The MAXQ3100 microcontroller is a low-power, 16-bit
RISC device that incorporates an integrated liquid-crystal
display (LCD) interface that can drive up to 160 segments, two analog comparators with precision internal
1.25V reference voltage, and a real-time clock (RTC)
module with a dedicated battery-backup supply. An internal temperature sensor allows software to monitor device
temperature and optionally interrupt to alert when a temperature conversion is complete. The MAXQ3100 is
uniquely suited for single-phase electricity metering applications that require an external analog front-end, but can
be used in any application that requires high-performance operation. The device operates at a fixed
4.194MHz, generated from the 32.76kHz RTC crystal. The
device has 8kWords of EEPROM, 512 words of RAM,
three 16-bit timers, and two universal synchronous/asynchronous receiver/transmitters (USARTs). The microcontroller core and I/O are powered by a single 3.3V supply,
and an additional battery supply keeps the RTC running
during power outages.
Features
♦ High-Performance, Low-Power, 16-Bit RISC Core
4.194MHz Operation, Approaching 1MIPS
per MHz
3.3V Core and I/O
33 Instructions, Most Single-Cycle
Three Independent Data Pointers Accelerate
Data Movement with Automatic Increment/
Decrement
16-Level Hardware Stack
16-Bit Instruction Word, 16-Bit Data Bus
16 x 16-Bit, General-Purpose Working Registers
Optimized for C-Compiler (High-Speed/Density
Code)
♦ Program and Data Memory
8kWords EEPROM
200,000 EEPROM Write/Erase Cycles
512 Words of Internal Data RAM
JTAG-Compatible Debug Port Bootloader for
Programming
♦ Peripheral Features
Up to 27 General-Purpose I/O Pins, Most 5V
Tolerant
160-Segment LCD Driver
Up to 4 COM and 40 Segments
Static, 1/2, and 1/3 LCD Bias Supported
No External Resistors Required
Two Analog Comparators with Internal +1.25V
Precision Reference
Two Serial USARTs, One with Infrared PWM
Support
Digital Temperature Sensor
Three 16-Bit Programmable Timers/Counters
8-Bit, Subsecond, System Timer/Alarm
Battery-Backed, 32-Bit RTC with
Time-of-Day Alarm and Digital Trim
Programmable Watchdog Timer
♦ Flexible Programming Interface
Bootloader Simplifies Programming
In-System Programming Through Debug Port
Supports In-Application Programming of EEPROM
For pricing, delivery, and ordering information, please contact Maxim Direct at 1-888-629-4642,
or visit Maxim’s website at www.maxim-ic.com.
EVALUATION KIT
AVAILABLE
Typical Application Circuits and Pin Configuration appear
at end of data sheet.
Note: Some revisions of this device may incorporate deviations
from published specifications known as errata. Multiple revisions of any device may be simultaneously available through
various sales channels. For information about device errata, go
to:
www.maxim-ic.com/errata
.
MAXQ is a registered trademark of Maxim Integrated Products, Inc.
+
Denotes a Pb-free/RoHS-compliant device.
Ordering Information
Utility Meters
Battery-Powered and
Portable Devices
Electrochemical and
Optical Sensors
Industrial Control
Data-Acquisition
Systems and Data
Loggers
Home Appliances
Consumer Electronics
Thermostats/Humidity
Sensors
Security Sensors
Gas and Chemical
Sensors
HVAC
Smart Transmitters
Applications
PART TEMP RANGE PIN-PACKAGE
MAXQ3100-EMN+ -40°C to +85°C 80 MQFP
MAXQ3100
Mixed-Signal Microcontroller with Analog
Comparators, LCD, and RTC
Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. These are stress ratings only, and functional
operation of the device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. Exposure to
absolute maximum rating conditions for extended periods may affect device reliability.
Voltage Range on DVDDRelative to DGND ..........-0.5V to +6.0V
Voltage Range on Any Pin Relative to DGND
(3V Tolerant) .........................................-0.5V to (DV
DD
+ 0.5V)
Continuous Output Current
(Any Single I/O Pin)..........................................................25mA
General-Purpose, Digital, I/O, Type D Port; External Edge-Selectable Interrupt. These port
pins function as bidirectional I/O pins only. All port pins default to input mode with weak
pullups enabled after a reset. All port pins can be configured as external interrupt inputs. All
alternate function s must be enabled from software.
General-Purpose, Digital, I/O, Type C Port; LCD Segment-Driver Output. These port pins
function as bidirectional I/O pins and LCD segment-driver outputs. All alternate functions
must be enabled from software.
SPECIAL/ALTERNATE FUNCTION
PIN NAME
NAME FUNCTION
44 P2.0 SEG32 LCD Segment 32
45 P2.1 SEG33 LCD Segment 33
46 P2.2 SEG34 LCD Segment 34
47 P2.3 SEG35 LCD Segment 35
48 P2.4 SEG36 LCD Segment 36
49 P2.5 SEG37 LCD Segment 37
50 P2.6 SEG38 LCD Segment 38
44–51
P2.0–P2.7;
SEG32–SEG39
51 P2.7 SEG39 LCD Segment 39
54
V
LCD
LCD Bias-Control Voltage. Highest LCD drive voltage used in all bias modes. This pin
must be connected to an external supply when using the LCD display controller.
55
V
LCD1
LCD Bias, Voltage 1. Next highest LCD drive voltage, used in 1/2 and 1/3 LCD bias modes.
An internal resistor-divider sets the voltage at this pin. External resistor s and capacitors
can be used to change LCD voltage or drive capability at this pin. This pin must be shunted
externally to V
LCD Bias, Voltage 2. Third highest LCD drive voltage, used in 1/3 LCD bias mode only. An
internal resistor-divider sets the voltage at this pin. External resistor s and capacitors can be
used to change LCD voltage or drive capability at this pin. This pin must be shunted
externally to V
LCD1
when using 1/2 bias mode.
57
V
ADJ
LCD Adjustment Voltag e. Lowest LCD drive voltage, u sed in al l bias modes . Connect to
DGND through an external resistor to provide external control of the LCD contrast. Leave
disconnected for internal contrast adjustment.
General-Purpose, Digital, I/O, Type D Port; External Edge-Selectable Interrupt. These port
pins function as bidirectional I/O pins only. All port pins default to input mode with weak
pullups enabled after a reset. Port pins P1.0–P1.3 can be configured as external interrupt
inputs. Al l alternate funct ions must be enabled from software.
SPECIAL/ALTERNATE FUNCTION
PIN NAME
NAME FUNCTION
60 P1.0 INT8 T2B Timer 2 Secondary I/O
61 P1.1 INT9 T2A Timer 2 Primary I/O
62 P1.2 INT10 TXD1 Serial Port 1 Transmit
60–63
P1.0–P1.3;
INT8–INT11;
T2B, T2A, TXD1,
RXD1
63 P1.3 INT11 RXD1 Serial Port 1 Receive
General-Purpose, Digital, I/O, Type C Port; External Edge-Selectable Interrupt. These port
pins function as bidirectional I/O pins only. All port pins default to input mode with weak
pullups enabled after a reset. All alternate functions must be enab led from software, except
for the JTAG-compatible functions that are enabled by default fo llowing reset.
SPECIAL/ALTERNATE FUNCTION
PIN NAME
NAME FUNCTION
64 P3.0 TDI JT AG TAP Data Input
65 P3.1 TDO JTAG TAP Data Output
66 P3.2 TCK JT AG TAP Clock Input
67 P3.3 TMS JTAG TAP Mode-Select Input
68 P3.4 SQW RTC Square-Wave Output
69 P3.5 CMP0 Analog Comparator Input 0
64–70
P3.0–P3.6;
TDI, TDO, TCK,
TMS, SWQ,
CMP0, CMP1
70 P3.6 CMP1 Analog Comarator Input 1
71
RESET
Active-Low, Digital Reset Input/Output. The CPU i s held in reset when thi s pin is low and
begins executing from the reset vector when released. The pin must be pulled high by an
external 50k resistor. This pin is driven low as an output when an internal reset condition
occurs.
72
V
BAT
Digital Battery-Backup Supply. This supply provides an optional battery backup for the
RTC when DV
DD
power is removed. If this pin is connected to a nominal 3.3V battery then
the RTC will operate and battery-backed register contents will be preserved when DV
DD
is
removed. If battery backup is not required this pin should be connected directly to DV
DD
.
73 32KIN
74 32KOUT
32kHz Crystal Input/Output. Connect an external, 6pF 32kHz watch crystal between 32KIN
and 32KOUT to generate the system clock.
The following is an introduction to the primary features
of the microcontroller. More detailed descriptions of the
device features can be found in the data sheets, errata
sheets, and user’s guides described later in the
Additional Documentation
section.
MAXQ Core Architecture
The MAXQ3100 is a high-performance, CMOS, 16-bit
RISC microcontroller with EEPROM and an integrated
160-segment LCD controller. It is structured on a highly
advanced, accumulator-based, 16-bit RISC architecture. Fetch and execution operations are completed in
one cycle without pipelining, because the instruction
contains both the op code and data. The result is a
streamlined 4.194 million instructions-per-second
(MIPS) microcontroller.
The highly efficient core is supported by a 16-level
hardware stack, enabling fast subroutine calling and
task switching. Data can be quickly and efficiently
manipulated with three internal data pointers. Multiple
data pointers allow more than one function to access
data memory without having to save and restore data
pointers each time. The data pointers can automatically
increment or decrement following an operation, eliminating the need for software intervention. As a result,
the application speed is greatly increased.
Functional Diagram
ANALOG COMPARATOR
8kW EEPROM
(PROGRAM)
TIMER 0-TYPE
16-BIT TIMER/COUNTER
TIMER 1-TYPE
16-BIT TIMER/COUNTER
TIMER 2-TYPE
16-BIT TIMER/COUNTER
SERIAL USART
SERIAL USART WITH
INFRARED PWM
SUPPORT
DIGITAL TEMPERATURE
SENSOR
512W SRAM
(D ATA)
(16 x 16-BIT ACCUMULATORS)
WATCHDOG TIMER
POWER REDUCTION/
CLOCK GENERATION
POR
JTAG
TMS
TDI
TDO
TCK
2kW UTILITY ROM
+1.25V
REFERENCE
ANALOG COMPARATOR
3.3V
160-SEGMENT LCD
DRIVER
REAL-TIME CLOCK
EXTERNAL 32.768kHz
CRYSTAL
MAXQ20 RISC CORE
MAXQ3100
MAXQ3100
Mixed-Signal Microcontroller with Analog
Comparators, LCD, and RTC
The instruction set is composed of fixed-length, 16-bit
instructions that operate on registers and memory locations. The instruction set is highly orthogonal, allowing
arithmetic and logical operations to use any register
along with the accumulator. Special-function registers
control the peripherals and are subdivided into register
modules. The family architecture is modular, so that
new devices and modules can reuse code developed
for existing products.
The architecture is transport-triggered. This means that
writes or reads from certain register locations can also
cause side effects to occur. These side effects form the
basis for the higher-level op codes defined by the
assembler, such as ADDC, OR, JUMP, etc. The op
codes are actually implemented as MOVE instructions
between certain system register locations, while the
assembler handles the encoding, which need not be a
concern to the programmer.
The 16-bit instruction word is designed for efficient execution. Bit 15 indicates the format for the source field of
the instruction. Bits 0 to 7 of the instruction represent the
source for the transfer. Depending on the value of the
format field, this can either be an immediate value or a
source register. If this field represents a register, the
lower four bits contain the module specifier and the
upper four bits contain the register index in that module.
Bits 8 to 14 represent the destination for the transfer. This
value always represents a destination register, with the
lower four bits containing the module specifier and the
upper three bits containing the register subindex within
that module.
Anytime that it is necessary to directly select one of the
upper 24 index locations in a destination module, the
prefix register PFX is needed to supply the extra destination bits. This prefix register write is inserted automatically by the assembler and requires only one
additional execution cycle.
Memory Organization
The device incorporates several memory areas:
• 2kWords utility ROM
• 8kWords of EEPROM for program storage
• 512 words of SRAM for storage of temporary
variables
• 16-level, 16-bit-wide stack memory for storage of
program return addresses and general-purpose use
The memory is arranged by default in a Harvard architecture, with separate address spaces for program and
data memory. The configuration of program and data
space depends on the current execution location.
• When executing code from EEPROM memory, the
SRAM and utility ROM are accessible in data space.
• When executing code from SRAM, the EEPROM and
utility ROM are accessible in data space.
• When executing code from the utility ROM, the
EEPROM memory and SRAM are accessible in data
space.
Refer to the
MAXQ Family User’s Guide: MAXQ3100
Supplement
for more details.
In all cases, whichever memory segment is currently
being executed from cannot be accessed in data space.
To allow the use of lookup tables and similar constructs
in the memory, the utility ROM contains a set of lookup
and block copy routines (refer to the user’s guide supplement for more details).
The incorporation of EEPROM allows the device to be
reprogrammed, eliminating the expense of throwing
away one-time programmable devices during development and field upgrades. Program memory can be
password protected with a 16-word key, denying
access to program memory by unauthorized individuals.
Stack Memory
A 16-bit-wide internal stack provides storage for program return addresses and general-purpose use. The
stack is used automatically by the processor when the
CALL, RET, and RETI instructions are executed and
interrupts serviced. The stack can also be used explicitly to store and retrieve data by using the PUSH, POP,
and POPI instructions.
On reset, the stack pointer, SP, initializes to the top of
the stack (0Fh). The CALL, PUSH, and interrupt-vectoring operations increment SP, then store a value at the
stack location pointed to by SP. The RET, RETI, POP,
and POPI operations retrieve the value at the stack
location pointed to by SP, and then decrement SP.
Utility ROM
The utility ROM is a 2kWord block of internal ROM
memory that defaults to a starting address of 8000h.
The utility ROM consists of subroutines that can be
called from application software. These include:
• In-system programming (bootloader) over the JTAGcompatible debug port
• In-circuit debug routines
• User-callable routines for in-application flash programming and code space table lookup
Following any reset, execution begins in the utility
ROM. The ROM software determines whether the program execution should immediately jump to the start of
user-application code (located at address 0000h), or to
the bootloader. Routines within the utility ROM are useraccessible and can be called as subroutines by the
application software. More information on the utility
ROM contents is contained in the user’s guide supplement for this device.
Some applications require protection against unauthorized viewing of program code memory. For these
applications, access to in-system programming, inapplication programming, or in-circuit debugging functions is prohibited until a password has been supplied.
A single password-lock (PWL) bit is implemented in the
SC register. When the PWL is set to one (power-on
reset default), the password is required to access the
utility ROM, including in-circuit debug and in-system
programming routines that allow reading or writing of
internal memory. When PWL is cleared to zero, these
utilities are fully accessible without the password. The
password is automatically set to all ones following a
mass erase.
Programming
The microcontroller’s EEPROM can be programmed by
two different methods: in-system programming and inapplication programming. Both methods afford great flexibility in system design as well as reduce the life-cycle
cost of the embedded system. In-system programming
can be password protected to prevent unauthorized
access to code memory.
In-System Programming
An internal bootloader allows the device to be reloaded
over a simple JTAG-compatible debug port. As a result,
system software can be upgraded in-system, eliminating
the need for a costly hardware retrofit when software
updates are required. Remote software uploads are possible that enable physically inaccessible applications to
be frequently updated. The interface hardware can be a
JTAG connection to another microcontroller, or a connection to a PC serial port using a serial-to-JTAG converter such as the one included in the MAXQ3100
evaluation kit. If in-system programmability is not
required, a commercial gang programmer can be used
for mass programming.
Activating the debug port and loading the test access
port (TAP) with the system programming instruction
invokes the bootloader. Setting the SPE bit to 1 during
reset through the debug port executes the bootloadermode program that resides in the utility ROM. When programming is complete, the bootloader can clear the
SPE bit and reset the device, allowing the device to
bypass the utility ROM and begin execution of the application software.
The following bootloader functions are supported:
•Load
• Dump
• CRC
• Verify
• Erase
In-Application Programming
The in-application programming feature allows the
microcontroller to modify its own program memory from
its application software. This allows on-the-fly software
updates in mission-critical applications that cannot
afford downtime. Alternatively, it allows the application
to develop custom loader software that can operate
under the control of the application software. The utility
ROM contains user-accessible programming functions
that erase and program memory. These functions are
described in detail in the user’s guide supplement for
this device.
Register Set
Most functions of the device are controlled by sets of
registers. These registers provide a working space for
memory operations as well as configuring and addressing peripheral registers on the device. Registers are
divided into two major types: system registers and
peripheral registers. The common register set, also
known as the system registers, includes the ALU, accumulator registers, data pointers, interrupt vectors and
control, and stack pointer. The peripheral registers
define additional functionality that may be included by
different products based on the MAXQ architecture.
This functionality is broken up into discrete modules so
that only the features required for a given product need
to be included. Tables 1 and 4 show the MAXQ3100
register set.
The MAXQ3100 generates its internal system clock from
the external 32.768kHz crystal. This serves as the timebase for the RTC and is multiplied internally by a frequency-locked loop (FLL) to provide a system clock of
4.194MHz. Best performance is achieved when mated
with a 32.768kHz crystal rated for a 6pF load. No external load capacitors are required. The frequency accuracy of a crystal-based oscillator circuit is dependent upon
crystal accuracy, the match between the crystal and the
oscillator capacitor load, ambient temperature, etc.
A crystal warmup counter enhances operational reliability. Each time the external crystal oscillation must restart,
including a power-on reset, the device initiates a crystal
warmup period of approximately 2 seconds. This warmup
period allows time for the crystal amplitude and frequency to stabilize before using it as a clock source.
Power Management
Advanced power-management features minimize power
consumption by dynamically matching the processing
speed of the device to the required performance level.
This means device operation can be slowed and power
consumption minimized during periods of reduced
activity. When more processing power is required, the
microcontroller can increase its operating frequency.
Software-selectable clock-divide operations allow flexibility, selecting whether a system clock cycle (SYSCLK)
is 1, 2, 4, or 8 of the 4.194MHz oscillator cycles. By performing this function in software, a lower power state
can be entered without the cost of additional hardware.
For extremely power-sensitive applications, two additional low-power modes are available.
In PMM1, one system clock is 256 oscillator cycles, significantly reducing power consumption while the microcontroller functions at reduced speed. The optional
switchback feature allows enabled interrupt sources,
such as the external interrupts, to cause the processor to
quickly exit PMM1 mode and return to a faster internal
clock rate.
Power consumption reaches its minimum in stop mode.
In this mode, the system clock and all code execution
is halted. Upon receiving one of the following enabled
events, the device executes a 250ms warmup delay
and then begins normal operation from the point in the
code following the setting of the STOP bit:
• An enabled external interrupt pin is triggered.
• An enabled comparator interrupt is triggered.
• An external reset signal is applied to the RESET pin.
• The RTC time-of-day or subsecond alarms are
activated.
The following peripherals can be enabled during stop
mode:
• Analog comparators
• RTC
• LCD controller
Interrupts
Multiple interrupt sources are available for quick
response to internal and external events. The MAXQ
architecture uses a single interrupt vector (IV), single
interrupt-service routine (ISR) design. For maximum
flexibility, interrupts can be enabled globally, individually, or by module. When an interrupt condition occurs,
its individual 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 interrupt 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 program 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 interrogated 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 11
• Analog Comparator 0 and 1 Interrupts
• Temperature Sensor Interrupt
• 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
Several reset sources are provided for microcontroller
control. Although code execution is halted in the reset
state, the high-frequency oscillator continues to oscillate.
Power-On Reset/Brownout Reset
An internal power-on reset circuit enhances system reliability. This circuit forces the device to perform a
power-on reset whenever a rising voltage on DV
DD
climbs above approximately V
RST
. Additionally, the
device performs a brownout reset whenever DV
DD
drops below V
RST
, a feature that can be optionally disabled in stop mode. The following events occur during
a power-on reset:
• All registers and circuits enter their power-on reset
state.
• I/O pins revert to their reset state, with logic one
states tracking DVDD.
• The power-on reset flag is set to indicate the source
of the reset.
• Code execution begins at location 8000h following a
2-second 32.768kHz warmup.
Watchdog Timer Reset
The watchdog timer functions are described in the
MAXQ Family User’s Guide
. Software can determine if
a reset was caused by a watchdog timeout by checking the watchdog timer reset flag (WTRF) in the WDCN
register. Execution resumes at location 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 functions as described in the
MAXQ Family User’s Guide
.
Execution resumes at location 8000h after the RESET
pin is released.
MAXQ3100
Mixed-Signal Microcontroller with Analog
Comparators, LCD, and RTC
The microcontroller uses the Type C and Type D bidirectional I/O ports described in the
MAXQ Family
User’s Guide
. The use of two port types allows for maximum flexibility when interfacing to external peripherals.
Each port has 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 dedicated peripheral registers. Using the alternate function
automatically converts the pin to that function.
Type C port pins have Schmitt Trigger receivers and
full CMOS output drivers, and can support alternate
functions. The pin is either tri-stated or a weak pullup
when defined as an input, dependent on the state of
the corresponding bit in the output register.
Type D port pins have Schmitt Trigger receivers and
full CMOS output drivers, and can support alternate
functions. The pin is either tri-stated or a weak pullup
when defined as an input, dependent on the state of
the corresponding bit in the output register. All Type D
pins also have interrupt capability.
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 independent 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 approximately 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.
Higher accuracy can be obtained by using the useraccessible digital RTC trim function. This feature allows
the designer to fine tune the RTC timing to compensate
for crystal inaccuracies and any unintended boardlevel effects that could cause crystal-frequency drift.
The user can enable a 1Hz or 512Hz square-wave output on P3.4. Frequency measurements of these signals
can show if there is any deviation from the expected
frequency, and writes to the RTC trim register can compensate in increments of 1 to 127 steps, with each step
approximately 3.05ppm (30.5µs).
If the V
BAT
pin is not directly tied to the DVDDpin, then
there may be a short increase in IDDwhile the device is
switching between V
BAT
and DVDDas the RTC power
source. IDDcan temporarily increase up to 300µA while
DVDDis rising and in the range 1.05 x V
BAT
< DVDD<
[(1.05 x V
BAT
) + 200mV]. A similar effect may be
observed while V
BAT
is falling and in the range [(0.95 x
DVDD) - 200mV] < V
BAT
< 0.95 x DVDD.
Programmable Timers
The MAXQ3100 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 external events. Timer 2 supports optional single-shot, external 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 freerunning counter designed to be periodically reset by
the application software. If software is operating correctly, the counter is periodically reset and never
reaches its maximum count. However, if software operation is interrupted, the timer does not reset, triggering
a system reset and optionally a watchdog timer interrupt. 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 212to 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 4.194MHz, watchdog timeout periods
can be programmed from 976µs to 128s, depending on
the system clock mode.
MAXQ3100
Mixed-Signal Microcontroller with Analog
Comparators, LCD, and RTC
Embedded debugging capability is available through
the debug port TAP. Embedded debug hardware and
embedded ROM firmware provide in-circuit debugging
capability to the user application, eliminating the need
for an expensive in-circuit emulator. Figure 4 shows a
block diagram of the in-circuit debugger. The in-circuit
debug features include:
• Hardware debug engine
• Set of registers able to set breakpoints on register,
code, or data accesses
• Set of debug service routines stored in the utility
ROM
The embedded hardware debug engine is an independent hardware block in the microcontroller. The debug
engine can monitor internal activities and interact with
selected internal registers while the CPU is executing
user code. Collectively, the hardware and software features allow two basic modes of in-circuit debugging:
• Background mode allows the host to configure and set
up the in-circuit debugger while the CPU continues to
execute the application software at full speed. Debug
mode can be invoked from background mode.
• Debug mode allows the debug engine to take control
of the CPU, providing read/write access to internal registers and memory, and single-step trace operation.
Serial Peripherals
The MAXQ3100 incorporates two 8051-style universal
synchronous/asynchronous receiver/transmitters. The
USARTs allow the device to conveniently communicate
with other RS-232 interface-enabled devices, as well as
PCs and serial modems when paired with an external
RS-232 line driver/receiver. The dual independent
USARTs can communicate simultaneously at different
baud rates with two separate peripherals. The USART
can detect framing errors and indicate the condition
through a user-accessible software bit.
The time base of the serial ports is derived from either a
division of the system clock or the dedicated baud
clock generator. The following table summarizes the
operating characteristics as well as the maximum baud
rate of each mode.
Serial port 0 contains additional functionality to support
low-speed infrared transmission in combination with the
PWM function of timer 2. When enabled in this mode,
the serial port automatically outputs a waveform generated by combining the normal serial port output waveform with the PWM carrier waveform output by timer 2,
using a logical OR or logical NOR function. The output
of serial port 0 in this mode can be used to drive an
infrared LED to communicate using a fixed-frequency
carrier modulated signal. Depending on the drive
strength required, the output may require a buffer when
used for this purpose.
Figure 4. In-Circuit Debugger
MAXQ3100
TMS
TCK
TDI
TDO
TAP
CONTROLLER
DEBUG
SERVICE
ROUTINES
(UTILITY ROM)
DEBUG
ENGINE
CONTROL
BREAKPOINT
ADDRESS
CPU
DATA
MODETYPESTART BITSDATA BITSSTOP BITMAX BAUD RATE AT 4.194MHz
The MAXQ3100 incorporates a pair of 1-bit analog-todigital comparators. The comparator inputs can be
connected to a wide range of peripherals, including
chemical, motion, or proximity detectors; voltage-supply monitoring; or any other appropriate analog input.
The comparator measures the analog inputs against
the internal +1.25V reference. The polarity of the internal comparator-output signal can be selected to indicate a value above or below the internal reference. The
comparators can be configured to generate an optional
interrupt in addition to setting an internal flag when the
input is out of range. A combination of the two comparators along with appropriate biasing of an input
allows the two comparators to be used as a window
comparator. When not in use, the pins associated with
the comparator are usable as general-purpose I/O. A
useful feature of the comparators is that they can be
used to wake the device from stop mode, allowing the
device to monitor external voltages while in an ultralow-power mode and only wake when necessary.
Temperature Sensor
The internal temperature sensor has a user-selectable
resolution of 10 (0.5°C), 11 (0.25°C), 12 (0.125°C), or
13 (0.0625°C) bits. Higher resolutions require longer
conversion times.
Setting the START bit initiates the temperature conversion, and the temperature sensor hardware clears the
bit when the conversion is complete. This bit can be
polled by software, or, optionally, the temperature conversion complete interrupt can be used to alert the system that the results are ready to be read from the
temperature results register (TEMPR).
Applications Information
Grounds and Bypassing
Careful PC-board layout significantly minimizes
crosstalk among the comparator inputs and other digital
signals. Keep digital and analog lines separate, and use
ground traces as shields between them where possible.
Bypass DV
DD
with a capacitor as low as 1µF and keep
bypass capacitor leads short for best noise rejection.
This device incorporates both analog and digital components, straddling both the analog and digital ground
planes. For increased accuracy, an LC filter can be
used to isolate pin 59. This pin powers the analog circuitry, and the additional filtering reduces the noise
entering the analog block.
Device Applications
The low-power, high-performance RISC architecture of
the MAXQ3100 makes it an excellent fit for many applications that require analog measurements combined
with the intelligence of a full-featured microcontroller.
Simple voltage-dividers can be used to scale any input
into a value in the range of the +1.25V reference. The
dual comparators allow the device to function as a simple limit comparator or window comparator in a wide
range of analog applications.
Figure 5. Analog Comparator Functional Diagram
CMON
INTERNAL
1.25V
REFERENCE
CMPOL
CMPx
CMM
SET
CMO
CMF
Q
CMM
INTERRUPT
REQUEST
MAXQ3100
Mixed-Signal Microcontroller with Analog
Comparators, LCD, and RTC
Designers must have four documents to fully use all the
features of this device. This data sheet contains pin
descriptions, feature overviews, and electrical specifications. Errata sheets contain deviations from published specifications. The user’s guides offer detailed
information about programming, device features, and
operation. The following documents can be downloaded from www.maxim-ic.com/microcontrollers.
• The MAXQ3100 data sheet, which contains electrical/timing specifications and pin descriptions, available at www.maxim-ic.com/MAXQ3100
.
• The MAXQ3100 errata sheet, available at
www.maxim-ic.com/errata.
• The
MAXQ Family User’s Guide
, which contains
detailed information on core features and operation,
including programming, avaliable at www.maximic.com/MAXQUG.
• The
MAXQ Family User’s Guide: MAXQ3100
Supplement
, which contains detailed information on
features specific to the MAXQ3100, available at
www.maxim-ic.com/MAXQ3100UG.
Development and Technical Support
A variety of highly versatile, affordably priced development tools for this microcontroller are available from
Maxim/Dallas Semiconductor and third-party suppliers,
including:
• Compilers
• In-circuit emulators
• Integrated development environments (IDEs)
• JTAG-to-serial converters for programming and
debugging
A partial list of development tool vendors can be found
on our website at www.maxim-ic.com/microcontrollers
.
Technical support is available through email at
maxq.support@dalsemi.com.
shows a general-purpose
implementation using a MAXQ3100 that reads two sensor inputs, displays result and status information on an
LCD display, and also interfaces simultaneously with
an RS-232 and RS-485 networks. I/O pins that are not
dedicated to special functions are available to control
other system functions.
3.3V
DIRECT INPUT
FROM USER-
DEFINED SENSOR
SCALED
COMPARATOR
INPUT
R
1
R
2
DV
CMP0
CMP1
BACKUP BATTERY
VBAT
DD
V
REF
MAXQ3100
TXD0
RXD0
TXD1
RXD1
Px.x
SEG[39:0]
COM[3:0]
RS-232
Tx/Rx
RS-485
Tx/Rx
RTS
LCD MODULE
NOTE THAT UP TO 160 LCD SEGMENTS
CAN BE DRIVEN IF OTHER MUXED PIN
FUNCTIONS ARE NOT USED.
2
C FRAM
I
OR EEPROM
JTAG DOWNLOAD/
DEBUG
CONNECTOR
P2.3
P2.2
TDO
TDI
TCK
TMS
32KIN
32KOUT
GENERAL-
PURPOSE I/O
INT7
INT6
BUTTON 1
BUTTON 2
MAXQ3100
Mixed-Signal Microcontroller with Analog
Comparators, LCD, and RTC
Another target application of the MAXQ3100 is in the
electricity metering market. When coupled with an analog front-end, the microcontroller becomes the core of
an affordable electricity metering solution. Such an
application can accurately keep time, incorporate a
versatile display, and allow for multiple modes of communication. See
Typical Application Circuit #2
.
UNREGULATED
SUPPLY
ENERGY
METERING IC
CALIBRATION
EQUIPMENT
REGULATOR
3.3V
BACKUP BATTERY
ISOLATION
DV
CMP0
V
BAT
CMP1
T0
SQW
DD
MAXQ3100
V
REF
IR Tx/Rx
CIRCUIT
TXD0
RXD0
TXD1
RXD1
RS-232
Tx/Rx
IR Rx
MODULE
2
C FRAM
I
OR EEPROM
JTAG DOWNLOAD/
DEBUG
CONNECTOR
P2.3
P2.2
TDO
TDI
TCK
TMS
32KIN
32KOUT
SEG[39:0]
COM[3:0]
INT7
INT6
LCD MODULE
NOTE THAT UP TO 160 LCD SEGMENTS
CAN BE DRIVEN IF OTHER MUXED PIN
FUNCTIONS ARE NOT USED.
Mixed-Signal Microcontroller with Analog
Comparators, LCD, and RTC
Maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim product. No circuit patent licenses are
implied. Maxim reserves the right to change the circuitry and specifications without notice at any time.
30
____________________Maxim Integrated Products, 120 San Gabriel Drive, Sunnyvale, CA 94086 408-737-7600
(The package drawing(s) in this data sheet may not reflect the most current specifications. For the latest package outline information,
go to www.maxim-ic.com/DallasPackInfo
)
.
Revision History
Rev 0; 6/07:Original release.
Loading...
+ 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.