金牌会员
- 积分
- 1243
- 金钱
- 1243
- 注册时间
- 2018-4-25
- 在线时间
- 185 小时
|
1金钱
为什么我串口给单片机发送字符串连接不起来,只能接收一个字符?file:///C:\Users\Administrator\Documents\Tencent Files\1120021691\Image\Group\Image3\47FCMS`4XV3{(MFN9324N{K.pngfile:///C:\Users\Administrator\Documents\Tencent Files\1120021691\Image\Group\Image3\47FCMS`4XV3{(MFN9324N{K.pngfile:///C:\Users\Administrator\Documents\Tencent Files\1120021691\Image\Group\Image3\47FCMS`4XV3{(MFN9324N{K.pngfile:///C:\Users\Administrator\Documents\Tencent Files\1120021691\Image\Group\Image3\47FCMS`4XV3{(MFN9324N{K.png
void SerialPort0_ISR(void) interrupt 4
{
char RX_DATA;
if (RI==1)
{
RX_DATA = SBUF;
Receive(RX_DATA);
clr_RI;
//SBUF = RX_DATA;
//while(!TI);
//TI = 0;
}
}
void Receive( char rxdata)
{
UART_BUFFER[u16CNT] = rxdata;
u16CNT++;
if(u16CNT==9)
{
//UART_BUFFER[u16CNT] = '\0';
Send_String_To_UART0(&UART_BUFFER[0],9);
u16CNT = 0;
riflag = 1;
}
else
{
riflag = 0;
}
}
|
|