|
Part 2: Hardware and Software Implementation
by Thomas Richter
Start ý The
Buck Converter ý Voltage Reference and
Battery Temperature ý AT90S2333 Battery
Charger ý ATtiny15 Battery Charger
ý Charge Current ý Software
Implementation ý User Settings ý Source
Code ý INT Battery Function ý The
Stable_ADC Function ý BC.H ý B_DEF.H
ý Charge MethodýSLA.C ý Charge
MethodýNiCd.C and NiMH.C ý Charge MethodýLilon.C
ý Suggested Improvement ý Sources
and PDF
ATtiny15 BATTERY CHARGER
Now, letýs discuss the theory specific
for the battery charger design based on ATtiny15. The 25.6-MHz oscillator
frequency is generated with an on-chip PLL from a 1.6-MHz internal
RC oscillator. The reference design is shipped without resistors for
dividing down the voltage of the battery. This limits the maximum
voltage to 3.67 V, making it suitable for one or two NiCd or NiMh
batteries. To use higher voltages, simply add the required resistors
to divide the voltage into the 0 to 3.67-V range. Figure 3 gives the
parameters for the layout.
|
|
| Figure 3ýThe ýtiny15 layout
parameters can be seen here. |
The charge voltage is measured directly
on the positive battery pole. When a voltage higher than the reference
voltage (3.67 V) is used to charge the battery, the charging voltage
can be divided with two resistors to fit into the 0 to 3.67-V area.
This input is also the negative input for the differential measurement
of the battery charge current, as shown in Figure
4. The current is measured as
the difference between the negative and positive input to the internal
20x gain stage. This voltage is measured over a 0.25-ohm shunt resistor.
All measurements are done with 10-bit (1024-step) resolution.
The voltage resolution is decided by
AREF, which is determined by:
[13]
In order to select a suitable measurement
range for the charger, decide how many battery cells and what type
of batteries you want to charge. The ADC is capable of measuring the
voltage range from AGND to AREF (3.67 V). The
output voltage (VADC) from the voltage divider has to be
within this range:
[14]
where VADC is the output
voltage from the voltage divider to the AVR A/D, Vb is the
battery voltage, Ra and Rb are the resistors used to
scale down the battery voltage, Ra is equal to R8 in the reference
design, and Rb is equal to R16 in the reference design.
Note that resistors R9 and R17 (for scaling
down the voltage of the shunt resistors) must be equal to R8 and R16
(for scaling down the voltage measurement). The reference design uses
R8 = R9 = 3.7 kilohms and R16 = R17 = 2.2 kilohms.
This gives a maximum charge voltage of:
[15]
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |