On-board anti-theft alarm system LIN bus design

With the rapid development of the automotive industry, there are more and more electronic control units on the body. Traditional body harnesses not only increase manufacturing costs, but also reduce system reliability and maintainability. As a result, the car body bus came into being. The use of a body bus design not only simplifies wiring, saves manufacturing costs, increases reliability, but also saves system maintenance costs. The on-vehicle anti-theft alarm module is a part of the body control unit (BCM), and since it itself does not require high real-time and rate of bus communication, it is connected to the low-speed bus LIN.

LIN bus

The LIN bus is mainly used for low-speed systems that do not require CAN performance, speed, and complexity. It is a low-cost serial communication network that uses a master node and several slave nodes, and is based on a common UART/SCI hardware interface. The maximum rate can reach 20kb/s.

The LIN bus transmits data through message frames. A complete message frame includes the header and information response. The header includes space, sync and marker fields. The spacing field consists of a continuous dominant level (0) at least 13 bits, which marks the start of a message frame during a data communication. Synchronization field contains clock synchronization information, the format of which is 0x55. After all slave nodes correctly receive the synchronization byte field, they accurately calculate the baud rate at which the host node will send data, and use this baud rate as the next step to send or Receive data baud rate setting value, thus realize the synchronization of slave node and host node clock. The marker field defines the content and length of the message. The message response is sent by the host node or slave node based on the flag field information, consisting of 2, 4, or 8 bytes of data and a 1-byte checksum. The verification is obtained by calculating all the bytes of data and is used for correctness of the verification data of the receiver.

Functional description

Vehicle anti-theft alarm module is a slave node of the body control module, the main function has the following 3 points: First, maintain communication with the BCM and report the status information of the anti-theft alarm module; the second is to receive the body control module command and drive the speaker to send out Alarm sound; third is to monitor whether the power line, ground line and LIN line between the connected anti-theft alarm module and the BCM are cut off and sound the alarm.

Implementation Option 1 Device Selection

The two main components of this system are LIN transceivers and microprocessors. Since the anti-theft alarm module is a battery-powered LIN node, it is necessary to consider low-power devices as much as possible when selecting the device. The LIN transceiver selects TJA1020, which is the physical media connection between the body controller and the anti-theft alarm module. It is also the interface between LIN master/slave protocol controller and LIN transmission media. The transmit data stream of the protocol controller input pin TXD is converted to a bus signal by the LIN transceiver, and the level inversion rate and the waveform are limited to reduce the electromagnetic radiation. The TJA1020's receiver detects the data stream on the LIN bus and passes it to the protocol controller via the RXD pin. The TJA1020 has a low-power management mode that consumes little current in sleep mode and reduces power consumption in error mode. Therefore, the TJA1020 is ideal for battery-operated LIN nodes such as burglar alarm modules. The system adopts STMicroelectronics 8-bit microprocessor STM8S105K4 as the master microcontroller. When running on the internal 128kHz clock, the static power consumption can be as low as 0.6mA. To meet the system's requirements for low power consumption, the LIN controller and battery level detection 10-bit ADC function are also available.

2 Information Frame Classification and System State Definition

The following defines the communication frame between the body control system and the anti-theft alarm module:

The wake-up command is used to wake the system from the sleep state to the unarmed state, and the sleep command is used to instruct the system to enter the sleep state. The contents of the command information frame include the defense, defense defense, alarm command, and the definition of the alarm status such as the alarm cycle, times, and other attributes.

3 basic block diagram

The basic block diagram of the system is shown in Figure 3. There are three interfaces for the system and the outside, the LIN line, the power line and the ground line. The on-board battery supplies power to the rechargeable battery, the TJA1020, and the MCU, respectively, and the role of the rechargeable battery is to supply the system with the power required for the alarm when the car battery is cut off.

In the initial situation, the TJA1020 is in the sleep state and the power to the MCU is cut off by the INH pin. At this time, the state of the system is defined as the sleep state. Connecting the car battery to the NJAK pin of the TJA1020 generates a level change, which triggers the TJA1020's external interrupt to wake up, and the TJA1020's Tx pin generates a strong pull-down. When a remote LIN frame wakes up the TJA1020, the Tx pin will generate a weak pull-down. After the TJA1020 wakes up, it turns on the power to the MCU through the INH pin to start the MCU and the system enters the unarmed state.

In the unarmed state, the MCU detects whether there is a car battery supply signal through the GPA port. If there is no power supply signal, the system will make the TJA1020 dormant by connecting the GPB pin of the NSLP after a certain period of time, and the TJA1020 will shut down through the INH pin. The MCU power supply, the system returns to sleep. When the car battery power supply is present, if the LIN sleep information frame is received, the system will also enter a sleep state.

When the system is in the non-sleep state, it can switch between the unarmed state, arming state and alarm state by receiving the BCM LIN command information frame. When the system is in the armed state and the alarm state, it will not enter the sleep state.

4 software process

The software of the system mainly includes the program that realizes the communication of the one-chip computer and LIN bus and the main program that the one-chip computer controls the anti-theft alarm horn. In order to ensure the real-time communication, the system uses a high priority interrupt to receive the signal on the LIN bus. In order to ensure the real-time performance of the system, in addition to some simple judgments and data reception during the interrupt processing, other parts are processed in the main program.

Once there is a valid dominant level on the bus, the controller immediately switches to the high-priority interrupt handling function. It first determines whether it is the interval field sent by the host node. If it is an interval field, it receives the synchronization field and the marker field, if not The field exits and waits for the next interruption. After receiving the correct identifier, if the identifier requires the system to send information, the system sends the data field and the checksum field, and after the completion of the sending, it waits to receive the next frame of data. If the identifier does not require the local machine to send data, the subsequent data field and checksum field are received. The main program then uses the identifier to determine whether the received data is valid for the local machine. If it is valid, it will be processed accordingly. After discarding, the process begins to wait for receiving the next frame of data.

LED Meteor Light

Led Meteor Light,Solar Meteor Shower Lights,Outdoor Decorative Meteor Lamp,Meteor Shower Lights Outdoor

Tianjin Jinji Optoelectronic Technology Co., Ltd. , https://www.tjjjgd.com