Comparison of two systems using CAN bus for communication

Publisher:滁州鱼儿Latest update time:2011-09-12 Source: icbuy亿芯网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

CAN bus is a serial communication network that effectively supports distributed control or real-time control. It can realize a fully distributed multi-machine system without the distinction between master and slave. It has the characteristics of fast transmission speed, automatic resolution of bus competition, good real-time performance, high reliability, and strong error correction ability. It has become an international bus standard. Due to the many advantages of CAN bus, its application range ranges from high-speed networks to low-cost multi-line networks. It has been widely used in the fields of automotive engine control components, sensors, anti-skid systems, industrial automation, building environmental control, machine tools, elevator control, medical equipment, etc. in the field of automation electronics.

SJA1000 is an independent CAN controller, mainly used for mobile targets and local area network control in general industrial environments. It is a replacement for the PCA82C200 CAN controller (BasicCAN) of Philips Semiconductor, and it adds a new operating mode - Pelican, which supports the CAN2.0B protocol with many new features. The basic characteristics and electrical parameters of SJA1000 are compatible with the PCA82C200 independent CAN controller, with PCA82C200 mode (the default BasicCAN mode), an extended receive buffer of 64 bytes, first-in-first-out (FIFO), support for CAN2.0A and CAN2.0B protocols, support for 11-bit and 29-bit identification codes, and a communication bit rate of up to 1 Mbps.

Independent CAN controller chip needs an external processor to accept the control of external CPU to run. If the processor has a CAN controller, it will undoubtedly greatly simplify the hardware design of the application system and greatly improve the reliability of the system. Therefore, many processors with CAN controllers have appeared. Philips' P8XC591 microcontroller is one of them. It fully implements the CAN2.0b specification and provides a software migration path directly from the SJA1000 independent CAN controller.

2 Introduction to two communication methods

2.1 Independent CAN controller SJA1000 communication method

SJA1000 is an independent CAN controller, mainly used for local area network control in mobile targets and general industrial environments. It is a replacement for Philips PCA82C200 CAN controller (BasicCAN). On the basis of full compatibility with PCA82C200, it adds a new working mode, Pelican. SJA1000 fully supports CAN2.0B protocol with many new features. The working mode of SJA1000 is selected by the CAN mode bit in its internal clock divider register (CDR). The default mode at hardware reset is BasicCAN working mode [1].

SJA1000 can support the timing characteristics of multiple microprocessors, such as Intel mode or Motorola mode. The interface between SJA1000 and microprocessor is very simple. Microprocessor accesses SJA1000 in the same way as external memory. When designing the interface circuit, the chip select address of SJA1000 should not conflict with the chip select address of other external memory in logic.

SJA1000 has two modes for the microprocessor to access its internal registers. The access in the two modes is different. These two modes are reset mode and working mode. When the hardware is reset, the controller is offline, or the request bit is set, SJA1000 enters reset mode. When the reset request bit in its internal control register (CR) is cleared, SJA1000 enters working mode. Some internal registers can only be accessed in reset mode, some registers can only be accessed in working mode, and some registers can be accessed in both modes.

2.2 Communication method of Philips microcontroller p8xc591

The P8XC591 from Philips Semiconductor is a high-performance 8-bit microcontroller manufactured using an advanced COMs process with an on-chip CAN controller. It is derived from the MCS-51 microcontroller family, uses the powerful 80C51 instruction set, and successfully includes the Pelican function of the Philips Semiconductor SJA1000 CAN controller, providing dedicated hardware, and its block diagram is shown in Figure 1. The fully static core provides extended power saving. The oscillator can be stopped and resumed without data loss. The improved 1:1 internal clock divider achieves a 500ns instruction cycle at a 12MHz external clock rate [1].

Figure 1 Block diagram of P8XC591

The P8XC591 is a high-performance microcontroller. Its dedicated hardware architecture and enhanced Philips "RX+ core" make it widely used in industrial control and automotive fields. The on-chip CAN controller provides many dedicated hardware functions for CAN applications. The P8XC591 fully implements the CAN2.0b specification and provides a software migration path directly from the SJA1000 stand-alone CAN controller. The P8XC591 has CAN expansion features, including enhanced receive filters, support for system maintenance, diagnosis, system optimization, and receive FIFO features, making the P8XC591 have a very wide range of applications.

The embedded CAN controller included in the P8XC591 has the following functional modules: the CAN core module, which controls the transmission and reception of CAN frames according to the CAN2.0B specification; the CAN interface module, which contains 5 special function registers that realize the connection between the CPU and the CAN controller. The access to important CAN registers is realized through the fast automatic increase addressing feature and the bit addressing of the special function registers; the transmit buffer module of the CAN controller, which can save a complete CAN information extension or standard frame format. As long as the transmission information is started by the CPU, the bytes are transferred from the transmit buffer to the CAN core module. When receiving a message, the CAN core module converts the serial bit stream into parallel data input to the receiving filter. Through this programmable filter, the P8XC591 determines the actual received information. All data received by the receiving filter are stored in the receiving FIFO (64 bytes). Depending on the operating mode and data length, the receiving buffer can save up to 21 CAN messages. This gives users more flexibility in specifying the interrupt service and interrupt priority of the system, because the possibility of data overflow is greatly reduced.

In addition to the common CAN features, the P8XC-591 also provides enhanced Pelican. Pelican has four independently configurable receive filter groups, each with four selectable receive filter configurations; each receive filter has a 32-bit specifier, a 32-bit code, and a 32-bit mask; all filter configurations can be changed during operation; support for higher-layer protocol receive filters; receive FIFO features; listen-only mode and self-test mode; receive interrupts can only be generated when the FIFO receive interrupt level is reached; receive interrupts are generated immediately when a high-priority data frame is received; support for system maintenance, diagnosis, and optimization features [2].

3 Comparison of two communication methods

When an independent CAN controller receives and sends data, when designing the interface circuit between the microprocessor and SJA1000, the interface mode between the microprocessor and SJA1000 must be selected first, and then the chip select address of SJA1000 should not conflict with other external memories, and the reset circuit of SJA1000 should be low level effective. The design of the hardware circuit is relatively complex. If you don't pay attention to any problem, it may cause the data to be unable to be sent and received.

The internal registers of SJA1000 are distributed in the continuous address space of 0 to 31, including the control segment and the information buffer. The control segment can be programmed to configure the communication parameters (such as baud rate, bit timing, etc.) during initialization loading. The microcontroller also controls the communication status on the CAN bus through this segment. The information buffer is divided into a send buffer and a receive buffer. The microprocessor writes the information to be sent into the send buffer, and then starts the send command to send the message. The received information that meets the receiving conditions is placed in the receive buffer, and the microprocessor can read the information and process it.

If the hardware circuit design uses the philips company's built-in CAN controller microcontroller p8xc591, the above problems will not exist. Since the p8xc591 contains an on-chip CAN controller, the p8xc591 can directly exchange data with external CAN nodes through the two pins txdc and rxdc. The CAN controller built into the p8xc591 is upwardly compatible with sja1000 in software. The external components required for the CAN node circuit connected to the p8xc591 are only a crystal oscillator plus two capacitors to drive the on-chip oscillator, a resistor and capacitor connected to the reset pin. The on-chip power-on reset circuit and a transceiver pca82c250 are used to connect the p8xc591 to the CAN bus. Therefore, we can use it very conveniently, and we don't have to consider the connection of many external circuits, so that we can avoid many easy errors.

P8XC591 completes data exchange with other CAN nodes by setting CAN's special function registers such as the address register (CANADR), data register (CANDAT), mode register (CANMOD), control register (CANCON), status register (CANSTA), bus timing register (BTR0, BTR1), etc., as well as reading and writing the send and receive buffers.

4 Conclusion

Through the introduction of this article, we have a better understanding of the independent CAN controller SJA1000 and the Philips P8XC591 microcontroller. Through the latter, we can simplify the task of connecting two processors to a single microcontroller. This greatly simplifies the hardware connection of the circuit and improves the reliability of the system.

Reference address:Comparison of two systems using CAN bus for communication

Previous article:A brief discussion on the control system technology of subway platform screen doors
Next article:Superconducting energy-saving technology that can be used from maglev trains to railways (Part 1)

Latest Security Electronics 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号