Maxq3120, High-precision adc mixed-signal microcontroller, Interrupts – Rainbow Electronics MAXQ3120 User Manual

Page 22: Reset sources, I/o ports

Advertising
background image

MAXQ3120

Power consumption reaches its minimum in stop mode.
In this mode, the external high-frequency oscillator,
system clock, and all code execution is halted. Stop
mode is exited when an enabled external interrupt pin
is triggered, an external reset signal is applied to the

RESET pin, or the RTC time-of-day alarm is activated.

The 32kHz clock continues running during stop mode,
enabling the following peripherals to keep running dur-
ing stop mode.

• The RTC always continues running during stop

mode.

• The LCD controller continues running during stop

mode if it is running from the 32kHz clock (LCCS = 0).

Interrupts

Multiple reset sources are available for quick response
to internal and external events. The MAXQ architecture
uses a single interrupt vector (IV), single interrupt-ser-
vice routine (ISR) design. For maximum flexibility, inter-
rupts can be enabled globally, individually, or by
module. When an interrupt condition occurs, its individ-
ual flag is set, even if the interrupt source is disabled at
the local, module, or global level. Interrupt flags must
be cleared within the user-interrupt routine to avoid
repeated interrupts from the same source. Application
software must ensure a delay between the write to the
flag and the RETI instruction to allow time for the inter-
rupt hardware to remove the internal interrupt condition.
Asynchronous interrupt flags require a one-instruction
delay and synchronous interrupt flags require a two-
instruction delay.

When an enabled interrupt is detected, software jumps
to a user-programmable interrupt vector location. The
IV register defaults to 0000h on reset or power-up, so if
it is not changed to a different address, the user pro-
gram must determine whether a jump to 0000h came
from a reset or interrupt source.

Once software control has been transferred to the ISR,
the interrupt identification register (IIR) can determine if
a system register or peripheral register was the source
of the interrupt. The specified module can then be inter-
rogated for the specific interrupt source and software
can take appropriate action. Because the interrupts are
evaluated by user software, the user can define a
unique interrupt priority scheme for each application.
The following interrupt sources are available.

• Watchdog Interrupt

• External Interrupts 0 to 2

• RTC Time-of-Day and Subsecond Alarms

• Serial Port 0 Receive and Transmit Interrupts

• Serial Port 1 Receive and Transmit Interrupts

• Timer 0 Overflow Interrupt

• Timer 1 Overflow and External Trigger Interrupts

• Timer 2 Low Compare, Low Overflow, Capture/

Compare, and Overflow Interrupts

Reset Sources

Several reset sources are provided for microcontroller
control. Although code execution is halted in the reset
state, the high-frequency oscillator and the 32kHz oscilla-
tor continue to oscillate. Internal resets such as the
power-on and watchdog resets assert the RESET pin low.

Power-On Reset

An internal power-on reset circuit enhances system reli-
ability. This circuit forces the device to perform a
power-on reset whenever a rising voltage on DV

DD

climbs above the V

RST

level. At this point, the following

events occur:

• All registers and circuits enter their reset state

(except for the RTC, if it is battery-backed)

• The POR flag (WDCN.7) is set to indicate the source

of the reset

• Code execution begins at location 8000h

Watchdog Timer Reset

The watchdog timer functions are described in the
MAXQ Family User’s Guide. Execution resumes at loca-
tion 8000h following a watchdog timer reset.

External System Reset

Asserting the external RESET pin low causes the
device to enter the reset state. The external reset func-
tions as described in the MAXQ Family User’s Guide.
Execution resumes at location 8000h after the RESET
pin is released.

I/O Ports

The microcontroller uses the Type C and Type D bidi-
rectional I/O ports described in the MAXQ Family
User’s Guide
. The use of two port types allows for maxi-
mum flexibility when interfacing to external peripherals.
Each port has eight independent, general-purpose I/O
pins and three configure/control registers. Many pins
support alternate functions such as timers or interrupts,
which are enabled, controlled, and monitored by dedi-
cated peripheral registers. Using the alternate function
automatically converts the pin to that function.

High-Precision ADC
Mixed-Signal Microcontroller

22

____________________________________________________________________

Advertising