Abstract: At present, the following ten kinds of field bus, the bus between the different specifications, has its own scope of application, including CAN (Controller Area Network) bus with its high performance, high reliability and unique design more and more attention has been paid, and has been recognized as some of the most promising one field bus. In this paper, intelligent instruments in general CAN communication interface hardware design and software block diagram.
1 Introduction
In the field of computer data transmission, a long time to use RS-232 communication standard, although they are widely used, but it is a low data rate, and point to point data transmission standard, without the ability to support a higher level of computers of functions. Meanwhile, in complex or large-scale applications (such as industrial control or automation in the field), takes a lot of sensors, actuators and controllers, they are usually located in a very wide range, so are indeed at the bottom need to design a low cost and can withstand the environment of industrial on-site communications systems, field bus (Field Bus) produced in this context.
Fieldbus intelligent field devices are connected and digital automation system, two-way transmission, multi-branch structure of the communications network. The topology shown in Figure 1. Fieldbus technology since the birth of 70 years so far, because of its reduced system, cable, simplifying installation, maintenance and management, and lower system investment and operating costs, increase system performance, the advantages of causing widespread attention, get big range of push.
CAN is an effective support of distributed control or real-time control of the serial communications network, originally from Germany BOSCH company vehicle monitoring and control system designed. Because the characteristics of CAN bus itself, its scope of application now no longer limited to the automobile industry to the process industry, mechanical industry, textile machinery, agricultural machinery, robots, CNC machine tools, medical devices, sensors and intelligent instruments and other sectors.
Intelligent Instrumentation is an important part of automation disciplines. With the rapid development of science and technology, especially in microelectronics, computer and communications technology changing so rapidly that smart meters toward digital networking and intelligent direction, while smart meters can be man-machine dialogue and dialogue with external equipment, connected by field bus into automated test systems. On the other hand, the user through the keyboard and display panel, select the measurement function can be dialogue, set the parameters. Of course, the industrial computer through the bus is also available measured data nodes.
2 CAN Interface Design
CAN bus is a serial data communication protocol, CAN bus communication interface in the integrated physical layer CAN protocol and data link layer functionality, you can complete the processing of communications data framing. CAN bus interface of the specific circuit design shown in Figure 1.
I use the SJA1000 CAN controller as a flow meter, and the CPU (MCU) of the I / O port directly connected to CAN bus and through PCA82C250 composition. This structure is very easy to implement CAN messaging network nodes in order to achieve on-site control.
SJA1000, AD0 ~ AD7 to connect to the MSP420F149 the P0 port, INT received P1.0, / CS received P1.1, / RD to connect to P1.2, / WR is connected to P1.3, ALE connected to P1.4, SJA1000, respectively RX0 and through two high-speed optocoupler TX0 CNW137 and PCA82C250 connected, the connection to the CAN bus.
PCA82C250 for the CAN bus transceiver is a CAN controller and CAN bus interface device, sent on the CAN bus differential, the RS pin is used to select PCA82C250 of work: high-speed mode, the slope method. RS ground for high-speed, RS pin series with a resistor and then ground, used to control the up and down the slope, thereby reducing RF interference. RS pin connected high, PCA82C250 in a wait state. At this point, turn off the transmitter, the receiver is in low current work on the CAN bus can be dominant position to react to notify CPU. Experimental data show that 15 ~ 200K range for the better, in this case, you can use parallel lines or twisted pair for the bus, this article PCA82C250 the slope of the resistance to take 30K.
CNW137 for high-speed optocoupler, the maximum speed of 10Mbps, the total for the protection of CAN controller SJA1000. CAN bus termination resistors play an important role, not appropriate to make data communication interference resistance and reliability greatly reduced, if not impossible to communicate a range of 108 ~ 132Ω, this use of the resistance of 124Ω.
2.1 SJA1000 features
CAN communication protocol completed mainly by the CAN controller. SJA1000 is suitable for automotive and general industrial environment, controller area network (CAN) The high level of integration independent controller, high performance communications protocol with the completion of all necessary features required, with a simple bus connection SJA1000 complete physical layer and data link Layer all the features of the microcontroller application layer functions can be completed, SJA1000 to provide a multi-purpose interface.
SJA1000 is a stand-alone CAN controller, which is Philips's other CAN controller PCA82C200 successor products, both software and pin compatible with PCA82C200. But it is not just PCA82C200's a simple alternative, it added many new features that make their performance better, especially for the system optimization, diagnosis, and higher maintenance requirements of occasions.
SJA1000 functional block diagram shown in Figure 2, consists of the following components: interface management logic; send buffer that can store a complete packet (extended or standard); acceptance filter; receiver FIFO; CAN core module .

2.2 82C250
SJA1000 microcontroller connected to one end and the other end with the CAN bus. However, in order to improve the CAN bus Microcontroller drive capability, can 82C250 CAN controller and physical bus as the interface between, in order to provide differential transmit capability to the bus and the CAN controller on the differential receive capability. 82C250 main features are as follows:
- Compatible with ISO/DIS11898;
- High-speed (up to 1 Mb / s);
- Anti-car environment with instantaneous interference and protection of the bus capacity;
- Reduce the slope of the RF interference control;
- Thermal protection;
- Protection short circuit between the battery and the ground;
- Low-current standby mode;
- A node in power-down will not affect the bus;
- Can be connected to 110 nodes.
CAN communication block diagram
SJA1000 During operation, the control must be configured before power lines (interrupt, reset, chip select, etc.) used to establish communication between the controller and the CAN hardware connection.
If, after power-independent CAN controller in the pin 17 by a reset pulse (low), it can enter the reset mode. Pre-register settings in the SJA1000, CAN controller reset mode by reading the / symbol to check whether the request has reached the reset mode, because the configuration information of the register can only be written in the reset mode, involving the control register (CR), Acceptance code register (ACR), acceptance mask register (AMR), bus timing register (BTRO and BTR1) and output control register (OCR) program initialization.
Clock frequency register, you can choose BasicCAN or PeliCAN mode, set the CLKOUT pin can be used to select the frequency, set whether to use the bypass CAN input comparator and whether to use the TX 1 output is used as a dedicated receiver interrupt output.

Acceptance code and set the acceptance mask register can filter information defined as information received acceptance and acceptance of the code related to code the definition of acceptance mask bit more code.
Bus timing registers, the definition of the bus bit rate. CAN bus output control register definition and TX1 output pin TX0 output mode, the definition of TX0 and TX1 output pin configuration is vacant, the drop-down, pull or push-pull, and polarity. Interrupt register settings allow the identification of the interrupt source.
Conclusion
More intelligent devices and PC connection via CAN interface and into the bus network, the system runs well. A field bus intelligent instrument system interference is strong, reliable performance, whether it is measuring the speed, precision, automated procedure or cost-effective are the traditional instruments can not match, the future instrument development.