Design of CAN bus interface conversion card based on single chip microcomputer

Publisher:Xiaoxue666Latest update time:2011-11-05 Keywords:MSP430  interface Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction
Controller Area Network (CAN) is a serial communication protocol developed by Mercedes-Benz in Germany in the 1980s to solve the data exchange between numerous automotive control devices and instruments. As a field bus, it is widely used in various industrial sites, and works in master-slave mode or multi-master mode according to different needs. The communication medium used by the CAN bus is twisted pair or other cables, and the transmission rate can reach 1Mb/s. There are two differences between the CAN bus and other communication networks: First, the message transmission does not contain the target address. It is based on the whole network broadcast. Each receiving station filters the message according to the identifier reflecting the nature of the data in the message, and accepts the messages that should be received and discards the messages that should not be received. Its advantages are that it can be online and offline, plug-and-play, and multi-station receiving; second, it particularly strengthens the attention to data security to meet the needs of control systems and other systems with higher data requirements. In view of its extremely high reliability, unique design, high speed and long transmission distance, it is particularly suitable for the interconnection of industrial field monitoring equipment.

2 System Introduction
CAN bus adopts bus network topology, as shown in Figure 1. Using the CAN bus's unique multi-master transmission method, each extension will actively send data when it needs it, without the need for the host to constantly poll, thereby saving data traffic on the network and improving transmission efficiency.

Most of the existing monitoring equipment uses RS-232 or RS-485 serial communication. In order to build a CAN communication network on this basis, the author designed a portable CAN bus interface conversion card. The conversion card can use a lithium battery as the power supply, with low power consumption, small size and light weight, which can meet the portable needs.

3 System Hardware Structure Design
Texas Instruments The company's MSP430 series microcontroller is an ultra-low power microcontroller with a voltage range of 1.8V to 3.6V. The processor achieves maximum code efficiency through a 16-bit RISC system, a 16-bit CPU, integrated registers and constant generators. The MSP430 series ultra-low power microcontroller is an ideal microcontroller for industrial control, digital motor control, handheld instruments and other equipment. This design uses the MSP430F449 microcontroller, which has a wealth of on-chip modules: up to 8 12-bit A/D converters, 48 ​​I/O ports, 2 UART watchdogs, 2 built-in 16-bit timers, Flash memory that can be simulated online, 7-way PWM output, LCD driver, etc. The electrical structure principle block diagram of the portable CAN bus interface conversion card is shown in Figure 2. It consists of a power module, a CAN communication interface circuit, a serial port level conversion circuit, a cache and an LCD module.

3.1 CAN communication interface circuit
The system hardware is based on Philips' SJA1000 CAN bus controller, which is an independent CAN bus controller mainly used in industrial environments. It is also a substitute for Philips Semiconductor PCA82C200 CAN controller (Basic CAN). SJA1000 connected by a simple bus can complete all the functions of the physical layer and data link layer of the CAN bus. SJA1000 consists of CAN core module, send buffer, interface FIFO, acceptance filter and interface management logic. The CAN core module is mainly responsible for the transmission and reception of CAN information frames and the implementation of CAN protocol, and the interface management logic is responsible for the interface between SJA1000 and the main controller. When transmitting data, the main controller sends the identifier and data into the send buffer and requests to send, thereby starting the CAN core module to read the data in the send buffer, and then encapsulates it into a complete CAN information frame according to the CAN protocol, and sends it to the bus through the transceiver. The capacity of the send buffer is 13 bytes. The acceptance filter unit processes the received information and sends it to the receive FIFO. The receive FIFO is 64 bytes. The PCA82C250 CAN bus transceiver is the interface between the CAN controller and the physical bus. It provides the CAN controller with the ability to send and receive differential signals to the bus. The transceiver can select three different operating modes depending on the different connections of pin 8 (RS): high speed, slope control, and standby mode. The slope of the bus can be controlled by connecting the resistor to the ground through the RS pin, and the slope is proportional to the current output on the RS pin. For applications with high transmission rate requirements, pin 8 is usually directly connected to the ground to select the high-speed mode. In this mode, the transmitter output transistor is simply turned on and off as fast as possible, and no measures are taken to limit the rising and falling slopes, so shielded cables must be used to avoid radio frequency interference. The transmit and receive ports of the CAN controller are connected to the PCA82C250 through an optoelectronic isolation circuit, which effectively suppresses the interference introduced by the bus
. 3.2 Serial port level conversion module In this design, MSP430F449 only uses one USART interface, while the CAN conversion card integrates two communication modules, RS232 and RS485. The interface type is selected by the DIP switch in the design. The RS232 and RS485 serial port level conversion modules use Maxim's MAX3221 and MAX3485 respectively. 3.3 Power supply module In addition to being powered by lithium batteries, the entire system can also be powered by external power supplies such as small transformers to meet the needs of different occasions. TPS7333 is selected as the regulated power supply of MSP430F449 to output a 3.3V system power supply voltage. To ensure normal data transmission, the power supply circuit is also equipped with a bq24012 battery charging management circuit to provide a timely alarm when the battery power is low and may affect normal data transmission, reminding you to replace the battery or charge it. 3.4 Cache and LCD module In order to save the working time of the PC, the TMS44400 dynamic memory is used to expand the dynamic storage interval. When transmitting data, the header information is first read to determine whether it is real-time transmission or cache operation. MSP430F449 has an LCD driver module. The EDS805 LCD display module of Dongxian Company is selected in the design to display the system status characteristics, data transmission speed, remaining time, etc. in real time. It can also provide power undervoltage alarm.









4 Software Design
The core structure of MSP430 adopts the Reduced Instruction Set (RSIC) design with a highly transparent format. The reception and transmission of CAN information are automatically completed by the CAN controller. The program only needs to read the corresponding data from the corresponding buffer and then perform the corresponding processing. In this system, the microcontroller enters a low-power sleep state after completing the initialization task. Any interrupt can wake it up and execute the corresponding interrupt service subroutine. The two interrupt sources of the system are PC serial port transmission and lower computer CAN information reception. The advantage of this is to avoid data retransmission caused by data exceeding the limit as much as possible. Figure 3 shows the system CAN initialization process, and Figure 4 shows the transmission interrupt service program process. Due to space constraints, this article omits the reception interrupt service program process, and its process is roughly the opposite of the transmission process.

5 Conclusion
This article introduces the software and hardware design of the CAN bus communication interface conversion card, hoping to provide some reference and help for designers studying CAN bus applications. The CAN bus communication interface conversion card introduced has a simple structure and strong anti-interference ability, and is very suitable for forming small and medium-sized distributed measurement and control networks. As the number of devices supporting the CAN protocol continues to increase, the price of CAN devices will further decrease, and their application in the field of automation will become more and more extensive.

Keywords:MSP430  interface Reference address:Design of CAN bus interface conversion card based on single chip microcomputer

Previous article:Design of Multimeter Based on 51 Single Chip Microcomputer
Next article:Hardware circuit design based on STC single chip microcomputer learning platform

Recommended ReadingLatest update time:2024-11-16 22:21

MSP430 program --- P1.0 port external interrupt
Add the corresponding code in the interrupt to complete the counting //P1.0 port is set as external interrupt, and multi-task is used for expansion   #include msp430x41x.h unsigned char ISR_Symbol=0; //task symbol   void Iint_Port1(void) {      P1DIR&=~BIT0; //Set to input direction      P1SEL&=~BIT0;
[Microcontroller]
A brief discussion on the functional application of TSS-5 single-board controller and the characteristics of MSP430
PTN is a connection-oriented packet technology with end-to-end service management, hierarchical OAM, carrier-grade protection and other transmission features. It is mainly used to carry carrier-grade Ethernet services and is compatible with TDM, ATM and other services. PTN packet transport network is currently recogni
[Microcontroller]
A brief discussion on the functional application of TSS-5 single-board controller and the characteristics of MSP430
Design of smoke sensing alarm circuit with emergency lighting function
  Smoke alarms are generally composed of smoke sensors and smoke detection chips. Emergency lighting generally consists of a set of charging and discharging circuits connected to the indoor power supply. In buildings, they all need to be wired separately, which wastes resources and affects the appearance. If there is
[Microcontroller]
Design of smoke sensing alarm circuit with emergency lighting function
MSP430G2452 button controls the LED light on P1.0 port
The MSP430G2452 button (P1.3) controls the P1.0 (LED) light on and off C language program. P1.3 is the input state with a pull-up resistor, and P1.0 is the output state. When P1.3 is pressed, the P1.0 port LED light turns on. When the button is released, the LED light turns off, and the cycle continues indefinitely! Th
[Microcontroller]
Experimental Challenge: Make a DDS using MSP430
http://115.com/file/c2n658ld    A software you need to use http://www.scienceprog.com/wp-content/uploads/2008/03/avrdds_proteus.zipSee    the circuit diagram and perform simulation (double-click U3, select the HEX file, and press F12 to run the simulation) The circuit diagram is also available at: Connecti
[Microcontroller]
Experimental Challenge: Make a DDS using MSP430
MSP430 Clock Settings (V)
4. CPU running at DCO clock:    The slowest frequency we can run DCO is about 1MHz (which is also the default speed). Therefore, we will start by switching MCLK to DCO. In most systems, you will want to run ACLK at VLO or crystal. Since ACLK is running at VLO in our current code, we will turn on DCO to run.    #inc
[Microcontroller]
Application design of MSP430 single chip microcomputer in power system
1 Introduction The MSP430 series of microcontrollers is a 16-bit ultra-low power mixed signal processor that was launched by Texas Instruments (TI) in 1996. It has been highly praised by users for its ultra-low power consumption, powerful processing capabilities, high-performance analog techno
[Microcontroller]
Application design of MSP430 single chip microcomputer in power system
Dual battery power supply design based on MSP430F168
Most portable devices use components that are light, small, and powerful. The power supply occupies an indispensable and important position among all components. Lithium-ion batteries are popular in the market because of their small size and large capacity, but for long-term outdoor operations, a lithium battery is sti
[Microcontroller]
Dual battery power supply design based on MSP430F168
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号