1. RTOS scheduling
1.1. zyBook multiple state machines → RTOS
-
Draw a state diagram for the state machines described in this code.
-
Draw a time line of when each
_tick()
function is run.
1.2. Scheduling in an RTOS
At the start, both tasks are Ready to run.
-
00 - OS Tick interrupt fires and runs the Scheduler code.
-
Selects TaskA to Run
-
-
10 - Tick interrupt runs the Scheduler again
-
Selects TaskA because it is the highest priority task in the Ready state.
-
-
At some point before the next Tick, TaskA calls
vTaskDelay(3)
.-
This puts it into the Blocked state (waiting for the delay time to expire).
-
Control returns to the Scheduler, which begins TaskB.
-
-
20 - Tick interrupts and runs Scheduler
-
Only Ready task is TaskB.
-
-
30 - Tick interrupt and runs Scheduler
-
Only Ready task is TaskB.
-
-
40 - Tick interrupt and runs Scheduler
-
This is the 3rd tick after TaskA’s
vTaskDelay(3)
, which un-blocks it and TaskA becomes Ready. -
TaskA is the highest priority task, so it is chosen to Run.
-
-
50 - Tick interrupt and runs Scheduler
-
TaskA remains the highest priority Ready task.
-
2. Homework
2.1. Demonstrate code running on the SRXE
A video of you playing the Slots game on your device at the end of the Instructable would work. SRXE Notes - Run TinyBASIC
You can find how I used the AVRASP programmer (cheap version) with avrdude
at the same page:
SRXE Notes - Explore / extract original contents
2.2. Amp Hour Podcast #581
Listen / watch Amp Hour interview: The Amp Hour Podcast - #581 – Real Time Operating Systems with Brian Amos
This is active listening, where you actually pay attention to and try to track the conversation. The problem with this is that Brian and Chris are dropping random vocabularity like nobody’s business.
Your task is to collect keywords and phrases that you don’t know and are associated with Real Time Operating Systems on an embedded system.
Turn in:
-
Your initial notes taken while listening to the podcast.
-
A cleaned-up version that organizes the terminology and concept names by their relationships to each other.
-
Include short definitions for each.
-
Think: a mind map
-
Before and after you listen to the podcast, open the FreeRTOS docs page:
-
FreeRTOS
Notes page about RTOS things: rtos