Home > Microcontroller >Interface Circuits > Interface circuit between CAN bus controller and single chip microcomputer

Interface circuit between CAN bus controller and single chip microcomputer

Source: InternetPublisher:张三叔 Keywords: CAN bus single chip microcomputer interface circuit Updated: 2024/08/07

The interface principle between the CAN bus controller and the single-chip microcomputer AT89S52 is shown in the figure below. 
The interface circuit is mainly composed of four parts: the microcontroller AT89C51 and its peripheral circuits, the independent CAN communication controller SJA1000, the CAN bus transceiver PCA82C250 and the high-speed optocoupler 6N137. The microprocessor AT89C51 is responsible for the initialization of the SJA1000 and realizes the reception and transmission of data by controlling the SJA1000.
The microcontroller and the SJA1000 share the reset circuit through the NOT gate. The AT89C51 crystal oscillator uses a 12MHz crystal oscillator, and the SJA1000 uses a 16MHz crystal oscillator. Among them, the SJA1000 uses the Intel mode (Mode=l), fCLKOUT=fXAL/2=8MHz.
The SJA1000 is equivalent to the off-chip memory of the AT89C51, and the CPU can directly perform read/write operations on the registers in the SJA1000.
The INT (inverse) pin of SJA1000 is connected to the INT0 (inverse) pin of AT89C51, and the ALE of AT89C51 is directly connected to the ALE of SJA1000.
In order to enhance the anti-interference ability of the CAN bus node, the TXO and RXO of SJA1000 are connected to the TXD and RXD of PCA82C250 through the high-speed optocoupler 6N137, which well realizes the electrical isolation between the CAN nodes on the bus. The two power supplies VCC and VDD used in the optocoupler circuit must be isolated.
The interface between PCA82C250 and CAN bus also adopts certain safety and anti-interference measures. The CANH and CANL pins of PCA82C250 are connected to the CAN bus through a 5Ω resistor respectively. The resistor can play a current limiting role and protect PCA82C250 from overcurrent shock. Two 30pF small capacitors are connected in parallel between CANH and CANL and ground to filter out high-frequency interference on the bus and have a certain ability to prevent electromagnetic radiation. In addition, a transient interference diode is reversely connected between the two CAN bus access terminals and the ground. When the CAN bus has a high negative voltage, the short circuit of the diode can provide overvoltage protection.

The resistor Rs between the 8th pin of PCA82C250 and the ground is called the slope resistor. When the baud rate is low and the bus is short, the slope control method is used. The rising and falling slopes depend on the resistance value of Rs. Experimental data show that 15kΩ~200kΩ is the ideal value range of Rs when using twisted pair as the bus.
According to the CAN protocol, each CAN information frame has a unique identifier. We use the CPU external SW-DIP8 switch to obtain the address information.

Interface circuit between CAN bus controller and single chip microcomputer

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号