4.2
Understanding and running the program in single-unit operation
This section explains sample programs as programs that practically turn on/of the LED using switch
operations and that control the buzzer using the A/D converter operations.
Start
Initialize
(Port and interrupt levels)
Initialize external interrupt
Initialize AD computer
Infinite loop
false
Acquire A/D value
from temperature
sensor
LED temperature
display
Start external interrupt
Clear external interrupt request
LED4, LED5, and LED6 ON/
End external interrupt
Start AD conversion
interrupt
Clear interrupt request flag
Use volume SW
End AD conversion
interrupt
Figure 4-11 Single-unit operation flowcharts
Press SW2
Clear external interrupt request
processing
flag
OFF
processing
true
Acquire A/D value
from slide volume
Cycle setting
Duty setting
74
AN07-00200-03E
Press SW3
Start external interrupt
processing
flag
PPG output authorized
PPG start/stop
End external interrupt
processing