Tag Archives: LIN bus

Video: Atmega328p MCU drives LINBUS signal injector

Zapta has created a LINBUS signal injector powered by Atmel’s Atmega328p microcontroller (MCU) to simulate an automatic “Sport Mode” button press in his vehicle.

Essentially, the Atmel-powered signal injector connects on a LIN Bus between the master and slave – observing and manipulating the data flowing on the line. 

The device is also equipped with a 115kbs serial interface for programming and logging bus activity on a standard computer, along with two LIN bus ports.

“One acts as a slave and should be connected to the LIN bus master and another that acts as a master and should be connected to the LIN bus slave,” Zapta explained in a recent blog post.

“The firmware includes a set of files named with the prefix custom_ that implements an application specific logic (simulating pressing the Sport Mode button of my car whenever the ignition is turned) and should be modified to match the target logic and behavior.”

In addition, the USB/Serial port is also compatible with the Arduino IDE (emulating an Atmel-powered Arduino Mini Pro) which can be used to edit/compile/download software updates.

“The serial output of the injector can be viewed directly with a terminal emulation software or using the provided script that adds timestamp,” Zapta added. 

”The injector provided sample application is configured for 19,200bps linbus that uses LIN V2 checksum but can be configured for busses with different speeds and checksum formula.”

Interested in learning more? You can check out the project’s official page and relevant files here.

Two-Wire LIN networking with Atmel (Part 1)

Current-gen vehicles are packed with hundreds of sensors used to monitor and display parameters such as temperature and pressure. In most instances, these sensors are remotely located within a vehicle far away from the host microcontroller (MCU) responsible for monitoring and processing the sensor data.

As such, these sensors typically do not directly connect to a network (such as CAN or LIN) due to the vehicle wiring overhead associated with connecting to the network. One such method for overcoming this wiring limitation is to convert the standard three-wire LIN network to a two-wire implementation where the LIN slave nodes harvest power directly from the LIN bus master communication wire, thereby eliminating the need for an individual battery supply wire to each slave node.


As Atmel engineering rep Darius Rydahl notes, a standard LIN bus consists of a master node and up to 15 slave nodes connected to a single network. The physical LIN network is a three-wire configuration consisting of power (vehicle battery), ground and the LIN bus communication line. A pull-up resistor, RLIN, typically 1kΩ, is required on the master’s LIN bus line. Under normal LIN bus operation, this pull-up resistor provides a voltage bias on the LIN bus line to the slave nodes on the LIN network. It does not power the LIN slave nodes, rather slave node power is derived from the battery input to the device, as shown in Figure 1.

“It is possible to use a non-standard LIN network architecture that simplifies to two wires. This approach relies on the harvesting of power by a connected slave node directly from the LIN bus line, thus eliminating the need for an independent slave node battery supply line (see figure 2),” Rydahl told Bits & Pieces. “With the battery supply line removed, all that is required to power the slave node is a blocking diode, VDS and buffer capacitor, CVS_S, large enough to sustain the slave node supply voltage during the transmission of LIN data packets, which periodically pulls the LIN signal to ground.”

In this series, Bits & Pieces will outline the implementation of this two-wire approach and identify the inherent system-level tradeoffs that must be considered to fully realize a functional two-wire LIN network.

According to Rydahl, the key to successfully implementing a two-wire LIN network centers around the power requirements of the connected slave node. Simply put, the slave node must be supplied with sufficient power to maintain communication at the minimum system operating voltage: typically 9V. If this condition cannot be met, it is unlikely that the two-wire LIN implementation will be a viable solution. Key parameters that affect the slave node’s performance in a two-wire implementation include LIN bus power supply, slave node current consumption, slave node buffer capacitance and LIN Bus data protocol.


“In terms of the LIN Bus power supply, the two-wire LIN network is limited by the power supplied from the master to the slave node over the LIN bus line. Meaning, the supply to the LIN slave in this configuration will be dictated by the LIN bus master pull-up resistor, RLIN (see figure 2),” Rydahl continued. “The slave node has a fixed minimum input voltage operating requirement of 5.5V (reference: the Atmel ATA6624 LIN transceiver). In order to meet this minimum operating voltage requirement, the load current drawn by the slave node must not cause the voltage drop across the LIN master pull-up resistor to increase to the point at which the input voltage to the slave node drops below 5.5V.”

As Rydahl points out, this is the minimum operating voltage threshold for slave node voltage regulator operation. Indeed, figure 3 shows the maximum load current available to the slave node at the minimum supply voltage of 5.5V at different LIN master pull-up resistances.


“The 1kΩ master pull-up resistor specified in the LIN standard specification cannot be used in the two-wire configuration. The resistor is too large and, as a result, is unable to properly source the slave node load,” he said. “As such, the pull-up resistor must be reduced in size to the smallest value possible without exceeding the current limitation specification of the LIN driver. In the case of the typical Atmel LIN transceiver, the ATA6624, the recommended minimum pullup resistor value is 220Ω. Resistances lower than this could result in excessive current flow through the LIN transceiver when the LIN bus is asserted low.”

Interested in learning more about Two-Wire LIN networking with Atmel? Be sure to check out part two of this series here.

Designing next-gen LIN systems with Atmel (Part 1)

The LIN (Local Interconnect Network) bus is a vehicle standard used within the latest automotive network architectures. The low-cost, single-wire serial communication system for distributed electronics in vehicles is highly suited to body control applications, including power windows, mirrors, smart wipers, door locks, seat/roof/lighting control, lamps and indicators, dashboard instruments, steering wheels, climate and air-conditioning (HVAC) systems, motors, switch panels and sensors.

“It is primarily used as a cost-effective sub-network of a CAN bus to integrate intelligent sensor devices or actuators where the LIN master node also acts as a gateway to connect the LIN bus with the corresponding CAN bus,” an Atmel engineering rep told Bits & Pieces. “Going hand in hand with rapid LIN market growth, the requirements for greater system efficiency and lower costs exerted on LIN products have continued to increase as well.”

To be sure, in-vehicle electronic systems are rapidly evolving and increasing in number, as are the number of switches for controlling various applications. In addition, applications with switches located far away from the control electronics and wires integrated within the wiring harness require high-voltage switches.


“And that is precisely why Atmel offers a next-generation ATA6641/42 System Basis Chip (SBC) with an eight-channel high-voltage switch interface, a LIN2.1 and SAEJ2602-2-compliant LIN transceiver and lowdrop voltage regulator,” the Atmel engineering rep continued. “The ATA6641/42 also boasts an adjustable window watchdog, facilitating the development of inexpensive, low-end, but also powerful slave and master nodes for LIN bus systems meeting the latest OEM requirements.”

Due to its optimized architecture, the ATA6641/42 provides a high degree of flexibility for deployment in various applications such as switch connection through the wiring harness, port/contact monitoring, contact cleaning, switches (towards GND or VBAT) and LED/relay/power transistor control.

Two versions of the System Basis Chip are currently available: the ATA6641 with a 3.3V voltage regulator and the ATA6642 with a 5V voltage regulator. The voltage regulator delivers up to 80mA load current. Sleep mode and active low-power mode guarantee very low current consumption even in the case of a floating bus line or a short circuit on the LIN bus to GND. To maintain very low current consumption in sleep mode, a special technique ensures that the circuit switches back to sleep mode after approximately 10ms if the bus line is floating or in case of a short circuit.


Improved slope control at the LIN driver ensures secure data communication of up to 20kBaud, while data rates of up to 250kBaud also enable high-speed data communication. Most features can be configured via the 16-bit SPI interface which streamlines and accelerates configuration of the slave/master LIN node for any given application.

Want to learn more about Atmel’s ATA6641/42? Be sure to check out part two and three of this series.