Analysis of LIN protocol for automotive network

The LIN protocol is suitable for low-cost, short-distance, and low-speed network communications in automobiles. Its purpose is to transmit switch setting status and respond to switch changes. This article analyzes in detail the characteristics of the LIN bus protocol, the composition of the message protocol, error detection mechanism, etc., and introduces how to implement the LIN bus slave node based on the PICmicro device.

The LIN protocol is developed by the European Association of Vehicle Manufacturers for low-cost, short-distance, and low-speed network communications. Its purpose is to transmit the switch setting status and respond to switch changes. Therefore, communication events occur within 100 milliseconds, without Other car applications, such as engine management, are much faster. This protocol supports bidirectional communication on a single wire, using a low-cost microcontroller driven by an RC oscillator, which can save the cost of a crystal or ceramic oscillator. In addition, this agreement is actually a time and software cost in exchange for hardware cost savings. Each message of the LIN protocol contains data for automatic baud rate stepping. The maximum baud rate can be supported is 20k. At the same time, the low-power sleep mode can shut down the bus to avoid unnecessary power consumption. The bus can be powered by any node.

LIN bus characteristics

The LIN bus combines the characteristics of I2C and RS232: like the I2C bus, the LIN bus is pulled up to a high level through a resistor, and each node can pull the bus low through the open collector driver; like RS232, it starts through Bits and stop bits identify each byte, and each bit is transferred asynchronously on the clock.

Figure 1 shows a typical LIN protocol configuration. When any node pulls the bus low, the bus is at a low level, indicating that the bus enters the occupied state; when all nodes leave the bus floating, the bus is at the battery voltage (9-18V), which means that the bus is in Recessive state; in the idle state, the floating bus is pulled up to a high level through a resistor.

The bus operates from 9 to 18 volts, but all devices connected to the bus must be able to withstand 40V. In general, the microcontroller is isolated from the bus by a line driver or receiver. The bus is terminated to Vbat at each node, the master node is terminated with a 1kΩ resistor and the slave node is terminated with a 20kΩ to 47kΩ resistor. The maximum length of the bus is 40 meters.

Each byte transmitted on the bus is framed with start and stop bits. The state of the start bit is opposite to the idle state (that is, 0), while the stop bit is the same as the idle state. In each byte, the least significant bit is transmitted first.

Message protocol

The master node controls the bus by polling each slave node and sharing the slave node's data with the rest of the bus. The slave node transmits data only when it receives a command from the master node, so that bidirectional transmission can be performed without further arbitration. Message transmission starts with a synchronization interrupt issued by the master node, followed by the synchronization field and message field of the message. The synchronization field transmitted at the beginning of each message also sets the clock of the entire bus, and each slave node uses this byte to adjust its baud rate.

The synchronous interruption puts the bus into an occupied state. The hold time of this state is the transmission time of 13-bit data, followed by a stop bit (non-occupied state), which informs the slave node that there will be a message transmission. The maximum clock drift of the master node and the slave node is allowed at 15%, so the synchronization interrupt received from the slave node may only have a transmission time of 11 bits or up to 15 data bits.

The second byte of each message is the mark byte, used to inform the bus what data is transmitted after this byte and which node should reply, and the length of the reply (the mark field is shown in Figure 2). Only one slave node responds to a command, and the slave node sends data only under the instruction of the master node. As long as the data appears on the bus, every node can receive it. Therefore, there is no need for the master node to specifically control the communication between the slave nodes.

Because the cheap RC oscillator is used in the design, the slave node must detect the baud rate of the master node and adjust its current baud rate during each transmission. Therefore, each communication starts with a sync byte consisting of alternating "0" and "1". The identification field immediately follows the synchronization field, which tells what is transmitted behind the bus. The identification field is divided into three sub-fields, the lowest 4 bits (0-3 bits) address the device on the bus, the middle two bits (4-5 bits) are the length of the message transmitted later, and the highest two bits (6-7) ) Is used as a parity bit.

In addition to the sleep command, the LIN protocol does not define the content of each message. Other commands are defined by specific applications.

Barbecue machine is a barbecue food machinery and equipment, its main function is to do all kinds of barbecue products. Mainly used for barbecue shops, mobile barbecue and so on.
The use of rotary grill grill grilled after a piece of barbecue from the barbecue, accompanied by salad dishes, ingredients into a special made in the bread. Visibility, on-site production, and popular in Europe and the United States. Become one of the mainstream street food fast food.
1 power: the range of 800-1600W, according to the actual situation. 2 grilled food: steak, shrimp, vegetables, ham and so on. 3 functions: 3.1 baking pan with a raised stripes, relying on the protruding stripes to bake the food, there will be drainage structure, slope or drain hole. 3.2 baking time is about 3-5 minutes. 3.3 thermostat is adjustable, according to the different food or personal taste to adjust the different. 3.4 heat pipe: According to the different grades of products, choose different specifications of the heating pipe. Generally fixed in the back of the heating plate, using high temperature stainless steel tube or nickel-chromium alloy tube INCO840, the latter cost higher. 3.5 generally do not need PCB control, FireWire to increase the temperature insurance. 3.6 within the wiring: the general use of hidden lines, hidden in the activities of the hinge of the shaft. 3.7 Other: need to take oil device, a separate configuration or drawer type oil box. 3.8 turn on the power, the red power light, the machine warm, until the green light into the food, wait 3 to 5 minutes.


Electric BBQ Grill

Electric BBQ Grill,Smokeless BBQ Grill,Electric Chicken Grill,Vertical Electric BBQ Grill

Ningbo APG Machine(appliance)Co.,Ltd , http://www.apgelectrical.com