Skip to main content
Explorer
May 16, 2025
Solved

USART receiver timeout after a (LIN) BREAK?

  • May 16, 2025
  • 1 reply
  • 447 views

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

    This topic has been closed for replies.
    Best answer by Pieter Conradie

    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

     

    1 reply

    Super User
    May 16, 2025

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

     

    Pieter ConradieAuthorAnswer
    Explorer
    May 19, 2025

    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