Design and Implementation of Efficient Timing Mechanism for Watchdog Based on VxWorks

VxWorks is one of the most widely used embedded real-time operating systems, and is widely used in industrial control, medical equipment, communications, aerospace and weaponry. VxWorks is a 32-bit real-time embedded operating system. Since its introduction in the 1980s by Wind River, its good real-time, multi-tasking support, volume reduction, and tailorability have been won by many companies, developers and users. favorite.

In applications with high real-time requirements, timers are important devices that are often used. For the VxWorks operating system itself, there is no universal, efficient timer component. The shared watchdog timing mechanism proposed in this paper is a general-purpose timer component implemented for this situation.

1 VxWorks timing method

1.1 Using the taskDely function

The function prototype is: STATUS taskDelay(int TICks) This function provides a simple task sleep mechanism, which is often used in applications that require inaccurate timing or delay. The timing unit is TIck. By default, 60 (TIcks) is 1s. (Use the sysClkRateSet function to modify the system default clock rate). Calling the taskDelay function in the task can free the CPU usage right during the specified TIcks, and change the state of the task to DELAY. The timing mechanism is not accurate because it is often affected by task scheduling.

1.2 watchdog watchDog

VxWorks provides a watchdog timer (watchDog timer), which is maintained by the following four functions:

wdCreate( ) creates and initializes a watchdog timer; wdDelete( ) terminates and deletes a watchdog timer; wdStart( ) starts the watchdog timer; wdCANcel( ) suspends the current watchdog timer.

With the wdCreate function, you can create a watchdog timer in any task, and implement the specified C function after the set period of time.

The watchDog timer is maintained as part of the system clock interrupt service routine. Therefore, the program operation performed by the watchdog is of high priority at the system interrupt level. The program must comply with the general ISR procedure and cannot use any program that may be blocked. The high-efficiency timers described in this article are based on the watchdog timer.

1.3 POSIX standard timer

VxWorks also provides IEEE POSIX 1003.1b standard timer interface. The POSIX standard guarantees the ease of interface between the application and the operating system. Programming with these interfaces makes it easy to migrate applications from one operating system to another. Using this timing mechanism, after a specified period of time, the task will send SIGNAL to itself, which is built on top of the clock and signal. The POSIX standard timer timer is often used to write programs that are cross-platform and need to run under multiple operating systems and are easy to port.

2 Based on the efficient timing mechanism of the watchdog

2.1 shared watchdog efficient timer

In some projects based on embedded real-time systems, timers are often used to implement a certain program or function after a certain period of time, and often the timing lengths are different. The use of timers often comes from different tasks, requiring real-time Sex, but also to ensure the orderliness of resource competition. In view of these characteristics, a frequently used timing task using a watchdog timer mode is no longer applicable. If the timer mechanism is constructed according to this mode, the watchdog timer runs because there are many timing tasks. At the interrupt level, resource consumption becomes very large, which affects the real-time nature of the system.

The timing mechanism of sharing the watchdog timer can solve the serious waste of such resources. The shared watchdog timing mechanism, as the name implies, is that multiple timing tasks implement timing operations by sharing the same watchdog timer, which has the advantages of low resource consumption, good real-time performance, and no need to generate additional timing tasks.

2.2 Timing algorithm

The basic principle of the shared watchdog high-efficiency timer is to dynamically change the timing task of the watchdog.

As shown in Figure 1, there are three timing tasks A, B, and C in the system. First, the A task submits a 500ms scheduled task. After 200ms, B submits a 200ms scheduled task. After 100ms, C submits a 150ms scheduled task. In addition to this, there is no other timing, and the operation of A, B, and C is shown in Figure 1.

Design and Implementation of Efficient Timing Mechanism for Watchdog Based on VxWorks

Figure 1 shared watchdog timer timing mechanism

Figure 1 Shared Watchdog Timer Timing Mechanism (see next page) Timer A initiates a timing request to the shared timer at 50ms on the time axis. The shared timer adds A's delay and execution program to its maintained timing list. The function pointer, and calculate the next execution time TA of the timer (system running time plus the timing delay of A). At this time, since there are no other timers to apply for the timing task, only the timing information of A exists in the list. When the time axis reaches 250ms, timer B initiates the timing application. Since the delay of timer A is 500ms, the delay of B is 200ms, that is, B will be executed at 450ms on the time axis, 100ms ahead of A (550ms). After subtracting 450ms), the timing list will complete two things. One is to modify the next execution time TB to be the system running time plus B delay, and the second is to execute the order TA and TB to order the list from small to large. Sort. At this time, B is the header in the list, and A is after B. The same reason is that when the time axis reaches 350ms, the timer C initiates the timing application, and the timed task C is added to the timing list, and the TC is calculated as the system running time plus the C delay, and then re-executed according to the TA, TB, and TC. Sort, at this time the list order is B, C, A. When the time axis is executed to 450ms, the ISR of timer B will be executed, and the B timing task will be deleted from the timing list; similarly, C tasks for 500ms and 550ms The task with A will be removed from the list separately.

At this point, all timing tasks are executed, the timing list is empty, and the shared watchdog timer goes to sleep.

ZGAR Aurora Vape Pods 1.0

Aurora Disposable Vape Device Vaping Pod Systems

Shenzhen WeiKa Technology Co.,Ltd. is a professional e-cigarette manufacturer and enterprise integrating R&D, design, production and sales and service of the electronic cigarette atomizer products, established in 2020.

We are actively developing and producing all kinds of reliable and unique atomizer products. We centre on research, developing, high quality and safety, and focus on better vaping experience in all aspects to our customers. We have advanced production equipment and strict production control system, each process has strict management, from production to delivery have been strictly tested to ensure the classic quality. Zgarvape for the future!

Aurora E-cigarette Cartridge is loved by the majority of consumers for its gorgeous and changeable colors, especially at night or in the dark. Fruits Flavors series, plant flavors series & special flavors series.Up to 16 different flavors for choices. A new design of gradient our disposable vape is impressive. Our vape pen and pods are matched with all the brands on the market. You can use other brand's vape pen with our vape pods. Aurora series Pods systems, the first choice for professional users!


16 Available Flavors (3Pods*2ml):

Amazing Cantaloupe / Coke on the Rocks / Ice Coconut / Ice Lolly / Iced Mung Bean / Longjing Tea / Mango Feast / Mountain Spring / Peach Tempting / Pineapple Juice / Refreshing Melon / Refreshing Mint / Rich Strawberry / Rose Litchi / The Ocean / Watermelon Juice

2021042116030620210421160303

20210421160316

20210421160300

Zgar Colorful Vape Pen E Cigarette Atomizer Device


Aurora Pods 1.0,Pod System Vape,Pos Systems Touch Screen,Empty Disposable Vape Pod System,400Puffs Pod Vape System

ZGAR INTERNATIONAL(HK)CO., LIMITED , https://www.zgarpods.com

This entry was posted in on