bq4285E/L
Interrupts
Two methods can be used to process bq4285E/L inter-
rupt events:
The bq4285E/L allows three individually selected inter-
rupt events to generate an interrupt request. These
three interrupt events are:
n
Enable interrupt events and use the interrupt request
output to invoke an interrupt service routine.
n
n
The periodic interrupt, programmable to occur once
n
Do not enable the interrupts and use a polling routine
to periodically check the status of the flag bits.
every 122µs to 500 ms.
The alarm interrupt, programmable to occur once per
second to once per day, is active in battery-backup
mode, providing a “wake-up” feature.
The individual interrupt sources are described in detail
in the following sections.
Periodic Interrupt
n
The update-ended interrupt, which occurs at the end
of each update cycle.
The mux output used to drive the SQW output also
drives the interrupt-generation circuitry. If the periodic
interrupt event is enabled by writing a 1 to the periodic
interrupt enable bit (PIE) in register C, an interrupt re-
quest is generated once every 122µs to 500ms. The pe-
riod between interrupts is selected by the same bits in
register A that select the square wave frequency (see Ta-
ble 3). Setting OSC2–OSC0 in register A to 011 does
not affect the periodic interrupt timing.
Each of the three interrupt events is enabled by an indi-
vidual interrupt-enable bit in register B. When an event
occurs, its event flag bit in register C is set. If the corre-
sponding event enable bit is also set, then an interrupt
request is generated. The interrupt request flag bit
(INTF) of register C is set with every interrupt request.
Reading register C clears all flag bits, including INTF,
and makes INT high-impedance.
Table 3. Square-Wave Frequency/Periodic Interrupt Rate
Register A Bits
Square Wave
Periodic Interrupt
OSC2 OSC1 OSC0
RS3
0
RS2
RS1
0
RS0
0
Frequency
None
256
128
8.192
Units
Period
None
Units
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
Hz
Hz
3.90625
7.8125
122.070
244.141
488.281
976.5625
1.95315
3.90625
7.8125
15.625
31.25
ms
ms
µs
0
1
0
0
1
1
kHz
kHz
kHz
kHz
Hz
0
0
0
4.096
2.048
1.024
µs
0
0
1
µs
0
1
0
µs
0
1
1
512
ms
ms
ms
ms
ms
ms
ms
ms
ms
1
0
0
256
128
64
32
16
8
Hz
1
0
1
Hz
1
1
0
Hz
1
1
1
Hz
1
0
0
Hz
62.5
1
0
1
Hz
125
1
1
0
4
Hz
250
1
1
1
2
Hz
500
same as above defined
by RS3–RS0
32.768
0
1
1
X
X
X
X
kHz
6