Research on Automobile Fault Diagnosis Instrument Based on C8051F020 Single Chip Microcomputer

Publisher:星光闪耀Latest update time:2011-07-26 Keywords:C8051F020 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

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.

System circuit diagram

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.

CAN bus and single chip microcomputer interface circuit

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]

Serial bus interface circuit

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.

System software design flow chart

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.

Keywords:C8051F020 Reference address:Research on Automobile Fault Diagnosis Instrument Based on C8051F020 Single Chip Microcomputer

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

Circuit Design of C8051F020 Single Chip Microcomputer
The design uses a high-performance single-chip microcomputer C8051F020 as the control chip to monitor the status of 40 buttons, 3 coding switches and 4 potentiometers on the oscilloscope panel. The working principles of the keyboard, coding switches and potentiometers are introduced respectively, as well as the hardwa
[Microcontroller]
Circuit Design of C8051F020 Single Chip Microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号