RTOS embedded in the MSP430F148 microcontroller(3)
source: application Author: Li Qiang Zhang Junmo Chen Yao : 2010-09-12
3 how to ensure the low power consumption characteristic based on (3)
Application of single chip microcomputer in the embedded area are very stressed ultra low power consumption characteristics of scm. Characteristics of MSP430 Series in the same. If the operation of the RTOS and the destruction of the low power characteristics of the SCM is the loss outweighs the gain. The MCU have provided several different power operating mode, you can choose according to the specific requirements. Different work mode is through reading and writing 1 or 1 groups of registers to control CPU, clock, crystal and peripheral equipment operation to achieve.
MSP430 series single-chip microcomputer has 6 different working modes, are based on the SR status register read and write to achieve. In RTOS, because each task can preserve their status, including the status register, so in the realization of low power mode of operation is more convenient and flexible. First of all, in the design of each task, can define its work mode according to the specific requirements of the task. Secondly, in the entire system design, the design of a lowest priority task, its role is to make the system enters a low-power mode specific. So, run on other tasks are completed, the system calls the task to make the whole system into a low-power operating mode. When the other tasks and resume operation (such as delay end), will automatically enter the working state, to achieve the purpose of reducing power consumption.
4 RAM
RTOS how to reduce the space occupied in the operation of the
The main reason for application of effect of RTOS on the single chip microcomputer is due to run RTOS in SCM requires certain system resources, such as the system clock, RAM, FLASH or ROM, thereby reducing the application system of resources. Especially the RAM occupancy. In general, the number of single-chip internal RAM are rarely (such as MSP430F148 is the MSP430 RAM the most, only 2 KB), although the external expansion to increase the RAM number, but this will not only increase the design difficulty and cost of the product, and sometimes also use the system cannot be extended. Therefore, the best way is to make full use of the MCU internal RAM to run RTOS.
by uC/OS-II analysis of the RAM usage that causes most, occupy RAM space, is due to the design of uC/OS-II, to assign a single task stack for each task. Especially in the hardware design of MCU interrupt stack and no separate task stack, stack size calculation task not only to calculate the variable and function nested tasks by the use of the RAM size, also must calculate the task interrupt and interrupt nesting required RAM space size at run time. Since each task are reserved for interrupts and interrupt nesting required RAM space size, so that a large number of RAM space is wasted. To solve the most direct way is to use the software to the task stack and interrupt stack separation, so that in the hour of the stack, only need to compute RAM space mission required, thus improves the efficiency of RAM, increase the application task more.