Presentation is loading. Please wait.

Presentation is loading. Please wait.

Example of RTMES Lab. 1 Controls Kukhee Kim June 24, 2010 Example of RTEMS Lab. Controls Department June 24, 2010 Kukhee Kim.

Similar presentations


Presentation on theme: "Example of RTMES Lab. 1 Controls Kukhee Kim June 24, 2010 Example of RTEMS Lab. Controls Department June 24, 2010 Kukhee Kim."— Presentation transcript:

1 Example of RTMES Lab. 1 Controls Kukhee Kim June 24, 2010 Example of RTEMS Lab. Controls Department June 24, 2010 Kukhee Kim

2 Example of RTMES Lab. 2 Controls Kukhee Kim June 24, 2010 Hello World! Just use printf() Cexp@ioc-b34-cd15>helloWorld() >>>> Hello World! <<<< 0x0000000a (10) Cexp@ioc-b34-cd15> Execute my function Print out from the function Return from the function

3 Example of RTMES Lab. 3 Controls Kukhee Kim June 24, 2010 Hello World2 Print out “Hello World2” and Sweep the LED array User function has infinite loop to sweep the LED array When the switch:MSB turns off, the loop will be finished Cexp@ioc-b34-cd15>helloWorld2() >>>> Hello World2 <<<< 0x0000007f (127) Cexp@ioc-b34-cd15> Execute the user function Print out “Hello World” and Sweeps the LED array continuesly When turns off the toggle switch:MSB Take out from the function

4 Example of RTMES Lab. 4 Controls Kukhee Kim June 24, 2010 Turtle & Rabbit Two tasks run: Turtle & Rabbit Turtle sweeps slowly on the LED array Rabbit sweeps fast on the LED array Need to consider MUTUAL EXCLUSION Need to consider SHADOW register When turns off toggle switch (bit 0), the Turtle will be finished When turns off toggle switch (bit 1), the Rabbit will be finished Cexp@ioc-b34-cd15>tr_init() >>>> Init for turtle and rabbit <<<< >>> Finish Init <<<< 0x0000000a (10) >>>> start turtle <<<< >>>> start rabbit <<<< >>>> finish turtle <<<< >>>> finish rabbit <<<< Cexp@ioc-b34-cd15> Execute user function The user function generates two tasks and Return to the Cexp Turtle sweeps slowly, and Rabbit sweeps fast on the LED array Switch bit0 turned off, and turtle finished. Switch bit 1 turned off, and rabbit finished.

5 Example of RTMES Lab. 5 Controls Kukhee Kim June 24, 2010 Turtle & Rabbit with Watchdog Two tasks run: Turtle & Rabbit Both are almost identical Infinite loop to sweep the LED array Shadow register & Mutual Excusion Hardware watchdog: High-Resolution Timer on the CPU Board Every 1 msec, watchdog wakes the ISR Why choose 1 msec? hardware limitation on the interval (~ 2msec) The ISR re-implement the timer immediately ISR (1kHz) down convert the frequency Every 50 msec, sends event to the Rabbit task Every 200 msec, sends event to the Turtle task Diagnostic Task runs Monitor ISR counter, Rabbit/Turtle counter Monitor the event delay between ISR and individual tasks

6 Example of RTMES Lab. 6 Controls Kukhee Kim June 24, 2010 ISR Interrupt 1kHz rates Re-implement timer Turtle Task Rabbit Task LED array Protecting Shared Object Mutual Exclusion & Shadow register Sends a RTEMS event, every 200msec Sends a RTEMS event, every 50msec Monitoring ISR and each tasks Measure delay between ISR and individual tasks (sub-usec resolution) Report every 2 seconds Diagnostic Task Turtle & Rabbit with Watchdog 3 usec delay measured

7 Example of RTMES Lab. 7 Controls Kukhee Kim June 24, 2010 Turtle & Rabbit with Watchdog Cexp@ioc-b34-cd15>watchdog_tr_init() >>>> Init for turtle and rabbit <<<< >>>> start turtle <<<< >>>> start rabbit <<<< >>> Finish Init <<<< 0x0000000a (10) ISR counter: 0, Turtle calls: 0, Rabbit calls: 0 Turtle delay: 0.000 usec, Rabbit delay 2.880 usec Cexp@ioc-b34-cd15>ISR counter: 2270, Turtle calls: 11, Rabbit calls: 45 Turtle delay: 3.630 usec, Rabbit delay 2.880 usec ISR counter: 4347, Turtle calls: 21, Rabbit calls: 86 Turtle delay: 3.660 usec, Rabbit delay 2.880 usec ISR counter: 6424, Turtle calls: 32, Rabbit calls: 128 Turtle delay: 3.660 usec, Rabbit delay 3.030 usec ISR counter: 8501, Turtle calls: 42, Rabbit calls: 170 Turtle delay: 3.660 usec, Rabbit delay 2.880 usec ISR counter: 10578, Turtle calls: 52, Rabbit calls: 211 Turtle delay: 3.660 usec, Rabbit delay 2.880 usec ISR counter: 12655, Turtle calls: 63, Rabbit calls: 253 Turtle delay: 3.660 usec, Rabbit delay 2.880 usec ISR counter: 14732, Turtle calls: 73, Rabbit calls: 294 Turtle delay: 3.630 usec, Rabbit delay 2.880 usec ISR counter: 16809, Turtle calls: 84, Rabbit calls: 336 Turtle delay: 3.690 usec, Rabbit delay 3.030 usec


Download ppt "Example of RTMES Lab. 1 Controls Kukhee Kim June 24, 2010 Example of RTEMS Lab. Controls Department June 24, 2010 Kukhee Kim."

Similar presentations


Ads by Google