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.
- Sample and hold amplifier AD9101 interface circuit
- Simple USB interface data acquisition system
- How to make a numeric keyboard using XIAO RP2040
- How to use ESP32 to implement the design of air quality monitoring system
- Make a capacitive soil moisture sensor using ESP32
- How to use ADXL335 to realize the design of gesture control robot
- Improvement of microcontroller-driven piezoelectric buzzer
- Microcontroller test board circuit 1
- PC infrared interface
- Usb mouse circuit diagram
- Negative voltage generation circuit diagram
- Design of infrared communication circuit based on single chip microcomputer
- Stepper motor drive circuit composed of LB1836M
- Minimum system interface circuit based on AT89C52 microcontroller
- Signal input circuit a
- Thyristor triggered interface circuit a
- 8-way switching input interface circuit
- Interface circuit between DAC0832 and 8-bit CPU
- Use MC34063 as a 12-volt programming power supply for single-chip microcomputer
- Optoelectronic interface circuit between single-channel DA chip DAC0832 and microcontroller