Design of Communication Power Supply Monitoring System Based on μC/OS-Ⅱ

Publisher:机器人总动员Latest update time:2014-10-14 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Design of Communication Power Supply Monitoring System Based on μC/OS-Ⅱ

Previous article:Design of biological safety cabinet controller based on ARM
Next article:STM32FSMC mechanism FlaSh memory expansion

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号