Maxq3120, High-precision adc mixed-signal microcontroller, Real-time clock – Rainbow Electronics MAXQ3120 User Manual

Page 24: Programmable timers, Watchdog timer

Advertising
background image

MAXQ3120

Real-Time Clock

A binary real-time clock keeps the time of day in
absolute seconds with 1/256-second resolution. The
32-bit second counter can count up to approximately
136 years and be translated to calendar format by the
application software. A time-of-day alarm and indepen-
dent subsecond alarm can cause an interrupt, or wake
the device from stop mode.

The independent subsecond alarm runs from the same
RTC, and allows the application to perform periodic
interrupts up to 8 seconds with a granularity of approxi-
mately 3.9ms. This creates an additional timer that can
be used to measure long periods without performance
degradations. Traditionally, long time periods have
been measured using multiple interrupts from shorter
programmable timers. Each timer interrupt required
servicing, with each accompanying interruption slowing
system operation. By using the RTC subsecond timer
as a long-period timer, only one interrupt is needed,
eliminating the performance hit associated with using a
shorter timer.

An internal crystal oscillator clocks the RTC using inte-
grated 6pF load capacitors, and gives the best perfor-
mance when mated with a 32.768kHz crystal rated for a
6pF load. No external load capacitors are required.
Higher accuracy can be obtained by using the digital
RTC trim function. The frequency accuracy of a crystal-
based oscillator circuit is dependent upon crystal accu-
racy, the match between the crystal and the oscillator
capacitor load, ambient temperature, etc.

Programmable Timers

The MAXQ3120 incorporates one instance each of the
timer 0, timer 1, and timer 2 peripherals. These timers
can be used in counter/timer/capture/compare/PWM
functions, allowing precise control of internal and exter-
nal events. Timer 2 supports optional single-shot, exter-
nal gating, and polarity control options as well as
carrier generation support for infrared transmit/receive
functions using serial port 0.

Timer 0

The timer 0 peripheral includes the following:

• 8-bit autoreload timer/counter

• 13-bit or 16-bit timer/counter

• Dual 8-bit timer/counter

• External pulse counter

Timer 1

The timer 1 peripheral includes the following:

• 16-bit autoreload timer/counter

• 16-bit capture

• 16-bit counter

• Clock generation output

Timer 2

The timer 2 peripheral includes the following:

• 16-bit autoreload timer/counter

• 16-bit capture

• 16-bit counter

• 8-bit capture and 8-bit timer

• 8-bit counter and 8-bit timer

• Infrared carrier generation support

Watchdog Timer

An internal watchdog timer greatly increases system
reliability. The timer resets the processor if software
execution is disturbed. The watchdog timer is a free-
running counter designed to be periodically reset by
the application software. If software is operating cor-
rectly, the counter is periodically reset and never
reaches its maximum count. However, if software oper-
ation is interrupted, the timer does not reset, triggering
a system reset and optionally a watchdog timer inter-
rupt. This protects the system against electrical noise
or electrostatic discharge (ESD) upsets that could
cause uncontrolled processor operation. The internal
watchdog timer is an upgrade to older designs with
external watchdog devices, reducing system cost and
simultaneously increasing reliability.

The watchdog timer is controlled through bits in the
WDCN register. Its timeout period can be set to one of
four programmable intervals ranging from 2

12

to 2

21

system clocks in its default mode, allowing flexibility to
support different types of applications. The interrupt
occurs 512 system clocks before the reset, allowing the
system to execute an interrupt and place the system in
a known, safe state before the device performs a total
system reset. At 8MHz, watchdog timeout periods can
be programmed from 512µs to 61.7s, depending on the
system clock mode.

High-Precision ADC
Mixed-Signal Microcontroller

24

____________________________________________________________________

Advertising