登录
首页 » Others » UART_TXaRX

UART_TXaRX

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

代码说明:

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

文件列表:

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

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

发表评论

0 个回复

  • 3
    说明:  系统由单片机、显示器等部分组成,利用显示器来显示密码锁输入的相关信息,系统上电时内部默认三组数字密码(4位或4位以上);密码输入正确则打开密码锁(The system is made up of single-chip microcomputer, display and other parts. It displays relevant information of the password lock using the display. When the system is powered up, it acquiers three sets of digital Ciphers (4 bits or more than 4 bits). If the password is entered correctly, it will open the password lock.)
    2018-03-04 22:29:25下载
    积分:1
  • AD9851驱动程序 STM32-AD9851-driver
    AD9851驱动程序,采用串行写入方式,STM32写入频率控制字。(AD9851 driver, using serial write mode, STM32 write frequency control word.)
    2020-07-07 18:38:57下载
    积分:1
  • SJ1
    8055 数字时钟 简单功能 8086 汇编 (8055 features a simple digital clock)
    2009-05-16 00:12:11下载
    积分:1
  • STM32F407示波器
    通过使用STM32F407内部的ADC资源,开发出的一款简易版示波器,能够识别并画出波形,显示频率、幅值等要素,可以调Time ,VPP level等。代码简单易读。(By using ADC resources in STM32F407, a simple version oscilloscope is developed, which can recognize and draw waveforms, display frequency, amplitude and other elements, and adjust time, VPP level, etc. The code is easy to read.)
    2020-06-21 11:20:02下载
    积分:1
  • STM32-USB-BULK
    STM32F10X USB批量传输功能,并有上位机测试程序,上位机使用libusb + vc6.0(STM32F10X USB bulk transmission,and pc test program(use libusb and vc 6.0))
    2016-08-05 10:54:50下载
    积分:1
  • 51chuankoutiaoshi
    51单片机串口调试程序一列,希望对大家有用(51 Single-chip serial debugging a program, in the hope that useful to everybody)
    2008-05-20 12:10:22下载
    积分:1
  • chirp
    啁啾脉冲的源代码,啁啾度可调,是一个很好的源程序。(Chirped pulse of the source code, adjustable chirp degrees, is a good source.)
    2007-10-22 20:15:35下载
    积分:1
  • route
    无线传感器网络分簇路由算法相关的MATLAB代码,比较齐全。(Clustering routing algorithm for wireless sensor networks MATLAB related code, more complete.)
    2014-10-24 17:37:59下载
    积分:1
  • temperature-display
    51单片机温度采集与显示设计 - 通过DS18B20温度传感器获取温度,并通过数码管显示,并实现了温度可手动校准(51 single-chip temperature acquisition and display design- through DS18B20 temperature sensor for temperature, and through the digital display, and achieve a temperature can be manually calibrated)
    2013-10-13 16:26:42下载
    积分:1
  • DS18B20数字温度传感器模块
    单片机向串口调试助手发送温度值,DQ接口连接单片机的PA0,开发环境为Keil(Single Chip Microcomputer sends temperature value to Serial debugging Assistant.DQ interface to PA0 interface of single chip microcomputer.The development environment is Keil.)
    2018-08-18 17:12:50下载
    积分:1
  • 696518资源总数
  • 105885会员总数
  • 31今日下载