Hi,
I've enabled interrupt for Tx_Ready in Uart0. As soon as I enable interrupt, code jump to the interrupt callback, I check status flag and exit from the callback. Problem is that code is going to interrupt callback continuosly. Is there any way to clear TXRDY flag and avoid continous interrupt callback ?
The idea is to send a byte in tx uart and then get interrupt one time when byte is sent. What am I doing wrong ?
Thanks,
Asier.
Solved! Go to Solution.
Hello
I apologize for the delayed answer, I suggest you use the function USART_TransferSendNonBlocking, This function sends data using an interrupt method. This is a non-blocking function, which returns directly without waiting for all data to be written to the TX register. When all data is written to the TX register in the IRQ handler, the USART driver calls the callback function and passes the ref kStatus_USART_TxIdle as status parameter.
Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar
Hello asier
The TXRDY flag is cleared when data is written to TXDAT. I suggest you refer to the usart interrupt example located at the SDK of your device.
Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar
Hello Omar,
It is clear that TXRDY flag is set when TXDAT is sent and reset when TXDAT is written.
My problem occurs when TXDAT is sent and hence TXRDY is set. In that case the interrupt callback does not happens only once but it interrups the code continously. How could manage this situation to attend interrupt once and then clear interrupt condition ?
Thanks in advance,
Asier.
Hello
I apologize for the delayed answer, I suggest you use the function USART_TransferSendNonBlocking, This function sends data using an interrupt method. This is a non-blocking function, which returns directly without waiting for all data to be written to the TX register. When all data is written to the TX register in the IRQ handler, the USART driver calls the callback function and passes the ref kStatus_USART_TxIdle as status parameter.
Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar