Abstract: Currently, there are more than a dozen types of fieldbuses, each with different specifications and applicable scopes. Among them, the CAN (Controller Area Network) bus is increasingly valued for its high performance, high reliability, and unique design, and is recognized as one of the most promising fieldbuses. Keywords: Microcontroller; Intelligent Instrument; CAN 1 Introduction In the field of computer data transmission, the RS-232 communication standard has long been used. Although it is widely used, it is a low data rate and point-to-point data transmission standard, unable to support higher-level computer-to-computer functional operations. At the same time, in complex or large-scale applications (such as industrial field control or production automation), a large number of sensors, actuators, and controllers are required, which are usually distributed over a very wide area. Therefore, at the lowest level, there is indeed a need to design a low-cost communication system that can withstand the industrial field environment. Fieldbus emerged in this context. Fieldbus is a digital, bidirectional, multi-branch communication network that connects intelligent field devices and automation systems. Since its inception in the 1970s, fieldbus technology has attracted widespread attention and promotion due to its advantages in reducing system cabling, simplifying system installation, maintenance and management, lowering system investment and operating costs, and enhancing system performance. CAN, an effective serial communication network supporting distributed or real-time control, was initially designed by the German company Bosch for automotive monitoring and control systems. Due to the inherent characteristics of the CAN bus, its applications are no longer limited to the automotive industry but have expanded to process industries, machinery industries, textile machinery, agricultural machinery, robotics, CNC machine tools, medical devices, sensors, and intelligent instruments. Intelligent instruments are an important component of automation. With the rapid development of science and technology, especially the ever-changing microelectronics, computer, and communication technologies, intelligent instruments are developing towards digitalization, networking, and intelligence. Intelligent instruments can engage in human-machine dialogue and communicate with external instruments and equipment, connecting to automatic testing systems via fieldbus. Furthermore, users can select measurement functions and set parameters through a dialogue interface using the keyboard and display screen on the panel. Of course, data from the measurement nodes can also be obtained through the industrial computer connected to the bus. 2. CAN Interface Design The CAN bus is a serial data communication protocol. The CAN bus communication interface integrates the physical layer and data link layer functions of the CAN protocol, enabling frame processing of communication data. The SJA1000 is used as the CAN controller for the flow meter, directly connected to the I/O port of the CPU (microcontroller), and then connected to the PCA82C250 to form the CAN bus. This structure easily realizes information transmission and reception in the CAN network node, thereby achieving field control. The AD0~AD7 pins of the SJA1000 are connected to the P0 port of the MSP420F149, INT to P1.0, /CS to P1.1, /RD to P1.2, /WR to P1.3, and ALE to P1.4. The RX0 and TX0 pins of the SJA1000 are connected to the PCA82C250 via two high-speed optocouplers CNW137, and then connected to the CAN bus. The PCA82C250 is a CAN bus transceiver, serving as the interface device between the CAN controller and the CAN bus. It transmits data differentially via the CAN bus. Its RS pin is used to select the PCA82C250's operating mode: high-speed mode or slope mode. Grounding RS enables high-speed mode. Connecting a resistor in series with the RS pin before grounding controls the rising and falling slopes, thereby reducing radio frequency interference. When the RS pin is high, the PCA82C250 is in a standby state. In this state, the transmitter is off, the receiver operates at low current, and can respond to dominant bits on the CAN bus, notifying the CPU. Experimental data indicates that 15–200KΩ is an ideal value range. Under these conditions, parallel or twisted-pair cables can be used as the bus. In this paper, the slope resistor for the PCA82C250 is 30KΩ. The CNW137 is a high-speed optocoupler with a maximum speed of 10Mbps, used to protect the CAN master controller SJA1000. The terminating resistor of the CAN bus plays a crucial role. An inappropriate resistor can significantly reduce the anti-interference capability and reliability of data communication, or even prevent communication altogether. The range is 108–132Ω; this paper uses a 124Ω resistor. 2.1 SJA1000 Functions The CAN communication protocol is primarily implemented by the CAN controller. The SJA1000 is a highly integrated independent controller suitable for automotive and general industrial Controller Area Networks (CAN) environments. It possesses all the necessary characteristics required to implement high-performance communication protocols. With its simple bus connection, the SJA1000 can perform all functions of the physical layer and data link layer. Application layer functions can be performed by a microcontroller, and the SJA1000 provides a versatile interface for them. The SJA1000 is an independent CAN controller, a successor to Philips' PCA82C200 CAN controller, and is compatible with the PCA82C200 in both software and pin configuration. However, it is not merely a simple replacement for the PCA82C200; it adds many new features, resulting in better performance, especially suitable for applications with high requirements for system optimization, diagnostics, and maintenance. The functional block diagram of the SJA1000 is shown in Figure 2, consisting of the following parts: interface management logic; transmit buffer, capable of storing a complete message (extended or standard); acceptance filter; receive FIFO; CAN core module. 2.2 82C250 One end of the SJA1000 is connected to the microcontroller, and the other end is connected to the CAN bus. However, to improve the microcontroller's ability to drive the CAN bus, the 82C250 can be used as the interface between the CAN controller and the physical bus, providing differential transmit capability to the bus and differential receive capability to the CAN controller. The main characteristics of the 82C250 are as follows: • Compatible with ISO/DIS11898 standard; • High speed (up to 1 Mb/s); • Capable of resisting transient interference in automotive environments and protecting the bus; • Slope control to reduce RF interference; • Thermal protection; • Protection against short circuits between battery and ground; • Low-current standby mode; • Power loss of a node will not affect the bus; • Up to 110 nodes can be connected. 3. CAN Communication Flowchart During SJA1000 operation, control lines (interrupts, reset, chip select, etc.) must be configured before power-on to establish a hardware connection for communication with the CAN controller. Initialization, CAN communication uses interrupt-based data transmission and reception subroutines. If the independent CAN controller receives a reset pulse (low level) on pin 17 after power-on, it can enter reset mode. Before setting the SJA1000 registers, the CAN controller checks if reset mode has been reached by reading the reset mode/request flag, as registers for configuration information can only be written in reset mode. This involves initialization programming of the control register (CR), acceptance code register (ACR), acceptance mask register (AMR), bus timing registers (BTRO and BTR1), and output control register (OCR). The clock divider register allows selection of BasicCAN or PeliCAN operating modes, enables the CLKOUT pin for frequency selection, sets whether to use the bypass CAN input comparator, and whether the TX1 output is used as a dedicated receive interrupt output. The acceptance code and acceptance mask register settings can filter information. An acceptance code is defined for the received information, and an acceptance mask code is defined by comparing the bits related to the acceptance code. The bus timing register defines the bit rate on the bus. The output control register defines the output modes of the CAN bus output pins TX0 and TX1, defining the configuration of TX0 and TX1 output pins as floating, pull-down, pull-up, or push-pull, as well as their polarity. The interrupt register sets the allowed interrupt sources. 4. Conclusion: Multiple intelligent instruments are connected to a PC via the CAN interface to form a bus network, and the system operates well. This fieldbus-based intelligent instrument system has strong anti-interference capabilities and reliable performance. Its measurement speed, accuracy, automation programs, and cost-effectiveness are unmatched by traditional instruments, representing the future direction of instrument development.