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.
- Improved circuit diagram of 8050 transistor emitter drive relay
- Interface circuit between intelligent temperature sensor TCN75 with two-wire serial interface and 89C51 single-chip microcomputer
- Simple USB interface data acquisition system
- Interface circuit composed of 74LS164 and 8051 microcontroller
- Interface circuit between AD574A and single chip microcomputer
- Sharing the process of making a single-chip integrated digital clock
- Use microcontroller to make simple timing controller for electric fan
- PC infrared interface
- Interface and program design between digital potentiometer X9241 and PIC microcontroller
- Hard disk control circuit and original program
- Multifunctional low-power RX130 32-bit microcontroller, do you know?
- Analysis of internal reset circuit diagram of microcontroller
- Dual audio decoding electronic circuit
- Microcontroller control circuit
- Anti-interference circuit
- Address decoding interface circuit
- Switching interface circuit in timing query mode
- Microcontroller hand washing controller circuit diagram
- Interface between serial IO port AD converter and microcontroller
- Communication between 8031 microcontroller and PC-1500 computer