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?
Solved! Go to Solution.
Hi 张华荣,
Please check this information:
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!
-----------------------------------------------------------------------------------------------------------------------
Hi 张华荣,
Please check this information:
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!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Thanks very much.
The problem is resolved.Because the OR Flag is set,the idle flag can not set.
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.