Font Size: a A A

The Design Of CAN Bus Communication Based On STM32

Posted on:2014-02-01Degree:MasterType:Thesis
Country:ChinaCandidate:X L KangFull Text:PDF
GTID:2248330395496700Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Distributed industrial control system is one of the most dynamic part in the field ofindustrial control.Depending on the fast developed technology of computer hardware andsoftware and progress of integrated circuit technique,Distributed industrial control systemhas achieved rapid development in the field of industrial control area.The diversity ofcontrol and diversification of system enhance the demand on system reliability andflexibility.A typical distributed control system includes field devices, interface, computingequipments, and communications equipments. Communication demand of industrial controlsystem is becoming more and more important,no matter in industrial automation field,ormedical instruments and Transportation construction field.CAN—Controller Area Network is a multi-master network which created byBOSCH.Cause it satisfied high requirements of the system on the flexibility andreliability,it quickly becomes the most promising bus in public.First CAN was created tosolve the data exchange problem between controllers and test instruments.CAN has manymasters,provides the possibility that each node communicate with others as ahost.Communication medium can be twisted pair,coaxial cable and optical fiber.The biggest characteristic of the CAN protocol is encoding communication datablock,abolishing the traditional station address coding,its communication rate can be up to1MB/s.So that we can make the network node number not limited theoretically.CRC checkfunction of CAN ensures the reliability of data communication. The length of data is up toeight data bytes.While guaranteed the length of control command,it also ensures improvedthe real-time communication and won’t take too long bus time at the same time.Thearbitration mechanism of CAN protocol guarantees to avoid clash when two units sendmassages at the same time when allots the bus.Due to the high reliability and flexibility of CAN bus protocol,a variety of control chipsof CAN communication system emerge in endlessly.The developed systems are widelyused in detection, monitoring, recording all kinds of signals.Such as automobilecommunication system, temperature humidity test system, etc.Their stable and reliableresults have been achieved in practice.This paper introduces the design of CAN buscommunication system based on STM32.In the numerous32-bit microprocessors,STM32 series is specially designed for embedded applications based on ARM Cortex-M3withthe performance,of rich superior peripheral and widely used in industrial and consumerelectronics products.Using STM32as main control chip to build high-performance, CANbus communication system will be more conducive to meet the requirements of highreliability in the production practice.In this paper, the CAN bus technology is introduced in detail,CAN bus communicationsystem based on STM32is designed and analysised.Recording and summarizing the workof each step, in this paper, the main work has the following contents:1.Introduce the CAN bus technologyThe first step of this article is to work on the CAN bus technology to conduct acomprehensive and meticulous research and learning and made a summary of thecharacteristics of CAN bus technology development.Introduced the layer structure of theCAN protocol, packet format, error and priority arbitration.2.The design of CAN communication systemPut forward the design requirements of the system.To build the basic framework of CANcommunication system based on STM32,including the system structure, hardware designand software design part.The system hardware design part includes:STM32master controlchip performance and the introduction of CAN communication module functions.Systemsoftware design includes: System application development environment, the systeminitialization process, the main program design process, the CAN module initialization andso on.3.Debugging and summaryDebugging of master controller STM32,mainly includes the main controller nodeinitialization and message receiving and sending.Debugging the system, mainly in order toensure that node can accomplish network communication.After the debug and experiment,this system works well, runs stably, satisfying the design standards.It provided a reliabletheoretical and practical basis for the application of CAN bus technology in the field ofindustrial control.
Keywords/Search Tags:CAN bus communication, STM32, MCP2515, Embedded systems, Fieldbus
PDF Full Text Request
Related items