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