Freescale Semiconductor M68HC08 manual Software Design, interrupt void pwmISRvoid, Table index =

Models: M68HC08

1 72
Download 72 pages 22.12 Kb
Page 44
Image 44
interrupt void pwmISR(void)

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 5-5. Flow Chart — Sine Wave Generation Interrupt Routine

Dimmable Light Ballast with Power Factor Correction, Rev. 1

44

Freescale Semiconductor

Page 44
Image 44
Freescale Semiconductor M68HC08 manual Software Design, interrupt void pwmISRvoid, Read new PWM value from table * sineGain