The MAXQ7670 is a highly integrated solution for measuring multiple analog signals and outputting the results
on a control area network (CAN) bus. The device operates from a single 5V supply and incorporates a highperformance, 16-bit reduced instruction set computing
(RISC) core, a SAR ADC, and a CAN 2.0B controller,
supporting transfer rates up to 1Mbps. The 10-bit SAR
ADC includes an amplifier with programmable gains of
1V/V or 16V/V, 8 input channels, and conversion rates up
to 250ksps. The eight single-ended ADC inputs can be
configured as four unipolar or bipolar, fully differential
inputs. For single-supply operation, the external 5V supply powers the digital I/Os and two separate integrated
linear regulators that supply the 2.5V digital core and the
3.3V analog circuitry. Each supply rail has a dedicated
power-supply supervisor that provides brownout detection and power-on reset (POR) functions. The 16-bit RISC
microcontroller (µC) includes 64KB (32K x 16) of nonvolatile program/data flash and 2KB (1K x 16) of data
RAM. Other features of the MAXQ7670 include a 4-wire
SPI™ interface, a JTAG interface for in-system programming and debugging, an integrated 15MHz RC oscillator, external crystal oscillator support, a timer/counter
with pulse-width modulation (PWM) capability, and seven
GPIO pins with interrupt and wake-up capability.
The system-on-a-chip (SoC) MAXQ7670 is a µC-based,
smart data acquisition system. As a member of the
MAXQ®family of 16-bit, RISC µCs, the MAXQ7670 is
ideal for low-cost, low-power, embedded-applications
such as automotive, industrial controls, and building
automation. The flexible, modular architecture used in
the MAXQ µCs allows development of targeted products for specific applications with minimal effort.
The MAXQ7670 is available in a 40-pin, 5mm x 5mm
TQFN package, and is specified to operate over the -40°C
to +125°C automotive temperature range.
Applications
Automotive Steering Angle and Torque Sensors
CAN-Based Automotive Sensor Applications
Industrial Control
Building Automation
Features
♦ High-Performance, Low-Power, 16-Bit RISC Core
0.166MHz to 16MHz Operation, Approaching
1MIPs/MHz
Low Power (< 1mA/MIPS, V
DVDD
= +2.5V)
16-Bit Instruction Word, 16-Bit Data Bus
33 Instructions, Most Require Only One Clock
Cycle
16-Level Hardware Stack
16 x 16-Bit, General-Purpose Working Registers
Three Independent Data Pointers with AutoIncrement/Decrement
Low-Power, Divide-by-256, Power-Management
Modes (PMM) and Stop Mode
♦ Program and Data Memory
64KB Internal Nonvolatile Program/Data Flash
2KB Internal Data RAM
♦ SAR ADC
8 Single-Ended/4 Differential Channels,
10-Bit Resolution with No Missing Codes
PGA Gain = 1V/V or 16V/V
250ksps (150.9ksps with PGA Gain = 16V/V)
♦ Timer/Digital I/O Peripherals
CAN 2.0B Controller (15 Message Centers)
Serial Peripheral Interface (SPI)
JTAG Interface (Extensive Debug and Emulation
Support)
Single 16-Bit/Dual 8-Bit Timer/PWM
Seven General-Purpose, Digital I/O Pins with
External Interrupt/Wake-Up Features
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.
Typical Application Circuit and Pin Configuration appear at
end of data sheet.
SPI is a trademark of Motorola, Inc.
MAXQ is a registered trademark of Maxim Integrated Products, Inc.
Ordering Information
PARTTEMP RANGEPIN-PACKAGE
MAXQ7670ATL+
40 TQFN-EP*
+
Denotes a lead-free/RoHS-compliant package.
*
EP = Exposed pad.
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:
http://www.maxim-ic.com/errata
.
-40°C to +125°C
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
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.
DVDD to DGND ........................................................-0.3V to +3V
DVDDIO to GNDIO ................................................-0.3V to +5.5V
AVDD to AGND ........................................................-0.3V to +4V
DGND to GNDIO. ..................................................-0.3V to +0.3V
GNDIO to AGND. ..................................................-0.3V to +0.3V
AGND to DGND.....................................................-0.3V to +0.3V
Analog Inputs to AGND..........................-0.3V to (V
AVDD
+ 0.3V)
RESET, Digital Inputs/Outputs to
GNDIO ............................................-0.3V to (V
DVDDIO
+ 0.3V)
XIN, XOUT to DGND ..............................-0.3V to (V
Note 1: All devices are 100% production tested at TA= +25°C and +125°C. Temperature limits to TA= -40°C are guaranteed by
design.
Note 2: All analog functions disabled and all digital inputs connected to supply or ground.
Note 3: High-speed/8 mode without CAN; V
DVDD
= +2.5V, CPU and 16-bit timer running at 2MHz from an external, 16MHz crystal
oscillator; all other peripherals disabled; all digital I/Os static at V
DVDDIO
or GNDIO; TA= T
MIN
to T
MAX
.
Note 4: High-speed/1 mode with CAN; V
DVDD
= +2.5V, CPU and 16-bit timer running at 16MHz from an external, 16MHz crystal
oscillator; CAN enabled and communicating at 500kbps; all other peripherals disabled, all digital I/Os (except CANTXD
and CANRXD) static at V
DVDDIO
or GNDIO, TA= T
MIN
to T
MAX
.
Note 5: Low speed, PMM1 mode without CAN; V
DVDD
= +2.5V, CPU and one timer running from an external, 16MHz crystal oscilla-
tor in PMM1 mode; all other peripherals disabled; all digital I/Os static at V
DVDDIO
or GNDIO, TA= T
MIN
to T
MAX
.
Note 6: CAN transmitting at 500kbps; 16-bit timer output switching at 500kHz; all active I/Os are loaded with a 20pF capacitor; all
remaining digital I/Os are static at V
DVDDIO
or GNDIO, TA= T
MIN
to T
MAX
.
Note 7: Guaranteed by design and characterization.
Note 8: This is not a static capacitance. It is the capacitance presented to the analog input when the T/H amplifier is in sample mode.
Note 9: The switched capacitor on the REFADC input can disturb the reference voltage. To reduce this disturbance, place a 0.1µF
capacitor from REFADC to AGND as close as possible to REFADC.
Note 10: The digital design is fully static. However, the lower clock limit is set by a clock detect circuit. The MAXQ7670 switches to
the internal RC clock if the external input goes below 166kHz. This clock detect circuit also acts to detect a crystal failure
when a crystal is used.
5REFADC ADC External Reference Input. Connect an external reference between 1V and V
6AGNDAnalog Ground
7AIN3
8AIN2
9AIN1
10AIN0
11I.C.Internally Connected. Connect to GNDIO for proper operation.
12P0.0Port 0 Bit 0. P0.0 is a general-purpose digital I/O with interrupt/wake-up capability.
13P0.1Port 0 Bit 1. P0.1 is a general-purpose digital I/O with interrupt/wake-up capability.
14P0.2Port 0 Bit 2. P0.2 is a general-purpose digital I/O with interrupt/wake-up capability.
15, 22, 38GNDIODigital I/O Ground and Regulator Ground
16CANRXD CAN Bus Receiver Input. CAN receiver input.
17CANTXDCAN Bus Transmitter Output. CAN transmitter output.
18SS
Analog Input Channel 7. AIN7 is multiplexed to the PGA or ADC as single-ended analog input 7 or as a
differential input with AIN6. As a differential input, the polarity of AIN7 is negative.
Analog Input Channel 6. AIN6 is multiplexed to the PGA or ADC as a single-ended analog input 6 or as a
differential input with AIN7. As a differential input, the polarity of AIN6 is positive.
Analog Input Channel 5. AIN5 is multiplexed to the PGA or ADC as single-ended analog input 5 or as a
differential input with AIN4. As a differential input, the polarity of AIN5 is negative.
Analog Input Channel 4. AIN4 is multiplexed to the PGA or ADC as single-ended analog input 4 or as a
differential input with AIN5. As a differential input, the polarity of AIN4 is positive.
Analog Input Channel 3. AIN3 is multiplexed to the PGA or ADC as single-ended analog input 3 or as a
differential input with AIN2. As a differential input, the polarity of AIN3 is negative.
Analog Input Channel 2. AIN2 is multiplexed to the PGA or ADC as single-ended analog input 2 or as a
differential input with AIN3. As a differential input, the polarity of AIN2 is positive.
Analog Input Channel 1. AIN1 is multiplexed to the PGA or ADC as single-ended analog input 1 or as a
differential input with AIN0. As a differential input, the polarity of AIN1 is negative.
Analog Input Channel 0. AIN0 is multiplexed to the PGA or ADC as single-ended analog input 0 or as a
differential input with AIN1. As a differential input, the polarity of AIN0 is positive.
Active-Low, SPI Port Slave Select Input. In SPI slave mode, this is the slave select input. In SPI master
mode, this is an input and connection is optional (connect if mode fault enable is required, refer to the
MAXQ7670 User’s Guide for a description of the SPICN register). In master mode, use an available GPIO
as a slave selector and pull SS high to DVDDIO through a pullup resistor.
.
AVDD
Port 0 Bit 6/Timer 0 I/O. P0.6 is a general-purpose digital I/O with interrupt/wake-up input capability. T0 is a
19P0.6/T0
20P0.7/T0B
21, 39DVDDIO
primary timer/PWM input or output. The alternative function, T0, is selected using the T2CNA0 register.
When this function is selected, it overrides the GPIO functionality.
Port 0 Bit 7/Timer 0 Output. P0.7 is a general-purpose digital I/O with interrupt/wake-up input capability.
T0B is a secondary timer/PWM output. The alternative function, T0B, is selected using the T2CNB0 register.
When this function is selected, it overrides the GPIO functionality.
Digital I/O Supply Voltage and Regulator Supply Input. DVDDIO supplies all digital I/O except for XIN and
XOUT, and supplies power to the two internal linear regulators, AVDD and DVDD. Bypass DVDDIO to
GNDIO with a 0.1µF capacitor as close as possible to the device.
27TDOJTAG Serial Test Data Output. TDO is the JTAG serial test, data output.
28TMSJTAG Test Mode Select. TMS is the JTAG test mode, select input.
29TDIJTAG Serial Test Data Input. TDI is the JTAG serial test, data input.
30TCKJTAG Serial Test Clock Input. TCK is the JTAG serial test, clock input.
31
32P0.5Port 0 Bit 5. P0.5 is a general-purpose digital I/O with interrupt/wake-up capability.
33RESET
34DGNDDigital Ground
35XOUT
P0.4/
ADCCNV
SPI Serial Clock. SCLK is the SPI interface serial clock I/O. In SPI master mode, SCLK is an output. While in
SPI slave mode, SCLK is an input.
SPI Serial Data I/O. MOSI is the SPI interface serial data output in master mode or serial data input in slave
mode.
SPI Serial Data I/O. MISO is the SPI interface serial data input in master mode or serial data output in slave
mode.
Active-Low +2.5V Linear Regulator Enable Input. Connect REGEN2 to GNDIO to enable the +2.5V linear
regulator. Connect to DVDDIO to disable the +2.5V linear regulator.
Port 0 Bit 4/ADC Start Conversion Control. P0.4 is a general-purpose digital I/O with interrupt/wake-up
capability. ADCCNV is a firmware-configurable, rising or falling edge, start/convert signal used to trigger
ADC conversions. The alternative function, ADCCNV, is selected using the register bits ACNT[2:0]. When
using ADCCNV as a trigger for ADC conversion, set P0.4/ADCCNV as an input using the PD0 register. This
action prevents any unintentional interference in the SARADC operation.
Reset Input/Output. Active-low input/output with internal 55kΩ pullup to DVDDIO. Drive low to reset the
MAXQ7670. The MAXQ20 µC core holds RESET low during POR and during DVDD brownout conditions.
High-Frequency Crystal Output. Connect an external crystal to XIN and XOUT for normal operation, or leave
unconnected if XIN is driven with an external clock source. Leave unconnected if an external clock source
is not used.
36XIN
37DVDD
40AVDD
—EPExposed Pad. Connect EP to the ground plane.
H i g h- Fr eq uency C r ystal Inp ut. C onnect an exter nal cr ystal or r esonator to X IN and X OU T for nor m al op er ati on,
or d r i ve X IN w i th an exter nal cl ock sour ce. Leave unconnected i f an exter nal cl ock sour ce i s not used .
D i g i tal S up p l y V ol tag e. D V D D sup p l i es i nter nal d i g i tal cor e and fl ash m em or y. D V D D i s d i r ectl y connected to
the outp ut of the i nter nal + 2.5V l i near r eg ul ator . D i sab l e the i nter nal r eg ul ator ( thr oug h REG EN 2) to connect an
exter nal sup p l y. Byp ass D V D D to D GN D w i th a 0.1µF cap aci tor as cl ose as p ossi b
Analog Supply Voltage. AVDD supplies PGA and ADC. AVDD is directly connected to the output of the
internal +3.3V linear regulator. Disable the internal regulator (via software) to connect an external supply.
Bypass AVDD to AGND with a 0.1µF capacitor as close as possible to the device.
l e to the d evi ce.
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
The MAXQ7670 incorporates a 16-bit RISC arithmetic
logic unit (ALU) with a Harvard memory architecture
that addresses 64KB (32K x 16) of flash and 2048
bytes (1024 x 16) of RAM memory. This core combined
with digital and analog peripherals provide versatile
data-acquisition functions. The peripherals include up to
seven digital I/Os, a 4-wire SPI interface, a CAN 2.0B
bus, a JTAG interface, a timer, an integrated RC oscillator, two linear regulators, a watchdog timer, three
power-supply supervisors, a 10-bit 250ksps SAR ADC
with programmable-gain amplifier (PGA) and eight single-ended or four differential multiplexed inputs. The
power-efficient MAXQ20 µC core consumes less than
1mA/MIPS. Refer to the
MAXQ7670 User’s Guide
for
more detailed information on configuring and programming the MAXQ7670.
Analog Input Peripheral
The integrated 10-bit ADC employs an ultra-low-power
SAR-based conversion method and operates up to
250ksps with PGA = 1V/V (150.9ksps with PGA =
16V/V). The integrated 8-channel multiplexer (mux) and
PGA allow the ADC to measure eight single-ended (relative to AGND) or four fully differential analog inputs
with software-selectable input ranges through the PGA.
See Figures 3 and 4.
Figure 3. Simplified Analog Input Diagram (Eight Single-Ended Inputs)
MAXQ7670
P0.4/ADCCNV
AIN0
AIN1
AIN2
AIN3
AIN4
AIN5
AIN6
AIN7
8:1
MUX
1V/V OR
16V/V
TIMER 0
ADCBY
ACTL
120
ADCDUL
ADCBIP
ADCRDY
DATA
BUS
PGA
PGG
CONVERSION
CONTROL
10-BIT ADC
250ksps
10
AGND
ADCMX
1 032
REFADC
ADCE
ADC
CLOCK
DIV
1 0
ADCCD
ADCASD
ADCCLK
SOURCE
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
The MAXQ7670 ADC uses a fully differential SAR conversion technique and an integrated T/H (track and
hold) block to convert voltage signals into a 10-bit digital result. Both single-ended and differential configurations are implemented using an analog input channel
multiplexer that supports 8 single-ended or 4 differential channels.
In single-ended mode, the mux selects from either of
the ground-referenced analog inputs AIN0–AIN7. In differential input configuration, analog inputs are selected
from the following pairs: AIN0/AIN1, AIN2/AIN3,
AIN4/AIN5, and AIN6/AIN7. Table 1 shows the singleended and differential input configurations possible for
the ADC mux.
Analog Input Track and Hold
A SAR conversion in the MAXQ7670 has different T/H
cycles depending on whether a gain of 1 (bypass) or a
gain of 16 (PGA enabled) is selected.
Gain = 1V/V
In gain = 1V/V, the conversion has a two-stage T/H
cycle. In track mode, a positive input capacitor connects to the signal channel. A negative input capacitor
connects to the reference channel. After the T/H enters
hold mode, the difference between the signal and the
reference channel is converted to a 10-bit value. This
two-stage cycle takes 16 SARCLKs to complete.
Gain = 16V/V
In gain = 16V/V, the conversion has a three-stage T/H
cycle: amplification, ADC track, and ADC hold. First,
the PGA tracks the selected input and reference signals. The PGA amplifies the difference between the two
signals and holds the result for the next stage, ADC
track. The ADC tracks and converts the PGA result into
a 10-bit value. The SAR operation itself does not
change irrespective of the chosen gain. This threestage cycle takes 26.5 SARCLKs to complete. Figure 5
shows the conversion timing differences between gain
= 1V/V and gain = 16V/V.
Table 1. ADC Mux Input Configurations
SAR CHANNEL
SELECT
(REGISTER
ACNT[14:11])
0000AIN0AGNDSingle-ended measurement on AIN0
0001AIN1AGNDSingle-ended measurement on AIN1
0010AIN2AGNDSingle-ended measurement on AIN2
0011AIN3AGNDSingle-ended measurement on AIN3
0100AIN4AGNDSingle-ended measurement on AIN4
0101AIN5AGNDSingle-ended measurement on AIN5
0110AIN6AGNDSingle-ended measurement on AIN6
0111AIN7AGNDSingle-ended measurement on AIN7
1000——Reserved
1001——Reserved
1010AIN0AIN1AIN0/AIN1
1011AIN2AIN3AIN2/AIN3
1100AIN4AIN5AIN4/AIN5
1101AIN6AIN7AIN6/AIN7
1110——Reserved
1111——VCIM differential zero offset trim
SIGNAL CHANNEL
INTO ADC
REFERENCE
CHANNEL INTO
ADC
MEASUREMENT TYPE
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
The input-capacitance charging rate determines the
time required for the T/H to acquire an input signal. The
required acquisition time lengthens with the increase of
the input signals source resistance. Any source below
5kΩ does not significantly affect the ADC’s performance. A high-impedance source can be accommodated by placing a 1µF capacitor between the input
channel and AGND. The combination of analog-input
source impedance and the capacitance at the analog
input creates an RC filter that limits the analog-input
bandwidth.
Controlling ADC Conversions
Use the following methods to control the ADC conversion timing:
1) Software register bit control
2) Continuous conversion
3) Internal timer (T0)
4) External input through ADCCNV
Refer to the
MAXQ7670 User’s Guide
for more detailed
information on the ADC and mux.
POR and Brownout
The MAXQ7670 operates from a single, external +5V
supply connected to the DVDDIO. DVDDIO is the supply rail for the digital I/O and the supply input for both
integrated linear regulators. The +3.3V linear regulator
powers AVDD, while the +2.5V linear regulator powers
DVDD. Alternatively, connect REGEN2 to DVDDIO and
apply external power supplies to AVDD and DVDD.
Power supplies DVDDIO, DVDD, and AVDD each
include a brownout monitor that alerts the µC through
an interrupt when the corresponding supply voltages
drop below a defined threshold. This condition is generally referred to as brownout interrupt (BOI). Enable
BOI by setting the VABE, VDBE, and VIBE bits in the
APE register. By continually checking for low supply
voltages, appropriate action can be taken for brownout
conditions.
Startup Using Internal Regulators
Once the +5V DVDDIO supply reaches approximately
1.25V, the +2.5V linear regulator turns on and DVDD
begins ramping. Between the DVDD levels of 1V and
the reset threshold, the DVDD monitor holds RESET
low. DVDD releases RESET after reaching the reset
threshold. The MAXQ7670 jumps to the reset vector
location (8000h in the utility ROM). During this time,
DVDD finishes ramping to its nominal voltage of +2.5V.
During this POR time, the software-enabled +3.3V linear regulator remains off. Turn on the +3.3V linear regulator after the MAXQ7670 has completed its bootup
routines and is running application code. To turn on the
+3.3V regulator, set the LRAPD bit in the APE register
to 0. The AVDD supply begins ramping to its nominal
voltage of +3.3V.
Brownout Detectors
The MAXQ7670 features brownout monitors for the +5V
DVDDIO, +3.3V AVDD, and +2.5V DVDD power supplies. When enabled, these monitors generate interrupts
when DVDDIO, AVDD, or DVDD fall below their respective brownout thresholds. Monitoring the supply rails
alerts the µC to brownout conditions so appropriate
action can be taken. Under normal conditions the DVDDIO
brownout monitor signals a falling +5V supply before
the DVDD or AVDD brownout monitors indicate that the
+2.5V or +3.3V are falling. The exceptions to this condition are:
• If either DVDD or AVDD are externally powered and
the source of power is removed
• If there is some type of device failure that pulls the reg-
ulator outputs low without affecting the +5V DVDDIO
supply
Figure 5. Conversion Timing Differences Between Gain = 1V/V and Gain = 16V/V
The DVDD reset supervisor resets the MAXQ7670 when
the +2.5V DVDD falls below the reset threshold. The
processor remains in reset until DVDD returns above
the reset threshold. The µC does not execute commands in reset mode. See Figure 6 for the µC response
to DVDD brownout and reset.
Refer to the
MAXQ7670 User’s Guide
for detailed programming information, and a more thorough description of POR and brownout behavior.
Internal 3.3V Linear Regulator
The integrated 3.3V 50mA linear regulator or an external 3.3V supply powers AVDD. The integrated 3.3V regulator is inactive upon power-up. Enable the integrated
regulator with software programming after power-up.
When using an external supply, connect a regulated
3.3V supply to AVDD after applying DVDDIO.
Internal 2.5V Linear Regulator
The integrated 2.5V 50mA linear regulator or an external 2.5V supply applied at DVDD powers DVDD.
Connect REGEN2 to GNDIO to enable the integrated
regulator. Connect REGEN2 to DVDDIO to use an
external supply. When using an external supply, connect a regulated 2.5V supply to DVDD after applying
DVDDIO.
DVDDIO Current Requirements
Both internal linear regulators are capable of supplying
up to 50mA each. When using the regulators to power
AVDD and DVDD and to provide power to external
devices, make sure DVDDIO’s power input can source
a current greater than the sum of the MAXQ7670 supply current and the load currents of the two regulators.
µ
Figure 6. DVDD Brownout and Reset Behavior
NOMINAL
DVDD (+2.5V)
+2.38V
+2.25V
BROWNOUT
INTERRUPT
(BOI)
DGND
DVLVL FLAG
(ASR[14])
DVBI FLAG
(ASR[4])
BROWNOUT
RESET
(BOR)
INTERNAL RESET
RESET OUTPUT
BOR STATE
FLAG ARBITRARILY
CLEARED BY
C
DVDD BROWNOUT
INTERRUPT
THRESHOLD RANGE
VDBE BIT SET BY µC
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
The MAXQ7670 oscillator module provides the master
clock generator that supplies the system clock for the
µC core and all of the peripheral modules. The high-frequency oscillator operates with an 8MHz or 16MHz
crystal. Alternatively, use the integrated RC oscillator in
applications that do not require precise timing. The
MAXQ7670 executes most instructions in a single
SYSCLK period. The oscillator module contains all of
the primary clock generation circuitry. Figure 7 shows a
block diagram of the system clock module.
The MAXQ7670 contains the following features for generating its master clock signal timing source:
• Internal high-frequency oscillator that can drive an
external 8MHz or 16MHz crystal
• External high-frequency 0.166MHz to 16MHz clock input
• Power-up timer
• Power-saving management modes
• Fail-safe modes
Watchdog Timer
The primary function of the watchdog timer is to supervise software execution, watching for stalled or stuck
software. The watchdog timer performs a controlled
system restart when the µC fails to write to the watchdog timer register before a selectable timeout interval
expires. A watchdog timer typically has four objectives:
1) To detect if a system is operating normally
2) To detect an infinite loop in any of the tasks
3) To detect an arbitration deadlock involving two or
more tasks
4) To detect if some lower priority tasks are not getting
to run because of higher priority tasks
As illustrated in Figure 8, the internal RC oscillator
(CLK_RC) drives the watchdog timer through a series
of dividers. The programmable divider output determines the timeout interval. When enabled, the interrupt
flag WDIF sets. A system reset occurs after a time
delay (based on the divider ratio) unless an interrupt
service routine clears the watchdog interrupt.
The watchdog timer functions as the source of both the
watchdog interrupt and the watchdog reset. The interrupt timeout has a default divide ratio of 2
12
of the
CLK_RC, with the watchdog reset set to timeout 2
9
clock cycles later. With the nominal RC oscillator value
of 15MHz, an interrupt timeout occurs every 0.273ms,
followed by a watchdog reset 34µs later. The watchdog
timer resets to the default divide ratio following any
reset event. Use the WD0 and WD1 bits in the WDCN
register to increase the watchdog interrupt period.
Changing the WD[1:0] bits before a watchdog interrupt
timeout occurs (i.e. before the watchdog reset counter
begins) resets the watchdog timer count. The watchdog reset timeout occurs 512 RC oscillator cycles after
the watchdog interrupt timeout. For more information on
the MAXQ7670 watchdog timer, refer to the
MAXQ7670
User’s Guide.
Figure 7. High-Frequency and RC Oscillator Functional
Diagram
The MAXQ7670 includes a 16-bit timer channel. The
timer offers two ports, T0 and T0B, to facilitate PWM
outputs, and capture timing events. The autoreload 16bit timer/counter offers the following functions:
• 8-/16-bit timer/counter
• Up/down autoreload
• Counter function of external pulse
• Capture
• Compare
• PWM output
• Event timer
• System supervisor
Refer to the
MAXQ7670 User’s Guide
and Application
Note 3205:
Using Timers in the MAXQ Family of
Microcontrollers
for more information about the timer
module.
CAN Interface Bus
The MAXQ7670 incorporates a fully compliant CAN
2.0B controller.
Two groups of registers provide the µC interface to the
CAN controller. To simplify the software associated with
the operation of the CAN controllers, most of the global
CAN status and controls as well as the individual message center control/status registers are located in the
peripheral register map. The remaining registers associated with the data identification, identification masks,
format, and data are located in a dual port memory to
allow the CAN controller and the processor access to
the required functions. The CAN controller can directly
access the dual port memory. The processor accesses
the dual port memory through a dedicated interface
that consists of the CAN 0 data pointer (C0DP) and the
CAN 0 data buffer (C0DB) special function registers.
See Figure 9 for CAN controller details.
CAN Functional Description
The CAN module stores up to 15 messages. Each message consists of an acceptance identifier and 8 bytes
of data. The MAXQ7670 supports both the standard 11bit and extended 29-bit identification modes.
Configure each of the first 14 message centers either to
transmit or receive. Message center 15 is a receiveonly center, storing any message that centers 1–14 do
not accept.
A message center only accepts an incoming message
if the following conditions are satisfied:
• The incoming message’s arbitration value matches
the message center’s acceptance identifier
• The first 2 data bytes of the incoming message match
the bytes in the media arbitration registers (C0MA0
and C0MA1)
Use the global mask registers to mask out bits in the
incoming message that do not require a comparison.
A message center, configured to transmit, meets these
conditions: T/R = 1, TIH = 0, DTUP = 1, MSRDY = 1,
and MTRQ = 1. The message center transmits its contents when it receives an incoming request message
containing the same identifier (i.e., a remote frame).
Global control and status registers in the CAN unit
enable the µC to evaluate error messages, validate and
locate new data, establish the bus timing for the CAN
bus, establish the identification mask bits, and verify the
source of individual messages. In addition, each message center is individually equipped with the necessary
status and controls to establish directions, interrupt generation, identification mode (standard or extended), data
field size, data status, automatic remote frame request
and acknowledgment, and masked or nonmasked identification acceptance testing.
JTAG Interface Bus
The joint test action group (JTAG) IEEE®1149.1 standard defines a unique method for in-circuit testing and
programming. The MAXQ7670 conforms to this standard, implementing an external test access port (TAP)
and internal TAP controller for communication with a
JTAG bus master, such as an automatic test equipment
(ATE). For detailed information on the TAP and TAP controller, refer to IEEE Standard 1149.1 on the IEEE website
at www.standards.ieee.org. The JTAG on the MAXQ7670
does not support boundary scan test capability.
IEEE is a registered service mark of the Institute of Electrical and Electronics Engineers.
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
The TAP controller communicates synchronously with
the host system (bus master) through four digital I/Os:
test mode select (TMS), test clock (TCK), test data
input (TDI), and test data output (TDO). The internal
TAP module consists of several shift registers and a
TAP controller (see Figure 11). The shift registers serve
as transmit-and-receive data buffers for a debugger.
4-Wire SPI Bus
The MAXQ7670 includes a powerful hardware SPI module, providing serial communication with a wide variety
of external devices. The SPI port on the MAXQ7670 is a
fully independent module that is accessed through software. This full 4-wire, full-duplex serial bus module supports master and slave modes. The SPI clock
frequency is limited to SYSCLK/2 in master mode and
SYSCLK/8 in slave mode. Figure 10 shows the functional diagram of the SPI port. Figures 1 and 2 illustrate the
timing parameters listed in the
Electrical Characteristics
table.
General-Purpose Digital I/Os
The MAXQ7670 provides seven general-purpose digital
I/Os (GPIOs). Some of the GPIOs include an additional
special function (SF), such as a timer input/output. For
example, the state of P0.6/T0 is programmable to
depend on timer channel 0 logic. When used as a port,
each I/O is configurable for high-impedance, weak
pullup to DVDDIO or pulldown to GNDIO. At power-up,
each GPIO is configured as an input with a pullup to
DVDDIO. In addition, each GPIO can be programmed
to cause an interrupt (on falling or rising edges). In stop
mode, use any interrupt to wake-up the device.
The port direction (PD) register determines the
input/output direction of each I/O. The port output (PO)
register contains the current state of the logic output
buffers. When an I/O is configured as an output, writing
to the PO register controls the output logic state.
Reading the PO register shows the current state of the
output buffers, independent of the data direction. The
port input (PI) register is a read-only register that
always reflects the logic state of the I/Os.
Figure 10. SPI Functional Diagram
MAXQ7670
MSB (15)
SHIFT REGISTER
SFR DATA BUS
LSB(0)
DVDDIO
MASTER
SLAVE
MASTER
SLAVE
MISO
MOSI
SPI INTERRUPT
SYSCLK
/2 MASTER (MAX)
/8 SLAVE (MAX)
READ BUFFER
SPI CONTROL UNIT
SHIFT CLK
SCLK OUT
SCLK IN
MASTER/SLAVE SELECT
SPI ENABLE
SPI CONTRL REG (SPICN)
SPI CONTRL REG (SPICF)
SPI CONTRL REG (SPICK)
07
MASTER
SLAVE
DVDDIO
SS
SCLK
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
The drive capability of the I/O, when configured for output, depends on the value in the PS0 (pad drive
strength) register and can be set for either 1mA or
2mA. When an I/O is configured as an input, writing to
the PO register enables/disables the pullup/pulldown
resistor. The value in the PRO (pad resistive pull direction) register sets the enabled resistor at the I/O as
either a pullup to DVDDIO or pulldown to GNDIO.
Refer to the
MAXQ7670 User’s Guide
for more detailed
information.
Port Characteristics
The MAXQ7670 includes a bidirectional 7-bit I/O port
(P0) whose features include:
• Schmitt trigger input circuitry with software-selectable
high-impedance or weak pullup to DVDDIO or pulldown to GNDIO
• Software-selectable push-pull CMOS output drivers
capable of sinking and sourcing 0.5mA
• Falling or rising edge interrupt capability
• P0.4, P0.6, and P0.7 I/Os contain an additional special
function, such as a logic input/output for a timer channel
• Selectable pad drive strength and resistive pull direction
Refer to the
MAXQ7670 User’s Guide
for more details.
Figure 11 illustrates the functional blocks of an I/O.
MAXQ20 Core Architecture
The MAXQ7670’s core is a member of the low-cost,
high-performance, CMOS, fully static, 16-bit MAXQ20
core µCs. The MAXQ7670 is structured on a highly
advanced, accumulator-based, 16-bit RISC architecture. Fetch and execution operations complete in one
cycle without pipelining because the instruction contains both the op code and data. The result is a streamlined 1 million instructions-per-second-per-megahertz
(MIPS/MHz) µC.
The highly efficient core is supported by a 16-level
hardware stack, enabling fast subroutine calling and
task switching. The internal data pointers manipulate
data quickly and efficiently. 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 and increasing application speed.
Instruction Set
The instruction set is composed of fixed-length, 16-bit
instructions that operate on registers and memory locations. The highly orthogonal instruction set allows arithmetic and logical operations to use any register along
with the accumulator. Special-function registers (also
called peripheral registers) control the peripherals and
are subdivided into register modules. The modular family architecture allows new devices and modules to
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.
Memory Organization
The MAXQ7670 incorporates the following memory
areas (see Figure 12):
• 8KB (4K x 16) utility ROM
• 64KB (32K x 16) of flash memory for program storage
• 2048 bytes (1024 x 16) of SRAM for storage of tempo-
rary variables
• 16-level stack memory for storage of program return
addresses and general-purpose use
A 16-bit-wide x 16 deep internal hardware stack provides storage for program return addresses and general-purpose use. The MAXQ7670 core implicitly uses the
stack when executing an interrupt service routine (ISR)
and also when running CALL, RET, and RETI instructions. The stack can also be explicitly used by the
application code to store data when context switching
(e.g., during a call or an interrupt). Storing and retrieving data is executed through the PUSH, POP, and POPI
instructions.
The incorporation of flash memory allows device reprogramming, eliminating the expense of discarding onetime programmable devices during development and
field upgrades (see Figure 13 for the flash memory sector maps).
A 16-word key protects the flash memory from access
by unauthorized individuals. Without supplying the 16word key, the password lock (PWL) bit in the SC register remains set, and the utility ROM is inaccessible.
Supplying the 16-word key makes the utility ROM transparent. The password-unlock command is issued
through the TAP interface. The 16-word password is
compared to the password in the program space to
determine its validity.
Enabling a pseudo-Von Neumann memory map places
the utility ROM, code, and data memory into a single
contiguous memory map. Use this mapping scheme for
applications that require dynamic program modification
or unique memory configurations.
Figure 12. MAXQ7670 Memory Map
Figure 13. Flash Memory Sector Maps
PROGRAM
SPACE
FFFFh
A400h
A3FFh
1024 x 16
DATA RAM
A000h
8FFFh
4K x 16
UTILITY ROM
8000h
7FFFh
PAGE 127
7FFFh
32K x 16
PROGRAM
FLASH
0000h
DATA SPACE
(WORD MODE)
FFFFh
9000h
8FFFh
4K x 16
UTILITY ROM
8000h
7FFFh
PAGE 126
PAGE 125
PAGE 2
PAGE 1
PAGE 0
DATA SPACE
(BYTE MODE)
8K x 8
UTILITY ROM
1 PAGE = 256 WORDS
FFFFh
9000h
8FFFh
8000h
7FFFh
32K x 16
PROGRAM
FLASH
EXECUTING
FROM
0000h
1024 x 16
DATA RAM
0400h
03FFh
0000h
2048 x 8
DATA RAM
0400h
03FFh
0000h
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
A 16-bit-wide x 16 deep internal hardware stack provides storage for program return addresses and general-purpose use. The processor uses the stack
automatically when executing the CALL, RET, and RETI
instructions and when servicing interrupts. The stack
stores and retrieves data through 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
location pointed to by SP. The RET, RETI, POP, and
POPI operations retrieve the value at SP and then
decrement SP.
Utility ROM
The utility ROM is a 8KB (4K x 16) block of internal
ROM memory that defaults to a starting address of
8000h. The utility ROM consists of subroutines
accessed from application software. These include:
• In-system programming (bootstrap loader) over JTAG
and CAN
• In-circuit debug routines
• Routines for in-application flash programming and
fast table lookup
Following any reset, execution begins in the utility ROM.
The ROM software determines whether the program execution should immediately jump to location 0000h, the
start of user-application code, or to one of the above routines. Utility ROM routines are accessible in the application software. For more information on the utility ROM
contents, refer to the
MAXQ7670 User’s Guide
.
Programming Flash Memory
The MAXQ7670 allows the user to program its flash
through the JTAG or the CAN port by allowing access
to the ROM-based bootloader through these ports. The
bootloader is entered in one of three ways: by a JTAG
request during the power-up sequence, through a CAN
request immediately after power-up when no password
has been set, and by jumping to the bootloader from
the application code. After a reset, the MAXQ7670
instruction pointer jumps to the beginning of ROM code
(0x8000). The ROM code does some initial housekeeping and then looks for a request from the JTAG port. If
there is a valid request (i.e., SPE = 1, PSS = 00), the
processor establishes communication between the
ROM bootloader and the JTAG port. If there is no JTAG
request and the password has been set (0x0010 to
0x001F is not all 0s or all Fs), then program execution
jumps to the application code at address 0x0000. If the
password has not been set (0x0010 to 0x001F is all 0s
or all Fs), the ROM code monitors the CAN port for 5s
waiting to receive 0x3E. If this character is not detected
within 5s, program execution jumps to the application
code at address 0x000. If 0x3E is detected during the
five-second window, the CAN port is established as the
bootloader communication port and the MAXQ7670
responds with 0x3E, verifying that it is in the loader
mode. CAN bootloader communication speed is set to
500kbaud when using a 16MHz crystal and 250kbaud
when using an 8MHz crystal.
Once communication has been established with the
loader, the host has access to all the family 0 commands regardless of the state of the PWL bit. If PWL =
0, all the loader commands are accessible. Family 0
commands all start with a 0 and provide basic functionality, but do not allow access to information in either
program memory or data memory. This prevents unauthorized access of proprietary information. A mass
erase of the flash sets all flash memory including the
password to 0xFFFF. With this condition, it is as if no
password has been set and the PWL bit is set to 0,
which allows access to all loader commands. For more
information on password protection and loader commands, refer to the
MAXQ7670 User’s Guide
.
In-Application Programming
The in-application programming feature allows the µC
to modify its own flash program memory while simultaneously executing its application software. This allows
on-the-fly software updates in mission-critical applications that cannot afford downtime. In-application programming also allows the application to develop
custom loader software that can operate under the control of the application software. The utility ROM contains
user-accessible flash programming functions that erase
and program flash memory. These functions are
described in detail in the
MAXQ7670 User’s Guide
.
Register Set
Register sets control the MAXQ7670 functions. 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. Tables 2–5 show the MAXQ7670 register set.
Advanced power-management features minimize
power consumption by dynamically matching the processing speed of the device to the required performance level. During periods of reduced activity, lower
the system clock speed to reduce power consumption.
Use the source-clock-divide feature to reduce the system clock speed to 1/2, 1/4, and 1/8 of the source
clock’s speed. A lower power state is thus achievable
without additional hardware. For extremely power-sensitive applications, two additional low-power modes are
available:
Enabling PMM reduces the system clock speed to
1/256 of the source clock speed, and significantly
reduces power consumption. The optional switchback
feature allows enabled interrupt sources including
external, CAN, and SPI interrupts to bring the µC out of
the power-management mode and to run at a faster
system clock speed.
Power consumption is minimal in stop mode. In this
mode, the external oscillator, internal RC oscillator, system clock, and all processing activity stop. Triggering
an enabled external interrupt or applying an external
reset signal to RESET brings the µC out of stop mode.
Upon exiting stop mode, the µC can either wait for the
external crystal to warm up, or execute immediately by
using the internal RC oscillator as the crystal warms up.
Interrupts
Multiple interrupt sources are available for quick
response to internal and external events. Examples of
events that can trigger an interrupt are:
• Watchdog interrupt
• GPIO0–GPIO7 interrupts
• SPI mode fault, write collision, receive overrun, and
• CAN0 receive and transmit interrupts and a change in
CAN0 status register interrupt
• ADC data ready interrupt
• Voltage brownout interrupts
• Crystal oscillator failure interrupt
Each interrupt has flag and enable bits. The flag indicates whether an interrupt event has occurred. Enable
the µC to generate an interrupt by setting the enable
bit. Interrupts are organized into modules. Enable the
interrupt individually, by module, and globally.
The µC jumps to an ISR after an enabled interrupt event
occurs. Use the interrupt identification register (IIR) to
determine whether the interrupt is a system or peripheral interrupt. In the ISR, clear the interrupt flag to eliminate repeated interrupts from the same event. After
clearing the interrupt, allow a delay before issuing the
return from interrupt (RETI) instruction. Asynchronous
interrupt flags require a one-instruction delay and synchronous interrupt flags require a two-instruction delay.
The MAXQ architecture uses a single interrupt vector
(IV) and single ISR design. The IV register holds the
address of the ISR. In the application code, assign a
unique address to each ISR. Otherwise, the IV automatically jumps to 0000h, the beginning of application
code, after an enabled interrupt occurs.
Reset Sources
Reset sources are provided for µC control. Although
code execution stops in the reset state, the internal RC
oscillator continues to oscillate. Internal resets, such as
the power-on and watchdog resets, pull RESET low.
Power-On Reset (POR)
An internal POR circuit enhances system reliability. The
POR circuit forces the device to perform a POR whenever a rising voltage on DVDD climbs above the POR
threshold. At this point the following events occur:
• All registers and circuits enter the default state
• The POR flag (WDCN.7) sets to indicate if the source
of the reset was a loss of power
• The internal 15MHz RC oscillator becomes the clock
source
• Code execution begins at location 8000h
Refer to the
MAXQ7670 User’s Guide
for more information.
Watchdog Timer Reset
The watchdog timer functions are described in the
MAXQ7670 User’s Guide
. Execution resumes at loca-
tion 8000h following a watchdog timer reset.
External System Reset
Pulling RESET low externally causes the device to enter
the reset state. The external reset functions as
described in the
MAXQ7670 User’s Guide
. Execution
resumes at location 8000h after RESET is released.
MAXQ7670
Microcontroller with 10-Bit ADC,
PGA, 64KB Flash, and CAN Interface
The MAXQ7670 uses an 8MHz or 16MHz Jauch
JXG53P2 (or similar specification):
Frequency: 8MHz or 16MHz ±0.25%.
C
LOAD
: 12pF.
CO: < 7pF max.
Series resonance resistance: max 50Ω/300Ω for
16MHz/8MHz, respectively.
Note: Series resonance resistance is the resistance
observed when the resonator is in the series resonant
condition. This is a parameter often stated by quartz
crystal vendors and is called R1. When a resonator is
used in the parallel resonant mode with an external
load capacitance, as is the case with the MAXQ7670
oscillator circuit, the effective resistance is sometimes
stated. This effective resistance at the loaded frequency of oscillation is:
R1 x (1 + (C
O/CLOAD
))2
For typical C
O
and C
LOAD
values, the effective resis-
tance can be greater than R1 by a factor of two.
Development and Technical Support
Highly versatile, affordably priced development tools
for this µC are available from Maxim and third-party
suppliers. Tools for the MAXQ7670 include:
• Compilers
• Evaluation kits
• JTAG-to-serial converters for programming and
debugging
A list of development tool vendors can be found at
www.maxim-ic.com/microcontrollers. For technical
support, go to www.maxim-ic.com/support.
Table 2. System Register Map
REGISTER
INDEX
0hAPA[0]PFX[0]IP———
1hAPCA[1]PFX[1]—SP——
2h—A[2]PFX[2]—IV——
3h—A[3]PFX[3]——OFFSDP0
4hPSFA[4]PFX[4]——DPC—
5hICA[5]PFX[5]——GR—
6hIMRA[6]PFX[6]—LC0GRL—
7h—A[7]PFX[7]—LC1BPDP1
8hSCA[8]——GRS—
9h—A[9]———GRH—
Ah—A[10]———GRXL—
BhIIRA[11]———FP—
Ch—A[12]—————
Dh—A[13]—————
EhCKCNA[14]—————
FhWDCNA[15]—————
AP (8h)A (9h)PFX (Bh)IP (Ch)SP (Dh)DPC (Eh)DP (Fh)
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.
Maxim Integrated Products, 120 San Gabriel Drive, Sunnyvale, CA 94086 408-737-7600 ____________________