Freedom Expansion Boards FRDM-BC3770-EVB and FRDM-BC3770-EVM, Rev. 2.0
40 NXP Semiconductors
Using BC3770 Components with Processor Expert
6.4.1.2 Interrupt Handling
If an interrupt from the battery charger occurs, an OnInterrupt event is invoked. (This interrupt handler is located in the Events.c file in
the Sources folder of your project.) When such an interrupt occurs, there are two options. The first is to read the Interrupt registers directly
from Battery charger. The second is to read the interrupt registers from the data structure DeviceData, which is updated prior to the
OnInterrupt event being invoked. The OnInterrupt event is useful when setting a flag to report some event has occurred is needed.
EnDisShutdown
Enables/disables the shutdown pin, which means the device is put in Shutdown mode. In Shutdown mode the I2C interface
is turned off to minimize power consumption. However, this applies only in case of an invalid input power source. This pin is
not effective as long as a valid input power source is present.
SetFastChargeTimer
Fast charge timer watches the device during Fast-charge mode. An interrupt is asserted if the battery voltage does not reach
its required value within this “fast-charge” time frame. Possible values are 3.5, 4.5, and 5.5 hours, or the timer can be dis-
abled.
SetTopOffTimer Top-off timer watches the device during Top-off mode. An interrupt is asserted if the battery voltage does not reach its
required value within this “top-off” time frame. Possible values are: 10, 20, 30, or 45 minutes.
GetStatus This method returns the content of the status register.
SetPreChargeCurrent
Pre-charge current is current charging the battery in pre-charge mode. The battery charger enters Pre-charge mode when
battery voltage is higher than 2.5 V. If the battery voltage does not exceed the VSYS_MIN threshold before the pre-charge
timer expires, charging is suspended and a fault signal is asserted via the INTB pin.
SetFastChargeCurrent
Fast-charge current is current charging the battery in Fast-charge mode. The Fast-charge mode is entered when the battery
voltage exceeds the VSYS_MIN threshold of a typical 3.6 V. If the battery voltage does not reach the VBAT_REG threshold
before the timer expires, charging is suspended and a fault signal is asserted via the INTB pin.
SetTopOffCurrent
Top-off-charge current is current charging the battery in Top-off mode. After the top-off timer expires, the top-off event is
reported to the processor via the INTB pin, which means the battery is fully charged. As soon as the processor reads the
interrupt registers, the processor is able to turn off the charger.
SetDischargeCurrent This method sets the discharge current limit in Discharge mode.
SetBatteryRegulation
Threshold
Based on this threshold, the charger transits from Fast-charge mode (Constant-current mode) to Full-charge mode (Con-
stant-voltage mode). In Full-charge mode, the fast charge current is reduced to a programmable top-off current. Up to this
threshold the VSYS output tracks the battery voltage in Trickle and Pre-charge mode.
SetWeakBattery
Threshold
This method sets the weak battery threshold voltage. The threshold ranges from 3.0 V to 3.75 V in 50 mV steps. A weak bat-
tery detection function allows the processor to acknowledge the low-battery condition by asserting an INTB event.
SetBoostOTGVoltage This method sets OTG voltage in Boost (OTG) mode. In Boost mode the device provides a regulated output voltage to
VBUS from the battery.
EnDisAutostop
This method enables or disables the autostop feature. If autostop is enabled after the top-off timer expires, the charger turns
off and goes into DONE state. If it is disabled, the charger is on continuously and stays in CV mode after the top-off timer is
expires.
EnDisAICL
Enables/disables adaptive-input current limit (AICL). AICL is mostly used at the beginning of the charging process when cur-
rent dissipation is higher than the current the power source can provide. This feature prevents the power source from col-
lapsing.
SetAICLVoltage
Threshold
This method sets AICL threshold voltage on VBUS. To keep the device functional with a current and voltage limited VBUS
source, the device in Start-up mode automatically starts incrementing the input current limit to either the default or pre-pro-
grammed value until either the input current limit is detected or the VBUS voltage detects the AICL threshold. This keeps
input supply voltage as a valid power source to provide the load for the application. The device allows the maximum current
the input supply can possibly provide without severely collapsing.
SetAICLCurrentLimit
This method sets the input current limit by writing to VBUSCTRL register. This value limits the fast-charge current when the
device is in Fast-charge mode. It also sets the limit for the adaptive-input current limit (AICL) when a device in Start-up mode
automatically starts incrementing the input current limit to either the default or pre-programmed value until either the input
current limit is detected or the VBUS voltage detects the AICL threshold. This keeps input supply voltage as a valid power
source to provide the load for the application.
OnInterrupt
Interrupt event handler from battery charger. This event is invoked every time there is a falling edge on the INT interrupt pin.
Contents of the registers in the device structure are updated prior to this event, so the interrupt registers directly from this
structure (without sending I2C command) can be read.
Table 8. BC_MC32BC3770 Methods and Events
Methods/Events Description