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
DOCUMENT NUMBER
9S12DT256DGV3/D
Version
Number
V03.00
V03.01
V03.02
V03.03
Revision
Date
24 March
2003
30 June
2003
24 July
2003
26 July
2003
Effective
Date
AuthorDescription of Changes
Initial version for Maskset L91N , based on MC9S12DP256B
V02.11.
•added new HCS12 core documentation
•added cumulative program/erase cyclelimitation
to Table A-12 for EEPROM
•updated Table 0-2 Document References
•removed cumulative program/erase cycle
limitation from Table A-12 for EEPROM
•added LRAE generic load and execute info to
section 15
•Added MC9S12DT256 in QFP 80 to Table 0-1
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,Buyer shallindemnify 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.
2
MC9S12DT256 Device User Guide — 9S12DT256DGV3/D V03.03
3
MC9S12DT256 Device User Guide — 9S12DT256DGV3/D V03.034MC9S12DT256 Device User Guide — V03.03
The following figure provides an ordering number example for the MC9S12H-Family devices.
MC9S12 DT256C FU
Package Option
Temperature Option
Temperature Options
C = -40˚C to85˚C
V = -40˚C to 105˚C
M = -40˚C to 125˚C
Device Title
Package Options
Controller Family
FU =80QFP
PV = 112 LQFP
Figure 0-1 Order Partnumber Example
15
MC9S12DT256 Device User Guide — V03.03
The following items should be considered when using a derivative (Table 0-1):
•Registers
–Do not write or read CAN0 registers (after reset: address range $0140 - $017F), if using a
derivative without CAN0.
–Do not write or read CAN1registers (after reset: address range $0180 - $01BF), if using a
derivative without CAN1.
–Do not write or read CAN4 registers (after reset: address range $0280 - $02BF), if using a
derivative without CAN4.
–Do not write or read BDLC registers (after reset: address range $00E8 - $00EF), if using a
derivative without BDLC.
•Interrupts
–Fill the four CAN0 interrupt vectors ($FFB0 - $FFB7) according to your coding policies for
unused interrupts, if using a derivative without CAN0.
–Fill the four CAN1 interrupt vectors ($FFA8 - $FFAF) according to your coding policies for
unused interrupts, if using a derivative without CAN1.
–Fill the four CAN4 interrupt vectors ($FF90 - $FF97) according to your coding policies for
unused interrupts, if using a derivative without CAN4.
–Fill the BDLC interrupt vector ($FFC2, $FFC3) according to your coding policies for unused
interrupts, if using a derivative without BDLC.
•Ports
–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.
–The CAN1 pin functionality (TXCAN1, RXCAN1) is not available on port PM3 and PM2, if
using a derivative without CAN1.
–The CAN4 pin functionality (TXCAN4, RXCAN4) is not available on port PJ7, PJ6, PM5,
PM7, PM6, PM5 and PM4, if using a derivative without CAN0.
–The BDLC pin functionality (TXB, RXB) is not available on port PM1 and PM0, if using a
derivative without BDLC.
–Do not write MODRR1 and MODRR0 bits of Module Routing Register (PIM_9DP256 Block
Guide), if using a derivative without CAN0.
–Do not write MODRR3 and MODRR2 bits of Module Routing Register (PIM_9DP256 Block
Guide), if using a derivative without CAN4.
Document References
16
MC9S12DT256 Device User Guide — V03.03
The Device Guide provides information about the MC9S12DT256 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 the
HCS12 Core User Guide and 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.
Table 0-2 Document References
User GuideVersionDocument Order Number
CPU12 Reference ManualV04CPU12RM/AD
HCS12 Multiplexed External Bus Interface (MEBI) Block GuideV03S12MEBIV3/D
HCS12 Module Mapping Control (MMC) Block GuideV04S12MMCV4/D
The state of PK7/ROMCTL is latched into ROMON Bit during RESET into
Emulation Mode or Normal Expanded Mode
17
MC9S12DT256 Device User Guide — V03.03
Table 0-3 Specification Change Summary for Maskset L91N
BlockSpec Change
EETS4K/FTS256KReliability Specification for Non Volatile Memories
PIM_9DP256CAN0 can be routed to PORTJ
18
User Guide End Sheet
MC9S12DT256 Device User Guide — V03.03
129
MC9S12DT256 Device User Guide — V03.03
130
FINAL PAGE OF
130
PAGES
MC9S12DT256 Device User Guide — V03.03
Section 1 IntroductionMC9S12DT256
1.1 Overview
The MC9S12DT256 microcontroller unit (MCU) is a 16-bit device composed of standard on-chip
peripherals including a 16-bit central processing unit (HCS12 CPU), 256K bytes of Flash EEPROM, 12K
bytes of RAM, 4K bytes of EEPROM, two asynchronous serial communications interfaces (SCI), three
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, three CAN 2.0 A, B software compatible modules
(MSCAN12), and an Inter-IC Bus. The MC9S12DT256 has full 16-bit data paths 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
•Three 1M bit per second, CAN 2.0 A, B software compatible modules
–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)
–Three 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)
20
–Compatible with I2C Bus standard
–Multi-master operation
–Software programmable for one of 256 different serial clock frequencies
•112-Pin LQFP package
–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
MC9S12DT256 Device User Guide — V03.03
1.4 Block Diagram
Figure 1-1 shows a block diagram of the MC9S12DT256 device.
22
MC9S12DT256 Device User Guide — V03.03
Figure 1-1 MC9S12DT256 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
256K Byte Flash EEPROM
12K Byte RAM
4K 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
Module
(SIM)
PB4
PB6
PB5
ADDR6
ADDR5
DATA6
DATA5
PB3
ADDR4
ADDR3
DATA4
DATA3
PB7
ADDR7
DATA7
PB2
PB1
ADDR2
ADDR1
DATA2
DATA1
ATD0
AN0
AN1
AN2
AN3
AN4
AN5
AN6
AN7
Enhanced Capture
Timer
SCI0
SCI1
SPI0
BDLC
(J1850)
CAN0
PB0
CAN1
ADDR0
CAN4
DATA0
IIC
PWM
SPI1
SPI2
VRH
VRL
VDDA
VSSA
PPAGE
MISO
MOSI
SCK
RXB
TXB
RXCAN
TXCAN
RXCAN
TXCAN
RXCAN
TXCAN
SDA
SCL
PWM0
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
PWM7
MISO
MOSI
SCK
MISO
MOSI
SCK
SS
SS
SS
AD0
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
reset the bottom 1k of the EEPROM ($0000 - $03FF) are hidden by the register space.
Table 1-1 Device Memory Map
AddressModule
$0000 - $0017
$0018 - $0019
$001A - $001B
$001C - $001F
$0020 - $0027
$0028 - $002F
$0030 - $0033
$0034 - $003F
$0040 - $007F
$0080 - $009F
$00A0 - $00C7
$00C8 - $00CF
$00D0 - $00D7
$00D8 - $00DF
$00E0 - $00E7
$00E8 - $00EF
$00F0 - $00F7
$00F8 - $00FF
$0100- $010F
$0110 - $011B
$011C - $011F
$0120 - $013F
$0140 - $017F
$0180 - $01BF
$01C0 - $01FF Reserved64
$0200 - $023F
$0240 - $027F Port Integration Module (PIM)64
$0280 - $02BF
$02C0 - $03FF
$0000 - $0FFF
CORE (Ports A, B, E, Modes, Inits, Test)
Reserved
Device ID register (PARTID)
CORE (MEMSIZ, IRQ, HPRIO)
Reserved
CORE (Background Debug Mode)
CORE (PPAGE, Port K)
Clock and Reset Generator (PLL, RTI, COP)
Enhanced Capture Timer 16-bit 8 channels
Analog to Digital Converter 10-bit 8 channels (ATD0)
Pulse Width Modulator 8-bit 8 channels (PWM)
Serial Communications Interface (SCI0)
Serial Communications Interface (SCI1)
Serial Peripheral Interface (SPI0)
Inter IC Bus
Byte Data Link Controller (BDLC)
Serial Peripheral Interface (SPI1)
Serial Peripheral Interface (SPI2)
Flash Control Register
EEPROM Control Register
Reserved
Analog to Digital Converter 10-bit 8 channels (ATD1)
Motorola Scalable Can (CAN0)
Motorola Scalable Can (CAN1)
Reserved
Motorola Scalable Can (CAN4)
Reserved
EEPROM array
Size
(Bytes)
24
12
64
32
40
16
12
32
64
64
64
64
320
4096
2
2
4
8
8
4
8
8
8
8
8
8
8
4
24
MC9S12DT256 Device User Guide — V03.03
Table 1-1 Device Memory Map
AddressModule
$1000 - $3FFF
$4000 - $7FFF
$8000 - $BFFF
$C000 - $FFFF
RAM array
Fixed Flash EEPROM array
incl. 0.5K, 1K, 2K or 4K Protected Sector at start
Flash EEPROM Page Window
Fixed Flash EEPROM array
incl. 0.5K, 1K, 2K or 4K Protected Sector at end
and 256 bytes of Vector Space at $FF80 - $FFFF
Size
(Bytes)
12288
16384
16384
16384
25
MC9S12DT256 Device User Guide — V03.03
Figure 1-2 MC9S12DT256 Memory Map
$0000
$0400
$1000
$4000
$8000
EXTERN
$0000
$03FF
$0000
$0FFF
$1000
$3FFF
$4000
$7FFF
$8000
REGISTERS
(Mappable to any 2k Block
within the first 32K)
4K Bytes EEPROM
(Mappable to any 4K Block)
12K Bytes RAM
(Mappable to any 16K
and alignable to top or
bottom)
16K Fixed Flash
Page $3E = 62
(This is dependant on the
state of the ROMHM bit)
16K Page Window
16 x 16K Flash EEPROM
pages
$C000
$FF00
$FFFF
VECTORS
EXPANDED*
* Assuming that a ‘0’ was driven onto port K bit 7 during MCU
is reset into normal expanded wide or narrow mode.
VECTORS
NORMAL
SINGLE CHIP
VECTORS
SPECIAL
SINGLE CHIP
$BFFF
$C000
16K Fixed Flash
Page $3F = 63
$FFFF
$FF00
BDM
(if active)
$FFFF
26
MC9S12DT256 Device User Guide — V03.03
1.6 Detailed Register Map
The following tables show the detailed register map of the MC9S12DT256.