MC9S12XHZ512
Data Sheet
Covers
MC9S12XHZ384, MC9S12XHZ256
HCS12X
Microcontrollers
MC9S12XHZ512
Rev. 1.06
10/2010
freescale.com
To provide the most up-to-date information, the revision of our documents on the World Wide Web will be
the most current. Your printed copy may be an earlier revision. To verify you have the latest information
available, refer to:
http://freescale.com/
The following revision history table summarizes changes contained in this document. This document
contains information for all constituent modules, with the exception of the S12X CPU. For S12X CPU
information please refer to CPU12XV2 in the CPU12/CPU12X Reference Manual.
Revision History
Date
January 5, 2006
April 20, 2006
July 28, 2006
January 8, 2007
August 20, 2007
November 4, 2008
October 14, 2010
Revision
Level
01.00
01.01
01.02
01.03
01.04
01.05
01.06
New Book
Updated block guide versions
Made minor corrections
Added MC9S12XHZ384 and MC9S12XHZ256
Updated slew rates
Corrected typos on pinout diagram
Added PartID. Minor updates to ECT, SCI, IIC and XGATE sections.
Description
List of Chapters
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Chapter 18
Chapter 19
Chapter 20
Chapter 21
Chapter 22
Chapter 23
Chapter 24
Chapter 25
MC9S12XHZ Family Device Overview . . . . . . . . . . . . . . . . . . . 21
Port Integration Module (S12XHZPIMV1) . . . . . . . . . . . . . . . . . 57
512 Kbyte Flash Module (S12XFTX512K4V3). . . . . . . . . . . . . 131
4 Kbyte EEPROM Module (S12XEETX4KV2) . . . . . . . . . . . . . 175
XGATE (S12XGATEV2). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Security (S12X9SECV2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Clocks and Reset Generator (S12CRGV6) . . . . . . . . . . . . . . . 331
Pierce Oscillator (S12XOSCLCPV1) . . . . . . . . . . . . . . . . . . . . 371
Analog-to-Digital Converter (ATD10B16CV4) . . . . . . . . . . . . 377
Liquid Crystal Display (LCD32F4BV1) . . . . . . . . . . . . . . . . . . 411
Motor Controller (MC10B12CV2). . . . . . . . . . . . . . . . . . . . . . . 429
Stepper Stall Detector (SSDV1). . . . . . . . . . . . . . . . . . . . . . . . 461
Inter-Integrated Circuit (IICV3) . . . . . . . . . . . . . . . . . . . . . . . . 479
Freescale’s Scalable Controller Area Network (MSCANV3) . 507
Serial Communication Interface (SCIV5) . . . . . . . . . . . . . . . . 561
Serial Peripheral Interface (SPIV4) . . . . . . . . . . . . . . . . . . . . . 599
Periodic Interrupt Timer (PIT24B4CV1) . . . . . . . . . . . . . . . . . 625
Pulse-Width Modulator (PWM8B8CV1). . . . . . . . . . . . . . . . . . 639
Enhanced Capture Timer (ECT16B8CV3). . . . . . . . . . . . . . . . 671
Voltage Regulator (VREG3V3V5) . . . . . . . . . . . . . . . . . . . . . . 725
Background Debug Module (S12XBDMV2) . . . . . . . . . . . . . . 739
S12X Debug (S12XDBGV3) Module . . . . . . . . . . . . . . . . . . . . 765
External Bus Interface (S12XEBIV3) . . . . . . . . . . . . . . . . . . . . 807
Interrupt (S12XINTV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
Memory Mapping Control (S12XMMCV3) . . . . . . . . . . . . . . . . 849
MC9S12XHZ512 Data Sheet, Rev. 1.06
Freescale Semiconductor
3
Appendix A Electrical Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
Appendix B Package Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935
Appendix C PCB Layout Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938
Appendix D Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941
Appendix E Detailed Register Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 942
MC9S12XHZ512 Data Sheet, Rev. 1.06
4
Freescale Semiconductor
Table of Contents
Chapter 1
MC9S12XHZ Family Device Overview
1.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.1.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.1.2 Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.3 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.4 Device Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.1.5 Part ID Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.2.1 Device Pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.2.2 Signal Properties Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.3 Detailed Signal Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.2.4 Power Supply Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
System Clock Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Chip Configuration Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.5.1 User Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.5.2 Low-Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.5.3 Freeze Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Resets and Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
1.6.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
1.6.2 Effects of Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
COP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
ATD External Trigger Input Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
1.2
1.3
1.4
1.5
1.6
1.7
1.8
Chapter 2
Port Integration Module (S12XHZPIMV1)
2.1
lntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.1.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.1.2 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
External Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Memory Map and Register Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.3.1 Port A and Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.3.2 Port C and Port D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.3.3 Port E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.3.4 Port K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.3.5 Miscellaneous registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.3.6 Port AD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
MC9S12XHZ512 Data Sheet, Rev. 1.06
Freescale Semiconductor
5
2.2
2.3