uart receiving problem?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
技术社区计划将于12月21日至1月5日期间进行升级,升级期间暂时无法发布新问题。

uart receiving problem?

2,097 次查看
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 回复

2,019 次查看
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