Datasheet

105
8024A–AVR–04/08
ATmega8HVA/16HVA
of lower resolution. The Accumulate Current Output provides a highly accurate current measure-
ment for Coulomb Counting.
The CC-ADC also provides a special Regular Current detection mode. This allows ultra-low
power operation in Power-save mode when small charge or discharge currents are flowing.
For offset cancellation the polarity of the input signal could be switched run time. Using this fea-
ture correctly will remove the internal CC-ADC offset. See application note AVR352.
19.3 Normal Operation
When enabled the CC-ADC continuously measures the voltage over the external sense resistor
R
SENSE
. Running in normal conversion mode, two data conversion output is provided.
Instantaneous Conversion Result
Accumulation Conversion Result
The Instantaneous Current conversion time is fixed to 3.9 ms (typical value) allowing the output
value to closely follow the input. After each Instantaneous Current conversion an interrupt is
generated if the interrupt is enabled. Data from conversion will be updated in the Instantaneous
Current registers CADICL and CADICH at the same time as the interrupt is given. To avoid los-
ing conversion data, both the low and high byte must be read within a 3.9 ms timing window after
the corresponding interrupt is given. When the low byte register is read, updating of the Instanta-
neous Current registers and interrupts will be stopped until the high byte is read. Figure 19-2
shows an Instantaneous Current conversion diagram, where DATA4 will be lost because DATA3
reading is not completed within the limited period.
Figure 19-2. Instantaneous Current Conversions
The Accumulate Current output is a high-resolution, high accuracy output with programmable
conversion time selected by the CADAS bits in CADCSRA. The converted value is an accurate
measurement of the average current flow during one conversion period. The CC-ADC generates
an interrupt each time a new Accumulate Current conversion has finished if the interrupt is
enabled. Data from conversion will be updated in the Accumulation Current registers CADAC0,
CADAC1, CADAC2 and CADAC3 at the same time as the interrupt is given. To avoid losing con-
version data, all bytes must be read within the selected conversion period. When the lower byte
registers are read, updating of the Accumulation Current registers and interrupts will be stopped
until the highest byte is read. Table 19-3 shows an Accumulation Current conversion diagram,
where DATA4 will be lost because DATA3 reading is not completed within the limited period.
Enable
Instantaneous
Interrupt
Accumulation
Data
Read low byte
Read high byte
3.9ms3.9ms~12ms settling 7.8ms
INVALID DATA
DATA 1
DATA 2
DATA 3
DATA 4