Compared with the communication power monitoring system developed by the traditional 51 single-chip microcomputer, the communication power system developed by combining μC/OS-Ⅱ with TMS470R1A288 has sufficient real-time performance, reliability and scalability, and is also lower in cost.
1. Transplantation of μC/OS-Ⅱ on TMS470R1A288
ARM7 (Advanced RISC Machines) is a RISC microprocessor series that is currently widely used in the embedded field. It occupies a leading position in the field of embedded system applications with its advantages of low cost, low power consumption and high performance. μC/OS-Ⅱ can be regarded as a powerful and complete multi-task scheduler with good portability. To port μC/OS-Ⅱ to the TMS470R1A288 processor of the ARM series, three files related to the ARM architecture need to be modified, which are introduced one by one below.
1.1OS_CPU.H
The modification of the data type definition part is related to the compiler used. Different compilers will use different byte lengths to represent the same data type. Since the processor's on-site registers will be saved in the stack of the currently running task when the task is switched, the OS_STK data type must be consistent with the processor's register length. Define the growth direction of the stack. The macro definition includes the macro definition of the switch interrupt and the macro definition of the task switch.
1.2 OS_CPU_A.ASM
The following four functions are implemented using ARM assembly instructions: OSStartHighRdy(), OSCtxSw(), OSIntCtxSw(), OSTickISR()
1.3OS_CPU_C.C
The transplantation of μC/OS-Ⅱ requires the user to write the following 10 simple C functions: ostaskstkinit(), ostaskcreatehook(), ostaskdelhook(), ostaskswhook(), ostaskstathook(), ostimetickhook(), ostaskidlehook(), osinithookbegin(), osinithookend(), ostcbinithook(). But the only necessary function is ostaskstkinit(), and the other 9 functions must be declared, but if there is no special requirement, you only need to simply implement them as empty functions.
2 Hardware Structure of Communication Power Supply Monitoring System
The communication power supply monitoring system designed in this scheme mainly realizes the functions of background communication, module communication, measurement of switch quantity and analog quantity, alarm management, battery management, LCD display and keyboard processing. At the same time, the current operation information of the system can be uploaded to the background centralized monitoring center through Ethernet, RS 485 or Modem. The hardware structure block diagram of this communication power supply monitoring system is shown in Figure 1. The switch quantity input part mainly realizes the monitoring of the AC input circuit breaker, AC output circuit breaker and lightning arrester status; the analog signal acquisition part realizes the measurement of AC voltage, busbar voltage, battery voltage, battery current, load current and battery temperature; the alarm dry node output part mainly realizes the output of rectifier module failure, load power-off, battery protection, AC SPD failure, AC power outage and other failures in the form of sound and light, so that users can deal with system failures in time.
3. Software Design of Communication Power Supply Monitoring System
According to the main functions to be realized by the communication power supply monitoring system and the task scheduling of the embedded real-time operating system μC/OS-Ⅱ, the software part can be divided into the following 11 relatively independent tasks, which are: RTC task, interface menu display task, CAN protocol communication task, I2C protocol communication task, background communication protocol task, analog measurement task, alarm task, battery management task, network communication task, self-test task, and system configuration parameter storage task. Each task is an infinite loop, and at any time, it can only be in one of the following five states: sleep state, ready state, running state, suspended state (waiting for an event to occur) and interrupted state. The realization of multi-task operation is actually achieved by the conversion and scheduling between many tasks by the CPU (central processing unit) and μC/OS-Ⅱ. The system service used for communication and synchronization between tasks in this system is a mutually exclusive semaphore, which is used to control the right to use shared resources. In summary, the software framework of this monitoring system is shown in Figure 2.
4 Conclusion
This paper introduces the scheme of developing a communication power monitoring system by transplanting the multi-task real-time operating system μC/OS-Ⅱ on the ARM7 series microprocessor TMS470R1A288, and introduces its hardware design and software design in detail. This design improves the shortcomings of the traditional communication power monitoring system, such as poor real-time performance, high cost, and partial software failure leading to the failure of the entire monitoring unit, so that the communication power monitoring system has sufficient flexibility, robustness, and real-time performance.
Previous article:Design of biological safety cabinet controller based on ARM
Next article:STM32FSMC mechanism FlaSh memory expansion
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
- NXP Smart Car Northeast Competition First Prize, we will open source after the competition
- Cumulative error analysis and clock frequency optimization for UART communication in MSP430FR2311
- Guess the price and win a surprise - how much does this "good" phone cost? Let's find out!
- ucos ii based on Cortex-M0 can run source code project
- Looking for a logic device like 74HC595
- UDP protocol peer-to-peer (P2P) communication (or NAT traversal) example
- TI-TM4C123x learning record: reading high and low levels
- Competition and adventure in digital circuits
- Record the failure of my first dsp project
- 18 kinds of motor step-down starting circuit diagrams [collection]