登录
首页 » Others » UART_TXaRX

UART_TXaRX

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

代码说明:

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

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

发表评论

0 个回复

  • xhppfx
    以CVI为平台,建立信号的频谱分析仪,有两个图形控件,用来分别显示采集波形和频谱分析图形;两个数字控件,一个输入采样速率,一个显示信号频率;三个命令控件,一个启动数据采集命令程序,一个开始频谱分析,一个退出程序。(CVI is the signal spectrum analyzer, two graphical controls, used to display the waveform acquisition and spectrum analysis graphics two digital controls, an input sampling rate, a display signal frequency three commands control, astart the data acquisition command procedure, a spectral analysis, an exit program.)
    2012-04-26 16:48:59下载
    积分:1
  • mp3_atmel
    atmel单片机开发的mp3,里面有原理图及源代码.(atmel microcontroller development of the mp3, with a diagram and the source code.)
    2007-03-15 09:41:32下载
    积分:1
  • STM_VCP_Driver
    STM32 USB转串口驱动,含X86和X64,版本号1.5(STM32 USB to serial port driver, including X86 and X64, version 1.5)
    2018-07-22 15:51:04下载
    积分:1
  • STM32中文参考手册_V10
    说明:  包括多种开发板的白皮书,基础学习单片机知识(Intelligent tracking car)
    2020-06-18 13:00:01下载
    积分:1
  • DS1302
    说明:  实时时钟芯片DS1302的C51编程,数据的读取及设置。(The C51 real-time clock chip DS1302 programming, data reading and settings.)
    2011-02-28 21:16:39下载
    积分:1
  • DS1302时钟LCD1602显示(可以按键设置时钟)
    DS1302时钟LCD1602显示(可以按键设置时钟)(DS1302 clock LCD1602 display (you can set the clock button))
    2018-10-18 09:50:39下载
    积分:1
  • iLI9486
    ILI9486显示屏幕的驱动程序,C语言描述(ILI9486 frequency display driver)
    2020-08-13 00:28:26下载
    积分:1
  • KS0108_SYB128642
    syb12864驱动程序,程序为三元晶公司的无字库12864液晶驱动(syb12864Drivers,Program s ternary crystal LCD driver 12864 free fonts)
    2015-03-31 10:19:44下载
    积分:1
  • chart
    自己写的一个示波器控件,支持多波形,鼠标左键拖动缩放,范围自动变化等各项功能。(Own wrote an oscilloscope controls, support for multiple waveforms, the left mouse button drag zoom, automatic range changes and other functions.)
    2021-01-29 11:58:39下载
    积分:1
  • jiaotongdeng
    单片机模拟交通灯显示。其中,红灯与绿灯显示时间均为50s,中间的黄灯显示时间为15s。绿灯用八位发光二极管流动闪烁作代表;红灯用八位发光二极管全亮作代表;黄灯用八位发光二极管全亮全灭闪烁作代表。刚开始显示的为绿灯。(SCM simulated traffic light display. Among them, the red and green display times are 50s, in the middle of the yellow light is displayed for 15s. Green with eight light-emitting diode flashes as a representative flow red with eight full brightness light-emitting diodes as a representative yellow with eight light-emitting diodes for all light flashes Quanmie representatives. Just beginning to show as green. Display order: green- yellow- red- yellow- green- yellow- red- ..................)
    2014-05-29 17:15:44下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载