Motorola reserves the right to make changes without further notice to any products herein to improve reliability, function or
design. Motorola does not assume any liability arising out of the application or use of any product or circuit described herein;
neither does it convey any license under its patent rights nor the rights of others. Motorola products 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 application in which the failure of the Motorola product could create a situation where
personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized
application,Buyershallindemnify andhold Motorolaand itsofficers, employees,subsidiaries, affiliates,and distributorsharmless
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 regarding the design or manufacture of the part.
1
Revision History
Version
Number
V01.00
V01.01
V01.02
V01.03
V01.04
V01.05
Revision
Date
16 NOV
2001
18 FEB
2002
6 MAR
2002
4 June
2002
4 July
2002
30 July
2002
Effective
Date
19 NOV
2001
18 FEB
2002
6 MAR
2002
4 June
2002
4 July
2002
30 July
2002
AuthorDescription of Changes
Initial version based on MC9SDP256-2.09 Version.
In table 7 I/O Characteristics" of the electrical characteristics
Table "Oscillator Characteristics":removed "Oscillator start-up time
from POR or STOP" row
Table "5V I/O Characteristics": Updated
Partial Drive IOH = +–2mA and Full Drive IOH = –10mA
Table "ATD Operating Characteristics": Distinguish I
ATD blocks on
Table "ATD Electrical Characteristics": Update C
Table "Operating Conditions": Changed V
(min)
Removed Document number except from Cover Sheet
Updated Table "Document References"
Table "5V I/O Characteristics" : Corrected Input Capacitance to 6pF
Section: "Device Pinout" (112-pin and 80-pin): added in diagrams
RXCAN0 to PJ6 and TXCAN0 to PJ7
Table "PLL Characteristics": Updated parameters K
Figure "Basic PLL functional diagram": Inserted XFC pin in diagram
Enhanced section "XFC Component Selection"
Added to SectionsATD,ECT and PWM: freeze mode = active BDM
mode
Added 1L86D to Table "Assigned Part ID numbers"
Corrected MEMSIZ1 value in Table "Memory size registers"
Subsection "Device Memory Map: Removed Flash mapping from
$0000 to $3FFF.
Table "Signal Properties": Added column "Internal Pull Resistor".
Preface Table "Document References": Changed to full naming for
each block.
Table "Interrupt Vector Locations", Column "Local Enable":
Corrected several register and bit names.
Figure "Recommended PCB Layout for 80QFP: Corrected
VREGEN pin position
Thermal values for junction to board and package
BGND pin pull-up
Part Order Information
Global Register Table
Chip Configuration Summary
Modified mode of Operations chapter
Section "Printed Circuit Board Layout Proposals": added Pierce
Oscillator examples for 112LQFP and 80QFP
->Table "Supply Current Characteristics":
changed max Run IDD from 65mA to 50mA
changes max Wait IDD from 40mA to 30mA
changed max Stop IDD from 50uA to 100uA
Section HCS12 Core Block Description: mentioned alternate clock
of BDM to be equivalent to oscillator clock
Table "5V I/O Characteristics": Corrected Input Leakage Current to
+/- 1 uA
Section "Part ID assignment": Located on start of next page for
better readability
Added MC9S12A64 derivative to cover sheet and "Derivative
Differences" Table
Corrected in footnote of Table "PLL Characteristics": f
Renamed "Preface" section to "Derivative Differences and
Document references". Added details for derivatives missing CAN0
and/or BDLC
Table"ESD and Latch-upTest Conditions":changed pulse numbers
from 3 to 1
Table "ESD and Latch-Up Protection Characteristics": changed
parameter classification from C to T
Table "5V I/O Characteristics": removed foot note from "Input
Leakage Current"
Table " Supply Current Characteristics": updated Stop and Pseudo
Stop currents
Subsection "Detailed Register Map": Corrected several entries
Subsection "Unsecuring the Microcontroller": Added more details
Table "Operating Conditions": improved footnote 1 wording, applied
footnote 1 to PLL Supply Voltage.
Tables "SPI Master/Slave Mode Timing Characteristics: Corrected
Operating Frequency
Appendix ’NVM, Flash and EEPROM’: Replaced ’burst
programming’ by ’row programming
Table "Operating Conditions": corrected minimum bus frequency to
0.25MHz
Section "Feature List": ECT features changed to "Four pulse
accumulators ..."
Replaced references to HCS12 Core Guide by the individual
HCS12 Block guides
Table "Signal Properties" corrected pull resistor reset state for PE7
and PE4-PE2.
Table "Absolute Maximum Ratings" corrected footnote on clamp of
TEST pin.
Added cycle definition to "CPU 12 Block Description".
Added register reset values to MMC and MEBI block descriptions.
Diagram "Clock Connections": Connect Bus Clock to HCS12 Core
OSC
= 4MHz
3
MC9S12DJ64 Device User Guide — V01.17
Version
Number
V01.15
V01.16
V01.17
Revision
Date
22 July
2003
24 Feb.
2004
21 May
2004
Effective
Date
22 July
2003
24 Feb.
2004
21 May
2004
AuthorDescription of Changes
Mentioned "S12 LRAE" bootloader in Flash section
Section Document References: corrected S12 CPU document
reference
Added 3L86D maskset with corresponding Part ID
Table Oscillator Characteristics: Added more details for EXTAL pin
Added 4L86D maskset with corresponding Part ID
Table "MC9S12DJ64 Memory Mapout of Reset": corrected$1000 $3fff memory in single chip modes to "unimplemented".
The following items should be considered when using a derivative.
•Registers
–Do not write or read CAN0 registers (after reset: address range $0140 - $017F), if using a
derivative without CAN0 (see Table 0-1).
–Do not write or read BDLC registers (after reset: address range $00E8 - $00EF), if using a
derivative without BDLC (see Table 0-1).
•Interrupts
–Fill the four CAN0 interrupt vectors ($FFB0 - $FFB7) according to your coding policies for
unused interrupts, if using a derivative without CAN0 (see Table 0-1).
Temperature Options
C = -40˚C to85˚C
V = -40˚C to 105˚C
M = -40˚C to 125˚C
Package Options
FU = 80QFP
PV = 112LQFP
–Fill the BDLC interrupt vector ($FFC2, $FFC3) according to your coding policies for unused
interrupts, if using a derivative without BDLC (see Table 0-1).
•Ports
15
MC9S12DJ64 Device User Guide — V01.17
–The CAN0 pin functionality (TXCAN0, RXCAN0) is not available on port PJ7, PJ6, PM5,
PM4, PM3, PM2, PM1 and PM0, if using a derivative without CAN0 (see Table 0-1).
–The BDLC pin functionality (TXB, RXB) is not available on port PM1 and PM0, if using a
derivative without BDLC (see Table 0-1).
–Do not write MODRR1 and MODRR0 Bit of Module Routing Register (PIM_9DJ64 Block
User Guide), if using a derivative without CAN0 (see Table 0-1).
•Pins not available in 80 pin QFP package
–Port H
In order to avoid floating nodes the ports should be either configured as outputs by setting the
data direction register (DDRH at Base+$0262) to $FF, or enabling the pull resistors by writing
a $FF to the pull enable register (PERH at Base+$0264).
–Port J[1:0]
PortJpull-up resistors areenabled out ofreseton all fourpins(7:6 and1:0).Therefore care must
be taken not to disable the pull enables on PJ[1:0] by clearing the bits PERJ1 and PERJ0 at
Base+$026C.
–Port K
Port K pull-up resistors are enabled out of reset, i.e. Bit 7 = PUKE = 1 in the register PUCR at
Base+$000C. Therefor care must be taken not to clear this bit.
–Port M[7:6]
PM7:6 must be configured as outputs or their pull resistors must be enabled to avoid floating
inputs.
–Port P6
PP6 must be configured as output or its pull resistor must be enabled to avoid a floating input.
–Port S[7:4]
PS7:4 must be configured as outputs or their pull resistors must be enabled to avoid floating
inputs.
–PAD[15:8] (ATD1 channels)
Out ofresetthe ATD1 is disabledpreventingcurrent flows in the pins.Donot modify the ATD1
registers!
Document References
The Device User Guide providesinformationabouttheMC9S12DJ64 device made up of standard HCS12
blocks and the HCS12 processor core.
This document is part of the customer documentation. A complete set of device manuals also includes all
the individual Block Guides of the implemented modules. In a effort to reduce redundancy all module
specific information is located only in the respective Block Guide. If applicable, special implementation
details of the module are given in the block description sections of this document.
See Table 0-2 for names and versions of the referenced documents throughout the Device User Guide.
16
MC9S12DJ64 Device User Guide — V01.17
Table 0-2 Document References
User Guide
HCS12 CPU Reference ManualV02S12CPUV2/D
HCS12 Module Mapping Control (MMC) Block GuideV04S12MMCV4/D
HCS12 Multiplexed External Bus Interface (MEBI) Block GuideV03S12MEBIV3/D
Clock and Reset Generator (CRG) Block User GuideV04S12CRGV4/D
Oscillator (OSC) Block User GuideV02S12OSCV2/D
Enhanced Capture Timer 16 Bit 8 Channel (ECT_16B8C) Block User GuideV01S12ECT16B8CV1/D
Analog to Digital Converter 10 Bit 8 Channel (ATD_10B8C) Block User GuideV02S12ATD10B8CV2/D
Inter IC Bus (IIC) Block User GuideV02S12IICV2/D
Asynchronous Serial Interface (SCI) Block User GuideV02S12SCIV2/D
Serial Peripheral Interface (SPI) Block User GuideV02S12SPIV2/D
Pulse Width Modulator 8 Bit 8 Channel (PWM_8B8C) Block User GuideV01S12PWM8B8CV1/D
64K Byte Flash (FTS64K) Block User GuideV01S12FTS64KV1/D
1K Byte EEPROM (EETS1K) Block User GuideV01S12EETS1KV1/D
Byte Level Data Link Controller -J1850 (BDLC) Block User GuideV01S12BDLCV1/D
Motorola Scalable CAN (MSCAN) Block User GuideV02S12MSCANV2/D
Voltage Regulator (VREG) Block User GuideV01S12VREGV1/D
Port Integration Module (PIM_9DJ64) Block User GuideV01S12PIM9DJ64V1/D
Versi
on
Document Order Number
17
MC9S12DJ64 Device User Guide — V01.17
18
MC9S12DJ64 Device User Guide — V01.17
Section 1 Introduction
1.1 Overview
The MC9S12DJ64 microcontroller unit (MCU) is a 16-bit device composed of standard on-chip
peripherals including a 16-bit central processing unit (HCS12 CPU), 64K bytes of Flash EEPROM, 4K
bytes of RAM, 1K bytes of EEPROM, two asynchronous serial communications interfaces (SCI), one
serial peripheral interfaces (SPI), an 8-channel IC/OC enhanced capture timer, two 8-channel, 10-bit
analog-to-digital converters(ADC),an 8-channel pulse-width modulator(PWM),a digital Byte Data Link
Controller (BDLC), 29 discrete digital I/O channels (Port A, Port B, Port K and Port E), 20 discrete digital
I/O lines with interrupt and wakeup capability, a CAN 2.0 A, B software compatible modules
(MSCAN12), and an Inter-IC Bus. The MC9S12DJ64 has full 16-bit datapaths throughout. However, the
external bus can operate in an 8-bit narrow mode so single 8-bit wide memory can be interfaced for lower
cost systems. The inclusion of a PLL circuit allows power consumption and performance to be adjusted to
suit operational requirements.
1.2 Features
•HCS12 Core
–16-bit HCS12 CPU
i. Upward compatible with M68HC11 instruction set
ii. Interrupt stacking and programmer’s model identical to M68HC11
iii.Instruction queue
•1M bit per second, CAN 2.0 A, B software compatible module
–Five receive and three transmit buffers
–Flexible identifier filter programmable as 2 x 32 bit, 4 x 16 bit or 8 x 8 bit
–Four separate interrupt channels for Rx, Tx, error and wake-up
–Low-pass filter wake-up function
–Loop-back for self test operation
•Enhanced Capture Timer
–16-bit main counter with 7-bit prescaler
–8 programmable input capture or output compare channels
–Four 8-bit or two 16-bit pulse accumulators
•8 PWM channels
–Programmable period and duty cycle
–8-bit 8-channel or 16-bit 4-channel
–Separate control for each pulse width and duty cycle
–Center-aligned or left-aligned outputs
–Programmable clock select logic with a wide range of frequencies
–Fast emergency shutdown input
–Usable as interrupt inputs
•Serial interfaces
–Two asynchronous Serial Communications Interfaces (SCI)
–Synchronous Serial Peripheral Interface (SPI)
•Byte Data Link Controller (BDLC)
–SAE J1850 Class B Data Communications Network Interface Compatible and ISO Compatible
for Low-Speed (<125 Kbps) Serial Data Communications in Automotive Applications
•Inter-IC Bus (IIC)
–Compatible with I2C Bus standard
–Multi-master operation
–Software programmable for one of 256 different serial clock frequencies
•112-Pin LQFP or 80 QFP package
20
–I/O lines with 5V input and drive capability
–5V A/D converter inputs
–Operation at 50MHz equivalent to 25MHz Bus Speed
–Development support
–Single-wire background debug™ mode (BDM)
–On-chip hardware breakpoints
•Special Operating Modes
–Special Single-Chip Mode with active Background Debug Mode
–Special Test Mode (Motorola use only)
–Special Peripheral Mode (Motorola use only)
Low power modes
•Stop Mode
•Pseudo Stop Mode
•Wait Mode
21
MC9S12DJ64 Device User Guide — V01.17
1.4 Block Diagram
Figure 1-1 shows a block diagram of the MC9S12DJ64 device.
22
MC9S12DJ64 Device User Guide — V01.17
Figure 1-1 MC9S12DJ64 Block Diagram
VDDR
VSSR
VREGEN
VDD1,2
VSS1,2
BKGD
XFC
VDDPLL
VSSPLL
EXTAL
XTAL
RESET
PE0
PE1
PE2
PE3
PE4
PE5
PE6
PE7
TEST
Multiplexed
Wide Bus
Multiplexed
Narrow Bus
Internal Logic 2.5V
VDD1,2
VSS1,2
PLL 2.5V
VDDPLL
VSSPLL
64K Byte Flash EEPROM
4K Byte RAM
1K Byte EEPROM
Voltage Regulator
Single-wire Background
Debug Module
Clock and
Reset
PLL
Generation
Module
XIRQ
IRQ
W
R/
LSTRB
DDRE
ECLK
MODA
MODB
NOACC/
XCLKS
PTE
Multiplexed Address/Data Bus
DDRADDRB
PTAPTB
PA4
PA3
PA2
PA1
ADDR11
ADDR10
ADDR9
DATA11
DATA10
DATA9
DATA3
DATA2
DATA1
PA0
ADDR8
DATA8
DATA0
PA7
PA6
PA5
ADDR15
ADDR14
ADDR13
DATA15
DATA14
DATA13
DATA7
DATA6
DATA5
ADDR12
DATA12
DATA4
I/O Driver 5V
VDDX
VSSX
A/D Converter 5V &
Voltage Regulator Reference
VDDA
VSSA
Voltage Regulator 5V & I/O
VDDR
VSSR
CPU12
Periodic Interrupt
COP Watchdog
Clock Monitor
Breakpoints
System
Integration
PB4
PB3
PB5
ADDR4
ADDR5
DATA4
DATA5
PB2
ADDR3
ADDR2
DATA3
DATA2
PB7
PB6
ADDR7
ADDR6
DATA7
DATA6
PB1
PB0
ADDR1
ADDR0
DATA1
DATA0
AN0
AN1
AN2
AN3
AN4
AN5
AN6
AN7
VRH
VRL
VDDA
VSSA
AD0
ATD0
PPAGE
Enhanced Capture
Timer
SCI0
SCI1
MISO
MOSI
SPI0
BDLC
(J1850)
CAN0
IIC
PWM
SCK
SS
RXB
TXB
RXCAN
TXCAN
SDA
SCL
PWM0
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
PWM7
ATD1
PAD00
PAD01
PAD02
PAD03
PAD04
PAD05
PAD06
PAD07
AN0
AN1
AN2
AN3
AN4
AN5
AN6
AN7
PIX0
PIX1
PIX2
PIX3
PIX4
PIX5
ECS
IOC0
IOC1
IOC2
IOC3
IOC4
IOC5
IOC6
IOC7
RXD
TXD
RXD
TXD
Module to Port Routing
KWJ0
KWJ1
KWJ6
KWJ7
KWP0
KWP1
KWP2
KWP3
KWP4
KWP5
KWP6
KWP7
KWH0
KWH1
KWH2
KWH3
KWH4
KWH5
KWH6
KWH7
VRH
VRL
VDDA
VSSA
DDRK
DDRT
DDRS
DDRM
DDRJ
DDRP
DDRH
AD1
PTK
PTT
PTS
PTM
PTJ
PTP
PTH
VRH
VRL
VDDA
VSSA
PAD08
PAD09
PAD10
PAD11
PAD12
PAD13
PAD14
PAD15
PK0
PK1
PK2
PK3
PK4
PK5
PK7
PT0
PT1
PT2
PT3
PT4
PT5
PT6
PT7
PS0
PS1
PS2
PS3
PS4
PS5
PS6
PS7
PM0
PM1
PM2
PM3
PM4
PM5
PM6
PM7
PJ0
PJ1
PJ6
PJ7
PP0
PP1
PP2
PP3
PP4
PP5
PP6
PP7
PH0
PH1
PH2
PH3
PH4
PH5
PH6
PH7
XADDR14
XADDR15
XADDR16
XADDR17
XADDR18
XADDR19
ECS
Signals shown in Bold are not available on the 80 Pin Package
23
MC9S12DJ64 Device User Guide — V01.17
24
MC9S12DJ64 Device User Guide — V01.17
1.5 Device Memory Map
Table 1-1 and Figure 1-2 show the device memory map of the MC9S12DJ64 after reset. The 1K
EEPROM is mapped twice in a 2K address space. Note that after reset the bottom 1k of the EEPROM
($0000 - $03FF) are hidden by the register space, and the 1K $0400 - $07FF is hidden by the RAM.