uart receiving problem?

cancel
Showing results for 
Search instead for 
Did you mean: 

uart receiving problem?

149 Views
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 

Labels (1)
0 Kudos
1 Reply

71 Views
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