LPC802 TXRDY interrupt in UART0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC802 TXRDY interrupt in UART0

Jump to solution
882 Views
asier
Contributor III

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.

0 Kudos
1 Solution
819 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

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

View solution in original post

0 Kudos
3 Replies
860 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

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

0 Kudos
850 Views
asier
Contributor III

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.

0 Kudos
820 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

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

0 Kudos