cancel
Showing results for 
Search instead for 
Did you mean: 

USART receiver timeout after a (LIN) BREAK?

Pieter Conradie
Associate III

Hi there,

I am using the full featured USART in LIN mode. The start of a LIN packet is signaled by a BREAK condition. The next byte is the SYNC (0x55). After the BREAK is detected, I enable the receiver timeout so that if the SYNC (0x55) is not received then the LIN reception must restart. This does not happen, i.e. after a BREAK with no other bytes, it does not generate a receive timeout.

According to the RM, the receiver timeout starts after a valid STOP. So is the end of a BREAK not considered a valid STOP and therefore the receive timeout does not start?

Thanks in advance,

Pieter

https://piconomix.com

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Pavel,

Thanks for the suggestion :)

I tried it but unfortunately it appears that IDLE does not work correctly if LIN mode (to detect a LIN break) is enabled. The IDLE flag is set too soon after the LBD flag. It does not wait long enough for the SYNC (0x55) byte.

The fundamental issue appears to be that the LIN Break condition is not checked when AUTOBAUD is enabled for the SYNC (0x55) byte. If it did detect the LIN break condition early enough then I could have restarted the AUTOBAUD sequence.

So my only solution appears to be using a timer but I don't have enough to go around.

Best regards,

Pieter

 

View solution in original post

2 REPLIES 2
Pavel A.
Super User

Instead of RTO, try IDLE detection. A stop bit follows a data frame, so if no data was received, RTO won't occur.

 

Hi Pavel,

Thanks for the suggestion :)

I tried it but unfortunately it appears that IDLE does not work correctly if LIN mode (to detect a LIN break) is enabled. The IDLE flag is set too soon after the LBD flag. It does not wait long enough for the SYNC (0x55) byte.

The fundamental issue appears to be that the LIN Break condition is not checked when AUTOBAUD is enabled for the SYNC (0x55) byte. If it did detect the LIN break condition early enough then I could have restarted the AUTOBAUD sequence.

So my only solution appears to be using a timer but I don't have enough to go around.

Best regards,

Pieter