With the continuous development of my country's economic construction, new cars equipped with computer control systems have been increasingly used in people's daily lives, which has greatly improved the power, economy, safety, reliability, etc. of cars. But at the same time, it also makes the structure of the car more complicated, and it also makes it more difficult to diagnose and eliminate car faults in general car maintenance. The method of diagnosing and eliminating car faults using the information stored in the car computer has also emerged. Instrument diagnosis is a modern inspection method developed on the basis of experience. It is used in conjunction with the on-board fault self-diagnosis system. In essence, it is equivalent to the terminal equipment of the self-diagnosis system and plays a role in human-computer interaction. This method can use instruments or equipment to test the performance and fault parameters, curves or waveforms of the car without disassembling the car, and can even automatically analyze and judge the technical condition of the car. With the popularization of electronic fuel injection engine cars, automobile fault diagnosis instruments have been accepted by most industry professionals as a necessary maintenance tool.
The automobile fault diagnosis instrument designed in this paper adopts the low-power single-chip microcomputer C8051F020 of CYGNAL Company as the core, which has various functions such as data storage, communication and LCD display. The instrument has the characteristics of low power consumption, high precision, easy to carry and suitable for various occasions.
1. Principle and function of diagnostic instrument
1.1 Hardware Principle and Function
(1) Diagnose the status of the electronic control system's sensors and actuators and whether the ECU is working properly. By judging whether the input and output voltages of the ECU change within the specified range, it can be determined whether the electronic control system is working properly.
(2) When a signal exceeding the specified value appears in a circuit in the electronic control system, the fault information reflected by the circuit and related sensors is stored in the memory inside the ECU in the form of a fault code. Maintenance personnel can use the diagnostic instrument to read the fault code and display it.
1.2 Main functions supported by hardware
(1) Through the CAN and LIN communication modules, it is possible to communicate with the various electronic control units (ECUs) in the vehicle and transmit fault codes and engine status information.
(2) The synchronous/asynchronous transceiver of the microcontroller can communicate serially with the PC to complete functions such as data exchange, program downloading, and diagnostic instrument upgrade.
(3) Display the vehicle's operating status data and fault information through the LCD display .
(4) Perform different diagnostic functions through the keyboard circuit.
(5) A large amount of fault codes and their measurement data are stored through a large-capacity FLASH memory with a serial interface.
2. Design of hardware circuit and interface circuit
2.1 Overall framework of the hardware circuit
The hardware system of the diagnostic instrument mainly includes the following modules: C8051F020 processor and its peripheral expansion circuit module, keyboard, LCD display module, external expansion memory module, CAN, LIN, communication module; serial communication module with PC; power supply circuit and system reset circuit. The overall block diagram is shown in Figure 1.
Figure 1 System circuit diagram
2.2 C8051F020 MCU Circuit
The CPU selected in the design is Cygnal's C8051F020 microcontroller, which uses Cygnal's patented CIP-51 microprocessor core that is fully compatible with the MCS-51 instruction set, with a peak speed of up to 25MIPS. In addition, almost all analog and digital peripherals and other functional components required for microcontroller data acquisition or control systems are integrated in one chip (including PGA, ADC, DAC, voltage comparator, voltage reference, temperature sensor, SMBus/I2C, UART, SPI, timer, programmable counter/timer array, internal oscillator, watchdog timer and power monitor, etc.). CIP-51 implements pipeline operation for instruction execution, thereby greatly improving the instruction execution speed. In addition, the most unique improvement of the C8051F020 microcontroller is the introduction of a digital cross switch. It allows internal digital system resources to be mapped to the port I/O pins of P0, P1, P2 and P3. At the same time, C8051F020 also adds a reset source internally, which greatly improves the reliability of the system and can fully meet the functional requirements of the diagnostic instrument.
2.3 Design of CAN and LIN bus interface circuits
2.3.1 CAN bus interface circuit
The CAN bus interface circuit includes the design of the interface circuit between the CAN communication controller and the microprocessor and between the CAN bus transceiver and the physical bus. The interface circuit between C8051F020 and the CAN driver chip SJA1000T is shown in Figure (2). This design selects the SJA1000 CAN controller and 82C250 bus transceiver of PHILIPS. SJA1000 is a bus interface chip in the circuit, which realizes the data communication between the ECU and the microprocessor. The main function of this circuit is to complete the communication between the CAN bus and the single-chip microcomputer. PCA82C250 is the interface between the CAN controller and the physical bus. It can provide differential transmission capability to the bus and differential reception capability of the CAN controller. The TXD and RXD pins send the transmission and reception signals after driving respectively. The specific connection is shown in Figure 2.
Figure 2 CAN bus and single-chip microcomputer interface circuit
2.3.2 Design of LIN communication module
The LIN bus transceiver uses the TJA1020 of PHILIPS, which is directly connected to the serial port of the microcontroller. The circuit connection diagram is shown in Figure 3. The TJA1020 transceiver is a physical media connection, suitable for LIN transmission rates up to 20kBaud. Its pins TXD and NSLP reduce the input threshold, and the output pins RXD and TXD are open drain. Therefore, it is compatible with microcontrollers using 3.3V or 5V power supplies, and the transceiver itself does not require additional VCC power. In order to make the pins RXD and TXD reach a high level, when the port pins of the microcontroller do not have integrated pull-up resistors, external pull-up resistors must be added. The microcontroller sends data from TX0 to the TXD pin of TJA1020, and the RXD pin of TJA1020 sends data to the RX0 of the microcontroller. The sleep control input NSLP of the LIN transceiver can be controlled by the port pins of the microcontroller.
2.4 Design of Serial Bus Interface Circuit
RS232 serial communication uses full-duplex mode, and a data transmission line is configured in the system. At the same time, the system can both send and receive data. Figure (4) shows the serial communication circuit connection diagram. Through the cross switch, the P0.0 and P0.1 of the C8051F020 microcontroller are set to TX0 and RX0. The RS232 logic level is symmetrical to the ground, which is completely different from the TTL and CMOS logic levels. The logic "1" level is -5 to -15, and the logic "0" level is between +5 and +15, which is inconsistent with the logic level of the microcontroller and must be converted. Figure 4 uses the SP3223 converter to realize the conversion between the TTL level and the RS-232 level. [page]
Figure 4 Serial bus interface circuit
2.5 Keyboard display and memory circuit
The main keyboard of this design adopts 4X4 keyboard input module, and its driver module adopts SK5278, which is a keyboard controller using PIC core launched by Fuzhou Beineng Technology Co., Ltd. The chip adopts 4-wire serial interface and can be interfaced with any type of single-chip microcomputer; it has key valid indication output and can manage the keyboard in interrupt mode; its row lines X0~X3 and column lines Y0~Y3 can form a 4×4 keyboard matrix; SK5278's 16-key keyboard controller contains de-jitter processing circuit, so it can directly output key values and interface with single-chip microcomputer or microprocessor in serial mode. The function keys of the system design adopt mid-segment input. The whole workflow continuously scans the status of the key to determine whether there is a key pressed. When any key is pressed, the mid-segment is generated, and the CPU executes the corresponding mid-segment subroutine. If no key is pressed, the keyboard status continues to be scanned until a key is pressed, and the keyboard interrupt handler is used to complete all information exchanges with the user.
The OCMJ5X10 used in the display circuit is a 160×80 dot matrix Chinese graphic LCD graphic display module. The module contains the national standard first-level simplified Chinese character library, which makes the display of Chinese characters very convenient; at the same time, the hardware interface between the module and the microcontroller uses only two handshake signal lines, REQ/BUSY, in addition to the data bus, which simplifies the hardware interface circuit design with the microcontroller. The above features are very important for the microcontroller system with very tight software and hardware resources.
Since the diagnostic system involves a large amount of fault codes, sensor information, execution information and other data information, a large storage space is required. Therefore, the system expands a large-capacity 8Mbit FLASH memory AT45DB081.
3. System software design
The software of this system adopts a modular design method. The entire program includes the main program, initialization program, timer interrupt program, diagnostic protocol program, serial communication program, keyboard display program, and memory read and write program. All programs are written in C language, which can be easily debugged and downloaded. Due to space limitations, this article only gives the flow chart of the main program, as shown in Figure 5. The main program of the system mainly completes the initialization of the C8051F020 microcontroller system, sets the system clock and function registers, calls the keyboard handler, and completes different functions, such as transferring to the corresponding service program according to different keys to complete different functions.
Figure 5 System software design flow chart
3.1 Hardware anti-interference design
(1) In system design, appropriate decoupling capacitors are configured around the power supply circuit and IC devices. The power ground, MCU peripheral circuit ground, and signal ground in the system are reliably grounded using a single-point grounding method to reduce interference from unequal potentials.
(2) Hardware filtering: This method has a good suppressive effect on cross-mode interference. RC low-pass filters are often used in some low-frequency signal input circuits to greatly weaken high-frequency interference signals.
(3) When designing the printed circuit board, the digital circuit is isolated from the analog circuit, and the digital and analog circuits are connected only at one point, which effectively prevents the digital circuit from affecting the analog signal.
(4) In order to prevent mutual interference between circuit modules, a metal casing is used in the design of the circuit board to effectively shield the interference of external radio frequency signals.
3.2 Software Anti-interference Design
(1) Digital filtering: When designing the software, the design of the digital filtering program was taken into consideration to effectively eliminate random interference.
(2) Set up redundant instructions and software traps. By applying software traps and data redundancy, system paralysis and program runaway caused by external interference, vibration or instantaneous failure can be effectively suppressed.
(3) Software watchdog. In order to prevent the program from running into an infinite loop and not being caught by a software trap, a "software watchdog" program was designed during the system software design, which effectively prevented the system from being paralyzed by the infinite loop.
4. Conclusion
This paper develops an ECU fault diagnostic instrument based on the C8051F020 single-chip microcomputer. The diagnostic instrument can realize parameter measurement, online fault diagnosis and actuator testing, and has the advantages of simple structure, low cost, small size and reliable performance. Experiments have proved that the diagnostic instrument works stably, is easy to operate and has strong anti-interference ability. This shows that the software and hardware design of the diagnostic instrument is relatively reasonable and has broad application prospects. It is a good assistant for maintenance personnel and has full value for production application.
Previous article:Design of Multi-channel CAN Bus Interface and Driver Based on MCP2515
Next article:Two-phase stepper motor drive system based on A3992 and C8051F300
Recommended ReadingLatest update time:2024-11-16 23:42
- Popular Resources
- Popular amplifiers
- Practice of Serial Communication between Single Chip Microcomputer and Computer (Zhang Xiuguan)
- Design of SD card main controller based on c8051f020
- C8051F020 implements ADC sampling of analog voltage outside the chip, displays it on the LCD, and sends it to the PC through the serial port
- ADC application elements in C8051F020 (scheme design).rar
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Which software does STM8 use to compile C?
- Regarding the problem that CCS3.3 cannot generate .out, please answer
- This article on Huawei's internal forum has become popular: The real reason for social involution:
- MicroPython Hands-on (22) - Wireless Broadcasting of Control Board
- [NXP Rapid IoT Review] + Learning and thinking about hardware schematics
- CircuitPython starts supporting Open Book
- "Play Board" + Shared Bicycle Control Board - Clock Chip PCF8563
- High-performance fully integrated SAR ADC
- Looking back, I realized that EE is so strong - Antenna
- Latest review activity! Free trial of Espressif's RISCV board ESP32-C3-DevKitM-1