Freescale MC9S12D64, MC9S12A64 User Guide

MC9S12DJ64
Device User Guide
V01.17
Covers also
MC9S12D64, MC9S12A64
DOCUMENT NUMBER
9S12DJ64DGV1/D
Original Release Date: 19 Nov. 2001
Revised: 21 May 2004
Motorola, Inc.
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.

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
Author Description of Changes
Initial version based on MC9SDP256-2.09 Version. In table 7 I/O Characteristics" of the electrical characteristics
replaced tPULSEwith tpign andtpval inlines "Port ...Interrupt Input Pulse filtered" and "Port ... Interrupt Input Pulse passed" respectively.
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
DD
and V
REF
to 22 pF
INS
DDPLL
1
for 1 and 2
to 2.35 V
and f
1
MC9S12DJ64 Device User Guide — V01.17
Version Number
V01.06
V01.07
V01.08
V01.09
V01.10
V01.11
V01.12
V01.13
V01.14
Revision
Date
20 Aug.
2002
20 Sept.
2002
25 Sept.
2002
10 Oct.
2002
8 Nov.
2002
24 Jan.
2003
31 Mar.
2003
20 May
2003
10 June
2003
Effective
Date
20 Aug.
2002
20 Sept.
2002
25 Sept.
2002
10 Oct.
2002
8 Nov.
2002
24 Jan.
2003
31 Mar.
2003
20 May
2003
10 June
2003
Author Description of Changes
NVM electricals updated Subsection "Detailed Register Map: Address corrections Preface, Table "Document references": added OSC User Guide New section "Oscillator (OSC) Block Description"
Electrical Characteristics:
-> Section "General": removed preliminary disclaimer
->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
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
Author Description 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".
MC9S12DJ64 Device User Guide — V01.17

Table of Contents

Section 1 Introduction
1.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
1.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
1.3 Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
1.4 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
1.5 Device Memory Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
1.5.1 Detailed Register Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
1.6 Part ID Assignments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
Section 2 Signal Description
2.1 Device Pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
2.2 Signal Properties Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51
2.3 Detailed Signal Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
2.3.1 EXTAL, XTAL — Oscillator Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
2.3.2 RESET — External Reset Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
2.3.3 TEST — Test Pin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
2.3.4 VREGEN — Voltage Regulator Enable Pin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
2.3.5 XFC — PLL Loop Filter Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
2.3.6 BKGD / TAGHI / MODC — Background Debug, Tag High, and Mode Pin . . . . . . . .54
2.3.7 PAD15 / AN15 / ETRIG1 — Port AD Input Pin of ATD1 . . . . . . . . . . . . . . . . . . . . . .55
2.3.8 PAD[14:08] / AN[14:08] — Port AD Input Pins ATD1 . . . . . . . . . . . . . . . . . . . . . . . .55
2.3.9 PAD07 / AN07 / ETRIG0 — Port AD Input Pin of ATD0 . . . . . . . . . . . . . . . . . . . . . .55
2.3.10 PAD[06:00] / AN[06:00] — Port AD Input Pins of ATD0 . . . . . . . . . . . . . . . . . . . . . .55
2.3.11 PA[7:0] / ADDR[15:8] / DATA[15:8] — Port A I/O Pins . . . . . . . . . . . . . . . . . . . . . . .55
2.3.12 PB[7:0] / ADDR[7:0] / DATA[7:0] — Port B I/O Pins . . . . . . . . . . . . . . . . . . . . . . . . .55
2.3.13 PE7 / NOACC / XCLKS — Port E I/O Pin 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
2.3.14 PE6 / MODB / IPIPE1 — Port E I/O Pin 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
2.3.15 PE5 / MODA / IPIPE0 — Port E I/O Pin 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
2.3.16 PE4 / ECLK — Port E I/O Pin 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
2.3.17 PE3 / LSTRB / TAGLO — Port E I/O Pin 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
2.3.18 PE2 / R/W — Port E I/O Pin 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
2.3.19 PE1 / IRQ — Port E Input Pin 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
2.3.20 PE0 / XIRQ — Port E Input Pin 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
MC9S12DJ64 Device User Guide — V01.17
2.3.21 PH7 / KWH7 — Port H I/O Pin 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
2.3.22 PH6 / KWH6 — Port H I/O Pin 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.23 PH5 / KWH5 — Port H I/O Pin 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.24 PH4 / KWH4 — Port H I/O Pin 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.25 PH3 / KWH3 — Port H I/O Pin 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.26 PH2 / KWH2 — Port H I/O Pin 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.27 PH1 / KWH1 — Port H I/O Pin 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.28 PH0 / KWH0 — Port H I/O Pin 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.29 PJ7 / KWJ7 / SCL / TXCAN0 — PORT J I/O Pin 7 . . . . . . . . . . . . . . . . . . . . . . . . . .58
2.3.30 PJ6 / KWJ6 / SDA / RXCAN0 — PORT J I/O Pin 6. . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.31 PJ[1:0] / KWJ[1:0] — Port J I/O Pins [1:0] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.32 PK7 / ECS / ROMCTL — Port K I/O Pin 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.33 PK[5:0] / XADDR[19:14] — Port K I/O Pins [5:0] . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.34 PM7 — Port M I/O Pin 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.35 PM6 — Port M I/O Pin 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.36 PM5 / TXCAN0 / SCK0 — Port M I/O Pin 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.37 PM4 / RXCAN0 / MOSI0 — Port M I/O Pin 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
2.3.38 PM3 / TXCAN0 / SS0 — Port M I/O Pin 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.39 PM2 / RXCAN0 / MISO0 — Port M I/O Pin 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.40 PM1 / TXCAN0 / TXB — Port M I/O Pin 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.41 PM0 / RXCAN0 / RXB — Port M I/O Pin 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.42 PP7 / KWP7 / PWM7 — Port P I/O Pin 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.43 PP6 / KWP6 / PWM6 — Port P I/O Pin 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.44 PP5 / KWP5 / PWM5 — Port P I/O Pin 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.45 PP4 / KWP4 / PWM4 — Port P I/O Pin 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
2.3.46 PP3 / KWP3 / PWM3 — Port P I/O Pin 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.47 PP2 / KWP2 / PWM2 — Port P I/O Pin 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.48 PP1 / KWP1 / PWM1 — Port P I/O Pin 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.49 PP0 / KWP0 / PWM0 — Port P I/O Pin 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.50 PS7 / SS0 — Port S I/O Pin 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.51 PS6 / SCK0 — Port S I/O Pin 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.52 PS5 / MOSI0 — Port S I/O Pin 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.53 PS4 / MISO0 — Port S I/O Pin 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.54 PS3 / TXD1 — Port S I/O Pin 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
2.3.55 PS2 / RXD1 — Port S I/O Pin 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
2.3.56 PS1 / TXD0 — Port S I/O Pin 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
MC9S12DJ64 Device User Guide — V01.17
2.3.57 PS0 / RXD0 — Port S I/O Pin 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
2.3.58 PT[7:0] / IOC[7:0] — Port T I/O Pins [7:0] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
2.4 Power Supply Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
2.4.1 VDDX, VSSX — Power & Ground Pins for I/O Drivers . . . . . . . . . . . . . . . . . . . . . . .63
2.4.2 VDDR, VSSR — Power & Ground Pins for I/O Drivers & for Internal Voltage Regulator 63
2.4.3 VDD1, VDD2, VSS1, VSS2 — Internal Logic Power Supply Pins. . . . . . . . . . . . . . .63
2.4.4 VDDA, VSSA — Power Supply Pins for ATD0/ATD1 and VREG . . . . . . . . . . . . . . .63
2.4.5 VRH, VRL — ATD Reference Voltage Input Pins . . . . . . . . . . . . . . . . . . . . . . . . . . .64
2.4.6 VDDPLL, VSSPLL — Power Supply Pins for PLL. . . . . . . . . . . . . . . . . . . . . . . . . . .64
2.4.7 VREGEN — On Chip Voltage Regulator Enable. . . . . . . . . . . . . . . . . . . . . . . . . . . .64
Section 3 System Clock Description
3.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
Section 4 Modes of Operation
4.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
4.2 Chip Configuration Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
4.3 Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
4.3.1 Securing the Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
4.3.2 Operation of the Secured Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
4.3.3 Unsecuring the Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
4.4 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
4.4.1 Stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
4.4.2 Pseudo Stop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
4.4.3 Wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
4.4.4 Run. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
Section 5 Resets and Interrupts
5.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
5.2 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
5.2.1 Vector Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
5.3 Effects of Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
5.3.1 I/O pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
5.3.2 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73
Section 6 HCS12 Core Block Description
MC9S12DJ64 Device User Guide — V01.17
6.1 CPU12 Block Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
6.1.1 Device-specific information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
6.2 HCS12 Module Mapping Control (MMC) Block Description. . . . . . . . . . . . . . . . . . . . . .75
6.2.1 Device-specific information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
6.3 HCS12 Multiplexed External Bus Interface (MEBI) Block Description . . . . . . . . . . . . . .75
6.3.1 Device-specific information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
6.4 HCS12 Interrupt (INT) Block Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
6.5 HCS12 Background Debug (BDM) Block Description . . . . . . . . . . . . . . . . . . . . . . . . . .76
6.5.1 Device-specific information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
6.6 HCS12 Breakpoint (BKP) Block Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Section 7 Clock and Reset Generator (CRG) Block Description
7.1 Device-specific information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Section 8 Oscillator (OSC) Block Description
8.1 Device-specific information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Section 9 Enhanced Capture Timer (ECT) Block Description
Section 10 Analog to Digital Converter (ATD) Block Description
Section 11 Inter-IC Bus (IIC) Block Description
Section 12 Serial Communications Interface (SCI) Block Description
Section 13 Serial Peripheral Interface (SPI) Block Description
Section 14 J1850 (BDLC) Block Description
Section 15 Pulse Width Modulator (PWM) Block Description
Section 16 Flash EEPROM 64K Block Description
Section 17 EEPROM 1K Block Description
Section 18 RAM Block Description
Section 19 MSCAN Block Description
MC9S12DJ64 Device User Guide — V01.17
Section 20 Port Integration Module (PIM) Block Description
Section 21 Voltage Regulator (VREG) Block Description
Section 22 Printed Circuit Board Layout Proposals
Appendix A Electrical Characteristics
A.1 General. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85
A.1.1 Parameter Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85
A.1.2 Power Supply. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85
A.1.3 Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
A.1.4 Current Injection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
A.1.5 Absolute Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87
A.1.6 ESD Protection and Latch-up Immunity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
A.1.7 Operating Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
A.1.8 Power Dissipation and Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
A.1.9 I/O Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
A.1.10 Supply Currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92
A.2 ATD Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
A.2.1 ATD Operating Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
A.2.2 Factors influencing accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
A.2.3 ATD accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
A.3 NVM, Flash and EEPROM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
A.3.1 NVM timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
A.3.2 NVM Reliability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
A.4 Voltage Regulator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
A.5 Reset, Oscillator and PLL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
A.5.1 Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
A.5.2 Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
A.5.3 Phase Locked Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
A.6 MSCAN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
A.7 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
A.7.1 Master Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
A.7.2 Slave Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
A.8 External Bus Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
A.8.1 General Muxed Bus Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
MC9S12DJ64 Device User Guide — V01.17
Appendix B Package Information
B.1 General. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
B.2 112-pin LQFP package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122
B.3 80-pin QFP package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
10
MC9S12DJ64 Device User Guide — V01.17

List of Figures

Figure 0-1 Order Partnumber Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Figure 1-1 MC9S12DJ64 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Figure 1-2 MC9S12DJ64 Memory Map out of Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
Figure 2-1 Pin Assignments in 112-pin LQFP for MC9S12DJ64 . . . . . . . . . . . . . . . . . . . . .50
Figure 2-2 Pin Assignments in 80-pin QFP for MC9S12DJ64 . . . . . . . . . . . . . . . . . . . . . . .51
Figure 2-3 PLL Loop Filter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
Figure 2-4 Colpitts Oscillator Connections (PE7=1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
Figure 2-5 Pierce Oscillator Connections (PE7=0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
Figure 2-6 External Clock Connections (PE7=0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
Figure 3-1 Clock Connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
Figure 22-1 Recommended PCB Layout 112LQFP Colpitts Oscillator. . . . . . . . . . . . . . . . . .80
Figure 22-2 Recommended PCB Layout for 80QFP Colpitts Oscillator . . . . . . . . . . . . . . . . .81
Figure 22-3 Recommended PCB Layout for 112LQFP Pierce Oscillator . . . . . . . . . . . . . . . .82
Figure 22-4 Recommended PCB Layout for 80QFP Pierce Oscillator . . . . . . . . . . . . . . . . . .83
Figure A-1 ATD Accuracy Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Figure A-2 Basic PLL functional diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Figure A-3 Jitter Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Figure A-4 Maximum bus clock jitter approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Figure A-5 SPI Master Timing (CPHA = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Figure A-6 SPI Master Timing (CPHA =1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Figure A-7 SPI Slave Timing (CPHA = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Figure A-8 SPI Slave Timing (CPHA =1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Figure A-9 General External Bus Timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Figure B-1 112-pin LQFP mechanical dimensions (case no. 987) . . . . . . . . . . . . . . . . . . 122
Figure B-2 80-pin QFP Mechanical Dimensions (case no. 841B). . . . . . . . . . . . . . . . . . . 123
11
MC9S12DJ64 Device User Guide — V01.17
12
MC9S12DJ64 Device User Guide — V01.17

List of Tables

Table 0-1 Derivative Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Table 0-2 Document References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
Table 1-1 Device Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
$0000 - $000F MEBI map 1 of 3 (HCS12 Multiplexed External Bus Interface) ................28
$0010 - $0014 MMC map 1 of 4 (HCS12 Module Mapping Control) ...............................28
$0015 - $0016 INT map 1 of 2 (HCS12 Interrupt) ............................................................29
$0017 - $0019 Reserved ..................................................................................................29
$001A - $001B Device ID Register (Table 1-3) ................................................................29
$001C - $001D MMC map 3 of 4 (HCS12 Module Mapping Control, Table 1-4) ..............29
$001E - $001E MEBI map 2 of 3 (HCS12 Multiplexed External Bus Interface) ................29
$001F - $001F INT map 2 of 2 (HCS12 Interrupt) ............................................................29
$0020 - $0027 Reserved ..................................................................................................29
$0028 - $002F BKP (HCS12 Breakpoint) .........................................................................30
$0030 - $0031 MMC map 4 of 4 (HCS12 Module Mapping Control) ...............................30
$0032 - $0033 MEBI map 3 of 3 (HCS12 Multiplexed External Bus Interface) ................30
$0034 - $003F CRG (Clock and Reset Generator) ..........................................................30
$0040 - $007F ECT (Enhanced Capture Timer 16 Bit 8 Channels) .................................31
$0080 - $009F ATD0 (Analog to Digital Converter 10 Bit 8 Channel) ..............................34
$00A0 - $00C7 PWM (Pulse Width Modulator 8 Bit 8 Channel) .......................................35
$00C8 - $00CF SCI0 (Asynchronous Serial Interface) ......................................................37
$00D0 - $00D7 SCI1 (Asynchronous Serial Interface) ......................................................37
$00D8 - $00DF SPI0 (Serial Peripheral Interface) ............................................................37
$00E0 - $00E7 IIC (Inter IC Bus) ......................................................................................38
$00E8 - $00EF BDLC (Bytelevel Data Link Controller J1850) ..........................................38
$00F0 - $00FF Reserved ..................................................................................................39
$0100 - $010F Flash Control Register (fts64k) ................................................................39
$0110 - $011B EEPROM Control Register (eets1k) ........................................................39
$011C - $011F Reserved for RAM Control Register ........................................................40
$0120 - $013F ATD1 (Analog to Digital Converter 10 Bit 8 Channel) ..............................40
$0140 - $017F CAN0 (Motorola Scalable CAN - MSCAN) ..............................................41
Table 1-2 Detailed MSCAN Foreground Receive and Transmit Buffer Layout . . . . . . . . . . .42
$0180 - $023F Reserved ..................................................................................................43
$0240 - $027F PIM (Port Integration Module) ..................................................................44
13
MC9S12DJ64 Device User Guide — V01.17
$0280 - $03FF Reserved ..................................................................................................46
Table 1-3 Assigned Part ID Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
Table 1-4 Memory size registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
Table 2-1 Signal Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Table 2-2 MC9S12DJ64 Power and Ground Connection Summary . . . . . . . . . . . . . . . . . . .62
Table 4-1 Mode Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
Table 4-2 Clock Selection Based on PE7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
Table 4-3 Voltage Regulator VREGEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
Table 5-1 Interrupt Vector Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
Table 22-1 Suggested External Component Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
Table A-1 Absolute Maximum Ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87
Table A-2 ESD and Latch-up Test Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
Table A-3 ESD and Latch-Up Protection Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . .88
Table A-4 Operating Conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
Table A-5 Thermal Package Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
Table A-6 5V I/O Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92
Table A-7 Supply Current Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
Table A-8 ATD Operating Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
Table A-9 ATD Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
Table A-10 ATD Conversion Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
Table A-11 NVM Timing Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
Table A-12 NVM Reliability Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Table A-13 Voltage Regulator Recommended Load Capacitances . . . . . . . . . . . . . . . . . . .103
Table A-14 Startup Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
Table A-15 Oscillator Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Table A-16 PLL Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
Table A-17 MSCAN Wake-up Pulse Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Table A-18 SPI Master Mode Timing Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114
Table A-19 SPI Slave Mode Timing Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
Table A-20 Expanded Bus Timing Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119
14
MC9S12DJ64 Device User Guide — V01.17

Derivative Differences and Document References

Derivative Differences
Table 0-1 shows the availability of peripheral modules on the various derivatives. For details about the
compatibility within the MC9S12D-Family refer also to engineering bulletin EB386.
Table 0-1 Derivative Differences
Generic device MC9S12DJ64 MC9S12D64 MC9S12A64
CAN0 1 1 0
J1850/BDLC 1 0 0
Packages 112LQFP, 80QFP 112LQFP, 80QFP 112LQFP, 80QFP
Mask Set L86D L86D L86D
Temp Options M, V, C M, V, C C
Package Codes PV, FU PV, FU PV, FU
Note
An errata exists
contact Sales office
An errata exists
contact Sales office
An errata exists
contact Sales office
MC9S12 DJ64 C FU
Package Option
Temperature Option Device Title Controller Family
Figure 0-1 Order Partnumber Example
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 to 85˚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 Manual V02 S12CPUV2/D
HCS12 Module Mapping Control (MMC) Block Guide V04 S12MMCV4/D
HCS12 Multiplexed External Bus Interface (MEBI) Block Guide V03 S12MEBIV3/D
HCS12 Interrupt (INT) Block Guide V01 S12INTV1/D
HCS12 Background Debug (BDM) Block Guide V04 S12BDMV4/D
HCS12 Breakpoint (BKP) Block Guide V01 S12BKPV1/D
Clock and Reset Generator (CRG) Block User Guide V04 S12CRGV4/D
Oscillator (OSC) Block User Guide V02 S12OSCV2/D
Enhanced Capture Timer 16 Bit 8 Channel (ECT_16B8C) Block User Guide V01 S12ECT16B8CV1/D
Analog to Digital Converter 10 Bit 8 Channel (ATD_10B8C) Block User Guide V02 S12ATD10B8CV2/D
Inter IC Bus (IIC) Block User Guide V02 S12IICV2/D
Asynchronous Serial Interface (SCI) Block User Guide V02 S12SCIV2/D
Serial Peripheral Interface (SPI) Block User Guide V02 S12SPIV2/D
Pulse Width Modulator 8 Bit 8 Channel (PWM_8B8C) Block User Guide V01 S12PWM8B8CV1/D
64K Byte Flash (FTS64K) Block User Guide V01 S12FTS64KV1/D
1K Byte EEPROM (EETS1K) Block User Guide V01 S12EETS1KV1/D
Byte Level Data Link Controller -J1850 (BDLC) Block User Guide V01 S12BDLCV1/D
Motorola Scalable CAN (MSCAN) Block User Guide V02 S12MSCANV2/D
Voltage Regulator (VREG) Block User Guide V01 S12VREGV1/D
Port Integration Module (PIM_9DJ64) Block User Guide V01 S12PIM9DJ64V1/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
iv.Enhanced indexed addressing – MEBI (Multiplexed External Bus Interface) – MMC (Module Mapping Control) – INT (Interrupt control) – BKP (Breakpoints) – BDM (Background Debug Mode)
CRG (low current Colpitts or Pierce oscillator, PLL, reset, clocks, COP watchdog, real time interrupt, clock monitor)
8-bit and 4-bit ports with interrupt functionality – Digital filtering – Programmable rising or falling edge trigger
Memory – 64K Flash EEPROM – 1K byte EEPROM
19
MC9S12DJ64 Device User Guide — V01.17
4K byte RAM
Two 8-channel Analog-to-Digital Converters – 10-bit resolution – External conversion trigger capability
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

1.3 Modes of Operation

User modes
Normal and Emulation Operating Modes – Normal Single-Chip Mode – Normal Expanded Wide Mode – Normal Expanded Narrow Mode
MC9S12DJ64 Device User Guide — V01.17
Emulation Expanded Wide Mode – Emulation Expanded Narrow Mode
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
DDRA DDRB
PTA PTB
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.
Table 1-1 Device Memory Map
Address Module
$0000 - $000F HCS12 Multiplexed External Bus Interface 16 $0010 - $0014 HCS12 Module Mapping Control 5 $0015 - $0016 HCS12 Interrupt 2
$0017 - $0019 Reserved 3 $001A - $001B Device ID register (PARTID) 2 $001C - $001D HCS12 Module Mapping Control 2
$001E HCS12 Multiplexed External Bus Interface 1
$001F HCS12 Interrupt 1 $0020 - $0027 Reserved 8 $0028 - $002F HCS12 Breakpoint Module 8 $0030 - $0031 HCS12 Module Mapping Control 2 $0032 - $0033 HCS12 Multiplexed External Bus Interface 2 $0034 - $003F Clock and Reset Generator (PLL, RTI, COP) 12 $0040 - $007F Enhanced Capture Timer 16-bit 8 channels 64 $0080 - $009F Analog to Digital Converter 10-bit 8 channels (ATD0) 32
$00A0 - $00C7 Pulse Width Modulator 8-bit 8 channels (PWM) 40 $00C8 - $00CF Serial Communications Interface 0 (SCI0) 8 $00D0 - $00D7 Serial Communications Interface 0 (SCI1) 8 $00D8 - $00DF Serial Peripheral Interface (SPI0) 8
$00E0 - $00E7 Inter IC Bus 8 $00E8 - $00EF Byte Data Link Controller (BDLC) 8
$00F0 - $00FF Reserved 16
$0100- $010F Flash Control Register 16 $0110 - $011B EEPROM Control Register 12 $011C - $011F Reserved 4
$0120 - $013F Analog to Digital Converter 10-bit 8 channels (ATD1) 32 $0140 - $017F Motorola Scalable Can (CAN0) 64 $0180 - $023F Reserved 192 $0240 - $027F Port Integration Module (PIM) 64
$0280 - $03FF Reserved 384 $0000 - $07FF $0000 - $0FFF RAM array 4096 $4000 - $7FFF
$8000 - $BFFF Flash EEPROM Page Window 16384
EEPROM array 1k Array mapped twice in the address space
Fixed Flash EEPROM array incl. 0.5K, 1K, 2K or 4K Protected Sector at start
Size
(Bytes)
2048
16384
25
MC9S12DJ64 Device User Guide — V01.17
Table 1-1 Device Memory Map
Address Module
Fixed Flash EEPROM array
$C000 - $FFFF
incl. 0.5K, 1K, 2K or 4K Protected Sector at end and 256 bytes of Vector Space at $FF80 - $FFFF
Size
(Bytes)
16384
26
MC9S12DJ64 Device User Guide — V01.17
Figure 1-2 MC9S12DJ64 Memory Map out of Reset
$0000
$0400
$0800
$1000
$4000
Unimplemented Unimplemented
$0000
$03FF $0000
$07FF $0000
$0FFF
$4000
$7FFF
REGISTERS
(Mappable to any 2K Boundary within the first 32K)
1K Bytes EEPROM
(Mappable to any 2K Boundary; 1K mapped two times in the 2K address space)
4K Bytes RAM
(Mappable to any 4K Boundary)
16K Fixed Flash Page $3E = 62
(This is dependant on the state of the ROMHM bit)
$8000
$C000
$FF00
$FFFF
EXTERN
VECTORS
EXPANDED
VECTORS
NORMAL
SINGLE CHIP
VECTORS
SPECIAL
SINGLE CHIP
$8000
16K Page Window 4 x 16K Flash EEPROM pages
$BFFF
$C000
16K Fixed Flash Page $3F = 63
$FFFF $FF00
BDM (if active)
$FFFF
27
MC9S12DJ64 Device User Guide — V01.17

1.5.1 Detailed Register Map

$0000 - $000F MEBI map 1 of 3 (HCS12 Multiplexed External Bus Interface)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0000 PORTA
$0001 PORTB
$0002 DDRA
$0003 DDRB
$0004 Reserved
$0005 Reserved
$0006 Reserved
$0007 Reserved
$0008 PORTE
$0009 DDRE
$000A PEAR
$000B MODE
$000C PUCR
$000D RDRIV
$000E EBICTL
$000F Reserved
Read:
Write:
Read:
Write:
Read:
Write:
Read:
Write:
Read: 00000000
Write:
Read: 00000000
Write:
Read: 00000000
Write:
Read: 00000000
Write:
Read:
Write:
Read:
Write:
Read:
Write:
Read:
Write:
Read:
Write:
Read:
Write:
Read: 0000000
Write:
Read: 00000000
Write:
Bit 7 654321Bit 0
Bit 7 654321Bit 0
Bit 7 654321Bit 0
Bit 7 654321Bit 0
Bit 7 65432
Bit 7 6543Bit 2
NOACCE
MODC MODB MODA
PUPKE
RDPK
0
00
00
PIPOE NECLK LSTRE RDWE
PUPEE
RDPE
0
IVIS
00
00
0
Bit 1 Bit 0
00
00
EMK EME
PUPBE PUPAE
RDPB RDPA
ESTR
$0010 - $0014 MMC map 1 of 4 (HCS12 Module Mapping Control)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0010 INITRM
$0011 INITRG
$0012 INITEE
$0013 MISC
$0014 Reserved
28
Read:
Write:
Read: 0
Write:
Read:
Write:
Read: 0000
Write:
Read: 00000000
Write:
RAM15 RAM14 RAM13 RAM12 RAM11
REG14 REG13 REG12 REG11
EE15 EE14 EE13 EE12 EE11
EXSTR1 EXSTR0 ROMHM ROMON
00
000
00
RAMHAL
EEON
MC9S12DJ64 Device User Guide — V01.17
$0015 - $0016 INT map 1 of 2 (HCS12 Interrupt)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0015 ITCR
$0016 ITEST
Read: 0 0 0
Write:
Read:
Write:
INTE INTC INTA INT8 INT6 INT4 INT2 INT0
WRINT ADR3 ADR2 ADR1 ADR0
$0017 - $0019 Reserved
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0017 -
$0019
Reserved
Read: 00000000
Write:
$001A - $001B Device ID Register (Table 1-3)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $001A PARTIDH
$001B PARTIDL
Read: ID15 ID14 ID13 ID12 ID11 ID10 ID9 ID8
Write:
Read: ID7 ID6 ID5 ID4 ID3 ID2 ID1 ID0
Write:
$001C - $001D MMC map 3 of 4 (HCS12 Module Mapping Control, Table 1-4)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $001C MEMSIZ0
$001D MEMSIZ1
Read: reg_sw0 0 eep_sw1 eep_sw0 0 ram_sw2 ram_sw1 ram_sw0
Write:
Read: rom_sw1 rom_sw0 0000pag_sw1 pag_sw0
Write:
$001E - $001E MEBI map 2 of 3 (HCS12 Multiplexed External Bus Interface)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $001E INTCR
Read:
Write:
IRQE IRQEN
000000
$001F - $001F INT map 2 of 2 (HCS12 Interrupt)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $001F HPRIO
Read:
Write:
PSEL7 PSEL6 PSEL5 PSEL4 PSEL3 PSEL2 PSEL1
0
$0020 - $0027 Reserved
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0020 -
$0027
Reserved
Read: 00000000
Write:
29
MC9S12DJ64 Device User Guide — V01.17
$0028 - $002F BKP (HCS12 Breakpoint)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0028 BKPCT0
$0029 BKPCT1
$002A BKP0X
$002B BKP0H
$002C BKP0L
$002D BKP1X
$002E BKP1H
$002F BKP1L
Read:
Write:
Read:
Write:
Read: 0 0
Write:
Read:
Write:
Read:
Write:
Read: 0 0
Write:
Read:
Write:
Read:
Write:
BKEN BKFULL BKBDM BKTAG
BK0MBH BK0MBL BK1MBH BK1MBL BK0RWE BK0RW BK1RWE BK1RW
BK0V5 BK0V4 BK0V3 BK0V2 BK0V1 BK0V0
Bit 15 14 13 12 11 10 9 Bit 8
Bit 7 654321Bit 0
BK1V5 BK1V4 BK1V3 BK1V2 BK1V1 BK1V0
Bit 15 14 13 12 11 10 9 Bit 8
Bit 7 654321Bit 0
0000
$0030 - $0031 MMC map 4 of 4 (HCS12 Module Mapping Control)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0030 PPAGE
$0031 Reserved
Read: 0 0
Write:
Read: 00000000
Write:
PIX5 PIX4 PIX3 PIX2 PIX1 PIX0
$0032 - $0033 MEBI map 3 of 3 (HCS12 Multiplexed External Bus Interface)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0032 PORTK
$0033 DDRK
Read:
Write:
Read:
Write:
Bit 7 654321Bit 0
Bit 7 654321Bit 0
$0034 - $003F CRG (Clock and Reset Generator)
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 $0034 SYNR
$0035 REFDV
$0036
$0037 CRGFLG
$0038 CRGINT
CTFLG
TEST ONLY
Read: 0 0
Write:
Read: 0000
Write:
Read: 00000000
Write:
Read:
Write:
Read:
Write:
RTIF PORF
RTIE
00
SYN5 SYN4 SYN3 SYN2 SYN1 SYN0
REFDV3 REFDV2 REFDV1 REFDV0
0
LOCKIF
LOCKIE
LOCK TRACK
00
SCMIF
SCMIE
SCM
0
30
Loading...
+ 96 hidden pages