MK26FN2M0VLQ18 Uart2 IDLE interrupt

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

MK26FN2M0VLQ18 Uart2 IDLE interrupt

跳至解决方案
1,371 次查看
张华荣
Contributor II

Hi,

I want to generate the  uart2 Idle Line Interrupt,the source code is below:

OSA_InstallIntHandler(UART2_RX_TX_IRQn, &Uart2_Idle_ISR);

UART2_C1 |= 0x04;        // Idle count start from the stop bit of previous byte

UART_HAL_SetIntMode(UART2_BASE_PTR,kUartIntIdleLine,true);   // enable the IDLE line interrupt

INT_SYS_EnableIRQ(UART2_RX_TX_IRQn);

UART_HAL_EnableTransmitter(base);
UART_HAL_EnableReceiver(base);

when i send the data to uart2 from the PC,the interrupt cannot generate.

but when i set the RXEDGIE enbale,the interrupt can generate.

UART_BWR_BDH_RXEDGIE(UART2_BASE_PTR,1);   // enable the RxD Input Active Edge Interrupt

How can i do it?

0 项奖励
回复
1 解答
1,204 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 张华荣,

     Please check this information:

pastedImage_1.png

Did you meet the IDLE set condition?

You can check it on your receiver wire and your UART2 configuration, just when the IDLE is set, the interrupt can happen.

RXEDGIE is not the IDLE interrupt, it is caused by the RxD Input Active Edge Interrupt.

Please make sure the IDLE set condition is meet on your side, if the condition is meet, the IDLE will be set, and the IDLE interrupt will be happen.

Please also take care these points:

Idle detection is not supported when7816Eis set/enabled and hence this flag is ignored.
NOTE: When RWU is set and WAKE is cleared, an idle line condition sets the IDLE flag if RWUID is set,
else the IDLE flag does not become set.

Wish it helps you!


Have a great day,
Kerry

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,205 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi 张华荣,

     Please check this information:

pastedImage_1.png

Did you meet the IDLE set condition?

You can check it on your receiver wire and your UART2 configuration, just when the IDLE is set, the interrupt can happen.

RXEDGIE is not the IDLE interrupt, it is caused by the RxD Input Active Edge Interrupt.

Please make sure the IDLE set condition is meet on your side, if the condition is meet, the IDLE will be set, and the IDLE interrupt will be happen.

Please also take care these points:

Idle detection is not supported when7816Eis set/enabled and hence this flag is ignored.
NOTE: When RWU is set and WAKE is cleared, an idle line condition sets the IDLE flag if RWUID is set,
else the IDLE flag does not become set.

Wish it helps you!


Have a great day,
Kerry

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

0 项奖励
回复
1,204 次查看
张华荣
Contributor II

Hi,

Thanks very much.

The problem is resolved.Because the OR Flag is set,the idle flag can not set.OR.png

when test the idle interrupt,i close the Receiver Full Interrupt,and do not read the UARTx_D register,

so the OR flag is set.

0 项奖励
回复