AnsweredAssumed Answered

UART configuration

Question asked by Ambarish Hundekar on Feb 5, 2018
Latest reply on Feb 7, 2018 by Diana Batrlova

Hi NXP Team,

 

I have tried example code of UART given by the NXP.

 

I am able to send the data from the controller to PC but not able to receive the data from PC(realTerm tool).

 

attached the example code .

 

char LPUART1_receive_char(void) { /* Function to Receive single Char */
char recieve;
while((LPUART1->STAT & LPUART_STAT_RDRF_MASK)>>LPUART_STAT_RDRF_SHIFT==0);
/* Wait for received buffer to be full */
recieve= LPUART1->DATA; /* Read received data*/
return recieve;
}

 

 

always while condition is failed and not able to update the receive data(RDRF bit is always 0).

 

Regards,

Ambarish

Attachments

Outcomes