UART App 4.0.1 in half duplex configuration transmit finished interrupt

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User10215
Level 4
Level 4
First like received
Hi,

I'm using the UART App of DAVE 4 in half duplex configuration with a XMC4500. The UART is connected to a RS485-Transceiver and the XMC4500 tells the transceiver via a GPIO if it should transmit or receive data. If I want to transmit data the GPIO will be set to low so the transceiver is in it's transmit state. Now I need to know the correct time to set the GPIO high again, which is when all bytes have been transmitted (including stop bits and possible parity bits). However, the "End of transmit callback" which can be configured in the UART-App doesn't give me the correct timing since it is called when the last byte of the transmit data has been transferred to the shift register. What I need is a callback-function that is called when the "Frame Finished Interrupt" occured. As far as I remember Dave 3 used that Interrupt for it's callback, so is it possible that this interrupt will be also available when DAVE 4 gets out of it's beta stage?

For now I configured the "Frame Finished Interrupt" manually (using XMCLib-functions) and an Interrupt Output Line not used by the DAVE-App. However, this is not a long-lasting solution since I will, at some point, use both channels of an USIC-module. All Interrupt-Output-Lines are used by the DAVE-App then.


Thanks,
Niclas
0 Likes
2 Replies
AngelB
Employee
Employee
Hello Niclas,

you are right the "End of transmit callback" is called after the data has been transfered to the Shfit Register.
What we recommend is to use the UART_ClearProtcolStatus() API to clear the flag and wait tilll the word is totally shifted and the transmit shift flag is again 1 by using the UART_GetProtocolStatus() API.

EndofTransmitCallBack()
{
UART_ClearProtcolStatus(&UART_0,XMC_UART_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION);
While(!(UART_GetProtocolStatus(&UART_0) &XMC_UART_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION) );
//User code
}


Anyway, the plan is to make the Interrupts also available externally in future Releases of the APP.

Best regards,
Angel
0 Likes
User10215
Level 4
Level 4
First like received
Hi Angel,

thanks for your answer. I'm happy to hear that the interrupt will be available in the future. For now I'll stick with a modified Dave-Code since waiting for nearly a whole byte to transmit in an Interrupt-routine is not an option for me.

Best regards,
Niclas
0 Likes