Design of CAN bus signal acquisition node based on P87C591

Publisher:leader5Latest update time:2011-08-23 Keywords:P87C591 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Signal acquisition node hardware structure www.elecfans.com

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.

Keywords:P87C591 Reference address:Design of CAN bus signal acquisition node based on P87C591

Previous article:Brushless DC motor speed control system based on ATmega8
Next article:The Calculation Method of Cx51 Programming Stack

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号