introduction
CAN, the full name of which is "Controller Area Network", is one of the most widely used field buses in the world. As a remote network communication control method with advanced technology, high reliability, complete functions and reasonable cost, CAN-bus has been widely used in various automation control systems and has incomparable advantages.
The new 16-bit dsPIC30F6014 digital signal controller combines the control advantages of a microcontroller with the high-speed computing characteristics of a digital signal processor (DSP), providing a single-chip solution for embedded systems.
This paper is based on the CAN protocol and combines the outstanding performance of dsPIC30F6014. In the process of designing the communication interface, a CAN node design method based on the dsPIC30F6014 digital signal controller is proposed.
1 dsPIC30F6014 Digital Signal Controller and CAN Bus
1.1 Features of dsPIC30F6014 Digital Signal Controller
The dsPIC30F6014 digital signal controller (DSC) is a single-chip embedded controller that integrates the control functions of a microcontroller (MCU) and the computing power and data throughput of a digital signal processor (DSP). It can operate at speeds of up to 20 and 30 MIPS, is equipped with self-programmable flash memory, and can operate within industrial and extended temperature ranges. The dsPIC30F6014 digital signal controller, which is based on a 16-bit microcontroller, not only has powerful peripherals and fast interrupt processing capabilities, but also integrates the functions of a digital signal processor that can manage high-speed computing activities. The dsPIC30F CPU module uses a 16-bit (data) modified Harvard architecture with an enhanced instruction set that includes strong support for DSP. The CPU has a 24-bit instruction word with a variable-length opcode field. The program counter (PC) is 24 bits wide and can address up to 4M × 24 bits of user program memory space. A single-cycle instruction prefetch mechanism is used to help maintain throughput and provide predictable execution. Equipped with 144K bytes of enhanced flash memory, 8K bytes of static RAM, and 8K bytes of EEPROM, it can support large and complex applications. The dsPIC series products are different from existing embedded systems. The system integrates oscillators, low voltage detection, and watchdog timers. The products do not need to use additional components, which can reduce the motherboard area and system costs, and provide a single chip solution for embedded systems. In addition, it also has a series of on-chip functions, including I/O ports, timers, input capture, output comparison, UART, 12-bit A/D converter, SPI interface, I2C interface, and CAN communication modules. The structure diagram is shown in Figure 1:
这些特性使之成为需要更高精确度、更快转速或无传感器控制的电机控制应用领域如非传感无刷直流电机、磁阻转换和感应电机的理想解决方案,另外还可以应用于因特网接入设备和汽车产品;生物特徵检测保护--如指纹识别;不间断电源、电源管理和话音开关(话音识别系统)等领域。
1.2 CAN bus technical features
CAN is a network mainly used for monitoring and controlling various processes (equipment). It was originally designed by the German company BOSCH for automobile monitoring and control systems. Due to its excellent characteristics and high reliability, CAN is particularly suitable for the interconnection of monitoring equipment in industrial processes. Therefore, it is increasingly valued by the industry. Specifically, CAN has the following characteristics:
(1) CAN can work in multi-master mode. Any node on the network can actively send information to other nodes on the network at any time, regardless of master or slave, and the communication mode is flexible.
(2) CAN can transmit and receive data in point-to-point, point-to-multipoint (group) and global broadcast modes;
(3) Node information on the CAN network can be divided into different priorities to meet different real-time requirements;
(4) CAN uses non-destructive bus arbitrage technology. When two nodes send data to the network at the same time, the node with lower priority will actively stop sending data, while the node with higher priority can continue to transmit data without being affected, which greatly saves the bus arbitrage conflict time and will not cause network paralysis even when the network load is heavy;
(5) The maximum direct communication distance of CAN can reach 10km (rate is less than 5kbps), and the maximum communication rate can reach 1Mkbps (at this time the maximum distance is 40m).
2 CAN Node Design
2.1 CAN node hardware design
Figure 2 shows an example of a CAN bus network. The figure shows three CAN network implementation methods: microcontroller + CAN controller + CAN transceiver; microcontroller with integrated CAN controller + CAN transceiver; CAN serial I/O device + CAN transceiver. Node 1 is composed of MICROCHIP's dsPIC30F6014 integrated CAN controller + MCP2551CAN transceiver; node 2 is composed of MICROCHIP's PIC microcontroller + MCP2550 serial CAN controller with SPI interface + MCP2551CAN transceiver; the CAN node of the PC is composed of Philips' SJA1000CAN controller + PCA82C250CAN transceiver. The research and experimental results of this article are completed under this network framework.
Obviously, dsPIC30F6014 can be connected to the CAN communication network by adding CAN bus transceiver circuit, which greatly simplifies the design of the communication system and reduces the probability of interference to the communication nodes. The CAN module is connected to the physical bus through the CAN controller interface chip MCP2551. MCP2551 is a fault-tolerant high-speed CAN device that can be used as a CAN protocol controller and physical bus interface. MCP2551 can provide differential transceiver capabilities for the CAN protocol controller, which fully complies with the ISO-11898 standard, including meeting the 24V voltage requirement. Its operating rate is up to 1 Mb/s.
2.2 CAN node software design
The 3-layer structure model of CAN bus is: physical layer, data link layer and application layer. The development of the system is mainly based on the design of application layer software. The software design of CAN bus node mainly includes three parts: CAN node initialization, message sending and message receiving. Initialization program design is very important for the normal operation of CAN bus node. It mainly includes the setting of working mode, receiving mask register and receiving code register, bus timer and interrupt enable register. MICROCHIP provides developers with a wealth of development tools and application libraries, which greatly improves the efficiency of code development. Since the CAN protocol does not specify the allocation of information identifiers, different methods can be used according to different applications. Therefore, it is very important to determine the allocation of CAN identifiers when designing a CAN-based communication system. The allocation and positioning of identifiers is also one of the main items of higher-level solutions. The current popular CAN application layer protocols are CANOpen protocol and DeviceNet protocol. DeviceNet protocol is suitable for factory automation control, and CANOpen protocol is suitable for all mechanical embedded networks. For small networks (as shown in Figure 2), Modbus protocol is a good solution. Modbus protocol is a universal language used in electronic controllers. Through this protocol, controllers can communicate with each other and with other devices via a network (such as Ethernet). It has become a universal industrial standard. With it, control devices produced by different manufacturers can be connected to an industrial network for centralized monitoring. Modbus protocol supports master/slave communication as well as peer-to-peer communication. Therefore, Modbus protocol can not only support RS232 and RS485 networks, but also give full play to the performance and communication efficiency of CAN-bus networks.
3 Issues that should be noted in system application
In actual operation, CAN bus failure and frame loss during data transmission are often encountered. The main reasons for correction are as follows:
(1) In order to further improve anti-interference measures, an isolation circuit composed of high-speed isolation devices such as 6N137 should be used between the CAN controller and the transceiver. At the same time, a DC-DC module should be used to isolate the power supply to enhance the anti-electromagnetic interference capability and protect the system circuit from network influences.
(2) The two 120 ohm resistors at both ends of the bus play a very important role in matching the bus impedance. If they are ignored, the anti-interference and reliability of data communication will be greatly reduced, or even communication will be impossible.
(3) When designing software, the setting of the CAN bus timer is very critical. All controllers on the CAN bus must have the same baud rate and bit length. However, different controllers are not required to use the same master oscillator clock. If the clock frequencies of the controllers are different, the baud rate must be adjusted by adjusting the number of time shares in each segment. The following are some requirements for time segment programming:
• Propagation segment + Phase buffer segment 1 > = Phase buffer segment 2
• Phase Buffer Segment 2 > Sync Jump Width
Typically, sampling of the bit should occur around 60-70% of the bit time, depending on system parameters.
Conclusion
The innovative viewpoint of this paper is: the implementation scheme of CAN node using dsPIC30F6014 digital signal controller is introduced in detail. The research and test results show that CAN node constructed by dsPIC30F6014 digital signal controller has many excellent performances and can give full play to the functions of the node, providing a new practical scheme for CAN node design of embedded system.
Previous article:Design of electronic password lock based on Max+Plus II and VHDL
Next article:Design of wheel tread scratch detection system based on DSP
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Negative ion generator export certification
- Help
- 【RT-Thread Reading Notes】——The harder you work, the luckier you will be
- DSP2812 FIFO usage
- The best video to introduce you to Matter is here! Check it out now.
- Design summary of RGB to VGA module
- About connecting Raspberry Pi to SensorTile.box via Bluetooth
- Last day! ST live broadcast with prizes | ST60 contactless connector and application exploration
- "The domineering hacker changed my outline" and the fan hacked the author's account to write a new plot of 20,000 words because he thought the author's writing was too bad.
- Playing with Zynq Serial 10 - Using GIT for Project Backup and Version Management 2