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

Publisher:SparkStar22Latest update time:2010-01-18 Source: 国外电子元器件Keywords:MSP430 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 many 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' 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 through the DIP switch. The RS232 and RS485 serial port level conversion modules are Maxim's MAX3221 and MAX3485 respectively.

3.3 Power 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 promptly 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 PC, TMS44400 dynamic memory is used to expand the dynamic storage interval during design. When transmitting data, the header information is read first to determine whether it is real-time transmission or cache operation. MSP430F449 has a liquid crystal driver module. The EDS805 liquid crystal 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 Reference address:Design of CAN bus interface conversion card based on MSP430 single chip microcomputer

Previous article:Grayscale image chaos secure communication based on single chip microcomputer
Next article:Design and implementation of digital controlled DC voltage regulated power supply based on single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 19:31

Design of CAN bus interface conversion card based on MSP430 series microcontroller
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
[Microcontroller]
Design of CAN bus interface conversion card based on MSP430 series microcontroller
Research on dust removal competition robot and its control strategy
At present, the development of robots has become an important standard for measuring the scientific and technological strength of various countries. The design of robots in developed countries such as Europe, the United States, and Japan has become increasingly mature, with a wide variety and powerful functions. Chi
[Microcontroller]
Research on dust removal competition robot and its control strategy
The connection program between MSP430F1121 and LCD driver chip PCF8576
MSP430F1121 and LCD driver chip PCF8576 connection program #include "msp430x11x1.h" #define uint unsigned int #define uchar unsigned char //Device address uchar PCF8576=0x70; //Memory data definition uchar ByteCnt; //I2C data byte counter uchar SlvAdr; //Controlled device addr
[Microcontroller]
Design of wireless environment monitoring sensor system based on MSP430F149
Introduction Intelligent sensors, which are composed of sensor technology, communication technology and computer technology, have attracted people's attention in process control and signal monitoring due to their high accuracy, good reliability and diverse functions, and have become a hot topic of research at
[Test Measurement]
MSP430F149 simulates IIC reading and writing 24C02 program
The board is equipped with an EEPROM memory, model AT24C02. The hardware connection of the board is: SCL--- P2.4, SDA--- P2.5. Straightforward, paste the program! ========================24cxx.h file====================== ===#ifndef _24CXX_H_#define _24CXX_H_#include msp430x14x.h #define WRITE_ADDR 0xA0 //A0 A1 A2
[Microcontroller]
MSP430F149 simulates IIC reading and writing 24C02 program
Design and implementation of automatic avoidance car based on MSP430
0 Introduction Robot competition is a high-tech activity carried out internationally in recent years. It integrates high-tech, entertainment and competition, and has attracted widespread attention and great interest from many scholars. The performance and avoidance control of the robot car subsystem during movement a
[Microcontroller]
Design and implementation of automatic avoidance car based on MSP430
MSP430F249UART
//****************************************************************************** //   MSP430x24x Demo - USCI_A0, 9600 UART Echo ISR, DCO SMCLK // //   Description: Echo a received character, RX ISR used. Normal mode is LPM0. //   USCI_A0 RX interrupt triggers TX Echo. //   Baud rate divider with 1MHz = 1MHz/9600 = ~10
[Microcontroller]
UART, IrDA, SPI, I2C MSP430 learning
The first difference between SPI, IIC and UART is of course the name:        SPI (Serial Peripheral Interface);              I2C (INTER IC BUS)            UART (Universal Asynchronous Receiver Transmitter) Second, the difference is in the electrical signal line:        The SPI bus consists of three
[Microcontroller]
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号