205/317
7 - Debugger and PROM Programmer Tutorial for ST72251
The 16-bit Timer runs continuously and generates an interrupt every 10 ms. A software
counter is used to count the half-period time of the blinking.
The parallel input-output ports are used both to input the four voltages to the ADC and to
switch the four LEDs.
7.6.2 The algorithm of each task
Since the functionality for each channel is identical, we shall describe only one of them.
The algorithm is the following:
07-task
Four such algorithms will run simultaneously, each belonging to one task. The initialization
part of the program will thus initialize the core and the peripherals, then start all four tasks.
They will run forever, since they are made of a loop with no exit condition.
Task
Read analog input
Convert it to time
Load counter with time
Counter
=0?
Yield
Toggle output
Little kernel : diagram of a task