Li-Ion, Li-Pol Charger Using MC9S08QD4 - Freescale
Li-Ion, Li-Pol Charger Using MC9S08QD4 - Freescale
Li-Ion, Li-Pol Charger Using MC9S08QD4 - Freescale
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Freescale</strong> Semiconductor<br />
Application Note<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong><br />
<strong>MC9S08QD4</strong><br />
by: Stanislav Arendarik<br />
RTAC Roznov, Czech Republic<br />
1 Introduction<br />
In the present time, there is a continuously growing<br />
amount of battery-powered appliances, <strong>Li</strong>-<strong>Ion</strong> and <strong>Li</strong>-<strong>Pol</strong><br />
batteries are frequently used. They are best suited to<br />
power supply requirements of used microcontrollers. It is<br />
possible to combine several battery cells in series to<br />
reach higher supply voltage. But most of applications use<br />
single-cell configuration. The batteries are charged by<br />
standard wall adapters or directly through USB interface<br />
of the PC. Charging is ensured by the dedicated battery<br />
charger in an appliance. This charger maintains safe<br />
charging conditions and proper, full charge of the<br />
battery cell. On the other side, a microcontroller in an<br />
appliance can replace a dedicated battery charger too.<br />
This can lower the final cost of the whole appliance. This<br />
microcontroller needs only several added external<br />
components to build the whole charger. These<br />
components are needed in most of chargers, specially<br />
powered by universal wall AC/DC adapter. On the other<br />
side, the microcontroller can boost the <strong>Li</strong>-<strong>Ion</strong> battery<br />
voltage (from 2.8 to 4.2 V) to higher voltage with tight<br />
© <strong>Freescale</strong> Semiconductor, Inc., 2009. All rights reserved.<br />
Document Number: AN3825<br />
Rev. 0, 03/2009<br />
Contents<br />
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />
2 <strong>Li</strong>-<strong>Ion</strong> and <strong>Li</strong>-<strong>Pol</strong> Battery Description . . . . . . . . . . . . . . . . 2<br />
3 <strong>Charger</strong> Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />
4 DC/DC Boost Converter Description . . . . . . . . . . . . . . . . 6<br />
5 Software Implementation. . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
6 Application Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
6.1 Schematic Description. . . . . . . . . . . . . . . . . . . . . . . 8<br />
6.2 Software Description . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
7 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
<strong>Li</strong>-<strong>Ion</strong> and <strong>Li</strong>-<strong>Pol</strong> Battery Description<br />
tollerance, for example +5.0 V or more, to supply some other circuits in the application. Both parts —<br />
the <strong>Li</strong>-<strong>Ion</strong> and <strong>Li</strong>-<strong>Pol</strong> charger and boost converter implemented in <strong>MC9S08QD4</strong> MCU will be discussed<br />
in this application note. The software for both implementations can be used in any other stand-alone<br />
application too. As an example of this implementation, the metronome application for musicians is<br />
presented with detailed schematic. The whole software pack is in the AN3825SW.zip file.<br />
2 <strong>Li</strong>-<strong>Ion</strong> and <strong>Li</strong>-<strong>Pol</strong> Battery Description<br />
<strong>Li</strong>-<strong>Ion</strong> batteries employ a graphite material used in conjuction with a lithiated transition metal oxide,<br />
such as lithium cobalt oxide. The electrolyte consists of a lithium salt dissolved in a mixture of organic<br />
carbonates. During the charge and discharge reaction, lithium ions move across the cell between the carbon<br />
and metal oxide electrodes.<br />
A lithium battery cell typicaly consists of a spiral-wound roll of two composite electrodes separated by a<br />
microporous film, containing the electrolyte solution. This all is sealed in a metallic case. The operating<br />
voltage ranges from 2.8 to 4.2 V per cell. This very useful voltage level combined with high energy density<br />
has lead to rapid grow of use in a wide range of electronic appliances, mainly in mobile phone market and<br />
as battery packs for notebooks. But these batteries are very useful in all applications, where a power supply<br />
is about 3.3 V — a level mostly used in microcontroller applications.<br />
The lithium-polymer (<strong>Li</strong>-<strong>Pol</strong>) batteries are very similar to the <strong>Li</strong>-<strong>Ion</strong> technology. They have the same<br />
properties as <strong>Li</strong>-<strong>Ion</strong> type, but a slightly higher energy density, and they can be manufactured as very thin<br />
cells, whilst retaining the performance and cost profile of <strong>Li</strong>-<strong>Ion</strong>.<br />
The <strong>Li</strong>-<strong>Ion</strong> and <strong>Li</strong>-<strong>Pol</strong> batteries have some important advantages over a previously used NiCd or<br />
NiMH types:<br />
They have no memory effect.<br />
They have a very low self-discharge.<br />
Another advantage is simpler charging than nickel-based batteries.<br />
There is an absence of topping and trickle charge.<br />
They have a higher energy density.<br />
<strong>Li</strong>-<strong>Ion</strong> and <strong>Li</strong>-<strong>Pol</strong> batteries can share the same charger.<br />
On the other side you have to pay attention to:<br />
You have to maintain a proper charging vo ltage level; maximum is 4.20 V per cell.<br />
You have to avoid deep discharging under 2.7 V per cell.<br />
You have to avoid exposing the battery to high temperatures.<br />
You have to avoid excessive heating of battery wh ilst charging or discharging (higher than +45 °C).<br />
2<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
<strong>Freescale</strong> Semiconductor
3 <strong>Charger</strong> Description<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
<strong>Charger</strong> Description<br />
The main goal was to use as simple configuration as possible, and meet all requirements for safe and proper<br />
charging of <strong>Li</strong>-<strong>Ion</strong> battery. The next aim was to reach a very low price of the whole solution. The software<br />
in the MCU controls the charging to maintain charging sequence defined by the manufacturer. This<br />
sequence is known as CCCV type. This means constant current and constant voltage shape. It is shown<br />
in Figure 1.<br />
4,2V<br />
Imax<br />
Imin<br />
Constant Current Constant Voltage<br />
Ubat<br />
Ibat<br />
Time<br />
Figure 1. CCCV Charging Characteristic<br />
During the first part of the charging process named as “constant current,” the battery voltage grows. At the<br />
end of this part the battery is charged up to 70 % of the nominal capacity. The charging processor must<br />
look up to actual battery voltage to avoid over-voltage of the battery. The maximal construction limit is<br />
4.30 V, thus the real charging limit is 4.20 V. The charging current during this period is defined by the<br />
battery properties. The standard mobile phone battery can be charged by 1 C current, the larger types<br />
(for example the 18650 type) usually 0.8 C or less. The C means current in mA, equal to capacity in mAh;<br />
for example 700 mA for capacity of 700 mAh. There are <strong>Li</strong>-<strong>Pol</strong> batteries on the market that can be charged<br />
by a much higher current.<br />
The next part of charging process is named “constant voltage”. In this state the charging processor must<br />
maintain a constant voltage of 4.20 V on the battery. The charging current decreases and battery is going<br />
to a full charge. When the charging current reaches the low limit, which is about 3 % of rated charging<br />
current I max , the battery is considered as fully charged and charging process is finished.<br />
<strong>Freescale</strong> Semiconductor 3
<strong>Charger</strong> Description<br />
The schematic of this charger solution is shown in Figure 2. This charger is based on the standard buck<br />
DC/DC converter structure. The power P-MOSFET is controlled by a PWM signal from the MCU.<br />
The duty cycle of the generated PWM signal with the inductor determines the charging current. The MCU<br />
measures the actual battery voltage by an ADC converter input ADC1. The mentioned QD4 type of MCU<br />
includes a 10-bit ADC, which is sufficient of accurate measurement of the voltage of charged<br />
<strong>Li</strong>-<strong>Ion</strong> battery. It is possible to use the next free ADC inputs to measure temperature of the battery using<br />
the internal temperature sensor too. On the other side, if you design this charger for a certain range of<br />
battery capacity, you can set the maximal charging current by limit of PWM duty cycle.<br />
4<br />
+5V<br />
+<br />
C1<br />
Vdd<br />
Vss<br />
D1<br />
MCU<br />
<strong>MC9S08QD4</strong><br />
PWM<br />
ADC1<br />
ADC2<br />
ADC3<br />
Control<br />
MOSFET<br />
Figure 2. Simplified <strong>Charger</strong> Schematic<br />
It is a very simple configuration, while the power supply voltage will be only +5.0 V, for example from<br />
the USB port of PC. If you need to use a higher input voltage, the low-cost low-power linear voltage<br />
regulator must be used to power the MCU only. All other parts are powered by input voltage higher than<br />
V DD of MCU. The final version shown in Figure 3 can be used with input supply in range up to 16 V DC.<br />
There are several small changes, when compared to the previous simple schematic of charger. The MCU<br />
is powered from a dedicated +3.3 V linear voltage regulator. This voltage level maintains a proper<br />
functionality, when the whole charger is powered from an external power source in the range from 5 V<br />
to 16 V. The upper limit depends on the properties of used components — capacitor C8, C9, power<br />
MOSFET Q2, and voltage regulator U1. The values of the inductor L1, capacitor C8 and C9 depend on the<br />
used power source and level of the charging current. They can be reduced in accordance to final design.<br />
Values on the schematic are usable for charging current up to 300 mA.<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
C3<br />
R<br />
D2<br />
L<br />
C4<br />
+<br />
+<br />
Battery<br />
Cell<br />
<strong>Freescale</strong> Semiconductor
D1<br />
2 1 Vin1<br />
L1<br />
D2 SS12<br />
NTGS3455T1<br />
SS12<br />
2 1<br />
SWin<br />
SWout 1 2<br />
Bat+<br />
U1<br />
R3<br />
100UH<br />
3<br />
Vdd 20.0K<br />
IN OUT<br />
1<br />
C9 +<br />
R1<br />
D3<br />
220UF<br />
C4<br />
1.0K Q2 SS12<br />
+ C8 C8 C1<br />
L78L33ACU C2<br />
1.0UF<br />
R5<br />
47UF 47UF<br />
10.0K<br />
0.10UF<br />
1.0UF<br />
GND<br />
Vin<br />
1<br />
2<br />
3 1<br />
5<br />
6<br />
4<br />
J5<br />
2 1<br />
GND<br />
3<br />
2<br />
1<br />
2<br />
PJ-007<br />
J3<br />
2<br />
+<br />
t<br />
-<br />
1<br />
2<br />
3<br />
T<br />
R7 10.0K<br />
U2<br />
BKGD<br />
RST<br />
Figure 3. Detailed <strong>Charger</strong> Schematic<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
<strong>Charger</strong> Description<br />
<strong>Freescale</strong> Semiconductor 5<br />
HDR 1X3<br />
C5<br />
1.0UF<br />
R6<br />
20.0K<br />
8<br />
7<br />
6<br />
5<br />
PTA0/ADC1P0<br />
PTA1/ADC1P1<br />
PTA2/ADC1P2<br />
PTA3/ADC1P3<br />
VDD 3<br />
1<br />
PTA5/RST/IRQ<br />
PTA4/BKGD<br />
2<br />
J1<br />
1 2<br />
3 4<br />
5 6<br />
C7<br />
0.1UF<br />
VSS<br />
J4<br />
BDM<br />
<strong>MC9S08QD4</strong>CSC<br />
4<br />
2<br />
1<br />
Q1<br />
BSS138LT1G<br />
2 3<br />
1<br />
R4<br />
10.0K<br />
C6<br />
0.1UF<br />
LED_EN<br />
D4<br />
1 2<br />
R2<br />
R8<br />
D5<br />
1 2<br />
MVC5474C<br />
180 OHM<br />
180 OHM<br />
MVC5474C
DC/DC Boost Converter Description<br />
4 DC/DC Boost Converter Description<br />
The DC/DC boost converter converts the battery cell voltage to a higher desired output voltage.<br />
This converter utilizes a very simple schematic shown in Figure 4.<br />
6<br />
Battery<br />
Cell +<br />
+4V<br />
+<br />
C1<br />
Figure 4. DC/DC Boost Converter<br />
The switcher N-MOSFET is controlled by a PWM signal from a microcontroller (MCU) of the application.<br />
Diode D is a standard Schottky type, capacitors C1 and C2 are low-ESR aluminium electrolyte types. In<br />
the real application the output voltage +5 V powers the MCU. In this case this MCU can simply measure<br />
this level, and directly set the PWM duty cycle to maintain a proper regulation of the output voltage +5 V.<br />
Values of the capacitors C1, C2, and inductor L are selected in accordance to output current and voltage<br />
ripple requirements. The capacitor values in the range from 47 µF to 330 µF are sufficient in<br />
most applications. The inductor value is in the range from 22 µH to 330 µH. You need to pay attention to<br />
select the proper size of this inductor in accordance to output current. In this configuration it is very easy<br />
to reach the output voltage in tolerance of ±0.1 V or better. You can use this converter for any other output<br />
voltage level in real range. Then the output-voltage divider must be used to measure the output voltage,<br />
because this level can be out of input range of the MCU’s analog-to-digital converter (ADC).<br />
5 Software Implementation<br />
The <strong>Li</strong>-<strong>Ion</strong> battery charger and DC/DC boost converter can be used as stand-alone application, but they<br />
can be implemented in the real application as an added software pack. In case you want use it as<br />
a stand-alone charger, you can use schematic shown in Figure 3. It can be corrected in accordance to user<br />
requirements — it can tightly fit the dedicated battery. Then you can reach the lowest cost possible. In case<br />
you want to use a whatever wall adapter in voltage range up to 16 V DC, you can use the schematic shown<br />
in Figure 3. This design is made as an example for testing purposes and it works very well.<br />
The DC boost converter can be used as a stand-alone application too. It can be implemented in a low-cost<br />
MCU with PWM and ADC capability. For example it can be the <strong>MC9S08QD4</strong>.<br />
6 Application Example<br />
L<br />
Control<br />
Both the charger and the converter can be used as an added software in any other application too. One small<br />
design was made as an example for this implementation — it is an accurate metronome for musicians. The<br />
software is implenemted in a new type of MCU — the MC9S08SG8. The whole schematic is shown in<br />
Figure 5.<br />
MOSFET<br />
+<br />
C2<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
D<br />
+5V<br />
<strong>Freescale</strong> Semiconductor
Application Example<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
<strong>Freescale</strong> Semiconductor 7<br />
Figure 5. Metronome Schematic<br />
Vbat<br />
+Vin<br />
<strong>Charger</strong><br />
Battery Converter<br />
Repro-<br />
+Vin<br />
SW1<br />
SW2<br />
SW3<br />
GND<br />
+5V<br />
LCD_Vo<br />
LCD_RS<br />
LCD_RW<br />
LCD_EN<br />
LCD_D4<br />
LCD_D5<br />
LCD_D6<br />
LCD_D7<br />
LCD_Vo<br />
+5V<br />
Vext<br />
+5V<br />
GND<br />
BKGD<br />
RESET<br />
LCD_RS<br />
LCD_RW<br />
<strong>Charger</strong><br />
LCD_EN<br />
LCD_D7<br />
LCD_D6 LCD_D5<br />
LCD_D4<br />
Vext<br />
SW3<br />
SW2<br />
SW1<br />
Repro-<br />
Repro+<br />
Battery<br />
Converter<br />
BKGD GND<br />
RESET<br />
+5V<br />
+5V<br />
+5V<br />
Repro+<br />
GND<br />
REPRO<br />
Battery <strong>Charger</strong><br />
DC/DC Boost Converter<br />
R2<br />
10k<br />
R2<br />
10k<br />
R4<br />
100k<br />
R4<br />
100k<br />
J2<br />
J2<br />
L2<br />
470uH<br />
L2<br />
470uH<br />
+ C5<br />
220uF<br />
+ C5<br />
220uF<br />
SW3<br />
SW3<br />
D4<br />
RB051L-40<br />
D4<br />
RB051L-40<br />
R6<br />
10k<br />
R6<br />
10k<br />
R1<br />
1k<br />
R1<br />
1k<br />
R10<br />
1k<br />
R10<br />
1k<br />
R7<br />
1k<br />
R7<br />
1k<br />
A<br />
B<br />
SW1<br />
A<br />
B<br />
SW1<br />
Q5<br />
NTJD4105C<br />
Q5<br />
NTJD4105C<br />
D2<br />
1N4148WX<br />
D2<br />
1N4148WX<br />
Q1<br />
2SA2056<br />
Q1<br />
2SA2056<br />
+ C7<br />
220uF<br />
+ C7<br />
220uF<br />
R12<br />
1k<br />
R12<br />
1k<br />
SW4<br />
SW4<br />
L1<br />
33uH<br />
L1<br />
33uH<br />
DS1<br />
PC1602-D<br />
DS1<br />
PC1602-D<br />
VSS<br />
1<br />
VDD<br />
2<br />
Vo<br />
3<br />
RS<br />
4<br />
R/W<br />
5<br />
E<br />
6<br />
DB0<br />
7<br />
DB1<br />
8<br />
DB2<br />
9<br />
DB3<br />
10<br />
DB4<br />
11<br />
DB5<br />
12<br />
DB6<br />
13<br />
DB7<br />
14<br />
A_BKL+<br />
15<br />
K_BKL-<br />
16<br />
C6<br />
100n<br />
C6<br />
100n<br />
J3<br />
BDM<br />
J3<br />
BDM<br />
1 2<br />
3 4<br />
6<br />
5<br />
R5<br />
1K<br />
R5<br />
1K<br />
R11<br />
10k<br />
R11<br />
10k<br />
Q4<br />
NTJD4105C<br />
Q4<br />
NTJD4105C<br />
R8<br />
1k<br />
R8<br />
1k<br />
C1<br />
100n<br />
C1<br />
100n<br />
R3<br />
330k<br />
R3<br />
330k<br />
D1<br />
RB051L-40<br />
D1<br />
RB051L-40<br />
Q3<br />
BSR14<br />
Q3<br />
BSR14<br />
R9<br />
10k<br />
R9<br />
10k<br />
C11<br />
100n<br />
C11<br />
100n<br />
Q2<br />
BC847AL<br />
Q2<br />
BC847AL<br />
+<br />
C8<br />
3300uF<br />
+<br />
C8<br />
3300uF<br />
J1<br />
DC_POWER_JACK<br />
J1<br />
DC_POWER_JACK<br />
1<br />
2<br />
3<br />
BT1<br />
<strong>Li</strong>-<strong>Ion</strong><br />
BT1<br />
<strong>Li</strong>-<strong>Ion</strong><br />
C4<br />
100n<br />
C4<br />
100n<br />
+<br />
C3<br />
470uF<br />
+<br />
C3<br />
470uF<br />
C2<br />
100n<br />
C2<br />
100n<br />
D3<br />
RB051L-40<br />
D3<br />
RB051L-40<br />
U1<br />
MC9S08SG8<br />
U1<br />
MC9S08SG8<br />
RESET<br />
1<br />
BKGD<br />
2<br />
Vdd<br />
3<br />
Vss<br />
4<br />
PB7/EXTAL<br />
5<br />
PB6/XTAL<br />
6<br />
PB5/T1Ch1/SS<br />
7<br />
PB4/T2Ch1/MISO<br />
8<br />
PC3/AD11<br />
9<br />
PC2/AD10<br />
10<br />
PC1/AD9<br />
11<br />
PC0/AD8<br />
12<br />
PB3/MOSI/AD7<br />
13<br />
PB2/SCK/AD6<br />
14<br />
PB1/TxD/AD5<br />
15<br />
PB0/RxD/AD4<br />
16<br />
PA3/SCL/AD3<br />
17<br />
PA2/SDA/AD2/ACO 18<br />
PA1/T2Ch0/AD1/AC-<br />
19<br />
PA0/T1Ch0/AD0/TCLK/AC+<br />
20<br />
SW2<br />
SW2
Application Example<br />
The application provides:<br />
<strong>Li</strong>-<strong>Ion</strong> battery charger<br />
DC/DC boost converter<br />
LCD display driver<br />
Sound generator<br />
Speaker driver<br />
6.1 Schematic Description<br />
The heart of this shematic is the MC9S08SG8 MCU. This MCU maintains all functions needed. It can be<br />
powered with voltage ranging from +2.7 to +5.5 V. The main power source is one-cell <strong>Li</strong>-<strong>Ion</strong> battery BT1.<br />
It is in the center of the schematic. The parts on the left belong to <strong>Li</strong>-<strong>Ion</strong> charger, and parts on the right<br />
belong to DC/DC boost converter. The next part is a standard LCD display (powered by +5 V) and sound<br />
driver — full bridge MOSFET powered by +5 V with a small speaker as a load. A relatively large<br />
capacitance C8 is used, because of high-current impulse load of +5 V line. When your application doesn’t<br />
require as high impulse load, the small capacitance C7 is sufficient in most applications.<br />
Standard bipolar transistors are used instead of presented MOSFET; they were “on the hand” and<br />
functionality is the same. After powerup by switching the main switch SW1, the MCU starts to run<br />
on battery voltage of about 3.6 to 4 V. This voltage is too low for proper functionality of the LCD.<br />
The MCU measures its own power supply and starts to run the DC/DC boost converter software.<br />
The +5 V power line rises to its level, and then it is possible to run the application software. The DC/DC<br />
boost converter software runs in the background and maintains the stabilized power supply of +5 V.<br />
The MCU software continuously senses the external voltage V ext on C2. If the external voltage in range<br />
from +6.5 V to +16 V is connected to DC power jack J1, then the <strong>Li</strong>-<strong>Ion</strong> charger software starts to run.<br />
This routine measures the actual battery voltage and external applied voltage and charges the battery until<br />
full charged. Then the charging process is terminated.<br />
6.2 Software Description<br />
The application software uses accurate time intervals generated by RTI interrupt in the MCU.<br />
It is important that this time interval serves as the synchronization point for all three software routines to<br />
be able to run concurrently. A test was made with a period of RTI interrupt from 5 ms to 30 ms and all<br />
applications ran properly. The accurate RTI period depends on the actual application. The state diagram of<br />
this application is shown in Figure 6. It is possible to add some other tasks to a software loop and make the<br />
RTI interrupt period setting comply with requirements of all tasks to achieve a proper functionality.<br />
8<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
<strong>Freescale</strong> Semiconductor
7 Conclusion<br />
START<br />
Power UP sequence,<br />
RTI initialization<br />
Measure Vdd line, start<br />
DC/DC boost converter,<br />
wait for +5V stabile<br />
RTI period<br />
count = X1?<br />
N<br />
RTI period<br />
count = X2?<br />
N<br />
RTI period<br />
count = X3?<br />
N<br />
Y<br />
Y<br />
Y<br />
Figure 6. State Diagram<br />
Run the application<br />
Run the charger<br />
Run the converter<br />
<strong>Li</strong>-<strong>Ion</strong>, <strong>Li</strong>-<strong>Pol</strong> <strong>Charger</strong> <strong>Using</strong> <strong>MC9S08QD4</strong>, Rev. 0<br />
Conclusion<br />
This application note is an example how to implement <strong>Li</strong>-<strong>Ion</strong> or <strong>Li</strong>-<strong>Pol</strong> charger and DC/DC<br />
boost converter into real customer application. All tasks and functions are implemented in<br />
application software. These applications were tested on a very simple low-cost MCU of the S08 family<br />
(<strong>MC9S08QD4</strong>, MC9S08SG8). The MCUs utilize internal peripherals as 10-bit ADC, real-time interrupt<br />
module RTI, PWM module, and internal bandgap reference (constant V ref ). It is possible to implement<br />
these algorithms to whichever S08 family of MCUs, which comprise mentioned internal peripherals. The<br />
whole application source code with a description inside is provided as the AN3825SW.zip file.<br />
<strong>Freescale</strong> Semiconductor 9
How to Reach Us:<br />
Home Page:<br />
www.freescale.com<br />
Web Support:<br />
http://www.freescale.com/support<br />
USA/Europe or Locations Not <strong>Li</strong>sted:<br />
<strong>Freescale</strong> Semiconductor, Inc.<br />
Technical Information Center, EL516<br />
2100 East Elliot Road<br />
Tempe, Arizona 85284<br />
+1-800-521-6274 or +1-480-768-2130<br />
www.freescale.com/support<br />
Europe, Middle East, and Africa:<br />
<strong>Freescale</strong> Halbleiter Deutschland GmbH<br />
Technical Information Center<br />
Schatzbogen 7<br />
81829 Muenchen, Germany<br />
+44 1296 380 456 (English)<br />
+46 8 52200080 (English)<br />
+49 89 92103 559 (German)<br />
+33 1 69 35 48 48 (French)<br />
www.freescale.com/support<br />
Japan:<br />
<strong>Freescale</strong> Semiconductor Japan Ltd.<br />
Headquarters<br />
ARCO Tower 15F<br />
1-8-1, Shimo-Meguro, Meguro-ku,<br />
Tokyo 153-0064<br />
Japan<br />
0120 191014 or +81 3 5437 9125<br />
support.japan@freescale.com<br />
Asia/Pacific:<br />
<strong>Freescale</strong> Semiconductor China Ltd.<br />
Exchange Building 23F<br />
No. 118 Jianguo Road<br />
Chaoyang District<br />
Beijing 100022<br />
China<br />
+86 10 5879 8000<br />
support.asia@freescale.com<br />
For <strong>Li</strong>terature Requests Only:<br />
<strong>Freescale</strong> Semiconductor <strong>Li</strong>terature Distribution Center<br />
P.O. Box 5405<br />
Denver, Colorado 80217<br />
1-800-441-2447 or 303-675-2140<br />
Fax: 303-675-2150<br />
LDCFor<strong>Freescale</strong>Semiconductor@hibbertgroup.com<br />
Document Number: AN3825<br />
Rev. 0<br />
03/2009<br />
Information in this document is provided solely to enable system and software<br />
implementers to use <strong>Freescale</strong> Semiconductor products. There are no express or<br />
implied copyright licenses granted hereunder to design or fabricate any integrated<br />
circuits or integrated circuits based on the information in this document.<br />
<strong>Freescale</strong> Semiconductor reserves the right to make changes without further notice to<br />
any products herein. <strong>Freescale</strong> Semiconductor makes no warranty, representation or<br />
guarantee regarding the suitability of its products for any particular purpose, nor does<br />
<strong>Freescale</strong> Semiconductor assume any liability arising out of the application or use of any<br />
product or circuit, and specifically disclaims any and all liability, including without<br />
limitation consequential or incidental damages. “Typical” parameters that may be<br />
provided in <strong>Freescale</strong> Semiconductor data sheets and/or specifications can and do vary<br />
in different applications and actual performance may vary over time. All operating<br />
parameters, including “Typicals”, must be validated for each customer application by<br />
customer’s technical experts. <strong>Freescale</strong> Semiconductor does not convey any license<br />
under its patent rights nor the rights of others. <strong>Freescale</strong> Semiconductor products are<br />
not designed, intended, or authorized for use as components in systems intended for<br />
surgical implant into the body, or other applications intended to support or sustain life,<br />
or for any other application in which the failure of the <strong>Freescale</strong> Semiconductor product<br />
could create a situation where personal injury or death may occur. Should Buyer<br />
purchase or use <strong>Freescale</strong> Semiconductor products for any such unintended or<br />
unauthorized application, Buyer shall indemnify and hold <strong>Freescale</strong> Semiconductor and<br />
its officers, employees, subsidiaries, affiliates, and distributors harmless against all<br />
claims, costs, damages, and expenses, and reasonable attorney fees arising out of,<br />
directly or indirectly, any claim of personal injury or death associated with such<br />
unintended or unauthorized use, even if such claim alleges that <strong>Freescale</strong><br />
Semiconductor was negligent regarding the design or manufacture of the part.<br />
RoHS-compliant and/or Pb-free versions of <strong>Freescale</strong> products have the functionality<br />
and electrical characteristics as their non-RoHS-compliant and/or non-Pb-free<br />
counterparts. For further information, see http://www.freescale.com or contact your<br />
<strong>Freescale</strong> sales representative.<br />
For information on <strong>Freescale</strong>’s Environmental Products program, go to<br />
http://www.freescale.com/epp.<br />
<strong>Freescale</strong> and the <strong>Freescale</strong> logo are trademarks of <strong>Freescale</strong> Semiconductor, Inc.<br />
All other product or service names are the property of their respective owners.<br />
© <strong>Freescale</strong> Semiconductor, Inc. 2009. All rights reserved.