Macchina 1.1 offers the option of connecting the ISO9141/LIN circuit directly to the Hardware UART of the ATMEGA2560 chip (or optionally other pins in the case where software serial is needed). However, due to the characteristics of the circuit and the fact that the ATMEGA2560 does not offer a straight-forward method of inverting the serial, we decided the best route would be to modify the circuit to produce the correct levels.
The modification is shown in this schematic for the L-Line Pin (K-Line is the same). We added a transistor with pull-up to the front end of the existing transistor circuit, and swap the inputs to the comparator. We also removed R56.
The actual modifications look like this. (before epoxy is added on top for durability)
Here we see the result. Channel 2 shows the output of the UART TX pin (0-5V logic) and Channel 1 shows the output of the K-line (0-12V logic).
Now any code written can be more straight-forward and we won't need to worry about inversion.