Design of vehicle fault diagnosis instrument based on CAN bus combined with radio frequency and USB

Publisher:钱币之歌Latest update time:2022-01-25 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Design a vehicle-mounted CAN bus fault diagnosis instrument based on 2.4G radio frequency, introduce its working principle and system hardware circuit in detail, and finally explain the software modules of the receiving end, transmitting end and PC end respectively.


The solution uses the 2.4G air protocol with automatic frequency hopping. The bit error rate is kept within the effective range after testing and statistics, and it can still work normally within 14m. USB is used as the receiving end and PC interface to ensure the plug-and-play of the system and high-speed data transmission.


Controller Area Network (CAN) provides a unified data exchange channel for various complex electronic devices, controllers, measuring instruments, etc. inside the car, and has been widely used. At present, most automotive components provide CAN bus communication interfaces.


CAN bus technology is used in today's mid-range and high-end cars. Aiming at the faults that may occur in the vehicle CAN bus, this paper proposes a design scheme for a vehicle CAN bus fault diagnosis instrument based on the fault code specified by the KWP2000 application layer, combining the advantages of radio frequency and USB. This scheme is low-cost, easy to carry, and has strong flexibility and adaptability.


1. Solution design

Due to the use of radio frequency technology, the car CAN bus data acquisition part and the CAN bus data diagnosis part can be separated, without the need for wiring, not limited by space, and easy to install and carry. According to relevant ISO standards, the CAN bus transmission rate can reach up to 1 Mbps; but due to the special environment inside the car, the vehicle-mounted CAN bus rate is generally 250 kbps. The radio frequency rate of this system can reach up to 1 Mbps, which can well meet the data transmission requirements.

Design of vehicle fault diagnosis instrument based on CAN bus combined with radio frequency and USB

The transmitting end uses USB as the receiving module and PC interface. Compared with RS232 or PCI interface, USB has the advantages of user convenience, automatic device identification, automatic installation of drivers and configuration, support for dynamic access and dynamic configuration, etc. Its transmission rate can reach tens of Mbps, and it supports synchronous and asynchronous transmission modes, ensuring bandwidth and low transmission distortion.


The PC application layer software integrates the application layer protocol of KWP2000. KWP2000 is a vehicle fault diagnosis protocol developed by Sweden, which has been widely used in microcomputer-controlled automatic transmissions, anti-lock braking systems, airbags, and cruise systems. It is based on the OSI seven-layer protocol and complies with the IS07498 standard. Layers 1 to 6 implement the functions of communication services, and layer 7 implements the functions of diagnostic services. Its application layer proposes a complete and standardized set of diagnostic codes. This system uses the application layer protocol of KWP2000 to analyze the collected CAN bus data to realize the function of fault diagnosis.


2. Hardware Implementation

2.1 Introduction to the chips used in the system

2.1.1 nRF2401 chip

nRF240l is a single-chip RF transceiver chip that operates in the 2.4-2.5GHz ISM band. It has built-in frequency synthesizer, power amplifier, crystal oscillator, modulator and standard SPI functional modules. The output power and communication channel can be configured through software. There are 125 channels available, and the maximum rate can reach 1 Mbps. The chip has a wide operating voltage of 1.9-3.6 V and very low operating energy consumption. When transmitting at a power of -5 dBm, the operating current is only 10.5 mA; when receiving, the operating current is only 18 mA.

nRF240l has 4 working modes: transceiver mode, configuration mode, idle mode, and shutdown mode. Its working mode is determined by the three pins PWR_UP, CE, and CS and the lowest bit TX_EN of the configuration byte.


The transceiver mode is divided into DirectMode and ShockBurst. The former does not process the signal in any way in the chip, which is the same as other RF transceivers. The latter uses the on-chip FIFO stack, and the data is sent in from the MCU at a low speed, but transmitted at a high speed, and all high-speed signal processing related to the RF protocol is performed in the chip. For example, nRF240l automatically processes the header and CRC check code in the ShockBurst transceiver mode, and automatically removes the packet header and CRC check code when receiving; it automatically adds the header and CRC check code when sending data.


2.1.2 TMU3100 chip

TMU3100 is a RISC core microcontroller launched by Taiwan Tenx in 2005. It embeds a USB controller that is fully compatible with the USB1.1 protocol and provides a low-speed USB interface and three endpoints, including one control input/output endpoint and two interrupt input endpoints.


TMU3100 can be configured as a standard HID class and can use the HID class driver that comes with the Windows operating system. This saves the work of developing device drivers and shortens the development cycle. The TMU3100 chip structure is shown in Figure 2.


2.1.3 PIC18F2682 chip

PICl8F2682 is a new 8-bit low-power CAN microcontroller launched by Microchip. Its main resources include: built-in standard CAN module, 80KB flash program memory, 1 KB data E2PROM, 3.3 KBRAM memory, 8-channel ADC, 1 8-bit and 3 16-bit T1MER, 1 SPI and I2C serial communication port, and programmable brown-out reset function and low voltage detection circuit.

PIC18F2682 has an enhanced CAN bus module built in, which includes a CAN protocol engine, message buffering, and message control. The CAN protocol engine automatically processes all messages received and sent on the CAN bus, and it can parse data frames when receiving or sending messages. You only need to set the appropriate registers first to send information, and the status of information transmission can be obtained through the relevant registers.


2.2 Hardware Circuit

2.2.1 Transmitter circuit principle

This is the circuit principle of the system transmitter. The CAN bus interface uses the PIC18F2682 microcontroller with built-in CAN module from Microchip, and the bus is isolated by the optical coupler 6N137; the CAN bus transceiver uses MCP2551.


The communication between PIC18F2682 and RF chip nRF2401 is completed through the standard SPI interface SCK, SDI, SDO, which can greatly improve the transmission rate. The configuration control enable CS and the receive and transmit enable CE of nRF2401 are controlled by RB4 and RB5 respectively. When nRF2401 receives a data packet, DR1 will be set to a high level, so PIC18F2682 can determine whether the data is received by querying the status of INT0.


2.2.2 Principle of receiving circuit

Since TMU3100 is powered by PC and the voltage VDD provided by the USB interface of PC has large interference, VDD is π-filtered.

Since TMU3100 does not have

SPI module, so it can communicate with the SPI port of nRF2401 through PB[1] and PB[0] according to the SPI protocol. The configuration control enable CS and the receive and transmit enable CE of nRF2401 are controlled by KSO[3] and KSO[13] respectively. After nRF2401 receives the data packet, DR1 will be set to a high level, so TMU3100 can determine whether the data is received by querying the status of KS16.


3. Software Design

The system's software design includes transmitter software design, receiver software design and PC software design.

3.1 Transmitter software design

The transmitter process is shown in Figure 5. The software design mainly realizes two functions: the first is to realize the collection of data on the CAN bus; the second is to realize the transmission of the collected data through radio frequency.


After power-on, the CAN module is initialized first. Then the nRF2101 is initialized and a connection is established with the receiving end. When no ACK signal is received after sending CAN data, the frequency is hopped; then the sending end is notified to prepare to receive the retransmitted CAN data until an ACK signal is received.


In order to prevent air interference, an automatic frequency hopping air protocol is adopted, that is, frequency hopping is performed regardless of whether an ACK signal is received. Therefore, strong interference in a certain frequency band can be prevented, thereby reducing the bit error rate.


3.2 Receiver Software Design

The software flow of the receiving end is shown in Figure 6. The software design mainly implements two functions: the first is to realize enumeration; the second is to realize uploading the received data to the PC via USB. After power-on, first complete the configuration of TMU3100 and enumerate with the PC; after the enumeration is successful, configure nRF2401 and establish a connection with the transmitter. When a data packet is received, first determine whether it is CAN data or a retransmission data command. If it is a CAN data packet, return an ACK signal to the transmitter and hop the frequency, and then transfer the received data to the PC via USB; if it is a retransmission command, first hop the frequency, and then set the retransmission flag, indicating that the next data packet is a retransmission data packet.

TMU3100 is configured as a standard HID class, so you do not need to develop a driver for the device, but instead use the standard HID class driver provided by Windows.


3.3 PC software design

The PC software consists of application programs and device drivers. Windows provides a complete built-in driver for standard USB devices. This system uses the Windows built-in HID class driver. As long as the TMU3100 is configured as the HID class, it can complete the communication with the PC. This eliminates the need to develop device drivers and greatly simplifies the development of the host computer software.

[1] [2]
Reference address:Design of vehicle fault diagnosis instrument based on CAN bus combined with radio frequency and USB

Previous article:Design of car light node based on μPD780822 single chip microcomputer and CAN bus module
Next article:Using MCU, CAN controller and transceiver to realize intelligent node of fuel cell vehicle air conditioner

Recommended ReadingLatest update time:2024-11-16 10:14

RF front-end chip GC1101 replaces RFX2401C for 2.4G wireless wall-mounted speakers
Wireless wall-mounted speakers are commonly used in school classrooms for wireless teaching, conference training, shopping malls, supermarkets, store restaurants, etc. The device has a reliable pairing method, super anti-interference ability, low power consumption, etc. The wall-mounted speaker is composed of a soun
[Embedded]
RF front-end chip GC1101 replaces RFX2401C for 2.4G wireless wall-mounted speakers
Taiwanese media: The shortage of LTCC RF components is very serious
The industry recently revealed that with the slow pace of factory expansion and the growing demand for 5G smartphones and Wi-Fi 6E applications, the shortage of LTCC (low-temperature co-fired ceramic) RF components is very serious. According to DIGITIMES, industry sources said that the delivery time of LTCC components
[Mobile phone portable]
Zuolan Microelectronics appeared at multiple industry events to demonstrate the comprehensive strength of domestic RF device technology innovation
Recently, Zuolan Microelectronics participated in the 2nd RF Filter Innovation Technology Conference and the 4th China MEMS Manufacturing Conference and Micro-Nano Manufacturing and Sensor Exhibition. As a company dedicated to the research and development of high-performance RF filters, duplexers and RF front-end modu
[Network Communication]
Zuolan Microelectronics appeared at multiple industry events to demonstrate the comprehensive strength of domestic RF device technology innovation
5G RF chip company Litong Communications completed Pre A round of financing of approximately 100 million yuan
Recently, Beijing Litong Communications Co., Ltd. (hereinafter referred to as "Litong Communications") completed a Pre A round of financing of nearly 100 million yuan, led exclusively by Heli Capital. Litong Communications originated in Zhongguancun, Beijing. The team includes communication experts from Tsinghua Unive
[Mobile phone portable]
USB communication code based on 51 single chip microcomputer 372
#include include.h #include "INTRINS.h" #define OP_CMD 1 // Command opcode #define OP_DATA 0 // Data opcode #define DELAY_TIMES 8 // Delay 2 microseconds #define DELAY_CNT_NUMS 2*DELAY_TIMES // Number of clock cycles required for a delay of 2 microseconds (for a 22.1184MHz crystal, each microsecond contains 22.1184
[Microcontroller]
Sanan Integrated Circuit's revenue in the first half of the year increased by 680% as it shipped GaAs RF to nearly 100 customers
 On August 18, Sanan Optoelectronics released its semi-annual report stating that the company's operating income in the first half of the year was 3.568 billion yuan, a year-on-year increase of 5.31%; the net profit attributable to shareholders of the listed company was 635 million yuan, a year-on-year decrease of 28.
[Mobile phone portable]
Why does the RF power meter display OVER RANGE?
The power of the signal I am testing is still within the test range of the power sensor. Why does the power meter display an 'OVER RANGE' error alarm? Answer: The analog display range of EPM/EPM-P RF power meter and P series RF power meter is from -70 dBm to +20 dBm. When the measured signal exceeds this range, the
[Test Measurement]
Rohde & Schwarz and Unisoc have verified the industry's first 3GPP Rel.17 IoT NTN RF conformance test case
Rohde & Schwarz (hereinafter referred to as "R&S") cooperated with Unisoc to verify the industry's first IoT NTN RF consistency test case based on Unisoc's 5G NTN satellite communication chip V8821. This achievement marks a breakthrough in the certification of NTN equipment by both parties and lays the necessa
[Network Communication]
Rohde & Schwarz and Unisoc have verified the industry's first 3GPP Rel.17 IoT NTN RF conformance test case
Latest Embedded Articles
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号