electronica Nov 2014
37
M
ICROCONTROLLERS
the purposes of this application example, the
worst case is that the Receive Update function
is performed about once every 10 minutes.
Thus, for the meter current-consumption cal-
culations, Receive Update is considered to be
a regular function with a 10-minute interval.
Here are more details about the main tasks
the meter microcontroller performs. Gen-
erating periodic wake-ups: because the real-
time clock operates continuously in this meter
design, it provides a convenient, power-ef-
ficient method for generating the 1-second
periodic wake-up signal. The 128Hz clock
that drives the RTC is derived from the sub-
clock (XCIN) 32.768 kHz input. Counters in
the RTC produce accurate time signals (year,
month, week, day, hour, minute and second)
for up to 99 years, making automatic leap-year
corrections. The MCU Alarm mode (ALM)
can generate an interrupt on the year, month,
date, day-of-week, hour, minute or sec-
ond. Another interrupt source, the periodic
interrupt (PRD), is convenient for initiating
shorter time periods because it can generate
an interrupt every 2 seconds, 1 second, 1/2
second, 1/4 second, 1/8 second, 1/16 second,
1/32 second 1/64 second or 1/256 second. The
example flow meter design utilises the 1-sec-
ond PRD interrupt for operational timing.
Monitoring flow: once every second, the MCU
ADC converts the output of the external Flow
Sensor to produce digital flow data. The ADC
converter is turned on via software prior to
each measurement. This keeps power dissi-
pation low, since the converter adds 0.66mA
to the current consumption when the MCU
is running at 32 MHz. At that clock speed,
the ADC has to be enabled for 3μs to make a
measurement: 1μs to enable the A/D, 1μs to
perform conversion, and a 1μs delay before
the converter is subsequently disabled. At 32
MHz, the RX111 wake-up time into the run
mode is 40μs. This time must be added to the
15μs it takes the CPU to process the flow data
from the ADC. Measuring battery level: the
low voltage detector in RX100 MCUs has two
separate voltage detection circuits. The LVD1
circuit measures the battery voltage (VCC). It
can compare this voltage to ten different volt-
age steps, ranging from 1.86V to 3.1V. By con-
trast, the LVD2 circuit can compare an external
voltage source to four different voltage steps,
ranging from 1.8V to 2.9V. In this flow meter
design, VCC is checked every minute to mon-
itor its condition using the LVD1 module to
get the most accurate measurement. It gener-
ates an interrupt if the level begins to approach
the specified lower voltage limit of 2.7V for 32
MHz operation of the RX111.
The MCU stores the measured battery voltage
and, if necessary, sends an alert to the utility
central control system during the next Send
Update operation. The battery measurement
function can run at 1MHz, so its associated
wake-up time is only 4.8μs. Its processing
time (at 1MHz) is estimated to be approxi-
mately 35μs. Thus, the total active time for this
function is about 40μs. Every 10 minutes, the
Send Update command uses the SPI periph-
eral to transmit data to the central control sys-
tem. To calculate the energy used by the meter
design, an engineering assumption is made
that it requires 1000μs to process and trans-
fer the data. Every 10 minutes, the Receive
Update command uses the SPI peripheral to
receive data from the central control system.
It is assumed that 2000μs is needed to wake,
receive and process the data.
Table 3 shows the execution time and current
drain of each of the flow meter functions. The
0.6mA current consumption number (high-
speed run mode; table 2) is used here because
the RX111 MCU CPU is active and some of
the built-in peripheral functions of the chip
may also be active. When the ADC is active, it
adds 0.66mA to the current consumption. To
determine the meter battery lifetime, the indi-
vidual average current for each function is cal-
culated by multiplying the current drain by the
percent cycle active. Results are shown in the
right-hand column in table 3. The sum of these
contributions is the total average MCU current
(ICC): 1.46μA. Of the major contributors to
the average current consumption of the meter,
the software standby mode current, 0.79μA,
accounts for about 54% of the 1.46μA total,
while the Flow Monitor function consumes
0.62μA, or approximately 42% of the total. In
applications like this that have relatively long
periods of inactivity, the current consumed in
the software standby and run modes generally
accounts for most of the average MCU current.
Thus, it’s important that the MCU used in the
design has excellent low-power characteristics
in both of these modes.
For this example application, the meter battery
pack is assumed to have a capacity of 300 mAh
and provides approximately 3V for most of its
life. Given that information, the battery life-
time is computed by dividing the average MCU
current into the battery capacity, as indicated
here: 300,000μAh/1.46μA = 206,243 hours, or
23.5 years. The calculation reveals that the bat-
tery lifetime of the RX111-based flow meter
exceeds the specified 20-year requirement.This
result clearly demonstrates the system design
advantages gained by applying the exceptional
low-power characteristics of an RX100 MCU.
The mentioned battery lifetime computa-
tions focus on the current contributed by the
microcontroller. For clarity, the current drain
of external components and the self-discharge
characteristics of the batter are not considered
in this example. Various design techniques
are helpful for applications in which external
devices must be considered; however, they are
beyond the scope of this article.
The advanced low-power characteristics of
RX100 MCUs make them excellent solutions
for flow meters and similar applications that
require battery operation. Among the device
features most helpful in such uses are the fol-
lowing: the power-efficient run mode, very
low software standby current, the fast wake-up
time from software standby mode, low power
dissipation for the RTC and LVD peripher-
als, and power-efficient processing at slower
clock frequencies. The lower-frequency run
modes of RX100 MCUs allow longer battery
lifetimes if the primary application routines
have a fixed execution time, i.e. one that’s not
determined solely by CPU performance.
Table 3. Power consumption estimates for the flow meter