1.1 System hardware foundation
The control system is designed based on the Atmel AT91M55800A microprocessor. AT91M55800A is a 16/32-bit microcontroller based on the ARM7TDMI core. Its processor core is a high-performance 32-bit RISC architecture; it has a high-density 16-bit instruction set and extremely low power consumption. It integrates 8 KB SRAM, vector interrupt controller VIC, advanced power management controller APMC and fully programmable external bus interface EBI on the chip; it has 3 USARTs, 58 programmable I/O lines, 6-channel 16-bit timer/counter, 8-channel 10-bit ADC and 2-way 10-bit DAC, providing a highly flexible and cost-effective solution for various ultra-low power applications.
Figure 1 is a hardware block diagram of the control system. The hardware design adopts a structured and modular design concept, which is easy to tailor. The communication interface includes RS232 serial communication interface, Ethernet interface and CAN bus interface. The Ethernet port can be connected to the industrial Ethernet. Combined with the ARM integrated development environment ADSl.2 and the online debugging tool Multi-ICE, the system can be simulated and traced in real time through the JTAG debugging interface and the Embedded ICE logic embedded in the processor.
1.2 System software foundation
(1) Porting of μC/OS-II
The tasks that the control system needs to complete are very complex, there are many peripherals to manage, and the programs are becoming more and more large, so porting an embedded real-time multi-tasking operating system is an inevitable choice. For small real-time control systems, the preemptive real-time multi-tasking operating system μC/OS-II with open source code, solidifiable and customizable, good portability, high stability and high reliability and a preemptive kernel is a good choice. The simple code of μC/OS-II has been applied to embedded systems such as smart meters, information appliances, wireless communication equipment and industrial machines.
It is relatively simple to transplant μC/OS-II to the AT91M5800A processor. Only three files related to the ARM architecture need to be modified: OS_CPU.H, OS_CPU_A.S and OS_CPU_C.C. The code volume is about 500 lines. The specific transplantation process will not be described in detail. There are many successful transplantation examples on the Internet. [page]
(2) Application of IEC 61131-3 standard software
The IEC 6113l-3 standard is the first programming language standard for digital control software technology formulated by the International Electrotechnical Commission (TEC) for industrial control around the world. It includes two parts: programming and common elements. Common elements describe the variables and data types of all common programming elements used in the five programming languages of IEC61131-3 (instruction list, structured text, ladder diagram, function block diagram and SFC), IEC software model and communication model; it provides rules such as how to name these software elements, declare variables, and initialize variables and data types. It is an indispensable organic component for implementing the IEC61131-3 programming system. The programming part describes two important models: the IEC software model and the communication model. These two models constitute the conceptual basis for implementing a programming system that complies with the IEC61131-3 international standard.
The IEC61131-3 standard also defines a standard function and function block algorithm library, and users can also build their own algorithm library. Since the function and function algorithm library are written in ANSI C language, the user's control algorithm program has good portability and reusability.
The application of IEC61131-3 standard software on the hardware platform based on AT91M55800A is to run the IEC runtime system as a task of μC/OS-II. The code is as follows:
2 Serial communication programming
The program written by the user in the programming system based on the IEC6113l-3 standard can be downloaded to the target system (i.e. control system) through the serial port or Ethernet port for execution after compilation and linking. The choice of communication connection between the programming system and the target system is very flexible, which can be RS232 serial communication, Ethernet communication, or other communication methods. The following is the code designed for RS232 serial communication program based on AT9lM55800A.
Create a data receiving/sending buffer in memory:
[page]
Finally, write the interface communication program between the IEC runtime system kernel and the user program:
With the above code, the embedded control system can receive the user IEC program downloaded from the host computer, and the host computer can collect and monitor the real-time data in the control system. These real-time data can also be published to the industrial Ethernet to realize information sharing.
Conclusion
This paper introduces the design and implementation of an embedded real-time measurement and control system based on ARM and IEC61131-3 standards. The system has good openness, scalability and upgradeability. RS232 communication interface, Ethernet interface and CAN bus interface are designed to meet the networking needs of modern industrial control sites. The software programming adopts the IEC61131-3 international standard, which makes the developed user program have good portability and reusability.
Previous article:Embedded development ARM system code solidification serial port implementation
Next article:ARM embedded VGA interface production
Recommended ReadingLatest update time:2024-11-16 14:57
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
- Say goodbye to 2018 and welcome 2019. See how the three pillars of China Mobile IoT dominate the field
- Using MakeCode Driver on BrainPad Development Board
- Please tell me the function of STM32 WWDG window value
- 2. Sensors used in previous "Control" competitions
- The left side is connected to the microcontroller, and the right side is the button. Why is the IO port always at a high level?
- Quickly obtain TI industrial motor drive resources and answer questions to win prizes
- Power consumption optimization design in embedded DSP design
- Activity/Inactivity recognition of LSM6DSL
- EEWORLD University - What you don't know about C language
- Fundamentals of Analog Electronics Technology (Lectured by Hua Chengying)