chip SRAM and jumps to the application code entry point.
There are only a few minor modifications needed for
LaunchPad:
1. Add a resistor divider across the battery terminals
and connect to ADC (analog-to-digital converter) pin 58.
2. Open J2 and J3 so that the yellow and green LEDs
are not ON in Hibernate mode.
3. Open J13 to supply the board from the J20 battery
connector.
4. Depopulate R3 to disable the D1 LED.
5. Depopulate R20 to disable the D4 LED.
6. Connect the reed switch to wake-up input GPIO
(general-purpose input/output) #13.
The CC3200 ADC is 12-bit/eight-channel, out of
which four channels are available for user applications.
The sampling rate is fixed at 16 µs per channel, and the
channels are sampled in a round-robin fashion. The pins
tolerate a maximum of 1.8V, but full scale is 1.467V.
To keep it simple, I chose to implement a divide-by-two resistive divider. Since this will always be connected
across the battery terminals, I went with one meg resistors
to keep the current consumption low. The drawback to
this approach is that the sampling capacitor current will be
severely limited, thereby affecting ADC readings. To fix
this problem, I placed a 100 nF capacitor across the lower
leg of the resistive divider.
The CC3200 internal sampling cap is 12 pF and is
switched on for 400 ns. So, a much larger 100 nF external
cap will supply enough current for the sampling cap to
reach the final voltage value of the divider in time to get
correctly sampled. The simulation in Figure 5 shows the
voltage on the sampling cap with and without the 100 nF
external cap.
Also, I knowingly compromised the voltage range
measurement and bandwidth. This means the ADC input
will get full scale when the battery voltage is 2.9V. Also,
the voltage change on the pin will be slower. In this
application, that didn’t matter since I was only interested
in a low point in the battery voltage range. If the battery
voltage dips below 2.4V, a text will go out as a warning to
replace the batteries.
Assuming two AA batteries (not at full capacity) and
an average load current about six times higher than
expected, the batteries should last well over a year: 2,000
mAh/0.1 mA = 20,000h 833 days.
Whenever the reed switch input is sampled, it’s also
debounced. The
pin is pooled every
10 ms, 100
consecutive times.
Only if it reads “1”
every single time
will it return
“success.” This will
prevent a false
alarm.
To preserve the
batteries, the
device is kept in
Hibernate mode. In
this state, most of
the SoC is powered
down except the
RTC (real time
clock) and 2x32-bit
OCR registers.
Before
hibernating, the
16 February 2018
■ FIGURE 4. CC3200 functional block diagram.
■ FIGURE 5.Voltage on the sampling capacitor with and without an external capacitor in
the voltage divider.