Communicating between a mega and an uno using LIN BUS

I'm having serious trouble finding documentation on this and would really like some help. I need to communicate from a mega to multiple uno's using LIN BUS. It seems the major problem is sending the 13 bit sync break. I'm new to this and don't know exactly how to make this happen. Hopefully someone has some insight or a direction to send me in. Also I'm using the mcp2021A as the transceiver on both ends. Thanks in advance, Adam.

I'll been trying to get a solution to this very problem for a while now. even posted here for help! Tough luck!

If anybody does have a solution to reliably detect the sync break that would be of much help!

only solution I found for now is to instead use 2 ATtiny167 which actually has LIN UART capability

Fantastic library for LIN BUS. I was able to get a Mega and two LIN LED’s to work with a UNO monitoring the bus. I’m still working on the UNO sniffer sketch.

There was another post LIN Bus network with a MCP2003 - Wiring of code problem? - Project Guidance - Arduino Forum

DABEAST provided a master/slave code pair and a layout using two transceiver IC’s to create the physical layer. I have verified this setup to work.

I first used DABEAST’s code to get the physical layer running, then substituted gandrewstone’s code for the master code to work out the frame for the LIN enabled LED’s.

Also verified to work. A BIG TIP, when you start using gandrewstone’s library and sketch, you should load the library files (Lin.h, Lin.ccp and heapskew.h) into the sketch as files. You will need to read, search, find keywords, again and again until you understand HOW the library works.

This will take time, but you’ll gain some serious understanding how LIN works. Be glad it’s not CAN! Lol if you want to learn CAN, get https://www.amazon.com/Controller-Area-Network-Prototyping-Arduino/dp/1938581164 and https://www.amazon.com/Comprehensible-Guide-Controller-Area-Network/dp/0976511606/ref=asap_bc?ie=UTF8

I use both books every time I do anything with CAN. VOSS is the CAN Master!

This stuff is tough. I spent probably 50 hours over several weeks leveling myself up reading data sheets, the LIN spec, the library and lots of google docs.

I’m still working on the timing for the next steps to control vehicle motors. That’s the really hard stuff. It requires a carefully choreographed dance with two messages from the master and a reply from the slave, over and over until the position is located.

I’ve had great success controlling voltage feedback servos with the arduino mega and a multichannel h-bridge, but this is another animal entirely.

Hope this helps someone and saves hours of searching for information that just isn’t out there for the arduino.