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

776件の閲覧回数
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 返信

659件の閲覧回数
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 件の賞賛
返信