s this possible do LIN with NRF5340 (uart) hardware and software wise
s this possible do LIN with NRF5340 (uart) hardware and software wise
Hi Peter,
LIN bus isn't supported on the hardware on the nRF53. The software, I don't think we have anything.
There had been some questions in the past regarding this:
LIN-bus SW driver for nRF5x
Does the nRF51822 UART support LIN bus?
The NRF54 will support CAN bus, but I'm not so sure about LIN.
Lin bus uart requirements:
normal data bytes in lin are 8 bits with start and stop as normal uart comm.
The bitrate is max 20kbit.
The sync break field is the one that is not like normal uart comm.
its a SYNC BREAK of min 13 bit (low) followed by
a SYNC DELIMITER (High)
Is this not possible with nrf5340 uart ?
If not can it be done in another way with a timer/capture/compare or so?
Hi Peter,
I checked around internally but I don't think we have done any study on this. The UART driver in Zephyr is quite non-flexible that you can't really use a TIMER to access the pin when it's already assigned to UART peripheral.
It should be possible with big banging (use a timer as you said) for the SYNC BREAK but you will have to skip the default driver.
For specific timing like this it is possible to adjust the baud rate for the break-sync-identifier sequence (a pain with Zephyr) or better just don't use the Uart Tx function at all but instead use a PWM to drive the Uart Tx pin. Zephyr then just handles the Uart Rx pin at the specific baud rate. Both PWM and Uart use the same clock source, so crystal or not is not an issue as the slave adjusts its timing with the 0x55 sync field. The PWM Tx can be simply handled with nrfx. If needed I can share an example on the nRF52 series, not sure how easy it is to port to the nRF53.
As an aside, using PWM for the Tx makes differential signaling - which improves both range and noise-immunity - trivial. Using timers instead of Uart for the Rx allows differential Rx as well; the baud rate is usually low.
Thank you very much - for your valued input.
Yes i will be very interested for an example :-)
Thank you very much - for your valued input.
Yes i will be very interested for an example :-)