The characteristics of CAN bus and P87C591 single-chip microcomputer are introduced, the software and hardware design of signal acquisition node based on P87C591 single-chip microcomputer is given, the problems that should be paid attention to in hardware circuit design are pointed out, and the subroutines such as node initialization, message sending and message receiving are emphasized in software design.
1 Introduction
In the condition monitoring and fault diagnosis of hydraulic system of construction machinery, the conditioning, acquisition and feature extraction of sensor signals, as well as sending the acquired data to the host (central processing unit) are realized by the signal acquisition unit. This paper introduces the design of CAN bus system signal acquisition node based on P87C591.
CAN is a new bus system proposed by Robert Bosch at the SAE (Society of Automotive Engineers) conference in February 1986. It is called "Automotive Serial Controller Area Network" and is one of the most important bus protocols. Because the CAN bus uses many new technologies and unique designs, it has outstanding reliability, real-time and flexibility compared with general communication buses, thus expanding its application range. At present, CAN has formed an international standard and is recognized as one of the most promising field buses.
The P87C591 is a single-chip 8-bit high-performance microcontroller from Philips Semiconductor with an on-chip CAN controller. It is derived from the 80C51 microcontroller family. It uses the 80C51 instruction set and includes the PeliCAN function of the Philips SJA1000 CAN controller. The P87C591 microcontroller uses advanced CMOS technology and is designed for automotive and general industrial applications. The P87C591 combines the functions of the P87C554 (microcontroller) and the SJAIO00 (independent CAN controller), and also has the following enhanced features:
Enhanced CAN receive interrupt
Extended Acceptance Filters
Acceptance filter can be changed dynamically
2 Signal Acquisition Node Hardware Circuit Design
2.1 Hardware Circuit Design
The signal acquisition node is directly fixed on the main measuring point of the hydraulic system of the engineering machinery. It is mainly composed of MCU, signal conditioning, A/D conversion, digital input module, memory and CAN bus interface. The signal acquisition node selects the high-performance 8-bit microcontroller P87C591 with an on-chip CAN controller as the processor, which can complete the basic analog and digital quantity acquisition and CAN bus communication. The acquisition module has 8 analog inputs and 4 optocoupler digital (switch) inputs. The first 3 analog inputs are designed for ICP vibration sensors, and the remaining 5 can be selected by jumpers. 0 V ~ 5 V voltage input or 4mA ~ 20 mA current loop input. To meet the needs of different types of sensors. Figure 1 is a schematic diagram of the hardware structure of the signal acquisition node.
Fig. 1 Hardware structure of signal acquisition node.
The signal acquisition unit is connected to the host (central processing unit) through a four-core cable, two of which are CAN bus signal lines (CANH and CANL). The other two are power lines that can provide power to various parts of the signal acquisition unit.
2.2 Issues that need attention in circuit design
The TJA1050 is a high-speed CAN transceiver. It is the interface between the Controller Area Network (CAN) protocol controller and the physical bus.
TJA1050 can provide different transmission performance for the bus and different reception performance for the CAN controller. TJA1050 can choose two working modes: high-speed mode and silent mode. High-speed mode is the normal working mode. Connecting pin 8 to ground can enter high-speed mode. If pin 8 is not connected, high-speed mode is the default working mode. Connecting pin 8 to Vcc can enter silent mode. Silent mode can prevent network communication from being blocked when the CAN controller is not controlled. In silent mode, the transmitter is disabled, but other functions of the device can continue to be used.
Two 120 n resistors are connected at both ends of the bus, which plays an important role in matching the bus impedance. If they are ignored, the anti-interference and reliability of data communication will be greatly reduced, or even communication will be impossible.
3 Signal Acquisition Node Software Design
The software design of the signal acquisition node mainly includes: node initialization, message sending, message receiving, CAN bus error processing, CAN bus interrupt processing, etc. This article focuses on node initialization, message sending and message receiving.
3.1 Node Initialization
After power-on or hardware reset, the CAN controller is in reset mode. If the CAN controller is not in reset mode, set the mode register RM bit to put it in reset mode. After the CAN controller is reset, it must be initialized to implement CAN communication, and its contents mainly include: operation mode, acceptance filter, bus timing and interrupt, etc. Among them, the timer is used to set the baud rate of data transmission on the CAN bus. Note that the baud rate of each node on the bus must be consistent, otherwise it will cause data transmission errors. The signal acquisition node initialization process is shown in Figure 2.
Figure 2 Initialization flow chart.
3.2 Message sending
The data transmission is automatically completed by the CAN controller according to the CAN protocol specification. The CPU transfers the data to be sent to the transmission buffer and sets the TR (transmission request) bit of the command register. The transmission process can be controlled by an interrupt request or query status flag. The message transmission process is shown in Figure 3.
Figure 3 Message sending flow chart.
3.3 Message Reception
The CPU reads the status register of the CAN controller at a certain period and checks the RBS (receive buffer status). If RBS indicates 0 (empty), there is no received data; if RBS indicates 1 (full), there is one or more complete available information in R)(nFo. The message receiving process is shown in Figure 4.
Figure 4 Message receiving process diagram
The design of other subroutines will not be introduced here.
4 Conclusion
CAN is favored by the industry for its unique design concept, good performance and high reliability; P87C591 with on-chip CAN controller has powerful functions and convenient design. It can be widely used in the industrial field. The signal acquisition node based on P87C591 makes full use of the excellent characteristics of CAN and P87C591, and realizes the data acquisition function well.
Previous article:Brushless DC motor speed control system based on ATmega8
Next article:The Calculation Method of Cx51 Programming Stack
- Popular Resources
- Popular amplifiers
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
- AD19, same rules, automatic routing is ok, manual routing will be short circuit and un-roated, what is the reason?
- We are looking for candidates who are proficient in zigbee!
- 【MM32 eMiniBoard Review】2a. Found that the virtual serial port may have problems, and the serial port routines cannot receive
- Help! Does anyone know what sensor this is?
- Do you usually read e-books or paper books now?
- ADC12 single channel multiple conversion routine (MSP430F5529)
- Motor startup interferes with the microcontroller problem
- Chapter 3 Interrupts, Clocks, and Low Power Consumption
- The difference between C64x+ and C64x CACHE in the C6000 series
- Realization of voltage to current conversion in Multisim12