Freescale Semiconductor M68HC08 Stereo System User Manual


 
4
Set Dimming value and Dimming value array
to minimal value
Set values of PI PFC stage regulator for run mode:
- proportionalGain = PI_KP_RUN;
- integralGain = PI_KI_RUN;
Run mode
1
Is enabled PI PFC stage
regulator calculation ?
yes
Test DC-BUS voltage on limits
Calculate PI PFC stage regulator
for reference sine gain
yes
Control lamp currents
no
Measure lamp currents
Is enabled PI ballast stage
regulator calculation ?
no
Has 1ms gone?
Is time to measure Dimming value ?
Get dimming value and compute moving avg. filter
Is current through Tube1
or Tube2 zero ?
Has zero current checking
interval gone?
yes
no
no
Reset current checking interval counter
Trimming internal oscillator
Is attemp to start > 0 ?
faultISR()
no
yes
1
yes
yes
no
yes
no
yes
no
Set zero current checking interval counter
(currFltMS)
Software Design
Dimmable Light Ballast with Power Factor Correction, Rev. 1
50 Freescale Semiconductor
Figure 5-10. Flow Chart — Main Flow, Part 4