中级会员
 
- 积分
- 236
- 金钱
- 236
- 注册时间
- 2016-1-21
- 在线时间
- 21 小时
|
本帖最后由 土立方 于 2016-4-22 09:24 编辑
用的单片机型号是90C516RD+
我先定义了一个513字节的数组unsigned char xdata buf[513];
初始化全为a,最后一个字节为0
memset(buf, 'a', 512);
buf[512] = 0;
然后我把它发送到电脑串口上
uart_send_str(buf);
相关的函数:
void uart_send_byte(unsigned char byte)
{
SBUF = byte;
while(!TI);
TI = 0;
}
void uart_send_str(unsigned char *s)
{
while(*s)
{
uart_send_byte(*s);
s++;
}
}
但是串口软件里面收到了512个0x61之后一直收到0xFF不停了,是哪里的问题?
|
|