uart receiving problem?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

uart receiving problem?

640 次查看
aravindpb5009
Contributor III

hai

      iam using lpc824  we are using two uarts when i try to read my uart1 in receiving end my code  stopped in one area 

i don't know why it was happening let me know the solution in below i attached my code where it was stopped 

please find my attachment 

标签 (1)
0 项奖励
1 回复

562 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Aravind,

Regarding your issue that the LPC824 stopped at line:

while (!(base->STAT & USART_STAT_RxRDY_MASK)) {}

The line always waits for the bit setting of USART_STAT_RxRDY_MASK in staus register, when the bit is NOT setting which means that the uart does not receive any data, the lpc824 will stick to the line and wait for bit setting.

so i do not suggest you use the USART_ReadBlocking1() function, which uses polling mode.  I suggest you use interrupt mode.

Hope it can help you

BR

Xiangjun rong