1. Design and Application of CAN bus isolator
Keywords: CAN bus isolator Introduction
CAN (Controller Area Network), Controller Area Network, is one of the most widely used
fieldbus CAN bus with its strong real-time, high reliability, simple structure, interoperability,
low prices, etc., can be applied to high-speed network and low-cost line network. Propose a
CAN bus isolator communication system, to be applied to an aircraft-to-ground
communications network, to achieve the speed of the aircraft and ground isolation, allowing
real-time communication between the aircraft and the ground to stabilize, T8 LED Light Tube
. The system is designed on the basis of analysis of the CAN Bus 2.0B protocol using a
structured approach to independent design of both aircraft and ground communication
protocol. The underlying module hardware design speed type is C8051F040 microcontroller
as the core of its internal integration of the CAN protocol controller, and thus simply increase
the CAN transceiver can be achieved CAN intelligent node design, composed than by MCU
with CAN protocol controller CAN node is more simple, reliable, and easy to operate. CAN
bus application layer protocol defined in writing by the user, it can better meet the design
requirements of the system. The entire system is running well, stable performance, good
communication redundancy, in line with the industrial field use requirements.
2 based on C8051F040 CAN intelligent node design
Figure 1 is based C8051F040 CAN bus hardware interface schematic circuit diagram.
C8051F040 internal integrated CAN controller, in order to enhance the system's anti-10th-
interference ability between CAN controller with TJA1040 access optocoupler 6N137, in
order to achieve the TJA1040 and outside CAN communication. Integrated transceiver
TJA1040 has instant anti-interference ability, to protect the bus to reduce RF interference, in
order to achieve the thermal protection function. Therefore, in the interference is not serious
Gallery with occasions, without increasing the optical isolation, and allows the system to
achieve the maximum communication rate or distance. If the use of opto-isolators, should try
to use the high-speed optical isolation, in order to reduce the time of the CAN bus effective
loop signal transmission delay. CAN isolator required data through the input and output of the
CAN bus acquisition module, interference need to add to the stability and reliability of the
system, opto-isolators. Test of the of intercellular communication compatible CAN2.0A
agreement by CAN2.0B, optocoupler 6N137 rise time of 30 ns (typical value), the isolation
voltage of 000 V, which supports the maximum frequency value of more than 30 MHz.
3 CAN bus isolation design
CAN bus isolation of the system design by the sending and receiving a two-part composition.
The sending and receiving section by the data instruction configuration, consisting of three
units of the data processing and data transmission, as shown in Figure 2. Which sent parts:
the host computer instructions configured after transmission through the FPGA to the
microcontroller, MCU itself brought the CAN bus to reach the bus driver after isolation
2. processing, and output data via the CAN bus. The receiving portion opposite. The system is
designed vehicle speed is set to 500 kHz, set the ground speed of 50 km / s, in order to
better simulate aircraft and ground communication.
The 4 isolators receiver communication protocol
The bus isolator divided into low-speed interface of two parts of the aircraft high-speed
interface and ground isolation through all the ground uplink to aircraft data. The system CAN
bus uses a master-slave mode, all bus data unified data frame without remote frame, the
data length is 8 bytes, the minimum is 0 bytes. According to the data link layer protocol,
arbitration field standard identifier of 11 (ID1O to ID0) system via the identifier to determine
the priority of data transmission. The provisions of this Agreement, ID in addition to showing
the priority data reception destination node, the source node and the data type of data
transmission. Specifically 11 ID: ID [1] (the ID bits 0 ~ 3) as a data receiving destination
node; ID [2] (the ID bits 4 to 7) for the data sent by the source node; ID [3] (ID 8 to 10) for the
data type.
This Agreement, the aircraft systems and ground systems have three nodes, node number
and ID number as shown in Table 1 below.
The 5 CAN isolator software design
5.1 CAN bus initialization
CAN bus initialization includes: I / O configuration, the configuration of the external crystal
oscillator, the opening and closing of the CAN bus, the transmitting and receiving
initialization. The initialization procedures are as follows:
void initial_can (unsigned char MsgNum, unsignedl int id)
{SFRPAGE = CONFIG_PAGE; 5.2 to send and receive program
CAN messages sent by the CAN controller auto-complete, the user simply based on the
received data frame identifier corresponding to the data transfer to the transmit buffer
register, this message object is then encoded into a command request register initiates the
transmission can send completed by the hardware. Updated regularly send data packets
object here, to send data is done automatically by the controller receives a data frame, you
can have the same identifier data frames sent. The send procedure code is as follows:
CAN message reception and transmission same done automatically by the CAN controller
the receiving program just to read the received data from the receive buffer, and then dealt
with accordingly. The method sending program is basically the same, not repeat them here.
6 key technology design and analysis
6.1 redundant design
Industrial control field situation is complicated cable due to external forces due to contact
3. failure rate is much higher than the failure rate of the node, once the failure of the cables, the
bus will lose communication ability and lead to system failures, pose a threat to the
robustness of the industrial control systems. To address this failure is the most simple,
effective way to the high failure rate of physical media redundant design. 2 bus cable, two
CAN bus transceiver, but only with a bus controller. The arbitration circuit automatic
monitoring of the state of the bus, and adaptive normal cable to complete the communication
task. A cable fault occurs, the device automatically alarm to remind staff overhaul. Equipment
spare cable repair process, continue to work. Cable redundancy is designed to achieve
compatibility with usually CAN bus communication system code level. Arbitration circuit set in
between the bus controller with two bus transceiver, monitoring the status of the CAN bus
cable, adaptive switching and alarm. Device messages sent to other nodes, the bus
controller to send the same message to two bus; receive messages, the arbitration circuit
cable fault, has been using the bus (main bus) packets receiving. If the bus (from the bus)
failure, fault monitoring circuit an interrupt signal a fault to the host computer, and at the
same time in the normal state bus still bear the normal communication tasks; master if the
bus is a failure, fault monitoring circuit to computer at the same time to issue an interrupt
signal, automatically switching into a bus, in order to ensure the device is working properly.
Bus switching action will only occur are using cable failure, which can improve the stability of
the communication, to reduce the probability of failure-to-answer.
6.2 Receiving data ID is not filtered to achieve
In the reception process of the CAN bus, the general implementation are sending the ID and
the receiver ID that matches the way, that is, at the receiving side to receive, while the ID
filtering achieve arbitrary receiving mode, while the present design, as long as there is data
to start receiving the ID number of the filter, so that the test may be better, for example, a
device carried by the ID number issued by the device due to various reasons and the
receiving side the received ID does not match, this can be judged may receive interference ,
or the device itself is a problem. The filtration method of the ID numbers do not primarily
through the request register, the command of the reception device, a message mask register,
the arbitration register message control register and the command mask register set to
achieve, T8 LED Light Tube. The realization of the program are as follows: 7 Conclusion
This paper presents the implementation of a CAN bus isolator. CAN intelligent node C8051F
MCU with CAN bus controller realized, increasing the redundancy of the CAN node design,
to improve the stability of the communication, to reduce the probability of failure-to-answer;
filtering of CAN data reception, better test system reliability and monitoring functions, when
not known equipment sent a message received can accurately locate the position of the
equipment failure. This program to achieve the CAN bus isolator has been successfully
applied to a particular model of aircraft ground testing Taichung, testing and debugging, the
system is stable, to meet the design requirements. And embedded CAN bus controller, a lot
of space reserved for future system upgrades.