I bought a LIN bus module from CopperHill Technologies. The MFG is SKPang
I'm not able to find a wiring diagram from either source, and their tech support has no idea. The best I've found after days of searching is the distributor website which is
essentially a photo, with no instructions.
This site has several LIN bus threads, but the code is not the same, and the application
does not appear to match my wiring needs?
Agreed, no need to duplicate code but since there are multiple .ino files in that GitHub repo, a link to the code base you’re using would be a good starting point.
How did you arrive at that pinout? Looks to me that RX should be AI1 (PC1) and TX on AI2 (PC2). CS should be connected to +5V at all times.
I see that CS is tied to 5V in the CopperHill photo using the Green jumper. I'm under
the impression by reading the ATMega Documentation that 3,3V will give a logic High state for the UNO (> 3.0 VDC)?
The LIN bus documents state that CS is only required for transmitting on the bus, so
I didn't think CS being high, or low would effect the receiving ability? In any case, I'll
connect to +5 as per your suggestion.
How did you arrive at that pinout?
I went by the photo, considering parallax...and I thought it was fairly close?
Looks to me that RX should be AI1 (PC1) and TX on AI2 (PC2)
RX should be AI1(PC1) = ADC1, 24/AD1 (Analog input A1?)
TX should be AI2(PC2) = ADC2, 25/AD2 (Analog input A2?)
Now that I’m looking at the analyzer code and prints, those pins do not appear to be correct. I’m not sure what I was looking at last night to come up with the A1/2 pins.
What i see in the analyzer schematic is that LIN_RX is on PORTD2 (Arduino pin 2) and LIN_TX is on PORTC2 (Arduino A2).
What I cannot find is where those pin assignments are actually made in the code. Greping the code base only turns up two PORT assignments, for the two led’s.
Since the analyzer was build using a different LIN interface chip, I’m not sure trying to use that code is the correct way forward. Have you researched the actual ic used? In general, if LIN uses standard asynchronous baud rates and word formats (on which I’m not knowledgeable) I think you’d be better served to use a board with multiple serial devices like the mega1280 or 2560. Messing about with software serial can work but it’s problematic once you’re into higher baud rates and other activities that can mess with the receiver timing.
That's my goal (to integrate with the 2560) after I get things sorted with the UNO.
I'll see what can be done with changing CS to 5 Volt, and moving to Analog A2.
If that doesn't produce results within a short period, I'll move to the MEGA and use
the additional TX/RX inputs.