Motorola reserves the righ t to make changes without further notice to any products
herein. Motorola makes no warranty, representation or guarantee regarding the
suitability of i ts products for any partic ular purpose, nor does Moto rola assume any
liability arising out of the application or use of any prod uct or circuit, and s pecifically
disclaims any an d all liability, including withou t limitation consequential or inc idental
damages. "Typical" parameters which may be provided in Motorola data sheets and/or
specifications can an d do vary in different applications and actua l performance may
vary over time. A ll operating parameters, i ncluding "Typicals" must be validated for
each customer application by customer’s technical experts. Motorola does not convey
any license under i ts patent rights nor the rig hts of others. Motorola prod ucts are not
designed, intended, or authorized for use as components in systems intended for
surgical implant into the body, or other applications intended to support or sustain life,
or for any other applicat ion in wh ich the failure of the Mo torola pr oduct could cr eate a
situation where personal injury or death may oc cur. Should Buyer purchase o r use
Motorola products for any such unintended or una uthorized application, Buye r shall
indemnify and hold Motorola and its officers, employees, subsid iaries, affiliates, and
distributors harmless against all claims, costs, damages, and expenses, and
reasonable attorney fees arising out of, directly or indirectly, any claim of personal
injury or death associated with such unintended or unauthorized use, even if such claim
alleges that Motorola was negligent reg arding the design o r manufacture of the p art.
Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
The MC68HC912DG1 28 microcontroller unit (MCU) is a 16-bit device
composed of standard on-chip peripherals including a 16-bit central
processing un it (CPU12), 128K bytes of flash EEPROM, 8K bytes of
RAM, 2K bytes of EEPROM, two asynchronous seri al comm un ic atio n
interfaces (SCI), a serial peripheral interface (SPI), an inter-IC interface
(I2C), an enhanced capture timer (ECT), two 8- channel,10-bit an alog-todigital converters (ATD), a four-channel pulse-width modulator (PWM),
and two CAN 2.0 A, B software compatible mo dules (MSCAN12).
System resource mapping, clock generation, interrupt control and bus
interfacing are managed by the lite integration module (LIM). The
MC68HC912DG12 8 has full 16- bit data pa ths throug hout, howeve r, the
external bus can operate in an 8-bit narrow mode so single 8-bit wide
memory can be interfaced for l ower cost systems. The inclusion of a PLL
circuit allows pow er consumption and perf ormance to be adjusted to suit
operational requirements. In addition to the I/ O ports available in each
module, 16 I/O po rt pins are availab le with Key-Wake- Up capability from
STOP or WAIT mode.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAGeneral Description23
For More Information On This Product,
Go to: www.freescale.com
General Description
1.3 Features
nc...
I
Freescale Semiconductor, Inc.
•16-bit CPU12
•Multiplexed bus
–Upward compatible with M68HC11 instruction set
–Interrupt stacking and programmer’s model identical to
M68HC11
–20-bit ALU
–Instruction queue
–Enhanced indexed addressing
–Sin gle chi p or expan ded
cale Semiconductor,
Frees
–16 address/16 data wide or 16 address/8 data narrow mode
•Memory
–128K byte flash EEPROM, made of four 32K byte modules
with 8K bytes protected BOOT section in each module
–2K byte EEPROM
–8K byte RAM, made of two 4K byte modules with Vstby in each
module.
•Analog-to-digital converters
–2 times x 8-channels, 10-bit resolution
Technical DataMC68HC912DG128 — Rev 3.0
24General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
•1M bit per second, CAN 2.0 A, B software compatible modules,
nc...
I
•Enhanced capture timer (ECT)
General Description
Features
two on the MC68HC912DG128, each with:
–Two re ceiv e an d thr ee transm i t buff er s
–Flexible identifier filter programmable as 2 x 32 bit, 4 x 16 bit or
8x8bit
–Four separate interrupt channels for Rx, Tx, error and wake-up
–Low- pass fi lter wake- up fun cti on
–Loop-back for self test operation
–Programmable link to a timer input capture channel, for time-
stamping and network synchronization.
cale Semiconductor,
Frees
–16-bit main counter with 7-bit prescaler
–8 pr og ra m mabl e i npu t ca ptu re or output compare channel s; 4
of the 8 input captures with buffer
–Inpu t capture filters an d buffers, th ree successi ve captures o n
four channels, or two captures on four cha nne l s with a
capture/compare selectable on the remaining four
–Four 8-bit or two 16-bit pulse accumulators
–16-bit modulus down-counter with 4-bit prescaler
–Four user-selectable delay counters for signal filtering
•4 PWM channels with programmable period and duty cycle
–8-bit 4-channel or 16-bit 2-channel
–Separate control for each pulse width and duty cycle
–Center- or left-aligned outputs
–Programmable clock select logic with a wide range of
frequencies
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAGeneral Description25
For More Information On This Product,
Go to: www.freescale.com
General Description
nc...
I
Freescale Semiconductor, Inc.
•Serial interfaces
•LIM (lite integration module)
–Two asynchronous serial communications interfaces (SCI)
–Inter IC bus interface (I2C)
–Synchronous serial peripheral interface (SPI)
–WCR (windowed COP watchdog, real time interrupt, clock
monitor)
–ROC (reset and clocks)
–MEBI (multiplexed externa l bus interface)
–MBI (internal bus interface and memory map)
cale Semiconductor,
Frees
–INT (interrupt control)
•Two 8-bit ports with key wake-up interrupt
•Clock generation
–Phase-locked loop clock frequency multiplier
–Limp home mode in absence of external clock
–Slow mode divider
–Low power 0.5 to 16 MHz crystal oscillator reference clock
•112-Pin TQFP package
–Up to 66 general-purpose I/O lines, plus up to 18 input-only
lines
•8MHz operation at 5V
•Development support
–Single-wire background deb ug™ mode (BDM)
–On-chip hardware breakpoints
Technical DataMC68HC912DG128 — Rev 3.0
26General DescriptionMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
1.4 Ordering Information
Table 1-1. Device Ordering Information
General Description
Ordering Information
Package
0 to +70
112-Pin TQFP
Single Tray
60 Pcs
nc...
I
* Important: M temperature operation is available only for single chip modes
The CPU12 is a hi gh-speed, 16-bit processing uni t. It has full 16-b it data
paths and wider internal registers (up to 20 bits) for high-speed extended
math instructions. The instruction set is a proper superset of the
M68HC11instruction set. The CPU12 allows instructions with odd byte
counts, including many single-byte instructions. This provides efficient
use of ROM space. An in struction queue buffers program informatio n so
the CPU always ha s immediate access to at least three bytes of machine
code at the start of every instruction. The CPU12 also offers an
extensive set of indexed addressing cap ab ilities.
2.3 Programming Model
CPU12 registers are a n inte gral pa rt of t he CPU a nd ar e not ad dressed
as if they were memory locations.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLACentral Processing Unit29
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Central Processing Unit
7
15
15
15
15
nc...
I
15
AB
70
D
IX
IY
SP
PC
NSXHIZVC
0
8-BIT ACCUMULATORS A & B
OR
0
16-BIT DOUBLE ACCUMULATOR D
0
INDEX REGISTER X
0
INDEX REGISTER Y
0
STACK POINTER
0
PROGRAM COUNTER
CONDITION CODE REGISTER
Figure 2-1. Programming Model
Accumulators A and B are genera l-purpose 8-bit a ccumulators used to
hold operands and results of arithmetic calculations or data
manipulations. Some instructions treat the combination of these two 8bit accumulators as a 16-bit double accumulator (accumulator D).
Index registers X and Y are used for indexed addressing mode. In the
cale Semiconductor,
indexed addressing mode, the contents of a 16-bit index register are
added to 5-bit, 9-bit, or 16-bit constants or the content of an accumulator
to form the effective addr ess of the operand to be used in the i nstruction.
Frees
Stack pointer (SP) points to the last stack location used. The CPU12
supports an automatic program stack that is used to save system
context during su br ou tine calls and interrupts, and can also be u s ed fo r
temporary storage of data. The stack pointer can also be used in all
indexed addressing modes.
Program counter is a 16-bit register that holds the address of the next
instruction to be executed. The program counter can be used in all
indexed addr essing modes except autoinc rement/decrement.
Technical DataMC68HC912DG128 — Rev 3.0
30Central Processing UnitMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
nc...
I
2.4 Data Types
Freescale Semiconductor, Inc.
Condition Code Register (CCR) contains five status indicators, two
interrupt masking bits, and a STOP disable bit. The five flags are half
carry (H), negative (N), zero (Z), overflow (V), and carry/borrow (C). The
half-carry flag is use d only for BCD arithmetic operations. The N, Z, V,
and C status bits allow for branchin g based on the results of a pr evious
operation.
After a reset, the CPU fetches a vector from the appropriate address and
begins executing instructions. The X and I interrupt mask bits are set to
mask any interrupt requests. The S bit is also set to inhibit the STOP
instruction.
Central Processing Unit
Data Types
cale Semiconductor,
2.5 Addressing Modes
Frees
The CPU12 supports the following data types:
•Bit data
•8-bit and 16-bit signed and unsigned integers
•16-bit unsigned fractions
•16-bit addresses
A byte is eight bits wide and can be accessed at any byte location. A
word is composed of two consecutive bytes with the most significant
byte at the lower value address. There are no special requirements for
alignment of instructions or operands.
Addressing modes determine how the CPU accesses memory locations
to be operated upon. The CPU12 includes all of the addressing modes
of the M68HC11 CPU as well as several new forms of indexed
addressing. Table 2-1 is a summary of the available addressing modes.
INST oprx3,–xysIDXAuto pre-decrement x, y, or sp by 1 ~ 8
INST oprx3,+xysIDXAuto pre-increment x, y, or sp by 1 ~ 8
INST oprx3,xys–IDXAuto post-decrement x, y, or sp by 1 ~ 8
INST oprx3,xys+IDXAuto post-increment x, y, or sp by 1 ~ 8
INST oprx9,xyspIDX1
or
INST #opr16i
INST rel8
or
INST rel16
INST abd,xyspIDX
IMM
REL
Operand is included in instruction stream
8- or 16-bit size implied by context
Operand is the lower 8-bits of an address in
the range $0000 – $00FF
An 8-bit or 16-bit relative offset from the
current pc is supplied in the instruction
5-bit signed constant offset from x, y, sp, or
pc
Indexed with 8-bit (A or B) or 16-bit (D)
accumulator offset from x, y, sp, or pc
9-bit signed constant offset from x, y, sp, or
pc
(lower 8-bits of offset in one extension byte)
Indexed
(16-bit offset)
Indexed-Indirect
(16-bit offset)
Indexed-Indirect
(D accumulator offset)
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLACentral Processing Unit33
INST oprx16,xyspIDX2
INST [oprx16,xysp][IDX2]
INST [D,xysp][D,IDX]
For More Information On This Product,
Go to: www.freescale.com
16-bit constant offset from x, y, sp, or pc
(16-bit offset in two extension bytes)
Pointer to operand is found at...
16-bit constant offset from x, y, sp, or pc
(16-bit offset in two extension bytes)
Pointer to operand is found at...
x, y, sp, or pc plus the value in D
Freescale Semiconductor, Inc.
Central Processing Unit
2.6 Indexed Addressing Modes
The CPU12 indexed modes reduce execution time and eliminate code
size penalties fo r using the Y inde x register. CP U12 indexed ad dressing
uses a postbyte plus zero, one, or two extension bytes after the
instruction opcode. The postbyte and extension s do th e fo llowing ta sks:
•Specify which index register is used.
•Determine whethe r a value in an accumula tor is used as an offset.
•Enable automatic pre- or post-increment or decrement
•Specify use of 5-bit, 9-bit, or 16-bit signed offsets.
nc...
I
cale Semiconductor,
Frees
Table 2-3. Summary of Indexed Operations
Postbyte
Code (xb)
rr0nnnnn
111rr0zs
111rr011[n,r]
rr1pnnnn
111rr1aa
Source
Code
Syntax
,r
n,r
–n,r
n,r
–n,r
n,–r n,+r
n,r– n,r+
A,r
B,r
D,r
Comments
5-bit constant offset n = –16 to +15
rr can specify X, Y, SP, or PC
Constant offset (9- or 16-bit signed)
z-0 = 9-bit with sign in LSB of postbyte(s)
1 = 16-bit
if z = s = 1, 16-bit offset indexed-indirect (see below)
rr can specify X, Y, SP, or PC
16-bit offset indexed-indirect
rr can specify X, Y, SP, or PC
Auto pre-decrement/incremen t or Auto post-
decrement/increment;
p = pre-(0) or post-(1), n = –8 to –1, +1 to +8
rr can specify X, Y, or SP (PC not a valid choice)
Accumulator offset (unsigned 8-bit or 16-bit)
aa-00 = A
01 = B
10 = D (16-bit)
11 = see accumulator D offset indexed-indirect
rr can specify X, Y, SP, or PC
111rr111[D,r]
Technical DataMC68HC912DG128 — Rev 3.0
34Central Processing UnitMOTOROLA
For More Information On This Product,
Accumulator D offset indexed-indirect
rr can specify X, Y, SP, or PC
Go to: www.freescale.com
Freescale Semiconductor, Inc.
2.7 Opcodes and Operands
The CPU12 uses 8-bit opcodes. Each opcode identifies a particular
instruction and associated addressing mode to the CPU. Several
opcodes are required to provide each instruction with a range of
addressing capabilities.
Only 256 opcodes would be available if the range of values were
restricted to the number that can be represented by 8-bit binary
numbers. To expand the num ber of opcodes, a second page i s added to
the opcode map. Opcodes on the second page are preceded by an
additional byte with the value $18.
Central Processing Unit
Opcodes and Operands
nc...
I
cale Semiconductor,
Frees
To provide additional addressing flexibility, opcodes can also be
followed by a postby te or ex tensio n by tes. Postb ytes impl eme nt cert ain
forms of indexed addr essing, transfers, e xchanges, and l oop primitiv es.
Extension bytes contain additional program information such as
addresses, offsets, and immedi at e data .
Power and ground pins are described below and summarized in Table
3-1.
3.3.1 Internal Power (VDD) and Ground (VSS)
Power is supplied to the MCU through VDD and VSS. Because fast signal
transitions place high, short-duration current demands on the power
supply, use bypass capacitors with high-frequency characteristics and
place them as close to the MCU as possible. Bypass requirements
nc...
I
depend on how heavily the MCU pins are loaded.
3.3.2 External Power (V
3.3.3 V
DDA
, V
cale Semiconductor,
External power and ground for I/O drivers. Because fast signal
transitions place high, short-duration current demands on the power
supply, use bypass capacitors with high-frequency characteristics and
place them as close to the MCU as possible. Bypass requirements
depend on how heavily the MCU pins are loaded.
SSA
Provides operating volt age and gr ou nd for the ana l og-to-digital
converter. This allows the supply voltage to the ATD to be bypassed
independently. Connecting V
used will not result in an increase of power consumption.
and Ground (V
DDX)
Frees
3.3.4 Analog to Digital Reference Voltages (VRH, VRL)
V
RH0
, V
: reference voltage high and low for ATD converter 0.
RL0
SSX
)
to VDD if the ATD modules are not
DDA
V
, V
RH1
If the ATD modules are not use d, leavin g VRH connected to VDD will not
result in an increase of power consumption.
Technical DataMC68HC912DG128 — Rev 3.0
40Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
: reference voltage high and low for ATD converter 1.
RL1
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
Power Supply Pins
nc...
I
cale Semiconductor,
Frees
3.3.5 V
DDPLL
3.3.6 XFC
, V
SSPLL
Provides operating voltage and ground for the P hase-Locked Loop. This
allows the supply voltage to the PLL to be bypassed independently.
NOTE:The VSSP LL pin should always be grou nded even if the PLL is not used.
The VDDPLL pin should not be left floating. It is recommended to
connect the VDDPLL pin to ground if the PLL is not used.
PLL loop filter. Please see Appendix: CGM Practical Aspects for
information on how to calculate PLL loop filter elements. Any current
leakage on this pin must be avoided.
VDDPLL
C
0
MCU
XFC
R
0
Figure 3-3. PLL Loop FIlter Connections
If VDDPLL is connected to VS S (t hi s is norm a l case ) , then the XFC pin
should either be left floating or connected to VSS (never to VDD). If
VDDPLL is tied to VD D but the PLL is switch ed off (PLLON bit cleare d),
then the XFC pin should be connected pre ferably t o VDDPLL ( i.e. read y
for VCO minimum frequency).
C
p
3.3.7 V
FP
Flash EEPROM program/erase voltage and supply voltage during
normal operation.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions41
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
nc...
I
3.3.8 V
STBY
Mnemonic
V
DD
V
SS
V
DDX
V
SSX
V
DDA
V
SSA
V
RH1
V
RL1
V
RH0
V
RL0
V
DDPLL
V
SSPLL
V
FP
V
STBY
Pin Number
112-pin QFP
cale Semiconductor,
3.4 Signal Descriptions
Stand-by voltage supp ly to static RAM . Used to mainta in the contents of
RAM with minimal power when the rest of the chip is powered down.
Table 3-1. Power and Ground Connection Summary
Description
12, 65
14, 66
42, 107
40, 106
85
88
86
87
67
68
43
45
97
41
Internal power and ground.
External power and ground, supply to pin drivers.
Operating voltage and ground for the analog-to-digital converter, allows the
supply voltage to the A/D to be bypassed independently.
Reference voltages for the analog-to-digital converter 1
Reference voltages for the analog-to-digital converter 0.
Provides operating voltage and ground for the Phase-Locked Loop. This allows
the supply voltage to the PLL to be bypassed independently.
Program/erase voltage for the Flash EEPROM and required supply for normal
operation.
Stand-by voltage supply to maintain the contents of RAM with minimal power
when the rest of the chip is powered down.
Frees
3.4.1 Crystal Driver and External Clock Input (XTAL, EXTAL)
These pins provide the interface for either a crystal or a CMOS
compatible clock to control the internal clock generator circuitry. Out of
reset the frequency app lied to EXTAL is tw ice t he desir ed E–clock rate .
All the device clocks are derived from the EXTAL input frequency.
NOTE:CRYSTAL CIRCUIT IS CHANGED FROM STANDARD.
Technical DataMC68HC912DG128 — Rev 3.0
42Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
Signal Descriptions
NOTE:The inte rnal return p ath for the osci llator is th e VSSPLL pin. Th erefore it
is recommended t o conne ct the co mmo n node of the reson ator and th e
capacitor d irectly to the VSSPLL pin.
2 x E crystal or ceramic resonator
EXTAL
nc...
I
cale Semiconductor,
Frees
MCU
XTAL
C1
C2
Figure 3-4. Common Crystal Connections
NOTE:When se lecting a cr ystal, it is r ecommended t o use one w ith the lo west
possible frequency in order to minimise EMC emissions.
2 x E
CMOS-COMPATIBLE
MCU
EXTAL
XTAL
NC
EXTERNAL OSCILLATOR
Figure 3-5. External Oscillator Connections
XTAL is the crystal output.Th e XTAL pin must be left untermina ted when
an external CMOS compatible clock input is connected to the EXTAL
pin. The XTAL output is normally intended to drive only a crystal. The
XTAL output can be buffered with a high-impedance buffer to drive the
EXTAL input of another device.
In all cases take extra care in the circuit board layout around the
oscillator pins. Load capacitances in the oscillator circuits include all
stray layout capacitances. Refer to Figure 3-4 and Figure 3-5 for
diagrams of oscillator circuits.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions43
For More Information On This Product,
Go to: www.freescale.com
Pinout and Signal Descriptions
3.4.2 E-Clock Output (ECLK)
ECLK is the output connection for the internal bus clock. It is used to
demultiplex the address and data in expanded modes and is used as a
timing reference. ECLK frequency is equal to 1/2 the crystal frequency
out of reset. Th e E-clo ck output is tu rned off i n sing le ch ip user mo de to
reduce the effects of RFI. It can be turned on if necessary. In special
single-chip mode, the E-clock is turned ON at reset and can be turned
OFF. In special peripheral mode the E-clock is an input to the MCU. All
clocks, including the E clock, are halted when the MCU is in STOP
mode. It is possible to configure the MCU to interface to slow external
memory. ECLK can be stretched for such accesses.
nc...
I
Freescale Semiconductor, Inc.
3.4.3 Reset (RESET)
cale Semiconductor,
Frees
An active low bidirectional control signal, RESET, acts as an input to
initialize the MCU to a known start- up state. It also acts as an open-drain
output to indicate that an internal failure has been detected in either the
clock monitor or COP watchdog circuit. The MCU goes into reset
asynchronously and comes out of reset synch ro no usl y. This al low s the
part to reach a proper reset state even if the clocks have failed, while
allowing synchronized operation when starting out of reset.
It is important to use an external low-voltage reset circuit (such as
MC34064 or MC34164) to prevent corruption of RAM or EEPROM due
to power transitions.
The reset sequence is initiated by any of the following events:
•Power-on-reset (POR)
•COP watchdog enabled and watchdog timer times out
•Clock monitor enabled and C lock monitor detects slow or stopped
clock
•User applies a low level to the reset pin
External circuitry connected to the reset pin s hould not include a large
capacitance that would interfere with the ability of this signal to rise to a
valid logic one within nine bus cycles after the low drive is released.
Technical DataMC68HC912DG128 — Rev 3.0
44Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Upon detection of any reset, an internal circuit dr ives the reset pin low
and a clocked reset sequence controls when the MCU can begin normal
processing. In the case of POR or a clock monitor error, a 4096 cycle
oscillator startup delay is imposed before the reset recovery sequence
starts (reset is driven low throughout this 4096 cycle delay). The intern al
reset recovery sequence then drives reset low for 16 to 17 cycles and
releases the drive to allow reset to rise. Nine cycles later this circuit
samples the reset pin to see if it has rise n to a log ic on e level. If r eset is
low at this point, the reset is assumed to be coming from an external
request and the internally latched states of the COP time-out and clock
monitor failure are cleared so the normal reset vector ($FFFE:FFFF) is
taken when reset is finally released. If reset is high after this nine cycle
nc...
I
3.4.4 Maskable Interrupt Request (IRQ)
cale Semiconductor,
Frees
delay, the reset source is tentatively assumed to be either a COP failure
or a clock monitor fail. If the internally latched state of the clock monitor
fail circuit is true, processing begins by fetch ing the clock monitor vector
($FFFC:FFFD). If no clock monitor failure is indicated, and the latched
state of the COP tim e-out is true, processing beg ins by fetching the COP
vector ($FFFA:FFFB). If neither clock monitor fail nor COP time-out are
pending, processing begins by fetching the normal reset vector
($FFFE:FFFF).
The IRQ input provides a means of applying asynchronous interrupt
requests to the MCU. Either falling edge-sensitive triggering or levelsensitive triggering is program selectable (INTCR register). IRQ is
always enabled and configured to level-sensitive triggering at reset. It
can be disabled by clearing the IRQEN bit (INTCR register). When the
MCU is reset, the IRQ fun ction is masked in the con dition code regi ster.
Pinout and Signal Descriptions
Signal Descriptions
This pin is always an input and can always be read. There is an active
pull-up on this pi n while in reset and immediately out of reset. The pullup can be turned off by clearing PUPE in the PUCR register.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions45
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
3.4.5 Nonmaskable Interrupt (XIRQ)
The XIRQ input provides a means of requesting a nonmaskable interrupt
after reset initialization. During reset, the X bit in the condition code
register (CCR) is set and any interrupt is masked until MCU software
enables it. Because the XIRQ input is level sensitive, it can be connected
to a multiple-source wired-OR network. This pin is always an input and
can always be read. There is an active pull-up on this pin while in reset
and immediately out of reset. The pull-up can be turned off by clearing
PUPE in the PUCR register. XIRQ is often used as a power loss detect
interrupt.
nc...
I
3.4.6 Mode Select (SMODN, MODA, and MODB)
cale Semiconductor,
Frees
Whenever XIRQ or IRQ are used with mul tiple interrupt sources (IRQ
must be configured for l evel-sensitive operat ion if there is more than o ne
source of IRQ interrupt), each source must drive the interrupt input with
an open-drain type of driver t o avoid con tention betw een outputs. There
must also be an interlock mechanism at each interrupt source so that the
source holds th e interrupt line low until the MCU recognizes and
acknowledges the interrupt request. If the interrupt line is held low, the
MCU will recognize another interrupt as soon as the interrupt mask bit in
the MCU is cleared (normally upon return from an interrupt).
The state of these pins during reset determine the MCU operating mode.
After reset, MODA and MODB can be configured as instruction queue
tracking signals IPIPE0 and IPIPE1 in expanded modes. MODA and
MODB have active pull-downs during reset.
The SMODN pin has an active pull-up when configured as an input. This
pin can be use d as BKGD or TAGHI after reset.
3.4.7 Single-Wire Background Mode Pin (BKGD)
The BKGD pin receives and transmits serial background debugging
commands. A sp ecial self -timing pr otocol is u sed. The BK GD pin has a n
active pull-up wh en configured as an input ; BKGD has no pull-up con trol.
Refer to Development Support.
Technical DataMC68HC912DG128 — Rev 3.0
46Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
3.4.8 External Address and Data Buses (A DDR[15:0] and DATA[15:0])
External bus pins share functions with gener a l-pu r po se I/ O po r ts A and
B. In single-chip operating modes, the pins can be used for I/O; in
expanded modes, the pins are used for the external buses.
In expanded wide mode, ports A and B are used for multiplexed 16-bit
data and address buses. PA[7:0] correspond to
ADDR[15:8]/DATA[15:8]; PB[7:0] correspond to ADDR[7:0]/DATA[7:0].
In expanded narrow mode, ports A and B are used for the16 -bit address
bus, and an 8-bit data bus is multiplexed with the most significant half of
the address bus on port A. In this mode, 16-bit data is handled as two
nc...
I
back-to-back bus cycles, one for the high byte followed by one for the
low byte. PA[7:0] correspond to ADDR[15:8] and to DATA[15:8] or
DATA[7:0], depending on the bus cycle. The state of the address pins
should be latched at the r ising edge of E. To allow for m aximum address
setup time at ext ernal devices, a transparent latch should be used.
Pinout and Signal Descriptions
Signal Descriptions
3.4.9 Read/Write (R/W)
cale Semiconductor,
3.4.10 Low-Byte Strobe (LSTRB)
Frees
In all modes this pin can be used as a general-purpose I/O and is an
input with an active pull-up out of reset. If the read/write function is
required it should be enabled by setting the RDWE bit in the PEAR
register. External writes will not be possible until enabled.
In all modes this pin can be used as a general-purpose I/O and is an
input with an active p ull-up out of rese t. If the strobe fun ction is required ,
it should be enabl ed by setting th e LSTRE bit in t he PEAR re gister. This
signal is used in write operations and so external low byte writes will not
be possible until this fun ction is enabled. This pi n is also used as T AGLO
in Special Expanded modes and is multiplexed with the LSTRB function.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions47
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
3.4.11 Instruction Queue Tracking Signals (IPIPE1 and IPIPE0)
These signals are used to track the state of the internal instruction
execution queue . Execution state i s time-multipl exed on the two sig nals.
Refer to Development Support.
3.4.12 Data Bus Enable (DBE)
The DBE pin (PE7) is an active low signal that will be asserted low during
E-clock high time. DBE provides separation between output of a
multiplexed addre ss and the input of da ta. When an exte rnal addr ess is
stretched, DBE is asserted during what would be the last quarter cycle
nc...
I
of the last E-clock cycle of stretch. In expanded modes this pin is used
to enable the dr i ve control of exte rn al buse s d ur i ng e xter n al r e ads. Use
of the DBE is controlled by the NDBE bit in the PEAR register. DBE is
enabled out of re set in expanded modes. This pi n h as an act ive pu ll- u p
during and after reset in single chip modes.
3.4.13 Inverted E clock (ECLK)
The ECLK pin (PE7) can be used to latch the address for demultiplexing. It has th e sam e behavior as the ECLK, except is inver te d.
In expanded modes this pin i s used to enable the drive control of external
buses during external reads. Use of the ECLK is controlled by the NDBE
and DBENE bits in the PEAR register.
cale Semiconductor,
3.4.14 Calibration reference (CAL)
Frees
The CAL pin (PE7) is the out put of the Slow Mode program mable clock
divider, SLWCLK, and is used as a cal ibra tion re fere nce. The SLWC LK
frequency is equal to the crystal frequency out of reset and always has
a 50% duty. If the DBE function is enabled it will override the enabled
CAL output. The CAL pin output is disabled by clearing CALE bit in the
PEAR register.
Technical DataMC68HC912DG128 — Rev 3.0
48Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
3.4.15 Clock generation module test (CGMTST)
The CGMTST pin (PE6) is the ou tput of the clocks tested when CG MTE
bit is set in PEAR register. The PIPOE bit must be cleared for the clocks
to be tested.
Table 3-2. Signal Description Summary
Pinout and Signal Descriptions
Signal Descriptions
nc...
I
cale Semiconductor,
Frees
Pin Name
EXTAL-47
XTAL-48
RESET-46
ADDR[7:0]
DATA[7:0]
ADDR[15:8]
DATA[15:8]
DBEPE736
ECLKPE736Inverted E clock used to latch the address.
CALPE736
CGMTSTPE637Clock gen erati on modu le tes t output .
MODB/
IPIPE1,
MODA/
IPIPE0
ECLKPE439
LSTRB/
TAGLO
R/W
IRQPE155
Shared
port
PB[7:0]31–24
PA[7:0]64–57
PE6, PE537, 38
PE353
PE254
Pin
Number
112-pin
Description
Crystal driver and external clock input pins. On reset all the device clocks
are derived from the EXTAL input frequency. XTAL is the crystal output.
An active low bidirectional control signal, RESET
initialize the MCU to a known start-up state, and an output when COP or
clock monitor causes a reset.
External bus pins share function with general-purpose I/O ports A and B.
In single chip modes, the pins can be used for I/O. In expanded modes,
the pins are used for the external buses.
Data bus control and, in expanded mode, enables the drive control of
external buses during external reads.
CAL is the output of the Slow Mode programmable clock divider,
SLWCLK, and is used as a calibration reference for functions such as
time of day. It is overridden when DBE
a 50% duty.
State of mode select pins during reset determine the initial operating
mode of the MCU. After reset, MODB and MODA can be configured as
instruction queue tracking signals IPIPE1 and IPIPE0 or as generalpurpose I/O pins.
E Clock is the output connection for the external bus clock. ECLK is used
as a timing reference and for address demultiplexing.
Low byte strobe (0 = low byte valid), in all modes this pin can be used as
I/O. The low strobe function is the exclusive-NOR of A0 and the internal
signal. (The SZ8 internal signal indicates the size 16/8 access.) Pin
SZ8
function TAGLO
Indicates direction of data on expansion bus. Shares function with
general-purpose I/O. Read/write in expanded modes.
Maskable interrupt request input provides a means of applying
asynchronous interrupt requests to the MCU. Either falling edgesensitive triggering or level-sensitive triggering is program selectable
(INTCR register).
used in instruction tagging. See Development Support.
acts as an input to
function is enabled. It always has
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions49
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
Table 3-2. Signal Description Summary
nc...
I
cale Semiconductor,
Frees
Pin Name
XIRQPE056
SMODN/
BKGD/
TAGHI
IX[2:0]PK[2:0]109-111Page Index register emulation outputs.
SDO/MOSIPS594Master out/slave in pin for serial peripheral interface
SDI/MISOPS493Master in/slave out pin for serial peripheral interface
TxD1PS39 2SCI1 trans mit pin
RxD1PS291SCI1 receive pin
TxD0PS19 0SCI0 trans mit pin
RxD0PS089SCI0 receive pin
IOC[7:0]PT[7:0]18–15, 7–4
AN1[7:0]PAD1[7:0]
AN0[7:0]PAD0[7:0]
TxCAN1-102MSCAN1 transmit pin
RxCAN1-103MSCAN1 receive pin
TxCAN0-104MSCAN0 transmit pin
RxCAN0-105MSCAN0 receive pin
SCLPIB798
SDAPIB699
KWJ[7:0]PJ[7:0]
KWH[7:0]PH[7:0]
Shared
port
-23
Pin
Number
112-pin
Provides a means of requesting asynchronous nonmaskable interrupt
requests after reset initialization
During reset, this pin determines special or normal operating mode. After
reset, single-wire background interface pin is dedicated to the
background debug function. Pin function TAGHI
tagging. See Development Support.
Slave sele ct output for SPI master mode, input for sl ave mode or master
mode.
Pins used for input capture and output compare in the timer and pulse
accumulator subsystem.
84/82/80/7
8/76/74/72/70Analog inputs for the analog-to-digital conversion module 1
83/81/79/7
7/75/73/71/69Analog inputs for the analog-to-digital conversion module 0
2
I
C bus serial clock line pin
2
I
C bus serial data line pin
8–11,
19–22
32–35,
49–52
Key wake-up and general purpose I/O; can cause an interrupt when an
input transitions from high to low or from low to high (KWPJ).
Key wake-up and general purpose I/O; can cause an interrupt when an
input transitions from high to low or from low to high (KWPH).
Description
used in instruction
Technical DataMC68HC912DG128 — Rev 3.0
50Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
3.5 Port Signals
3.5.1 Port A
nc...
I
Freescale Semiconductor, Inc.
The MC68HC912D G128 incorporates eleven ports which are used to
control and access the various device subsystems. When not used for
these purposes, port pins may be used for general-purpose I/O. In
addition to the pins described below, each port consists of a data register
which can be read and writt en at any time, and, with the exception of po rt
AD0, port AD1, PE[1:0], RxCAN and TxCAN, a data direction register
which controls the direction of each pin. After reset all general purpose
I/O pins are configured as input.
Port A pins are u sed for add ress and data i n expanded modes. In sing le
chip modes, the pins can be used as gene ral purpose I/O. The port data
register is not in the address map during expanded and peripheral mode
operation. When it is in the ma p, port A can be r ead or written at anytime.
Pinout and Signal Descriptions
Port Signals
cale Semiconductor,
Frees
3.5.2 Port B
Register DDRA deter mines whether each port A pi n is an input or output.
DDRA is not in the address map during expanded and peripheral mode
operation. Setting a bit in DDRA makes the corresponding bit in port A
an output; clearing a bit in DDRA makes the corresponding bit in port A
an input. The default reset state of DDRA is all zeros.
When the PUPA bit in the PUCR re giste r is set, all por t A input pi ns are
pulled-up internally by an active pull-up device. PUCR is not in the
address map in peripheral mode.
Setting the RDPA bit in register RDRIV causes all port A outputs to have
reduced drive level. RDRIV can be writ ten once after reset. RDRIV is not
in the address map in peripheral mode. Refer to Bus Control and
Input/Output.
Port B pins are u sed for add ress and data i n expanded modes. In sing le
chip modes, the pins can be used as gene ral purpose I/O. The port data
register is not in the address map during expanded and peripheral mode
operation. When it is in the ma p, port B can be r ead or written at anytime.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions51
For More Information On This Product,
Go to: www.freescale.com
Pinout and Signal Descriptions
Register DDRB deter mines whether each port B pi n is an input or output.
DDRB is not in the address map during expanded and peripheral mode
operation. Setting a bit in DDRB makes the corresponding bit in port B
an output; clearing a bit in DDRB makes the corresponding bit in port B
an input. The default reset state of DDRB is all zeros.
When the PUPB bit in the PUCR re giste r is set, all por t B input pi ns are
pulled-up internally by an active pull-up device. PUCR is not in the
address map in peripheral mode.
Setting the RDPB bit in register RDRIV causes all port B outputs to have
reduced drive level. RDRIV can be writ ten once after reset. RDRIV is not
nc...
I
in the address map in peripheral mode. Refer to Bus Control and
Input/Output.
Freescale Semiconductor, Inc.
3.5.3 Port E
cale Semiconductor,
Frees
Port E pins operate differently from port A and B pins. Port E pins are
used for bus contro l signals and interrup t service re quest signa ls. When
a pin is not used for one of these specific functions, it can be used as
general-purpose I/O. However, two of the pins (PE[1:0]) can only be
used for input, and t he states of these pins can be r ead i n th e po r t da ta
register even when they are used for IRQ and XIRQ.
The PEAR registe r determines pin function, and register DDRE
determines whether each pin is an input or output when it is used for
general-purpose I/O. PEAR settings override DDRE settings. Because
PE[1:0] are input-only pins, only DDRE[7:2] have effect. Setting a bit in
the DDRE register makes the corresponding bit in port E an output;
clearing a bit in the DDRE register makes the corresponding bit in port E
an input. The default reset state of DDRE is all zeros.
When the PUPE bit in the PUCR register is set, PE[7,3,2,1, 0] are pulled
up. PE[7,3,2,0] are active pull-up device s. PUPCR is not in t he add ress
map in peripheral mode.
Neither port E nor DDRE is in the map in peripheral mode; neither is in
the internal map in expanded modes with EME set.
Technical DataMC68HC912DG128 — Rev 3.0
52Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
3.5.4 Port H
nc...
I
Freescale Semiconductor, Inc.
Setting the RDPE bit in register RDRIV causes all port E outputs to have
reduced drive level. RDRIV can be writ ten once after reset. RDRIV is not
in the address map in peripheral mode. Refer to Bus Control and
Input/Output.
Port H pins are used for key wake-ups that ca n be used with the pins
configured as inputs or outputs. The key wake-ups are triggered with
either a rising or fal ling edge sign al (KWPH ). An interrup t is genera ted if
the corresponding bit is en abl e d (K WI EH ). If any of the i nte rr u pts i s not
enabled, the corresponding pin can be used as a general purpose I/O
pin. Refer to I/O Ports with Key Wake-up.
Pinout and Signal Descriptions
Port Signals
cale Semiconductor,
Frees
Register DDRH determi nes whether each port H pin is an input or ou tput.
Setting a bit in DDRH makes the corresponding bit in port H an output;
clearing a bit in DDRH makes the correspondin g b it in port H a n in put.
The default reset state of DDRH is all zeros.
Register KWPH not only deter mines what type of edge the key wake ups
are triggered, but it also determines what type of resistive load is used
for port H input pins w hen P UPH bi t is set i n the P UCR reg ister. S etting
a bit in KWPH makes the corres ponding key wake up in put pin trigger at
rising edges and load s a pull down in the corr esponding port H input pin.
Clearing a bit in KW PH makes th e correspon ding key w ake up inpu t pin
trigger at falling edges and loads a pull up in the corresponding port H
input pin. The default state of KWPH is all zeros.
Setting the RDPH bit in register RDRIV causes all port H outputs to have
reduced drive level. RDRIV can be writ ten once after reset. RDRIV is not
in the address map in peripheral mode. Refer to Bus Control and
Input/Output.
3.5.5 Port J
Port J pins are used for key wake-ups that can be used with the pins
configured as inputs or outputs. The key wake-ups are triggered with
either a rising or falling e dge si gnal ( KWPJ). An i nterr upt is g enerate d if
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions53
For More Information On This Product,
Go to: www.freescale.com
Pinout and Signal Descriptions
the corresponding bit is enabled (KWIEJ). If any of the interrupts is not
enabled, the corresponding pin can be used as a general purpose I/O
pin. Refer to I/O Ports with Key Wake-up.
Register DDRJ determines whether each port J pin is an input or output.
Setting a bit in DDRJ makes the corresponding bit in port J an output ;
clearing a bit in DDRJ makes the corresponding bit in port J an input. The
default reset state of DDRJ is all zeros.
Register KWPJ not only determines what type of edge the key wake ups
are triggered, but it also determines what type of resistive load is used
for port J input pins whe n PUPJ bit is set in the PUCR registe r. Setting a
nc...
I
bit in KWPJ makes the corresponding key wake up input pin trigger at
rising edges and l oads a pull down in the co rrespondin g port J in put pin.
Clearing a bit in KWPJ makes the cor respo ndin g key wake up input pin
trigger at falling edges and loads a pull up in the corresponding port J
input pin. The default state of KWPJ is all zeros.
Freescale Semiconductor, Inc.
3.5.6 Port K
cale Semiconductor,
Frees
Setting the RDPJ bit in register RDRIV causes all port J outputs to have
reduced drive level. RDRIV can be writ ten once after reset. RDRIV is not
in the address map in peripheral mode. Refer to Bus Control and
Input/Output.
Port K pins are used for page index emulat ion in expa nded or perip heral
modes. When page index emulation is not enabled, EMK is not set in
MODE register, or the p art is in single chip mode , these pins can be used
for general purpose I/O. Port K bit 3 is used as a gene ral purpose I/O pin
only. The port data register is not in the address map during expanded
and peripheral mode operat ion with EM K set. When it is in the map, p ort
K can be read or written at anytime.
Register DDRK deter mines whether each port K pi n is an input or output.
DDRK is not in the address map during expanded and peripheral mode
operation with EMK set. Setting a bit in DDRK makes the corresponding
bit in port K an output; clearing a bit in DDRK makes the corresponding
bit in port K an input. The default reset state of DDRK is all zeros.
Technical DataMC68HC912DG128 — Rev 3.0
54Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
3.5.7 Port CAN1
nc...
I
Freescale Semiconductor, Inc.
When the PUPK bit in the PUCR re giste r is set, all por t K input pi ns are
pulled-up internally by an active pull-up device. PUCR is not in the
address map in peripheral mode.
Setting the RDPK bit in register RDRIV causes all port K outputs to have
reduced drive level. RDRIV can be writ ten once after reset. RDRIV is not
in the address map in peripheral mode. Refer to Bus Control and
Input/Output.
The MSCAN1 uses two external pins, one input (RxCAN1) and one
output (TxCAN1). The TxCAN1 output pin represents the logic level on
the CAN: ‘0’ is for a dominant state, and ‘1’ is for a recessive state.
RxCAN1 is on bit 0 of Port CAN1, TxCAN1 is on bit 1.
Pinout and Signal Descriptions
Port Signals
3.5.8 Port CAN0
3.5.9 Port IB
cale Semiconductor,
Frees
The MSCAN0 uses two external pins, one input (RxCAN0) and one
output (TxCAN0). The TxCAN0 output pin represents the logic level on
the CAN: ‘0’ is for a dominant state, and ‘1’ is for a recessive state.
RxCAN0 is on bit 0 of Port CAN0, TxCAN0 is on bit 1.
Bidirectional pins to IIC bus interface subsystem. The IIC bus interface
uses a Serial Data line (SDA) and Serial Clock line (SCL) for data
transfer. The pins are connected to a positive voltage supply via a pull
up resistor. The pull ups can be enabled internally or connected
externally. The output stages have open drain outputs in order to
perform the wired-AND function. When the IIC is disabled the pins can
be used as gener al purpose I/O pins. SCL is on bit 7 of Port IB and S DA
is on bit 6. The remaining pins of Port IB (PIB[5:4]) are controlled by
registers in the IIC address space.
Register DDRIB determines pin direction of port IB when used for
general-purpose I/O. When DDRI B bits are set, the corresp onding pin is
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions55
For More Information On This Product,
Go to: www.freescale.com
Pinout and Signal Descriptions
configured for output. On reset the DDRIB bits are cleared and the
corresponding pin is configured for input.
When the PUPIB bit in the IBPURD register is set, all input pins are
pulled up internally by an active pull-up device. Pull-ups are disabled
after reset, except for input ports 0 through 3, which are always on
regardless of PUPIB bit.
Setting the RDPIB bit in the IBPURD register configures all port IB
outputs to have reduced drive levels. Levels are at normal drive
capability after reset. The IBPURD register can b e re ad or written
anytime after reset. Refer to section Inter-IC Bus.
nc...
I
3.5.10 Port AD1
Freescale Semiconductor, Inc.
3.5.11 Port AD0
cale Semiconductor,
Frees
This port is an analog inpu t in terfa c e to the a na log-to -di gita l subsystem
and used for general-purpose input. When analog-to-digital functions
are not enabled, the port has eight general-purpose input pins,
PAD1[7:0]. The ADPU bit in the ATD1CTL2 register enables the A/D
function.
Port AD1 pins are inpu ts; no data direction register is associ ated with this
port. The port has no resistive input loads and no reduced drive controls.
Refer to MSCAN Controller.
This port is an analog input interface to the analog-to-digital subsystem
and used for general-purpose input. When analog-to-digital functions are
not enabled, the port has eight general-purpose input pins, PAD0[7:0].
The ADPU bit in the ATD0CTL2 register enables the A/ D function.
Port AD0 pins are inpu ts; no data direction register is associ ated with this
port. The port has no resistive input loads and no reduced drive controls.
Refer to MSCAN Controller.
Technical DataMC68HC912DG128 — Rev 3.0
56Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
3.5.12 Port P
Freescale Semiconductor, Inc.
The four pulse-widt h modulation channel outputs share gen eral-purpose
port P pins. The PWM function is enabled with the PWEN register.
Enabling PWM pins takes precedence over the general-purpose port.
When pulse-width modulation is not in use, the port pins may be used for
general-purpose I/O.
Register DDRP determines pin direction of port P when used for
general-purpose I/O. When DDRP bits are set, the corresponding pin is
configured for output. On reset the DDRP bi ts are cleared and the
corresponding pin is configured for input.
Pinout and Signal Descriptions
Port Signals
nc...
I
3.5.13 Port S
cale Semiconductor,
Frees
When the PUPP bit in the PWCTL register is set, all input pins are pulled
up internally by an active pull-up device. Pull-ups are disabled after reset.
Setting the RDPP bit in the PWCTL register configures all port P outputs
to have reduced drive levels. Levels are at normal drive capability after
reset. The PWCTL register can be read or written anytime after reset.
Refer to Pulse Width Modulator.
Port S is the 8-bit inte r face to the standard serial inte r face con s ist ing o f
the two serial com munications interf aces (SCI1 and SC I0) and the seri al
peripheral interface (SPI) subsystems. Port S pins are available for
general-purpose I/O when standard serial function s are not enab led.
Port S pins serve several functions depending on the various internal
control registers. If WOMS bit in the SC0CR1register is set, the Pchannel drivers of the ou tput buffers are disabled (wi re-or mode) for pins
0 through 3. If SWOM bit in the SP0CR1 register is set, the P-channel
drivers of the output buffers are disabled (wire-or mode) for pins 4
through 7. The open drai n control affects both the serial an d the generalpurpose outputs. If the RDPS bit in the SP0CR2 register is set, Port S
pin drive capabilities are reduced. If PUPS bit in the SP0CR2 register is
set, a pull-up device is activated for each port S pin programmed as a
general purpose input. If the pin is programmed as a general-purpose
output, the pull-u p is disconnected fr om the pin regardless of the state of
PUPS bit. See Multiple Serial Interface.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions57
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
3.5.14 Port T
This port provides eight general-purpose I/O pin s when n ot en ab led fo r
input capture and output compare in the timer and pulse accumulator
subsystem. The TEN bit in the TSCR register enables the timer function.
The pulse accumulator subsystem is enabled with the PAEN bit in the
PACTL register.
Register DDRT determines pin direction of port T when used for generalpurpose I/O. When DDRT bits are set, the corresponding pin is
configured for output. On reset the DDRT bits are cleared and the
corresponding pin is configured for input.
nc...
I
cale Semiconductor,
Frees
When the PUPT bit in the TMSK 2 register is set, all in put pins are pulled
up internally by an active pull-up device. Pull- ups are disabled after
reset.
Setting the RDPT bit in the TMSK2 registe r configures all port T outputs
to have reduced drive levels. Levels are at normal drive capability after
reset. The TMSK2 register can be read or written anytime after reset
Refer to Enhanced Capture Timer.
Technical DataMC68HC912DG128 — Rev 3.0
58Pinout and Signal DescriptionsMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
nc...
I
cale Semiconductor,
Frees
Port Name
Port A
PA[7:0]
Port B
PB[7:0]
Port AD1
PAD1[7:0]
Port AD0
PAD0[7:0]
Port CAN1
PCAN1[1:0]
Port CAN0
PCAN0[1:0]
Port IB
PIB[7:4]
Port IB
PIB[3:2]
Port E
PE[7:0]
Port K
PK[7,3:0]
Port P
PP[3:0]
Port S
PS[7:0]
Port T
PT[7:0]
Freescale Semiconductor, Inc.
Table 3-3. Port Description Summary
Pin NumbersData Direction
112-pin
64-57
31–24
84/82/80/78/7
6/74/72/70
83/81/79/77/7
5/73/71/69
102–103
104–105
98–101
102–103
36–39, 53–56
13,
108-111
112,
1–3
96–89
18–15, 7–4
Register
(Address)
In/Out
DDRA ($0002)
In/Out
DDRB ($0003)
InAnalog-to-digital converter 1 and general-purpose I/O.
InAnalog-to-digital converter 0 and general-purpose I/O.
PCAN1[1] Out
PCAN1[0] In
PCAN0[1] Out
PCAN0[0] In
In/Out
DDRIB ($00E7)
In/Out
DDRIB ($00E7)
PE[1:0] In
PE[7:2] In/Out
DDRE ($0009)
In/Out
DDRK ($00FD)
In/Out
DDRP ($0057)
In/Out
DDRS ($00D7)
In/Out
DDRT ($00AF)
Pinout and Signal Descriptions
Port Signals
Description
Port A and port B pins are used for address and data in
expanded modes. The port data registers are not in the
address map during expanded and peripheral mode
operation. When in the map, port A and port B can be
read or written any time.
DDRA and DDRB are not in the address map in expanded
or peripheral modes.
PCAN1[1:0] are used with the MSCAN1 module and
cannot be used as general purpose I/O.
PCAN0[1:0] are used with the MSCAN0 module and
cannot be used as general purpose I/O.
General purpose I/O. PIB[7:6] are used with the I-Bus
module when enabled.
General purpose I/O
Mode selection, bus control signals and interrupt service
request signals; or general-purpose I/O.
Page index emulation signals in expanded or peripheral
mode or general-purpose I/O.
General-purpose I/O. PP[3:0] are used with the pulse-width
modulator when enabled.
Serial communications interfaces 1 and 0 and serial
peripheral interface subsystems; or general-purpose I/O.
General-purpose I/O when not enabled for input capture
and output compare in the timer and pulse accumulator
subsystem.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAPinout and Signal Descriptions59
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Pinout and Signal Descriptions
3.5.15 Port Pull-Up Pull-Down and Reduced Drive
MCU ports can be configured for internal pull-up. To reduce power
consumption a nd RFI, the pin output drivers ca n be configured to
operate at a r educed drive level . Reduced driv e causes a slight increase
in transition time depen ding on loading and should be use d only for ports
which have a light loading. Table 3-4 summarizes t he port pull-up/pulldown default status and controls.
Table 3-4. Port Pull-Up, Pull-Down and Reduced Drive Summary
Enable BitReduced Drive Control Bit
nc...
I
cale Semiconductor,
Frees
Port
Name
Port APull-upPUCR ($000C)PUPADisabled RDRIV ($000D)RDPAFull drive
Port BPull-upPUCR ($000C)PUPBDisabled RDRIV ($000D)RDPBFull drive
Port KPull-upPUCR ($000C)PUPKDisabled RDRIV ($000D)RDPKFull drive
Port PPull-upPWCTL ($0054)PUPPDisabled PWCTL ($0054)RDPPFull drive
Port SPull-upSP0CR2 ($00D1)PUPSEnabled SP0CR2 ($00D1)RDPSFull drive
Port TPull-upTMSK2 ($008D)TPUDisabled TMSK2 ($008D)TDRBFull drive
Port IB[7:4]Pull-upIBPURD ($00E5)PUPIBDisabled IBPURD ($00E5)RDPIBFull drive
Port IB[3:2]Pull-upAlways enabled when pins are inputIBPURD ($00E5)RDPIBFull drive
Port AD0None——
Port AD1None——
Port CAN1[1]None——
Port CAN1[0]Pull-upAlways enabled—
Port CAN0[1]None——
Port CAN0[0]Pull-upAlways enabled—
The register block can be mapped to any 2K byte boundary wit hin the
standard 64K b yte address space by manipu lating bits REG[15:11] in
the INITRG register. INITRG establishes the upper five bits of the
register block’s 16-bit address. The registe r block occupies the first 1K
byte of the 2K byte block. D efault add ressing ( after re set) is in dicated in
the table below. For additional information refer to General Description.
Eight possible operat ing modes determine the ope rating configuratio n of
the MC68HC912DG128 . Each mode has an associa ted default memory
map and external bus configura tion. After reset, most system re sources
can be mapped to other addresses by writing to the appropriate control
registers.
The operating mode out of reset is determined by the states of the
BKGD, MODB, and MODA pins during reset.
The SMODN, MOD B, and MODA bits in the MODE register sh ow current
operating mode and provide limited mode switching during operation.
The states of the BKGD, MOD B, and MODA pin s are latch ed into thes e
bits on the rising edge of the reset signal.
In expanded modes, al l address space not used by int ernal resources is
by default external memory.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes75
For More Information On This Product,
Go to: www.freescale.com
Operating Modes
BKGDMODBMODAModePort APort B
Freescale Semiconductor, Inc.
Table 5-1. Mode Selection
100Normal Single ChipG.P. I/OG.P. I/O
101Normal Expanded NarrowADDR/DATAADDR
nc...
I
cale Semiconductor,
Frees
110
111Normal Expanded WideADDR/DATAADDR/DATA
000Special Single ChipG.P. I/OG.P. I/O
001Special Expanded NarrowADDR/DATAADDR
010Special PeripheralADDR/DATAADDR/DATA
011Speci al Expanded WideADDR/DATAA DDR/ DATA
Reserved (Forced to
Peripheral)
——
There are two basic types of operating modes:
Normal modes — some registers and bits are protected
against accidental changes.
Special modes — allow greater access to protected control
registers and bit s for special purposes such as test ing and
emulation.
For operation above 105°C, the MC68HC912DG128 (M temperature
range product only) is limited to single chip modes of operation.
A system development and debug feature, background debug mode
(BDM), is available in all modes. In special single-chip mode, BDM is
active immediately after reset.
5.3.1 Normal Operating Modes
These modes provide three operating configurations. Background
debugging is available in all three modes, but must first be enabled for
some operations by means of a BDM background command, then
activated.
Technical DataMC68HC912DG128 — Rev 3.0
76Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
nc...
I
Operating Modes
Operating Modes
Normal Single-Chip Mode — There are no external address
and data buses in this mode. The MCU operates as a standalone device and al l pro gram an d dat a reso urces are on- chip .
External port pins normally associated with address and data
buses can be used for general-purpose I/O.
Normal Expanded Wide Mode — This is a normal mode of
operation in which the expanded bus is present with a 16-bit
data bus. Ports A and B are used for the 16-bit multiplexed
address/data bus.
Normal Expanded Narrow Mode — This is a normal mode of
operation in which the expanded bus is present with an 8-bit
data bus. Ports A and B are used for the16-bit address bus.
Port A is used as t he da ta bu s, multi ple xed wi th add resses. In
this mode, 16-bit data is presented one byte at a time, the high
byte followed by t he low byte. The address is automatically
incremented on the second cycle.
5.3.2 Special Operating Modes
cale Semiconductor,
Frees
There are three special operating modes that correspond to normal
operating modes. Th ese operating mo des are commonly used in factory
testing and system development. In addition, there is a special
peripheral mode, i n which an external master , such as an I.C. tester, can
control the on-chip peripherals.
Special Single-Chip Mode — This mode can be us ed to force
the MCU to active BDM mode to allow system debug through
the BKGD pin. There are no external address and data buses
in this mode. The MCU oper ates as a st and-al one dev ice and
all program a nd data space are on-chip. External por t pins can
be used for general-purpose I/O.
Special Expanded Wide Mode — This mode can be us ed for
emulation of normal expanded wide mode and emulation of
normal single-chip mode. Ports A and B are used for the 16-bit
multiplexed address/data bus.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes77
For More Information On This Product,
Go to: www.freescale.com
Operating Modes
nc...
I
Freescale Semiconductor, Inc.
Special Expanded Narrow Mode — This mode can be used
for emulation of normal expanded narrow mode. Ports A and B
are used for the16-bit add ress bu s. Port A is use d as the da ta
bus, multiplexed with addresses. In this mode, 16-bit data is
presented one byte at a time, the high byte followed by the low
byte. The address is auto matically incremen ted on the second
cycle.
Special Peripheral Mode — The CPU is not active in this
mode. An external master can control on-chip peripherals for
testing purposes. It is not possible to change to or from this
mode without going through reset. Background debugging
should not be used while the MCU is in special peripheral
mode as internal bus conflicts be twee n BDM and the ext erna l
master can cause improper operation of both modes.
Bit 7654321Bit 0
SMODNMODBMODAESTRIVISEBSWAIEMKEME
RESET:00011011Special Single Chip
RESET:00111011Special Exp Nar
RESET:01011011Peripheral
RESET:01111011Special Exp Wide
RESET:10010000Normal Single Chip
RESET:10110000Normal Exp Nar
cale Semiconductor,
RESET:11110000Normal Exp Wide
MODE — Mode Register$000B
Frees
5.4 Background Debug Mode
Background debug mode (BDM) is an auxiliary operating mode that is
used for system devel opment. BDM is implemen ted in on-chip hardw are
and provides a full set of debug op erations. S ome BDM comm ands can
be executed while the CPU is operating normally. Other BDM
commands are firmware based, and require the BDM firmware to be
enabled and active for execution.
Technical DataMC68HC912DG128 — Rev 3.0
78Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Operating Modes
Background Debug Mode
In special single-chip mode, BDM is ena bled and active immediately out
of reset. BDM is available in all other operating mode s, but must be
enabled before it can be activated. BDM should not be used in special
peripheral mode because of potential bus conflicts.
Once enabled, background mode can be made active by a serial
command sent via the BKGD pin or execution of a CPU12 BGND
instruction. While background mode is active, the CPU can interpret
special debugging commands, and read and write CPU registers,
peripheral registers, an d locations in memory.
While BDM is active, t he C PU execut es code located in a sm all o n-chip
nc...
I
ROM mapped to addresses $FF20 to $FFFF, and BDM control registers
are accessible at addresses $FF00 to $FF06. The BDM ROM replaces
the regular system vectors while BDM is active. While BDM is active, the
user memory from $FF00 to $FFFF is not in the map except through
serial BDM commands.
RESET:10010000Normal Single Chip
RESET:10110000Normal Exp Nar
RESET:11110000Normal Exp Wide
MODE — Mode Register$000B
The MODE register controls the MCU operating mode and various
configuration options. This register is not in the map in peripheral mode
SMODN, MODB, MODA — Mode Select Special, B and A
These bits show the current operatin g mode an d reflect the status of
the BKGD, MODB and MODA input pins at the rising edge of reset.
SMODN is Read anytime. May only be written in special mode s
(SMODN = 0). The first write is ignored;
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes79
For More Information On This Product,
Go to: www.freescale.com
Operating Modes
Freescale Semiconductor, Inc.
MODB, MODA may be written once in Normal modes (SMODN = 1).
Write anytime in special modes (first write is ignored) – special
peripheral and reserved modes cannot be selected.
ESTR — E Clock Stretch Enable
Determines if the E Clock behaves as a simple free-running clock or
as a bus control signal that is active only for external bus cycles.
ESTR is always one in expanded modes since it is required for
address and dat a bus de-multiplexing and must follo w stretched
cycles.
0 = E never stretches (always free running).
nc...
I
cale Semiconductor,
Frees
1 = E stretches high during external access cycles and low during
non-visible internal accesses (IVIS = 0).
Normal modes: write once; Special modes: write anytime. Read
anytime.
IVIS — Internal Visibility
This bit determines whether internal ADDR, DATA, R/W an d L STR B
signals can be seen on the external bus during accesses to internal
locations. In Special Narrow Mode if this bit is set and an internal
access occurs the data will appear wide on Ports A and B. This serves
the same function as the EMD bit of the non-multiplexed versions of
the HC12 and allows for emulation. Visibility is not available when the
part is operating in a single-chip mode.
0 = No visibility of internal bus operations on external bus.
1 = Internal bus operations are visibl e on exte rn al bus.
Normal modes: write once; Special modes: write anytime EXCEPT
the first time. Read anytime.
Technical DataMC68HC912DG128 — Rev 3.0
80Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
EBSWAI — External Bus Module Stop in Wait Control
This bit controls access to the externa l bus inte rfa c e wh en in wait
mode. The module will delay before shutting down in wait mode to
allow for final bus activity to complete.
0 = External bus and registers continue functioning during wait
1 = External bus is shut down during wait mode.
Normal modes: write anytime; special modes: write never. Read
anytime.
EMK — Emulate Port K
Operating Modes
Internal Resource Mapping
mode.
nc...
I
5.5 Internal Resource Mapping
cale Semiconductor,
The internal register block, RAM, and EEPROM have default locations
within the 64K by te standard address space but may be reassigned to
Frees
other locations during program execution by setting bits in mapping
registers INITRG, INITRM, and INITEE. During n ormal operating modes
these registers c an be written once . I t is advisa ble to e xplicit ly establi sh
these resource locations during the initialization phase of program
execution, even if default values are chos en, in order to protect the
registers from inadvertent modification later.
In single-chip mode PORTK and DDRK are always in the map
regardless of the state of this bit.
0 = Port K and DDRK registers are in the mem o ry ma p. Memory
expansion emulation is disabled and all pins are general
purpose I/O.
1 = In expanded or peripheral mode, PORTK and DDRK are
removed from the internal memory map. Removing these
registers from the map allows th e user to em ulate th e function
of these registers externally.
Normal modes: write once; special modes: write anytime EXCEPT
the first time. Read anytime.
Writes to the mapping registers go into effect between the cycle that
follows the write and the cycle after that. To assure that there are no
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes81
For More Information On This Product,
Go to: www.freescale.com
Operating Modes
nc...
I
cale Semiconductor,
Freescale Semiconductor, Inc.
unintended operations, a write to one of these registers should be
followed with a NOP instruction.
If conflicts occur when mapping resources, the register block will take
precedence over the other resources; RAM or EEPROM addresses
occupied by the register block will not be available for storage. When
active, BDM ROM takes precedence over other resources, although a
conflict between BDM ROM and register space is not possible. The
following table shows resource mapping precedence.
The MC68HC912DG128 contains 128K bytes of Flash EEPROM
nonvolatile memory which can be used to store program code or static
data. This physical memory comprises four 32k byte array modules,
00FEE32K, 01FEE32K, 10FE E32K and 11FEE32K. The 32K b yte array
11FEE32K has a fixed location from $4000 to $7FFF and $C000 to
$FFFF. The three 32K byte arrays 00FEE32K, 01FEE32K and
10FEE32K are accessible through a 16K byt e program page window
mapped from $8000 to $BFFF. The fixed 32K byte array 11FEE32K can
also be accessed through the program page window..
Table 5-2. Mapping Precedence
PrecedenceResource
1BDM ROM (if active)
2Register Space
3RAM
4EEPROM
5On-Chip Flash EEPROM
6External Memory
Frees
5.5.1 Register Block Mapping
After reset the 1K byte register block resides at location $0000 but can
be reassigned to any 2K byte boundary within the standard 64K byte
address space. Mappin g o f inte r nal r eg ister s i s co ntr olled by fi ve b it s in
the INITRG register. The register block occupies the first 1K byte bytes
of the 2K byte block.
Technical DataMC68HC912DG128 — Rev 3.0
82Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
INITRG — Initialization of Internal Register Position Register$0011
Bit 7654321Bit 0
REG15REG14REG13REG12REG1100MMSWAI
RESET:00000000
REG[15:11] — Internal register map position
These bits specify the upper five bits of the 16-bit registers address.
Normal modes: write once; special modes: write anytime. Read
anytime.
Operating Modes
Internal Resource Mapping
nc...
I
5.5.2 RAM Mapping
cale Semiconductor,
Frees
MMSWAI — Memory Mapping Interface Stop in Wait Control
This bit controls access to the memory ma pping interface when in
Wait mode.
Normal modes: write anytime; special modes: write never. Read
anytime.
0 = Memory mapping interface continues to function du ring Wait
mode.
1 = Memory mapping interface access is shut down during Wait
mode.
The MC68HC912DG128 has 8K bytes of fully static RAM that is used for
storing instructions, variables, and temporary data during program
execution. Since the RAM is actually implemented with two 4K RAM
arrays, any misaligned word access between last address of first 4K
RAM and first address of second 4K RAM will take two cycles instead of
one. After reset, RAM addressing begins at location $2000 but can be
assigned to any 8K byte boundary within the standard 64K byte address
space. Mapping of internal RAM is con trolled by three bits in the INITRM
register.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes83
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Operating Modes
INITRM — Initialization of Internal RAM Position Register$0010
Bit 7654321Bit 0
RAM15RAM14RAM1300000
RESET:00100000
RAM[15:13] — Internal RAM map position
These bits specify the upper three bits of the 16-bit RAM address.
Normal modes: write once; special modes: write anytime. Read
anytime.
nc...
I
5.5.3 EEPROM Mapping
The MC68HC912DG128 has 2K bytes of EEPROM which is activated by
the EEON bit in the INITEE register. Mapping of internal EEPROM is
controlled by four bits in the INITEE register. After reset EEPROM
address space begins at location $0800 but can be mapped to any 4K
byte boundary within the standard 64K byt e address space. The
EEPROM block occupies the last 2K bytes of the 4K byte block.
INITEE— Initialization of Internal EEPROM Position Register$0012
Bit 7654321Bit 0
EE15EE14EE13EE12000EEON
RESET:00000001
cale Semiconductor,
EE[15:12] — Internal EEPROM map position
These bits specify the up per fou r bits of t he 16-bit EEPROM a ddress.
Frees
Normal modes: write once; special modes: write anytime. Read
anytime.
EEON — internal EEPROM On (Enabled)
This bit is forced to one in single-chip modes.
Read or write anytime.
0 = Removes the EEPROM from the map.
1 = Places the on-chip EEPROM in the memory map at the address
selected by EE[15:12].
Technical DataMC68HC912DG128 — Rev 3.0
84Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
5.5.4 Flash EEPROM mapping through internal Memory Expansion
The Page Index register or PPAGE provides memory management for
the MC68HC912DG128. PPAGE consists of three bits to indicate which
physical location is active within the windows of the MC68HC912DG128.
The MC68HC912DG128 has a u ser’s program space window , a register
space window for Flash module registers, and a test program space
window.
The user’s program pa ge window consists of 1 6K Flash EEPROM bytes.
One of eight pages is viewed through this window for a total of 128K
accessible Flash EEPROM bytes.
Operating Modes
Internal Resource Mapping
nc...
I
cale Semiconductor,
Frees
5.5.5 Program space expansion
On the MC68HC912DG128, the register space window consists of a 4byte register block. One of four pages is viewed through this window for
each of the 32K flash module register blocks of MC68HC912DG128.
The test mode program page win dow consis t s of 32K Flash EEPR OM
bytes. One of the four 32K byte arrays is vie wed through this windo w for
a total 128K accessible Flash EEPROM bytes. This window is only
available in special mode for test purposes and replaces the user’s
program page window.
MC68HC912DG128 has a five pin port, Port K, for emulation and for
general purpose I/O. Three pins are used to emulate the three page
indices (PPAGE bits) and one pin is used as an emulation chip select.
When these four pins are not used for emulation they serve as general
purpose I/O pins. The fifth Port K pin is used as a general purpose I/O
pin.
There are 128K bytes of Flash EEPROM. With a 64K byte address
space, the PPAGE register is needed to perform on-chip memory
expansion. A program space window of 16K byte pages is located from
$8000 to $BFFF. Three page indices are used to point to one of eight
different 16K byte pages. They can be viewed as expanded addresses
x16, x15 and x14.
* The 16K byte program space page 6 can also be accessed at a fixed
location from $4000 to $7FFF. The 16K byte program space page 7 can
also be accessed at a fixed location from $C000 to $FFFF.
5.5.6 Flash register space expansion
There are four 32K Flash arrays for MC68HC912DG128 and each
requires a 4-byte register block. A register space window is used to
access one of the four 4-byte blocks and the PPAGE register to map
each one into th e window. The register space window is located from
$00F4 to $00F7 after reset. Only two page indices are used to point to
one of the four pages of the register space.
In special mode and for test purposes only, the 128K bytes of Flash
EEPROM can be accesse d through a test prog ram space window of 3 2K
bytes. This window replaces the user’s program space window to be
able to access an entire array. In special mode and with ROMTST bit set
in MISC register, a program space is located from $8000 to $FFFF. Only
two page indices are used to point to one of the four 32K byte arrays.
They can be viewed as expanded addresses X16 and X15.
Read and write anytime
Writing to the port does not change the pin states when it is configured
for page index emulation output.
This port is associated with the page index emulation pins. When the
port is not enabled to emulate page index, the port pins are used as
general-purpose I/O. Port K bit 3 is always a general purpose I/O pin.
This register i s not in the mem ory map in peripheral or expanded mo des
when the EMK control bit in MODE register is set.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes87
For More Information On This Product,
Go to: www.freescale.com
Operating Modes
Freescale Semiconductor, Inc.
When selected as inputs, these pins can be configured to be high
impedance or pulled up.
ECS — Emulation Chip Select of selected program space
When this signal is active low it indicates that the program space is
accessed. This also applies to test mode program spa ce. A n access
is made if an ad dr ess is in th e program space window an d ei the r the
Flash or external memory is accessed. The ECS timing is E clock high
and can be stretched when accessing external memory depending on
the EXTR0 and EXTR1 bits in the MISC register. The ECS signal is
only active when the EMK bit is set.
nc...
I
PIX[2:0] — The content of the PPAGE register emulated externally.
This content indicates which Flash module register space is in the
memory map and which 16K byte Flash memory is in the program
space. In special mode and with ROMTST bit set, the content of the
Page Index regi ster indicates whic h 32K byte Fl ash array is in the test
program space.
DDRK — Port K Data Direction Register$00FD
Bit 7654321Bit 0
DDK7000DDK3DDK2DDK1DDK0
RESET:00000000
cale Semiconductor,
Read and write: anytime.
This register determines the primary direction for each port K pin
configured as general-purpose I/O.
Frees
0 = Associated pin is a high-impedance input.
1 = Associated pin is an output.
This register is n ot in the map in peri pheral or expanded mo des when the
EMK control bi t is set.
Technical DataMC68HC912DG128 — Rev 3.0
88Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
PPAGE — (Program) Page Index Register$00FF
Bit 7654321Bit 0
00000PIX2PIX1PIX0
RESET:00000000
Operating Modes
Internal Resource Mapping
Read and write: anytime.
This register determines the active page viewed through
MC68HC912DG128 windows.
CALL and RTC instructions have a special single wire mechanism to
nc...
I
read and write this register without using an addre ss bus.
5.5.9 Miscella neous System Control Register
Additional mapping and external resource controls are available. To use
external resources the part must be operated in one of the expanded
modes.
MISC — Miscellaneous Mapping Control Register$0013
Bit 7654321Bit 0Mode
ROMTSTNDRFRFSTR1RFSTR0EXSTR1EXSTR0ROMHMROMON
RESET:00001100Exp mode
RESET:00001101
cale Semiconductor,
Normal modes: write once; Special modes: write anytime. Read
anytime.
Frees
ROMTST — FLASH EEPROM Test mode
In normal modes, this bit is forced to zero.
0 = 16K window for Flash memory is located from $8000–$BFFF
1 = 32K window for Flash memory is located from $8000–$FFFF
peripheral or
SC mode
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes89
For More Information On This Product,
Go to: www.freescale.com
Operating Modes
nc...
I
Freescale Semiconductor, Inc.
NDRF — Narrow Data Bus for Register-Following Map Space
This bit enables a narrow bus feature for the 1K 512 byte RegisterFollowing Map. This is useful for accessing 8-bit peripherals and
allows 8-bit and 16-bit external memory devices to be mixed in a
system. In Expanded Narrow (eight bit) modes, Single Chip Modes,
and Peripheral mode, this bit has no effect.
0 = Makes Register-Follow ing MAP space act as a full 16 bit data bus.
1 = Makes the Register-Following MAP space act the same as an 8
bit only external data bus (data only goes through port A externally).
The Register-Following space is mapped from $0400 to $07FF after
reset, which is next to the register map. If th e registers are moved this
space follows.
cale Semiconductor,
Frees
RFSTR1, RFSTR0 — Register Following Stretch
This two bit field determines th e amount of clock str etch on accesses
to the 1K byte Register Following Map. It is valid regardless of the
state of the NDRF bit. In Single Chip and Peripheral Modes this bit
has no meaning or effect.
Table 5-6. RFSTR Stretch Bit Definition
RFSTR1RFSTR0
000
011
102
113
Number of E Clocks
Stretched
Technical DataMC68HC912DG128 — Rev 3.0
90Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
EXSTR1, EXSTR0 — External Access Stretch
This two bit field determines th e amount of clock str etch on accesses
to the External Addre ss Space. In S ingle Ch ip and Per ipheral Modes
this bit has no meaning or effect .
Operating Modes
Internal Resource Mapping
Table 5-7. EXSTR Stretch Bit Definition
nc...
I
cale Semiconductor,
Frees
EXSTR1EXSTR0
000
011
102
113
ROMHM — FLASH EEPROM only in second Half of Map
This bit has no mea ning if ROMON bit is clear.
0 = The 16K byte of fixed Flash EEPROM in location $4000–$7FFF
can be accessed.
1 = Disables direct access to 16K byte Flash EEPROM from
$4000–$7FFF in the memo ry ma p. The ph ysica l loca tion of
this16K byte Flash can still be accessed through the Program
Page window.
In special mode, with ROMTST bit set, this bit will allow overlap of the
four 32K Flash EEPROM arrays and overlap the four 4-byte Flash
register space in the same map space to be able to program all arrays
at the same time.
0 = The four 32K Flash arrays are accessed with four pages for
each.
1 = The four 32K Flash arrays coi ncide in th e same sp ace and a re
selected at the same time for programmin g.
Number of E Clocks
Stretched
CAUTION:Bit must be cleared before reading any of the arrays or registers.
ROMON — Enable FLASH EEPROM
These bits are used to enable the Flash EEPROM
0 = Disables Flash EEPRO M in the mem o ry ma p.
1 = Enables Flash EEPROM in the memory map.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes91
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Operating Modes
5.5.10 Mapping test registers
These registers are u sed for testing the m apping logic. They ca n only be
read and after each read they get cleare d. A write to each register will
have no effect.
MTST0 — Mapping Test Register 0$00F8
Bit 7654321Bit 0
MT07MT06MT05MT04MT03MT02MT01MT00
RESET:00000000
MTST1 — Mapping Test Register 1$00F9
nc...
I
RESET:00000000
Bit 7654321Bit 0
MT0FMT0EMT0DMT0CMT0BMT0AMT09MT08
MTST2 — Mapping Test Register 2$00FA
Bit 7654321Bit 0
RESET:00000000
MTST3 — Mapping Test Register 3$00FB
RESET:00000000
MT17MT16MT15MT14MT13MT12MT11MT10
Bit 7654321Bit 0
MT1FMT1EMT1DMT1CMT1BMT1AMT19MT18
cale Semiconductor,
Frees
Technical DataMC68HC912DG128 — Rev 3.0
92Operating ModesMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
5.6 Memory Maps
Freescale Semiconductor, Inc.
Operating Modes
Memory Maps
The following diagrams illustrate the memory map for each mode of
operation immediately after reset.
$0000
$03FF
$0000
$0400
$0800
$1000
$2000
nc...
I
cale Semiconductor,
$4000
$8000
$C000
$FF00
$FFFF
SINGLE CHIP
EXT
VECTORSVECTORSVECTORS
EXPANDEDNORMAL
SPECIAL
SINGLE CHIP
$0800
$0FFF
$2000
$3FFF
$4000
$8000
$BFFF
$C000
$FFFF
$FF00
$FFFF
REGISTERS
(MAPPABLE TO ANY 2K SPACE)
2K bytes EEPROM
(MAPPABLE TO ANY 4K SPACE)
8K bytes RAM
(MAPPABLE TO ANY 8K SPACE)
16K Fixed Flash EEPROM
16K Page Window
Eight 16K Flash EEPROM pages
$A000 - $BFFF Protected BOOT
at odd programing pages
16K Fixed Flash EEPROM
$E000 - $FFFF Protected BOOT
BDM
(if active)
Frees
Figure 5-1. Memory Map after reset
The following diagram illustrates the memory paging scheme.
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLAOperating Modes93
For More Information On This Product,
Go to: www.freescale.com
Operating Modes
$0000
$0400
$0800
$1000
$2000
Freescale Semiconductor, Inc.
$4000
nc...
I
$8000
$C000
$E000
$FF00
$FFFF
cale Semiconductor,
6
16K Flash
(Paged)
7
(8K Boot)
VECTORS
NORMAL
SINGLE CHIP
16K Flash
(Unpaged)
16K Flash
(Unpaged)
One 16K Page accessible at a time (selected by PPAGE value = 0 to 7)
00 Flash 32K
0
1234567
(8K Boot)(8K Boot)(8K Boot)(8K Boot)
01 Flash 32K10 Flash 32K11 Flash 32K *
* This 32K Flash
accessible as
pages 6 & 7 and
as unpaged
$4000 - $7FFF &
$C000 - $FFFF
Internally the MC68HC912DG128 has full 16-bit data paths, but
depending upon the operating mode and control registers, the external
multiplexed bus may be 8 or 16 bits. Ther e ar e cases wh ere 8- bi t and
16-bit accesses can appear on adjace nt cycles u sing the LSTRB signal
to indicate 8- or 16-bit data.
It is possible to have a mix of 8 and 16 bit peripherals attached to the
external multiplexed bus, using the NDRF bit in the MISC register while
in expanded wide modes.
cale Semiconductor,
6.3 Detecting Access Type from External Signals
Frees
The external signals L STRB, R/W, and A0 can be used to determin e the
type of bus access that is taking place. Accesses to the internal RAM
module are the only type of access that produce LSTRB =A0=1,
because the internal RAM is specifically designed to allow misaligned
16-bit accesses in a single cycle. In these cases the data for the address
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLABus Control and Input/Output95
For More Information On This Product,
Go to: www.freescale.com
Bus Control and Input/Output
that was accessed is on the low half of the data bus and the data for
address + 1 is on the high half of the data bus.
nc...
I
Freescale Semiconductor, Inc.
Figure 6-1. Access Type vs. Bus Control Pins
LSTRBA0R/WType of Access
1018-bit read of an even address
0118-bit read of an odd address
1008-bit write of an even address
0108-bit write of an odd address
00116-bit read of an even address
111
00016-bit write to an even address
110
16-bit read of an odd address
(low/high data swapped)
16-bit write to an even address
(low/high data swapped)
6.4 Registers
cale Semiconductor,
Frees
Not all registers are visible in the MC68HC912DG128 memory map
under certain conditi ons. In special peripheral mode the first 16 registe rs
associated with bus expansion are removed from the memory map.
In expanded modes, some or all of port A, port B, and port E are used
for expansion buses and control signals. In order to allow emulation of
the single-chip functions of these ports, some of these registers must be
rebuilt in an external port replacement unit. In any expanded mode, port
A, and port B, are used for ad dress and data lin es so regist ers for t hese
ports, as well as t he data direction registers for these ports, are removed
from the on-chip memory map and become external accesses.
In any expanded mode, port E pins m ay be needed for bus contro l (e.g.,
ECLK, R/W). To regain the single-chip functions of port E, the emulate
port E (EME) control bit in the MODE register may be set. In this special
case of expanded mo de and EME se t, PORTE and DDRE re gisters ar e
removed from the on-chip memory map and become external accesses
so port E may be rebuilt externally.
Technical DataMC68HC912DG128 — Rev 3.0
96Bus Control and Input/OutputMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Bit 7654321Bit 0
Single ChipPA7PA6PA5PA4PA3PA2PA1PA0
RESET:————————
Bus Control and Input/Output
Registers
Expanded
& Periph:
Expanded
narrow
PORTA — Port A Register$0000
nc...
I
ADDR15/
DATA15
ADDR15/
DATA15/
DATA7
ADDR14/
DATA14
ADDR14/
DATA14/
DATA6
ADDR13/
DATA13
ADDR13/
DATA13/
DATA5
ADDR12/
DATA12
ADDR12/
DATA12/
DATA4
ADDR11/
DATA11
ADDR11/
DATA11/
DATA3
ADDR10/
DATA10
ADDR10/
DATA10/
DATA2
ADDR9/
DATA9
ADDR9/
DATA9/
DATA1
ADDR8/
DATA8
ADDR8/
DATA8/
DATA0
Bits PA[7:0] are associated respectively with addresses ADDR[15:8],
DATA[15:8] and DATA[7 :0], in n arrow mo de. When this port i s not used
for external addresses such as in single-chip mode, these pins can be
used as general-purpose I/O. DDRA determines the primary directio n of
each pin. This regis ter is not in the on-chip map in ex panded and
peripheral modes. Read and write anytime.
Bit 7654321Bit 0
DDA7DDA6DDA5DDA4DDA3DDA2DDA1DDA0
RESET:00000000
DDRA — Port A Data Direction Register$0002
cale Semiconductor,
This register determines the primary direction for each port A pin when
functioning as a general-purpose I/O port. DDRA is not in the on-chip
Frees
map in expanded and peripheral modes. Read and write anytime.
0 = Associated pin is a high-impedance input
1 = Associated pin is an output
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLABus Control and Input/Output97
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Bus Control and Input/Output
Bit 7654321Bit 0
Single ChipPB7PB6PB5PB4PB3PB2PB1PB0
RESET:————————
Expanded
& Periph:
Expanded
narrow
PORTB — Port B Register$0001
nc...
I
ADDR7/
DATA7
ADDR7ADDR6ADDR5ADDR4ADDR3ADDR2ADDR1ADDR0
ADDR6/
DATA6
ADDR5/
DATA5
ADDR4/
DATA4
ADDR3/
DATA3
ADDR2/
DATA2
ADDR1/
DATA1
ADDR0/
DATA0
Bits PB[7:0] are associated with addresses ADDR[7:0] an d DATA[7:0]
(except in narrow mode) respectively. When this port is not used for
external addresses such as in single-chip mode, these pins can be used
as general-purpose I/O. DDRB determines the primary direction of each
pin. This register is not in the on-chip map in expanded and peripheral
modes. Read and write anyti me .
Bit 7654321Bit 0
DDB7DDB6DDB5DDB4DDB3DDB2DDB1DDB0
RESET:00000000
DDRB — Port B Data Direction Register$0003
cale Semiconductor,
This register determines the primary direction for each port B pin when
functioning as a general-purpose I/O port. DDRB is not in the on-chip
Frees
map in expanded and peripheral modes. Read and write anytime.
0 = Associated pin is a high-impedance input
1 = Associated pin is an output
Technical DataMC68HC912DG128 — Rev 3.0
98Bus Control and Input/OutputMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
BIT 7654321BIT 0
PE7PE6PE5PE4PE3PE2PE1PE0
RESET:————————
or
Alt. Pin
Function
PORTE — Port E Register$0008
DBE
ECLK or
CAL
MODB or
IPIPE1 or
CGMTST
MODA or
IPIPE0
ECLK
LSTRB or
TAGLO
Bus Control and Input/Output
R/WIRQXIRQ
This register is associated with exte rnal bus control signals and interr upt
nc...
I
inputs, including data bus enable (DBE), mode select (MODB/IPIPE1,
MODA/IPIPE0), E clock, size (LSTRB), read/write (R/W), IRQ, and
XIRQ. When the associated pin is not used for one of these specific
functions, the pin can be used as general-purpose I/O. The port E
assignment register (PEAR) selects the function of each pin. DDRE
determines the primary direction of each port E pin when configured to
be general-purpose I/O.
Some of these pi ns have software selectable pull-ups (DBE, LSTRB,
R/W, IRQ, and XIRQ). A single control bit enables the pull-ups for all
these pins which are configured as inputs.
This register is not in the map in peripheral mode or expanded modes
when the EME bit is set.
cale Semiconductor,
Read and write anytime.
Registers
Frees
MC68HC912DG128 — Rev 3.0Technical Data
MOTOROLABus Control and Input/Output99
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Bus Control and Input/Output
Bit 7654321Bit 0
DDE7DDE6DDE5DDE4DDE3DDE200
RESET:00000000
DDRE — Port E Data Direction Register$0009
This register determines the primary direction for each port E pin
configured as general-purpose I/O.
0 = Associated pin is a high-impedance input
nc...
I
1 = Associated pin is an output
PE[1:0] are associated with XIRQ and IRQ and cannot be configured as
outputs. These pins can be read regardless of whether the alternate
interrupt functions are enabled.
This register is not in th e map in peripher al mode and expanded m odes
while the EME control bit is set.
Read and write anytime.
BIT 7654321BIT 0
NDBECGMTEPIPOENECLKLSTRERDWECALEDBENE
cale Semiconductor,
RESET:00000000
RESET:00101100
Frees
RESET:11010000Peripheral
RESET:10010000
RESET:00101100
PEAR — Port E Assignment Register$000A
Normal
Expanded
Special
Expanded
Normal
single chip
Special
single chip
The PEAR register is used to choose between th e ge nera l-purpo se I/O
functions and the alternate bus control functions of Port E. When an
Technical DataMC68HC912DG128 — Rev 3.0
100Bus Control and Input/OutputMOTOROLA
For More Information On This Product,
Go to: www.freescale.com
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.