cancel
Showing results for 
Search instead for 
Did you mean: 

USART - Sending break characters on RS485 bus

michel239955_stm1
Associate
Posted on January 30, 2013 at 20:58

Hi all,

I can't figure out whether the TC flag is set at the end of a break character or not.

I use a GPIO to enable TX mode on the RS485 transceiver at the end of any transmission I normally monitor the TC flag and disable 485 TX mode when TC=1.

Sending a break character is not like sending data and there is nothing in the manual that explains if the TC is set at the end of a break character or not.

Anyone knows?

The ref.manual says:

Break characters

Setting the SBK bit transmits a break character. The break frame length depends on the M

bit (see Figure 223). If the SBK bit is set to �1 a break character is sent on the TX line after completing the current character transmission. This bit is reset by hardware when the break character is completed.

#uart-break #stm32-usart-break-character
3 REPLIES 3
Posted on January 30, 2013 at 23:13

I don't know, but a quick way to check yourself would be to forward the TC status to a GPIO in a tight foreground loop.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
michel239955_stm1
Associate
Posted on February 01, 2013 at 10:42

I checked on the logic analyzer. TC is not changed when sending a break character. Also, it's not possible to send long breaks ( i need 5 ms) so USART has to be deinitialised and break signal has to be sent using GPIO, it's painful but I'll get over it 🙂

Andrew Neil
Chief II
Posted on February 01, 2013 at 14:09

''it's not possible to send long breaks ( i need 5 ms) so USART has to be deinitialised and break signal has to be sent using GPIO''

 

 

Instead of completely ''deinitialising'' the UART, could you just reduce the baud rate and/or increase the clock divider to ''stretch'' the break...?