we are using k60fx512. we are using the following intialization steps to enable the uart2 interuppt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

we are using k60fx512. we are using the following intialization steps to enable the uart2 interuppt

383 Views
anjum
Contributor II

the intialisation steps are:

uart_init (UART2_BASE_PTR,120000, 921600);

UART_C2_REG(UART2_BASE_PTR) |= UART_C2_RIE_MASK;

NVICICPR1 |= 1 << (49%32);

  NVICISER1 |= 1 << (49%32);

then isr for uart2:

void UART2_handler(void)

{

    unsigned char data1;

  if(!(UART_S1_REG(UART2_BASE_PTR) & UART_S1_RDRF_MASK))

    data1=UART_D_REG(UART2_BASE_PTR);

}

while receiving the data, it is entering inside the ISR. But it is never coming out of the isr.??

Labels (1)
0 Kudos
1 Reply

266 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

I would recommend to refer thread UART Driver with Interrupt  about UART interrupt application.

For you mentioned, it could not coming out from UART2 ISR routine, it need to check the UART2_S1 register if there with some other flags also be set.

I think you could debug the code and check the UART2_S1 register value.

Wish it helps.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos