This document is provided as a supplement to the MAXQ Family User’s Guide, covering new or modified features
specific to the MAXQ2010. This document must be used in conjunction with the MAXQ Family User’s Guide, available
on our website at www.maxim-ic.com/MAXQUG. Addenda are arranged by section number, which correspond to
sections in the MAXQ Family User’s Guide. Additions and changes, with respect to the MAXQ Family User’s Guide,
are contained in this document, and updates/additions are added when available.
The MAXQ2010 is a low-power, high-performance, 16-bit, RISC microcontroller based on the MAXQM architecture
design. It includes support for integrated, in-system-programmable, flash memory and a wide range of peripherals
including an 8-channel, 12-bit successive-approximation analog-to-digital converter (SAR ADC) and an LCD driver
supporting up to 1/4-duty multiplexed displays. The MAXQ2010 is uniquely suited for any application that requires high
performance and low-power operation.
1.1 References
Refer to the MAXQ Family User’s Guide for the following information:
• Description of the core architecture, instruction set, and memory mapping common to all MAXQ microcontrollers.
• Definitions and functions of the common system register set, including accumulators, data pointers, loop counters,
and general-purpose registers.
• Descriptions of common clock generation, interrupt handling, and reset/power-management modes.
• Descriptions and programming examples for common MAXQ peripherals found on the MAXQ2010 including the
serial universal synchronous/asynchronous receiver-transmitter (USART), SPIK interface, and hardware multiplier.
• Description of the test access port (TAP) and in-circuit debug interface.
• Description of the in-system programming mode.
The MAXQ2010 data sheet, which contains electrical/timing specifications and pin descriptions, is available at
www.maxim-ic.com/MAXQ2010.
Errata sheets for the MAXQ2010 and other MAXQ micros are available at www.maxim-ic.com/errata.
For more information on other MAXQ microcontrollers, development hardware and software, frequently asked questions, and software examples, visit the MAXQ page at www.maxim-ic.com/MAXQ.
MAXQ is a registered trademark of Maxim Integrated Products, Inc.
SPI is a trademark of Motorola, Inc.
1-1
MAXQ Family User’s Guide:
MAXQ2010 Supplement
ADDENDUM TO SECTION 2: ARCHITECTURE
The MAXQ2010 shares the common architecture features with other members of the MAXQ microcontroller family.
Details are discussed in the following sections.
2.1 Instruction Set
This device uses the standard 16-bit MAXQ20 core instruction set as described in the MAXQ Family User’s Guide.
2.2 Harvard Memory Architecture
Program memory, data memory, and register space follow the Harvard architecture model. Each type of memory
is kept separate and is accessed by a separate bus, allowing different word lengths for different types of memory.
Registers can be either 8 bits or 16 bits in width. Program memory is 16 bits in width to accommodate the standard
MAXQ20 16-bit instruction set. Data memory is also 16 bits in width, but can be accessed in 8-bit or 16-bit modes for
maximum flexibility.
The MAXQ2010 includes a flexible memory-management unit (MMU) that allows code to be executed from either the
program flash, the utility ROM, or the internal data SRAM. Any of these three memory spaces can also be accessed
in data space at any time, with the single restriction that the physical memory area that is currently being used as program space cannot be simultaneously read from in data space. In the event that it is necessary to read data from the
program segment that is currently in use (for example, when executing code from program flash that utilizes a lookup
table also located in program flash), standardized data transfer functions provided in the utility ROM can be used to
do so. See Section 24:Utility ROM for more details.
2.3 Register Space
The MAXQ2010 contains the standard set of MAXQ20 system registers as described in the MAXQ Family User’s Guide,
but with differences noted in this guide where they exist.
Peripheral register space (modules 0 to 4) contains registers that are used to access the following peripherals:
• 12-bit SAR ADC converter with up to eight single-ended or four differential input channels
• General-purpose 8-bit I/O ports (P0 to P6)
• External interrupts (up to 23)
• Three programmable Type B timer/counters
• Two serial USART interfaces
• I2C interface
• SPI interface
• Hardware multiplier
• Real-time clock (RTC)
• LCD controller
The lower 8 bits of all registers in modules 0 to 4 (as well as the AP module M8) are bit addressable.
2-1
OOh
O1h
O2h
O3h
O4h
O5h
O6h
O7h
O8h
O9h
0Ah
OBh
OCh
ODh
OEh
OFh
10h
REGISTER INDEX
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
MAXQ Family User’s Guide:
REGISTER MODULE
M0M1M2M3M4M8M9
PO0
PO1
PO2
PO3
EIFOMC1TB2REIF1
PD0PD4LCD5
PD1
PD2PD6
PD3
SPICN
SPICFLCD11
SPICKLCD12
RTRMLCD13
RCNTLCD14
RTSSLCD15
RTSHLCD16
RTSLLCD17
RSSALCD18
RASHLCD19
RASLLCD20
MCNT
PO4I2CBUFTBORAPA[O]IP
MA
PO5
PO6
SPIB
SVM
PD5
MB
MC2
LCD6
LCD7
LCD8
LCD9
LCD10
I2CST
I2CIE
SCON0
SBUFOICEIEOMC0TB2CEIE1
SCON1IMRLCFGADSTEIF2
SBUF1ADADDREIE2
SMD0SCPIOMC1RTB0CNP14
PR0PI1MC0RTBOVPI5
SMD1PF2LCRATB1CNPI6
PR1IIRP13LCD0TB1VEIES1
I2CCNEIES0LCD1TB2CNEIES2
I2CCKLCD2TB2V
I2CTOLCD3ADCN
I2CSLALCD4PWCN
TBOC
TB1R
TB1C
ADDATA
APCA[1]
PSF
CKCN
WDCN
MAXQ2010 Supplement
A[2]
A[3]
A[4]
A[5]
A[6]
A[7]
A[8]
A[9]
A[10]
A[11]
A[12]
A[13]
A[14]
A[15]
M11
PFX
M12M13M14M15
SP
IV
OFFSDP[O]
DPC
GR
LC[0]GRL
BPLC[1]DP[1]
GRS
GRH
GRXL
BP[OFFS]
RESERVED
OR
OP CODE
8-CHANNEL
SAR ADC
PORT PINS
(GPIO)
REAL-TIME
CLOCK
INTERRUPT
CONTROL
Figure 2-1. MAXQ2010 System and Peripheral Register Map
2-2
HARDWARE
MULTIPLIER
SERIAL,
SPI, I
2
C
LCD
CONTROLLER
TIMERS
ACC
ARRAY,
CONTROL
OTHER
FUNCTIONS
MAXQ Family User’s Guide:
MAXQ2010 Supplement
2.4 Memory Organization
As with all MAXQ microcontrollers, the MAXQ2010 contains logically separate program and data memory spaces. All
memory is internal, and physical memory segments (other than the stack and register memories) can be accessed as
either program memory or as data memory, but not both at once.
The MAXQ2010 contains the following physical memory segments.
2.4.1 Register Space
As described in the MAXQ Family User’s Guide, register space on MAXQ microcontrollers consists of 16 register modules, each of which could contain up to 32 registers. Of these possible 16 register modules, only 12 are used on the
MAXQ2010: seven for system registers and five for peripheral registers.
2.4.2 Program Stack
The MAXQ2010 provides a 16 x 16 hardware stack to support subroutine calls and system interrupts. This stack is used
automatically by CALL/RET and PUSH/POP instructions, and can also be accessed directly through the SP register as
described in the MAXQ Family User’s Guide.
When using the in-circuit debugging features, one word of the stack must be reserved to store the return location when
execution branches into the debugging routines in the utility ROM. If in-circuit debug is not used, the entire stack is
available for application use.
2.4.3 Data SRAM
The MAXQ2010 contains up to 1024 words (2KB) of on-chip data SRAM, which can be mapped into either program or
data space. The contents of this SRAM are indeterminate after power-on reset, but are maintained during stop mode
and across non-POR resets.
When using the in-circuit debugging features, the highest 19 bytes of the SRAM must be reserved for saved state storage and working space for the debugging routines in the utility ROM. If in-circuit debug is not used, the entire SRAM
is available for application use.
2.4.4 Program Flash
The MAXQ2010 contains 32KWords (32K x 16) of flash memory, which normally serves as program memory. When
executing from the data SRAM or utility ROM, this memory is mapped to data space (as 32KWords or 64KB) and can
be used for lookup tables and similar functions.
Since program memory is mapped into data space starting at address 8000h, only half the available program memory
can be mapped into data space at one time when operating in byte-access mode. The CDA0 (code data access) bit
is used to control which half of program memory is available in data space as shown in Figure 2-3 and Figure 2-4, and
as described in the MAXQ Family User’s Guide. When operating in word-access mode, the entire 32KWord program
memory can be mapped into data space at once.
Flash memory mapped into data space can be read from directly, like any other type of data memory. However, writing
to flash memory must be done indirectly by calling the in-application functions provided by the utility ROM. See Section 24:Utility ROM for more details.
2.5 Program and Data Memory Mapping
Figures 2-2, 2-3, and 2-4 show the mapping of physical memory segments into the program and data memory space.
The mapping of memory segments into program space is always the same. The mapping of memory segments into
data space varies depending on which memory segment is currently being executed from.
In all cases, whichever memory segment is currently being executed from in program space may not be accessed in
data space.
2-3
MAXQ Family User’s Guide:
MAXQ2010 Supplement
DATA SPACE
(BYTE MODE)
4K x 8
UTILITY ROM
2K x 8
DATA SRAM
EXECUTING FROM
PROGRAM
SPACE
1K x 16
DATA SRAM
2K x 16
UTILITY ROM
32K x 16
PROGRAM FLASH
FFFFh
A3FFh
A000h
87FFh
8000h
7FFFh
0000h
Figure 2-2. Memory Map When Executing from Program Flash Memory
DATA SPACE
(WORD MODE)
FFFFhFFFFh
8FFFh
8000h
07FFh
0000h
2K x 16
UTILITY ROM
1K x 16
DATA SRAM
87FFh
8000h
03FFh
0000h
EXECUTING FROM
PROGRAM
SPACE
1K x 16
DATA SRAM
2K x 16
UTILITY ROM
16K x 16
PROGRAM FLASH
(PAGE 1)
16K x 16
PROGRAM FLASH
(PAGE 0)
DATA SPACE
(BYTE MODE, CDA0 = 0)
FFFFhFFFFh
A3FFh
A000h
87FFh
8000h
7FFFh
4000h
3FFFh
0000h
32K x 8
LOWER HALF
(PAGE 0) OF
PROGRAM FLASH
MEMORY
8000h
07FFh
2K x 8
DATA SRAM
0000h
DATA SPACE
(BYTE MODE, CDA0 = 1)
32K x 8
UPPER HALF
(PAGE 1) OF
PROGRAM FLASH
MEMORY
2K x 8
DATA SRAM
FFFFh
8000h
07FFh
0000h
DATA SPACE
(WORD MODE)
FFFFh
32K x 16
PROGRAM FLASH
8000h
03FFh
1K x 16
DATA SRAM
0000h
Figure 2-3. Memory Map When Executing from Utility ROM
2-4
MAXQ Family User’s Guide:
MAXQ2010 Supplement
EXECUTING FROM
PROGRAM
SPACE
1K x 16
DATA SRAM
2K x 16
UTILITY ROM
16K x 16
PROGRAM FLASH
(PAGE 1)
16K x 16
PROGRAM FLASH
(PAGE 0)
DATA SPACE
(BYTE MODE, CDA0 = 0)
FFFFhFFFFh
A3FFh
A000h
87FFh
4K x 8
UTILITY ROM
8000h
7FFFh
4000h
3FFFh
0000h
32K x 8
LOWER HALF
(PAGE 0) OF
PROGRAM FLASH
MEMORY
8000h
7FFFh
0000h
DATA SPACE
(BYTE MODE, CDA0 = 1)
4K x 8
UTILITY ROM
32K x 8
UPPER HALF
(PAGE 1) OF
PROGRAM FLASH
MEMORY
FFFFh
8000h
7FFFh
0000h
DATA SPACE
(WORD MODE)
FFFFh
87FFh8FFFh8FFFh
2K x 8
UTILITY ROM
8000h
7FFFh
32K x 16
PROGRAM FLASH
0000h
Figure 2-4. Memory Map When Executing from Data SRAM
2.6 Clock Generation
All functional modules in the MAXQ2010 are synchronized to a single system clock. This system clock can be generated from one of the following clock sources:
• External high-frequency clock
• Internal high-frequency oscillator using external crystal or resonator circuit
• External 32kHz clock
• Internal 32kHz oscillator using external crystal or resonator circuit
• 256x frequency-locked loop (FLL) using 32kHz clock as an input source
The MAXQ2010 does not support an external RC relaxation oscillator circuit, and the FLL takes the place of the ring
oscillator found in some other devices. The 32kHz crystal oscillator could also be used directly by the LCD controller
and the RTC, regardless of the currently selected system clock source.
The following registers and bits are used to control clock generation and selection. For more information, see the register descriptions in this guide and in the MAXQ Family User’s Guide.
2.6.1 External High-Frequency Oscillator Circuit
The high-frequency oscillator operates as described in Section 2.7: Clock Generation of the MAXQ Family User’s
Guide. If used, the external crystal or resonator circuit for this oscillator should be connected between the HFXIN and
HFXOUT pins.
The high-frequency oscillator can be disabled by setting HFXD (PWCN.4) to 1; this is only allowed if the high-frequency
oscillator is not currently being used as the clock source (FLLMD and FLLSL must both equal 1). In this configuration,
an external clock can be used to directly drive HFXIN; refer to the IC data sheet for more details.
2-5
MAXQ Family User’s Guide:
MAXQ2010 Supplement
POWER-ON
RESET
STOP
CRYSTAL KLL
HF
CRYSTAL
FLL
ENABLE
32kHz
CRYSTAL
RESETXDOG COUNT
XDOG
STARTUP
TIMER
CLK INPUT
MUX
GLITCH-FREE
XDOG DONE
MAXQ2010
CLOCK
DIVIDER
WAKE-UP
TIMER, LCD
CONTROLLER
DIV 1
DIV 2
SELECTOR
MUX
GLITCH-FREE
DIV 4
DIV 8
32kHz
PMM1
DEFAULT
FLL SELECT
RESET DOG
WATCHDOG
TIMER
ENABLE
CLOCK
GENERATION
RWT
RESET
WATCHDOG RESET
WATCHDOG INTERRUPT
SYSTEM CLOCK
SWB
INTERRUPT/SERIAL PORT
RESET
STOP
STOP
POWER-ON
RESET
INPUT
CRYSTAL
MONITOR
ENABLE
FLLMD
POWER-ON RESET
XDOG DONE
FLLSL
Figure 2-5. MAXQ2010 Clock Sources
2.6.2 External 32kHz Crystal Oscillator Circuit
The 32kHz oscillator operates as described in Section 2.7: Clock Generation of the MAXQ Family User’s Guide. It cannot be used directly as a system clock source, but instead works as an input to the FLL. It can also be used directly by
the LCD controller and RTC modules, regardless of the current system clock source selection. This clock can be generated by an internal 32kHz crystal oscillator, using an external crystal connected between the 32KIN and 32KOUT pins.
Setting X32D (PWCN.2) to 1 disables the 32kHz clock source completely. This should only be done when all the following conditions are true:
• Either the high-frequency oscillator is being used as the system clock source, or if the FLL is being used as the
system clock source, it is already enabled and locked.
• The 32kHz clock is not being used to drive either the RTC or the LCD controller.
If X32D = 0, the control bit X32KBYP (PWCN.5) can be used to switch between the internal oscillator and external
32kHz clock modes of operation.
2-6
MAXQ Family User’s Guide:
MAXQ2010 Supplement
Table 2-1. System Clock Generation and Control Registers
REGISTERADDRESSBIT(S)FUNCTION
000: System clock = high-frequency clock divided by 1.
001: System clock = high-frequency clock divided by 2.
010: System clock = high-frequency clock divided by 4.
011: System clock = high-frequency clock divided by 8.
1xx: System clock = high-frequency clock/256.
CKCNM8[0Eh]
[2:0]—PMME,
CD[1:0]
CKCNM8[0Eh]5—FLLMD
CKCNM8[0Eh]6—FLLSL
PWCNM0[0Fh]0—FLLEN
PWCNM0[0Fh]1—FLOCK
PWCNM0[0Fh]2—X32D
PWCNM0[0Fh]3—X32KRDY
PWCNM0[0Fh]4—HFXD
PWCNM0[0Fh]5—X32KBYP
PWCNM0[0Fh][9:8]—X32KMD
0: System clock is being provided by an external source.
1: System clock is being provided by the FLL.
0: Selects an external source for system clock generation.
1: Selects the FLL for system clock generation.
0: Disables the FLL (unless it is providing the system clock).
1: Enables the FLL and locks it to the 32kHz input.
0: Indicates the FLL is disabled or in the process of locking.
1: Indicates the FLL is locked to the 32kHz input.
0: 32kHz clock or oscillator operates normally (default).
1: Disables the 32kHz source completely (except in stop).
0: Indicates the 32kHz oscillator is still warming up.
1: Indicates the 32kHz oscillator is ready for use.
0: High-frequency oscillator operates normally (default).
1: Disables the high-frequency oscillator, allowing an external clock to be
provided at HFXIN.
0: 32kHz clock is provided by internal oscillator (default).
1: Disables the 32kHz oscillator, allowing an external clock to be provided at
32KIN.
00: 32kHz oscillator operates in noise immune mode.
01: 32kHz oscillator operates in quiet mode.
10: 32kHz oscillator operates in noise immune mode normally and in quiet mode
during stop mode. (Note: This setting should not be used on devices of rev B3 or earlier; refer to the device errata for more details.)
11: 32kHz oscillator operates in quiet mode normally and in noise immune mode
during stop mode.
2.6.3 Frequency-Locked Loop (FLL)
The MAXQ2010 contains an FLL circuit that provides an optional, low-cost method of generating a high-frequency
system clock. The FLL uses the 32kHz clock as an input, multiplying its frequency by 256 to generate a clock output of
approximately 8.4MHz (refer to the IC data sheet for details). This clock output can be used as a system clock source.
On power-on reset, the FLL is automatically enabled as the system clock source while the high-frequency oscillator
warms up. Once the warmup count for the high-frequency oscillator has completed, the clock source switches to the
high-frequency oscillator automatically. If no external crystal or resonator circuit is provided at HFXIN, the switchover
never occurs, and the clock runs from the FLL indefinitely.
To select the FLL as the system clock source permanently, the FLLSL bit (CKCN.6) must be set to 1. Setting this bit
immediately switches over the system clock source to the FLL. The FLLMD (CKCN.5) bit indicates the current system
clock source. If the FLL is currently providing the system clock, FLLMD = 1; otherwise, FLLMD = 0.
Since the FLLSL bit is cleared by power-on reset only, if this bit is set before entering stop mode, the FLL is still used
as the system clock source when stop mode is exited. In this case, a four-cycle warmup delay is required when exiting
stop mode before execution resumes using the FLL as the system clock source.
2-7
MAXQ Family User’s Guide:
MAXQ2010 Supplement
When the system clock source is switched back from the FLL to the high-frequency oscillator by clearing FLLSL to
zero, the FLL is still used as the system clock source until the warmup period has completed for the high-frequency
oscillator. This is reflected by the value of the FLLMD bit, which remains at 1 until the warmup for the high-frequency
oscillator has completed and the clock switches over, at which point FLLMD switches to 0.
2.7 Interrupts
In general, interrupt handling on the MAXQ2010 operates as described in the MAXQ Family User’s Guide. All interrupt
sources have the same priority, and all interrupts cause program execution to branch to the location specified by the
Interrupt Vector (IV) register, which defaults to 0000h.
Table 2-2 lists all possible interrupt sources for the MAXQ2010, along with their corresponding module interrupt enable
bits, local interrupt enable bits, and interrupt flags.
• Each module interrupt enable bit, when cleared to 0, blocks interrupts originating in that module from being acknowledged. When the module interrupt enable bit is set to 1, interrupts from that module are acknowledged (unless all
interrupts have been disabled globally).
• Each local interrupt enable bit, when cleared to 0, disables the corresponding interrupt. When the local interrupt-
enable bit is set to 1, the interrupt is triggered whenever its interrupt flag is set to 1 by hardware or by software.
• Each interrupt flag bit, when set to 1, causes its corresponding interrupt to trigger. Interrupt flag bits are typically set
by hardware and must be cleared by software (generally in the interrupt handler routine).
Note that for an interrupt to fire, the following five conditions must exist:
• Interrupts must be enabled globally by setting IGE (IC.0) to 1.
• The module interrupt enable bit for the interrupt source’s module must be set to 1.
• The local interrupt enable bit for the specific interrupt source must be set to 1.
• The interrupt flag for the interrupt source must be set to 1. Typically, this is done by hardware when the condition
that requires interrupt service occurs.
• The interrupt-in-service (INS) bit must be cleared to 0. This bit is set automatically upon vectoring to the interrupt
handler (IV) address and cleared automatically upon exit (RETI/POPI), so the only reason to clear this bit manually
(inside the interrupt handler routine) is to allow nested interrupt handling.
Table 2-2. Interrupt Sources and Control Bits
INTERRUPTMODULE ENABLE BITLOCAL ENABLE BITINTERRUPT FLAG
Table 2-2. Interrupt Sources and Control Bits (continued)
INTERRUPTMODULE ENABLE BITLOCAL ENABLE BITINTERRUPT FLAG
External Interrupt 13 (P5.5)IM1 (IMR.1)EX13 (EIE1.5)IE13 (EIF1.5)
External Interrupt 14 (P5.6)IM1 (IMR.1)EX14 (EIE1.6)IE14 (EIF1.6)
External Interrupt 15 (P6.0)IM1 (IMR.1)EX15 (EIE2.0)IE15 (EIF2.0)
External Interrupt 16 (P6.1)IM1 (IMR.1)EX16 (EIE2.1)IE16 (EIF2.1)
External Interrupt 17 (P6.2)IM1 (IMR.1)EX17 (EIE2.2)IE17 (EIF2.2)
External Interrupt 18 (P6.3)IM1 (IMR.1)EX18 (EIE2.3)IE18 (EIF2.3)
External Interrupt 19 (P6.4)IM1 (IMR.1)EX19 (EIE2.4)IE19 (EIF2.4)
External Interrupt 20 (P6.5)IM1 (IMR.1)EX20 (EIE2.5)IE20 (EIF2.5)
External Interrupt 21 (P6.6)IM1 (IMR.1)EX21 (EIE2.6)IE21 (EIF2.6)
External Interrupt 22 (P6.7)IM1 (IMR.1)EX22 (EIE2.7)IE22 (EIF2.7)
Supply Voltage Monitor InterruptIM1 (IMR.1)SVMIE (SVM.2)SVMI (SVM.3)
SPI Mode Fault InterruptIM1 (IMR.1)ESPII (SPICF.7)MODF (SPICN.3)
SPI Write Collision InterruptIM1 (IMR.1)ESPII (SPICF.7)WCOL (SPICN.4)
SPI Receive Overrun InterruptIM1 (IMR.1)ESPII (SPICF.7)ROVR (SPICN.5)
SPI Transfer Complete InterruptIM1 (IMR.1)ESPII (SPICF.7)SPIC (SPICN.6)
I2C START Condition InterruptIM3 (IMR.3)I2CSRI (I2CST.0)I2CSRIE (I2CIE.0)
I2C Transmit Complete InterruptIM3 (IMR.3)I2CTXI (I2CST.1)I2CTXIE (I2CIE.1)
I2C Receive Ready InterruptIM3 (IMR.3)I2CRXI (I2CST.2)I2CRXIE (I2CIE.2)
I2C Clock Stretch InterruptIM3 (IMR.3)I2CSTRI (I2CST.3)I2CSTRIE (I2CIE.3)
I2C Timeout InterruptIM3 (IMR.3)I2CTOI (I2CST.4)I2CTOIE (I2CIE.4)
I2C Slave Address Match InterruptIM3 (IMR.3)I2CAMI (I2CST.5)I2CAMIE (I2CIE.5)
I2C Arbitration Loss InterruptIM3 (IMR.3)I2CALI (I2CST.6)I2CALIE (I2CIE.6)
I2C NACK InterruptIM3 (IMR.3)I2CNACKI (I2CST.7)I2CNACKIE (I2CIE.7)
I2C General Call Address InterruptIM3 (IMR.3)I2CGCI (I2CST.8)I2CGCIE (I2CIE.8)
I2C Receiver Overrun InterruptIM3 (IMR.3)I2CROI (I2CST.9)I2CROIE (I2CIE.9)
I2C STOP Condition InterruptIM3 (IMR.3)I2CSPI (I2CST.11)I2CSPIE (I2CIE.11)
Serial Port 0 ReceiveIM3 (IMR.3)ESI (SMD0.2)RI (SCON0.0)
Serial Port 0 TransmitIM3 (IMR.3)ESI (SMD0.2)TI (SCON0.1)
Serial Port 1 ReceiveIM3 (IMR.3)ESI (SMD1.2)RI (SCON1.0)
Serial Port 1 TransmitIM3 (IMR.3)ESI (SMD1.2)TI (SCON1.1)
ADC Data Available InterruptIM4 (IMR.4)ADDAIE (ADCN.5)ADDAI (ADST.5)
Type B Timer 0—External TriggerIM4 (IMR.4)EXFB (TB0CN.6)ETB (TB0CN.1)
Type B Timer 0—OverflowIM4 (IMR.4)TFB (TB0CN.7)ETB (TB0CN.1)
Type B Timer 1—External TriggerIM4 (IMR.4)EXFB (TB1CN.6)ETB (TB1CN.1)
Type B Timer 1—OverflowIM4 (IMR.4)TFB (TB1CN.7)ETB (TB1CN.1)
Type B Timer 2—External TriggerIM4 (IMR.4)EXFB (TB2CN.6)ETB (TB2CN.1)
Type B Timer 2—OverflowIM4 (IMR.4)TFB (TB2CN.7)ETB (TB2CN.1)
2.8 Reset Conditions
There are four possible reset sources for the MAXQ2010. While in the reset state, the enabled system clock oscillator
continues running, but no code execution occurs. Once the reset condition has been removed or has completed, code
execution resumes at address 8000h for all reset types.
2-9
MAXQ Family User’s Guide:
MAXQ2010 Supplement
SUPPLY AT V
FREQUENCY-LOCKED LOOP
INTERNAL RESET
Figure 2-6. Power-On Reset Timing
DD
V
RST
T1
(T1 = STARTUP TIME FOR FLL)
T2
(T2 = 65,536 FLL CYCLES, OR 7.84ms AT 8.4MHz)
2.8.1 Power-On Reset
When power is first applied to the MAXQ2010, or when the supply voltage at VDD drops below the V
processor is held in a power-on reset state. See Figure 2-6. For the MAXQ2010 to exit power-on reset, the following
two conditions must apply:
• The supply voltage at VDD is above the power-on reset level V
RST.
• The FLL has completed 65,536 cycles (delay for power supply to stabilize).
level, the
RST
2.8.2 Watchdog Timer Reset
The watchdog timer on the MAXQ2010 functions as described in the MAXQ Family User’s Guide.
2.8.3 External Reset
External reset through the RST input is a synchronous reset source. After the external reset low has been removed and
sampled, execution resumes following a delay of four clock cycles, as shown in Figure 2-7.
2.9 Power-Management Features
The MAXQ2010 provides the following features to assist in power management:
• Divide-by-256 (PMM) mode to reduce current consumption.
• Switchback mode to exit PMM mode automatically when rapid processing is required.
• Ultra-low-power stop mode.
• Selective regulator and brownout detection disable during stop mode.
• Selectable noise immune mode or quiet mode for 32kHz oscillator operation.
Table 2-3 shows the system registers and bits used to control power-management features. For more information, see
the register descriptions in this document and in the MAXQ Family User’s Guide.
2-10
MAXQ Family User’s Guide:
MAXQ2010 Supplement
CLOCK
RST
RESET SAMPLING
INTERNAL RESET
Figure 2-7. External Reset Timing
FIRST
INSTRUCTION
FETCH
Table 2-3. System Power-Management Registers
REGISTERADDRESSBITFUNCTION
00: System clock = high-frequency clock divided by 1.
CKCNM8[0Eh][1:0]—CD[1:0]
CKCNM8[0Eh]2—PMME
CKCNM8[0Eh]3—SWB
CKCNM8[0Eh]4—STOPWhen set to 1, causes the processor to enter stop mode.
PWCNM0[0Fh]0—FLLENWhen set to 1, enables the FLL and causes it to lock to the 32kHz input.
PWCNM0[0Fh]1—FLOCK
PWCNM0[0Fh]2—X32DWhen set to 1, disables the 32kHz clock source.
PWCNM0[0Fh]3—X32KRDY
PWCNM0[0Fh]4—HFXD
PWCNM0[0Fh]5—X32KBYP
PWCNM0[0Fh]6—REGEN
PWCNM0[0Fh]7—BOD
01: System clock = high-frequency clock divided by 2.
10: System clock = high-frequency clock divided by 4.
11: System clock = high-frequency clock divided by 8.
0: System clock is determined by the settings of CD[1:0].
1: System clock = high-frequency clock divided by 256.
When set to 1, enables automatic switchback from PMM (divide-by-256
mode) to normal clock-divide mode under certain conditions.
0: FLL is disabled or warming up.
1: FLL is enabled and locked to the 32kHz input.
Read-only status bit; when 1, indicates that the 32kHz clock is ready for
use.
0: Enables the high-frequency oscillator.
1: Disables the high-frequency oscillator, allowing an external clock to be
provided at HFXIN.
0: Enables the internal 32kHz oscillator.
1: Disables the internal 32kHz oscillator, allowing an external clock to be
provided at 32KIN.
0: Internal regulator is shut down during stop mode.
1: Internal regulator remains powered on during stop mode.
0: Brownout detection remains enabled during stop mode.
1: Brownout detection is enabled during stop mode.
2-11
MAXQ Family User’s Guide:
MAXQ2010 Supplement
Table 2-3. System Power-Management Registers (continued)
REGISTERADDRESSBITFUNCTION
Selects operating mode of the 32kHz oscillator as follows.
00: Always operate in noise immune mode.
01: Always operate in quiet mode.
10: Operate in noise immune mode normally and in quiet mode during stop.
PWCNM0[0Fh][9:8]—X32KMD[1:0]
PWCNM0[0Fh]15—FREQMD
2.9.1 Divide-by-256 Mode (PMM)
In this power-management mode, all operations continue as normal, but at a reduced clock rate (the high-frequency
clock divided by 256). This power-management mode affects module clock rates as follows:
• Program execution occurs at the high-frequency clock rate divided by 256.
• The RTC module continues to operate using the 32kHz clock.
• The LCD module continues to operate using its originally selected clock, which is either the high-frequency clock
divided by 512 or the 32kHz clock, as selected by the LCCS bit (LCRA.6).
• All other functional modules (timers, USARTs, SPI) operate at the high-frequency clock rate divided by 256.
This power-management mode is entered by setting the PMME bit (CKCN.2) to 1. When PMM mode is exited (either
by clearing the PMME bit or as a result of a switchback trigger), system operation reverts to divide-by-1 mode.
Wait for 32kHz oscillator warmup upon stop mode exit. (Note: This setting
should not be used on devices of rev B3 or earlier; refer to the device
errata for more details.)
11: Operate in noise immune mode normally and in quiet mode during stop.
Skip 32kHz oscillator warmup upon stop mode exit.
This bit is used to adjust the operating mode of the MAXQ2010 to provide
optimal current consumption based on operating frequency. Typically,
when running at a frequency of 3MHz or higher, this bit should be set to
0 to optimize current consumption. When running at a frequency under
3MHz, this bit should typically be set to 1. Refer to the “VDD Supply Current
vs. Clock Frequency” graph in the IC data sheet for more details.
2.9.2 Switchback Mode
As described in the MAXQ Family User’s Guide, switchback mode is used to provide an automatic exit from powermanagement mode when a higher clock rate is required to respond to I/O, such as USART activity, SPI activity, or an
external interrupt.
Switchback mode is enabled when the SWB (CKCN.3) bit is set to 1 and the PMME (CKCN.2) bit is set to 1 (the system
is in the PMM mode). If switchback is enabled, the PMME bit is cleared (causing the system to exit power-management
mode) when any of the following conditions occur:
• An external interrupt condition occurs on an external interrupt pin and the corresponding external interrupt is enabled.
• An active-low transition occurs on the RXD0 or RXD1 pin, and the corresponding USART is enabled to receive data.
• The SBUF0 or SBUF1 register is written to transmit a byte over the corresponding USART.
• The SPIB register is written to transmit a byte with the SPI interface enabled in master mode.
• The SSEL signal is asserted low with the SPI interface enabled in slave mode.
• A START condition occurs on the I2C bus and the I2C start interrupt is triggered.
• The supply voltage drops below the supply voltage monitor (SVM) threshold, and the SVM interrupt is triggered.
• A time-of-day alarm is generated by the RTC module.
• A subsecond alarm is generated by the RTC module.
2-12
MAXQ Family User’s Guide:
MAXQ2010 Supplement
• An ADC conversion is initiated by setting ADCONV to 1.
• Active debug mode is entered either by a breakpoint match or direct issuance of the debug command from back-
ground mode.
As described in the MAXQ Family User’s Guide, if any of these conditions is true (a switchback source is active) and
the SWB bit has been set, the PMME bit cannot be set to enter power-management mode.
2.9.3 Stop Mode
Stop mode disables all circuits within the MAXQ2010 except for the 32kHz crystal amplifier and any circuitry that is
clocked directly by the 32kHz clock. All other on-chip clocks, timers, serial ports, and other peripherals are stopped,
and no code execution occurs. Once in stop mode, the MAXQ2010 is in a near-static state, with power consumption
determined largely by leakage currents.
The RTC always continues to run during stop mode if it was enabled upon stop mode entry. The LCD controller continues to run during stop mode if the following conditions are true:
• The 32kHz clock is selected as the LCD controller clock source (LCCS = 0).
• The LCD controller is in normal operation mode (OPM = 1).
• The LCD controller is enabled to operate during stop mode (SMO = 1).
Stop mode is invoked by setting the STOP bit to 1. The MAXQ2010 enters stop mode immediately when the STOP bit
is set. Entering stop mode does not affect the setting of the clock control bits; this allows the system to return to its
original operating frequency following stop mode removal.
The processor exits stop mode if any of the following conditions occur. In order to exit stop mode by means of an interrupt, the interrupt must be enabled globally, by module, and locally prior to entering stop mode.
• External reset (from the RST pin)
• Power-on/brownout reset
• External interrupt
• RTC time-of-day or subsecond alarm
• I2C start interrupt
• Supply voltage monitor interrupt (SVMSTOP must be set to 1)
Note that exiting stop mode through external reset or power-on reset causes the processor to undergo a normal reset
cycle, as opposed to resuming execution at the point at which it entered stop mode. Exiting stop mode by means of
an interrupt or RTC alarm causes the processor to vector to the interrupt handler routine at IV. Following the completion
of the interrupt handler, execution resumes at the instruction following the one that caused the entry into stop mode.
When the processor exits stop mode, program execution resumes after approximately four FLL oscillator cycles (refer
to the IC data sheet for timing details). The clock source following stop mode exit is selected as follows:
• If FLLSL = 1, the processor continues running from the FLL indefinitely.
• If FLLSL = 0, the processor continues running from the FLL until the high-frequency clock source completes its
65,536-cycle warmup count, at which point it switches over to the high-frequency clock automatically.
Note: The MAXQ2010 powers down parts of the memory interface during stop mode to conserve power. Because
of this, application code must always “re-prime” the active data pointer (DP[0], DP[1], or BP[OFFS]) following
any exit from stop mode before using that data pointer to read from memory. This can be accomplished by:
• Writing a new address (or rewriting the existing address) to the active data pointer.
• Writing to the DPC register to select a new data pointer (or reselect the active data pointer).
2-13
MAXQ Family User’s Guide:
MAXQ2010 Supplement
ADDENDUM TO SECTION 3: PROGRAMMING
Refer to Section 3: Programming of the MAXQ Family User’s Guide for examples of general program operations involv-
ing the MAXQ core. The MAXQ2010 contains the MAXQ20 (16-bit accumulator version) of the MAXQ core.
3-1
MAXQ Family User’s Guide:
MAXQ2010 Supplement
ADDENDUM TO SECTION 4: SYSTEM REGISTER DESCRIPTIONS
Refer to Section 4: System Register Descriptions of the MAXQ Family User’s Guide for functional descriptions of the
registers and bits in Table 4-1.
Note: Register names that appear in italics indicate read-only registers. Register names that appear in bold indicate 16-bit registers. All other registers are 8 bits in width.
Note: Bits marked as “s” have special behavior upon reset; see the register descriptions for details.
1514131211109876543210
BIT
BIT
4-2
MAXQ Family User’s Guide:
MAXQ2010 Supplement
4.1 System Register Descriptions
This section details the functionality of any system register contained in the MAXQ2010 that operates differently from its
description in the MAXQ Family User’s Guide. Addresses for all system and peripheral registers are given as “Mx[yy],”
where x is the module number (from 0 to 15 decimal) and yy is the register index (from 00h to 1Fh hexadecimal). Fields
in the bit definition tables are defined as follows:
• Name: Symbolic names of bits or bit fields in this register.
• Reset: The value of each bit in this register following a standard reset. If this field reads “unchanged,” the given bit
is unaffected by standard reset. If this field reads “s,” the given bit does not have a fixed 0 or 1 reset value because
its value is determined by another internal state or external condition.
• POR: If present this field defines the value of each bit in this register following a power-on reset (as opposed to a
standard reset). Some bits are unaffected by standard resets and are set/cleared by POR only.
• Access: Bits can be read-only (r) or read/write (rw). Any special restrictions or conditions that could apply when
reading or writing this bit are detailed in the bit description.
4.1.1 Processor Status Flags Register (PSF, M8[04h])
Bit #
NameZS—GPF1GPF0OVCE
Reset10000000
Accessrrrrwrwrwrwrw
76543210
This register operates as described in the MAXQ Family User’s Guide, with the exception that the overflow bit (OV)
can be written by software.
4.1.2 Interrupt Mask Register (IMR, M8[06h])
Bit #
NameIMS——IM4IM3IM2IM1IM0
Reset00000000
Accessrwrrrwrwrwrwrw
The first five bits in this register are interrupt mask bits for modules 0 to 4, one bit per module. The eighth bit, IMS,
serves as a mask for any system module interrupt sources. Setting a mask bit allows the enabled interrupt sources for
the associated module or system (with IMS) to generate interrupt requests. Clearing the mask bit effectively disables
all interrupt sources associated with that module or, in the case of IMS, all system interrupt sources. The IMR register
is intended to facilitate user-definable interrupt prioritization.
Bit 7: System Module Interrupt Mask (IMS)
Bits 5:6: Reserved
Bit 4: Module 4 Interrupt Mask (IM4)
Bit 3: Module 3 Interrupt Mask (IM3)
Bit 2: Module 2 Interrupt Mask (IM2)
Bit 1: Module 1 Interrupt Mask (IM1)
Bit 0: Module 0 Interrupt Mask (IM0)
76543210
4-3
4.1.3 System Control Register (SC, M8[08h])
MAXQ Family User’s Guide:
MAXQ2010 Supplement
Bit #
NameTAP——CDA0——PWL—
Reset100000Unchanged0
POR10000010
Accessrwrrrrrrwr
Bit 7: Test Access (Debug) Port Enable (TAP)
0 = Debug port functions are disabled, and P6.0 to P6.3 can be used as general-purpose I/O pins.
1 = Port pins P6.0 to P6.3 are enabled to act as debug port inputs and outputs.
Bits 6:5, 3:2, 0: Reserved
Bit 4: Code Data Access (CDA0). Setting this bit to 0 or 1 enables access to either the low or high page of program
memory in data space when accessing data in byte mode, as shown in Figure 2-3 and Figure 2-4. When accessing
data space in word mode, the setting of this bit has no effect.
Bit 1: Password Lock (PWL). This bit defaults to 1 on power-on reset only. When this bit is 1, it requires a 32-byte
password to be matched with the password in the program space (words 10h to 1Fh) before allowing access to the
ROM loader’s utilities for read/write of program memory and debug functions. Clearing this bit to 0 disables the password protection to the ROM loader.
Bit #
NameIIS——II4II3II2II1II0
Reset00000000
Accessrrrrrrrr
76543210
The first four bits in this register indicate interrupts pending in modules 0 to 4, one bit per module. The eighth bit, IIS,
indicates a pending system interrupt (from the watchdog timer or other system function). The interrupt pending flags
are set only for enabled interrupt sources waiting for service. The interrupt pending flag is cleared when the pending
interrupt source(s) within that module are disabled or when the interrupt flag(s) are cleared by software.
Bit 7: Interrupt Pending Flag for System Modules (IIS)
Bits 6:5: Reserved
Bit 4: Interrupt Pending Flag for Module 4 (II4)
Bit 3: Interrupt Pending Flag for Module 3 (II3)
Bit 2: Interrupt Pending Flag for Module 2 (II2)
Bit 1: Interrupt Pending Flag for Module 1 (II1)
Bit 0: Interrupt Pending Flag for Module 0 (II0)
4-4
Loading...
+ 117 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.