cancel
Showing results for 
Search instead for 
Did you mean: 

USART1: is it busy receiving?

christophkeiner9
Associate III

I use the USART1 on a STM32F103RB in half duplex RS485 configuration.
My question is: how can i be shure, that the bus is idle?

OK, i can see RXNE if a complete Byte was received, but if the USART is just receiving the bits and it has not reached the stop bit, i can't find a "busy" Flag or similar.

But shurely i don't want to start sending in this case.
Actually the only way i see is to use the EXTI interrupt line for that.
Has anybody a hint for this issue?

Thank You!

1 ACCEPTED SOLUTION

Accepted Solutions

Just FYI, newer STM32 (starting with 'F0/'F3) UARTs do have a BUSY flag, indicating ongoing Rx.

But even then, it is set only after start bit is detected successfully. As Clive said above, you should design the higher-level protocol so that this simply does not happen thus is not an issue.

JW

View solution in original post

3 REPLIES 3

>>My question is: how can I be sure, that the bus is idle?

Use a protocol that provides, packets, sizes, and expectations.

Waiting for something to "stop sending" seems prone to all kinds of issues and misinterpretations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Just FYI, newer STM32 (starting with 'F0/'F3) UARTs do have a BUSY flag, indicating ongoing Rx.

But even then, it is set only after start bit is detected successfully. As Clive said above, you should design the higher-level protocol so that this simply does not happen thus is not an issue.

JW

Thank you for your Reply.

I use Modbus RTU, but i usually like to check things that can go wrong as far as i can.