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

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

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

743 次查看
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.??

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

626 次查看
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 项奖励
回复