Design of an ARM-based automotive electronic control system unit
2026-04-06 06:20:12··#1
[Abstract] This paper introduces the hardware design and software analysis of the control module and CAN communication module of an automotive electronic control system unit, and provides an example with an ARM7 core. [Keywords] ARM, CAN, Car-Bus With the widespread application of electronic control units (ECUs) in automobiles, the degree of automotive electronics is increasing. While the addition of electronic control systems improves the power, economy, and comfort of automobiles, the resulting increased complexity of circuits inevitably leads to large and complex wiring and limited installation space. Simultaneously, to improve the information utilization rate of ECUs, a large amount of data information needs to be shared between different electronic units, and a large number of control signals in the automotive integrated control system also need to be exchanged in real time. Data communication between different functional electronic control system units is becoming increasingly important. Therefore, increasingly higher requirements are placed on the design of electronic control system units, requiring not only high communication speed, accuracy, and reliability of the communication network, but also high control effectiveness and small space requirements for the control module. This paper presents an electronic control system unit (CAN) for use in automotive network systems, based on CAN bus technology. 1. Design of the CAN Communication Module for the Electronic Control System Unit According to the CAN communication principle, the hardware of the CAN communication module of the electronic control system unit mainly consists of a CAN controller, a CAN driver, and a central microprocessor. Traditional CAN communication modules use a 51 series microcontroller as the central processor, an SJA1000 as the CAN controller, and a PCA82C250 as the CAN driver. This approach uses a large number of silicon chips, occupies a large space, has limited peripheral interface expansion, and consumes a lot of power. Therefore, in this design, we use the LPC2119 with an embedded CAN controller and a TJA1050 bus driver to construct the CAN communication module of the electronic control system unit. The hardware diagram of the CAN communication module is shown in Figure 1. The LPC2119 has an ARM7 core and features small package size, low power consumption, multiple 32-bit timers, four 10-bit ADCs, two CAN channels, and up to nine external interrupts. The TJA1050, manufactured by Philips, is a high-speed CAN bus driver designed to replace the PCA82C250. This device provides an interface between the CAN controller and the physical bus, as well as differential transmit and receive capabilities for the CAN bus. For end nodes consisting of "weak" terminals, the resistors and capacitors surrounding the TJA1050 can improve the system's EMC performance. Practical experience has shown that using the LPC2119 and TJA1050 to construct a CAN communication module offers strong peripheral expansion capabilities, a small footprint, and improved electromagnetic radiation (EME) and electromagnetic interference (EMI) performance. 2. Design of the Electronic Control System Unit Control Module Traditional "spider web" control modules are complex and difficult to maintain. In this design, we combine a power module, a human-machine communication module, and a status input module to construct the electronic control system unit control module, improving the overall system's visibility and effectiveness. The hardware diagram of the control module is shown in Figure 2. 2.1 Power Module Considering the large power load of automobiles and the limitations of the LPC2119's I/O port drivers, a power module is used in the system as a bridge between the central microprocessor and the power load. In the design, we use Motorola's MC33888 power device to control the high beam, low beam, reversing lights, and brake lights. The MC33888 integrates four high-side lamp drivers and eight relay or LED drivers, forming a controllable network with advantages such as on-board diagnostics, error reporting capabilities with microcontroller communication, and fault softening. Considering the relatively high power of the interior lights and walkway lights, we use the MC33487 power device for control. The MC33487 integrates two 20 milliohm high-side drivers with current sensing, providing a 4.5A current output. Inductive loads and high-current short-circuit protection are the main challenges of the design. The MC33887 boasts advantages such as low power consumption, 25 microamps current in standby mode, and short-circuit shutdown with output current exceeding 8 amps. Therefore, the system uses the MC33887 power device to control the motor, lock, antenna, and wash pump. 2.2 Human-Machine Communication Module To improve the comfort and safety of drivers and passengers, the entire system must establish a robust human-machine communication module. The human-machine communication module is constructed by combining the BC7281, the keyboard module, and peripheral LEDs. The BC7281 is a dedicated chip for 16-bit digital tube display and keyboard interface from Bigo. This chip can control a 16-bit digital tube or 128 independent LEDs through an external shift register (74HC164, 74LS595, etc.). The drive output polarity and timing of the BC7281 can be controlled by software, allowing it to work with various drive circuits and is suitable for digital tubes of any size. Through the human-machine communication module, human consciousness can be recognized by the machine, and the machine can also feed back relevant status information to LEDs or LCDs, achieving a visual effect in human-machine communication. The status input module mainly feeds back the effects of human operations (such as headlight and turn signal switches), vehicle status (such as door and window opening/closing), and internal status information (such as fuel level and coolant temperature) to the central processor. The central processor analyzes and processes the feedback information to accurately determine the vehicle's status and take corresponding actions. External status information can be divided into digital and analog signals. Through a series of peripheral circuits (such as a shaping and anti-vibration circuit), digital signals are converted into 0V and +5V high and low levels that the CPU can recognize. For analog signal processing, the changes in coolant temperature, fuel level, air pressure, and room temperature are first converted into electrical signals between 0V and 5V by a normalization circuit, and then converted into corresponding digital signals by the 4-channel 10-bit AD converter embedded in the LPC2119. These digital quantities are transmitted to the electronic control system unit near the driver using the existing CAN communication module, and then reflected on the instruments via a D/A converter. 3. Electronic Control System Unit Software Design For the LPC2119 microprocessor, the CAN controller is entirely event-triggered; that is, when its own state changes, the CAN controller informs the microprocessor of the result of the state change. Therefore, the central microprocessor can use interrupt or polling methods to process the CAN controller accordingly. The complete CAN firmware programming hierarchy diagram is shown in Figure 3. Each electronic control system unit sends data to the bus according to the specified format and cycle, and simultaneously retrieves the required messages as needed. For receiving data, this system uses an interrupt method. Once an interrupt occurs, the received data is automatically loaded into the corresponding message register. At this time, the identifier of the received message is selectively compared bit by bit with the identifier pre-set during the initialization of the receive buffer using a mask filter register. Only messages with matching identifiers can enter the receive buffer; those that do not meet the requirements are masked out of the receive buffer, thereby reducing the CPU's message processing burden. While the application layer programs for each electronic control system unit differ, the application programs for the communication module are largely consistent, and can be divided into CAN initialization, data transmission, and data reception. 3.1 CAN Initialization Program The CAN initialization program is mainly used to set parameters for CAN operation. Its initialization primarily includes: enabling CAN hardware, setting CAN alarm limits, setting the bus baud rate, setting the interrupt mode, setting the CAN acceptance filter mode, and setting the CAN controller's operating mode. 3.2 Data Transmission Program After successful CAN module initialization, it can be used to transmit messages. The process of a node sending a message to the bus is as follows: The LPC2119 assembles the data to be transmitted into a frame according to the CAN format, writes it to the CAN module's transmit buffer, and then initiates the transmit command to send the message to the bus. One crucial point to note when using the transmit function is that after initiating the data transmission command, the CAN controller will only return a status indicating whether the data frame was successfully transmitted after all data in the buffer has been transmitted. Therefore, waiting indefinitely for data transmission within the function will degrade the overall performance of the microprocessor. To avoid this situation, the function returns immediately after initiating transmission, determining success by either interrupting the transmission or checking the TCS status bit. 3.3 Data Reception Program In this design, we use interrupts to receive data on the CAN bus. When an internal interrupt occurs in the LPC2119's CAN controller, we first identify the RI bit in the interrupt register to determine if it's a receive interrupt, and then read the contents of the receive buffer. 4 Conclusion Practice has proven that, based on CAN bus technology, automotive electronic control systems with an ARM7 core offer small unit size and high efficiency. In particular, its data communication exhibits strong real-time performance, higher reliability, and better anti-interference capabilities, preventing network paralysis even under heavy loads. However, further research and improvement are needed for practical application, and the program's communication processing capabilities, error correction, and fault tolerance need further enhancement. References 1 Wu Kuanming. CAN Bus Principles and Application System Design. Beijing: Beijing University of Aeronautics and Astronautics Press, 1996. 2 Zhou Ligong. Enhanced 80C51 Microcontroller Quick Start and Practice. Beijing: Beijing University of Aeronautics and Astronautics Press, 2003. 3 Ge Lin. Research on the Application of CAN Communication Network in Automobiles. Automotive Technology 2000; (11); 1-4