登录
首页 » Others » UART_TXaRX

UART_TXaRX

于 2013-10-20 发布 文件大小:2KB
0 143
下载积分: 1 下载次数: 13

代码说明:

  单片机接收从电脑串口发送出来的一串字符串,却只能接收到第一个字符,其他的都丢失了或者是接收到的是乱码,却不知道是什么原因。其实,那是因为,虽然单片机的是全双工串口,但是串口的缓冲区(SBUF)却一般只有一个字节,即1Byte,远没有像电脑串口的缓冲区以KB计算那么大,并且,单片机的处理速度是很有限的,试想一下,假如要求一串字符串以9600bps的速率,一个起始位,一个结束位,无校正位,相当于960Byte/s传输到单片机,单片机要是能够全部接收的话,那么单片机接收和处理一个字节的时间仅为约1ms的时间。这说明了,如果单片机的处理速度不够快,还没有将接收到的上一帧数据及时转送到单片机的RAM中,而电脑串口又传输过来一帧新的数据,这帧新的数据就会把单片机的串口输入缓冲区的SBUF给刷新掉,或者说单片机压根就没有接收到新的一帧数据,造成了数据的丢失或接收到乱码。 如果需要单片机接收到从串口发送过来的一段很长的字符串,并且能够都正常接收和显示(TX&RX FUNCATION between PC and MCU)

文件列表:

单片机实现接收从电脑发送过来的字符串的方法.txt,2804,2013-03-24

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Calcul
    汇编语言的计算器的代码,是加减乘除,带小数点的。大家可以用(Calculator assembly language code is Math, with a decimal point. We can)
    2010-07-16 14:52:22下载
    积分:1
  • 看门狗wdt
    NRF82532看门狗程序,能很好的保证单片机系统正常工作,性能十分可靠。(The NRF82532 watchdog program can ensure the normal operation of the single chip microcomputer system and its performance is very reliable.)
    2021-02-20 15:59:43下载
    积分:1
  • C8051F320SPI
    双C8051F320主从机通讯程序,可单独使用,也可双机通讯,四线协议(Dual C8051F320 master and slave communication program, can be used alone, can also be dual-machine communication, four-wire protocol)
    2013-07-28 10:55:44下载
    积分:1
  • control_no_out_.ino
    利用温度控制制冷设备运行,实现空调扇自动制冷(Using temperature control refrigeration equipment to realize automatic refrigeration of air conditioning fan)
    2020-06-20 07:40:01下载
    积分:1
  • jiaotongdeng
    交通灯控制程序 使用51单片机汇编语言编写
    2011-12-02 12:07:26下载
    积分:1
  • C8051F120
    C8051F120,实现ADC0采样芯片温度,通过串口0发送到PC机,实时监控温度的变化(C8051F120, ADC0 sampling chip temperature to achieve, through the serial port 0 is sent to the PC, real-time monitoring of temperature change)
    2013-07-05 20:19:10下载
    积分:1
  • islanding-detection-technology
    基于电压正反馈的逆变器并网孤岛检测技术,simulink仿真有较好的介绍,是学习孤岛检测的好资料。(Based on the positive feedback voltage inverter grid islanding detection technology, for a better introduction to simulink simulation.Islanding detection is learning good information.)
    2016-05-16 23:20:04下载
    积分:1
  • BeepLight
    说明:  一个很好用的直流蜂鸣器单片机前台控制程序(a good use of DC buzzer SCM prospects control procedures)
    2006-01-25 10:29:57下载
    积分:1
  • ADC测试
    ADC 测试包含ADC+12864+UART+PID(ADC test includes ADC+12864+UART+PID)
    2020-06-22 17:20:02下载
    积分:1
  • anjian
    stm8系列单片机,控制八位数码管按键计数(stm8 series microcontrollers, digital control buttons eight counts)
    2015-03-29 17:12:04下载
    积分:1
  • 696518资源总数
  • 105549会员总数
  • 12今日下载