Traditional Light Tower
A traditional light tower is a tall structure that is equipped with powerful lights to provide illumination in various settings. It is commonly used in construction sites, outdoor events, emergency situations, and other areas where temporary lighting is required.
Traditional Light Tower,Mobile Light Tower,Mine Light Tower,Construction Light Towers Grandwatt Electric Corp. , https://www.grandwattelectric.com
Traditional light towers typically consist of a sturdy metal frame with a mast that can be extended to different heights, allowing the lights to be positioned at various angles and distances. The lights themselves are typically high-intensity discharge (HID) lamps or light-emitting diodes (LEDs), which can produce a bright and focused beam of light.
These light towers are often portable and easy to transport, allowing them to be quickly set up and moved to different locations as needed. They are usually powered by diesel generators or other sources of electricity, ensuring that they can operate independently of the local power grid.
In addition to providing illumination, traditional light towers may also be equipped with other features such as telescopic cameras for surveillance, outlets for powering tools and equipment, and even solar panels for eco-friendly operation.
Overall, traditional light towers are essential tools in various industries and applications, providing reliable and efficient lighting solutions in areas where conventional lighting may be insufficient or unavailable.
Application of multi-tasking watchdog design on uC/OS-II system
In order to enhance the reliability and security of a microcomputer system within an embedded environment, a common approach is to implement a "watchdog." A watchdog can be either hardware-based or software-based. A hardware watchdog uses a dedicated circuit that relies on a timer to ensure that a microcontroller task, referred to as "feeding the dog," completes within a specified time frame. If the task exceeds this time, the system is automatically restarted. On the other hand, a software watchdog utilizes the internal processor timer to impose a maximum runtime limit on tasks. If a task runs longer than allowed, it is forcibly terminated.
These traditional watchdog mechanisms typically operate in a single-task environment, which makes them relatively simple to implement. However, in a multitasking system, the situation becomes more complex. If each task is treated like a single-task system, only when all tasks fail will the watchdog trigger a restart. To address this, researchers such as Ye Bangli from Chongqing Normal University have explored similar concepts in Windows systems [1], while others have discussed the issue in embedded environments [2], though without detailed implementation methods.
This paper presents the porting of the uC/OS-II real-time operating system onto the LPC2132 microcontroller from Philips. Based on the system's message mechanism and priority management, a high-priority task is designated as a monitor to oversee the execution of all running tasks. If any task fails, the monitoring task delays its "feeding" of the watchdog, leading to a timer overflow and a system restart. This ensures long-term stability of both the microcontroller and all its tasks.
**1 System Overview**
**1.1 Hardware and Development Environment**
The uC/OS-II operating system is ported to the LPC2132 development board. The LPC2132 is a 32-bit ARM7TDMI-S core microprocessor featuring real-time emulation and tracking capabilities, along with 64KB of high-speed Flash memory, four communication interfaces, two 32-bit timers, one 10-bit 8-channel ADC, and two hardware interfaces. It also includes 47 GPIOs and up to 9 edge or level-triggered external interrupts, making it suitable for a wide range of applications.
uC/OS-II is a preemptive, real-time operating system with open-source code, offering portability, ease of use, and flexibility. It supports up to 64 tasks, usually implemented as infinite loops. In the current version, users can manage up to 56 tasks simultaneously, which meets most application requirements.
**1.2 System Functions**
In a multitasking system, it is often desirable to restart a specific task upon failure without restarting the entire system, thus preserving the operation of critical tasks. However, if a task fails repeatedly, the system should be restarted. Similarly, if the main program or hardware encounters an error, the system must reboot. Based on this logic, the watchdog primarily performs the following functions:
1. Restart a task when it encounters an exception.
2. Restart the system if a task fails multiple times.
3. Reboot the microcontroller if the OS or hardware malfunctions.
**2 Multi-Task Watchdog Monitoring Principle**
By combining the built-in hardware watchdog of the LPC2132 with the uC/OS-II operating system, a high-priority task is assigned as a monitor to track the status of all application tasks. This monitor is referred to as a software watchdog. Each monitored task is assigned a timer, and the task must clear the timer within a set period—this is known as "feeding the soft dog."
If the monitored task operates normally, the software watchdog periodically resets the hardware watchdog timer. However, if a task fails, the watchdog cannot reset the timer in time, causing it to overflow. The system then sends an instruction to reset the task’s stack pointer to its starting address, effectively restarting the task. If the task continues to fail, the watchdog will eventually trigger a full system restart. Additionally, if the monitor task itself fails, the hardware watchdog will also initiate a system reboot.
**3 Software Implementation**
**3.1 Communication Between Application Tasks and Software Watchdogs**
When tasks communicate with the software watchdog, each application task sends a status message to the monitor. The monitor, in turn, sends messages back to the tasks. Using mailboxes for communication can lead to inefficiencies when many tasks are involved. Therefore, message queues are used instead. Each application task has two mailboxes: one for sending messages to the monitor and another for receiving commands from it.
When an error occurs, the task uses the `OSQPost()` function to send a message to the monitor. The monitor reads the message via `OSQPend()` and responds with a message through `OSMboxPost()`. The task then processes the received message using `OSMboxPend()` and takes appropriate action.
**3.2 Implementation of the Multitasking Software Watchdog**
The multitasking watchdog monitors each task by checking whether it successfully "feeds the soft dog" within a given timeframe. Using the microcontroller’s timer interrupt mechanism, each task is assigned a timing unit and a run flag. When a task is idle, it "feeds the dog" at intervals shorter than the set threshold. When active, the task’s expected maximum runtime is slightly less than the watchdog’s timer setting.
During normal execution, the task sends a signal to "feed the dog," resetting the timer. If the task fails, the watchdog timer overflows, and the monitor task triggers a restart. The number of restart attempts is tracked, and if it exceeds the limit, the system is restarted. This ensures robustness and stability in the embedded environment.
**4 Conclusion**
By integrating the LPC2132’s built-in hardware watchdog with the uC/OS-II operating system, a multitasking-capable software watchdog is developed. This watchdog not only monitors various application tasks but also allows for selective restarts, ensuring minimal disruption to other tasks. It enables task restarts until they become unresponsive, after which the system is rebooted. This design maintains the independence of application tasks while ensuring long-term system stability. Moreover, the watchdog can automatically restart the system in case of main program or hardware failures, ensuring continuous and reliable operation.