cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware implementation of LIN bus using USART1 on STM32L562 MCU

gdecker1
Visitor

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?

2 REPLIES 2
AScha.3
Chief III

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".

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.