Freescale Semiconductor M68HC08 Stereo System User Manual


 
interrupt void pwmISR(void)
End of subroutine
Read new (PWM value from table * sineGain)
Increment of table index
Was end of sine tab. reached ?
Table index = 0
yes
Set 1ms flag and reset 1ms counter
yesHas 1ms gone ?
no
Reset LDOK to enable new PWM reload
and clear reload flag
Increment 1ms counter
no
Enable PI ballast stage regulator computing
and reset 500us counter
yesHas 500us gone ?
Increment 500us counter
no
Software Design
Dimmable Light Ballast with Power Factor Correction, Rev. 1
44 Freescale Semiconductor
Figure 5-5. Flow Chart — Sine Wave Generation Interrupt Routine