Am 13.08.2021 um 16:50 schrieb Simon Filgis:
Dear all,

has anybody implemented a LIN driver for SAME70 USART? The SAME70 USART
peripheral is capable of. A SW implementation (sllin.c - Pavel Pisa) would
also be interesting!

Would you extend sma_lowputc.c and sam_serial.c or would you grep USARTx in
a separate file?

Have a good Weekend,

Simon

Do you need LIN Master or LIN Slave?

LIN Master is easy. It's standard serial. The only nonstandard item is the BREAK signal generation. For this, just insert an AND Gate into the LIN TX UART line and keep the other input of the gate high. When you need to send a break, flush the buffers, set the other input of the gate to low, send two bytes (any value will do), wait until all bits are out, and set the gate input high. Then you've sent a break with 20 bit times, which is perfectly within the LIN specification, and without the need for a timer etc.

LIN slave is much more complex, especially if you want to do autobauding by measuring the SYNC byte after the break. You might end up with a custom serial driver then. If a fixed bitrate is enough the only problem is detecting the BREAK signal. A received break signal is basically a 0 byte with a framing error added. You only need to detect and clear the framing error.


Grüße

Frank-CHristian Krügel
  • Lin Simon Filgis

Reply via email to