Skip to main content
Associate II
February 7, 2025
Question

Hardware implementation of LIN bus using USART1 on STM32L562 MCU

  • February 7, 2025
  • 1 reply
  • 1970 views

First time designing for ST microcontrollers, so I thank you for your patience.

 

I see by the datasheet that USART1 can be used as a LIN bus directly without a LIN bus transceiver, but I can't find any examples of how the hardware is implemented when that's set up. My assumption is that I need a 1kohm pull up to Vcc on the master and a weaker pull up on the slaves, connected to USART1_TX and leaving USART1_RX floating.

 

Is this accurate? If not, how do I use the LIN bus peripherals on the STM32L5 series?

1 reply

AScha.3
Super User
February 7, 2025

No.

LIN bus is typical on cars, 12V signal level.  And STM32 is 3v3 cpu - so you always need transceiver chip.

But you can use the uart, set in linbus-mode, to work with transceiver .

 

AScha3_0-1738947327299.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
gdecker1Author
Associate II
February 7, 2025

That doesn't make sense to me. LIN bus transceivers already work with standard UARTs. There's no reason for a special LIN bus setting in the microcontroller if you already have a UART.

The datasheet for the STM32L562xx part says: 

  • These interfaces provide asynchronous communication, IrDA SIR ENDEC support, multiprocessor communication mode, single-wire half-duplex communication mode and have LIN master/slave capability.

So they have the ability to be used as a half-duplex and as LIN master/slave. The question I have is how am I supposed to connect the half-duplex connection? Do I use just the TX line, or just the RX line, or do I short them together?

The question of the level shifter is one I'll have to investigate further, but one of the reasons I chose this chip for my design was because it supported LIN without a separate transceiver.

 

AScha.3
Super User
February 7, 2025

"sense to me" ...come on.

see ds, maximum voltage on pins:

AScha3_0-1738951447225.png

So if your LIN bus is working under 5V , its might work ok ; but never on 12V , without level shifter or transceiver.

"If you feel a post has answered your question, please click ""Accept as Solution""."