AN1971
APPLICATION NOTE
ST7LITE0xxx MICROCONTROLLED BALLAST
Demand for flexibility is increasing in new ballast applications. If a designer can use the same
ballast with different tube lamp wattages and types, savings can be made reducing logistic
costs. The aim of this application note is to show designers how the ST7 microcontroller helps
in the design of such a ballast. In addition, it shows how the use of the ST7LITE0xxx micro-
controller adds some attributes facilitating design-work and improving the ballast functionality.
1 INTRODUCTION
Figure 1
shows a diagram of the whole application.
Figure 1. Block Diagram
=400V
Half bridge Driver
L6384
Power
Section
Lamp
ST7LITE0xxx
Microcontroller
Voltage
Measurement
Current
Measurement
Rev. 3
December 2012
1/16
1
ST7LITE0xxx MICROCONTROLLED BALLAST
1.1 POWER SECTION
This application note focuses on the lamp control and therefore a DC voltage 400V has been
chosen to supply the application. To have a complete ballast connectable to the standard
mains, the EVAL6562-80 board can be chosen to serve as a PFC part, between AC-mains
and the 400V DC link.
In this application, voltage-fed series resonant half-bridge inverters are used to drive a fluores-
cent tube lamp in zero-voltage switching mode and the microcontroller handles the control of
the ballast. The microcontroller drives the L6384 high voltage half bridge driver. L6384 is a
small eight-pin device, with one input, selectable dead time and implemented bootstrap diode
(refer to the L6384 datasheet for more information). In
Figure 2,
the driver and resonant tank
topology are shown. Thanks to the microcontroller flexibility, existing resonant circuits can
also be used.
Figure 2. Power Section Circuit
400V
U2
1
2
3
4
IN
Vcc
DT/SD
GND
L6384
Vboot
HVG
Vout
LVG
8
7
6
5
C4
100nF
63V
R9
22
Q1
STP5NK60ZFP
L1
2.3 mH
2.
EF25
C5
100nF
250V
1
R10 22
Q2
STP5NK60ZFP
2
LAMP
R36
1
1W
C7
10nF
1600V
2/16
2
ST7LITE0xxx MICROCONTROLLED BALLAST
1.2 DIGITAL SECTION
The ST7LITE0xxx microcontroller has been chosen as it is small and easy to use (please refer
to
Section 5 REFERENCES AND RELATED MATERIALS [1]).
This processor has a 1.5kB
flash program memory, 128 bytes of RAM and moreover it has 128 bytes of EEPROM of us-
able memory, for example, for storing lamp parameters. There is no need for any external
clock circuitry, because it has an integrated RC oscillator with an accuracy of 1%. This oscil-
lator provides a clock signal up to 8MHz. What makes this microcontroller a strong tool for the
ballast application are the peripherals: Autoreload Timer, Lite Timer and Analog to Digital
Converter. Foremost, it must be highlighted that the software drivers for all the peripherals are
available in the ST7 software library (see ST7 Software Library,
http://www.st.com/mcu)
and
you do not need to spend time to develop your own.
The Autoreload timer is a peripheral which controls a PWM output from the microcontroller.
The principle of its function is shown in
Figure 3.
At the heart of the autoreload timer is a free-
running counter, which works absolutely independently from the processor core. For de-
signers, there are only two important values: “Reload Value Register” and “Compare Value
Register”. The counter increments its value to the maximum. When it is reached, it switches
the output pin to the logical 1 (5V) and after that the counter starts incrementing again from the
value stored in the already mentioned “Reload Value Register”. After each increment, the
counter is compared to the “Compare Value Register”. If the match occurs, the output pin is
switched to the logic value 0 (0V).
Figure 3. PWM Function
4095
Counter
Compare Value
Register
Reload Value
Register
000
Output
pin
t
From
Figure 3,
it can be seen that the control of the PWM signal is very simple with
ST7LITE0xxx through just the two registers: by writing into the Reload Register, you select the
frequency and by writing into the Compare Register you can select the duty cycle. This way,
the frequency can be selected from 2kHz up to 4MHz. The incremental period change is
125ns with fclock = 8 MHz.
In addition to the autoreload timer, there is also another generic timer available. This timer
(called Lite Timer) is a free running counter generating a software interrupt every 1ms. There
3/16
ST7LITE0xxx MICROCONTROLLED BALLAST
is a simple software trick using a variable which counts the number of these interrupts. If you
want an event to occur after a certain time (e.g. switch from preheating to ignition mode after
one second), you should watch this global variable and when it reaches the desired value a
proper procedure is run. The time from 1ms up to the dozen of minutes can be measured this
way (with the step of 1ms).
To connect the analog world to the digital core there is an analog to digital converter (ADC) im-
plemented in the ST7LITE0xxx. This ADC has two input ranges, the first measures the analog
voltage from 0 to 5V in order to obtain a digital value ranging from 0 to 255 (8-bit resolution).
The second turns on an integrated amplifier with a gain of eight, which means that it can
measure the voltage in the range from 0 to 250mV. This integrated amplifier is very useful, es-
pecially when measuring the small voltage drop on the current sense resistors.
Lamp current and voltage must be measured to have complete information about the ballast
circuitry. In
Figure 4
and
Figure 5
are the circuits used to filter the voltage on the current sense
resistor. The first filter is used to obtain the peak current value and the second one to get an
average current.
Figure 4. Peak Current Sensor
R37
8k2
D4
Sense Resistor
Figure 5. DC Current Sensor
Analog Input
R33
10k
Sense Resistor
Analog Input
C19
R38
12k
C12
150n
BAT46J
BAT46
470nF
Two circuits are used for voltage measurement, similar to the current measurement. The first,
used to measure a peak value, is depicted in
Figure 6.
It is a simple voltage divider with output
in the range from 0 to 5V. To avoid an error caused by the voltage drop on the diode D3, the
divider has been split into two parts. The second measurement circuit, used to obtain the
voltage DC offset on the lamp, is shown in
Figure 7.
Because the offset can be either positive
or negative the circuit has been adapted to raise the zero point to 2.5V. This means that a
measured voltage smaller than 2.5V results in a negative offset and voltage higher than 2.5V
gives a positive offset.
4/16
ST7LITE0xxx MICROCONTROLLED BALLAST
Figure 6. Peak Voltage Sensor
Voltage Sense
R19
300k
300V
R20
300k
300V
R21
300k
300V
R22
100k
Figure 7. DC Voltage Sensor
Voltage Sense
R14
300k
300V
R15
300k
300V
R18
2k4
Analog Input
R16
100k
300V
R17
2k4
+5V
Analog Input
C10
68nF
R23 75k
R24
27k
D3
1N4148
C9
4.7nF
150V
C8
470n
5/16