MM912G634CV1AER2 [NXP]

SPECIALTY ANALOG CIRCUIT, PQFP48, 7 X 7 MM, 1.40 MM HEIGHT, 0.50 MM PITCH, MS-026BBC, LQFP-48;
MM912G634CV1AER2
型号: MM912G634CV1AER2
厂家: NXP    NXP
描述:

SPECIALTY ANALOG CIRCUIT, PQFP48, 7 X 7 MM, 1.40 MM HEIGHT, 0.50 MM PITCH, MS-026BBC, LQFP-48

文件: 总342页 (文件大小:2654K)
中文:  中文翻译
下载:  下载PDF数据表文档文件
Freescale Semiconductor  
Technical Data  
Document Number: MM912_634D1  
Rev. 11.0, 4/2014  
Integrated S12 Based Relay  
Driver with LIN  
912_634  
The MM912G634 (48 kB) and MM912H634 (64 kB) are  
integrated, MagniV, single package solutions that integrate an  
HCS12 microcontroller with a SMARTMOS analog control IC.  
The Die to Die Interface (D2D) controlled analog die combines  
system base chip and application specific functions, including a  
LIN transceiver.  
AP SUFFIX (PB-FREE)  
98ASH00962A  
AE SUFFIX (PB-FREE)  
98ASA00173D  
48 PIN LQFP  
(7.0 X7.0 mm)  
48 PIN LQFP-EP  
(7.0 X7.0 mm)  
Features  
• 16-Bit S12 CPU, 64/48 kByte P-FLASH,  
• 6.0 kByte RAM; 4/2 kByte D-FLASH  
• Six high-voltage / Wake-up inputs (L5…0)  
• Three low voltage GPIOs (PB2…0)  
• Background debug (BDM) & debug module (DBG)  
• Die to Die bus interface for transparent memory mapping  
• On-chip oscillator & two independent watchdogs  
• LIN 2.1 Physical Layer Interface with integrated SCI  
• 10 digital MCU GPIOs shared with SPI (PA7…0, PE1…0)  
• 10-Bit, 15 Channel - Analog to Digital Converter (ADC)  
• 16-Bit, 4 Channel - Timer Module (TIM16B4C)  
• 8-Bit, 2 Channel - Pulse width modulation module (PWM)  
• Low power modes with cyclic sense & forced wake-up  
• Current sense module with selectable gain  
• Reverse battery protected voltage sense module  
• Two protected low-side outputs to drive inductive loads  
• Two protected high-side outputs  
• Chip temperature sensor  
• Hall sensor supply & integrated voltage regulator(s)  
Battery Sense  
Power Supply  
LIN Interface  
VSENSE  
VS1  
VS2  
LS1  
MM912_634  
Low-side Drivers  
PGND  
M
LIN  
LGND  
ADC25  
AGND  
VDD  
VDDD2D  
VDDX  
VDDRX  
DGND  
VSSD2D  
VSSRX  
LS2  
ADC Supply  
ISENSEH*  
ISENSEL*  
Current Sense Mode  
Hall Sensor Supply  
2.5 V Supply  
5.0 V Supply  
HSUP  
Hall Sensor  
Hall Sensor  
5.0 V GPI/O with optional  
pull-up (shared with ADC,  
PWM, Timer, and SCI)  
Digital Ground  
Reset  
PTB0/AD0/RX/TIM0CH0  
PTB1/AD1/TX/TIM0CH1  
PTB2/AD2/PWM/TIM0CH2  
HS1  
RESET  
RESET_A  
PA0/MISO  
PA1/MOSI  
PA2/SCK  
PA3/SS  
PA4  
PA5  
PA6  
PA7  
12 V Light/LED and  
Switch Supply  
HS2*  
5.0 V Digital I/O  
Analog/Digital inputs  
L0  
L1  
L2  
L3  
L4*  
L5*  
(High Voltage and Wake-up  
capable)  
BKGD/MODC  
PE0/EXTAL  
PE1/XTAL  
TEST  
Debug and External  
Oscillator  
TCLK  
TEST_A  
Analog Test  
MCU Test  
* Feature not availablre in all Analog Options  
Figure 1. Simplified Application Diagram  
© Freescale Semiconductor, Inc., 2010-2014. All rights reserved.  
Ordering Information  
1
Ordering Information  
Table 1. ORDERING INFORMATION  
Device  
Max. Bus  
Frequency in  
MHz (fBUSMAX  
(Add an R2 suffix for  
Tape and Reel  
orders)  
Temperature  
Range (TA)  
Data Flash  
(kB)  
RAM  
(kB)  
Analog Stop Mode  
Option(1) Wake-up  
Package  
Flash (kB)  
)
(5)  
MM912G634CM1AE  
MM912G634DM1AE  
MM912G634CV1AE  
MM912G634DV1AE  
MM912G634CV2AP  
MM912G634DV2AP  
MM912H634CM1AE  
MM912H634DM1AE  
MM912H634CV1AE  
MM912H634DV1AE  
-40°C to 125°C  
-40°C to 105°C  
-40°C to 105°C  
-40°C to 125°C  
-40°C to 105°C  
LQFP48-EP  
LQFP48-EP  
LQFP48  
20  
20  
16  
20  
20  
48(2)  
48(2)  
48(2)  
64  
2(3)  
2(3)  
2(3)  
4
2(4)  
2(4)  
2(4)  
6
A1  
Enhanced  
(5)  
A1  
Enhanced  
(5)  
A2  
Enhanced  
(5)  
LQFP48-EP  
LQFP48-EP  
A1  
Enhanced  
(5)  
64  
4
6
A1  
Enhanced  
Note:  
1. See Table 2.  
2. The 48 kB Flash option (MM912G634) using the same S12I64 MCU with the tested FLASHSIZE reduced to 48 kB. This will limit the  
usable Flash area to the first 48 kB (0x3_4000-0x3_FFFF).  
3. The 48 kB Flash option (MM912G634) using the same S12I64 MCU with the tested Data - FLASHSIZE reduced to 2.0 kB. This will limit  
the usable Data Flash area to the first 2.0 kB (0x0_4400-0x0_4BFF).  
4. The 48 kB Flash option (MM912G634) using the same S12I64 MCU with the tested RAMSIZE reduced to 2.0 kB. This will limit the  
usable RAM area to the first 2.0 kB (0x0_2800-0x0_2FFF).  
5. Refer to MM912_634, Silicon Analog Mask (M91W) / Digital Mask (N53A) Errata  
Table 2. Analog Options(6)  
Feature  
A1  
A2  
Battery Sense Module  
Current Sense Module  
YES  
YES  
YES  
NO  
2nd High-side Output (HS2)  
Wake-up Inputs (Lx)  
Hall Supply Output (HSUP)  
LIN Module  
YES  
YES  
L0…L5  
YES  
L0…L3  
YES  
YES  
YES  
Note:  
6. This table only highlights the analog die differences between the derivatives. Features highlighted as “NO” or the Lx Inputs not  
mentioned are not available in the specific option and not bonded out and/or not tested. See Analog Die Options for detailed  
information.  
MM912_634 Advance Information, Rev. 11.0  
2
Freescale Semiconductor  
 
 
 
 
 
 
 
 
Table of Contents  
1
2
3
Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2  
Internal Block Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3  
Pin Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4  
3.1 MM912_634 Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5  
3.2 MCU Die Signal Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8  
Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10  
4.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10  
4.2 Absolute Maximum Ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10  
4.3 Operating Conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12  
4.4 Supply Currents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12  
4.5 Static Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14  
4.6 Dynamic Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21  
4.7 Thermal Protection Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36  
4.8 ESD Protection and Latch-up Immunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37  
4.9 Additional Test Information ISO7637-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38  
Functional Description and Application Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39  
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39  
5.2 Device Register Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39  
5.3 MM912_634 - Analog Die Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52  
5.4 Modes of Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55  
5.5 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59  
5.6 Die to Die Interface - Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62  
5.7 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63  
5.8 Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66  
5.9 Wake-up / Cyclic Sense . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67  
5.10 Window Watchdog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71  
5.11 Hall Sensor Supply Output - HSUP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73  
5.12 High-side Drivers - HS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74  
5.13 Low-side Drivers - LSx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76  
5.14 PWM Control Module (PWM8B2C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80  
5.15 LIN Physical Layer Interface - LIN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94  
5.16 Serial Communication Interface (S08SCIV4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96  
5.17 High Voltage Inputs - Lx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110  
5.18 General Purpose I/O - PTB[0…2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111  
5.19 Basic Timer Module - TIM (TIM16B4C). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113  
5.20 Analog Digital Converter - ADC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127  
5.21 Current Sense Module - ISENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134  
5.22 Temperature Sensor - TSENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135  
5.23 Supply Voltage Sense - VSENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136  
5.24 Internal Supply Voltage Sense - VS1SENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136  
5.25 Internal Bandgap Reference Voltage Sense - BANDGAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137  
5.26 MM912_634 - Analog Die Trimming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137  
5.27 MM912_634 - MCU Die Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141  
5.28 Port Integration Module (S12IPIMV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149  
5.29 Memory Map Control (S12PMMCV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157  
5.30 Interrupt Module (S12SS12IPIMV1V1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169  
5.31 Background Debug Module (S12IPIMV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173  
5.32 S12S Debug Module (S12IPIMV1V2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190  
5.33 Security (S12XS12IPIMV1V2). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223  
5.34 Impact on MCU modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224  
5.35 Secure firmware Code Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .226  
5.36 Initialization of a Virgin Device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .228  
5.37 Impact of Security on Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229  
4
5
MM912_634 Advance Information, Rev. 11.0  
Freescale Semiconductor  
3
Ordering Information  
5.38 S12 Clock, Reset and Power Management Unit (S12IPIMV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229  
5.39 Serial Peripheral Interface (S12S12IPIMV1V5). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266  
5.40 64 KByte Flash Module (S12FTMRC64K1V1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286  
5.41 Die-to-Die Initiator (S12IPIMV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .322  
Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .334  
6.1 Package Dimensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .334  
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .339  
6
7
MM912_634 Advance Information, Rev. 11.0  
4
Freescale Semiconductor  
Internal Block Diagram  
2
Internal Block Diagram  
PA7  
PORTA  
DDRA  
BKGD/MODC  
RESET  
Internal Bus  
VSSD2D  
VDDD2D  
VDD  
VDDX  
DGND  
RESET_A  
VSENSE  
TCLK  
VS1  
VS2  
TEST_A  
Internal Bus  
ISENSEH  
ISENSEL  
HS1  
HS2  
LS2  
HSUP  
LIN  
PGND  
LS1  
Figure 2. MM912_634 Block Diagram  
MM912_634 Advance Information, Rev. 11.0  
5
Freescale Semiconductor  
Pin Assignment  
3
Pin Assignment  
PA6  
L5  
L4  
L3  
L2  
L1  
L0  
1
36  
35  
34  
33  
32  
31  
30  
29  
28  
27  
26  
25  
PE0/EXTAL  
2
PE1/XTAL  
3
TEST  
4
PA5  
5
PA4  
6
PA3  
AGND  
ADC2p5  
PTB2  
7
PA2  
8
PA1  
9
PA0  
PTB1  
10  
VSSRX  
PTB0  
11  
VDDRX  
LGND  
12  
Figure 3. MM912_634 Pin Out  
NOTE  
The device exposed pad (package option AE only) is recommended to be connected to  
GND.  
Not all pins are available for analog die option 2. See Analog Die Options for details.  
MM912_634 Advance Information, Rev. 11.0  
6
Freescale Semiconductor  
Pin Assignment  
3.1  
MM912_634 Pin Description  
The following table gives a brief description of all available pins on the MM912_634 package. Refer to the highlighted chapter for  
detailed information.  
Table 3. MM912_634 Pin Description  
Pin #  
Pin Name  
Formal Name  
Description  
General purpose port A input or output pin 6. See Port Integration Module  
(S12IPIMV1)  
1
PA6  
MCU PA6  
EXTAL is one of the optional crystal/resonator driver and external clock pins. On  
reset, all the device clocks are derived from the Internal Reference Clock and port  
PE may be used for general purpose I/O. See EXTAL and XTAL and Port Integration  
Module (S12IPIMV1).  
2
3
PE0/EXTAL  
PE1/XTAL  
MCU Oscillator  
MCU Oscillator  
XTAL is one of the optional crystal/resonator driver and external clock pins. On  
reset, all the device clocks are derived from the Internal Reference Clock and port  
PE may be used for general purpose I/O. See EXTAL and XTAL and Port Integration  
Module (S12IPIMV1).  
This input only pin is reserved for test. This pin has a pull-down device. The TEST  
pin must be tied to EVSS in user mode.  
4
5
6
7
8
9
TEST  
PA5  
PA4  
PA3  
PA2  
PA1  
MCU Test  
MCU PA5  
General purpose port A input or output pin 5. See Port Integration Module  
(S12IPIMV1)  
General purpose port A input or output pin 4. See Port Integration Module  
(S12IPIMV1).  
MCU PA4  
General purpose port A input or output pin 3, shared with the SS signal of the  
integrated SPI Interface. See Port Integration Module (S12IPIMV1).  
MCU PA3 / SS  
MCU PA2 / SCK  
MCU PA1 / MOSI  
General purpose port A input or output pin 2, shared with the SCLK signal of the  
integrated SPI Interface. See Port Integration Module (S12IPIMV1).  
General purpose port A input or output pin 1, shared with the MOSI signal of the  
integrated SPI Interface. See Port Integration Module (S12IPIMV1).  
General-purpose port A input or output pin 0, shared with the MISO signal of the  
integrated SPI Interface. See Port Integration Module (S12IPIMV1).  
10  
11  
12  
13  
14  
PA0  
MCU PA0 / MISO  
MCU 5.0 V Ground  
MCU 5.0 V Supply  
MCU 2.5 V Ground  
MCU 2.5 V Supply  
VSSRX  
VDDRX  
VSSD2D  
VDDD2D  
Ground for the MCU 5.0 V power supply.  
MCU 5.0 V - Core- and Flash Voltage Regulator supply. See MM912_634 - MCU  
Die Overview.  
Ground for the MCU 2.5 V power supply.  
MCU 2.5 V - MCU Die-to-Die Interface power supply. See MM912_634 - MCU Die  
Overview.  
Voltage Regulator  
Output 2.5 V  
+2.5 V main voltage regulator output pin. External capacitor (CVDD) needed. See  
Power Supply.  
15  
16  
17  
VDD  
VDDX  
DGND  
Voltage Regulator Output +5.0 V main voltage regulator output pin. External capacitor (CVDDX) needed. See  
5.0 V  
Power Supply.  
This pin is the device digital ground connection for the 5.0 V and 2.5V logic. DGND,  
LGND, and AGND are internally connected to PGND via a back to back diode.  
Digital Ground  
Battery voltage sense input. This pin can be connected directly to the battery line for  
voltage measurements. The voltage present at this input is scaled down by an  
internal voltage divider, and can be routed to the internal ADC via the analog  
multiplexer.The pin is self-protected against reverse battery connections. An  
external resistor (RVSENXSE) is needed for protection(7). See Supply Voltage  
Sense - VSENSE. Note: This pin function is not available on all device  
configurations.  
18  
VSENSE  
Voltage Sense  
Note:  
7. An optional filter capacitor CVSENSE is recommended to be placed between the board connector and DVSENSE to GND for increased  
ESD performance.  
This pin is the device power supply pin 1. VS1 is primarily supplying the VDDX  
Voltage regulator and the Hall Sensor Supply Regulator (HSUP). VS1 can be  
sensed via a voltage divider through the AD converter. Reverse battery protection  
diode is required. See Power Supply  
19  
VS1  
Power Supply Pin 1  
MM912_634 Advance Information, Rev. 11.0  
7
Freescale Semiconductor  
 
Pin Assignment  
Table 3. MM912_634 Pin Description (continued)  
Pin #  
Pin Name  
Formal Name  
Description  
This pin is the device power supply pin 2. VS2 supplies the High-side Drivers (HSx).  
Reverse battery protection diode required. See Power Supply  
20  
VS2  
Power Supply Pin 2  
This pin is the first High-side output. It is supplied through the VS2 pin. It is designed  
to drive small resistive loads with optional PWM. In cyclic sense mode, this output  
will activate periodically during low power mode. See High-side Drivers - HS.  
21  
22  
HS1  
HS2  
High-side Output 1  
High-side Output 2  
This pin is the second High-side output. It is supplied through the VS2 pin. It is  
designed to drive small resistive loads with optional PWM. In cyclic sense mode, this  
output will activate periodically during low power mode. See High-side Drivers - HS.  
Note: This pin function is not available on all device configurations.  
This pin is designed as an 18 V Regulator to drive Hall Sensor Elements. It is  
supplied through the VS1 pin. An external capacitor (CHSUP) is needed. See Hall  
Sensor Supply Output - HSUP. Note: This pin function is not available on all device  
configurations.  
23  
HSUP  
Hall Sensor Supply Output  
This pin represents the single-wire bus transmitter and receiver. See LIN Physical  
Layer Interface - LIN. Note: This pin function is not available on all device  
configurations.  
24  
25  
LIN  
LIN Bus I/O  
This pin is the device LIN Ground connection. DGND, LGND, and AGND are  
internally connected to PGND via a back to back diode.  
LGND  
LIN Ground Pin  
This is the General Purpose I/O pin 0 based on VDDX with the following shared  
functions:  
• PTB0 - Bidirectional 5.0 V (VDDX) digital port I/O with selectable internal pull-up  
resistor.  
• AD0 - Analog Input Channel 0, 0…2.5V (ADC2p5) analog input  
• TIM0CH0 - Timer Channel 0 Input/Output  
• Rx - Selectable connection to LIN / SCI  
26  
27  
28  
PTB0  
PTB1  
PTB2  
General Purpose I/O 0  
General Purpose I/O 1  
General Purpose I/O 2  
See General Purpose I/O - PTB[0…2].  
This is the General Purpose I/O pin 1 based on VDDX with the following shared  
functions:  
• PTB1 - Bidirectional 5.0 V (VDDX) digital port I/O with selectable internal pull-up  
resistor.  
• AD1 - Analog Input Channel 1, 0…2.5 V (ADC2p5) analog input  
• TIM0CH1 - Timer Channel 1 Input/Output  
• Tx - Selectable connection to LIN / SCI  
See General Purpose I/O - PTB[0…2].  
This is the General Purpose I/O pin 2 based on VDDX with the following shared  
functions:  
• PTB2 - Bidirectional 5.0 V (VDDX) digital port I/O with selectable internal pull-up  
resistor.  
• AD2 - Analog Input Channel 2, 0…2.5V (ADC2p5) analog input  
• TIM0CH2 - Timer Channel 2 Input/Output  
• PWM - Selectable connection to PWM Channel 0 or 1  
See General Purpose I/O - PTB[0…2].  
This pin represents the ADC reference voltage and has to be connected to a filter  
capacitor. See Analog Digital Converter - ADC  
29  
30  
ADC2p5  
AGND  
ADC Reference Voltage  
Analog Ground Pin  
This pin is the device Analog to Digital converter ground connection. DGND, LGND  
and AGND are internally connected to PGND via a back to back diode.  
This pins is the High Voltage Input 0 with the following shared functions:  
• L0 - Digital High Voltage Input 0. When used as digital input, a series resistor  
(RLX) must be used to protect against automotive transients.(8)  
• AD3 - Analog Input 3 with selectable divider for 0…5.0 V and 0…18 V  
measurement range.  
31  
L0  
High Voltage Input 0  
• WU0 - Selectable Wake-up input 0 for wake up and cyclic sense during low  
power mode.  
See High Voltage Inputs - Lx  
MM912_634 Advance Information, Rev. 11.0  
8
Freescale Semiconductor  
Pin Assignment  
Table 3. MM912_634 Pin Description (continued)  
Pin #  
Pin Name  
Formal Name  
Description  
This pins is the High Voltage Input 1 with the following shared functions:  
• L1 - Digital High Voltage Input 1. When used as digital input, a series resistor  
(RLX) must be used to protect against automotive transients.(8)  
• AD4 - Analog Input 4 with selectable divider for 0…5.0 V and 0…18 V  
measurement range.  
32  
L1  
High Voltage Input 1  
• WU1 - Selectable Wake-up input 1 for wake-up and cyclic sense during low  
power mode.  
See High Voltage Inputs - Lx  
This pins is the High Voltage Input 2 with the following shared functions:  
• L2 - Digital High Voltage Input 2. When used as digital input, a series resistor  
(RLX) must be used to protect against automotive transients.(8)  
• AD5 - Analog Input 5 with selectable divider for 0…5.0 V and 0…18 V  
measurement range.  
33  
34  
35  
36  
L2  
L3  
L4  
L5  
High Voltage Input 2  
High Voltage Input 3  
High Voltage Input 4  
High Voltage Input 5  
• WU2 - Selectable Wake-up input 2 for wake-up and cyclic sense during low  
power mode.  
See High Voltage Inputs - Lx. Note: This pin function is not available on all device  
configurations.  
This pins is the High Voltage Input 3 with the following shared functions:  
• L3 - Digital High Voltage Input 3. When used as digital input, a series resistor  
(RLX) must be used to protect against automotive transients.(8)  
• AD6 - Analog Input 6 with selectable divider for 0…5.0 V and 0…18 V  
measurement range.  
• WU3 - Selectable Wake-up input 3 for wake-up and cyclic sense during low  
power mode.  
See High Voltage Inputs - Lx. Note: This pin function is not available on all device  
configurations.  
This pins is the High Voltage Input 4 with the following shared functions:  
• L4 - Digital High Voltage Input 4. When used as digital input, a series resistor  
(RLX) must be used to protect against automotive transients.(8)  
• AD7 - Analog Input 7 with selectable divider for 0…5.0 V and 0…18 V  
measurement range.  
• WU4 - Selectable Wake-up input 4 for wake-up and cyclic sense during low  
power mode.  
See High Voltage Inputs - Lx. Note: This pin function is not available on all device  
configurations.  
This pins is the High Voltage Input 5 with the following shared functions:  
• L5 - Digital High Voltage Input 5. When used as digital input, a series resistor  
(RLX) must be used to protect against automotive transients.(8)  
• AD8 - Analog Input 8 with selectable divider for 0…5.0 V and 0…18 V  
measurement range.  
• WU5 - Selectable Wake-up input 5 for wake-up and cyclic sense during low  
power mode.  
See High Voltage Inputs - Lx. Note: This pin function is not available on all device  
configurations.  
Note:  
8. An optional filter capacitor CLX is recommended to be placed between the board connector and RLX to GND for increased ESD  
performance.  
Low-side output 1 used to drive small inductive loads like relays. The output is  
short-circuit protected, includes active clamp circuitry and can be also controlled by  
the PWM module.  
37  
38  
LS1  
Low-side Output 1  
Power Ground Pin  
See Low-side Drivers - LSx  
This pin is the device Low-side Ground connection. DGND, LGND and AGND are  
internally connected to PGND via a back to back diode.  
PGND  
MM912_634 Advance Information, Rev. 11.0  
9
Freescale Semiconductor  
 
Pin Assignment  
Table 3. MM912_634 Pin Description (continued)  
Pin #  
Pin Name  
Formal Name  
Description  
Low-side output 2 used to drive small inductive loads like relays. The output is  
short-circuit protected, includes active clamp circuitry and can be also controlled by  
the PWM module.  
39  
LS2  
Low-side Output 2  
See Low-side Drivers - LSx  
Current Sense differential input “Low”. This pin is used in combination with  
ISENSEH to measure the voltage drop across a shunt resistor. See Current Sense  
Module - ISENSE. Note: This pin function is not available on all device  
configurations.  
40  
41  
ISENSEL  
ISENSEH  
Current Sense Pin L  
Current Sense Pin H  
Current Sense differential input “High”. This pin is used in combination with  
ISENSEL to measure the voltage drop across a shunt resistor. Current Sense  
Module - ISENSE. Note: This pin function is not available on all device  
configurations.  
42  
43  
NC  
Not connected  
Test Mode  
This pin is reserved for alternative function and should be left floating.  
Analog die Test Mode pin for Test Mode only. This pin must be grounded in user  
mode.  
TEST_A  
Test Mode Clock Input pin for Test Mode only. The pin can be used to disable the  
internal watchdog for development purpose in user mode. See Window Watchdog.  
The pin is recommended to be grounded in user mode.  
44  
45  
46  
TCLK  
RESET_A  
RESET  
Test Clock Input  
Reset I/O  
Bidirectional Reset I/O pin of the analog die. Active low signal. Internal pull-up. VDDX  
based. See Resets. To be externally connected to the RESET pin.  
The RESET pin is an active low bidirectional control signal. It acts as an input to  
initialize the MCU to a known start-up state, and an output when an internal MCU  
function causes a reset. The RESET pin has an internal pull-up device to VDDRX.  
MCU Reset  
The BKGD/MODC pin is used as a pseudo-open-drain pin for the background  
MCU Background Debug debug communication. It is used as MCU operating mode select pin during reset.  
47  
48  
BKGD  
PA7  
and Mode  
The state of this pin is latched to the MODC bit at the rising edge of RESET. The  
BKGD pin has a pull-up device.  
General purpose port A input or output pin 7. See Port Integration Module  
(S12IPIMV1)  
MCU PA7  
3.2  
MCU Die Signal Properties  
This section describes the external MCU signals. It includes a table of signal properties.  
Table 4. Signal Properties Summary  
Internal Pull Resistor  
Pin Name  
Function 1  
Pin Name  
Function 2  
Power  
Supply  
Description  
Reset  
State  
CTRL  
PUPEE/  
OSCPINS_EN  
PE0  
PE1  
EXTAL  
XTAL  
VDDRX  
VDDRX  
DOWN  
DOWN  
Port E I/O, Oscillator pin  
Port E I/O, Oscillator pin  
PUPBE/  
OSCPINS_EN  
RESET  
TEST  
BKGD  
PA7  
VDDRX  
N.A.  
PULLUP  
External reset  
Test input  
RESET pin  
BKPUE  
NA  
DOWN  
UP  
MODC  
VDDRX  
VDDRX  
VDDRX  
VDDRX  
VDDRX  
VDDRX  
VDDRX  
Background debug  
Port A I/O  
NA  
PA6  
NA  
NA  
Port A I/O  
PA5  
NA  
NA  
Port A I/O  
PA4  
NA  
NA  
Port A I/O  
PA3  
SS  
NA  
NA  
Port A I/O, SPI  
Port A I/O, SPI  
PA2  
SCK  
NA  
NA  
MM912_634 Advance Information, Rev. 11.0  
10  
Freescale Semiconductor  
Pin Assignment  
Table 4. Signal Properties Summary (continued)  
Internal Pull Resistor  
CTRL  
Pin Name  
Function 1  
Pin Name  
Function 2  
Power  
Supply  
Description  
Reset  
State  
PA1  
PA0  
MOSI  
MISO  
VDDRX  
VDDRX  
NA  
NA  
NA  
NA  
Port A I/O, SPI  
Port A I/O, SPI  
PUPCE/  
D2DEN  
PC1  
PC0  
D2DINT  
D2DCLK  
VDDD2D  
VDDD2D  
VDDD2D  
Disabled  
NA  
Port C I/O, D2DI  
Port C I/O, D2DI  
Port D I/O, D2DI  
NA  
PUPDE/  
D2DEN  
PD7-0  
D2DDAT7-0  
Disabled  
MM912_634 Advance Information, Rev. 11.0  
11  
Freescale Semiconductor  
Electrical Characteristics  
4
Electrical Characteristics  
General  
4.1  
This section contains electrical information for the embedded 9S12I64 microcontroller die, as well as the 912_634 analog die.  
4.2  
Absolute Maximum Ratings  
Absolute maximum ratings are stress ratings only. A functional operation under or outside those maxima is not guaranteed.  
Stress beyond those limits may affect the reliability or cause permanent damage of the device.  
This device contains circuitry protecting against damage due to high static voltage or electrical fields. However, it is advised that  
normal precautions be taken to avoid application of any voltages higher than maximum rated voltages to this high-impedance  
circuit. Reliability of operation is enhanced if unused inputs are tied to an appropriate voltage level. All voltages are with respect  
to ground, unless otherwise noted.  
Table 5. Absolute Maximum Electrical Ratings - Analog Die  
Ratings  
Symbol  
Value  
Unit  
Supply Voltage at VS1 and VS2  
Normal operation (DC)  
VSUP(SS)  
VSUP(PK)  
VSUP(TR)  
-0.3 to 27  
V
Transient conditions (load dump)  
-0.3 to 40  
(9)  
Transient input voltage with external component (according to LIN  
Conformance Test Specification / ISO7637-2)  
L0…L5 - Pin Voltage  
Normal operation with a series RLX resistor (DC)  
VLxDC  
VLxTR  
V
V
27 to 40  
Transient input voltage with external component (according to LIN  
Conformance Test Specification / ISO7637-2)  
(9)  
LIN Pin Voltage  
Normal operation (DC)  
VBUSDC  
VBUSTR  
-33 to 40  
Transient input voltage with external component (according to LIN  
Conformance Test Specification / ISO7637-2)  
(9)  
Supply Voltage at VDDX  
Supply Voltage at VDD (10)  
VDDX  
VDD  
-0.3 to 5.5  
-0.3 to 2.75  
V
V
A
A
V
V
V
V
V
V
V
V
VDD Output Current  
IVDD  
Internally Limited  
Internally Limited  
-0.3 to 10  
VDDX Output Current  
IVDDX  
VTCLK  
VIN  
TCLK Pin Voltage  
RESET_A Pin Voltage  
-0.3 to VDDx+0.3  
-0.3 to VDDx+0.3  
-0.3 to VS2+0.3  
-0.3 to 45  
Input / Output Pins PTB[0:2] Voltage  
HS1 and HS2 Pin Voltage (DC)  
LS1 and LS2 Pin Voltage (DC)  
ISENSEH and ISENSEL Pin Voltage (DC)  
HSUP Pin Voltage (DC)  
VIN  
VHS  
VLS  
VISENSE  
VHSUP  
VVSENSE  
-0.3 to 40  
-0.3 to VS1+0.3  
-27 to 40  
VSENSE Pin Voltage (DC)  
Note:  
9. See Section 4.9, “Additional Test Information ISO7637-2"  
10. Caution: As this pin is adjacent to the VDDX pin, care should be taken to avoid a short between VDD and VDDX, for example during  
soldering process. A short-circuit between these pins might lead to permanent damage.  
MM912_634 Advance Information, Rev. 11.0  
12  
Freescale Semiconductor  
 
 
Electrical Characteristics  
Table 6. Maximum Electrical Ratings - MCU Die(11)  
Ratings  
Symbol  
Value  
Unit  
5.0 V Supply Voltage (Supplying the MCU internal regulator for core and  
flash)  
VDDRX  
-0.3 to 6.0  
V
2.5 V D2D - Supply Voltage  
VDDD2D  
VIN  
-0.3 to 3.6  
-0.3 to 6.0  
-0.3 to 2.16  
-0.3 to 10.0  
V
V
V
V
Digital I/O input voltage (PA0...PA7, PE0, PE1)  
EXTAL, XTAL (PE0 and PE1 in alternative configuration)  
TEST Input  
VILV  
VTEST  
Instantaneous Maximum Current  
Single pin limit for all digital I/O pins  
ID  
-25 to 25  
-25 to 25  
mA  
mA  
Instantaneous Maximum Current  
Single pin limit for EXTAL, XTAL  
IDL  
Note:  
11. All digital I/O pins are internally clamped to VSSRX and VDDRX.  
Table 7. Maximum Thermal Ratings  
Ratings  
Symbol  
Value  
Unit  
Storage Temperature  
TSTG  
-55 to 150  
C  
Package, Thermal Resistance - LQFP48-EP  
Four layer board (JEDEC 2s2p)  
°C/W  
Junction to Ambient Natural Convection (12)  
RJA  
RJB  
38  
16  
Junction to Board (14)  
Two layer board (JEDEC 1s)  
RJA  
91  
Junction to Ambient Natural Convection (12), (13)  
Package, Thermal Resistance - LQFP48  
Four layer board (JEDEC 2s2p)  
°C/W  
Junction to Ambient Natural Convection (12)  
RJA  
RJB  
59  
31  
Junction to Board (14)  
Two layer board (JEDEC 1s)  
RJA  
96  
Junction to Ambient Natural Convection (12), (13)  
(16)  
Peak Package Reflow Temperature During Reflow(15)  
,
°C  
TPPRT  
Note 16  
Notes  
12. Junction temperature is a function of die size, on-chip power dissipation, package thermal resistance, mounting site (board)  
temperature, ambient temperature, air flow, power dissipation of other components on the board, and board thermal resistance.  
13. Per JEDEC JESD51-6 with the board (JESD51-7) horizontal.  
14. Thermal resistance between the die and the printed circuit board per JEDEC JESD51-8. Board temperature is measured on the top  
surface of the board near the package.  
15. Pin soldering temperature limit is for 10 seconds maximum duration. Not designed for immersion soldering. Exceeding these limits may  
cause malfunction or permanent damage to the device.  
16. Freescale’s Package Reflow capability meets Pb-free requirements for JEDEC standard J-STD-020C. For Peak Package Reflow  
Temperature and Moisture Sensitivity Levels (MSL), Go to www.freescale.com, search by part number [e.g. remove prefixes/suffixes  
and enter the core ID to view all orderable parts (i.e. MC33xxxD enter 33xxx), and review parametrics.  
MM912_634 Advance Information, Rev. 11.0  
13  
Freescale Semiconductor  
 
 
 
 
 
 
Electrical Characteristics  
4.3  
Operating Conditions  
This section describes the operating conditions of the device. Unless otherwise noted those conditions apply to all the following  
data.  
Table 8. Operating Conditions  
Ratings  
Analog Die Nominal Operating Voltage  
Symbol  
Value  
Unit  
VSUP  
5.5 to 18  
V
Analog Die Functional Operating Voltage - Device is fully functional. All  
features are operating.  
VSUPOP  
5.5 to 27  
V
MCU I/O and Supply Voltage(17)  
MCU Digital Logic Supply Voltage(17)  
VDDRX  
4.75 to 5.25  
2.25 to 2.75  
V
V
VDDD2D  
MCU Oscillator  
MM912x634xxxAE  
MM912x634xxxAP  
fOSC  
fBUS  
TA  
4.0 to 16  
4.0 to 16  
MHz  
MHz  
C  
MCU Bus frequency  
MM912x634xxxAE  
MM912x634xxxAP  
(18)  
fBUSMAX  
Operating Ambient Temperature  
MM912x634xMxxx  
-40 to 125  
-40 to 105  
MM912x634xVxxx  
Operating Junction Temperature - Analog Die  
Operating Junction Temperature - MCU Die  
TJ_A  
TJ_M  
-40 to 150  
-40 to 150  
C  
C  
Note:  
17. During power up and power down sequence always VDDD2D < VDDRX  
18. fBUSMAX frequency ratings differ by device and is specified in Table 1  
4.4  
Supply Currents  
This section describes the current consumption characteristics of the device as well as the conditions for the measurements.  
4.4.1 Measurement Conditions  
All measurements are without output loads. Currents are measured in MCU special single chip mode and the CPU code is  
executed from RAM, unless otherwise noted.  
Table 9. Supply Currents  
Ratings  
Symbol  
Min  
Typ(19)  
Max  
Unit  
Normal Mode analog die only, excluding external loads, LIN Recessive State  
(5.5 V VSUP 18 V, 2.25 V VDD 2.75 V, 4.5 V VDDX 5.5 V, -40 °C   
TJ_A 150 °C).  
IRUN_A  
-
5.0  
8.0  
mA  
Normal Mode MCU die only (TJ_(2M0=)(1215)0 °C; VDDD2D = 2.75 V, VDDRX = 5.5 V,  
IRUN_M  
-
18  
20  
mA  
µA  
f
OSC = 4.0 MHz, fBUS= fBUSMAX  
Stop Mode internal analog die only, excluding external loads, LIN Recessive  
State, Lx enabled, measured at VS1+VS2 (5.5 V VSUP 18 V, 2.25 V VDD  
2.75 V, 4.5 V VDDX 5.5 V)  
ISTOP_A  
-40 °C TJ_A 125 °C  
-
20  
40  
Stop Mode MCU die only (VDDD2D = 2.75 V, VDDRX = 5.5 V, fOSC= 4.0 MHz;  
MCU in STOP; RTI and COP off)(22)  
TJ_M=150°C  
TJ_M=-40°C  
TJ_M=25°C  
ISTOP_M  
-
-
-
85  
31  
31  
150  
50  
50  
µA  
MM912_634 Advance Information, Rev. 11.0  
14  
Freescale Semiconductor  
 
 
 
Electrical Characteristics  
Table 9. Supply Currents (continued)  
Ratings  
Symbol  
Min  
Typ(19)  
Max  
Unit  
Sleep Mode (VDD = VDDX = OFF; 5.5 V VSUP 18 V; -40 °C TJ_A  
125 °C; 3.0 V Lx 1.0 V)  
ISLEEP  
ICS  
-
-
15  
15  
28  
20  
µA  
µA  
Cyclic Sense Supply Current Adder (5.0 ms Cycle)  
Note:  
19. Typical values noted reflect the approximate parameter mean at TA = 25 °C  
20.  
21.  
22.  
f
I
I
BUSMAX frequency ratings differ by device and is specified in Table 1  
RUN_M denotes the sum of the currents flowing into VDD and VDDX.  
STOP_M denotes the sum of the currents flowing into VDD and VDDX.  
MM912_634 Advance Information, Rev. 11.0  
15  
Freescale Semiconductor  
Electrical Characteristics  
4.5  
Static Electrical Characteristics  
All characteristics noted under the following conditions:  
5.5 V VSUP 18 V  
-40 °C TA 125 °C (MM912x634xMxxx)  
-40 °C TA 105 °C (MM912x634xVxxx)  
Typical values noted reflect the approximate parameter mean at TA = 25 °C under nominal conditions, unless otherwise noted.  
4.5.1 Static Electrical Characteristics Analog Die  
Table 10. Static Electrical Characteristics - Power Supply  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Power-On Reset (POR) Threshold (measured on VS1)  
VPOR  
1.5  
-
3.5  
V
Low Voltage Warning (LVI)  
Threshold (measured on VS1, falling edge)  
Hysteresis (measured on VS1)  
VLVI  
VLVI_H  
5.55  
-
6.0  
1.0  
6.6  
-
V
V
V
High Voltage Warning (HVI)  
Threshold (measured on VS2, rising edge)  
Hysteresis (measured on VS2)  
VHVI  
VHVI_H  
18  
-
19.25  
1.0  
20.5  
-
Low Battery Warning (LBI)  
Threshold (measured on VSENSE, falling edge)  
Hysteresis (measured on VSENSE)  
VLBI  
VLBI_H  
5.55  
-
6.0  
1.0  
6.6  
-
J2602 Undervoltage threshold  
VJ2602UV  
VLVRX  
5.5  
2.7  
5.7  
3.0  
6.2  
3.3  
2.4  
2.1  
3.0  
6.1  
V
V
V
V
V
V
Low VDDX Voltage (LVRX) Threshold  
Low VDD Voltage Reset (LVR) Threshold Normal Mode  
Low VDD Voltage Reset (LVR) Threshold Stop Mode (23)  
VDD Overvoltage Threshold (VROV)  
VDDX Overvoltage Threshold (VROVX)  
Note:  
VLVR  
2.30  
1.6  
2.35  
VLVRS  
1.85  
VVDDOV  
VVDDXOV  
2.575  
5.25  
2.7875  
5.675  
23. See MM912_634ER - MM912_634, Silicon Analog Mask (M91W) / Digital Mask (N53A) Errata  
Table 11. Static Electrical Characteristics - Resets  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Low-state Output Voltage IOUT = 2.0 mA  
Pull-up Resistor  
VOL  
RRPU  
VIL  
-
-
-
0.8  
V
kOhm  
V
25  
50  
Low-state Input Voltage  
-
-
0.3VDDX  
High-state Input Voltage  
VIH  
0.7VDDX  
-
-
-
V
Reset Release Voltage (VDDX)  
RESET_A pin Current Limitation  
VRSTRV  
-
1.5  
7.5  
V
5.0  
10  
mA  
Table 12. Static Electrical Characteristics - Window Watchdog  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Watchdog Disable Voltage (fixed voltage)  
Watchdog Enable Voltage (fixed voltage)  
VTST  
7.0  
-
-
-
10  
V
V
VTSTEN  
5.5  
MM912_634 Advance Information, Rev. 11.0  
16  
Freescale Semiconductor  
 
Electrical Characteristics  
Table 13. Static Electrical Characteristics - Voltage Regulator 5.0 V (VDDX)  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Normal Mode Output Voltage  
1.0 mA < IVDDX + IVDDXINTERNAL < 80 mA; 5.5 V < VSUP < 27 V (24)  
Normal Mode Output Current Limitation (IVDDX  
VDDXRUN  
V
4.75  
80  
5.00  
130  
5.25  
200  
)
IVDDXRUN  
VDDXSTOP  
IVDDXSTOP  
mA  
V
Stop Mode Output Voltage (IVDDX + IVDDXINTERNAL < 500 μA for TJ  
25 °C; IVDDX + IVDDXINTERNAL < 400 μA for TJ < 25 °C) (24)  
-
5.0  
-
5.5  
20  
Stop Mode Output Current Limitation (IVDDX  
)
1.0  
mA  
Line Regulation  
Normal Mode, IVDDX = 80 mA  
LRXRUN  
LRXSTOP  
-
-
20  
-
25  
200  
mV  
mV  
Stop Mode, IVDDX = 500 µA  
Load Regulation  
Normal Mode, 1.0 mA < IVDDX < 80 mA  
LDXRUN  
LDXCRK  
LDXSTOP  
-
-
-
15  
-
-
80  
200  
250  
Normal Mode, VSUP = 3.6 V, 1.0 mA < IVDDX < 40 mA  
Stop Mode, 0.1 mA < IVDDX < 500 µA  
External Capacitor  
External Capacitor ESR  
Note:  
CVDDX  
1.0  
-
-
-
10  
10  
µF  
CVDDX_R  
Ohm  
24.  
IVDDXINTERNAL includes internal consumption from both analog and MCU die.  
Table 14. Static Electrical Characteristics - Voltage Regulator 2.5 V (VDD)  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Normal Mode Output Voltage  
1.0 mA < IVDD + IVDDINTERNAL 45 mA; 5.5 V < VSUP < 27 V (25)  
VDDRUN  
V
2,425  
2.5  
2,575  
Normal Mode Output Current Limitation (IVDD  
TJ < 25 °C  
)
IVDDLIMRUN  
-
-
80  
80  
120  
143  
mA  
TJ 25 °C  
Stop Mode Output Voltage (IVDD + IVDDINTERNAL < 500 μA for TJ 25 °C;  
VDD + IVDDINTERNAL < 400 μA for TJ < 25 °C) (25)  
VDDSTOP  
2.25  
-
2.5  
-
2.75  
10  
V
I
Stop Mode Output Current Limitation (IVDD  
)
IVDDLIMSTOP  
mA  
Line Regulation  
Normal Mode, IVDD = 45 mA  
LRRUN  
LRSTOP  
-
-
10  
-
12.5  
200  
mV  
mV  
Stop Mode, IVDD = 1.0 mA  
Load Regulation  
Normal Mode, 1.0 mA < IVDD < 45 mA  
LDRUN  
LDCRK  
LDSTOP  
-
-
-
7.5  
-
-
40  
40  
200  
Normal Mode, VSUP = 3.6 V, 1.0 mA < IVDD < 30 mA  
Stop Mode, 0.1 mA < IVDD < 1.0 mA  
External Capacitor  
External Capacitor ESR  
Note:  
CVDD  
1.0  
-
-
-
10  
10  
µF  
CVDD_R  
Ohm  
25.  
IVDDINTERNAL includes internal consumption from both analog and MCU die.  
MM912_634 Advance Information, Rev. 11.0  
17  
Freescale Semiconductor  
 
 
Electrical Characteristics  
Table 15. Static Electrical Characteristics - Hall Sensor Supply Output - HSUP  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Current Limitation  
IHSUP  
40  
70  
90  
mA  
Output Drain-to-Source On resistance  
TJ = 150 °C, ILOAD = 30 mA; 5.5 V VSUP 16 V  
RDS(ON)  
-
-
-
-
10  
12  
Ohm  
TJ = 150 °C, ILOAD = 30 mA; 3.7 V VSUP < 5.5 V  
Output Voltage: (18 V VSUP 27 V)  
Load Regulation (1.0 mA < IHSUP < 30 mA; VSUP > 18 V)  
Hall Supply Capacitor Range  
VHSUPMAX  
LDHSUP  
16  
17.5  
18  
500  
10  
V
-
0.22  
-
-
-
-
mV  
µF  
CHSUP  
External Capacitor ESR  
CHSUP_R  
10  
Ohm  
Table 16. Static Electrical Characteristics - High-side Drivers - HS  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Output Drain-to-Source On resistance  
TJ = 25 °C, ILOAD = 50 mA; VSUP > 9.0 V  
-
-
-
-
-
-
7.0  
10  
14  
RDS(ON)  
Ohm  
TJ = 150 °C, ILOAD = 50 mA; VSUP > 9.0 V  
TJ = 150 °C, ILOAD = 30 mA; 5.5 V < VSUP < 9.0 V  
Output Current Limitation (0 V < VOUT < VSUP - 2.0 V)  
Open Load Current Detection  
ILIMHSX  
IOLHSX  
ILEAK  
60  
110  
5.0  
-
250  
7.5  
10  
-
mA  
mA  
µA  
V
-
Leakage Current (-0.2 V < VHSx < VS2 + 0.2 V)  
Current Limitation Flag Threshold (5.5 V < VSUP < 27 V)  
-
VTHSC  
VSUP -2  
-
Table 17. Static Electrical Characteristics - Low-side Drivers - LS  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Output Drain-to-Source On resistance  
TJ = 25 °C, ILOAD = 150 mA, VSUP > 9.0 V  
TJ = 150 °C, ILOAD = 150 mA, VSUP > 9.0 V  
TJ = 150 °C, ILOAD = 120 mA, 5.5 V < VSUP < 9.0 V  
2.5  
4.5  
10  
RDS(ON)  
Ohm  
Output Current Limitation (2.0 V < VOUT < VSUP  
Open Load Current Detection  
)
ILIMLSX  
IOLLSX  
ILEAK  
180  
-
275  
380  
12  
mA  
mA  
µA  
8.0  
Leakage Current (-0.2 V < VOUT < VS1)  
Active Output Energy Clamp (IOUT = 150 mA)  
Coil Series Resistance (IOUT = 150 mA)  
Coil Inductance (IOUT = 150 mA)  
-
-
-
-
-
-
10  
VCLAMP  
RCOIL  
RCOIL  
VTHSC  
40  
120  
-
45  
V
Ohm  
m  
V
400  
-
Current Limitation Flag Threshold (5.5 V < VSUP < 27 V)  
2.0  
MM912_634 Advance Information, Rev. 11.0  
18  
Freescale Semiconductor  
Electrical Characteristics  
Table 18. Static Electrical Characteristics - LIN Physical Layer Interface - LIN  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Current Limitation for Driver dominant state. VBUS = 18 V  
IBUSLIM  
40  
120  
200  
mA  
Input Leakage Current at the Receiver incl. Pull-up Resistor  
RSLAVE; Driver OFF; VBUS = 0 V; VBAT = 12 V  
IBUS_PAS_DOM  
-1.0  
-
-
mA  
Input Leakage Current at the Receiver incl. Pull-up Resistor  
RSLAVE; Driver OFF;  
IBUS_PAS_REC  
-
-
20  
µA  
8.0 V < VBAT < 18 V; 8.0 V < VBUS < 18 V; VBUS VBAT  
Input Leakage Current; GND Disconnected; GNDDEVICE = VSUP;  
0 < VBUS < 18 V; VBAT = 12 V  
IBUS_NO_GND  
-1.0  
-
-
-
1.0  
mA  
µA  
Input Leakage Current; VBAT disconnected; VSUP_DEVICE =  
GND; 0 < VBUS < 18 V  
IBUS_NO_BAT  
100  
Receiver Input Voltage; Receiver Dominant State  
Receiver Input Voltage; Receiver Recessive State  
Receiver Threshold Center (VTH_DOM + VTH_REC)/2  
VBUSdom  
VBUSrec  
VBUS_CNT  
VBUS_HYS  
Dser_int  
Rslave  
-
0.6  
0.475  
-
-
-
0.4  
-
VSUP  
VSUP  
VSUP  
VSUP  
V
0.5  
-
0.525  
0.175  
1.0  
Receiver Threshold Hysteresis (VTH_REC - VTH_DOM  
Voltage Drop at the serial Diode  
LIN Pull-up Resistor  
)
0.4  
20  
0.7  
30  
5.0  
-
60  
kOhm  
V
Bus Wake-up Threshold from Stop or Sleep  
Bus Dominant Voltage  
VWUP  
4.0  
-
6.0  
VDOM  
2.5  
V
Table 19. Static Electrical Characteristics - High Voltage Inputs - Lx  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Low Detection Threshold  
VTHL  
VTHH  
VHYS  
V
2.2  
1.5  
2.5  
2.5  
3.4  
4.0  
(7.0 V VSUP 27 V)  
(5.5 V VSUP 7.0 V)  
High Detection Threshold  
V
V
2.6  
2.0  
3.0  
3.0  
3.7  
4.5  
(7.0 V VSUP 27 V)  
(5.5 V VSUP 7.0 V)  
Hysteresis  
0.25  
0.45  
1.0  
(5.5 V < VSUP < 27 V)  
Input Current Lx (-0.2 V < VIN < VS1)  
Analog Input Impedance Lx  
Lx Series Resistor  
IIN  
RLxIN  
RLX  
-10  
-
-
-
10  
1.2  
10.5  
-
µA  
MOhm  
kOhm  
nF  
9.5  
-
10  
100  
Lx Capacitor (optional)(26)  
CLX  
Analog Input Divider Ratio (RATIOLx = VLx / VADOUT0  
)
LXDS (Lx Divider Select) = 0  
RATIOLx  
RATIOLX  
LxMATCH  
-
-
2.0  
7.2  
-
-
LXDS (Lx Divider Select) = 1  
Analog Input Divider Ratio Accuracy  
-5.5  
-
5.5  
%
%
Analog Inputs Channel Ratio - Mismatch  
LXDS (Lx Divider Select) = 0  
-
-
-
-
5.0  
5.0  
LXDS (Lx Divider Select) = 1  
Note:  
26. The ESD behavior specified in Section 4.8, “ESD Protection and Latch-up Immunity" are guaranteed without the optional capacitor.  
MM912_634 Advance Information, Rev. 11.0  
19  
Freescale Semiconductor  
 
Electrical Characteristics  
Table 20. Static Electrical Characteristics - General Purpose I/O - PTB[0…2]  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Input High Voltage  
VIH  
VIL  
0.7VDDX  
VSS-0.3  
-
-
VDDX+0.3  
0.35VDDX  
-
V
V
Input Low Voltage  
-
140  
-
Input Hysteresis  
VHYS  
VIH3.7  
VIL3.7  
VHYS3.7  
mV  
V
Input High Voltage (VS1 = 3.7 V)  
Input Low Voltage (VS1 = 3.7 V)  
Input Hysteresis (VS1 = 3.7 V)  
2.1  
VDDX+0.3  
1.4  
VSS-0.3  
100  
-
V
200  
300  
mV  
Input Leakage Current (pins in high-impedance input mode)  
(VIN = VDDX or VSSX  
IIN  
-1.0  
-
1.0  
µA  
)
Output High Voltage (pins in output mode) Full drive IOH = -10 mA  
Output Low Voltage (pins in output mode) Full drive IOL = 10 mA  
Internal Pull-up Resistance (VIH min > Input voltage > VIL max)  
Input Capacitance  
VOH  
VOL  
VDDX-0.8  
-
-
0.8  
48.75  
-
V
V
-
-
RPUL  
CIN  
26.25  
37.5  
kOhm  
pF  
-
6.0  
Clamp Voltage when selected as analog input  
Analog Input impedance = 10 kOhm max, Capacitance = 12 pF  
Analog Input Capacitance = 12 pF  
VCL_AIN  
RAIN  
VDD  
-
-
-
V
-
-
10  
-
kOhm  
pF  
CAIN  
12  
-
Maximum current all PTB combined (VDDX capability)  
Output Drive strength at 10 MHz  
IBMAX  
COUT  
-15  
-
15  
100  
mA  
pF  
-
Table 21. Static Electrical Characteristics - Analog Digital Converter - ADC(27)  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
ADC2p5 Reference Voltage  
5.5 V < VSUP < 27 V  
VADC2p5RU  
V
2,45  
-
2.5  
-
2.55  
100  
N
ADC2p5 Reference Stop Mode Output Voltage  
VADC2p5ST  
mV  
OP  
Line Regulation, Normal Mode  
External Capacitor  
LRRUNA  
-
10  
-
12.5  
1.0  
10  
mV  
µF  
CADC2p5  
CVDD_R  
ESCALE  
EDNL  
EINL  
0.1  
-
External Capacitor ESR  
-
Ohm  
LSB  
LSB  
LSB  
LSB  
LSB  
LSB  
Scale Factor Error  
-1  
-
1
Differential Linearity Error  
Integral Linearity Error  
-1.5  
-1.5  
-2.0  
-0.5  
-5.0  
-
1.5  
1.5  
2.0  
0.5  
5.0  
-
Zero Offset Error  
EOFF  
EQ  
-
Quantization Error  
-
Total Error with offset compensation  
TE  
-
Bandgap measurement Channel (CH14) Valid Result Range  
ADCH14  
1.1  
1.25  
1.4  
V
(including ±7.0% bg1p25sleep accuracy + high-impedance measurement  
(28)  
error of ±5.0% at fADC  
)
Note:  
27. No external load allowed on the ADC2p5 pin.  
28. Reduced ADC frequency will lower measurement error.  
MM912_634 Advance Information, Rev. 11.0  
20  
Freescale Semiconductor  
 
 
Electrical Characteristics  
Table 22. Static Electrical Characteristics - Current Sense Module - ISENSE  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Gain  
CSGS (Current Sense Gain Select) = 000  
CSGS (Current Sense Gain Select) = 001  
CSGS (Current Sense Gain Select) = 010  
CSGS (Current Sense Gain Select) = 011  
CSGS (Current Sense Gain Select) = 100  
CSGS (Current Sense Gain Select) = 101  
CSGS (Current Sense Gain Select) = 110  
CSGS (Current Sense Gain Select) = 111  
-
-
-
-
-
-
-
-
7
9
-
-
-
-
-
-
-
-
10  
12  
14  
18  
24  
36  
G
Gain Accuracy  
-3.0  
-1.5  
-
-
-
3.0  
1.5  
-
%
%
Offset  
Resolution(29)  
RES  
VIN  
51  
-
mA/LSB  
V
ISENSEH, ISENSEL Input Common Mode Voltage Range  
-0.2  
3.0  
Current Sense Module - Normal Mode Current Consumption Adder  
(CSE = 1)  
IISENSE  
-
600  
-
µA  
Note:  
29. RES = 2.44 mV/(GAIN*RSHUNT  
)
Table 23. Static Electrical Characteristics - Temperature Sensor - TSENSE  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Internal Chip Temperature Sense Gain(30)  
TSG  
TSErr  
-
9.17  
-
-
mV/k  
°C  
Internal Chip Temperature Sense Error at the end of conversion(30)  
Temperature represented by a ADCIN Voltage of 0.150 V(30)  
Temperature represented by a ADCIN Voltage of 1.984 V(30)  
–5.0  
-55  
145  
5.0  
-45  
155  
T0.15V  
T1.984V  
-50  
150  
°C  
°C  
Note:  
30. Guaranteed by design and characterization.  
Table 24. Static Electrical Characteristics - Supply Voltage Sense - VSENSE and VS1SENSE  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
VSENSE Input Divider Ratio (RATIOVSENSE = VVSENSE / ADCIN)  
5.5 V < VSUP < 27 V  
RATIOVSENS  
E
-
-
-
10.8  
-
5.0%  
5.0  
VSENSE error - whole path (VSENSE pad to Digital value)  
ErVSENSE  
%
VS1SENSE Input Divider Ratio (RATIOVS1SENSE = VVS1SENSE / ADCIN)  
5.5 V < VSUP < 27 V  
RATIOVS1SE  
NSE  
10.8  
5.0%  
VS1SENSE error - whole path (VS1 pad to Digital value)  
ErVS1SENSE  
-
9.5  
-
-
5.0  
10.5  
-
%
kOhm  
nF  
VSENSE Series Resistor  
RVSENSE  
CVSENSE  
10  
VSENSE Capacitor (optional)(31)  
Note:  
100  
31. The ESD behavior specified in Section 4.8, “ESD Protection and Latch-up Immunity" is guaranteed without the optional capacitor.  
MM912_634 Advance Information, Rev. 11.0  
21  
Freescale Semiconductor  
 
 
 
Electrical Characteristics  
4.5.2  
Static Electrical Characteristics MCU Die  
I/O Characteristics  
4.5.2.1  
This section describes the characteristics of all I/O pins except EXTAL, XTAL, TEST and supply pins.  
Table 25. 5.0 V I/O Characteristics for PTA, PTE, RESET and BKGD Pins  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Input high voltage  
Input high voltage  
VIH  
0.65*VDDRX  
-
-
V
VDDRX  
0.3  
+
VIH  
VIL  
-
-
-
-
V
V
Input low voltage  
0.35*VDDR  
X
Input low voltage  
Input hysteresis  
VIL  
VSSRX - 0.3  
-
-
-
V
VHYS  
250  
-
mV  
Input leakage current (pins in high-impedance input mode)  
= V or V  
IIN  
-1.0  
-
1.0  
A  
V
IN  
DDRX  
SSRX  
Output high voltage (pins in output mode) IOH = -4.0 mA  
Output low voltage (pins in output mode) IOL = +4.0 mA  
Internal pull-up resistance (VIHmin > input voltage > VILmax)  
Internal pull-down resistance (VIHmin > input voltage > VILmax)  
Input capacitance  
VOH  
VOL  
VDDRX – 0.8  
-
-
V
-
-
-
0.8  
50  
50  
-
V
RPUL  
RPDH  
Cin  
25  
25  
-
k  
k  
pF  
-
6.0  
Injection current(32)  
Single pin limit  
IICS  
IICP  
-2.5  
-25  
-
-
2.5  
25  
mA  
Total device Limit, sum of all injected currents  
Note:  
32. Refer to Section 4.8, “ESD Protection and Latch-up Immunity" for more details.  
4.5.2.2  
Electrical Specification for MCU internal Voltage Regulator  
Table 26. IVREG Characteristics  
Characteristic  
Symbol  
Min  
Typical  
Max  
Unit  
Input Voltages  
VVDDRA  
3.13  
5.5  
V
V
VDDRX Low Voltage Interrupt Assert Level  
VDDRX Low Voltage Interrupt Deassert Level  
VLViA  
VLVID  
4.04  
4.19  
4.23  
4.38  
4.40  
4.49  
V
DDRX Low Voltage Reset Deassert (33)(34)(35)  
VLVRXD  
VLVRXA  
3.05  
3.02  
3.13  
V
V
VDDRX Low Voltage Reset Assert (33)(34)(35)  
2.95  
Note:  
33. Device functionality is guaranteed on power down to the LVR assert level.  
34. Monitors VDDRX, active only in Full Performance mode. MCU is monitored by the POR in RPM (see Figure 4).  
35. Monitors VDDRX, active only in Full Performance mode. VLVRA and VPORD  
.
NOTE  
The LVR monitors the voltages VDD_CORE, VDDFLASH and VDDRX. As soon as voltage drops  
on these supplies which would prohibit the correct function of the microcontroller, the LVR is  
triggering a reset.  
MM912_634 Advance Information, Rev. 11.0  
22  
Freescale Semiconductor  
 
 
 
 
Electrical Characteristics  
4.5.2.3  
Chip Power-up and Voltage Drops  
LVI (low voltage interrupt), POR (power-on reset) and LVRs (low voltage reset) handle chip power-up or drops of the supply  
voltage.  
V
VDDRX  
VLVID  
VLVIA  
V
DD_Core  
VLVRD  
VLVRA  
VPORD  
t
LVI  
LVI enabled  
LVI disabled due to LVR  
POR  
LVR  
Figure 4. 9S12I32 - Chip Power-up and Voltage Drops (not scaled)  
4.6  
Dynamic Electrical Characteristics  
Dynamic characteristics noted under conditions 5.5 V VSUP 18 V, -40 °C TA 125 °C, unless otherwise noted. Typical  
values noted reflect the approximate parameter mean at TA = 25 °C under nominal conditions, unless otherwise noted.  
4.6.1  
Dynamic Electrical Characteristics Analog Die  
Table 27. Dynamic Electrical Characteristics - Modes of Operation  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
VDD Short Timeout  
Analog Base Clock  
Reset Delay  
tVTO  
fBASE  
tRST  
110  
-
150  
100  
200  
205  
-
ms  
kHz  
µs  
140  
280  
MM912_634 Advance Information, Rev. 11.0  
23  
Freescale Semiconductor  
 
Electrical Characteristics  
Table 28. Dynamic Electrical Characteristics - Power Supply(36)  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Glitch Filter Low Battery Warning (LBI)  
Glitch Filter Low Voltage Warning (LVI)  
Glitch Filter High Voltage Warning (HVI)  
tLB  
tLV  
tHV  
-
-
-
2.0  
2.0  
2.0  
-
-
-
µs  
µs  
µs  
Note:  
36. Guaranteed by design.  
Table 29. Dynamic Electrical Characteristics - Die to Die Interface - D2D  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
(37)  
Operating Frequency (D2DCLK, D2D[0:3])  
Note:  
fD2D  
-
-
fBUSMAX  
MHz  
37.  
fBUSMAX frequency ratings differ by device and is specified in Table 1  
Table 30. Dynamic Electrical Characteristics - Resets  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Reset Deglitch Filter Time  
Reset Low Level Duration  
tRSTDF  
1.2  
2.0  
3.0  
µs  
µs  
tRSTLOW  
140  
200  
280  
Table 31. Dynamic Electrical Characteristics - Wake-up / Cyclic Sense  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Lx Wake-up Filter Time  
tWUF  
CSAC  
CSACT  
tS  
-
20  
-
s  
%
%
-
Cyclic Sense / Forced Wake-up Timing Accuracy - not trimmed  
Cyclic Sense / Forced Wake-up Timing Accuracy - trimmed(38)  
Time between HSx on and Lx sense during cyclic sense  
HSx ON duration during Cyclic Sense  
-35  
-5.0  
35  
-
5.0  
same as tHSON / tHSONT  
tHSON  
tHSONT  
140  
200  
200  
280  
s  
s  
HSx ON duration during Cyclic Sense - trimmed(38)  
180  
220  
Note:  
38. No trimming possible in Sleep mode.  
Table 32. Dynamic Electrical Characteristics - Window Watchdog  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Initial Non-window Watchdog Timeout  
Watchdog Timeout Accuracy - not trimmed  
Watchdog Timeout Accuracy - trimmed  
tIWDTO  
WDAC  
WDACT  
110  
-35  
150  
190  
35  
ms  
%
-
-
-5.0  
5.0  
%
Table 33. Dynamic Electrical Characteristics - High-side Drivers - HS  
Ratings  
High-side Operating Frequency(39)  
Load Condition: CLOAD2.2 nF; RLOAD500   
Note:  
Symbol  
Min  
Typ  
Max  
Unit  
fHS  
kHz  
-
-
50  
39. Guaranteed by design.  
MM912_634 Advance Information, Rev. 11.0  
24  
Freescale Semiconductor  
 
 
 
 
Electrical Characteristics  
Table 34. Dynamic Electrical Characteristics - Low-side Drivers - LS  
Ratings  
Symbol  
fLS  
Min  
Typ  
Max  
Unit  
Low-side Operating Frequency  
-
-
10  
kHz  
Table 35. Dynamic Electrical Characteristics - LIN Physical Layer Interface - LIN  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
Bus Wake-up Deglitcher (Sleep and Stop mode)  
tPROPWL  
BRFAST  
tREC_PD  
tREC_SYM  
60  
80  
-
100  
100  
6.0  
2.0  
µs  
kBit/s  
µs  
Fast Bit Rate (Programming mode)  
-
-
Propagation Delay of Receiver, tREC_PD = MAX (tREC_PDR, tREC_PDF  
Symmetry of Receiver Propagation Delay, tREC_PDF - tREC_PDR  
)
-
-2.0  
-
µs  
LIN Driver - 20.0 kBit/s; Bus load conditions (CBUS; RBUS): 1.0 nF; 1.0 k/ 6,8 nF;660 / 10 nF;500 . Measurement thresholds: 50% of TXD  
signal to LIN signal threshold defined at each parameter. See Figure 5 and Figure 6.  
Duty Cycle 1:  
THREC(MAX) = 0.744 x VSUP  
THDOM(MAX) = 0.581 x VSUP  
D1  
D2  
0.396  
-
-
-
7.0 V VSUP18 V; tBit = 50 µs;  
D1 = tBUS_REC(MIN)/(2 x tBit  
)
Duty Cycle 2:  
THREC(MIN) = 0.422 x VSUP  
THDOM(MIN) = 0.284 x VSUP  
7.6 V VSUP18 V; tBIT = 50 µs  
-
0.581  
D2 = tBUS_REC(MAX)/(2 x tBIT  
)
LIN Driver - 10.0 kBit/s; Bus load conditions (CBUS; RBUS): 1.0 nF; 1.0 k/ 6,8 nF;660 / 10 nF;500  Measurement thresholds: 50% of TXD  
signal to LIN signal threshold defined at each parameter. See Figure 5 and Figure 7.  
Duty Cycle 3:  
THREC(MAX) = 0.778 x VSUP  
THDOM(MAX) = 0.616 x VSUP  
D3  
D4  
0.417  
-
-
-
7.0 V VSUP18 V; tBIT = 96 µs  
D3 = TBUS_REC(MIN)/(2 x tBIT  
)
Duty Cycle 4:  
THREC(MIN) = 0.389 x VSUP  
THDOM(MIN) = 0.251 x VSUP  
-
0.590  
7.6 V VSUP18 V; tBIT = 96 µs  
D4 = tBUS_REC(MAX)/(2 x tBIT  
)
LIN Transmitter Timing, (VSUP from 7.0 to 18 V) - See Figure 9  
Transmitter Symmetry  
ttran_sym < MAX(ttran_sym60%, ttran_sym40%)  
tran_sym60% = ttran_pdf60% - ttran_pdr60%  
tran_sym40% = ttran_pdf40% - ttran_pdr40%  
ttran_sym  
-7.25  
0
7.25  
µs  
MM912_634 Advance Information, Rev. 11.0  
25  
Freescale Semiconductor  
Electrical Characteristics  
Note: R and C = 1.0 k1.0 nF,  
0
0
660 /6.8 nF, a, d 500 /10 nF  
Figure 5. Test Circuit for Timing Measurements  
Figure 6. LIN Timing Measurements for Normal Baud Rate  
MM912_634 Advance Information, Rev. 11.0  
26  
Freescale Semiconductor  
Electrical Characteristics  
Figure 7. LIN Timing Measurements for Slow Baud Rate  
Figure 8. LIN Receiver Timing  
TX  
BUS  
60%  
40%  
ttran_pdf60%  
ttran_pdf40%  
ttran_pdr40%  
ttran_pdr60%  
Figure 9. LIN Transmitter Timing  
MM912_634 Advance Information, Rev. 11.0  
27  
Freescale Semiconductor  
Electrical Characteristics  
Table 36. Dynamic Electrical Characteristics - General Purpose I/O - PTB[0…2](40)  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
GPIO Digital Frequency  
fPTB  
tPDR  
tRISE  
tPDF  
tFALL  
-
-
-
-
-
-
-
-
-
-
10  
20  
MHz  
ns  
Propagation Delay - Rising Edge(41)  
Rise Time - Rising Edge(40)  
Propagation Delay - Falling Edge(40)  
Rise Time - Falling Edge(40)  
17.5  
20  
ns  
ns  
17.5  
ns  
Note:  
40. Guaranteed by design.  
41. Load PTBx = 100 pF.  
Table 37. Dynamic Electrical Characteristics - Analog Digital Converter - ADC(42)  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
ADC Operating Frequency  
fADC  
tCONV  
fCH14  
1.6  
2.0  
26  
-
2.4  
MHz  
clk  
Conversion Time (from ACCR write to CC Flag)  
Sample Frequency Channel 14 (Bandgap)  
-
2.5  
kHz  
Note:  
42. Guaranteed by design.  
4.6.2  
Dynamic Electrical Characteristics MCU Die  
NVM  
Timing Parameters  
4.6.2.1  
4.6.2.1.1  
The time base for all NVM program or erase operations is derived from the bus clock using the FCLKDIV register. The frequency  
of this derived clock must be set within the limits specified as fNVMOP. The NVM module does not have any means to monitor the  
frequency and will not prevent program or erase operations at frequencies above or below the specified minimum. When  
attempting to program or erase the NVM module at a lower frequency, a full program or erase transition is not assured.  
The following sections provide equations which can be used to determine the time required to execute specific flash commands.  
All timing parameters are a function of the bus clock frequency, fNVMBUS. All program and erase times are also a function of the  
NVM operating frequency, fNVMOP. A summary of key timing parameters can be found in Table 38.  
4.6.2.1.1.1  
Erase Verify All Blocks (Blank Check) (FCMD=0x01)  
The time required to perform a blank check on all blocks is dependent on the location of the first non-blank word starting at relative  
address zero. It takes one bus cycle per phrase to verify plus a setup of the command. Assuming that no non-blank location is  
found, then the time to erase verify all blocks is given by:  
1
--------------------  
tcheck = 19200   
fNVMBUS  
4.6.2.1.1.2  
Erase Verify Block (Blank Check) (FCMD=0x02)  
The time required to perform a blank check is dependent on the location of the first non-blank word starting at relative address  
zero. It takes one bus cycle per phrase to verify plus a setup of the command.  
Assuming that no non-blank location is found, then the time to erase verify a P-Flash block is given by:  
1
--------------------  
tpcheck = 17200   
fNVMBUS  
MM912_634 Advance Information, Rev. 11.0  
28  
Freescale Semiconductor  
 
 
 
Electrical Characteristics  
Assuming that no non-blank location is found, then the time to erase verify a D-Flash block is given by:  
1
--------------------  
tdcheck = 2800   
fNVMBUS  
4.6.2.1.1.3  
Erase Verify P-Flash Section (FCMD=0x03)  
The maximum time to erase verify a section of P-Flash depends on the number of phrases being verified (NVP) and is given by:  
1
--------------------  
t  450 + NVP   
fNVMBUS  
4.6.2.1.1.4  
Read Once (FCMD=0x04)  
The maximum read once time is given by:  
1
--------------------  
t = 400   
fNVMBUS  
4.6.2.1.1.5  
Program P-Flash (FCMD=0x06)  
The programming time for a single phrase of four P-Flash words and the two seven-bit ECC fields is dependent on the bus  
frequency, fNVMBUS, as well as on the NVM operating frequency, fNVMOP  
The typical phrase programming time is given by:  
.
1
1
------------------  
--------------------  
tppgm 164   
+ 2000   
fNVMOP  
fNVMBUS  
The maximum phrase programming time is given by:  
1
1
------------------  
--------------------  
tppgm 164   
+ 2500   
fNVMOP  
fNVMBUS  
4.6.2.1.1.6  
Program Once (FCMD=0x07)  
The maximum time required to program a P-Flash Program Once field is given by:  
1
1
------------------  
--------------------  
t 164   
+ 2150   
fNVMOP  
fNVMBUS  
4.6.2.1.1.7  
Erase All Blocks (FCMD=0x08)  
The time required to erase all blocks is given by:  
1
1
------------------  
--------------------  
tmass 100100   
+ 38000   
fNVMOP  
fNVMBUS  
MM912_634 Advance Information, Rev. 11.0  
29  
Freescale Semiconductor  
Electrical Characteristics  
4.6.2.1.1.8  
Erase P-Flash Block (FCMD=0x09)  
The time required to erase the P-Flash block is given by:  
1
1
------------------  
--------------------  
tpmass 100100   
+ 35000   
fNVMOP  
fNVMBUS  
4.6.2.1.1.9  
Erase P-Flash Sector (FCMD=0x0A)  
The typical time to erase a 512-byte P-Flash sector is given by:  
1
1
------------------  
--------------------  
tpera 20020   
+ 700   
fNVMOP  
fNVMBUS  
The maximum time to erase a 512-byte P-Flash sector is given by:  
1
1
-----------------  
--------------------  
tpera 20020   
+ 1400   
fNVMOP  
fNVMBUS  
4.6.2.1.1.10  
Unsecure Flash (FCMD=0x0B)  
The maximum time required to erase and unsecure the Flash is given by:  
1
1
-----------------  
--------------------  
tuns 100100   
+ 38000   
fNVMOP  
fNVMBUS  
4.6.2.1.1.11  
Verify Backdoor Access Key (FCMD=0x0C)  
The maximum verify back door access key time is given by:  
1
--------------------  
t = 400   
fNVMBUS  
4.6.2.1.1.12  
Set User Margin Level (FCMD=0x0D)  
The maximum set user margin level time is given by:  
1
--------------------  
t = 350   
fNVMBUS  
4.6.2.1.1.13  
Set Field Margin Level (FCMD=0x0E)  
The maximum set field margin level time is given by:  
1
--------------------  
t = 350   
fNVMBUS  
4.6.2.1.1.14  
Erase Verify D-Flash Section (FCMD=0x10)  
The time required to Erase Verify D-Flash for a given number of words NW is given by:  
1
--------------------  
tdcheck  450 + NW   
fNVMBUS  
MM912_634 Advance Information, Rev. 11.0  
30  
Freescale Semiconductor  
Electrical Characteristics  
4.6.2.1.1.15  
Program D-Flash (FCMD=0x11)  
D-Flash programming time is dependent on the number of words being programmed and their location with respect to a row  
boundary, since programming across a row boundary requires extra steps. The D-Flash programming time is specified for  
different cases: 1,2,3,4 words and 4 words across a row boundary.  
The typical D-Flash programming time is given by the following equation, where NW denotes the number of words; BC=0 if no  
row boundary is crossed and BC=1 if a row boundary is crossed:  
1
1
-----------------  
--------------------  
tdpgm  14 + 54 NW+ 14 BC   
+ 500 + 525 NW+ 100 BC   
fNVMOP  
fNVMBUS  
The maximum D-Flash programming time is given by:  
1
1
------------------  
--------------------  
tdpgm  14 + 54 NW+ 14 BC   
+ 500 + 750 NW + 100 BC   
fNVMOP  
fNVMBUS  
4.6.2.1.1.16  
Erase D-Flash Sector (FCMD=0x12)  
Typical D-Flash sector erase times, expected on a new device where no margin verify fails occur, is given by:  
1
1
-----------------  
--------------------  
tdera 5025   
+ 700   
fNVMOP  
fNVMBUS  
Maximum D-Flash sector erase times is given by:  
1
1
-----------------  
--------------------  
tdera 20100   
+ 3400   
fNVMOP  
fNVMBUS  
The D-Flash sector erase time is ~5.0 ms on a new device and can extend to ~20 ms as the flash is cycled.  
Table 38. NVM Timing Characteristics (FTMRC)  
C
Rating  
Symbol  
Min  
Typ(43)  
Max(44)  
Unit(45)  
Bus frequency(46)  
fNVMBUS  
fNVMOP  
tmass  
1
0.8  
1.0  
100  
32  
1.05  
130  
19200  
130  
130  
17200  
26  
MHz  
MHz  
ms  
Operating frequency  
D
D
D
D
D
D
D
D
D
D
D
D
D
Erase all blocks (mass erase) time  
Erase verify all blocks (blank check) time  
Unsecure Flash time  
tCHECK  
tUNS  
tCYC  
ms  
100  
100  
P-Flash block erase time  
tPMASS  
tPCHECK  
tPERA  
ms  
P-Flash erase verify (blank check) time  
P-Flash sector erase time  
tCYC  
ms  
20  
P-Flash phrase programming time  
D-Flash sector erase time  
tPPGM  
226  
5(47)  
285  
26  
s  
tDERA  
ms  
D-Flash erase verify (blank check) time  
D-Flash one word programming time  
D-Flash two word programming time  
D-Flash three word programming time  
D-Flash four word programming time  
tDCHECK  
tDPGM1  
tDPGM2  
tDPGM3  
tDPGM4  
2800  
107  
185  
262  
339  
tCYC  
s  
100  
170  
241  
311  
s  
s  
s  
MM912_634 Advance Information, Rev. 11.0  
31  
Freescale Semiconductor  
Electrical Characteristics  
Table 38. NVM Timing Characteristics (FTMRC) (continued)  
C
Rating  
Symbol  
Min  
Typ(43)  
Max(44)  
Unit(45)  
D
D-Flash four word programming time crossing row boundary  
tDPGM4C  
328  
357  
s  
Note:  
43. Typical program and erase times are based on typical fNVMOP and maximum fNVMBUS  
.
44. Maximum program and erase times are based on minimum fNVMOP and maximum fNVMBUS  
45. tCYC = 1 / fNVMBUS  
.
46. The maximum device bus clock is specified as fBUS.  
47. Typical value for a new device.  
4.6.2.1.2  
NVM Reliability Parameters  
The reliability of the NVM blocks is guaranteed by stress test during qualification, constant process monitors, and burn-in to  
screen early life failures.  
The data retention and program/erase cycling failure rates are specified at the operating conditions noted. The program/erase  
cycle count on the sector is incremented every time a sector or mass erase event is executed.  
NOTE  
All values shown in Table 39 are preliminary and subject to further characterization.  
Table 39. NVM Reliability Characteristics  
Rating  
Symbol  
Min  
Typ  
Max  
Unit  
Program Flash Arrays  
Data retention at an average junction temperature of TJAVG = 85 C(48) after up to  
10,000 program/erase cycles  
tNVMRET  
20  
100(49)  
Years  
Program Flash number of program/erase cycles  
(-40 C TJ 150 C  
nFLPE  
10K  
100K(50)  
Cycles  
Data Flash Array  
Data retention at an average junction temperature of TJAVG = 85 C(48) after up to  
tNVMRET  
tNVMRET  
tNVMRET  
nFLPE  
5
100(49)  
100(49)  
Years  
Years  
50,000 program/erase cycles  
Data retention at an average junction temperature of TJAVG = 85 C(48) after up to  
10,000 program/erase cycles  
Data retention at an average junction temperature of TJAVG = 85 C(48) after less  
than 100 program/erase cycles  
10  
20  
100(49)  
Years  
Data Flash number of program/erase cycles (-40 C TJ 150 C  
50K  
500K(50)  
Cycles  
Note:  
48. TJAVG does not exceed 85 C in a typical temperature profile over the lifetime of a consumer, industrial or automotive application.  
49. Typical data retention values are based on intrinsic capability of the technology measured at high temperature and de-rated to 25 C  
using the Arrhenius equation. For additional information on how Freescale defines Typical Data Retention, refer to Engineering Bulletin  
EB618  
50. Spec table quotes typical endurance evaluated at 25 C for this product family. For additional information on how Freescale defines  
Typical Endurance, refer to Engineering Bulletin EB619.  
4.6.2.2  
4.6.2.2.1  
Phase Locked Loop  
Jitter Definitions  
With each transition of the feedback clock, the deviation from the reference clock is measured and input voltage to the VCO is  
adjusted accordingly.The adjustment is done continuously with no abrupt changes in the VCOCLK frequency. Noise, voltage,  
temperature, and other factors cause slight variations in the control loop resulting in a clock jitter. This jitter affects the real  
minimum and maximum clock periods, as illustrated in Figure 10.  
MM912_634 Advance Information, Rev. 11.0  
32  
Freescale Semiconductor  
 
 
 
 
Electrical Characteristics  
0
1
2
3
N-1  
N
t
MIN1  
t
NOM  
t
MAX1  
t
MINN  
t
MAXN  
Figure 10. Jitter Definitions  
The relative deviation of tNOM is at its maximum for one clock period, and decreases towards zero for larger number of clock  
periods (N). Jitter is defined as:  
t
N  
t
N  
max  
min  
----------------------  
----------------------  
, 1 –  
JN= max 1 –  
N t  
N t  
nom  
nom  
For N < 100, the following equation is a good fit for the maximum jitter:  
j
1
-------  
JN=  
N
J(N)  
1
5
10  
20  
N
Figure 11. Maximum Bus Clock Jitter Approximation  
NOTE  
On timers and serial modules a prescaler will eliminate the effect of the jitter to a large extent.  
MM912_634 Advance Information, Rev. 11.0  
33  
Freescale Semiconductor  
Electrical Characteristics  
4.6.2.2.2  
Electrical Characteristics for the PLL(51)  
Table 40. PLL Characteristics  
Rating  
Symbol  
Min  
Typ  
Max  
Unit  
VCO Frequency During System Reset  
VCO Locking Range  
Reference Clock  
fVCORST  
fVCO  
8.0  
32  
1.0  
0
32  
MHz  
MHz  
MHz  
64  
fREF  
(52)  
Lock Detection  
Lock  
unl  
tlock  
j1  
|
1.5  
2.5  
%
(52)  
Un-Lock Detection  
|
0.5  
%
Time to Lock  
Jitter Fit Parameter 1(53)  
150 + 256/fREF  
1.2  
s  
%
Note:  
51. the maximum device bus clock is specified as fBUS.  
52. % deviation from target frequency.  
53. fREF = 1.0 MHz, fBUS = 32 MHz equivalent fPLL = 64 MHz, REFRQ=00, SYNDIV=$1F, VCOFRQ=01, POSTDIV=$00.  
4.6.2.3  
Electrical Characteristics for the IRC1M  
Table 41. IRC1M Characteristics  
Rating  
Symbol  
Min  
Typ  
Max  
Unit  
Internal Reference Frequency, Factory Trimmed  
-40 °C TJ 150 °C  
fIRC1M_TRIM  
MHz  
0.987  
1.0  
1.013  
4.6.2.4  
Electrical Characteristics for the Oscillator (OSCLCP)  
Table 42. OSCLCP Characteristics  
Rating  
Symbol  
Min  
Typ  
Max  
Unit  
Crystal Oscillator Range  
fOSC  
iOSC  
4.0  
100  
16  
MHz  
A  
Startup Current  
Oscillator Start-up time (LCP, 4MHz)(54)  
Oscillator Start-up time (LCP, 8MHz)(54)  
Oscillator Start-up time (LCP, 16MHz)(54)  
Clock Monitor Failure Assert Frequency  
Input Capacitance (EXTAL, XTAL pins)  
EXTAL Pin Input Hysteresis  
tUPOSC  
tUPOSC  
tUPOSC  
fCMFA  
2.0  
1.6  
1.0  
450  
7.0  
120  
0.9  
10  
ms  
ms  
ms  
KHz  
pF  
8.0  
5.0  
1200  
200  
CIN  
VHYS,EXTAL  
VPP,EXTAL  
mV  
V
EXTAL Pin Oscillation Amplitude (loop controlled Pierce)  
Note:  
54. These values apply for carefully designed PCB layouts with capacitors that match the crystal/resonator requirements.  
55. Only applies if EXTAL is externally driven.  
4.6.2.5  
Reset Characteristics  
Table 43. Reset and Stop Characteristics  
Rating  
Symbol  
Min  
Typ  
Max  
Unit  
Reset Input Pulse Width, Minimum Input Time  
Startup from Reset  
PWRSTL  
nRST  
2.0  
768  
50  
tVCORST  
tVCORST  
s  
STOP Recovery Time  
tSTP_REC  
MM912_634 Advance Information, Rev. 11.0  
34  
Freescale Semiconductor  
 
 
 
 
Electrical Characteristics  
4.6.2.6  
SPI Timing  
This section provides electrical parametrics and ratings for the SPI. In Table 44 the measurement conditions are listed.  
Table 44. Measurement Conditions  
Description  
Value  
Unit  
Drive mode  
Full drive mode  
50  
pF  
V
(56)  
Load capacitance CLOAD , on all outputs  
Thresholds for delay measurement points  
(20% / 80%) VDDRX  
Note:  
56. Timing specified for equal load on all SPI output pins. Avoid asymmetric load.  
4.6.2.6.1  
Master Mode  
In Figure 12 the timing diagram for master mode with transmission format CPHA = 0 is depicted.  
SS  
(Output)  
2
1
12  
12  
13  
13  
3
SCK  
(CPOL = 0)  
(Output)  
4
4
SCK  
(CPOL = 1)  
(Output)  
5
6
MISO  
Bit MSB-1… 1  
9
MSB IN2  
10  
MSB OUT2  
LSB IN  
(Input)  
11  
MOSI  
(Output)  
Bit MSB-11  
LSB OUT  
1. If configured as an output.  
2. LSBF = 0. For LSBF = 1, bit order is LSB, bit 1, bit 2... MSB.  
Figure 12. SPI Master Timing (CPHA = 0)  
In Figure 13 the timing diagram for master mode with transmission format CPHA=1 is depicted.  
MM912_634 Advance Information, Rev. 11.0  
35  
Freescale Semiconductor  
 
 
 
Electrical Characteristics  
SS  
(Output)  
1
12  
12  
13  
13  
3
2
SCK  
(CPOL = 0)  
(Output)  
4
4
SCK  
(CPOL = 1)  
(Output)  
5
6
MISO  
(Input)  
Bit MSB-1... 1  
MSB IN2  
LSB IN  
11  
9
MOSI  
(Output)  
Port Data  
Bit MSB-1... 1  
Master LSB OUT  
Port Data  
Master MSB OUT2  
1.If configured as output  
2. LSBF = 0. For LSBF = 1, bit order is LSB, bit 1,bit 2... MSB.  
Figure 13. SPI Master Timing (CPHA = 1)  
In Table 45 the timing characteristics for master mode are listed.  
Table 45. SPI Master Mode Timing Characteristics  
Characteristic  
Symbol  
Min  
Typ  
Max  
Unit  
SCK Frequency  
SCK Period  
fSCK  
tSCK  
tLEAD  
tLAG  
tWSCK  
tSU  
1/2048  
2.0  
12  
fBUS  
tBUS  
tSCK  
tSCK  
tSCK  
ns  
1/2  
1/2  
1/2  
2048  
Enable Lead Time  
Enable Lag Time  
Clock (SCK) High or Low Time  
Data Setup Time (inputs)  
Data Hold Time (inputs)  
Data Valid After SCK Edge  
Data Valid After SS Fall (CPHA = 0)  
Data Hold Time (outputs)  
Rise and Fall Time Inputs  
Rise and Fall Time Outputs  
8.0  
8.0  
tHI  
ns  
tVSCK  
tVSS  
tHO  
29  
15  
ns  
ns  
20  
ns  
tRFI  
8.0  
8.0  
ns  
tRFO  
ns  
MM912_634 Advance Information, Rev. 11.0  
36  
Freescale Semiconductor  
 
Electrical Characteristics  
4.6.2.6.2  
Slave Mode  
In Figure 14 the timing diagram for slave mode with transmission format CPHA = 0 is depicted.  
SS  
(Input)  
1
12  
12  
13  
13  
3
SCK  
(CPOL = 0)  
(Input)  
4
4
2
SCK  
(CPOL = 1)  
10  
7
(Input)  
8
9
11  
11  
MISO  
(Output)  
See  
See  
Note  
Bit MSB-1... 1  
Slave LSB OUT  
Slave MSB  
6
Note  
5
MOSI  
(Input)  
Bit MSB-1... 1  
MSB IN  
LSB IN  
NOTE: Not defined  
Figure 14. SPI Slave Timing (CPHA = 0)  
In Figure 15 the timing diagram for slave mode with transmission format CPHA = 1 is depicted.  
SS  
(Input)  
3
1
12  
13  
13  
2
SCK  
(CPOL = 0)  
(Input)  
4
4
12  
11  
SCK  
(CPOL = 1)  
(Input)  
8
9
MISO  
See  
Bit MSB-1... 1  
Slave MSB OUT  
Slave LSB OUT  
LSB IN  
Note  
(Output)  
7
5
6
MOSI  
(Input)  
MSB IN  
Bit MSB-1… 1  
NOTE: Not defined  
Figure 15. SPI Slave Timing (CPHA = 1)  
In Table 46 the timing characteristics for slave mode are listed.  
MM912_634 Advance Information, Rev. 11.0  
37  
Freescale Semiconductor  
 
 
Electrical Characteristics  
Table 46. SPI Slave Mode Timing Characteristics  
Characteristic  
SCK Frequency  
Symbol  
Min  
Typ  
Max  
Unit  
fSCK  
tSCK  
tLEAD  
tLAG  
tWSCK  
tSU  
DC  
4
14  
fBUS  
tBUS  
tBUS  
tBUS  
tBUS  
ns  
SCK Period  
Enable Lead Time  
4
20  
22  
Enable Lag Time  
4.0  
4.0  
8.0  
8.0  
20  
Clock (SCK) High or Low Time  
Data Setup Time (inputs)  
Data Hold Time (inputs)  
Slave Access Time (time to data active)  
Slave MISO Disable Time  
Data Valid After SCK Edge  
Data Valid After SS Fall  
Data Hold Time (outputs)  
Rise and Fall Time Inputs  
Rise and Fall Time Outputs  
Note:  
tHI  
ns  
tA  
ns  
tDIS  
ns  
(57)  
tVSCK  
tVSS  
tHO  
29 + 0.5 tBUS  
ns  
ns  
ns  
ns  
ns  
(57)  
29 + 0.5 tBUS  
tRFI  
8.0  
8.0  
tRFO  
57. 0.5 tBUS added due to internal synchronization delay  
4.7  
Thermal Protection Characteristics  
Characteristics noted under conditions 5.5 V VSUP 18 V, -40 °C TA 125 °C, unless otherwise noted. Typical values noted  
reflect the approximate parameter mean at TA = 25 °C under nominal conditions, unless otherwise noted.  
Table 47. Thermal Characteristics - Voltage Regulators VDD (2.5 V) & VDDX (5.0 V)(58)  
Ratings  
Symbol  
Min  
Typ  
Max  
Unit  
VDD/VDDX High-temperature Warning (HTI)  
Threshold  
Hysteresis  
THTI  
THTI_H  
110  
-
125  
10  
140  
-
°C  
VDD/VDDX Overtemperature Shutdown  
Threshold  
Hysteresis  
TSD  
TSD_H  
155  
-
170  
10  
185  
-
°C  
HSUP Overtemperature Shutdown  
HSUP Overtemperature Shutdown Hysteresis  
HS Overtemperature Shutdown  
THSUPSD  
THSUPSD_HYS  
THSSD  
150  
165  
10  
180  
°C  
°C  
°C  
°C  
°C  
°C  
°C  
°C  
-
150  
-
-
180  
-
165  
10  
HS Overtemperature Shutdown Hysteresis  
LS Overtemperature Shutdown  
THSSD_HYS  
TLSSD  
TLSSD_HYS  
TLINSD  
150  
-
165  
10  
180  
-
LS Overtemperature Shutdown Hysteresis  
LIN Overtemperature Shutdown  
150  
-
165  
20  
200  
-
LIN Overtemperature Shutdown Hysteresis  
TLINSD_HYS  
Note:  
58. Guaranteed by characterization. Functionality tested.  
MM912_634 Advance Information, Rev. 11.0  
38  
Freescale Semiconductor  
 
 
Electrical Characteristics  
4.8  
ESD Protection and Latch-up Immunity  
All ESD testing is in conformity with CDF-AEC-Q100 stress test qualification for automotive grade integrated circuits. During the  
device qualification, ESD stresses were performed for the Human Body Model (HBM), Machine Model (MM), Charge Device  
Model (CDM), as well as LIN transceiver specific specifications.  
A device will be defined as a failure if after exposure to ESD pulses, the device no longer meets the device specification.  
Complete DC parametric and functional testing is performed per the applicable device specification at room temperature,  
followed by hot temperature, unless specified otherwise in the device specification.  
Table 48. ESD and Latch-up Protection Characteristics  
Ratings  
Symbol  
Value  
Unit  
ESD - Human Body Model (HBM) following AEC-Q100 / JESD22-A114  
(CZAP = 100 pF, RZAP = 1500 )  
- LIN (DGND, PGND, AGND, and LGND shorted)  
±8000  
±4000  
±3000  
±2000  
VHBM  
V
- VS1, VS2, VSENSE, Lx  
- HSx  
- All other Pins  
ESD - Charged Device Model (CDM) following AEC-Q100,  
Corner Pins (1, 12, 13, 24, 25, 36, 37, and 48)  
All other Pins  
VCDM  
±750  
±500  
V
ESD - Machine Model (MM) following AEC-Q100  
(CZAP = 200 pF, RZAP = 0 ), All Pins  
Latch-up current at TA = 125 C(59)  
VMM  
ILAT  
±200  
±100  
V
mA  
ESD GUN - LIN Conformance Test Specification(61), unpowered, contact  
discharge, CZAP= 150 pF, RZAP = 330 .  
- LIN (with or without bus filter CBUS=220 pF)  
±15000  
±20000  
±6000  
V
V
- VS1, VS2 with CVS  
- Lx with serial RLX  
ESD GUN - following IEC 61000-4-2 Test Specification(62), unpowered,  
contact discharge, CZAP= 150 pF, RZAP = 330   
- LIN (with or without bus filter CBUS=220 pF)  
±8000  
±8000  
±8000  
±8000  
(60)  
- VSENSE with serial RVSENSE  
- VS1, VS2 with CVS  
- Lx with serial RLX  
ESD GUN - following ISO10605 Test Specification(62), unpowered, contact  
discharge, CZAP= 150 pF, RZAP = 2.0 k  
- LIN (with or without bus filter CBUS=220pF)  
±6000  
±6000  
±6000  
±6000  
V
(60)  
- VSENSE with serial RVSENSE  
- VS1, VS2 with CVS  
- Lx with serial RLX  
MM912_634 Advance Information, Rev. 11.0  
39  
Freescale Semiconductor  
 
Electrical Characteristics  
Table 48. ESD and Latch-up Protection Characteristics (continued)  
Ratings  
Symbol  
Value  
Unit  
ESD GUN - following ISO10605 Test Specification(62), powered, contact  
discharge, CZAP= 330 pF, RZAP = 2.0 k  
- LIN (with or without bus filter CBUS=220 pF)  
±8000  
±8000  
±8000  
±8000  
V
(60)  
- VSENSE with serial RVSENSE  
- VS1, VS2 with CVS  
- Lx with serial RLX  
Note:  
59. Input Voltage Limit = -2.5 to 7.5 V.  
60. With CVBAT (10…100 nF) as part of the battery path.  
61. Certification available on request  
62. Tested internally only; certification pending  
4.9  
Additional Test Information ISO7637-2  
Immunity against transients for the LIN, Lx, and VBAT, is specified according to the LIN Conformance Test Specification - Section  
LIN EMC Test Specification refer to the LIN Conformance Test Certification Report - available as separate document.  
MM912_634 Advance Information, Rev. 11.0  
40  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5
Functional Description and Application Information  
Introduction  
5.1  
This chapter describes the MM912_634 dual die device functions on a block by block base. To distinguish between the module  
location being the MCU die or the analog die, the following symbols are shown on all module cover pages:  
The documented module is physically located on the Analog die. This applies to MM912_634 - Analog Die Overview  
through MM912_634 - Analog Die Trimming.  
MCU  
ANALOG  
The documented module is physically located on the Microcontroller die. This applies to MM912_634 - MCU Die  
Overview through Port Integration Module (S12IPIMV1).  
MCU  
ANALOG  
Sections concerning both dies or the complete device will not have a specific indication.  
5.2  
Device Register Maps  
Table 49 shows the device register memory map overview for the 64 kByte MCU die (9S12I32).  
Table 49. Device Register Memory Map Overview  
Address  
Module  
PIM (port integration module)  
Size (Bytes)  
0x0000–0x0009  
0x000A–0x000B  
0x000C–0x000D  
0x000E–0x000F  
0x0010–0x0015  
0x0016–0x0019  
0x001A–0x001B  
0x001C–0x001E  
0x001F  
10  
2
MMC (memory map control)  
PIM (port integration module)  
Reserved  
2
2
MMC (memory map control)  
Reserved  
8
2
Device ID register  
2
Reserved  
4
INT (interrupt module)  
DBG (debug module)  
Reserved  
1
0x0020–0x002F  
0x0030–0x0033  
0x0034–0x003F  
0x0040–0x00D7  
0x00D8–0x00DF  
0x00E0–0x00E7  
0x00E8–0x00EF  
0x00F0–0x00FF  
0x0100–0x0113  
0x0114–0x011F  
0x0120–0x017F  
0x0180–0x01EF  
0x01F0–0x01FC  
0x01FD–0x01FF  
0x0200-0x02FF  
0x0300–0x03FF  
16  
4
CPMU (clock and power management)  
Reserved  
12  
152  
8
D2DI (die 2 die initiator)  
Reserved  
32  
8
SPI (serial peripheral interface)  
Reserved  
32  
20  
12  
96  
112  
13  
3
FTMRC control registers  
Reserved  
PIM (port integration module)  
Reserved  
CPMU (clock and power management)  
Reserved  
D2DI (die 2 die initiator, blocking access window)  
D2DI (die 2 die initiator, non-blocking write window)  
256  
256  
MM912_634 Advance Information, Rev. 11.0  
41  
Freescale Semiconductor  
 
Functional Description and Application Information  
NOTE  
Reserved register space shown in Table 49 is not allocated to any module. This register  
space is reserved for future use, and will show as grayed areas in tables throughout this  
document. Writing to these locations has no effect. Read access to these locations returns  
zero.  
5.2.1  
Detailed Module Register Maps  
Table 50 to Table 72 show the detailed module maps of the 9S12I64 MCU die.  
Table 50. 0x0000–0x0007 Port Integration Module (PIM) Map 1 of 3  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0x0000  
PORTA  
PA7  
0
PA6  
0
PA5  
0
PA4  
0
PA3  
0
PA2  
0
PA1  
PA 0  
W
R
0x0001  
0x0002  
0x0003  
PORTB  
DDRA  
PB1  
PB0  
W
R
DDRA7  
0
DDRA6  
0
DDRA5  
0
DDRA4  
0
DDRA3  
0
DDRA2  
0
DDRA1  
DDRA0  
W
R
DDRE  
DDRE1  
0
DDRE0  
0
W
R
0
0
0
0
0
0
0x0004-  
0x0009  
Reserved  
W
Table 51. 0x000A–0x000B Memory Map Control (MMC) Map 1 of 2  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x000A  
Reserved  
W
R
0
0
0
0
0
0
0
0x000B  
MODE  
MODC  
W
Table 52. 0x000C–0x000D Port Integration Module (PIM) Map 2 of 3  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0x000C  
PUCR  
BKPUE  
0
PDPEE  
0
W
R
0
0
0
0
0x000D  
RDRIV  
RDRD  
RDRC  
W
Table 53. 0x000E–0x000F Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x000E-  
0x000F  
Reserved  
W
MM912_634 Advance Information, Rev. 11.0  
42  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 54. 0x0010–0x001B Memory Map Control (MMC) Map 2 of 2  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x0010  
Reserved  
W
R
0x0011  
0x0012  
0x0013  
0x0014  
0x0015  
DIRECT  
Reserved  
Reserved  
Reserved  
PPAGE  
DP15  
0
DP14  
0
DP13  
0
DP12  
0
DP11  
0
DP10  
0
DP9  
0
DP8  
0
W
R
W
R
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
W
R
W
R
PIX3  
PIX2  
PIX1  
PIX0  
W
Table 55. 0x0016–0x0019 Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x0016-  
0x0019  
Reserved  
W
Table 56. 0x001A–0x001B Device ID Register (PARTIDH/PARTIDL)  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
PARTIDH  
0x001A  
PARTIDH  
W
R
PARTIDL  
0x001B  
PARTIDL  
W
Table 57. 0x001C–0x001E Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x001C-  
0x001E  
Reserved  
W
Table 58. 0x001F Interrupt Module (INT)  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0x001F  
IVBR  
IVB_ADDR[7:0]  
W
MM912_634 Advance Information, Rev. 11.0  
43  
Freescale Semiconductor  
Functional Description and Application Information  
Table 59. 0x0020–0x002F Debug Module (DBG)  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
TRIG  
0
0
0
0x0020  
DBGC1  
ARM  
TBF  
BDM  
0
DBGBRK  
0
COMRV  
W
R
0
0
SSF2  
SSF1  
0
SSF0  
0x0021  
0x0022  
0x0023  
0x0024  
0x0025  
0x0026  
DBGSR  
DBGTCR  
DBGC2  
W
R
0
0
0
0
TSOURCE  
0
TRCMOD  
TALIGN  
W
R
0
0
0
ABCM  
W
R
Bit 15  
Bit 7  
TBF  
0
Bit 14  
Bit 13  
Bit 5  
Bit 12  
Bit 4  
Bit 11  
Bit 3  
Bit 10  
Bit 2  
Bit 9  
Bit 1  
Bit 8  
Bit 0  
DBGTBH  
DBGTBL  
DBGCNT  
DBGSCRX  
DBGMFR  
DBGACTL  
DBGBCTL  
DBGCCTL  
DBGXAH  
DBGXAM  
DBGXAL  
DBGADH  
DBGADL  
DBGADHM  
DBGADLM  
W
R
Bit 6  
W
R
0
0
0
CNT  
W
R
0
0
0
0
SC3  
0
SC2  
MC2  
SC1  
MC1  
SC0  
MC0  
W
R
0x0027  
0x0028  
0
W
R
SZE  
SZ  
TAG  
TAG  
BRK  
BRK  
RW  
RW  
RWE  
RWE  
NDB  
0
COMPE  
COMPE  
COMPE  
Bit 16  
Bit 8  
W
R
SZE  
0
SZ  
0
W
R
0
TAG  
0
BRK  
0
RW  
0
RWE  
0
W
R
0
0
0x0029  
0x002A  
0x002B  
0x002C  
0x002D  
0x002E  
0x002F  
Bit 17  
W
R
Bit 15  
Bit 7  
14  
6
13  
5
12  
4
11  
3
10  
2
9
1
9
1
9
1
W
R
Bit 0  
W
R
Bit 15  
Bit 7  
14  
6
13  
5
12  
4
11  
3
10  
2
Bit 8  
W
R
Bit 0  
W
R
Bit 15  
Bit 7  
14  
6
13  
5
12  
4
11  
3
10  
2
Bit 8  
W
R
Bit 0  
W
MM912_634 Advance Information, Rev. 11.0  
44  
Freescale Semiconductor  
Functional Description and Application Information  
Table 60. 0x0030–0x033 Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x0030-  
0x0033  
Reserved  
W
Table 61. 0x0034–0x003F Clock and Power Management (CPMU) Map 1 of 2  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
CPMU  
SYNR  
0x0034  
VCOFRQ[1:0]  
SYNDIV[5:0]  
W
R
0
0
0
CPMU  
REFDIV  
0x0035  
0x0036  
0x0037  
0x0038  
0x0039  
0x003A  
0x003B  
0x003C  
0x003D  
0x003E  
0x003F  
REFFRQ[1:0]  
REFDIV[3:0]  
W
R
0
0
CPMU  
POSTDIV  
POSTDIV[4:0]  
W
R
LOCK  
0
UPOSC  
0
CPMUFLG  
CPMUINT  
CPMUCLKS  
CPMUPLL  
CPMURTI  
CPMUCOP  
Reserved  
RTIF  
RTIE  
PORF  
0
LVRF  
0
LOCKIF  
ILAF  
0
OSCIF  
OSCIE  
W
R
LOCKIE  
0
W
R
0
RTI  
OSCSEL  
COP  
OSCSEL  
PLLSEL  
0
PSTP  
0
PRE  
0
PCE  
0
W
R
0
0
FM1  
FM0  
W
R
RTDEC  
RTR6  
RTR5  
RTR4  
0
RTR3  
0
RTR2  
RTR1  
RTR0  
W
R
0
WCOP  
0
RSBCK  
0
CR2  
0
CR1  
0
CR0  
0
W
R
WRTMASK  
0
0
0
0
0
W
R
0
0
0
0
0
0
Reserved  
W
R
0
0
0
0
0
0
0
0
CPMU  
ARMCOP  
W
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
Table 62. 0x0040–0x0D7 Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x0040-  
0x00D7  
Reserved  
W
MM912_634 Advance Information, Rev. 11.0  
45  
Freescale Semiconductor  
Functional Description and Application Information  
Table 63. 0x00D8–0x00DF Die 2 Die Initiator (D2DI) Map 1 of 3  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0x00D8  
D2DCTL0  
D2DEN  
D2DCW  
0
D2DSWAI  
0
D2DCLKDIV[1:0]  
W
R
0
0x00D9  
0x00DA  
0x00DB  
0x00DC  
0x00DD  
0x00DE  
0x00DF  
D2DCTL1  
D2DSTAT0  
D2DSTAT1  
D2DADRHI  
D2DADRLO  
D2DDATAHI  
D2DDATALO  
D2DIE  
ERRIF  
TIMEOUT[3:0]  
W
R
ACKERF  
D2DBSY  
SZ8  
CNCLF  
TIMEF  
0
TERRF  
PARF  
PAR1  
PAR0  
W
R
0
0
0
0
0
0
0
0
0
0
D2DIF  
RWB  
W
R
NBLK  
W
R
ADR[7:0]  
W
R
DATA[15:8]  
DATA[7:0]  
W
R
W
Table 64. 0x00E0–0x0E7 Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x00E0-  
0x00E7  
Reserved  
W
Table 65. 0x00E8–0x00EF Serial Peripheral Interface (SPI)  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0x00E8  
SPICR1  
SPIE  
0
SPE  
SPTIE  
0
MSTR  
CPOL  
CPHA  
0
SSOE  
LSBFE  
W
R
0x00E9  
0x00EA  
0x00EB  
0x00EC  
0x00ED  
0x00EE  
0x00EF  
SPICR2  
SPIBR  
XFRW  
MODFEN  
BIDIROE  
0
SPISWAI  
SPC0  
W
R
0
SPPR2  
0
SPPR1  
SPTEF  
SPPR0  
MODF  
SPR2  
0
SPR1  
0
SPR0  
0
W
R
SPIF  
0
SPISR  
W
R
R15  
T15  
R7  
T7  
R14  
T14  
R6  
T6  
R13  
T13  
R5  
T5  
R12  
T12  
R4  
T4  
R11  
T11  
R3  
T3  
R10  
T10  
R2  
T2  
R9  
T9  
R1  
T1  
0
R8  
T8  
R0  
T0  
0
SPIDRH  
SPIDRL  
Reserved  
Reserved  
W
R
W
R
0
0
0
0
0
0
W
R
0
0
0
0
0
0
0
0
W
MM912_634 Advance Information, Rev. 11.0  
46  
Freescale Semiconductor  
Functional Description and Application Information  
Table 66. 0x00F0–0x0FF Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x00E0-  
0x00FF  
Reserved  
W
Table 67. 0x0100–0x011F Flash Module (FTMRC)  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
FDIVLD  
0x0100  
FCLKDIV  
FDIVLCK  
KEYEN0  
FDIV5  
RNV5  
FDIV4  
RNV4  
FDIV3  
RNV3  
FDIV2  
RNV2  
FDIV1  
SEC1  
FDIV0  
SEC0  
W
R
KEYEN1  
0x0101  
0x0102  
0x0103  
0x0104  
0x0105  
0x0106  
0x0107  
0x0108  
0x0109  
0x010A  
0x010B  
0x010C  
0x010D  
0x010E  
0x010F  
0x0110  
0x0111  
FSEC  
FCCOBIX  
Reserved  
FCNFG  
W
R
0
0
0
0
0
0
0
0
0
0
CCOBIX2  
0
CCOBIX1  
0
CCOBIX0  
0
W
R
0
0
W
R
0
0
0
CCIE  
0
IGNSF  
0
FDFD  
FSFD  
W
R
0
0
MGBUSY  
0
0
RSVD  
0
FERCNFG  
FSTAT  
DFDIE  
SFDIE  
W
R
0
MGSTAT1 MGSTAT0  
CCIF  
0
ACCERR  
0
FPVIOL  
0
W
R
0
RNV6  
0
FERSTAT  
FPROT  
DFDIF  
FPLS1  
DPS1  
SFDIF  
FPLS0  
DPS0  
W
R
FPOPEN  
DPOPEN  
CCOB15  
FPHDIS  
0
FPHS1  
0
FPHS0  
DPS3  
FPLDIS  
DPS2  
W
R
DFPROT  
FCCOBHI  
FCCOBLO  
Reserved  
Reserved  
Reserved  
Reserved  
FOPT  
W
R
CCOB14  
CCOB13  
CCOB12  
CCOB11  
CCOB10  
CCOB9  
CCOB8  
W
R
CCOB7  
0
CCOB6  
0
CCOB5  
0
CCOB4  
0
CCOB3  
0
CCOB2  
0
CCOB1  
0
CCOB0  
0
W
R
W
R
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
W
R
W
R
0
0
0
0
0
0
0
0
W
R
NV7  
0
NV6  
0
NV5  
0
NV4  
0
NV3  
0
NV2  
0
NV1  
0
NV0  
0
W
R
Reserved  
W
MM912_634 Advance Information, Rev. 11.0  
47  
Freescale Semiconductor  
Functional Description and Application Information  
Table 67. 0x0100–0x011F Flash Module (FTMRC) (continued)  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x0112  
Reserved  
W
R
0
0
0
0
0
0
0
0
0x0113  
Reserved  
W
Table 68. 0x0120 Port Integration Module (PIM) Map 3 of 3  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
PTIA7  
PTIA6  
PTIA5  
PTIA4  
PTIA3  
PTIA2  
PTIA1  
PTIA0  
0x0120  
PTIA  
W
R
0
0
0
0
0
0
0
0
0
0
0
0
PTIB1  
0
PTIB0  
0
0x0121  
PTIB  
W
R
0x0122-  
0x017F  
Reserved  
W
Table 69. 0x0180–0x1EF Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x0180-  
0x01EF  
Reserved  
W
Table 70. 0x01F0–0x01FF Clock and Power Management (CPMU) Map 2 of 2  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x01F0  
Reserved  
W
R
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
LVDS  
CPMU  
LVCTL  
0x01F1  
0x01F6  
0x01F7  
0x01F8  
0x01F9  
LVIE  
0
LVIF  
0
W
R
0
0
0
Reserved  
Reserved  
W
R
0
0
W
R
CPMU  
IRCTRIMH  
TCTRIM[3:0]  
IRCTRIM[9:8]  
W
R
CPMU  
IRCTRIML  
IRCTRIM[7:0]  
W
OSCPINS_  
EN  
R
0x01FA  
CPMUOSC  
OSCE  
0
OSCBW  
0
OSCFILT[4:0]  
0
W
R
0
0
0
0
0
0
0
0
0x01FB  
0x01FC  
CPMUPROT  
Reserved  
PROT  
0
W
R
0
0
0
W
MM912_634 Advance Information, Rev. 11.0  
48  
Freescale Semiconductor  
Functional Description and Application Information  
Table 71. 0x01FD–0x1FF Reserved  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0
0
0
0
0
0
0
0
0x01FD-  
0x01FF  
Reserved  
W
Table 72. 0x0200–0x03FF Die-To-Die Initiator Blocking and Non-Blocking Access Window  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
R
0x0200-  
0x02FF  
BlockingAccess  
Window  
W
R
0x0300-  
0x03FF  
Non-Blocking  
Access Window  
W
Table 73 shows the detailed module maps of the MM912_634 analog die.  
Table 73. Analog die Registers(63) - 0x0200–0x02FF D2D Blocking Access (D2DI) 2 of 3/  
0x0300–0x03FF D2D Non Blocking Access (D2DI) 3 of 3  
Offset  
Name  
7
6
5
4
3
2
1
0
ISR (hi)  
Interrupt Source Register  
ISR (lo)  
R
W
R
0
0
HOT  
LSOT  
HSOT  
LINOT  
SCI  
RX  
0x00  
TX  
ERR  
TOV  
CH3  
CH2  
CH1  
CH0  
VSI  
0x01  
0x02  
0x04  
0x05  
0x08  
0x09  
0x10  
0x11  
0x12  
0x13  
0x14  
0x15  
Interrupt Source Register  
IVR  
W
R
0
0
IRQ  
Interrupt Vector Register  
VCR  
W
R
0
0
0
0
VROVIE  
VROVC  
HTIE  
HTC  
HVIE  
HVC  
LVIE  
LVC  
LBIE  
LBC  
Voltage Control Register  
VSR  
W
R
0
0
Voltage Status Register  
LXR  
W
R
0
0
0
0
L5  
L4  
L3  
L2  
L1  
L0  
Lx Status Register  
LXCR  
W
R
L5DS  
0
L4DS  
0
L3DS  
0
L2DS  
L1DS  
L0DS  
Lx Control Register  
WDR  
W
R
WDOFF  
WDWO  
WDTO  
Watchdog Register  
WDSR  
W
R
WDSR  
Watchdog Service Register  
WCR  
W
R
CSSEL  
L5WE  
L4WE  
L3WE  
L2WE  
L1WE  
L0WE  
Wake Up Control Register  
TCR  
W
R
FWM  
CST  
Timing Control Register  
WSR  
W
R
FWU  
0
LINWU  
0
L5WU  
WDR  
L4WU  
EXR  
L3WU  
WUR  
L2WU  
LVRX  
L1WU  
LVR  
L0WU  
POR  
Wake Up Source Register  
RSR  
W
R
Reset Status Register  
W
MM912_634 Advance Information, Rev. 11.0  
49  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 73. Analog die Registers(63) - 0x0200–0x02FF D2D Blocking Access (D2DI) 2 of 3/  
0x0300–0x03FF D2D Non Blocking Access (D2DI) 3 of 3 (continued)  
Offset  
Name  
7
6
5
4
3
2
1
0
MCR  
Mode Control Register  
LINR  
R
W
R
0
0
0
0
0
0
0x16  
MODE  
LINSR  
LINOTC  
RX  
0x18  
0x20  
0x21  
0x22  
0x28  
0x29  
0x30  
0x31  
LINOTIE  
0
TX  
LVSD  
0
LINEN  
LIN Register  
W
R
PTBC1  
PUEB2  
0
PUEB1  
0
PUEB0  
0
DDRB2  
DDRB1  
DDRB0  
Port B Configuration Register 1  
PTBC2  
W
R
0
0
PWMCS PWMEN  
SERMOD  
Port B Config Register 2  
PTB  
W
R
0
0
0
0
PTB2  
PTB1  
PTB0  
Port B Data Register  
HSCR  
W
R
HSHVSD  
E
HSOTIE  
HSOTC  
PWMCS2 PWMCS1 PWMHS2 PWMHS1  
HS2CL HS1CL  
HS2  
HS1  
High-side Control Register  
HSSR  
W
R
0
0
0
0
0
0
HS2OL  
HS1OL  
High-side Status Register  
LSCR  
W
R
LSOTIE  
LSOTC  
PWMCS2 PWMCS1 PWMLS2 PWMLS1  
LS2  
LS1  
Low-side Control Register  
LSSR  
W
R
0
0
0
0
LS2CL  
LS1CL  
LS2OL  
LS1OL  
Low-side Status Register  
LSCEN  
W
R
0
0x32  
LSCEN  
Low-Side Control Enable  
Register  
W
HSR  
Hall Supply Register  
CSR  
R
W
R
HOTC  
0
0
0
0
0
0
0
0
0
0x38  
0x3C  
0x40  
0x41  
0x42  
0x43  
0x44  
0x45  
0x46  
0x47  
HOTIE  
CSE  
HSUPON  
CCD  
CSGS  
SBR9  
SBR1  
PE  
Current Sense Register  
SCIBD (hi)  
W
R
LBKDIE RXEDGIE  
SBR12  
SBR4  
M
SBR11  
SBR10  
SBR2  
ILT  
SBR8  
SBR0  
PT  
SCI Baud Rate Register  
SCIBD (lo)  
W
R
SBR7  
SBR6  
0
SBR5  
RSRC  
SBR3  
0
SCI Baud Rate Register  
SCIC1  
W
R
LOOPS  
SCI Control Register 1  
SCIC2  
W
R
TIE  
TCIE  
TC  
RIE  
ILIE  
TE  
RE  
NF  
RWU  
FE  
SBK  
PF  
SCI Control Register 2  
SCIS1  
W
R
TDRE  
RDRF  
IDLE  
OR  
SCI Status Register 1  
SCIS2  
W
R
0
RAF  
LBKDIF RXEDGIF  
RXINV  
TXINV  
RWUID  
ORIE  
BRK13  
NEIE  
LBKDE  
FEIE  
SCI Status Register 2  
SCIC3  
W
R
R8  
T8  
TXDIR  
PEIE  
SCI Control Register 3  
SCID  
W
R
R7  
T7  
R6  
T6  
R5  
T5  
R4  
T4  
R3  
T3  
R2  
T2  
R1  
T1  
R0  
T0  
SCI Data Register  
W
MM912_634 Advance Information, Rev. 11.0  
50  
Freescale Semiconductor  
Functional Description and Application Information  
Table 73. Analog die Registers(63) - 0x0200–0x02FF D2D Blocking Access (D2DI) 2 of 3/  
0x0300–0x03FF D2D Non Blocking Access (D2DI) 3 of 3 (continued)  
Offset  
Name  
7
6
5
4
3
2
1
0
PWMCTL  
PWM Control Register  
PWMPRCLK  
R
W
R
0x60  
CAE1  
0
CAE0  
PCLK1  
PCLK0  
PPOL1  
0
PPOL0  
PWME1  
PWME0  
0x61  
0x62  
0x63  
0x64  
0x65  
0x66  
0x67  
0x68  
0x69  
0x80  
0x81  
0x82  
0x83  
0x84  
0x85  
0x86  
0x87  
0x88  
0x89  
0x8A  
PCKB2  
PCKB1  
PCKB0  
PCKA2  
PCKA1  
PCKA0  
Bit 0  
PWM Presc. Clk Select Reg  
PWMSCLA  
W
R
Bit 7  
Bit 7  
6
6
5
5
4
4
3
3
2
2
1
1
PWM Scale A Register  
PWMSCLB  
W
R
Bit 0  
PWM Scale B Register  
PWMCNT0  
W
R
Bit 7  
0
6
0
6
0
5
0
5
0
4
0
4
0
3
0
3
0
2
0
2
0
1
0
1
0
Bit 0  
0
PWM Ch Counter Reg 0  
PWMCNT1  
W
R
Bit 7  
0
Bit 0  
0
PWM Ch Counter Reg 1  
PWMPER0  
W
R
Bit 7  
Bit 7  
Bit 7  
Bit 7  
6
6
6
6
5
5
5
5
4
4
4
4
3
3
3
2
2
2
2
1
1
1
1
Bit 0  
Bit 0  
Bit 0  
Bit 0  
PWM Ch Period Register 0  
PWMPER1  
W
R
PWM Ch Period Register 1  
PWMDTY0  
W
R
PWM Ch Duty Register 0  
PWMDTY1  
W
R
3
0
PWM Ch Duty Register 1  
ACR  
W
R
SCIE  
SCF  
CCE  
OCE  
0
ADCRST  
0
PS2  
PS1  
PS0  
ADC Config Register  
ASR  
W
R
2p5CLF  
CCNT3  
CH11  
CCNT2  
CCNT1  
CCNT0  
ADC Status Register  
ACCR (hi)  
W
R
0
CH15  
CH14  
CH12  
CH10  
CH9  
CH8  
ADC Conversion Ctrl Reg  
ACCR (lo)  
W
R
CH7  
CH6  
CH5  
0
CH4  
CH3  
CH2  
CH1  
CC9  
CH0  
CC8  
ADC Conversion Ctrl Reg  
ACCSR (hi)  
W
R
CC15  
CC14  
CC12  
CC11  
CC10  
ADC Conv Complete Reg  
ACCSR (lo)  
W
R
CC7  
CC6  
CC5  
adr0 7  
0
CC4  
adr0 6  
0
CC3  
adr0 5  
0
CC2  
adr0 4  
0
CC1  
adr0 3  
0
CC0  
adr0 2  
0
ADC Conv Complete Reg  
ADR0 (hi)  
W
R
adr0 9  
adr0 1  
adr1 9  
adr1 1  
adr2 9  
adr0 8  
adr0 0  
adr1 8  
adr1 0  
adr2 8  
ADC Data Result Register 0  
ADR0 (lo)  
W
R
ADC Data Result Register 0  
ADR1 (hi)  
W
R
adr1 7  
0
adr1 6  
0
adr1 5  
0
adr1 4  
0
adr1 3  
0
adr1 2  
0
ADC Data Result Register 1  
ADR1 (lo)  
W
R
ADC Data Result Register 1  
ADR2 (hi)  
W
R
adr2 7  
adr2 6  
adr2 5  
adr2 4  
adr2 3  
adr2 2  
ADC Data Result Register 2  
W
MM912_634 Advance Information, Rev. 11.0  
51  
Freescale Semiconductor  
Functional Description and Application Information  
Table 73. Analog die Registers(63) - 0x0200–0x02FF D2D Blocking Access (D2DI) 2 of 3/  
0x0300–0x03FF D2D Non Blocking Access (D2DI) 3 of 3 (continued)  
Offset  
Name  
7
6
5
4
3
2
1
0
ADR2 (lo)  
ADC Data Result Register 2  
ADR3 (hi)  
R
W
R
adr2 1  
adr2 0  
0
0
0
0
0
0
0x8B  
adr3 9  
adr3 1  
adr4 9  
adr4 1  
adr5 9  
adr5 1  
adr6 9  
adr6 1  
adr7 9  
adr7 1  
adr8 9  
adr8 1  
adr9 9  
adr9 1  
adr10 9  
adr10 1  
adr11 9  
adr11 1  
adr12 9  
adr12 1  
adr3 8  
adr3 0  
adr4 8  
adr4 0  
adr5 8  
adr5 0  
adr6 8  
adr6 0  
adr7 8  
adr7 0  
adr8 8  
adr8 0  
adr9 8  
adr9 0  
adr10 8  
adr10 0  
adr11 8  
adr11 0  
adr12 8  
adr12 0  
adr3 7  
adr3 6  
adr3 5  
adr3 4  
adr3 3  
adr3 2  
0x8C  
0x8D  
0x8E  
0x8F  
0x90  
0x91  
0x92  
0x93  
0x94  
0x95  
0x96  
0x97  
0x98  
0x99  
0x9A  
0x9B  
0x9C  
0x9D  
0x9E  
0x9F  
ADC Data Result Register 3  
ADR3 (lo)  
W
R
0
0
0
0
0
0
ADC Data Result Register 3  
ADR4 (hi)  
W
R
adr4 7  
adr4 6  
adr4 5  
adr4 4  
adr4 3  
adr4 2  
ADC Data Result Register 4  
ADR4 (lo)  
W
R
0
0
0
0
0
0
ADC Data Result Register 4  
ADR5 (hi)  
W
R
adr5 7  
adr5 6  
adr5 5  
adr5 4  
adr5 3  
adr5 2  
ADC Data Result Register 5  
ADR5 (lo)  
W
R
0
0
0
0
0
0
ADC Data Result Register 5  
ADR6 (hi)  
W
R
adr6 7  
adr6 6  
adr6 5  
adr6 4  
adr6 3  
adr6 2  
ADC Data Result Register 6  
ADR6 (lo)  
W
R
0
0
0
0
0
0
ADC Data Result Register 6  
ADR7 (hi)  
W
R
adr7 7  
adr7 6  
adr7 5  
adr7 4  
adr7 3  
adr7 2  
ADC Data Result Register 7  
ADR7 (lo)  
W
R
0
0
0
0
0
0
ADC Data Result Register 7  
ADR8 (hi)  
W
R
adr8 7  
adr8 6  
adr8 5  
adr8 4  
adr8 3  
adr8 2  
ADC Data Result Register 8  
ADR8 (lo)  
W
R
0
0
0
0
0
0
ADC Data Result Register 8  
ADR9 (hi)  
W
R
adr9 7  
adr9 6  
adr9 5  
adr9 4  
adr9 3  
adr9 2  
ADC Data Result Register 9  
ADR9 (lo)  
W
R
0
0
0
0
0
0
ADC Data Result Register 9  
ADR10 (hi)  
W
R
adr10 7  
adr10 6  
adr10 5  
adr10 4  
adr10 3  
adr10 2  
ADC Data Result Reg 10  
ADR10 (lo)  
W
R
0
adr11 7  
0
0
adr11 6  
0
0
adr11 5  
0
0
adr11 4  
0
0
adr11 3  
0
0
adr11 2  
0
ADC Data Result Reg 10  
ADR11 (hi)  
W
R
ADC Data Result Reg 11  
ADR11 (lo)  
W
R
ADC Data Result Reg 11  
ADR12 (hi)  
W
R
adr12 7  
0
adr12 6  
0
adr12 5  
0
adr12 4  
0
adr12 3  
0
adr12 2  
0
ADC Data Result Reg 12  
ADR12 (lo)  
W
R
ADC Data Result Reg 12  
W
MM912_634 Advance Information, Rev. 11.0  
52  
Freescale Semiconductor  
Functional Description and Application Information  
Table 73. Analog die Registers(63) - 0x0200–0x02FF D2D Blocking Access (D2DI) 2 of 3/  
0x0300–0x03FF D2D Non Blocking Access (D2DI) 3 of 3 (continued)  
Offset  
Name  
7
6
5
4
3
2
1
0
ADR14 (hi)  
ADC Data Result Reg 14  
ADR14 (lo)  
R
W
R
adr14 9  
adr14 8  
adr14 7  
adr14 6  
adr14 5  
adr14 4  
adr14 3  
adr14 2  
0xA2  
adr14 1  
adr14 0  
0
0
0
adr15 5  
0
0
adr15 4  
0
0
adr15 3  
0
0
adr15 2  
0
0xA3  
0xA4  
0xA5  
0xC0  
0xC1  
0xC2  
0xC3  
0xC4  
0xC5  
0xC6  
0xC7  
0xC8  
0xC9  
0xCA  
0xCB  
0xCC  
0xCD  
0xCE  
0xCF  
0xD0  
ADC Data Result Reg 14  
ADR15 (hi)  
W
R
adr15 9  
adr15 8  
adr15 7  
adr15 6  
ADC Data Result Reg 15  
ADR15 (lo)  
W
R
adr15 1  
adr15 0  
0
0
0
0
0
0
0
0
0
0
ADC Data Result Reg 15  
TIOS  
W
R
0
0
0
0
0
0
0
0
IOS3  
IOS2  
IOS1  
IOS0  
TIM InCap/OutComp Select  
CFORC  
W
R
0
0
0
0
Timer Compare Force Reg  
OC3M  
W
R
FOC3  
FOC2  
FOC1  
FOC0  
OC3M3  
OC3D3  
tcnt 11  
OC3M2  
OC3D2  
tcnt 10  
OC3M1  
OC3D1  
tcnt 9  
OC3M0  
OC3D0  
tcnt 8  
Output Comp 3 Mask Reg  
OC3D  
W
R
Output Comp 3 Data Reg  
TCNT (hi)  
W
R
tcnt 15  
tcnt 7  
tcnt 14  
tcnt 13  
tcnt 12  
tcnt 4  
Timer Count Register  
TCNT (lo)  
W
R
tcnt 6  
0
tcnt 5  
0
tcnt 3  
0
tcnt 2  
0
tcnt 1  
0
tcnt 0  
0
Timer Count Register  
TSCR1  
W
R
TEN  
0
TFFCA  
0
Timer System Control Reg 1  
TTOV  
W
R
0
0
TOV3  
OM1  
TOV2  
OL1  
TOV1  
OM0  
TOV0  
OL0  
Timer Toggle Overflow Reg  
TCTL1  
W
R
OM3  
OL3  
OM2  
OL2  
Timer Control Register 1  
TCTL2  
W
R
EDG3B  
0
EDG3A  
0
EDG2B  
0
EDG2A  
0
EDG1B  
C3I  
EDG1A  
C2I  
EDG0B  
C1I  
EDG0A  
C0I  
Timer Control Register 2  
TIE  
W
R
Timer Interrupt Enable Reg  
TSCR2  
W
R
0
0
0
0
0
0
0
0
0
TOI  
0
TCRE  
PR2  
PR1  
PR0  
Timer System Control Reg 2  
TFLG1  
W
R
C3F  
0
C2F  
0
C1F  
0
C0F  
0
Main Timer Interrupt Flag 1  
TFLG2  
W
R
TOF  
tc0 15  
tc0 7  
Main Timer Interrupt Flag 2  
TC0 (hi)  
W
R
tc0 14  
tc0 6  
tc0 13  
tc0 5  
tc0 12  
tc0 4  
tc0 11  
tc0 3  
tc0 10  
tc0 2  
tc0 9  
tc0 1  
tc1 9  
tc0 8  
tc0 0  
tc1 8  
TIM InCap/OutComp Reg 0  
TC0 (lo)  
W
R
TIM InCap/OutComp Reg 0  
TC1 (hi)  
W
R
tc1 15  
tc1 14  
tc1 13  
tc1 12  
tc1 11  
tc1 10  
TIM InCap/OutComp Reg 1  
W
MM912_634 Advance Information, Rev. 11.0  
53  
Freescale Semiconductor  
Functional Description and Application Information  
Table 73. Analog die Registers(63) - 0x0200–0x02FF D2D Blocking Access (D2DI) 2 of 3/  
0x0300–0x03FF D2D Non Blocking Access (D2DI) 3 of 3 (continued)  
Offset  
Name  
7
6
5
4
3
2
1
0
TC1 (lo)  
TIM InCap/OutComp Reg 1  
TC2 (hi)  
R
W
R
0xD1  
tc1 7  
tc1 6  
tc1 5  
tc1 4  
tc1 3  
tc1 2  
tc1 1  
tc1 0  
0xD2  
0xD3  
0xD4  
0xD5  
0xF0  
0xF1  
0xF2  
0xF3  
tc2 15  
tc2 7  
tc2 14  
tc2 6  
tc2 13  
tc2 5  
tc2 12  
tc2 4  
tc2 11  
tc2 3  
tc2 10  
tc2 2  
tc2 9  
tc2 1  
tc3 9  
tc3 1  
tc2 8  
tc2 0  
tc3 8  
tc3 0  
TIM InCap/OutComp Reg 2  
TC2 (lo)  
W
R
TIM InCap/OutComp Reg 2  
TC3 (hi)  
W
R
tc3 15  
tc3 7  
tc3 14  
tc3 6  
tc3 13  
tc3 5  
tc3 12  
tc3 4  
tc3 11  
tc3 3  
tc3 10  
tc3 2  
TIM InCap/OutComp Reg 3  
TC3 (lo)  
W
R
TIM InCap/OutComp Reg 3  
CTR0  
W
R
LINTRE  
BGTRE  
LINTR  
CTR1_6  
WDCTRE CTR0_4  
BGTRIM BGTRIM  
CTR0_3 WDCTR2 WDCTR1 WDCTR0  
IREFTRE IREFTR2 IREFTR1 IREFTR0  
Trimming Reg 0  
CTR1  
W
R
UP  
DN  
Trimming Reg 1  
CTR2  
W
R
SLPBGT SLPBG_L SLPBGT SLPBGT SLPBGT  
CTR2_E CTR2_1  
CTR2_0  
RE  
OCK  
R2  
R1  
R0  
Trimming Reg 2  
CTR3  
W
R
OFFCTR OFFCTR OFFCTR OFFCTR  
CTR3_E CTR3_2  
FMREV  
CTR3_1  
CTR3_0  
E
2
1
0
Trimming Reg 3  
SRR  
W
R
0
0
0
0
MMREV  
0xF4  
Note:  
Silicon Revision Register  
W
63. Registers not shown are reserved and must not be accessed.  
5.3  
MM912_634 - Analog Die Overview  
MCU  
ANALOG  
5.3.1  
Introduction  
The MM912_634 analog die implements all system base functionality to operate the integrated microcontroller,  
and delivers application specific actuator control as well as input capturing.  
5.3.2  
System Registers  
5.3.2.1  
Silicon Revision Register (SRR)  
Table 74. Silicon Revision Register (SRR)  
Offset(63) 0xF4  
Access: User read  
7
6
5
4
3
2
1
0
R
0
0
0
0
FMREV  
MMREV  
W
Note:  
64. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
54  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 75. SRR - Register Field Descriptions  
Field  
Description  
3-2  
MM912F634 analog die Silicon Revision Register - These bits represent the revision of Silicon of the analog die. They are  
incremented for every full mask or metal mask issued of the device. One number is set for one revision of the silicon of the  
analog die.  
FMREV  
1-0  
MMREV  
NOTE  
Refer to the MM912F634ER - Mask set errata document for details on the analog die mask  
revisions.  
5.3.3  
Analog Die Options  
The following section describes the differences between analog die options 1 and 2.  
Table 76. Analog Die Options  
Feature  
Option 1  
Option 2  
Current Sense Module  
Wake Up Inputs (Lx)  
YES  
NO  
L0…L5  
L0.L3  
NOTE  
This document will describe the features and functions of option 1 (all modules available and  
tested). Beyond this chapter, there will be no additional note or differentiation between the  
different implementations.  
5.3.3.1  
Current Sense Module  
For device options with the current sense module not available, the following considerations are to be made.  
5.3.3.1.1 Pinout considerations  
Table 77. ISENSE - Pin Considerations  
Pin  
PIN name for option 1  
New PIN name  
Comment  
40  
41  
ISENSEL  
ISENSEH  
NC  
NC  
ISENSE feature not bonded and/or not tested. Connect PINs 40 and 41  
(NC) to GND.  
5.3.3.1.2  
Register Considerations  
The Current Sense Register must remain in default (0x00) state.  
Offset  
Name  
7
6
5
4
3
2
1
0
CSR  
R
0
0
0
0x3C  
CSE  
CCD  
CSGS  
Current Sense Register  
W
The Conversion Control Register - Bit 9 must always be written 0.  
ACCR (hi)  
R
0
0x82  
CH15  
CH14  
CH12  
CH11  
CH10  
CH9  
CH8  
ADC Conversion Ctrl Reg  
W
The Conversion Complete Register - Bit 9 must be ignored.  
MM912_634 Advance Information, Rev. 11.0  
55  
Freescale Semiconductor  
Functional Description and Application Information  
ACCSR (hi)  
R
CC15  
CC14  
0
CC12  
CC11  
CC10  
CC9  
CC8  
0x84  
ADC Conv Complete Reg  
W
The ADC Data Result Reg 9 must be ignored.  
ADR9 (hi)  
R
W
R
adr9 9  
adr9 1  
adr9 8  
adr9 0  
adr9 7  
0
adr9 6  
0
adr9 5  
0
adr9 4  
0
adr9 3  
0
adr9 2  
0
0x98  
0x99  
ADC Data Result Register 9  
ADR9 (lo)  
ADC Data Result Register 9  
W
5.3.3.1.3  
Functional Considerations  
The complete Current Sense Module is not available.  
The ADC Channel 9 is not available.  
5.3.3.2  
Wake-up Inputs (Lx)  
For device options with reduced number of wake up inputs (Lx), the following considerations are to be made.  
5.3.3.2.1 Pinout considerations  
Table 78. Lx - Pin Considerations  
PIN Name for  
Option 1  
New PIN  
name  
Pin  
Comment  
One or more Lx wake up inputs are not available based on the analog die option. Not available Lx  
inputs are not bonded and/or not tested. Connect not available Lx pins (NC) to GND. RLx is not  
required on those pins.  
31…36  
Lx  
NC  
5.3.3.2.2  
Register Considerations  
The Lx - Bit for the not available Lx input in the Lx Status Register must be ignored.  
Offset  
Name  
7
6
5
4
3
2
1
0
LXR  
R
0
0
L5  
L4  
L3  
L2  
L1  
L0  
0x08  
Lx Status Register  
W
The Lx Control register for the not available Lx input must be written 0.  
LXCR  
R
0
0
0x09  
L5DS  
L4DS  
L3DS  
L2DS  
L1DS  
L0DS  
Lx Control Register  
W
A not available Lx input can not be selected as Wake-up Source and must have its LxWE bit set to 0.  
WCR  
R
0x12  
CSSEL  
L5WE  
L4WE  
L3WE  
L2WE  
L1WE  
L1WU  
L0WE  
L0WU  
Wake Up Control Register  
W
The Wake-up Source Register for not available Lx inputs must be ignored.  
WSR  
R
FWU  
LINWU  
L5WU  
L4WU  
L3WU  
L2WU  
0x14  
Wake Up Source Register  
W
The Conversion Control Register for the not available Lx analog input (3…8) must always be written 0.  
MM912_634 Advance Information, Rev. 11.0  
56  
Freescale Semiconductor  
Functional Description and Application Information  
ACCR (hi)  
R
W
R
0
0x82  
0x83  
CH15  
CH7  
CH14  
CH6  
CH12  
CH4  
CH11  
CH3  
CH10  
CH2  
CH9  
CH1  
CH8  
CH0  
ADC Conversion Ctrl Reg  
ACCR (lo)  
CH5  
ADC Conversion Ctrl Reg  
W
The Conversion Complete Register for the not available Lx analog input (3.8) must be ignored.  
ACCSR (hi)  
ADC Conv Complete Reg  
ACCSR (lo)  
R
W
R
CC15  
CC7  
CC14  
CC6  
0
CC12  
CC4  
CC11  
CC3  
CC10  
CC2  
CC9  
CC1  
CC8  
CC0  
0x84  
0x85  
CC5  
ADC Conv Complete Reg  
W
The ADC Data Result Register for the not available Lx analog input (3.8) must be ignored.  
ADRx (hi)  
R
W
R
adrx 9  
adrx 1  
adrx 8  
adrx 0  
adrx 7  
0
adrx 6  
0
adrx 5  
0
adrx 4  
0
adrx 3  
0
adrx 2  
0
ADC Data Result Register x  
ADRx (lo)  
0x8C-0  
x97  
ADC Data Result Register x  
W
5.3.3.2.3  
Functional Considerations  
For the not available Lx inputs, the following functions are limited:  
No Wake-up feature / Cyclic Sense  
No Digital Input  
No Analog Input and conversion via ADC  
5.4  
Modes of Operation  
The MM912_634 analog die offers three main operating modes: Normal (Run), Stop, and Sleep. In Normal mode,  
the device is active and is operating under normal application conditions. In Stop mode, the voltage regulator  
operates with limited current capability, the external load is expected to be reduced while in Stop mode. In Sleep  
mode both voltage regulators are turned off (VDD = VDDX = 0 V).  
MCU  
ANALOG  
Wake-up from Stop mode is indicated by an interrupt signal. Wake-up from Sleep mode will change the MM912_634 analog die  
into reset mode while the voltage regulator is turned back on.  
The selection of the different modes is controlled by the Mode Control Register (MCR).  
Figure 16 describes how transitions are done between the different operating modes.  
MM912_634 Advance Information, Rev. 11.0  
57  
Freescale Semiconductor  
 
Functional Description and Application Information  
Power  
Down  
Power Up  
(POR = 1)  
Power Down  
(VSUP<VPOR  
)
Reset  
Power Down  
(VSUP<VPOR  
)
WatchDog Time-Out1,  
External or Internal Reset  
Wake Up  
VDD High and Reset  
Delay (tRST) expired  
External or  
VDD Low and VSUV = 0  
and Delay (tVTO) expired  
Internal Reset  
Normal  
Mode  
Wake Up  
Stop  
Sleep  
Command  
Command  
Stop  
Mode  
Sleep  
Mode  
1) Initial WD to be served within tWDTO to enable Window WD  
Figure 16. Modes of Operation and Transitions  
5.4.1  
Power Down Mode  
For the device power (VS1) below VPOR, the MM912_634 analog die is virtually in Power Down mode. Once VS1>VPOR, the  
MM912_634 analog die will enter Reset mode with the condition “Power On Reset - POR”.  
5.4.2  
Reset Mode  
The MM912_634 analog die enters Reset mode if a reset condition occurs (POR - Power On Reset, LVR- Low Voltage Reset,  
Low Voltage VDDX Reset - LVRX, WDR - Watchdog Reset, EXR - External Reset, and WUR - Wake-up Sleep Reset).  
For internal reset sources, the RESET_A pin is driven low for tRST after the reset condition is gone. After this delay, the RESET_A  
pin is released. With a high detected on the RESET_A pin, VDD>VLVR and VDDX>VLVRX the MM912_634 analog die enters  
in Normal mode.  
To avoid short-circuit conditions being present for a long time, a tVTO timeout is implemented. Once VDD < VLVR or VDDX <  
VLVRX with VS1 > (VLVI + VLVI_H) for more than tVTO, the MM912_634 analog die will transit directly to Sleep mode.  
The Reset Status Register (RSR) will indicate the source of the reset by individual flags.  
POR - Power On Reset  
LVR - Low Voltage Reset VDD  
LVRX - Low Voltage Reset VDDX  
WDR - Watchdog Reset  
EXR - External Reset  
WUR - Wake-up Sleep Reset  
See also Resets.  
MM912_634 Advance Information, Rev. 11.0  
58  
Freescale Semiconductor  
Functional Description and Application Information  
5.4.3  
Normal Mode  
In Normal mode, all MM912_634 analog die user functions are active and can be controlled by the D2D Interface. Both regulators  
(VDD and VDDX) are active and operate with full current capability.  
Once entered in Normal mode, the Watchdog will operate as a simple non-window watchdog with an initial timeout (tIWDTO) to  
be reset via the D2D Interface. After the initial reset, the watchdog will operate in standard window mode. See Window Watchdog  
for details.  
5.4.4  
Stop Mode  
The Stop mode will allow reduced current consumption with fast startup time. In this mode, both voltage regulators (VDD and  
VDDX) are active, with limited current drive capability. In this condition, the MCU is supposed to operate in Low Power mode  
(STOP).  
NOTE  
To avoid any pending analog die interrupts prevent the MCU from entering MCU stop  
resulting in unexpected system behavior, the analog die IRQ sources should be disabled  
and the corresponding flags be cleared before entering stop.  
The device can enter in Stop mode by configuring the Mode Control Register (MCR) via the D2D Interface. The MCU has to enter  
a Low Power mode immediately afterwards executing the STOP instruction. The Wake-up Source Register (WSR) has to be read  
after a wake-up condition in order to execute a new STOP mode command. Two base clock cycles (fBASE) delay are required  
between WSR read and MCR write.  
While in Stop mode, the MM912_634 analog die will wake up on the following sources:  
Lx - Wake-up (maskable with selectable cyclic sense)  
Forced Wake-up (configurable timeout)  
LIN Wake-up  
D2D Wake-up (special command)  
After Wake-up from the sources listed above, the device will transit to Normal mode.  
Reset will wake up the device directly to Reset mode.  
See Wake-up / Cyclic Sense for details.  
5.4.5  
Sleep Mode  
The Sleep mode will allow very low current consumption. In this mode, both voltage regulators (VDD and VDDX) are inactive.  
The device can enter into Sleep mode by configuring the Mode Control Register (MCR) via the D2D- Interface. During Sleep  
mode, all unused internal blocks are deactivated to allow the lowest possible consumption. Power consumption will decrease  
further if the Cyclic Sense or Forced Wake-up feature are disabled. While in Sleep mode, the MM912_634 analog die will wake  
up on the following sources:  
Lx - Wake-up (maskable with selectable cyclic sense)  
Forced Wake-up (configurable timeout)  
LIN Wake-up  
After Wake-up from the sources listed above or a reset condition, the device will transit to Reset mode.  
See Wake-up / Cyclic Sense for details.  
MM912_634 Advance Information, Rev. 11.0  
59  
Freescale Semiconductor  
Functional Description and Application Information  
5.4.6  
Analog Die Functionality by Operation Mode  
Table 79. Operation Mode Overview  
Function  
Reset  
Normal  
Stop  
Sleep  
VDD/VDDX  
HSUP  
LSx  
full  
full  
full  
stop  
OFF  
OFF  
OFF  
full  
OFF  
OFF  
HSx  
full  
Cyclic Sense(63)  
Cyclic Sense(63)  
ADC  
full  
OFF  
OFF  
D2D  
full  
functional  
Wake-up(63)  
OFF  
OFF  
Wake-up(63)  
Lx  
full  
OFF  
PTBx  
full  
OFF  
LIN  
full  
full(66)  
Wake-up(63)  
Wake-up(63)  
OFF  
Watchdog  
VSENSE  
CSENSE  
Cyclic Sense  
OFF  
full  
OFF  
OFF  
full  
OFF  
Cyclic Sense(63)  
OFF  
Cyclic Sense(63)  
not active  
Note:  
65. If configured.  
66. Special init through non window watchdog.  
5.4.7  
5.4.7.1  
Register Definition  
Mode Control Register (MCR)  
Table 80. Mode Control Register (MCR)  
Offset(67) 0x16  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
MODE  
Reset  
0
0
0
0
0
0
0
0
Note:  
67. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 81. MCR - Register Field Descriptions  
Field  
Description  
Mode Select - These bits will issue a transition from to the selected Operating Mode.  
00 - Normal Mode. Only with effect in Stop Mode. Will issue Wake Up and transition to Normal Mode.  
1-0  
MODE  
01 - Stop Mode. Will initiate transition to Stop Mode.(68)  
10 - Sleep Mode. Will initiate transition to Sleep Mode.  
11 - Normal Mode.  
Note:  
68. The Wake-up Source Register (WSR) has to be read after a wake-up condition in order to execute a new STOP mode command. Two  
base clock cycles (fBASE) delay are required between WSR read and MCR write.  
MM912_634 Advance Information, Rev. 11.0  
60  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
5.5  
Power Supply  
The MM912_634 analog die supplies VDD (2.5 V), VDDX (5.0 V), and HSUP, based on the supply voltage applied  
to the VS1 pin. VDD is cascaded of the VDDX regulator. To separate the High-side outputs from the main power  
supply, the VS2 pin does only power the High-side drivers. Both supply pins have to be externally protected  
against reverse battery conditions. To supply external Hall Effect Sensors, the HSUP pin will supply a switchable  
regulated supply. See Hall Sensor Supply Output - HSUP.  
MCU  
ANALOG  
A reverse battery protected input (VSENSE) is implemented to measure the Battery Voltage directly. A serial resistor (RVSENSE)  
is required on this pin. See Supply Voltage Sense - VSENSE. In addition, the VS1 supply can be routed to the ADC (VS1SENSE)  
to measure the VS1 pin voltage directly. See Internal Supply Voltage Sense - VS1SENSE.  
To have an independent ADC verification, the internal sleep mode bandgap voltage can be routed to the ADC (BANDGAP). As  
this node is independent from the ADC reference, any out of range result would indicate malfunctioning ADC or Bandgap  
reference. See Internal Bandgap Reference Voltage Sense - BANDGAP.  
To stabilize the internal ADC reference voltage for higher precision measurements, the current limited ADC2p5 pin needs to be  
connected to an external filter capacitor (CADC2p5). It is not recommended to connect additional loads to this pin. See Analog  
Digital Converter - ADC.  
The following safety features are implemented:  
LBI - Low Battery Interrupt, internally measured at VSENSE  
LVI - Low Voltage Interrupt, internally measured at VS1  
HVI - High Voltage Interrupt, internally measured at VS2  
VROVI - Voltage Regulator Overvoltage Interrupt internally measured at VDD and VDDX  
LVR - Low Voltage Reset, internally measured at VDD  
LVRX - Low Voltage Reset, internally measured at VDDX  
HTI - High Temperature Interrupt measured between the VDD and VDDX regulators  
Overtemperature Shutdown measured between the VDD and VDDX regulators  
LBI  
HVI  
HS1  
÷
HS1 & HS2  
HS2  
LVI  
ADC  
bg1p25sleep  
HSUP (18V)  
Regulator  
VDDX (5V)  
Regulator  
HSUP  
CHSUP  
VDDXINTERNAL  
VDDX  
LVRX  
VROV  
CVDDX  
ADC2p5  
ADC 2.5V  
Reference  
VDD (2.5V)  
Regulator  
CADC  
VDD  
VDDINTERNAL  
CVDD  
LVR  
Figure 17. MM912_634 Power Supply  
MM912_634 Advance Information, Rev. 11.0  
61  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.5.1  
Voltage Regulators VDD (2.5 V) & VDDX (5.0 V)  
To supply the MCU die and minor additional loads two cascaded voltage regulators have been implemented, VDDX (5.0 V) and  
VDD (2.5 V). External capacitors (CVDD) and (CVDDX) are required for proper regulation.  
5.5.2  
Power Up Behavior / Power Down Behavior - I64  
To guarantee safe power up and down behavior, special dependencies are implemented to prevent unwanted MCU execution.  
Figure 18 shows a standard power up and power down sequence.  
RESET_A  
Normal Operating  
Range (not to scale)  
V
LBI / VLVI  
VROVX  
5V  
/ VLVR_MCU  
VLVRX  
4
1
VROX  
VLVR  
5
2
VPOR_A  
VPOR_MCU  
3
6
VSUP  
VDDX  
VDD  
Figure 18. Power Up / Down Sequence  
To avoid any critical behavior, it is essential to have the MCU Power On Reset (POR) active when the analog die reset  
(RESET_A) is not fully active. As the RESET_A circuity is supplied by VDDX, VDD needs to be below the POR threshold when  
VDDX is to low to guarantee RESET_A active (3;6). This is achieved with the following implementation.  
Power Up:  
The VDD regulator is enabled after VDDX has reached the VLVRX threshold (1).  
Once VDD reaches VLRV, the RESET_A is released (2).  
The MCU is also protected by the MCU_LVR.  
Power Down:  
Once VDDX has reached the VLVRX threshold (4), the VDD regulator is disabled and the regulator output is actively  
pulled down to discharge any VDD capacitance (5). RESET_A is activated as well.  
The active discharge guarantees VDD to be below POR level before VDDX discharges below critical level for the reset  
circuity.  
NOTE  
The behavior explained previously is essential for the 9S12I64 MCU die used, as this MCU  
does have an internal regulator stage, but the LVR function only active in normal mode  
9S12I64.  
The shutdown behavior should be considered when sizing the external capacitors CVDD and  
CVDDX for extended low voltage operation.  
MM912_634 Advance Information, Rev. 11.0  
62  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.5.3  
Register Definition  
5.5.3.1  
Voltage Control Register (VCR)  
Table 82. Voltage Control Register (VCR)  
Offset(67) 0x04  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
VROVIE  
0
HTIE  
0
HVIE  
0
LVIE  
0
LBIE  
0
Reset  
0
0
0
Note:  
69. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 83. VCR - Register Field Descriptions  
Field  
Description  
Voltage Regulator Overvoltage Interrupt Enable — Enables the interrupt for the Regulator Overvoltage Condition.  
0 - Voltage Regulator Overvoltage Interrupt is disabled  
4
VROVIE  
1 - Voltage Regulator Overvoltage Interrupt is enabled  
High Temperature Interrupt Enable — Enables the interrupt for the Voltage Regulator (VDD/VDDX) Temperature Warning.  
0 - High Temperature Interrupt is disabled  
3
HTIE  
1 - High Temperature Interrupt is enabled  
High Voltage Interrupt Enable — Enables the interrupt for the VS2 - High Voltage Warning.  
0 - High Voltage Interrupt is disabled  
2
HVIE  
1 - High Voltage Interrupt is enabled  
Low Voltage Interrupt Enable — Enables the interrupt for the VS1 - Low Voltage Warning.  
0 - Low Voltage Interrupt is disabled  
1
LVIE  
1 - Low Voltage Interrupt is enabled  
Low Battery Interrupt Enable — Enables the interrupt for the VSENSE - Low Battery Voltage Warning.  
0 - Low Battery Interrupt is disabled  
0
LBIE  
1 - Low Battery Interrupt is enabled  
5.5.3.2  
Voltage Status Register (VSR)  
Table 84. Voltage Status Register (VSR)  
Offset(70) 0x05  
Access: User read  
7
6
5
4
3
2
1
0
R
W
0
0
0
VROVC  
HTC  
HVC  
LVC  
LBC  
Reset  
0
0
0
0
0
0
0
0
Note:  
70. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
63  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 85. VSR - Register Field Descriptions  
Field  
Description  
Voltage Regulator Overvoltage Condition - This status bit indicates an overvoltage warning is present for at least one of the  
main voltage regulators (VDD or VDDX). Reading the register will clear the VROVI flag if present. See Interrupts for details.  
Note: This feature requires the trimming of Trimming Register 2 (CTR2) to be done to be effective. Untrimmed devices may  
issue the VROVC condition including the LS turn off at normal operation.  
4
VROVC  
0 - No Voltage Regulator Overvoltage Condition present.  
1 - Voltage Regulator Overvoltage Condition present.  
High Temperature Condition - This status bit indicates a high temperature warning is present for the Voltage regulators  
(VDD/VDDX). Reading the register will clear the HTI flag if present. See Interrupts for details.  
3
0 - No High Temperature Condition present.  
1 - High Temperature Condition present.  
HTC  
High Voltage Condition - This status bit indicates a high voltage warning for VS2 is present. Reading the register will clear the  
HVI flag if present. See Interrupts for details.  
2
0 - No High Voltage Condition present.  
1 - High Voltage Condition present.  
HVC  
Low Voltage Condition - This status bit indicates a low voltage warning for VS1 is present. Reading the register will clear the  
LVI flag if present. See Interrupts for details.  
1
0 - No Low Voltage Condition present.  
1 - Low Voltage Condition present.  
LVC  
Low Battery Condition - This status bit indicates a low voltage warning for VSENSE is present. Reading the register will clear  
the LBI flag if present. See Interrupts for details.  
0
0 - No Low Battery Condition present.  
1 - Low Battery Condition present.  
LBC  
5.6  
Die to Die Interface - Target  
The D2D Interface is the bus interface to the Microcontroller. Access to the MM912_634 analog die is controlled  
by the D2D Interface module. This section describes the functionality of the die-to-die target block (D2D).  
MCU  
ANALOG  
5.6.1  
Overview  
The D2D is the target for a data transfer from the target to the initiator (MCU). The initiator provides a set of configuration registers  
and two memory mapped 256 Byte address windows. When writing to a window, a transaction is initiated sending a write  
command, followed by an 8-bit address, and the data byte or word is received from the initiator. When reading from a window, a  
transaction is received with the read command, followed by an 8-bit address. The target then responds with the data. The basic  
idea is that a peripheral located on the MM912_634 analog die, can be addressed like an on-chip peripheral.  
Features:  
software transparent register access to peripherals on the MM912_634 analog die  
256 Byte address window  
supports blocking read or write, as well as non-blocking write transactions  
4-bit physical bus width  
automatic synchronization of the target when initiator starts driving the interface clock  
generates transaction and error status as well as EOT acknowledge  
providing single interrupt interface to D2D Initiator  
5.6.2  
Low Power Mode Operation  
The D2D module is disabled in SLEEP mode. In Stop mode, the D2DINT signal is used to wake-up a powered down MCU. As  
the MCU could wake-up without the MM912_634 analog die, a special command will be recognized as a wake-up event during  
Stop mode. See Modes of Operation.  
5.6.2.1  
Normal Mode / Stop Mode  
While in Normal or Stop mode, D2DCLK acts as input only with pull present. D2D[3:0] operates as an input/output with pull-down  
always present. D2DINT acts as output only.  
MM912_634 Advance Information, Rev. 11.0  
64  
Freescale Semiconductor  
 
Functional Description and Application Information  
NOTE  
The maximum allowed clock speed of the interface is limited to fD2D  
.
5.6.2.2  
Sleep Mode  
While in Sleep mode, all Interface data pins are pulled down to DGND to reduce power consumption.  
5.7  
Interrupts  
Interrupts are used to signal a microcontroller that a peripheral needs to be serviced. While in Stop mode, the  
interrupt signal is used to signal Wake-up events. The interrupts are signaled by an active high level of the D2DINT  
pin, which will remain high until the interrupt is acknowledged via the D2D-Interface. Interrupts are only asserted  
while in Normal mode.  
MCU  
ANALOG  
5.7.1  
Interrupt Source Identification  
Once an Interrupt is signalized, there are two options to identify the corresponding source(s).  
5.7.1.1  
Interrupt Source Mirror  
All Interrupt sources in MM912_634 analog die are mirrored to a special Interrupt Source Register (ISR). This register is read  
only and will indicate all currently pending Interrupts. Reading this register will not acknowledge any interrupt. An additional D2D  
access is necessary to serve the specific module.  
NOTE  
The VSI - Voltage Status Interrupt combines the five status flags for the Low Battery  
Interrupt, Low Voltage Interrupt, High Voltage Interrupt, Voltage Regulator Overvoltage  
Interrupt, and the Voltage Regulator High Temperature Interrupt. The specific source can be  
identified by reading the Voltage Status Register - VSR.  
5.7.1.1.1  
Interrupt Source Register (ISR)  
Table 86. Interrupt Source Register (ISR)  
Offset(67) 0x00 (0x00 and 0x01 for 8Bit access)  
Access: User read  
15  
14  
13  
12  
11  
10  
9
8
7
6
5
4
3
2
1
0
R
W
0
0
HOT LSOT HSOT LINOT SCI  
RX  
TX  
ERR TOV CH3  
CH2  
CH1  
CH0  
VSI  
Note:  
71. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 87. ISR - Register Field Descriptions  
Field  
Description  
VSI - Voltage Status Interrupt combining the following sources:  
• Low Battery Interrupt  
• Low Voltage Interrupt  
• High Voltage Interrupt  
0 - VSI  
• Voltage Regulator Overvoltage Interrupt  
• Voltage Regulator High Temperature Interrupt  
1 - CH0  
2 - CH1  
3 - CH2  
4 - CH3  
5 - TOV  
6 - ERR  
CH0 - TIM Channel 0 Interrupt  
CH1 - TIM Channel 1 Interrupt  
CH2 - TIM Channel 2 Interrupt  
CH3 - TIM Channel 3 Interrupt  
TOV - Timer Overflow Interrupt  
ERR - SCI Error Interrupt  
MM912_634 Advance Information, Rev. 11.0  
65  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 87. ISR - Register Field Descriptions (continued)  
Field  
Description  
7 - TX  
8 - RX  
TX - SCI Transmit Interrupt  
RX - SCI Receive Interrupt  
9 - SCI  
SCI - ADC Sequence Complete Interrupt  
10 - LINOT  
11 - HSOT  
12 - LSOT  
13 - HOT  
LINOT - LIN Driver Overtemperature Interrupt  
HSOT - High-side Overtemperature Interrupt  
LSOT - Low-side Overtemperature Interrupt  
HOT - HSUP Overtemperature Interrupt  
5.7.1.2  
Interrupt Vector Emulation by Priority  
To allow a vector based interrupt handling by the MCU, the number of the highest prioritized interrupt pending is returned in the  
Interrupt Vector Register. To allow an offset based vector table, the result is pre-shifted (multiple of 2). Reading this register will  
not acknowledge an interrupt. An additional D2D access is necessary to serve the specific module.  
5.7.1.2.1  
Interrupt Vector Register (IVR)  
Table 88. Interrupt Vector Register (IVR)  
Offset(72) 0x02  
Access: User read  
7
6
5
4
3
2
1
0
R
0
0
IRQ  
W
Note:  
72. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 89. IVR - Register Field Descriptions  
Field  
Description  
Represents the highest prioritized interrupt pending. See Table 90 In case no interrupt is pending, the result will be 0.  
5:0  
IRQ  
The following table is listing all MM912_634 analog die interrupt sources with the corresponding priority.  
Table 90. Interrupt Source Priority  
Interrupt Source  
IRQ  
Priority  
no interrupt pending or wake-up from Stop mode  
LVI - Low Voltage Interrupt  
0x00  
0x02  
0x04  
0x06  
0x08  
0x0A  
0x0C  
0x0E  
0x10  
0x12  
0x14  
0x16  
1 (highest)  
2
3
HTI - Voltage Regulator High Temperature Interrupt  
LBI - Low Battery Interrupt  
4
CH0 - TIM Channel 0 Interrupt  
CH1 - TIM Channel 1 Interrupt  
CH2 - TIM Channel 2 Interrupt  
CH3 - TIM Channel 3 Interrupt  
TOV - Timer Overflow Interrupt  
ERR - SCI Error Interrupt  
5
6
7
8
9
10  
11  
12  
TX - SCI Transmit Interrupt  
RX - SCI Receive Interrupt  
MM912_634 Advance Information, Rev. 11.0  
66  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 90. Interrupt Source Priority (continued)  
Interrupt Source  
IRQ  
Priority  
SCI - ADC Sequence Complete Interrupt  
LINOT - LIN Driver Overtemperature Interrupt  
HSOT - High-side Overtemperature Interrupt  
LSOT - Low-side Overtemperature Interrupt  
HOT - HSUP Overtemperature Interrupt  
HVI - High Voltage Interrupt  
0x18  
0x1A  
0x1C  
0x1E  
0x20  
0x22  
0x24  
13  
14  
15  
16  
17  
18  
VROVI - Voltage Regulator Overvoltage Interrupt  
19 (lowest)  
5.7.2  
Interrupt Sources  
5.7.2.1  
Voltage Status Interrupt (VSI)  
The Voltage Status Interrupt - VSI combines the five interrupt sources of the Voltage Status Register. It is only available in the  
Interrupt Source Register (ISR). Acknowledge the interrupt by reading the Voltage Status Register - VSR. To issue a new  
interrupt, the condition has to vanish and occur again. See Power Supply for details on the Voltage Status Register including  
masking information.  
5.7.2.2  
Low Voltage Interrupt (LVI)  
Acknowledge the interrupt by reading the Voltage Status Register - VSR. To issue a new interrupt, the condition has to vanish  
and occur again. See Power Supply for details on the Voltage Status Register including masking information.  
5.7.2.3  
Voltage Regulator High Temperature Interrupt (HTI)  
Acknowledge the interrupt by reading the Voltage Status Register - VSR. To issue a new interrupt, the condition has to vanish  
and occur again. See Power Supply for details on the Voltage Status Register including masking information.  
5.7.2.4  
Low Battery Interrupt (LBI)  
Acknowledge the interrupt by reading the Voltage Status Register - VSR. To issue a new interrupt, the condition has to vanish  
and occur again. See Power Supply for details on the Voltage Status Register including masking information.  
5.7.2.5  
TIM Channel 0 Interrupt (CH0)  
See Basic Timer Module - TIM (TIM16B4C).  
5.7.2.6  
TIM Channel 1 Interrupt (CH1)  
See Basic Timer Module - TIM (TIM16B4C).  
5.7.2.7  
TIM Channel 2 Interrupt (CH2)  
See Basic Timer Module - TIM (TIM16B4C).  
5.7.2.8  
TIM Channel 3 Interrupt (CH3)  
See Basic Timer Module - TIM (TIM16B4C).  
5.7.2.9  
TIM Timer Overflow Interrupt (TOV)  
See Basic Timer Module - TIM (TIM16B4C).  
5.7.2.10  
SCI Error Interrupt (ERR)  
See Serial Communication Interface (S08SCIV4).  
5.7.2.11  
SCI Transmit Interrupt (TX)  
See Serial Communication Interface (S08SCIV4).  
MM912_634 Advance Information, Rev. 11.0  
67  
Freescale Semiconductor  
Functional Description and Application Information  
5.7.2.12  
SCI Receive Interrupt (RX)  
See Serial Communication Interface (S08SCIV4).  
5.7.2.13  
LIN Driver Overtemperature Interrupt (LINOT)  
Acknowledge the interrupt by reading the LIN Register - LINR. To issue a new interrupt, the condition has to vanish and occur  
again. See LIN Physical Layer Interface - LIN for details on the LIN Register including masking information.  
5.7.2.14  
High-side Overtemperature Interrupt (HSOT)  
Acknowledge the interrupt by reading the High-side Status Register - HSSR. To issue a new interrupt, the condition has to vanish  
and occur again. See High-side Drivers - HS for details on the High-side Status Register including masking information.  
5.7.2.15  
Low-side Overtemperature Interrupt (LSOT)  
Acknowledge the interrupt by reading the Low-side Status Register - LSSR. To issue a new interrupt, the condition has to vanish  
and occur again. See Low-side Drivers - LSx for details on the Low-side Status Register including masking information.  
5.7.2.16  
HSUP Overtemperature Interrupt (HOT)  
Acknowledge the interrupt by reading the Hall Supply Register - HSR. To issue a new interrupt, the condition has to vanish and  
occur again. See Hall Sensor Supply Output - HSUP for details on the Hall Supply Register including masking information.  
5.7.2.17  
High Voltage Interrupt (HVI)  
Acknowledge the interrupt by reading the Voltage Status Register - VSR. To issue a new interrupt, the condition has to vanish  
and occur again. See Power Supply for details on the Voltage Status Register including masking information.  
5.7.2.18  
Voltage Regulator Overvoltage Interrupt (VROVI)  
Acknowledge the interrupt by reading the Voltage Status Register - VSR. To issue a new interrupt, the condition has to vanish  
and occur again. See Power Supply for details on the Voltage Status Register including masking information.  
5.8  
Resets  
To protect the system during critical events, the MM912_634 analog die will drive the RESET_A pin low during the  
presence of the reset condition. In addition, the RESET_A pin is monitored for external reset events. To match the  
MCU, the RESET_A pin is based on the VDDX voltage level.  
MCU  
ANALOG  
After an internal reset condition has gone, the RESET_A will stay low for an additional time tRST before being  
released. Entering reset mode will cause all MM912_634 analog die registers to be initialized to their RESET default. The only  
registers with valid information are the Reset Status Register (RSR) and the Wake-up Source Register (WUS).  
5.8.1  
Reset Sources  
In the MM912_634 six reset sources exist.  
5.8.1.1  
POR - Analog Die Power On Reset  
To indicate the device power supply (VS1) was below VPOR or the MM912_634 analog die was powered up, the POR condition  
is set. See Modes of Operation.  
5.8.1.2  
LVR - Low Voltage Reset - VDD  
With the VDD voltage regulator output voltage falling below VLVR, the Low Voltage Reset condition becomes present. As the  
VDD Regulator is shutdown once a LVRX condition is detected, The actual cause could be also a low voltage condition at the  
VDDX regulator. See Power Supply.  
5.8.1.3  
LVRX - Low Voltage Reset - VDDX  
With the VDDX voltage regulator output voltage falling below VLVRX, the Low Voltage Reset condition becomes present. See  
Power Supply.  
MM912_634 Advance Information, Rev. 11.0  
68  
Freescale Semiconductor  
Functional Description and Application Information  
5.8.1.4  
WUR - Wake-up Reset  
While in Sleep mode, any active wake-up event will cause a MM912_634 analog die transition from Sleep to Reset Mode. To  
determine the wake-up source, refer to Wake-up / Cyclic Sense.  
5.8.1.5  
EXR - External Reset  
Any low level voltage at the RESET_A pin with a duration > tRSTDF will issue an External Reset event. This reset source is also  
active in Stop mode.  
5.8.1.6  
WDR - Watchdog Reset  
Any incorrect serving if the MM912_634 analog die Watchdog will result in a Watchdog Reset. Refer to the Window Watchdog  
for details.  
5.8.2  
Register Definition  
5.8.2.1  
Reset Status Register (RSR)  
Table 91. Reset Status Register (RSR)  
Offset(72) 0x15  
Access: User read  
7
6
5
4
3
2
1
0
R
0
0
WDR  
EXR  
WUR  
LVRX  
LVR  
POR  
W
Note:  
73. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 92. RSR - Register Field Descriptions  
Field  
Description  
5 - WDR  
4 - EXR  
Watchdog Reset - Reset caused by an incorrect serving of the watchdog.  
External Reset - Reset caused by the RESET_A pin driven low externally for > tRSTDF  
.
Wake-up Reset - Reset caused by a wake-up from Sleep mode. To determine the wake-up source, refer to Wake-up / Cyclic  
Sense.  
3 - WUR  
2 - LVRX  
1 - LVR  
0 - POR  
Low Voltage Reset VDDX - Reset caused by a low voltage condition monitored at the VDDX output.  
Low Voltage Reset VDD - Reset caused by a low voltage condition monitored at the VDD output.(74)  
Power On Reset - Supply Voltage was below VPOR  
.
Note:  
74. As the VDD Regulator is shutdown once a LVRX condition is detected, The actual cause could be also a low voltage condition at the  
VDDX regulator.  
Reading the Reset Status register will clear the information inside. Writing has no effect. LVR and LVRX are masked when POR  
or WUR are set.  
5.9  
Wake-up / Cyclic Sense  
To wake-up the MM912_634 analog die from Stop or Sleep mode, several wake-up sources are implemented. As  
described in Modes of Operation, a wake-up from Stop mode will result in an interrupt (D2DINT) to the MCU  
combined with a transition to Normal mode. A wake-up from Sleep mode will result in a transition to Reset mode.  
In any case, the source of the wake-up can be identified by reading the Wake-up Source Register (WSR). The  
MCU  
ANALOG  
Wake-up Source Register (WSR) has to be read after a wake-up condition in order to execute a new STOP mode command. Two  
base clock cycles (fBASE) delay are required between the WSR read and MCR write.  
In general, there are the following seven main wake-up sources:  
Wake-up by a state change of one of the Lx inputs  
Wake-up by a state change of one of the Lx inputs during a cyclic sense  
MM912_634 Advance Information, Rev. 11.0  
69  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Wake-up due to a forced wake-up  
Wake-up by the LIN module  
Wake-up by D2D interface (Stop mode only)  
Wake-up due to internal / external Reset (Stop mode only)  
Wake-up due to loss of supply voltage (Sleep mode only)  
VSUP  
HS1  
HS2  
D2DINT  
Wake Up  
Module  
Cyclic Sense / Forced  
Wake Up Timer  
D2DCLK  
D2D3  
Forced  
Wake Up  
L0  
L1  
L2  
L3  
L4  
L5  
D2D  
Wake Up  
D2D2  
D2D1  
D2D0  
Cyclic Wake Up  
Lx – Wake Up  
LIN  
LIN Bus  
LIN Wake Up  
Figure 19. Wake-up Sources  
5.9.1  
Wake-up Sources  
Lx - Wake-up (Cyclic Sense Disabled)  
5.9.1.1  
Any state digital change on a Wake-up Enabled Lx input will issue a wake-up. In order to select and activate a Wake-up Input  
(Lx), the Wake-up Control Register (WCR) must be configured with appropriate LxWE inputs enabled or disabled before entering  
low power mode. The Lx - Wake-up may be combined with the Forced Wake-up.  
Note: Selecting a Lx Input for wake-up will disable a selected analog input once entering low power mode.  
5.9.1.2  
Lx - Cyclic Sense Wake-up  
To reduce external power consumption during low power mode a cyclic wake-up has been implemented. Configuring the Timing  
Control Register (TCR) a specific cycle time can be selected to implement a periodic switching of the HS1 or HS2 output with the  
corresponding detection of an Lx state change. Any configuration of the HSx in the High-side Control Register (HSCR) will be  
ignored when entering low power mode. The Lx - Cyclic Sense Wake-up may be combined with the Forced Wake-up. In case  
both (forced and Lx change) events are present at the same time, the Forced Wake-up will be indicated as Wake-up source.  
NOTE  
Once Cyclic Sense is configured (CSSEL!=0), the state change is only recognized from one  
cyclic sense event to the next.  
The additional accuracy of the cyclic sense cycle by the WD clock trimming is only active  
during STOP mode. There is no trimmed clock available during SLEEP mode.  
5.9.1.3  
Forced Wake-up  
Configuring the Forced Wake-up Multiplier (FWM) in the Timing Control Register (TCR) will enable the forced wake-up based on  
the selected Cyclic Sense Timing (CST). Forced Wake-up can be combined with all other wake-up sources considering the timing  
dependencies.  
5.9.1.4  
LIN - Wake-up  
While in Low-Power mode the MM912_634 analog die monitors the activity on the LIN bus. A dominant pulse longer than  
tPROPWL followed by a dominant to recessive transition will cause a LIN Wake-up. This behavior protects the system from a  
short-to-ground bus condition.  
MM912_634 Advance Information, Rev. 11.0  
70  
Freescale Semiconductor  
Functional Description and Application Information  
5.9.1.5  
D2D - Wake-up (Stop Mode only)  
Receiving a Normal mode request via the D2D interface (MODE=0, Mode Control Register (MCR)) will result in a wake-up from  
stop mode. As this condition is controlled by the MCU, no wake-up status bit does indicate this wake-up source.  
5.9.1.6  
Wake-up Due to Internal / External Reset (STOP Mode Only)  
While in Stop mode, a Reset due to a VDD low voltage condition or an external Reset applied on the RESET_A pin will result in  
a Wake-up with immediate transition to Reset mode. In this case, the LVR or EXR bits in the Reset Status Register will indicate  
the source of the event.  
5.9.1.7  
Wake-up Due to Loss of Supply Voltage (SLEEP Mode Only)  
While in Sleep mode, a supply voltage VS1 < VPOR will result in a transition to Power On mode.  
5.9.2  
Register Definition  
5.9.2.1  
Wake-up Control Register (WCR)  
Table 93. Wake-up Control Register (WCR)  
Offset(74) 0x12  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
CSSEL  
L5WE  
1
L4WE  
1
L3WE  
1
L2WE  
1
L1WE  
1
L0WE  
1
Reset  
0
0
Note:  
75. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 94. WCR - Register Field Descriptions  
Field  
Description  
Cyclic Sense Select - Configures the HSx output for the cyclic sense event. Note, with no LxWE selected - only the selected  
HSx output will be switched periodically, no Lx state change would be detected. For all configurations, the Forced Wake-up  
can be activated in parallel in Section 5.9.2.2, “Timing Control Register (TCR)"  
7-6  
00 - Cyclic Sense Off  
CSSEL  
01 - Cyclic Sense with periodic HS1on  
10 - Cyclic Sense with periodic HS2 on  
11 - Cyclic Sense with periodic HS1 and HS2 on.  
Wake-up Input 5 Enabled - L5 Wake-up Select Bit.  
0 - L5 Wake-up Disabled  
5 - L5WE  
4 - L4WE  
3 - L3WE  
2- L2WE  
1 - L5 Wake-up Enabled  
Wake-up Input 4 Enabled - L4 Wake-up Select Bit.  
0 - L4 Wake-up Disabled  
1 - L4 Wake-up Enabled  
Wake-up Input 3 Enabled - L3 Wake-up Select Bit.  
0 - L3Wake-up Disabled  
1 - L3 Wake-up Enabled  
Wake-up Input 2 Enabled - L2 Wake-up Select Bit.  
0 - L2 Wake-up Disabled  
1 - L2 Wake-up Enabled  
MM912_634 Advance Information, Rev. 11.0  
71  
Freescale Semiconductor  
Functional Description and Application Information  
Table 94. WCR - Register Field Descriptions (continued)  
Field  
Description  
Wake-up Input 1 Enabled - L1 Wake-up Select Bit.  
0 - L1 Wake-up Disabled  
1 - L1 Wake-up Enabled  
1 - L1WE  
0 - L0WE  
Wake-up Input 0 Enabled - L0 Wake-up Select Bit.  
0 - L0 Wake-up Disabled  
1 - L0 Wake-up Enabled  
5.9.2.2  
Timing Control Register (TCR)  
Table 95. Timing Control Register (TCR)  
Offset(76) 0x13  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
FWM  
CST  
Reset  
0
0
0
0
0
0
0
0
Note:  
76. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 96. TCR - Register Field Descriptions  
Field  
Description  
Forced Wake-up Multiplicator - Configures the multiplicator for the forced wake-up. The selected multiplicator (FWM!=0)  
will force a wake-up every FWM x CST ms. With this implementation, Forced and Cyclic wake-up can be performed in  
parallel with the cyclic sense period <= the forced wake-up period.  
0000 - Forced Wake-up = Off  
0001 - 1x  
0010 - 2x  
0011 - 4x  
0100 - 8x  
7-4  
FWM  
0101 - 16x  
0110 - 32x  
0111 - 64x  
1000 - 128x  
1001 - 256x  
1010 - 512x  
1011 - 1024x  
11xx - not implemented (Forced Wake Multiplicator = 1024x)  
MM912_634 Advance Information, Rev. 11.0  
72  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 96. TCR - Register Field Descriptions (continued)  
Field  
Description  
Cyclic Sense Timing(77)  
0000 - 1.0 ms  
0001 - 2.0 ms  
0010 - 5.0 ms  
0011 - 10 ms  
0100 - 20 ms  
0101 - 50 ms  
0110 - 100 ms  
0111 - 200 ms  
1000 - 500 ms  
1001 - 1000 ms  
3-0  
CST  
1010 - 1111 - not implemented (Cyclic Sense Timing = 1000 ms)  
Note:  
77. Cyclic Sense Timing with Accuracy CSAC and CSACT.  
5.9.2.3  
Wake-up Source Register (WSR)  
Table 97. Wake-up Source Register (WSR)  
Offset(78) 0x14  
Access: User read  
7
6
5
4
3
2
1
0
R
W
FWU  
LINWU  
L5WU  
L4WU  
L3WU  
L2WU  
L1WU  
L0WU  
Note:  
78. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 98. WSR - Register Field Descriptions  
Field  
Description  
Forced Wake-up - Wake-up caused by a forced wake-up  
7 - FWU  
6 - LINWU  
5 - L5WU  
4 - L4WU  
3 - L3WU  
2 - L2WU  
1 - L1WU  
0 - L0WU  
LIN Wake-up - Wake-up caused by a LIN wake-up  
L5 Wake-up - Wake-up caused by a state change of the L6 Input  
L4 Wake-up - Wake-up caused by a state change of the L5 Input  
L3 Wake-up - Wake-up caused by a state change of the L4 Input  
L2 Wake-up - Wake-up caused by a state change of the L3 Input  
L1 Wake-up - Wake-up caused by a state change of the L2 Input  
L0 Wake-up - Wake-up caused by a state change of the L1 Input  
Reading the WSR will clear the wake-up status bit(s). Writing will have no effect. The Wake-up Source Register (WSR) has to be  
read after a wake-up condition, in order to execute a new STOP mode command. Two base clock cycles (fBASE) delays are  
required between the WSR read and the MCR write.  
5.10  
Window Watchdog  
The MM912_634 analog die includes a configurable window watchdog, which is active in Normal mode. The  
watchdog module is based on a separate clock source (fBASE) operating independent from the MCU based  
D2DCLK clock. The watchdog timeout (tWDTO) can be configured between 10 ms and 1280 ms (typ.) using the  
Watchdog Register (WDR).  
MCU  
ANALOG  
During Low Power mode, the watchdog feature is not active, a D2D read during Stop mode will have the WDOFF bit set.  
To clear the watchdog counter, a alternating write must be performed to the Watchdog Service Register (WDSR). The first write  
after the RESET_A has been released has to be 0xAA. The next one must be 0x55.  
MM912_634 Advance Information, Rev. 11.0  
73  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
After the RESET_A has been released, there will be a standard (non-window) watchdog active with a fixed timeout of tIWDTO  
.
The Watchdog Window Open (WDWO) bit is set during that time and the window watchdog can be configured (WDR) without  
changing the initial timeout, and can be trimmed using the trim value given in the MCU trimming Flash section. See MM912_634  
- Analog Die Trimming.  
WD Register  
WRITE = 0xAA  
(to be continued)  
Window WD timing (tWDTO  
)
tWDTO / 2 tWDTO / 2  
WD Register  
WRITE = 0x55  
Window Watch Dog  
Window Closed  
Window Watch Dog  
Window Open  
Initial WD Reg.  
WRITE = 0xAA  
Window Watch Dog  
Window Closed  
Window Watch Dog  
Window Open  
Standard Initial Watch Dog (no window)  
t
tIWDTO  
Figure 20. MM912_634 Analog Die Watchdog Operation  
To enable the window watchdog, the initial counter reset has to be performed by writing 0xAA to the Watchdog Service Register  
(WDSR) before tIWDTO is reached.  
If the tIWDTO timeout is reached with no counter reset or a value different from 0xAA was written to the WDSR, a watchdog reset  
will occur.  
Once entering Window Watchdog mode, the first half of the time tWDTO forbids a counter reset. To reset the watchdog counter,  
an alternating write of 0x55 and 0xAA must be performed within the second half of the tWDTO. A Window Open (WDWO) flag will  
indicate the current status of the window. A timeout or wrong value written to the WDSR will force a watchdog reset.  
For debug purpose, the watchdog can be completely disabled by applying VTST to the TCLK pin while TEST_A is grounded.  
The watchdog will be disabled as long as VTST is present. The watchdog is guaranteed functional for VTSTEN. The WDOFF bit  
will indicate the watchdog being disabled. The WDSR register will reset to default once the watchdog is disabled. Once the  
watchdog is re-enabled, the initial watchdog sequence has to be performed.  
During Low Power mode, the Watchdog clock is halted and the Watchdog Service Register (WDSR) is reset to the default state.  
5.10.1  
Register Definition  
5.10.1.1  
Watchdog Register (WDR)  
Table 99. Watchdog Register (WDR)  
Offset(74) 0x10  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
WDOFF  
WDWO  
0
0
0
WDTO  
0
Reset  
0
0
0
0
0
0
0
Note:  
79. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 100. WDR - Register Field Descriptions  
Field  
Description  
7 - WDOFF  
Watchdog Off - Indicating the Watchdog module is being disabled externally.  
MM912_634 Advance Information, Rev. 11.0  
74  
Freescale Semiconductor  
Functional Description and Application Information  
Table 100. WDR - Register Field Descriptions (continued)  
Field  
Description  
6 - WDWO  
Watchdog Window Open - Indicating the Watchdog Window is currently open for counter reset.  
Watchdog Timeout Configuration - configuring the Watchdog timeout duration tWDTO  
.
000 - 10 ms  
001 - 20 ms  
010 - 40 ms  
011 - 80 ms  
100 - 160 ms  
101 - 320 ms  
110 - 640 ms  
111 - 1280 ms  
2-0  
WDTO[2:0]  
5.10.1.2  
Watchdog Service Register (WDSR)  
Table 101. Watchdog Service Register (WDSR)  
Offset(80) 0x11  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
WDSR  
Reset  
0
1
0
1
0
1
0
1
Note:  
80. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 102. WDSR - Register Field Descriptions  
Field  
Description  
7-0  
WDSR  
Watchdog Service Register - Writing this register with the correct value (0xAA alternating 0x55) while the window is open  
will reset the watchdog counter. Writing the register while the watchdog is disabled will have no effect.  
5.11  
Hall Sensor Supply Output - HSUP  
To supply Hall Effect Sensors or similar external loads, the HSUP output is implemented. To reduce power  
dissipation inside the device, the output is implemented as a switchable Voltage Regulator, internally connected  
to the VS1 supply input. For protection, an Overtemperature Shutdown and a Current Limitation is implemented.  
A write to the Hall Supply Register (HSR), when the overtemperature condition is gone, will re-enable the Hall  
Supply Output.  
MCU  
ANALOG  
The HSUP output is active only during Normal mode. A capacitor CHSUP is recommended for operation.  
MM912_634 Advance Information, Rev. 11.0  
75  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.11.1  
Register Definition  
5.11.1.1  
Hall Supply Register (HSR)  
Table 103. Hall Supply Register (HSR)  
Offset(80) 0x38  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
HOTC  
0
0
0
0
0
HOTIE  
0
HSUPON  
0
Reset  
0
0
0
0
0
0
Note:  
81. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 104. HSR - Register Field Descriptions  
Field  
Description  
7 - HOTIE  
Hall Supply Overtemperature Interrupt Enable  
Hall Supply Overtemperature Condition present. During the event, the Hall Supply is shut down. Reading the register will  
clear the HOT flag if present. See Interrupts for details.  
6 - HOTC  
Hall Supply On:  
0 - HSUPON 0 - Hall Supply Regulator disabled  
1 - Hall Supply Regulator enabled  
5.12  
High-side Drivers - HS  
These outputs are two high-side drivers, intended to drive small resistive loads or LEDs incorporating the following  
features:  
MCU  
ANALOG  
PWM capability via the PWM Module  
Open load detection  
Current limitation  
Overtemperature shutdown (with maskable interrupt)  
High voltage shutdown - HVI (software maskable)  
Cyclic-Sense, See Wake-up / Cyclic Sense  
5.12.1  
Open Load Detection  
Each high-side driver signals an OpenLoad condition if the current through the high-side is below the OpenLoad current  
threshold. The OpenLoad condition is indicated with the bits HS1OL and HS2OL in the High-side Status Register (HSSR).  
When the high-side is in OFF state, the OpenLoad Detection function is not operating. When reading the HSSR register while  
the high-side is operating in PWM and is in the OFF state, the HS1OL and HS2OL bits will not indicate OpenLoad.  
5.12.2  
Current Limitation  
Each high-side driver has an output current limitation. In combination with the overtemperature shutdown the high-side drivers  
are protected against overcurrent and short-circuit failures.  
That the driver operates in the current limitation area is indicated with the bits HS1CL and HS2CL in the High-side Status Register  
(HSSR).  
5.12.3  
Overtemperature Protection (HS Interrupt)  
Both high-side drivers are protected against overtemperature. In overtemperature conditions, both high-side drivers are shut  
down and the event is latched in the Interrupt Control Module. The shutdown is indicated as HS Interrupt in the Interrupt Source  
Register (ISR).  
A thermal shutdown of the high-side drivers is indicated by setting the HSOT bit in the High-side Status Register (HSSR).  
MM912_634 Advance Information, Rev. 11.0  
76  
Freescale Semiconductor  
 
Functional Description and Application Information  
A write to the High-side Control Register (HSCR), when the overtemperature condition is gone, will re- enable the high-side  
drivers.  
5.12.4  
High Voltage Shutdown  
In case of a high voltage condition (HVI), and if the high voltage shutdown is enabled (bit HVSDE in the High-side Control Register  
(HSCR) is set), both high-side drivers are shut down. A write to the High-side Control Register (HSCR), when the high voltage  
condition is gone, will re-enable the high-side drivers.  
5.12.5  
Sleep And Stop Mode  
The high-side drivers can be enabled to operate in Sleep and Stop mode for cyclic sensing. See Wake-up / Cyclic Sense  
5.12.6  
PWM Capability  
PWM Control Module (PWM8B2C)  
5.12.7  
Register Definition  
5.12.7.1  
High-side Control Register (HSCR)  
Table 105. High-side Control Register (HSCR)  
Offset(80) 0x28  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
HSOTIE  
0
HSHVSDE  
0
PWMCS2  
0
PWMCS1  
0
PWMHS2  
0
PWMHS1  
0
HS2  
0
HS1  
0
Reset  
Note:  
82. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 106. HSCR - Register Field Descriptions  
Field  
Description  
7 - HSOTIE  
High-side Overtemperature Interrupt Enable  
High-side High Voltage Shutdown. Once enabled, both high-sides will shut down when a high voltage condition - HVC is  
present. See Power Supply for the Voltage Status Register.  
6 - HSHVSDE  
PWM Channel Select HS2  
5 - PWMCS2  
0 - PWM Channel 0 selected as PWM Channel  
1 - PWM Channel 1 selected as PWM Channel  
PWM Channel Select HS1  
4 - PWMCS1  
3 - PWMHS2  
2 - PWMHS1  
1 - HS2 (83)  
0 - PWM Channel 0 selected as PWM Channel  
1 - PWM Channel 1 selected as PWM Channel  
PWM Enable for HS2  
0 - PWM disabled on HS2  
1 - PWM enabled on HS2 (Channel as selected with PWMCS2)  
PWM Enable for HS1  
0 - PWM disabled on HS1  
1 - PWM enabled on HS1 (Channel as selected with PWMCS1)  
HS2 Control  
0 - HS2 disabled  
1 - HS2 enabled  
MM912_634 Advance Information, Rev. 11.0  
77  
Freescale Semiconductor  
Functional Description and Application Information  
Table 106. HSCR - Register Field Descriptions (continued)  
Field  
Description  
HS2 Control  
0 - HS1  
0 - HS1 disabled  
1 - HS1 enabled  
Note:  
83. When the high-side is in OFF state, the OpenLoad Detection function is not operating. When reading the HSSR register while the  
high-side is operating in PWM and is in the OFF state, the HS1OL and HS2OL bits will not indicate OpenLoad.  
5.12.7.2  
High-side Status Register (HSSR)  
Table 107. High-side Status Register (HSSR)  
Offset(84) 0x29  
Access: User read  
7
6
5
4
3
2
1
0
R
W
HSOTC  
0
0
0
HS2CL  
HS1CL  
HS2OL  
HS1OL  
Reset  
0
0
0
0
0
0
0
0
Note:  
84. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 108. HSSR - Register Field Descriptions  
Field  
Description  
High-side Overtemperature Condition present. Both drivers are turned off. Reading the register will clear the HSOT interrupt  
flag if present. See Interrupts for details.  
7 - HSOTC  
3 - HS2CL  
2 - HS1CL  
1 - HS2OL  
1 - HS1OL  
High-side 2 Current Limitation  
High-side 1 Current Limitation  
High-side 2 Open Load  
High-side 1Open Load  
5.13  
Low-side Drivers - LSx  
MCU  
ANALOG  
5.13.1  
Introduction / Features  
These outputs are two low-side drivers intended to drive relays (inductive loads) incorporating the following  
features:  
PWM capability  
Open load detection  
Current limitation  
Overtemperature shutdown (with maskable interrupt)  
Active clamp  
Independent VREG - High Voltage Shutdown  
5.13.1.1  
Block Diagram  
The following Figure shows the basic structure of the LS drivers.  
MM912_634 Advance Information, Rev. 11.0  
78  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Interrupt  
Control  
Module  
LSOTIE  
PWMCSx  
VROVIE  
Located in VCR  
ANALOG  
active  
clamp  
PWMLSx  
LSx  
MODE[1:0]  
LSx  
Low Side - Driver  
(active clamp)  
open load detection  
VREG HV  
Shutdown  
Latch  
on/off  
LSxOL  
LSxCL  
LSOTC  
LS - Control  
Control  
current limitation  
overtemperture shutdown (maskable interrupt)  
VREG high voltage shutdown (maskable interrupt)  
Status  
VROVC  
Located in VSR  
Vreg high  
voltage  
PGND  
LSCEN[3:0]  
VDD Digital  
Sleep2p5 Digital  
1Bit  
4Bit  
4Bit  
Figure 21. Low-side Drivers - Block Diagram  
5.13.1.2  
Modes of Operation  
The Low-side module is active only in Normal mode; the Low-side drivers are disabled in Sleep and Stop mode.  
5.13.2 External Signal Description  
This section lists and describes the signals that do connect off-chip.  
Table 109 shows all the pins and their functions that are controlled by the Low-side module.  
Table 109. Pin Functions and Priorities  
Pin Function  
Pin Function  
after Reset  
Pin Name  
I/O  
Description  
& Priority  
LS1  
LS2  
O
O
LS1  
LS2  
High Voltage Output  
Low-side Power Output Driver, Active Clamping  
5.13.3  
5.13.3.1  
Memory Map and Registers  
Module Memory Map  
Table 110 shows the register map of the Low-side Driver module. All Register addresses given are referenced to the D2D  
interface offset.  
MM912_634 Advance Information, Rev. 11.0  
79  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 110. Low-side Module - Memory Map  
Register  
Bit 7  
6
5
4
3
2
1
Bit 0  
Name  
R
W
R
0
0x30  
LSCR  
LSOTIE  
LSOTC  
PWMCS2  
0
PWMCS1  
0
PWMLS2  
LS2CL  
PWMLS1  
LS1CL  
LS2  
LS1  
0
0
LS2OL  
LS1OL  
0x31  
LSSR  
W
R
0
0
0
0x32  
LSCEN  
LSCEN  
W
5.13.3.2  
Register Descriptions  
Low-side Control Register (LSCR)  
5.13.3.2.1  
Table 111. Low-side Control Register (LSCR)  
Offset(84) 0x30  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
LSOTIE  
0
PWMCS2  
0
PWMCS1  
PWMLS2  
0
PWMLS1  
0
LS2  
0
LS1  
0
Reset  
0
0
Note:  
85. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 112. LSCR - Register Field Descriptions  
Field  
Description  
7 - LSOTIE  
Low-side Overtemperature Interrupt Enable  
PWM Channel Select LS2  
5 - PWMCS2  
4 - PWMCS1  
3 - PWMLS2  
2 - PWMLS1  
0 - PWM Channel 0 selected as PWM Channel  
1 - PWM Channel 1 selected as PWM Channel  
PWM Channel Select LS1  
0 - PWM Channel 0 selected as PWM Channel  
1 - PWM Channel 1 selected as PWM Channel  
PWM Enable for LS2  
0 - PWM disabled on LS2  
1 - PWM enabled on LS2 (Channel as selected with PWMCS2)  
PWM Enable for LS1  
0 - PWM disabled on LS1  
1 - PWM enabled on LS1 (Channel as selected with PWMCS1)  
1 - LS2  
0 - LS1  
LS2 Enable; LSEN has to be written once to control the LS2 Driver  
LS1 Enable; LSEN has to be written once to control the LS1 Driver  
MM912_634 Advance Information, Rev. 11.0  
80  
Freescale Semiconductor  
Functional Description and Application Information  
5.13.3.2.2  
Low-side Status Register (LSSR)  
Table 113. Low-side Status Register (LSSR)  
Offset(86) 0x31  
Access: User read  
7
6
5
4
3
2
1
0
R
W
LSOTC  
0
0
0
LS2CL  
LS1CL  
LS2OL  
LS1OL  
Reset  
0
0
0
0
0
0
0
0
Note:  
86. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 114. LSSR - Register Field Descriptions  
Field  
Description  
Low-side Overtemperature condition present. Both drivers are turned off. Reading the register will clear the LSOT interrupt  
flag if present. See Interrupts for details.  
7 - LSOTC  
3 - LS2CL  
2 - LS1CL  
1 - LS2OL  
Low-side 2 Current Limitation  
Low-side 1 Current Limitation  
Low-side 2 Open Load (87)  
Note:  
87. When the low-side is in OFF state, the OpenLoad Detection function is not operating. When reading the LSSR register while the low  
side is operating in PWM and is in the OFF state, the LS1OL and LS2OL bits will not indicate OpenLoad.  
5.13.3.2.3  
Low-side Control Enable Register (LSCEN)  
Table 115. Low-side Enable Register (LSEN)  
Offset(88) 0x32  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
LSCEN  
Reset  
0
0
0
0
0
0
0
0
Note:  
88. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 116. LSEN - Register Field Descriptions  
Field  
Description  
Low-side Control Enable - To allow the LS Control via LSx, the correct value has to be written into the LSCEN Register.  
0x5 - Low-side Control Enabled  
3-0  
LSCEN  
all other values - Low-side Control Disabled  
5.13.4  
Functional Description  
The Low-side switches are controlled by the bits LS1:2 in the Low-side Control Register (LSCR). In order to control the Low-sides,  
the LSCEN register has to be correctly written once after RESET or VROV.  
To protect the device against overvoltage when an inductive load (relay) is turned off an active clamp circuit is implemented.  
5.13.4.1  
Voltage Regulator Overvoltage Protection  
To protect the application for an unintentional activation of the drivers in case of a voltage regulator overvoltage failure, the  
Low-side Drivers will automatically shut down in case of an overvoltage on one of the two regulators.  
MM912_634 Advance Information, Rev. 11.0  
81  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
The shutdown is fully handled in the analog section of the driver. This will secure the feature in case the digital logic is damaged  
due to the overvoltage condition.  
Once an overvoltage condition on one of the voltage regulators occurs, the LSx control bits in the Low-side Control Register  
(LSCR) will be reset to 0. The Voltage Regulator Overvoltage Condition Bit (VROVC) in the Voltage Status Register (VSR) will  
stay set as long as the condition is present. If the Voltage Regulator Overvoltage Interrupt was enabled (VROVIE=1), the VROV-  
Interrupt will be issued. Reading the Voltage Regulator Overvoltage Condition Bit (VROVC) in the Voltage Status Register (VSR)  
will clear the interrupt. To issue another VROV - Interrupt, the condition has to vanish and be present again.  
To re-enable the Low-side Drivers after a Voltage Regulator Overvoltage condition occurred, first the LSCEN register has to be  
written with “0x05” - this information is processed through the main digital blocks, and would secure a minimum functionality  
before enabling the LS drivers again. In a second step, the LSx Control Bits in the Low-side Control Register (LSCR) must be  
enabled again after the overvoltage condition has vanished (VROVC=0).  
NOTE  
The overvoltage threshold has to be trimmed at system power up. Refer to Trimming  
Register 2 (CTR2) for details. The default trim is worst case and may have disabled the LS  
function already. An initial LS enable would be needed.  
5.13.4.2  
Open Load Detection  
Each low-side driver signals an OpenLoad condition if the current through the low-side is below the OpenLoad current threshold.  
The OpenLoad condition is indicated with the bits LS1OL and LS2OL in the Low-side Status Register (LSSR). When the low-side  
is in OFF state, the OpenLoad Detection function is not operating. When reading the LSSR register while the low-side is operating  
in PWM and is in the OFF state, the LS1OL and LS2OL bits will not indicate OpenLoad.  
5.13.4.3  
Current Limitation  
Each Low-side driver has a current limitation. In combination with the overtemperature shutdown, the Low-side drivers are  
protected against overcurrent and short-circuit failures.  
The driver operates in current limitation, and is indicated with the bits LS1CL and LS2CL in the Low-side Status Register (LSSR).  
Note: If the drivers is operating in current limitation mode excessive power might be dissipated.  
5.13.4.4  
Overtemperature Protection (LS Interrupt)  
Both Low-side drivers are protected against overtemperature. In case of an overtemperature condition, both Low-side drivers are  
shut down and the event is latched in the Interrupt Control Module. The shutdown is indicated as LS Interrupt in the Interrupt  
Source Register (ISR).  
If the bit LSM is set in the Interrupt Mask Register (IMR) than an Interrupt (IRQ) is generated.  
A write to the Low-side Control Register (LSCR) will re-enable the Low-side drivers when the overtemperature condition is gone.  
5.13.5  
PWM Capability  
See PWM Control Module (PWM8B2C).  
5.14  
PWM Control Module (PWM8B2C)  
MCU  
ANALOG  
5.14.1  
Introduction  
To control the High-side (HS1, HS2) and the Low-side (LS1, LS2) duty cycle as well as the PTB2 output, the PWM  
module is implemented. Refer to the individual driver section for details on the use of the internal PWM1 and  
PWM0 signal (High-side Drivers - HS, Low-side Drivers - LSx and General Purpose I/O - PTB[0…2])  
The PWM definition is based on the HC12 PWM definitions with some of the simplifications incorporated. The PWM module has  
two channels with independent controls of left and center aligned outputs on each channel.  
Each of the two channels has a programmable period and duty cycle as well as a dedicated counter. A flexible clock select  
scheme allows a total of four different clock sources to be used with the counters. Each of the modulators can create independent  
continuous waveforms with software-selectable duty rates from 0% to 100%.  
5.14.1.1  
Features  
The PWM block includes these distinctive features:  
MM912_634 Advance Information, Rev. 11.0  
82  
Freescale Semiconductor  
 
Functional Description and Application Information  
Two independent PWM channels with programmable periods and duty cycles  
Dedicated counter for each PWM channel  
Programmable PWM enable/disable for each channel  
Software selection of PWM duty pulse polarity for each channel  
Period and duty cycle are double buffered. Change takes effect when the end of the effective period is reached (PWM  
counter reaches zero), or when the channel is disabled  
Programmable center or left aligned outputs on individual channels  
Four clock sources (A, B, SA, and SB) provide for a wide range of frequencies  
Programmable clock select logic  
5.14.1.2  
Modes of Operation  
The PWM8B2C module does operate in Normal mode only.  
5.14.1.3 Block Diagram  
Figure 22 shows the block diagram for the 8-bit 2-channel PWM block.  
PWM8B2C  
PWM Channels  
PWM Clock  
D2D Clock  
Clock Select  
Control  
Enable  
Channel 1  
PWM1  
PWM0  
Polarity  
Period and Duty  
Counter  
Counter  
Channel 0  
Alignment  
Period and Duty  
Figure 22. PWM Block Diagram  
5.14.2  
Signal Description  
The PWM module has a total of two internal outputs to control the Low-side Outputs, the High-side Outputs and / or the PTB2  
output with pulse width modulation. See High-side Drivers - HS, Low-side Drivers - LSx and General Purpose I/O - PTB[0…2] for  
configuration details.  
NOTE  
Based on the D2D clock speed, the PWM8B2C module is capable of generating PWM signal  
frequencies higher than the maximum output frequency of the connected driver (HS, LS).  
Refer to Dynamic Electrical Characteristics for details.  
Do not exceed the driver maximum output frequency.  
5.14.2.1  
D2DCLK  
Die 2 Die Interface Clock.  
MM912_634 Advance Information, Rev. 11.0  
83  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.14.2.2  
PWM1 — Pulse Width Modulator Channel 1  
This signal serves as waveform output of PWM channel 1.  
5.14.2.3  
PWM0 — Pulse Width Modulator Channel 0  
This signal serves as waveform output of PWM channel 0.  
5.14.3  
Register Descriptions  
This section describes in detail all the registers and register bits in the PWM module. Reserved bits within a register will always  
read as 0 and the write will be unimplemented. Unimplemented functions are indicated by shading the bit.  
Table 117. PWM Register Summary  
Name / Offset(88)  
7
6
5
4
3
2
1
0
R
W
R
0x60  
PWMCTL  
CAE1  
0
CAE0  
PCLK1  
PCLK0  
PPOL1  
0
PPOL0  
PWME1  
PWME0  
0x61  
PWMPRCLK  
PCKB2  
PCKB1  
PCKB0  
PCKA2  
PCKA1  
PCKA0  
Bit 0  
W
R
0x62  
PWMSCLA  
Bit 7  
Bit 7  
6
6
5
5
4
4
3
3
2
2
1
1
W
R
0x63  
PWMSCLB  
Bit 0  
W
R
Bit 7  
0
6
0
6
0
5
0
5
0
4
0
4
0
3
0
3
0
2
0
2
0
1
0
1
0
Bit 0  
0
0x64  
PWMCNT0  
W
R
Bit 7  
0
Bit 0  
0
0x65  
PWMCNT1  
W
R
0x66  
Bit 7  
Bit 7  
Bit 7  
Bit 7  
6
6
6
6
5
5
5
5
4
4
4
4
3
3
3
3
2
2
2
2
1
1
1
1
Bit 0  
Bit 0  
Bit 0  
Bit 0  
PWMPER0  
W
R
0x67  
PWMPER1  
W
R
0x68  
PWMDTY0  
W
R
0x69  
PWMDTY1  
W
Note:  
89. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
5.14.3.1  
PWM Control Register (PWMCTL)  
Table 118. PWM Control Register (PWMCTL)  
Offset(90) 0x60  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
CAE1  
0
CAE0  
0
PCLK1  
0
PCLK0  
0
PPOL1  
0
PPOL0  
0
PWME1  
0
PWME0  
0
Reset  
Note:  
90. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
84  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 119. PWMCTL - Register Field Descriptions  
Field  
Description  
Center Aligned Output Modes on Channels 1–0  
7–6  
0
1
Channels 1–0 operate in left aligned output mode.  
CAE[1:0]  
Channels 1–0 operate in center aligned output mode.  
Pulse Width Channel 1 Clock Select  
5
0
1
Clock B is the clock source for PWM channel 1.  
Clock SB is the clock source for PWM channel 1.  
PCLK1  
Pulse Width Channel 0 Clock Select  
4
0
1
Clock A is the clock source for PWM channel 0.  
Clock SA is the clock source for PWM channel 0.  
PCLK0  
Pulse Width Channel 1–0 Polarity Bits  
3–2  
PPOL[1:0]  
0
1
PWM channel 1–0 outputs are low at the beginning of the period, then go high when the duty count is reached.  
PWM channel 1–0 outputs are high at the beginning of the period, then go low when the duty count is reached.  
Pulse Width Channel 1–0 Enable  
1-0  
0
Pulse width channel 1–0 is disabled.  
PWME[1:0]  
1
Pulse width channel 1–0 is enabled. The pulse modulated signal becomes available at PWM, output bit 1 when its  
clock source begins its next cycle.  
5.14.3.1.1  
PWM Enable (PWMEx)  
Each PWM channel has an enable bit (PWMEx) to start its waveform output. When any of the PWMEx bits are set (PWMEx = 1),  
the associated PWM output is enabled immediately. However, the actual PWM waveform is not available on the associated PWM  
output until its clock source begins its next cycle, due to the synchronization of PWMEx and the clock source.  
NOTE  
The first PWM cycle after enabling the channel can be irregular. If both PWM channels are  
disabled (PWME1–0 = 0), the prescaler counter shuts off for power savings.  
5.14.3.1.2  
PWM Polarity (PPOLx)  
The starting polarity of each PWM channel waveform is determined by the associated PPOLx bit. If the polarity bit is one, the  
PWM channel output is high at the beginning of the cycle and then goes low when the duty count is reached. Conversely, if the  
polarity bit is zero, the output starts low and then goes high when the duty count is reached.  
NOTE  
PPOLx register bits can be written anytime. If the polarity changes while a PWM signal is  
being generated, a truncated or stretched pulse can occur during the transition  
5.14.3.1.3  
PWM Clock Select (PCLKx)  
Each PWM channel has a choice of two clocks to use as the clock source for that channel as described by the following.  
NOTE  
Register bits PCLK0 and PCLK1 can be written anytime. If a clock select changes while a  
PWM signal is being generated, a truncated or stretched pulse can occur during the  
transition.  
5.14.3.1.4  
PWM Center Align Enable (CAEx)  
The CAEx bits select either center aligned outputs or left aligned output for both PWM channels. If the CAEx bit is set to a one,  
the corresponding PWM output will be center aligned. If the CAEx bit is cleared, the corresponding PWM output will be left  
aligned. See Section 5.14.4.2.5, “Left Aligned Outputs" and Section 5.14.4.2.6, “Center Aligned Outputs" for a more detailed  
description of the PWM output modes.  
NOTE  
Write these bits only when the corresponding channel is disabled.  
MM912_634 Advance Information, Rev. 11.0  
85  
Freescale Semiconductor  
Functional Description and Application Information  
PWM Prescale Clock Select Register (PWMPRCLK)  
5.14.3.2  
This register selects the prescale clock source for clocks A and B independently.  
Table 120. PWM Prescale Clock Select Register (PWMPRCLK)  
Offset(91) 0x61  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
PCKB2  
0
PCKB1  
0
PCKB0  
0
PCKA2  
0
PCKA1  
0
PCKA0  
0
Reset  
0
0
Note:  
91. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 121. PWMPRCLK - Register Field Descriptions  
Field  
Description  
6–4  
PCKB[2:0]  
Prescaler Select for Clock B — Clock B is one of two clock sources which can be used for channel 1. These three bits  
determine the rate of clock B, as shown in Table 122.  
2–0  
PCKA[2:0]  
Prescaler Select for Clock A — Clock A is one of two clock sources which can be used for channel 0. These three bits  
determine the rate of clock A, as shown in Table 123.  
Table 122. Clock B Prescaler Selects  
PCKB2  
PCKB1  
PCKB0  
Value of Clock B  
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
D2D clock  
D2D clock / 2  
D2D clock / 4  
D2D clock / 8  
D2D clock / 16  
D2D clock / 32  
D2D clock / 64  
D2D clock / 128  
Table 123. Clock A Prescaler Selects  
PCKA2  
PCKA1  
PCKA0  
Value of Clock A  
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
D2D clock  
D2D clock / 2  
D2D clock / 4  
D2D clock / 8  
D2D clock / 16  
D2D clock / 32  
D2D clock / 64  
D2D clock / 128  
NOTE  
PCKB2–0 and PCKA2–0 register bits can be written anytime. If the clock pre-scale is  
changed while a PWM signal is being generated, a truncated or stretched pulse can occur  
during the transition.  
MM912_634 Advance Information, Rev. 11.0  
86  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
5.14.3.3  
PWM Scale A Register (PWMSCLA)  
PWMSCLA is the programmable scale value used in scaling clock A to generate clock SA. Clock SA is generated by taking clock  
A, dividing it by the value in the PWMSCLA register and dividing that by two.  
Clock SA = Clock A / (2 * PWMSCLA)  
NOTE  
When PWMSCLA = $00, PWMSCLA value is considered a full scale value of 256. Clock A  
is thus divided by 512.  
Any value written to this register will cause the scale counter to load the new scale value (PWMSCLA)  
.
Table 124. PWM Scale A Register (PWMSCLA)  
Offset(92) 0x62  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
Bit 7  
0
6
0
5
4
3
0
2
1
0
Bit 0  
0
Reset  
Note:  
0
0
0
92. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
5.14.3.4  
PWM Scale B Register (PWMSCLB)  
PWMSCLB is the programmable scale value used in scaling clock B to generate clock SB. Clock SB is generated by taking clock  
B, dividing it by the value in the PWMSCLB register and dividing that by two.  
Clock SB = Clock B / (2 * PWMSCLB)  
NOTE  
When PWMSCLB = $00, PWMSCLB value is considered a full scale value of 256. Clock B  
is thus divided by 512.  
Any value written to this register will cause the scale counter to load the new scale value (PWMSCLB).  
Table 125. PWM Scale B Register (PWMSCLB)  
Offset(93) 0x63  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
Bit 7  
0
6
5
4
0
3
0
2
0
1
Bit 0  
0
Reset  
Note:  
0
0
0
93. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
5.14.3.5  
PWM Channel Counter Registers (PWMCNTx)  
Each channel has a dedicated 8-bit up/down counter, which runs at the rate of the selected clock source. The counter can be  
read at any time without affecting the count or the operation of the PWM channel. In left aligned output mode, the counter counts  
from 0 to the value in the period register - 1. In center aligned output mode, the counter counts from 0 up to the value in the period  
register and then back down to 0.  
Any value written to the counter causes the counter to reset to $00, the counter direction to be set to up, the immediate load of  
both duty and period registers with values from the buffers, and the output to change according to the polarity bit. The counter is  
also cleared at the end of the effective period (see Section 5.14.4.2.5, “Left Aligned Outputs" and Section 5.14.4.2.6, “Center  
Aligned Outputs" for more details). When the channel is disabled (PWMEx = 0), the PWMCNTx register does not count. When a  
channel becomes enabled (PWMEx = 1), the associated PWM counter starts at the count in the PWMCNTx register. For more  
detailed information on the operation of the counters, see Section 5.14.4.2.4, “PWM Timer Counters".  
MM912_634 Advance Information, Rev. 11.0  
87  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
NOTE  
Writing to the counter while the channel is enabled can cause an irregular PWM cycle to  
occur.  
Table 126. PWM Channel Counter Registers (PWMCNTx)  
Offset(94) 0x64/0x65  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
Bit 7  
6
5
4
3
2
1
Bit 0  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Reset  
0
Note:  
94. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
5.14.3.6  
PWM Channel Period Registers (PWMPERx)  
There is a dedicated period register for each channel. The value in this register determines the period of the associated PWM  
channel.  
The period registers for each channel are double buffered, so if they change while the channel is enabled, the change will NOT  
take effect until one of the following occurs:  
The effective period ends  
The counter is written (counter resets to $00)  
The channel is disabled  
In this way, the output of the PWM will always be either the old waveform or the new waveform, not some variation in between.  
If the channel is not enabled, then writes to the period register will go directly to the latches as well as the buffer.  
NOTE  
Reads of this register return the most recent value written. Reads do not necessarily return  
the value of the currently active period due to the double buffering scheme.  
See Section 5.14.4.2.3, “PWM Period and Duty" for more information.  
To calculate the output period, take the selected clock source period for the channel of interest (A, B, SA, or SB) and multiply it  
by the value in the period register for that channel:  
Left aligned output (CAEx = 0)  
PWMx Period = Channel Clock Period * PWMPERx Center Aligned Output (CAEx = 1)  
PWMx Period = Channel Clock Period * (2 * PWMPERx)  
For boundary case programming values, refer to Section 5.14.4.2.7, “PWM Boundary Cases".  
Table 127. PWM Channel Period Registers (PWMPERx)  
Offset(95) 0x66/0x67  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
Bit 7  
0
6
0
5
4
3
0
2
1
0
Bit 0  
0
Reset  
0
0
0
Note:  
95. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
5.14.3.7  
PWM Channel Duty Registers (PWMDTYx)  
There is a dedicated duty register for each channel. The value in this register determines the duty of the associated PWM  
channel. The duty value is compared to the counter and if it is equal to the counter value a match occurs and the output changes  
state.  
The duty registers for each channel are double buffered, so if they change while the channel is enabled, the change will NOT  
take effect until one of the following occurs:  
MM912_634 Advance Information, Rev. 11.0  
88  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
The effective period ends  
The counter is written (counter resets to $00)  
The channel is disabled  
In this way, the output of the PWM will always be either the old duty waveform or the new duty waveform, not some variation in  
between. If the channel is not enabled, then writes to the duty register will go directly to the latches as well as the buffer.  
NOTE  
Reads of this register return the most recent value written. Reads do not necessarily return  
the value of the currently active duty due to the double buffering scheme.  
See Section 5.14.4.2.3, “PWM Period and Duty" for more information.  
NOTE  
Depending on the polarity bit, the duty registers will contain the count of either the high time  
or the low time. If the polarity bit is one, the output starts high and then goes low when the  
duty count is reached, so the duty registers contain a count of the high time. If the polarity  
bit is zero, the output starts low and then goes high when the duty count is reached, so the  
duty registers contain a count of the low time.  
To calculate the output duty cycle (high time as a% of period) for a particular channel:  
Polarity = 0 (PPOL x =0)  
Duty Cycle = [(PWMPERx-PWMDTYx)/PWMPERx] * 100%  
Polarity = 1 (PPOLx = 1)  
Duty Cycle = [PWMDTYx / PWMPERx] * 100%  
For boundary case programming values, refer to Section 5.14.4.2.7, “PWM Boundary Cases".  
Table 128. PWM Channel Duty Registers (PWMDTYx)  
Offset(96) 0x68/0x69  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
Bit 7  
0
6
0
5
4
3
0
2
1
0
Bit 0  
0
Reset  
0
0
0
Note:  
96. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
5.14.4  
Functional Description  
PWM Clock Select  
5.14.4.1  
There are four available clocks: clock A, clock B, clock SA (scaled A), and clock SB (scaled B). These four clocks are based on  
the D2D clock.  
Clock A and B can be software selected to be 1, 1/2, 1/4, 1/8,..., 1/64, 1/128 times the D2D clock. Clock SA uses clock A as an  
input and divides it further with a reloadable counter. Similarly, clock SB uses clock B as an input and divides it further with a  
reloadable counter. The rates available for clock SA are software selectable to be clock A divided by 2, 4, 6, 8,..., or 512 in  
increments of divide by 2. Similar rates are available for clock SB. Each PWM channel has the capability of selecting one of two  
clocks, either the pre-scaled clock (clock A or B) or the scaled clock (clock SA or SB).  
The block diagram in Figure 23 shows the four different clocks and how the scaled clocks are created.  
5.14.4.1.1  
Prescale  
The input clock to the PWM prescaler is the D2D clock. The input clock can also be disabled when both PWM channels are  
disabled (PWME1-0 = 0). This is useful for reducing power by disabling the prescale counter.  
Clock A and clock B are scaled values of the input clock. The value is software selectable for both clock A and clock B and has  
options of 1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, or 1/128 times the D2D clock. The value selected for clock A is determined by the  
PCKA2, PCKA1, PCKA0 bits in the PWMPRCLK register. The value selected for clock B is determined by the PCKB2, PCKB1,  
PCKB0 bits also in the PWMPRCLK register.  
MM912_634 Advance Information, Rev. 11.0  
89  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.14.4.1.2  
Clock Scale  
The scaled A clock uses clock A as an input and divides it further with a user programmable value and then divides this by 2.  
The scaled B clock uses clock B as an input and divides it further with a user programmable value and then divides this by 2.  
The rates available for clock SA are software selectable to be clock A divided by 2, 4, 6, 8,..., or 512 in increments of divide by  
2. Similar rates are available for clock SB.  
Clock A  
M
Clock to  
PWM Ch 0  
U
Clock A/2, A/4, A/6,....A/512  
X
M
U
X
PCLK0  
Count = 1  
Load  
8-Bit Down  
Counter  
Clock SA  
DIV 2  
PWMSCLA  
Clock B  
M
U
X
Clock to  
PWM Ch 1  
Clock B/2, B/4, B/6,....B/512  
PCLK1  
M
U
X
Count = 1  
8-Bit Down  
Counter  
Load  
Clock SB  
PWMSCLB  
DIV 2  
Prescale  
Scale  
Figure 23. PWM Clock Select Block Diagram  
Clock Select  
Clock A is used as an input to an 8-bit down counter. This down counter loads a user programmable scale value from the scale  
register (PWMSCLA). When the down counter reaches one, a pulse is output and the 8-bit counter is re-loaded. The output signal  
MM912_634 Advance Information, Rev. 11.0  
90  
Freescale Semiconductor  
Functional Description and Application Information  
from this circuit is further divided by two. This gives a greater range with only a slight reduction in granularity. Clock SA equals  
clock A divided by two times the value in the PWMSCLA register.  
NOTE  
Clock SA = Clock A / (2 * PWMSCLA)  
When PWMSCLA = $00, PWMSCLA value is considered a full scale value of 256. Clock A  
is thus divided by 512.  
Similarly, clock B is used as an input to an 8-bit down counter followed by a divide by two producing clock SB. Thus, clock SB  
equals clock B divided by two times the value in the PWMSCLB register.  
NOTE  
Clock SB = Clock B / (2 * PWMSCLB)  
When PWMSCLB = $00, PWMSCLB value is considered a full scale value of 256. Clock B  
is thus divided by 512.  
As an example, consider the case in which the user writes $FF into the PWMSCLA register. Clock A for this case will be E divided  
by 4. A pulse will occur at a rate of once every 255x4 E cycles. Passing this through the divide by two circuit produces a clock  
signal at an E divided by 2040 rate. Similarly, a value of $01 in the PWMSCLA register when clock A is E divided by 4 will produce  
a clock at an E divided by 8 rate.  
Writing to PWMSCLA or PWMSCLB causes the associated 8-bit down counter to be re-loaded. Otherwise, when changing rates  
the counter would have to count down to $01 before counting at the proper rate. Forcing the associated counter to re-load the  
scale register value every time PWMSCLA or PWMSCLB is written prevents this.  
NOTE  
Writing to the scale registers while channels are operating can cause irregularities in the  
PWM outputs.  
5.14.4.1.3  
Clock Select  
Each PWM channel has the capability of selecting one of two clocks. For channels 0 the clock choice is clock A or clock SA. For  
channels 1 the choice is clock B or clock SB. The clock selection is done with the PCLKx control bits in the PWMCTL register.  
NOTE  
Changing clock control bits while channels are operating can cause irregularities in the PWM  
outputs.  
5.14.4.2  
PWM Channel Timers  
The main part of the PWM module are the actual timers. Each of the timer channels has a counter, a period register, and a duty  
register (each are 8-bit). The waveform output period is controlled by a match between the period register and the value in the  
counter. The duty is controlled by a match between the duty register and the counter value, and causes the state of the output to  
change during the period. The starting polarity of the output is also selectable on a per channel basis. Shown in Figure 24 is the  
block diagram for the PWM timer.  
MM912_634 Advance Information, Rev. 11.0  
91  
Freescale Semiconductor  
Functional Description and Application Information  
D2D Clock  
8-Bit Counter  
PWMCNTx  
Gate  
(Clock Edge  
Sync)  
Up/Down  
Reset  
8-bit Compare =  
T
M
U
X
Q
Q
PWMDTYx  
PWM  
R
8-bit Compare =  
PWMPERx  
PPOLx  
T
Q
CAEx  
Q
R
PWMEx  
Figure 24. PWM Timer Channel Block Diagram  
5.14.4.2.1  
PWM Enable  
Each PWM channel has an enable bit (PWMEx) to start its waveform output. When any of the PWMEx bits are set (PWMEx = 1),  
the associated PWM output signal is enabled immediately. However, the actual PWM waveform is not available on the associated  
PWM output until its clock source begins its next cycle due to the synchronization of PWMEx and the clock source.  
NOTE  
The first PWM cycle after enabling the channel can be irregular.  
On the front end of the PWM timer, the clock is enabled to the PWM circuit by the PWMEx bit being high. There is an  
edge-synchronizing circuit to guarantee that the clock will only be enabled or disabled at an edge. When the channel is disabled  
(PWMEx = 0), the counter for the channel does not count.  
5.14.4.2.2  
PWM Polarity  
Each channel has a polarity bit to allow starting a waveform cycle with a high or low signal. This is shown on the block diagram  
as a mux select of either the Q output or the Q output of the PWM output flip flop. When one of the bits in the PWMPOL register  
is set, the associated PWM channel output is high at the beginning of the waveform, then goes low when the duty count is  
reached. Conversely, if the polarity bit is zero, the output starts low and then goes high when the duty count is reached.  
5.14.4.2.3  
PWM Period and Duty  
Dedicated period and duty registers exist for each channel and are double buffered, so if they change while the channel is  
enabled, the change will NOT take effect until one of the following occurs:  
The effective period ends  
The counter is written (counter resets to $00)  
The channel is disabled  
MM912_634 Advance Information, Rev. 11.0  
92  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
In this way, the output of the PWM will always be either the old waveform or the new waveform, not some variation in between.  
If the channel is not enabled, then writes to the period and duty registers will go directly to the latches as well as the buffer.  
A change in duty or period can be forced into effect “immediately” by writing the new value to the duty and/or period registers,  
and then writing to the counter. This forces the counter to reset and the new duty and/or period values to be latched. In addition,  
since the counter is readable, it is possible to know where the count is with respect to the duty value, and software can be used  
to make adjustments  
NOTE  
When forcing a new period or duty into effect immediately, an irregular PWM cycle can occur.  
Depending on the polarity bit, the duty registers will contain the count of either the high time  
or the low time.  
5.14.4.2.4  
PWM Timer Counters  
Each channel has a dedicated 8-bit up/down counter which runs at the rate of the selected clock source (see Section 5.14.4.1,  
“PWM Clock Select" for the available clock sources and rates). The counter compares to two registers, a duty register and a  
period register as shown in Figure 24. When the PWM counter matches the duty register, the output flip-flop changes state,  
causing the PWM waveform to also change state. A match between the PWM counter and the period register behaves differently  
depending on what output mode is selected as shown in Figure 24 and described in Section 5.14.4.2.5, “Left Aligned Outputs"  
and Section 5.14.4.2.6, “Center Aligned Outputs".  
Each channel counter can be read at anytime without affecting the count or the operation of the PWM channel.  
Any value written to the counter causes the counter to reset to $00, the counter direction to be set to up, the immediate load of  
both duty and period registers with values from the buffers, and the output to change according to the polarity bit. When the  
channel is disabled (PWMEx = 0), the counter stops. When a channel becomes enabled (PWMEx = 1), the associated PWM  
counter continues from the count in the PWMCNTx register. This allows the waveform to continue where it left off when the  
channel is re-enabled. When the channel is disabled, writing “0” to the period register will cause the counter to reset on the next  
selected clock.  
NOTE  
To start a new “clean” PWM waveform without any “history” from the old waveform, writing  
the channel counter (PWMCNTx) must happen prior to enabling the PWM channel  
(PWMEx = 1).  
Generally, writes to the counter are done prior to enabling a channel in order to start from a known state. However, writing a  
counter can also be done while the PWM channel is enabled (counting). The effect is similar to writing the counter when the  
channel is disabled, except that the new period is started immediately with the output set according to the polarity bit.  
NOTE  
Writing to the counter while the channel is enabled can cause an irregular PWM cycle to  
occur.  
The counter is cleared at the end of the effective period (see Section 5.14.4.2.5, “Left Aligned Outputs" and Section 5.14.4.2.6,  
“Center Aligned Outputs" for more details).  
Table 129. PWM Timer Counter Conditions  
Counter Clears ($00)  
Counter Counts  
Counter Stops  
When PWMCNTx register written to any value  
Effective period ends  
When PWM channel is enabled (PWMEx = 1).  
Counts from last value in PWMCNTx.  
When PWM channel is disabled (PWMEx = 0)  
5.14.4.2.5  
Left Aligned Outputs  
The PWM timer provides the choice of two types of outputs, left aligned or center aligned. They are selected with the CAEx bits  
in the PWMCTL register. If the CAEx bit is cleared (CAEx = 0), the corresponding PWM output will be left aligned.  
In left aligned output mode, the 8-bit counter is configured as an up counter only. It compares to two registers, a duty register and  
a period register as shown in the block diagram in Figure 24. When the PWM counter matches the duty register the output flip-flop  
changes state causing the PWM waveform to also change state. A match between the PWM counter and the period register  
resets the counter and the output flip-flop, as shown in Figure 24, as well as performing a load from the double buffer period and  
duty register to the associated registers, as described in Section 5.14.4.2.3, “PWM Period and Duty". The counter counts from 0  
to the value in the period register – 1.  
MM912_634 Advance Information, Rev. 11.0  
93  
Freescale Semiconductor  
 
Functional Description and Application Information  
NOTE  
Changing the PWM output mode from left aligned to center aligned output (or vice versa)  
while channels are operating can cause irregularities in the PWM output. It is recommended  
to program the output mode before enabling the PWM channel.  
PPOLx = 0  
PPOLx = 1  
PWMDTYx  
Period = PWMPERx  
Figure 25. PWM Left Aligned Output Waveform  
To calculate the output frequency in left aligned output mode for a particular channel, take the selected clock source frequency  
for the channel (A, B, SA, or SB), and divide it by the value in the period register for that channel.  
PWMx Frequency = Clock (A, B, SA, or SB) / PWMPERx  
PWMx Duty Cycle (high time as a % of period):  
Polarity = 0 (PPOLx = 0)  
Duty Cycle = [(PWMPERx-PWMDTYx)/PWMPERx] * 100%  
Polarity = 1 (PPOLx = 1)  
Duty Cycle = [PWMDTYx / PWMPERx] * 100%  
As an example of a left aligned output, consider the following case:  
Clock Source = E, where E = 10 kHz (100 µs period)  
PPOLx = 0  
PWMPERx = 4  
PWMDTYx = 1  
PWMx Frequency = 10 kHz/4 = 2.5 kHz  
PWMx Period = 400 µs  
PWMx Duty Cycle = 3/4 *100% = 75%  
The output waveform generated is shown in Figure 26.  
E = 100 µs  
Duty Cycle = 75%  
Period = 400 µs  
Figure 26. PWM Left Aligned Output Example Waveform  
5.14.4.2.6  
Center Aligned Outputs  
For a center aligned output mode selection, set the CAEx bit (CAEx = 1) in the PWMCTL register, and the corresponding PWM  
output will be center aligned.  
The 8-bit counter operates as an up/down counter in this mode, and is set to up whenever the counter is equal to $00. The counter  
compares to two registers, a duty register and a period register, as shown in the block diagram in Figure 24. When the PWM  
counter matches the duty register, the output flip-flop changes state, causing the PWM waveform to also change state. A match  
between the PWM counter and the period register changes the counter direction from an up-count to a down-count. When the  
PWM counter decrements and matches the duty register again, the output flip-flop changes state, causing the PWM output to  
also change state. When the PWM counter decrements and reaches zero, the counter direction changes from a down-count back  
to an up-count, and a load from the double buffer period and duty registers to the associated registers is performed, as described  
MM912_634 Advance Information, Rev. 11.0  
94  
Freescale Semiconductor  
 
Functional Description and Application Information  
in Section 5.14.4.2.3, “PWM Period and Duty". The counter counts from 0 up to the value in the period register and then back  
down to 0. Thus the effective period is PWMPERx*2.  
NOTE  
Changing the PWM output mode from left aligned to center aligned output (or vice versa)  
while channels are operating can cause irregularities in the PWM output. It is recommended  
to program the output mode before enabling the PWM channel.  
PPOLx = 0  
PPOLx = 1  
PWMDTYx  
PWMPERx  
PWMDTYx  
PWMPERx  
Period = PWMPERx*2  
Figure 27. PWM Center Aligned Output Waveform  
To calculate the output frequency in center aligned output mode for a particular channel, take the selected clock source frequency  
for the channel (A, B, SA, or SB) and divide it by twice the value in the period register for that channel.  
PWMx Frequency = Clock (A, B, SA, or SB) / (2*PWMPERx)  
PWMx Duty Cycle (high time as a% of period):  
Polarity = 0 (PPOLx = 0)  
Duty Cycle = [(PWMPERx-PWMDTYx)/PWMPERx] * 100%  
Polarity = 1 (PPOLx = 1)  
Duty Cycle = [PWMDTYx / PWMPERx] * 100%  
As an example of a center aligned output, consider the following case:  
Clock Source = E, where E = 10 kHz (100 µs period)  
PPOLx = 0  
PWMPERx = 4  
PWMDTYx = 1  
PWMx Frequency = 10 kHz/8 = 1.25 kHz  
PWMx Period = 800 µs  
PWMx Duty Cycle = 3/4 *100% = 75%  
Figure 28 shows the output waveform generated.  
E = 100 µs  
E = 100 µs  
DUTY CYCLE = 75%  
PERIOD = 800 µs  
Figure 28. PWM Center Aligned Output Example Waveform  
MM912_634 Advance Information, Rev. 11.0  
95  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.14.4.2.7  
PWM Boundary Cases  
Table 130 summarizes the boundary conditions for the PWM, regardless of the output mode (left aligned or center aligned).  
Table 130. PWM Boundary Cases  
PWMDTYx  
PWMPERx  
PPOLx  
PWMx Output  
$00  
>$00  
1
Always low  
(indicates no duty)  
$00  
>$00  
0
1
Always high  
Always high  
(indicates no duty)  
$00(97)  
(indicates no period)  
XX  
$00(97)  
(indicates no period)  
XX  
0
1
Always low  
Always high  
>= PWMPERx  
XX  
Note:  
97. Counter = $00 and does not count.  
5.14.5  
Resets  
The reset state of each individual bit is listed within the Section 5.14.3, “Register Descriptions", which details the registers and  
their bit-fields. All special functions or modes which are initialized during or just following reset are described within this section.  
The 8-bit up/down counter is configured as an up counter out of reset.  
All the channels are disabled and all the counters do not count.  
5.14.6  
Interrupts  
The PWM module has no Interrupts.  
5.15  
LIN Physical Layer Interface - LIN  
The LIN bus pin provides a physical layer for single-wire communication in automotive applications. The LIN  
MCU  
ANALOG  
physical layer is designed to meet the LIN physical layer version 2.1 specification, and has the following features:  
LIN physical layer 2.1 compliant  
Slew rate selection 20 kBit, 10 kBit, and fast Mode (100 kBit)  
Overtemperature Shutdown - HTI  
Permanent Pull-up in Normal mode 30 k, 1.0 Min low power  
Current limitation  
External Rx / Tx access. See General Purpose I/O - PTB[0…2]  
Slew Rate Trim Bit. See MM912_634 - Analog Die Trimming  
The LIN driver is a Low-side MOSFET with current limitation and thermal shutdown. An internal pull-up resistor with a serial diode  
structure is integrated, so no external pull-up components are required for the application in a slave node. The fall time from  
dominant to recessive and the rise time from recessive to dominant is controlled. The symmetry between both slopes is  
guaranteed.  
5.15.1  
LIN Pin  
The LIN pin offers high susceptibility immunity level from external disturbance, guaranteeing communication during external  
disturbance. See ESD Protection and Latch-up Immunity.  
5.15.2  
Slew Rate Selection  
The slew rate can be selected for optimized operation at 10 kBit/s and 20 kBit/s as well as a fast baud rate (100 kBit) for test and  
programming. The slew rate can be adapted with the bits LINSR[1:0] in the LIN Register (LINR). The initial slew rate is 20 kBit/s.  
MM912_634 Advance Information, Rev. 11.0  
96  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.15.3  
Overtemperature Shutdown (LIN Interrupt)  
The output Low-side FET (transmitter) is protected against overtemperature conditions. In case of an overtemperature condition,  
the transmitter will be shut down and the bit LINOTC in the LIN Register (LINR) is set as long as the condition is present.  
If the LINOTIE bit is set in the LIN Register (LINR), an Interrupt IRQ will be generated. Acknowledge the interrupt by reading the  
LIN Register (LINR). To issue a new interrupt, the condition has to vanish and occur again.  
The transmitter is automatically re-enabled once the overtemperature condition is gone and TxD is High.  
5.15.4  
Low Power Mode and Wake-up Feature  
During Low Power mode operation the transmitter of the physical layer is disabled. The receiver is still active and able to detect  
Wake-up events on the LIN bus line.  
A dominant level longer than tPROPWL followed by a rising edge, will generate a wake-up event and be reported in the Wake-up  
Source Register (WSR).  
5.15.5  
J2602 Compliance  
A Low Voltage Shutdown feature was implemented to allow controlled J2602 compliant LIN driver behavior under Low Voltage  
conditions (LVSD=0).  
When an undervoltage occurs on VS1 (LVI), the LIN stays in recessive mode if it was in recessive state. If it was in a dominant  
state, it waits until the next dominant to recessive transition, then it stays in the recessive state.  
When the undervoltage condition (LVI) is gone, the LIN will start operating when Tx is in a recessive state or on the next dominant  
to recessive transition.  
5.15.6  
Register Definition  
LIN Register (LINR)  
5.15.6.1  
Table 131. LIN Register (LINR)  
Offset(97) 0x18  
Access: User read  
7
6
5
4
3
2
1
0
R
W
LINOTC  
RX  
LINOTIE  
0
TX  
0
LVSD  
0
LINEN  
0
LINSR  
Reset  
0
0
0
0
Note:  
98. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 132. LINR - Register Field Descriptions  
Field  
Description  
7 - LINOTIE  
6 - LINOTC  
LIN - Overtemperature Interrupt Enable  
LIN - Overtemperature condition present. LIN driver is shut down. Reading this bit will clear the LINOT interrupt flag.  
LIN - Receiver (Rx) Status.  
0 - LIN Bus Dominant  
1 - LIN Bus Recessive  
5 - RX  
4 - TX  
LIN - Direct Transmitter Control. The inverted signal is OR  
0 - Transmitter not controlled  
1 - Transmitter Dominant  
LIN - Low Voltage Shutdown Disable (J2602 Compliance Control)  
0 - LIN will be set to recessive state in case of VS1 undervoltage condition  
1 - LIN will stay functional even with a VS1 undervoltage condition  
3 - LVSD  
MM912_634 Advance Information, Rev. 11.0  
97  
Freescale Semiconductor  
Functional Description and Application Information  
Table 132. LINR - Register Field Descriptions (continued)  
Field  
Description  
LIN Module Enable  
2 - LINEN  
0 - LIN Module Disabled  
1 - LIN Module Enabled  
LIN - Slew Rate Select  
00 - Normal Slew Rate (20 kBit)  
01 - Slow Slew Rate (10.4 kBit)  
10 - Fast Slew Rate (100 kBit)  
11 - Normal Slew Rate (20 kBit)  
1-0 - LINSR  
5.16  
Serial Communication Interface (S08SCIV4)  
MCU  
ANALOG  
5.16.1  
Introduction  
5.16.1.1  
Features  
Features of the SCI module include:  
Full-duplex, standard non-return-to-zero (NRZ) format  
Double-buffered transmitter and receiver with separate enables  
Programmable baud rates (13-bit modulo divider)  
Interrupt-driven or polled operation:  
Transmit data register empty and transmission complete  
Receive data register full  
Receive overrun, parity error, framing error, and noise error  
Idle receiver detect  
Active edge on receive pin  
Break detect supporting LIN  
Hardware parity generation and checking  
Programmable 8-bit or 9-bit character length  
Receiver wake-up by idle-line or address-mark  
Optional 13-bit break character generation / 11-bit break character detection  
Selectable transmitter output polarity  
5.16.1.2  
Modes of Operation  
See Section 5.16.3, “Functional Description", for details concerning SCI operation in these modes:  
8 and 9-bit data modes  
Loop mode  
Single-wire mode  
5.16.1.3  
Block Diagram  
Figure 29 shows the transmitter portion of the SCI.  
MM912_634 Advance Information, Rev. 11.0  
98  
Freescale Semiconductor  
 
Functional Description and Application Information  
INTERNAL BUS  
(WRITE-ONLY)  
LOOPS  
SCID – Tx BUFFER  
RSRC  
LOOP  
TO RECEIVE  
DATA IN  
11-BIT TRANSMIT SHIFT REGISTER  
CONTROL  
M
TO TxD  
H
8
7
6
5
4
3
2
1
0
L
1 BAUD  
RATE CLOCK  
SHIFT DIRECTION  
TX-  
T*  
PE  
PT  
PARITY  
GENERATION  
SCI CONTROLS TxD  
TxD DIRECTION  
TE  
SBK  
TO TxD  
LOGIC  
TRANSMIT CONTROL  
TXDIR  
BRK13  
TDRE  
TIE  
Tx INTERRUPT  
REQUEST  
TC  
TCIE  
Figure 29. SCI Transmitter Block Diagram  
Figure 30 shows the receiver portion of the SCI.  
MM912_634 Advance Information, Rev. 11.0  
99  
Freescale Semiconductor  
 
Functional Description and Application Information  
INTERNAL BUS  
(READ-ONLY)  
SCID – Rx BUFFER  
16 BAUD  
RATE CLOCK  
DIVIDE  
BY 16  
FROM  
TRANSMITTER  
11-BIT RECEIVE SHIFT REGISTER  
LOOPS  
RSRC  
SINGLE-WIRE  
M
LOOP CONTROL  
LBKDE  
H
8
7
6
5
4
3
2
1
0
L
FROM RxD  
RX-  
DATA RECOVERY  
SHIFT DIRECTION  
WAKEUP  
LOGIC  
ILT  
RWUID  
RWU  
ACTIVE EDGE  
DETECT  
RDRF  
RIE  
IDLE  
ILIE  
Rx INTERRUPT  
REQUEST  
LBKDIF  
LBKDIE  
RXEDGIF  
RXEDGIE  
OR  
ORIE  
FE  
FEIE  
ERROR INTERRUPT  
REQUEST  
NF  
NEIE  
PE  
PT  
PARITY  
CHECKING  
PF  
PEIE  
Figure 30. SCI Receiver Block Diagram  
MM912_634 Advance Information, Rev. 11.0  
100  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.16.2  
Register Definition  
The SCI has eight 8-bit registers to control baud rate, select SCI options, report SCI status, and for transmit/receive data.  
Refer to Die to Die Interface - Target of this data sheet for the absolute address assignments for all SCI registers. This section  
refers to registers and control bits only by their names.  
5.16.2.1  
SCI Baud Rate Registers (SCIBD (hi), SCIBD (lo))  
This pair of registers controls the prescale divisor for SCI baud rate generation. To update the 13-bit baud rate setting  
[SBR12:SBR0], first write to SCIBD (hi) to buffer the high half of the new value, and then write to SCIBD (lo). The working value  
in SCIBD (hi) does not change until SCIBD (lo) is written.  
SCIBDL is reset to a non-zero value, so after reset the baud rate generator remains disabled until the first time the receiver or  
transmitter is enabled (RE or TE bits in SCIC2 are written to 1).  
Table 133. SCI Baud Rate Register (SCIBD (hi))  
Offset(97) 0x40  
Access: User read/write  
7
6
5
4
3
2
1
0
R
0
LBKDIE  
0
RXEDGIE  
0
SBR12  
0
SBR11  
0
SBR10  
0
SBR9  
0
SBR8  
0
W
Reset  
0
Note:  
99. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 134. SCIBD (hi) Field Descriptions  
Field  
Description  
LIN Break Detect Interrupt Enable (for LBKDIF)  
7
0
1
Hardware interrupts from LBKDIF disabled (use polling).  
Hardware interrupt requested when LBKDIF flag is 1.  
LBKDIE  
RxD Input Active Edge Interrupt Enable (for RXEDGIF)  
6
0
1
Hardware interrupts from RXEDGIF disabled (use polling).  
Hardware interrupt requested when RXEDGIF flag is 1.  
RXEDGIE  
Baud Rate Modulo Divisor — The 13 bits in SBR[12:0] are referred to collectively as BR, and they set the modulo divide rate  
for the SCI baud rate generator. When BR = 0, the SCI baud rate generator is disabled to reduce supply current. When BR = 1  
to 8191, the SCI baud rate = BUSCLK/(16BR). See also BR bits in Table 136.  
4:0  
SBR[128]  
Table 135. SCI Baud Rate Register (SCIBDL)  
Offset(100 0x41  
Access: User read/write  
)
7
6
5
4
3
2
1
0
R
W
SBR7  
0
SBR6  
0
SBR5  
0
SBR4  
0
SBR3  
0
SBR2  
1
SBR1  
0
SBR0  
0
Reset  
Note:  
100. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 136. SCIBDL Field Descriptions  
Field  
Description  
Baud Rate Modulo Divisor — These 13 bits in SBR[12:0] are referred to collectively as BR, and they set the modulo divide rate  
for the SCI baud rate generator. When BR = 0, the SCI baud rate generator is disabled to reduce supply current. When BR = 1  
to 8191, the SCI baud rate = BUSCLK/(16BR). See also BR bits in Table 134.  
7:0  
SBR[7:0]  
MM912_634 Advance Information, Rev. 11.0  
101  
Freescale Semiconductor  
 
 
 
 
 
Functional Description and Application Information  
5.16.2.2  
SCI Control Register 1 (SCIC1)  
This read/write register is used to control various optional features of the SCI system.  
Table 137. SCI Control Register 1 (SCIC1)  
Offset(101 0x42  
Access: User read/write  
)
7
6
5
4
3
2
1
0
R
W
0
0
LOOPS  
0
RSRC  
0
M
0
ILT  
0
PE  
0
PT  
0
Reset  
0
0
Note:  
101. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 138. SCIC1 Field Descriptions  
Field  
Description  
Loop Mode Select — Selects between loop back modes and normal 2-pin full-duplex modes. When LOOPS = 1, the transmitter  
output is internally connected to the receiver input.  
7
0
Normal operation — RxD and TxD use separate pins.  
LOOPS  
1
Loop mode or single-wire mode where transmitter outputs are internally connected to receiver input. (See RSRC bit.)  
RxD pin is not used by SCI.  
Receiver Source Select — This bit has no meaning or effect unless the LOOPS bit is set to 1. When LOOPS = 1, the receiver  
input is internally connected to the TxD pin and RSRC determines whether this connection is also connected to the transmitter  
output.  
5
RSRC  
0
1
Provided LOOPS = 1, RSRC = 0 selects internal loop back mode and the SCI does not use the RxD pins.  
Single-wire SCI mode where the TxD pin is connected to the transmitter output and receiver input.  
9-Bit or 8-Bit Mode Select  
4
M
0
1
Normal — start + 8 data bits (LSB first) + stop.  
Receiver and transmitter use 9-bit data characters start + 8 data bits (LSB first) + 9th data bit + stop.  
Idle Line Type Select — Setting this bit to 1 ensures that the stop bit and logic 1 bits at the end of a character do not count  
toward the 10 or 11 bit times of logic high level needed by the idle line detection logic. Refer to Section 5.16.3.3.2.1, “Idle-line  
Wake-up" for more information.  
2
ILT  
0
1
Idle character bit count starts after start bit.  
Idle character bit count starts after stop bit.  
Parity Enable — Enables hardware parity generation and checking. When parity is enabled, the most significant bit (MSB) of  
the data character (eighth or ninth data bit) is treated as the parity bit.  
1
0
1
No hardware parity generation or checking.  
Parity enabled.  
PE  
Parity Type — Provided parity is enabled (PE = 1), this bit selects even or odd parity. Odd parity means the total number of 1s  
in the data character, including the parity bit, is odd. Even parity means the total number of 1s in the data character, including  
the parity bit, is even.  
0
PT  
0
1
Even parity.  
Odd parity.  
MM912_634 Advance Information, Rev. 11.0  
102  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.16.2.3  
SCI Control Register 2 (SCIC2)  
This register can be read or written at any time.  
Table 139. SCI Control Register 2 (SCIC2)  
Offset(102 0x43  
Access: User read/write  
)
7
6
5
4
3
2
1
0
R
W
TIE  
0
TCIE  
0
RIE  
0
ILIE  
0
TE  
0
RE  
0
RWU  
0
SBK  
0
Reset  
Note:  
102. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 140. SCIC2 Field Descriptions  
Field  
Description  
Transmit Interrupt Enable (for TDRE)  
7
TIE  
0
1
Hardware interrupts from TDRE disabled (use polling).  
Hardware interrupt requested when TDRE flag is 1.  
Transmission Complete Interrupt Enable (for TC)  
6
0
1
Hardware interrupts from TC disabled (use polling).  
Hardware interrupt requested when TC flag is 1.  
TCIE  
Receiver Interrupt Enable (for RDRF)  
5
RIE  
0
1
Hardware interrupts from RDRF disabled (use polling).  
Hardware interrupt requested when RDRF flag is 1.  
Idle Line Interrupt Enable (for IDLE)  
4
LIE  
0
1
Hardware interrupts from IDLE disabled (use polling).  
Hardware interrupt requested when IDLE flag is 1.  
Transmitter Enable  
0
1
Transmitter off.  
Transmitter on.  
TE must be 1 in order to use the SCI transmitter. When TE = 1, the SCI forces the TxD pin to act as an output for the SCI  
system.  
3
When the SCI is configured for single-wire operation (LOOPS = RSRC = 1), TXDIR controls the direction of traffic on the single  
SCI communication line (TxD pin).  
TE  
TE also can be used to queue an idle character by writing TE = 0 then TE = 1 while a transmission is in progress. Refer to  
Section 5.16.3.2.1, “Send Break and Queued Idle" for more details.  
When TE is written to 0, the transmitter keeps control of the port TxD pin until any data, queued idle, or queued break character  
finishes transmitting before allowing the pin to revert to a general-purpose I/O pin.  
Receiver Enable — When the SCI receiver is off, the RxD pin reverts to being a general-purpose port I/O pin. If LOOPS = 1  
the RxD pin reverts to being a general-purpose I/O pin even if RE = 1.  
2
0
1
Receiver off.  
Receiver on.  
RE  
MM912_634 Advance Information, Rev. 11.0  
103  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 140. SCIC2 Field Descriptions (continued)  
Field  
Description  
Receiver Wake-up Control — This bit can be written to 1 to place the SCI receiver in a standby state where it waits for automatic  
hardware detection of a selected wake-up condition. The wake-up condition is either an idle line between messages  
(WAKE = 0, idle-line wake-up), or a logic 1 in the most significant data bit in a character (WAKE = 1, address-mark wake-up).  
Application software sets RWU and (normally) a selected hardware condition automatically clears RWU. Refer to  
Section 5.16.3.3.2, “Receiver Wake-up Operation" for more details.  
1
RWU  
0
1
Normal SCI receiver operation.  
SCI receiver in standby waiting for wake-up condition.  
Send Break — Writing a 1 and then a 0 to SBK queues a break character in the transmit data stream. Additional break  
characters of 10 or 11 (13 or 14 if BRK13 = 1) bit times of logic 0 are queued as long as SBK = 1. Depending on the timing of  
the set and clear of SBK relative to the information currently being transmitted, a second break character may be queued  
before software clears SBK. Refer to Section 5.16.3.2.1, “Send Break and Queued Idle" for more details.  
0
SBK  
0
1
Normal transmitter operation.  
Queue break character(s) to be sent.  
5.16.2.4  
SCI Status Register 1 (SCIS1)  
This register has eight read-only status flags. Writes have no effect. Special software sequences (which do not involve writing to  
this register) are used to clear these status flags.  
Table 141. SCI Status Register 1 (SCIS1)  
Offset(103 0x44  
Access: User read/write  
)
7
6
5
4
3
2
1
0
R
W
TDRE  
TC  
RDRF  
IDLE  
OR  
NF  
FE  
pF  
Reset  
1
1
0
0
0
0
0
0
Note:  
103. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 142. SCIS1 Field Descriptions  
Field  
Description  
Transmit Data Register Empty Flag — TDRE is set out of reset and when a transmit data value transfers from the transmit data  
buffer to the transmit shifter, leaving room for a new character in the buffer. To clear TDRE, read SCIS1 with TDRE = 1 and  
then write to the SCI data register (SCID).  
7
TDRE  
0
1
Transmit data register (buffer) full.  
Transmit data register (buffer) empty.  
Transmission Complete Flag — TC is set out of reset and when TDRE = 1 and no data, preamble, or break character is being  
transmitted.  
0
1
Transmitter active (sending data, a preamble, or a break).  
Transmitter idle (transmission activity complete).  
6
TC  
TC is cleared automatically by reading SCIS1 with TC = 1 and then doing one of the following three things:  
Write to the SCI data register (SCID) to transmit new data  
Queue a preamble by changing TE from 0 to 1  
Queue a break character by writing 1 to SBK in SCIC2  
Receive Data Register Full Flag — RDRF becomes set when a character transfers from the receive shifter into the receive  
data register (SCID). To clear RDRF, read SCIS1 with RDRF = 1 and then read the SCI data register (SCID).  
5
0
1
Receive data register empty.  
Receive data register full.  
RDRF  
MM912_634 Advance Information, Rev. 11.0  
104  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 142. SCIS1 Field Descriptions (continued)  
Field  
Description  
Idle Line Flag — IDLE is set when the SCI receive line becomes idle for a full character time after a period of activity. When  
ILT = 0, the receiver starts counting idle bit times after the start bit. So if the receive character is all 1s, these bit times and the  
stop bit time count toward the full character time of logic high (10 or 11 bit times depending on the M control bit) needed for the  
receiver to detect an idle line. When ILT = 1, the receiver doesn’t start counting idle bit times until after the stop bit. So the stop  
bit and any logic high bit times at the end of the previous character do not count toward the full character time of logic high  
needed for the receiver to detect an idle line.  
4
IDLE  
To clear IDLE, read SCIS1 with IDLE = 1 and then read the SCI data register (SCID). After IDLE has been cleared, it cannot  
become set again until after a new character has been received and RDRF has been set. IDLE will get set only once even if  
the receive line remains idle for an extended period.  
0
1
No idle line detected.  
Idle line was detected.  
Receiver Overrun Flag — OR is set when a new serial character is ready to be transferred to the receive data register (buffer),  
but the previously received character has not been read from SCID yet. In this case, the new character (and all associated  
error information) is lost because there is no room to move it into SCID. To clear OR, read SCIS1 with OR = 1 and then read  
the SCI data register (SCID).  
3
OR  
0
1
No overrun.  
Receive overrun (new SCI data lost).  
Noise Flag — The advanced sampling technique used in the receiver takes seven samples during the start bit and three  
samples in each data bit and the stop bit. If any of these samples disagrees with the rest of the samples within any bit time in  
the frame, the flag NF will be set at the same time as the flag RDRF gets set for the character. To clear NF, read SCIS1 and  
then read the SCI data register (SCID).  
2
NF  
0
1
No noise detected.  
Noise detected in the received character in SCID.  
Framing Error Flag — FE is set at the same time as RDRF when the receiver detects a logic 0 where the stop bit was expected.  
This suggests the receiver was not properly aligned to a character frame. To clear FE, read SCIS1 with FE = 1 and then read  
the SCI data register (SCID).  
1
FE  
0
1
No framing error detected. This does not guarantee the framing is correct.  
Framing error.  
Parity Error Flag — PF is set at the same time as RDRF when parity is enabled (PE = 1) and the parity bit in the received  
character does not agree with the expected parity value. To clear PF, read SCIS1 and then read the SCI data register (SCID).  
0
0
1
No parity error.  
Parity error.  
PF  
5.16.2.5  
SCI Status Register 2 (SCIS2)  
This register has one read-only status flag.  
Table 143. SCI Status Register 2 (SCIS2)  
Offset(104 0x45  
Access: User read/write  
)
7
6
5
4
3
2
1
0
R
W
0
RAF  
LBKDIF  
0
RXEDGIF  
0
RXINV(105)  
0
RWUID  
0
BRK13  
0
LBKDE  
0
Reset  
0
0
Note:  
104. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
105  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 144. SCIS2 Field Descriptions  
Field  
Description  
LIN Break Detect Interrupt Flag — LBKDIF is set when the LIN break detect circuitry is enabled and a LIN break character is  
detected. LBKDIF is cleared by writing a “1” to it.  
7
0
1
No LIN break character has been detected.  
LIN break character has been detected.  
LBKDIF  
RxD Pin Active Edge Interrupt Flag — RXEDGIF is set when an active edge (falling if RXINV = 0, rising if RXINV=1) on the  
RxD pin occurs. RXEDGIF is cleared by writing a “1” to it.  
6
0
1
No active edge on the receive pin has occurred.  
An active edge on the receive pin has occurred.  
RXEDGIF  
Receive Data Inversion — Setting this bit reverses the polarity of the received data input.  
4
0
1
Receive data not inverted  
Receive data inverted  
RXINV(105)  
Receive Wake Up Idle Detect— RWUID controls whether the idle character that wakes up the receiver sets the IDLE bit.  
3
0
1
During receive standby state (RWU = 1), the IDLE bit does not get set upon detection of an idle character.  
During receive standby state (RWU = 1), the IDLE bit gets set upon detection of an idle character.  
RWUID  
Break Character Generation Length — BRK13 is used to select a longer transmitted break character length. Detection of a  
framing error is not affected by the state of this bit.  
2
0
1
Break character is transmitted with length of 10 bit times (11 if M = 1)  
Break character is transmitted with length of 13 bit times (14 if M = 1)  
BRK13  
LIN Break Detection Enable— LBKDE is used to select a longer break character detection length. While LBKDE is set, framing  
error (FE) and receive data register full (RDRF) flags are prevented from setting.  
1
0
1
Break character detection disabled.  
Break character detection enabled.  
LBKDE  
Note:  
105. Setting RXINV inverts the RxD input for all cases: data bits, start and stop bits, break, and idle.  
When using an internal oscillator in a LIN system, it is necessary to raise the break detection threshold by one bit time. Under  
the worst case timing conditions allowed in LIN, it is possible that a 0x00 data character can appear to be 10.26 bit times long at  
a slave which is running 14% faster than the master. This would trigger normal break detection circuitry which is designed to  
detect a 10 bit break symbol. When the LBKDE bit is set, framing errors are inhibited and the break detection threshold changes  
from 10 bits to 11 bits, preventing false detection of a 0x00 data character as a LIN break symbol.  
5.16.2.6  
SCI Control Register 3 (SCIC3)  
Table 145. SCI Control Register 3 (SCIC3)  
Offset(106) 0x46  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
R8  
T8  
0
TXDIR  
0
TXINV(107)  
0
ORIE  
0
NEIE  
0
FEIE  
0
PEIE  
0
Reset  
0
Note:  
106. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
106  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 146. SCIC3 Field Descriptions  
Field  
Description  
Ninth Data Bit for Receiver — When the SCI is configured for 9-bit data (M = 1), R8 can be thought of as a ninth receive data  
bit to the left of the MSB of the buffered data in the SCID register. When reading 9-bit data, read R8 before reading SCID  
because reading SCID completes automatic flag clearing sequences which could allow R8 and SCID to be overwritten with  
new data.  
7
R8  
Ninth Data Bit for Transmitter — When the SCI is configured for 9-bit data (M = 1), T8 may be thought of as a ninth transmit  
data bit to the left of the MSB of the data in the SCID register. When writing 9-bit data, the entire 9-bit value is transferred to  
the SCI shift register after SCID is written so T8 should be written (if it needs to change from its previous value) before SCID  
is written. If T8 does not need to change in the new value (such as when it is used to generate mark or space parity), it need  
not be written each time SCID is written.  
6
T8  
TxD Pin Direction in Single-wire Mode — When the SCI is configured for single-wire half-duplex operation  
(LOOPS = RSRC = 1), this bit determines the direction of data at the TxD pin.  
5
0
1
TxD pin is an input in single-wire mode.  
TxD pin is an output in single-wire mode.  
TXDIR  
Transmit Data Inversion — Setting this bit reverses the polarity of the transmitted data output.  
4
0
1
Transmit data not inverted  
Transmit data inverted  
TXINV(107)  
Overrun Interrupt Enable — This bit enables the overrun flag (OR) to generate hardware interrupt requests.  
3
0
1
OR interrupts disabled (use polling).  
ORIE  
Hardware interrupt requested when OR = 1.  
Noise Error Interrupt Enable — This bit enables the noise flag (NF) to generate hardware interrupt requests.  
2
0
1
NF interrupts disabled (use polling).  
NEIE  
Hardware interrupt requested when NF = 1.  
Framing Error Interrupt Enable — This bit enables the framing error flag (FE) to generate hardware interrupt requests.  
1
FEIE  
0
1
FE interrupts disabled (use polling).  
Hardware interrupt requested when FE = 1.  
Parity Error Interrupt Enable — This bit enables the parity error flag (PF) to generate hardware interrupt requests.  
0
0
1
PF interrupts disabled (use polling).  
PEIE  
Hardware interrupt requested when PF = 1.  
Note:  
107. Setting TXINV inverts the TxD output for all cases: data bits, start and stop bits, break, and idle.  
5.16.2.7  
SCI Data Register (SCID)  
This register is actually two separate registers. Reads return the contents of the read-only receive data buffer and writes go to  
the write-only transmit data buffer. Reads and writes of this register are also involved in the automatic flag clearing mechanisms  
for the SCI status flags.  
Table 147. SCI Data Register (SCID)  
Offset(108) 0x47  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
R7  
T7  
0
R6  
T6  
0
R5  
T5  
0
R4  
T4  
0
R3  
T3  
0
R2  
T2  
0
R1  
T1  
0
R0  
T0  
0
Reset  
Note:  
108. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
107  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.16.3  
Functional Description  
The SCI allows full-duplex, asynchronous, NRZ serial communication among the MCU and remote devices, including other  
MCUs. The SCI comprises a baud rate generator, transmitter, and receiver block. The transmitter and receiver operate  
independently, although they use the same baud rate generator. During normal operation, the MCU monitors the status of the  
SCI, writes the data to be transmitted, and processes received data. The following describes each of the blocks of the SCI.  
5.16.3.1  
Baud Rate Generation  
As shown in Figure 31, the clock source for the SCI baud rate generator is the D2D clock.  
MODULO DIVIDE BY  
(1 THROUGH 8191)  
DIVIDE BY  
Tx BAUD RATE  
16  
D2D  
SBR12:SBR0  
Rx SAMPLING CLOCK  
(16 ´ BAUD RATE)  
BAUD RATE GENERATOR  
OFF IF [SBR12:SBR0] = 0  
BUSCLK  
BAUD RATE =  
[SBR12:SBR0] ´ 16  
Figure 31. SCI Baud Rate Generation  
SCI communications require the transmitter and receiver (which typically derive baud rates from independent clock sources) to  
use the same baud rate. Allowed tolerance on this baud frequency depends on the details of how the receiver synchronizes to  
the leading edge of the start bit and how bit sampling is performed.  
The MCU resynchronizes to bit boundaries on every high-to-low transition, but in the worst case, there are no such transitions in  
the full 10- or 11-bit time character frame so any mismatch in baud rate is accumulated for the whole character time. For a  
Freescale Semiconductor SCI system whose bus frequency is driven by a crystal, the allowed baud rate mismatch is about ±4.5  
percent for 8-bit data format and about ±4.0 percent for 9-bit data format. Although baud rate modulo divider settings do not  
always produce baud rates that exactly match standard rates, it is normally possible to get within a few percent, which is  
acceptable for reliable communications.  
5.16.3.2  
Transmitter Functional Description  
This section describes the overall block diagram for the SCI transmitter, as well as specialized functions for sending break and  
idle characters. The transmitter block diagram is shown in Figure 29.  
The transmitter output (TxD) idle state defaults to logic high (TXINV = 0 following reset). The transmitter output is inverted by  
setting TXINV = 1. The transmitter is enabled by setting the TE bit in SCIC2. This queues a preamble character that is one full  
character frame of the idle state. The transmitter then remains idle until data is available in the transmit data buffer. Programs  
store data into the transmit data buffer by writing to the SCI data register (SCID).  
The central element of the SCI transmitter is the transmit shift register that is either 10 or 11 bits long depending on the setting  
in the M control bit. For the remainder of this section, we will assume M = 0, selecting the normal 8-bit data mode. In 8-bit data  
mode, the shift register holds a start bit, eight data bits, and a stop bit. When the transmit shift register is available for a new SCI  
character, the value waiting in the transmit data register is transferred to the shift register (synchronized with the baud rate clock)  
and the transmit data register empty (TDRE) status flag is set to indicate another character may be written to the transmit data  
buffer at SCID.  
If no new character is waiting in the transmit data buffer after a stop bit is shifted out the TxD pin, the transmitter sets the transmit  
complete flag and enters an idle mode, with TxD high, waiting for more characters to transmit.  
Writing 0 to TE does not immediately release the pin to be a general-purpose I/O pin. Any transmit activity that is in progress  
must first be completed. This includes data characters in progress, queued idle characters, and queued break characters.  
5.16.3.2.1  
Send Break and Queued Idle  
The SBK control bit in SCIC2 is used to send break characters which were originally used to gain the attention of old teletype  
receivers. Break characters are a full character time of logic 0 (10 bit times including the start and stop bits). A longer break of  
13 bit times can be enabled by setting BRK13 = 1. Normally, a program would wait for TDRE to become set to indicate the last  
character of a message has moved to the transmit shifter, then write 1 and then write 0 to the SBK bit. This action queues a break  
MM912_634 Advance Information, Rev. 11.0  
108  
Freescale Semiconductor  
 
Functional Description and Application Information  
character to be sent as soon as the shifter is available. If SBK is still 1 when the queued break moves into the shifter  
(synchronized to the baud rate clock), an additional break character is queued. If the receiving device is another Freescale  
Semiconductor SCI, the break characters will be received as 0s in all eight data bits and a framing error (FE = 1) occurs.  
When idle-line wake-up is used, a full character time of idle (logic 1) is needed between messages to wake up any sleeping  
receivers. Normally, a program would wait for TDRE to become set to indicate the last character of a message has moved to the  
transmit shifter, then write 0 and then write 1 to the TE bit. This action queues an idle character to be sent as soon as the shifter  
is available. As long as the character in the shifter does not finish while TE = 0, the SCI transmitter never actually releases control  
of the TxD pin. If there is a possibility of the shifter finishing while TE = 0, set the general-purpose I/O controls so the pin that is  
shared with TxD is an output driving a logic 1. This ensures that the TxD line will look like a normal idle line even if the SCI loses  
control of the port pin between writing 0 and then 1 to TE.  
The length of the break character is affected by the BRK13 and M bits as shown below.  
Table 148. Break Character Length  
BRK13  
M
Break Character Length  
0
0
1
1
0
1
0
1
10 bit times  
11 bit times  
13 bit times  
14 bit times  
5.16.3.3  
Receiver Functional Description  
In this section, the receiver block diagram (Figure 30) is used as a guide for the overall receiver functional description. Next, the  
data sampling technique used to reconstruct receiver data is described in more detail. Finally, two variations of the receiver  
wake-up function are explained.  
The receiver input is inverted by setting RXINV = 1. The receiver is enabled by setting the RE bit in SCIC2. Character frames  
consist of a start bit of logic 0, eight (or nine) data bits (LSB first), and a stop bit of logic 1. For information about 9-bit data mode,  
refer to Section •, “8 and 9-bit data modes". For the remainder of this discussion, we assume the SCI is configured for normal  
8-bit data mode.  
After receiving the stop bit into the receive shifter, and provided the receive data register is not already full, the data character is  
transferred to the receive data register and the receive data register full (RDRF) status flag is set. If RDRF was already set  
indicating the receive data register (buffer) was already full, the overrun (OR) status flag is set and the new data is lost. Because  
the SCI receiver is double-buffered, the program has one full character time after RDRF is set before the data in the receive data  
buffer must be read to avoid a receiver overrun.  
When a program detects that the receive data register is full (RDRF = 1), it gets the data from the receive data register by reading  
SCID. The RDRF flag is cleared automatically by a 2-step sequence which is normally satisfied in the course of the user’s  
program that handles receive data. Refer to Section 5.16.3.4, “Interrupts and Status Flags" for more details about flag clearing.  
5.16.3.3.1  
Data Sampling Technique  
The SCI receiver uses a 16baud rate clock for sampling. The receiver starts by taking logic level samples at 16 times the baud  
rate to search for a falling edge on the RxD serial data input pin. A falling edge is defined as a logic 0 sample after three  
consecutive logic 1 samples. The 16baud rate clock is used to divide the bit time into 16 segments labeled RT1 through RT16.  
When a falling edge is located, three more samples are taken at RT3, RT5, and RT7 to make sure this was a real start bit and  
not merely noise. If at least two of these three samples are 0, the receiver assumes it is synchronized to a receive character.  
The receiver then samples each bit time, including the start and stop bits, at RT8, RT9, and RT10 to determine the logic level for  
that bit. The logic level is interpreted to be that of the majority of the samples taken during the bit time. In the case of the start bit,  
the bit is assumed to be 0 if at least two of the samples at RT3, RT5, and RT7 are 0 even if one or all of the samples taken at  
RT8, RT9, and RT10 are 1s. If any sample in any bit time (including the start and stop bits) in a character frame fails to agree  
with the logic level for that bit, the noise flag (NF) will be set when the received character is transferred to the receive data buffer.  
The falling edge detection logic continuously looks for falling edges, and if an edge is detected, the sample clock is  
resynchronized to bit times. This improves the reliability of the receiver in the presence of noise or mismatched baud rates. It  
does not improve worst case analysis because some characters do not have any extra falling edges anywhere in the character  
frame.  
MM912_634 Advance Information, Rev. 11.0  
109  
Freescale Semiconductor  
Functional Description and Application Information  
In the case of a framing error, provided the received character was not a break character, the sampling logic that searches for a  
falling edge is filled with three logic 1 samples so that a new start bit can be detected almost immediately.  
In the case of a framing error, the receiver is inhibited from receiving any new characters until the framing error flag is cleared.  
The receive shift register continues to function, but a complete character cannot transfer to the receive data buffer if FE is still set.  
5.16.3.3.2  
Receiver Wake-up Operation  
Receiver wake-up is a hardware mechanism that allows an SCI receiver to ignore the characters in a message that is intended  
for a different SCI receiver. In such a system, all receivers evaluate the first character(s) of each message, and as soon as they  
determine the message is intended for a different receiver, they write logic 1 to the receiver wake up (RWU) control bit in SCIC2.  
When RWU bit is set, the status flags associated with the receiver (with the exception of the idle bit, IDLE, when RWUID bit is  
set) are inhibited from setting, thus eliminating the software overhead for handling the unimportant message characters. At the  
end of a message, or at the beginning of the next message, all receivers automatically force RWU to 0 so all receivers wake up  
in time to look at the first character(s) of the next message.  
5.16.3.3.2.1  
Idle-line Wake-up  
When WAKE = 0, the receiver is configured for idle-line wake-up. In this mode, RWU is cleared automatically when the receiver  
detects a full character time of the idle-line level. The M control bit selects 8-bit or 9-bit data mode that determines how many bit  
times of idle are needed to constitute a full character time (10 or 11 bit times because of the start and stop bits).  
When RWU is one and RWUID is zero, the idle condition that wakes up the receiver does not set the IDLE flag. The receiver  
wakes up and waits for the first data character of the next message which will set the RDRF flag and generate an interrupt if  
enabled. When RWUID is one, any idle condition sets the IDLE flag and generates an interrupt if enabled, regardless of whether  
RWU is zero or one.  
The idle-line type (ILT) control bit selects one of two ways to detect an idle line. When ILT = 0, the idle bit counter starts after the  
start bit so the stop bit and any logic 1s at the end of a character count toward the full character time of idle. When ILT = 1, the  
idle bit counter does not start until after a stop bit time, so the idle detection is not affected by the data in the last character of the  
previous message.  
5.16.3.3.2.2  
Address-Mark Wake-up  
When WAKE = 1, the receiver is configured for address-mark wake-up. In this mode, RWU is cleared automatically when the  
receiver detects a logic 1 in the most significant bit of a received character (eighth bit in M = 0 mode and ninth bit in M = 1 mode).  
Address-mark wake-up allows messages to contain idle characters but requires that the MSB be reserved for use in address  
frames. The logic 1 MSB of an address frame clears the RWU bit before the stop bit is received and sets the RDRF flag. In this  
case the character with the MSB set is received even though the receiver was sleeping during most of this character time.  
5.16.3.4  
Interrupts and Status Flags  
The SCI system has three separate interrupt vectors to reduce the amount of software needed to isolate the cause of the  
interrupt. One interrupt vector is associated with the transmitter for TDRE and TC events. Another interrupt vector is associated  
with the receiver for RDRF, IDLE, RXEDGIF and LBKDIF events, and a third vector is used for OR, NF, FE, and PF error  
conditions. Each of these ten interrupt sources can be separately masked by local interrupt enable masks. The flags can still be  
polled by software when the local masks are cleared to disable generation of hardware interrupt requests.  
The SCI transmitter has two status flags that optionally can generate hardware interrupt requests. Transmit data register empty  
(TDRE) indicates when there is room in the transmit data buffer to write another transmit character to SCID. If the transmit  
interrupt enable (TIE) bit is set, a hardware interrupt will be requested whenever TDRE = 1. Transmit complete (TC) indicates  
that the transmitter is finished transmitting all data, preamble, and break characters and is idle with TxD at the inactive level. This  
flag is often used in systems with modems to determine when it is safe to turn off the modem. If the transmit complete interrupt  
enable (TCIE) bit is set, a hardware interrupt will be requested whenever TC = 1. Instead of hardware interrupts, software polling  
may be used to monitor the TDRE and TC status flags if the corresponding TIE or TCIE local interrupt masks are 0s.  
When a program detects that the receive data register is full (RDRF = 1), it gets the data from the receive data register by reading  
SCID. The RDRF flag is cleared by reading SCIS1 while RDRF = 1 and then reading SCID.  
When polling is used, this sequence is naturally satisfied in the normal course of the user program. If hardware interrupts are  
used, SCIS1 must be read in the interrupt service routine (ISR). Normally, this is done in the ISR anyway to check for receive  
errors, so the sequence is automatically satisfied.  
MM912_634 Advance Information, Rev. 11.0  
110  
Freescale Semiconductor  
Functional Description and Application Information  
The IDLE status flag includes logic that prevents it from getting set repeatedly when the RxD line remains idle for an extended  
period of time. IDLE is cleared by reading SCIS1 while IDLE = 1 and then reading SCID. After IDLE has been cleared, it cannot  
become set again until the receiver has received at least one new character and has set RDRF.  
If the associated error was detected in the received character that caused RDRF to be set, the error flags — noise flag (NF),  
framing error (FE), and parity error flag (PF) — get set at the same time as RDRF. These flags are not set in overrun cases.  
If RDRF was already set when a new character is ready to be transferred from the receive shifter to the receive data buffer, the  
overrun (OR) flag gets set instead the data along with any associated NF, FE, or PF condition is lost.  
At any time, an active edge on the RxD serial data input pin causes the RXEDGIF flag to set. The RXEDGIF flag is cleared by  
writing a “1” to it. This function does depend on the receiver being enabled (RE = 1).  
5.16.3.5  
Additional SCI Functions  
The following sections describe additional SCI functions.  
5.16.3.5.1  
8- and 9-Bit Data Modes  
The SCI system (transmitter and receiver) can be configured to operate in 9-bit data mode by setting the M control bit in SCIC1.  
In 9-bit mode, there is a ninth data bit to the left of the MSB of the SCI data register. For the transmit data buffer, this bit is stored  
in T8 in SCIC3. For the receiver, the ninth bit is held in R8 in SCIC3.  
For coherent writes to the transmit data buffer, write to the T8 bit before writing to SCID.  
If the bit value to be transmitted as the ninth bit of a new character is the same as for the previous character, it is not necessary  
to write to T8 again. When data is transferred from the transmit data buffer to the transmit shifter, the value in T8 is copied at the  
same time data is transferred from SCID to the shifter.  
9-bit data mode typically is used in conjunction with parity to allow eight bits of data plus the parity in the ninth bit. Or it is used  
with address-mark wake-up so the ninth data bit can serve as the wake-up bit. In custom protocols, the ninth bit can also serve  
as a software-controlled marker.  
5.16.3.5.2  
Stop Mode Operation  
During all stop modes, clocks to the SCI module are halted.  
In stop1 and stop2 modes, all SCI register data is lost and must be re-initialized upon recovery from these two stop modes. No  
SCI module registers are affected in stop3 mode.  
The receive input active edge detect circuit is still active in stop3 mode, but not in stop2. An active edge on the receive input  
brings the CPU out of stop3 mode if the interrupt is not masked (RXEDGIE = 1).  
Note that because the clocks are halted, the SCI module will resume operation upon exit from stop (only in stop3 mode). Software  
should ensure stop mode is not entered while there is a character being transmitted out of or received into the SCI module.  
5.16.3.5.3  
Loop Mode  
When LOOPS = 1, the RSRC bit in the same register chooses between loop mode (RSRC = 0) or single-wire mode (RSRC = 1).  
Loop mode is sometimes used to check software, independent of connections in the external system, to help isolate system  
problems. In this mode, the transmitter output is internally connected to the receiver input and the RxD pin is not used by the SCI,  
so it reverts to a general purpose port I/O pin.  
5.16.3.5.4  
Single-wire Operation  
When LOOPS = 1, the RSRC bit in the same register chooses between loop mode (RSRC = 0) or single-wire mode (RSRC = 1).  
Single-wire mode is used to implement a half-duplex serial connection. The receiver is internally connected to the transmitter  
output and to the TxD pin. The RxD pin is not used and reverts to a general purpose port I/O pin.  
In single-wire mode, the TXDIR bit in SCIC3 controls the direction of serial data on the TxD pin. When TXDIR = 0, the TxD pin  
is an input to the SCI receiver and the transmitter is temporarily disconnected from the TxD pin so an external device can send  
serial data to the receiver. When TXDIR = 1, the TxD pin is an output driven by the transmitter. In single-wire mode, the internal  
loop back connection from the transmitter to the receiver causes the receiver to receive characters that are sent out by the  
transmitter.  
MM912_634 Advance Information, Rev. 11.0  
111  
Freescale Semiconductor  
Functional Description and Application Information  
5.17  
High Voltage Inputs - Lx  
Six High Voltage capable inputs are implemented with the following features:  
MCU  
ANALOG  
Digital Input Capable  
Analog Input Capable with selectable voltage divider.  
Wake-up Capable during Low Power mode. See Wake-up / Cyclic Sense.  
When used as analog inputs to sense voltages outside the module a series resistor must be used on the used input. When a Lx  
input is not selected in the analog multiplexer, the voltage divider is disconnected from that input. When a Lx input is selected in  
the analog multiplexer, it will be disconnected in low power mode if configured as Wake-up input. Unused Lx pins are  
recommended to be connected to GND to improve EMC behavior.  
5.17.1  
Register Definition  
5.17.1.1  
Lx Status Register (LXR)  
Table 149. Lx Status Register (LXR)  
Offset(109) 0x08  
Access: User read  
7
6
5
4
3
2
1
0
R
0
0
L5  
L4  
L3  
L2  
L1  
L0  
W
Note:  
109. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 150. LXR - Register Field Descriptions  
Field  
Description  
Lx Status Register - Current Digital State of the Lx Input  
L[5-0]  
5.17.1.2  
Lx Control Register (LXCR)  
Table 151. Lx Control Register (LXCR)  
Offset(110) 0x09  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
L5DS  
0
L4DS  
0
L3DS  
0
L2DS  
0
L1DS  
0
L0DS  
0
Reset  
0
0
Note:  
110. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 152. LXCR - Register Field Descriptions  
Field  
Description  
Analog Input Divider Ratio Selection - Lx  
5-0  
L[5-0]DS  
0 - 2 (typ.)  
1 - 7.2 (typ)  
MM912_634 Advance Information, Rev. 11.0  
112  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.18  
General Purpose I/O - PTB[0…2]  
The three multipurpose I/O pins can be configured to operate as documented in the table below.  
MCU  
ANALOG  
Table 153. General purpose I/O - Operating modes  
Priority  
Function  
PTB2  
PTB1  
PTB0  
Chp/Pg  
1 (H)  
2
2.5 V Analog Input  
AD2  
TIMCH2  
PWM  
AD1  
TIMCH1  
Tx  
AD0  
TIMCH0  
Rx  
5.20/135  
5.19/122  
5.15/102  
current  
Timer Input Capture / Output Compare  
LIN / SCI - Rx / Tx (PTB0…1) or PWM (PTB2)  
5.0 V Input Output  
3
4 (L)  
PTB2  
PTB1  
PTB0  
The alternate function of PTB2, PTB1 and PTB0 can be configured by selecting the function in the corresponding module (e.g.  
TIMER). The selection with the highest priority will take effect when more than one function is selected.  
5.18.1  
Digital I/O Functionality  
All three pins act as standard digital Inputs / Outputs with selectable pull-up resistor.  
5.18.2  
Alternative SCI / LIN Functionality  
For alternative serial configuration and for debug and certification purpose, PTB0 and PTB1 can be configured to connect to the  
internal LIN and / or SCI signals (RxD and TxD). Figure 32 shows the 4 available configurations.  
PTB0/AD0/TIM0CH0/Rx  
PTB1/AD1/TIM0CH1/Tx  
PTB2/AD2/TIM0CH2/PWM  
PTB0/AD0/TIM0CH0/Rx  
PTB1/AD1/TIM0CH1/Tx  
PTB2/AD2/TIM0CH2/PWM  
4 Channel Timer  
Module  
4 Channel Timer  
Module  
TIM0CH3  
TIM0CH3  
Serial  
Communication  
Interface (SCI)  
Rx  
Tx  
Rx  
Tx  
LIN  
Serial  
Communication  
Interface (SCI)  
Rx  
Tx  
Rx  
Tx  
LIN  
LIN Physical  
Layer Interface  
LIN Physical  
Layer Interface  
Mode 0 (default)  
Mode 2 (external LIN)  
PTB0/AD0/TIM0CH0/Rx  
PTB1/AD1/TIM0CH1/Tx  
PTB2/AD2/TIM0CH2/PWM  
PTB0/AD0/TIM0CH0/Rx  
PTB1/AD1/TIM0CH1/Tx  
PTB2/AD2/TIM0CH2/PWM  
4 Channel Timer  
Module  
4 Channel Timer  
Module  
TIM0CH3  
TIM0CH3  
Rx  
Tx  
Rx  
Tx  
Rx  
Rx  
Tx  
Serial  
Communication  
Interface (SCI)  
LIN  
Serial  
Communication  
Interface (SCI)  
LIN  
LIN Physical  
Layer Interface  
LIN Physical  
Layer Interface  
Tx  
Mode 1 (external SCI)  
Mode 3 (observe)  
Figure 32. Alternative SCI / LIN Functionality  
5.18.3  
Alternative PWM Functionality  
As an alternative routing for the PWM channel (0 or 1) output, the PortB 2 (PTB2) can be configured to output one of the two  
PWM channels defined in the PWM Control Module (PWM8B2C). The selection and output enable can be configured in the Port  
B Configuration Register 2 (PTBC2).  
MM912_634 Advance Information, Rev. 11.0  
113  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
5.18.4  
Register definition  
5.18.4.1  
Port B Configuration Register 1 (PTBC1)  
Table 154. Port B Configuration Register 1 (PTBC1)  
Offset(109) 0x20  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
PUEB2  
0
PUEB1  
0
PUEB0  
0
DDRB2  
0
DDRB1  
0
DDRB0  
0
Reset  
0
0
Note:  
111. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 155. PTBC1 - Register Field Descriptions  
Field  
Description  
Pull-up Enable Port B[2…0]  
6-4  
PUEB[2-0]  
0 - Pull-up disabled on PTBx pin.  
1- Pull-up enabled on PTBx pin.  
Data Direction Port B[2…0]  
0 - PTBx configured as input.  
1 - PTBx configured as output.  
2-0  
DDRB[2-0]  
NOTE  
The pull-up resistor is not active once the port is configured as an output.  
5.18.4.2  
Port B Configuration Register 2 (PTBC2)  
Table 156. Port B Configuration Register 2 (PTBC2)  
Offset(112) 0x21  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
PWMCS  
0
PWMEN  
0
SERMOD  
Reset  
0
0
0
0
0
0
Note:  
112. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
114  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 157. PTBC2 - Register Field Descriptions  
Field  
Description  
PWM Channel Select PTB2. See PWM Control Module (PWM8B2C).  
0 - PWM Channel 0 selected as PWM Channel for PTB2  
1 - PWM Channel 1 selected as PWM Channel for PTB2  
3
PWMCS  
PWM Enable for PTB2. See PWM Control Module (PWM8B2C).  
0 - PWM disabled on PTB2  
2
PWMEN  
1 - PWM enabled on PTB2 (Channel as selected with PWMCS)  
Serial Mode Select for PTB0 and PTB1. See Figure 32 for details.  
00 - Mode 0, SCI internally connected the LIN Physical Layer Interface. PTB0 and PTB1 are Digital I/Os  
01 - Mode 1, SCI connected to PTB0 and PTB1 (external SCI mode)  
1-0  
SERMOD  
10 - Mode 2, LIN Physical Layer Interface connected to PTB0 and PTB1 (external LIN mode)  
11 - Mode 3, SCI internally connected the LIN Physical Layer Interface and PTB0 and PTB1 are connected both as  
outputs (Observe mode)  
5.18.4.3  
Port B Data Register (PTB)  
Table 158. Port B Data Register (PTB)  
Offset(113) 0x22  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
PTB2  
0
PTB1  
0
PTB0  
0
Reset  
0
0
0
0
0
Note:  
113. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 159. PTB - Register Field Descriptions  
Field  
Description  
Port B general purpose input/output data — Data Register  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered  
and synchronized pin input state is read.  
2-0  
PTB[2-0]  
5.19  
Basic Timer Module - TIM (TIM16B4C)  
MCU  
ANALOG  
5.19.1  
Introduction  
5.19.1.1  
Overview  
The basic timer consists of a 16-bit, software-programmable counter driven by a seven-stage programmable prescaler.  
This timer can be used for many purposes, including input waveform measurements while simultaneously generating an output  
waveform. Pulse widths can vary from microseconds to many seconds.  
This timer contains 4 complete input capture/output compare channels [IOC 3:2]. The input capture function is used to detect a  
selected transition edge and record the time. The output compare function is used for generating output signals or for timer  
software delays.  
A full access for the counter registers or the input capture/output compare registers should take place in 16bit word access.  
Accessing high byte and low byte separately for all of these registers may not yield the same result as accessing them in one  
word.  
MM912_634 Advance Information, Rev. 11.0  
115  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.19.1.2  
Features  
The TIM16B4C includes these distinctive features:  
Four input capture/output compare channels.  
Clock prescaler  
16-bit counter  
5.19.1.3  
Modes of Operation  
The TIM16B4C is only active during Normal mode.  
5.19.1.4 Block Diagram  
Channel 0  
Prescaler  
D2D Clock  
Input capture  
Output compare  
IOC0  
Timer overflow  
interrupt  
Channel 1  
16-bit Counter  
Input capture  
IOC1  
Output compare  
Channel 2  
Input capture  
Output compare  
Timer channel 0  
interrupt  
IOC2  
Channel 3  
Registers  
Input capture  
IOC3  
Timer channel 3  
interrupt  
Output compare  
Figure 33. Timer Block Diagram  
For more information see the respective functional descriptions see Section 5.19.4, “Functional Description" of this chapter.  
5.19.2  
Signal Description  
Overview  
5.19.2.1  
The TIM16B4C module is internally connected to the PTB (IOC0, IOC1, IOC2) and to the Rx signal as specified in General  
Purpose I/O - PTB[0…2] (IOC3).  
5.19.2.2  
Detailed Signal Descriptions  
5.19.2.2.1  
IOC3 – Input Capture and Output Compare Channel 3  
This pin serves as input capture or output compare for channel 3 and is internally connected to the Rx signal as specified in  
Alternative SCI / LIN Functionality.  
NOTE  
Since the Rx signal is only available as an input, using the output compare feature for this  
channel would have no effect.  
5.19.2.2.2  
IOC2 – Input Capture and Output Compare Channel 2  
This pin serves as an input capture or output compare for channel 2 and can be routed to the PTB2 general purpose I/O.  
MM912_634 Advance Information, Rev. 11.0  
116  
Freescale Semiconductor  
Functional Description and Application Information  
5.19.2.2.3  
IOC1 – Input Capture and Output Compare Channel 1  
This pin serves as an input capture or output compare for channel 1 and can be routed to the PTB1 general purpose I/O.  
5.19.2.2.4  
IOC0 – Input Capture and Output Compare Channel 0  
This pin serves as an input capture or output compare for channel 0 and can be routed to the PTB0 general purpose I/O.  
NOTE  
For the description of interrupts see Section 5.19.6, “Interrupts".  
5.19.3  
Memory Map and Registers  
Overview  
5.19.3.1  
This section provides a detailed description of all memory and registers.  
5.19.3.2 Module Memory Map  
The memory map for the TIM16B4C module is given below in Table 160.  
Table 160. Module Memory Map  
Offset(109)  
Use  
Access  
0xC0  
0xC1  
0xC2  
0xC3  
0xC4  
0xC5  
0xC6  
0xC7  
0xC8  
0xC9  
0xCA  
0xCB  
0xCC  
0xCD  
0xCE  
0xCF  
0xD0  
0xD1  
0xD2  
0xD3  
0xD4  
Timer Input Capture/Output Compare Select (TIOS)  
Timer Compare Force Register (CFORC)  
Read/Write  
Read/Write(115)  
Read/Write  
Output Compare 3 Mask Register (OC3M)  
Output Compare 3 Data Register (OC3D)  
Timer Count Register (TCNT(hi))  
Read/Write  
Read/Write(116)  
Read/Write(115)  
Read/Write  
Timer Count Register (TCNT(lo))  
Timer System Control Register 1 (TSCR1)  
Timer Toggle Overflow Register (TTOV)  
Read/Write  
Timer Control Register 1 (TCTL1)  
Read/Write  
Timer Control Register 2 (TCTL2)  
Read/Write  
Timer Interrupt Enable Register (TIE)  
Read/Write  
Timer System Control Register 2 (TSCR2)  
Main Timer Interrupt Flag 1 (TFLG1)  
Read/Write  
Read/Write  
Main Timer Interrupt Flag 2 (TFLG2)  
Read/Write  
Timer Input Capture/Output Compare Register 0 (TC0(hi))  
Timer Input Capture/Output Compare Register 0 (TC0(lo))  
Timer Input Capture/Output Compare Register 1 (TC1(hi))  
Timer Input Capture/Output Compare Register 1 (TC1(lo))  
Timer Input Capture/Output Compare Register 2 (TC2(hi))  
Timer Input Capture/Output Compare Register 2 (TC2(lo))  
Timer Input Capture/Output Compare Register 3 (TC3(hi))  
Read/Write(116)  
Read/Write(116)  
Read/Write(116)  
Read/Write(116)  
Read/Write(116)  
Read/Write(116)  
Read/Write(116)  
Note:  
114. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
115. Always read $00.  
116. Write to these registers have no meaning or effect during input capture.  
MM912_634 Advance Information, Rev. 11.0  
117  
Freescale Semiconductor  
 
 
 
 
Functional Description and Application Information  
5.19.3.3  
Register Descriptions  
This section consists of register descriptions in address order. Each description includes a standard register diagram with an  
associated figure number. Details of register bit and field function follow the register diagrams, in bit order.  
5.19.3.3.1  
Timer Input Capture/Output Compare Select (TIOS)  
Table 161. Timer Input Capture/Output Compare Select (TIOS)  
Offset(117) 0xC0  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
IOS3  
0
IOS2  
0
IOS1  
0
IOS0  
0
Reset  
0
0
0
0
Note:  
117. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 162. TIOS - Register Field Descriptions  
Field  
Description  
Input Capture or Output Compare Channel Configuration  
3-0  
IOS[3-0]  
0 - The corresponding channel acts as an input capture.  
1 - The corresponding channel acts as an output compare.  
5.19.3.3.2  
Timer Compare Force Register (CFORC)  
Table 163. Timer Compare Force Register (CFORC)  
Offset(118) 0xC1  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
FOC3  
0
0
FOC2  
0
0
FOC1  
0
0
FOC0  
0
Reset  
0
0
0
0
Note:  
118. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 164. CFORC - Register Field Descriptions  
Field  
Description  
Force Output Compare Action for Channel 3-0  
3-0  
FOC[3-0]  
0 - Force Output Compare Action disabled. Input Capture or Output Compare Channel Configuration  
1 - Force Output Compare Action enabled  
A write to this register with the corresponding (FOC 3:0) data bit(s) set causes the action programmed for output compare on  
channel “n” to occur immediately.The action taken is the same as if a successful comparison had just taken place with the TCn  
register except the interrupt flag does not get set.  
NOTE  
A successful channel 3 output compare overrides any channel 2:0 compares. If forced  
output compare on any channel occurs at the same time as the successful output compare  
then forced output compare action will take precedence and interrupt flag will not get set.  
MM912_634 Advance Information, Rev. 11.0  
118  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.19.3.3.3  
Output Compare 3 Mask Register (OC3M)  
Table 165. Output Compare 3 Mask Register (OC3M)  
Offset(119) 0xC2  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
OC3M3  
0
OC3M2  
0
OC3M1  
0
OC3M0  
0
Reset  
0
0
0
0
Note:  
119. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 166. OC3M - Register Field Descriptions  
Field  
Description  
Output Compare 3 Mask “n” Channel bit  
0 - Does not set the corresponding port to be an output port  
1 - Sets the corresponding port to be an output port when this corresponding TIOS bit is set to be an output compare  
3-0  
OC3M[3-0]  
Setting the OC3Mn (n ranges from 0 to 2) will set the corresponding port to be an output port when the corresponding TIOSn (n  
ranges from 0 to 2) bit is set to be an output compare.  
NOTE  
A successful channel 3 output compare overrides any channel 2:0 compares. For each  
OC3M bit that is set, the output compare action reflects the corresponding OC3D bit.  
5.19.3.3.4  
Output Compare 3 Data Register (OC3D)  
Table 167. Output Compare 3 Data Register (OC3D)  
Offset(120) 0xC3  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
OC3D3  
OC3D2  
OC3D1  
OC3D0  
Reset  
0
0
0
0
0
0
0
0
Note:  
120. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 168. OC3D - Register Field Descriptions  
Field  
Description  
3-0  
Output Compare 3 Data for Channel “n”  
OC3D[3-0]  
NOTE  
A channel 3 output compare will cause bits in the output compare 3 data register to transfer  
to the timer port data register if the corresponding output compare 3 mask register bits are  
set.  
MM912_634 Advance Information, Rev. 11.0  
119  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.19.3.3.5  
Timer Count Register (TCNT)  
Table 169. Timer Count Register (TCNT)  
Offset(121) 0xC4, 0xC5  
Access: User read(anytime)/write (special mode)  
15  
14  
13  
12  
11  
10  
9
8
R
W
tcnt15  
tcnt14  
tcnt13  
tcnt12  
tcnt11  
tcnt10  
tcnt9  
tcnt8  
Reset  
0
0
0
0
0
0
0
0
7
6
5
4
3
2
1
0
R
W
tcnt7  
0
tcnt6  
0
tcnt5  
0
tcnt4  
0
tcnt3  
0
tcnt2  
0
tcnt1  
0
tcnt0  
0
Reset  
Note:  
121. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 170. TCNT - Register Field Descriptions  
Field  
Description  
15-0  
16 Bit Timer Count Register  
tcnt[15-0]  
NOTE  
The 16-bit main timer is an up counter. A full access for the counter register should take  
place in one clock cycle. A separate read/write for high byte and low byte will give a different  
result than accessing them as a word. The period of the first count after a write to the TCNT  
registers may be a different length because the write is not synchronized with the prescaler  
clock.  
5.19.3.3.6  
Timer System Control Register 1 (TSCR1)  
Table 171. Timer System Control Register 1 (TSCR1)  
Offset(122) 0xC6  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
TEN  
0
TFFCA  
0
Reset  
0
0
0
0
0
0
Note:  
122. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
120  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 172. TSCR1 - Register Field Descriptions  
Field  
Description  
Timer Enable  
7
1 = Enables the timer.  
TEN  
0 = Disables the timer. (Used for reducing power consumption).  
Timer Fast Flag Clear All  
1 = For TFLG1 register, a read from an input capture or a write to the output compare channel [TC 3:0] causes the  
corresponding channel flag, CnF, to be cleared.For TFLG2 register, any access to the TCNT register clears the TOF  
flag. Any access to the PACNT registers clears the PAOVF and PAIF bits in the PAFLG register. This has the  
advantage of eliminating software overhead in a separate clear sequence. Extra care is required to avoid accidental  
flag clearing due to unintended accesses.  
4
TFFCA  
0 = Allows the timer flag clearing.  
5.19.3.3.7  
Timer Toggle On Overflow Register 1 (TTOV)  
Table 173. Timer Toggle On Overflow Register 1 (TTOV)  
Offset(123) 0xC7  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
TOV3  
0
TOV2  
0
TOV1  
0
TOV0  
0
Reset  
0
0
0
0
Note:  
123. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 174. TTOV - Register Field Descriptions  
Field  
Description  
Toggle On Overflow Bits  
3-0  
TOV[3-0]  
1 = Toggle output compare pin on overflow feature enabled.  
0 = Toggle output compare pin on overflow feature disabled.  
NOTE  
TOVn toggles output compare pin on overflow. This feature only takes effect when the  
corresponding channel is configured for an output compare mode. When set, an overflow  
toggle on the output compare pin takes precedence over forced output compare events.  
5.19.3.3.8  
Timer Control Register 1 (TCTL1)  
Table 175. Timer Control Register 1 (TCTL1)  
Offset(124) 0xC8  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
OM3  
0
OL3  
0
OM2  
0
OL2  
0
OM1  
0
OL1  
0
OM0  
0
OL0  
0
Reset  
Note:  
124. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
121  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 176. TCTL1 - Register Field Descriptions  
Field  
Description  
7,5,3,1  
OMn  
Output Mode bit  
6,4,2,0  
OLn  
Output Level bit  
NOTE  
These four pairs of control bits are encoded to specify the output action to be taken as a  
result of a successful Output Compare on “n” channel. When either OMn or OLn, the pin  
associated with the corresponding channel becomes an output tied to its IOC. To enable  
output action by the OMn and OLn bits on a timer port, the corresponding bit in OC3M should  
be cleared.  
Table 177. Compare Result Output Action  
OMn  
OLn  
Action  
0
0
1
1
0
1
0
1
Timer disconnected from output pin logic  
Toggle OCn output line  
Clear OCn output line to zero  
Set OCn output line to one  
5.19.3.3.9  
Timer Control Register 2 (TCTL2)  
Table 178. Timer Control Register 2 (TCTL2)  
Offset(125) 0xC9  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
EDG3B  
0
EDG3A  
0
EDG2B  
0
EDG2A  
0
EDG1B  
0
EDG1A  
0
EDG0B  
0
EDG0A  
0
Reset  
Note:  
125. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 179. TCTL2 - Register Field Descriptions  
Field  
Description  
EDGnB,EDGnA Input Capture Edge Control  
These four pairs of control bits configure the input capture edge detector circuits.  
Table 180. Edge Detector Circuit Configuration  
EDGnB  
EDGnA  
Configuration  
0
0
1
1
0
1
0
1
Capture disabled  
Capture on rising edges only  
Capture on falling edges only  
Capture on any edge (rising or falling)  
MM912_634 Advance Information, Rev. 11.0  
122  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.19.3.3.10  
Timer Interrupt Enable Register (TIE)  
Table 181. Timer Interrupt Enable Register (TIE)  
Offset(126) 0xCA  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
C3I  
0
C2I  
0
C1I  
0
C0I  
0
Reset  
0
0
0
0
Note:  
126. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 182. TIE - Register Field Descriptions  
Field  
Description  
Input Capture/Output Compare Interrupt Enable.  
3-0  
C[3-0]I  
1 = Enables corresponding Interrupt flag (CnF of TFLG1 register) to cause a hardware interrupt  
0 = Disables corresponding Interrupt flag (CnF of TFLG1 register) from causing a hardware interrupt  
5.19.3.3.11  
Timer System Control Register 2 (TSCR2)  
Table 183. Timer System Control Register 2 (TSCR2)  
Offset(127) 0xCB  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
TOI  
0
TCRE  
0
PR2  
0
PR1  
0
PR0  
0
Reset  
0
0
0
Note:  
127. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 184. TIE - Register Field Descriptions  
Field  
Description  
Timer Overflow Interrupt Enable  
7
TOI  
1 = Hardware interrupt requested when TOF flag set in TFLG2 register.  
0 = Hardware Interrupt request inhibited.  
TCRE — Timer Counter Reset Enable  
3
1 = Enables Timer Counter reset by a successful output compare on channel 3  
0 = Inhibits Timer Counter reset and counter continues to run.  
TCRE  
3-0  
Timer Prescaler Select  
PR[2:0]  
These three bits select the frequency of the timer prescaler clock derived from the Bus Clock as shown in Table 185.  
NOTE  
This mode of operation is similar to an up-counting modulus counter.  
If register TC3 = $0000 and TCRE = 1, the timer counter register (TCNT) will stay at $0000  
continuously. If register TC3 = $FFFF and TCRE = 1, TOF will not be set when the timer  
counter register (TCNT) is reset from $FFFF to $0000.  
The newly selected prescale factor will not take effect until the next synchronized edge,  
where all prescale counter stages equal zero.  
MM912_634 Advance Information, Rev. 11.0  
123  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 185. Timer Clock Selection  
PR2  
PR1  
PR0  
Timer Clock  
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
D2D Clock / 1  
D2D Clock / 2  
D2D Clock / 4  
D2D Clock / 8  
D2D Clock / 16  
D2D Clock / 32  
D2D Clock / 64  
D2D Clock / 128  
5.19.3.3.12  
Main Timer Interrupt Flag 1 (TFLG1)  
Table 186. Main Timer Interrupt Flag 1 (TFLG1)  
Offset(128) 0xCC  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
C3F  
0
C2F  
0
C1F  
0
C0F  
0
Reset  
0
0
0
0
Note:  
128. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 187. TFLG1 - Register Field Descriptions  
Field  
Description  
Input Capture/Output Compare Channel Flag.  
3-0  
C[3:0]F  
1 = Input Capture or Output Compare event occurred  
0 = No event (Input Capture or Output Compare event) occurred.  
NOTE  
These flags are set when an input capture or output compare event occurs. Flag set on a  
particular channel is cleared by writing a one to that corresponding CnF bit. Writing a zero  
to CnF bit has no effect on its status. When TFFCA bit in TSCR register is set, a read from  
an input capture or a write into an output compare channel will cause the corresponding  
channel flag CnF to be cleared.  
5.19.3.3.13  
Main Timer Interrupt Flag 2 (TFLG2)  
Table 188. Main Timer Interrupt Flag 2 (TFLG2)  
Offset(119) 0xCD  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
TOF  
0
Reset  
0
0
0
0
0
0
0
Note:  
129. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
MM912_634 Advance Information, Rev. 11.0  
124  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 189. TFLG2 - Register Field Descriptions  
Field  
Description  
Timer Overflow Flag  
7
TOF  
1 = Indicates that an Interrupt has occurred (Set when 16-bit free-running timer counter overflows from $FFFF to  
$0000)  
0 = Flag indicates an Interrupt has not occurred.  
NOTE  
The TFLG2 register indicates when an interrupt has occurred. Writing a one to the TOF bit  
will clear it. Any access to TCNT will clear TOF bit of TFLG2 register if the TFFCA bit in  
TSCR register is set.  
5.19.3.3.14  
Timer Input Capture/Output Compare Registers (TC3 - TC0)  
Table 190. Timer Input Capture/Output Compare Register 0 (TC0)  
Offset(130) 0xCE, 0xCF  
Access: User read (anytime)/write (131)  
15  
14  
13  
12  
11  
10  
9
8
R
W
tc0_15  
tc0_14  
tc0_13  
tc0_12  
tc0_11  
tc0_10  
tc0_9  
tc0_8  
Reset  
0
0
0
0
0
0
0
0
7
6
5
4
3
2
1
0
R
W
tc0_7  
0
tc0_6  
0
tc0_5  
0
tc0_4  
0
tc0_3  
0
tc0_2  
0
tc0_1  
0
tc0_0  
0
Reset  
Note:  
130. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
131. TRead anytime. Write anytime for output compare functions Writes to these registers have no effect during input capture.  
Table 191. Timer Input Capture/Output Compare Register 1(TC1)  
Offset(132) 0xD0, 0xD1  
Access: User read (anytime)/write (133)  
15  
14  
13  
12  
11  
10  
9
8
R
tc1_15  
W
tc1_14  
tc1_13  
tc1_12  
tc1_11  
tc1_10  
tc1_9  
tc1_8  
Reset  
0
0
0
0
0
0
0
0
7
6
5
4
3
2
1
0
R
W
tc1_7  
0
tc1_6  
0
tc1_5  
0
tc1_4  
0
tc1_3  
0
tc1_2  
0
tc1_1  
0
tc1_0  
0
Reset  
Note:  
132. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
133. TRead anytime. Write anytime for output compare functions Writes to these registers have no effect during input capture.  
MM912_634 Advance Information, Rev. 11.0  
125  
Freescale Semiconductor  
 
 
 
 
 
 
Functional Description and Application Information  
Table 192. Timer Input Capture/Output Compare Register 2(TC2)  
Offset(134) 0xD2, 0xD3  
Access: User read (anytime)/write (135)  
15  
14  
13  
12  
11  
10  
9
8
R
W
tc2_15  
tc2_14  
tc2_13  
tc2_12  
tc2_11  
tc2_10  
tc2_9  
tc2_8  
Reset  
0
0
0
0
0
0
0
0
7
6
5
4
3
2
1
0
R
W
tc2_7  
0
tc2_6  
0
tc2_5  
0
tc2_4  
0
tc2_3  
0
tc2_2  
0
tc2_1  
0
tc2_0  
0
Reset  
Note:  
134. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
135. TRead anytime. Write anytime for output compare functions Writes to these registers have no effect during input capture.  
Table 193. Timer Input Capture/Output Compare Register 3(TC3)  
Offset(136) 0xD4, 0xD5  
Access: User read (anytime)/write (137)  
15  
14  
13  
12  
11  
10  
9
8
R
tc3_15  
W
tc3_14  
tc3_13  
tc3_12  
tc3_11  
tc3_10  
tc3_9  
tc3_8  
Reset  
0
0
0
0
0
0
0
0
7
6
5
4
3
2
1
0
R
W
tc3_7  
0
tc3_6  
0
tc3_5  
0
tc3_4  
0
tc3_3  
0
tc3_2  
0
tc3_1  
0
tc3_0  
0
Reset  
Note:  
136. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
137. TRead anytime. Write anytime for output compare functions Writes to these registers have no effect during input capture.  
Table 194. TCn - Register Field Descriptions  
Field  
Description  
15-0  
16 Timer Input Capture/Output Compare Registers  
tcn[15-0]  
NOTE  
TRead anytime. Write anytime for output compare function. Writes to these registers have  
no effect during input capture.  
Depending on the TIOS bit for the corresponding channel, these registers are used to latch  
the value of the free-running counter when a defined transition is sensed by the  
corresponding input capture edge detector or to trigger an output action for output compare.  
Read/Write access in byte mode for high byte should takes place before low byte otherwise  
it will give a different result.  
MM912_634 Advance Information, Rev. 11.0  
126  
Freescale Semiconductor  
 
 
 
 
 
 
Functional Description and Application Information  
5.19.4  
Functional Description  
General  
5.19.4.1  
This section provides a complete functional description of the timer TIM16B4C block. Refer to the detailed timer block diagram  
in Figure 34 as necessary.  
D2D Clock  
channel 3 output  
compare  
PR[2:1:0]  
TCRE  
PRESCALER  
CxI  
TCNT(hi):TCNT(lo)  
16-BIT COUNTER  
CxF  
CLEAR COUNTER  
TOF  
TOI  
INTERRUPT  
LOGIC  
TOF  
TE  
CHANNEL 0  
16-BIT COMPARATOR  
TC0  
C0F  
C0F  
CH. 0 CAPTURE  
OM:OL0  
IOC0 PIN  
LOGIC  
IOC0 PIN  
TOV0  
CH. 0 COMPARE  
EDGE  
DETECT  
EDG0A EDG0B  
IOC0  
CHANNEL3  
16-BIT COMPARATOR  
TC3  
C3F  
C3F  
CH.3 CAPTURE  
PA INPUT  
IOC3 PIN  
LOGIC  
OM:OL3  
TOV3  
IOC3 PIN  
CH.3 COMPARE  
EDG3A  
EDG3B  
EDGE  
DETECT  
IOC3  
Figure 34. Detailed Timer Block Diagram  
5.19.4.2  
Prescaler  
The prescaler divides the bus clock by 1, 2, 4, 8, 16, 32, 64, or 128. The prescaler select bits, PR[2:0], select the prescaler divisor.  
PR[2:0] are in the timer system control register 2 (TSCR2).  
5.19.4.3  
Input Capture  
Clearing the I/O (input/output) select bit, IOSn, configures channel n as an input capture channel. The input capture function  
captures the time at which an external event occurs. When an active edge occurs on the pin of an input capture channel, the  
timer transfers the value in the timer counter into the timer channel registers, TCn.  
The minimum pulse width for the input capture input is greater than two bus clocks.  
An input capture on channel n sets the CnF flag. The CnI bit enables the CnF flag to generate interrupt requests.  
MM912_634 Advance Information, Rev. 11.0  
127  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.19.4.4  
Output Compare  
Setting the I/O select bit, IOSn, configures channel n as an output compare channel. The output compare function can generate  
a periodic pulse with a programmable polarity, duration, and frequency. When the timer counter reaches the value in the channel  
registers of an output compare channel, the timer can set, clear, or toggle the channel pin. An output compare on channel n sets  
the CnF flag. The CnI bit enables the CnF flag to generate interrupt requests.  
The output mode and level bits, OMn and OLn, select set, clear, toggle on output compare. Clearing both OMn and OLn  
disconnects the pin from the output logic.  
Setting a force output compare bit, FOCn, causes an output compare on channel n. A forced output compare does not set the  
channel flag.  
A successful output compare on channel 3 overrides output compares on all other output compare channels. The output compare  
3 mask register masks the bits in the output compare 3 data register. The timer counter reset enable bit, TCRE, enables channel  
3 output compares to reset the timer counter. A channel 3 output compare can reset the timer counter even if the IOC3 pin is  
being used as the pulse accumulator input.  
Writing to the timer port bit of an output compare pin does not affect the pin state. The value written is stored in an internal latch.  
When the pin becomes available for general-purpose output, the last value written to the bit appears at the pin.  
5.19.5  
Resets  
5.19.5.1  
General  
The reset state of each individual bit is listed within the Register Description section 5.19.3, “Memory Map and Registers“, which  
details the registers and their bit-fields.  
5.19.6  
Interrupts  
General  
5.19.6.1  
This section describes interrupts originated by the TIM16B4C block. Table 195 lists the interrupts generated by the TIM16B4C to  
communicate with the MCU.  
Table 195. TIM16B4C Interrupts  
Interrupt  
Offset  
Vector  
Priority  
Source  
Description  
C[3:0]F  
TOF  
-
-
-
-
-
-
Timer Channel 3-0  
Timer Overflow  
Active high timer channel interrupts 3-0  
Timer Overflow interrupt  
5.19.6.2  
Description of Interrupt Operation  
The TIM16B4C uses a total of 5 interrupt vectors. The interrupt vector offsets and interrupt numbers are chip dependent. More  
information on interrupt vector offsets and interrupt numbers can be found in Interrupts.  
5.19.6.2.1  
Channel [3:0] Interrupt  
These active high outputs are asserted by the module to request a timer channel 3–0 interrupt, following an input capture or  
output compare event on these channels [3-0]. For the interrupt to be asserted on a specific channel, the enable, CnI bit of TIE  
register should be set. These interrupts are serviced by the system controller.  
5.19.6.2.2  
Timer Overflow Interrupt (TOF)  
This active high output will be asserted by the module to request a timer overflow interrupt, following the timer counter overflow  
when the overflow enable bit (TOI) bit of TFLG2 register is set. This interrupt is serviced by the system controller.  
MM912_634 Advance Information, Rev. 11.0  
128  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.20  
Analog Digital Converter - ADC  
Introduction  
MCU  
ANALOG  
5.20.1  
5.20.1.1  
Overview  
In order to sample the MM912_634 analog die analog sources, a 10-bit resolution successive approximation Analog to Digital  
Converter has been implemented. Controlled by the A/D Control Logic (ADC Wrapper), the Analog Digital Converter allows fast  
and high precision conversions.  
A/D Control Logic  
D2DCLK  
(ADC Wrapper)  
A
Data  
Registers  
DATAA2D  
D
Figure 35. Analog Digital Converter Block Diagram  
5.20.1.2  
Features  
10-bit resolution  
13 µs (typ.), 10-bit Single Sample + Conversion Time  
External ADC2p5 pin with overcurrent protection to filter the analog reference voltage  
Total Error (TE) of ± 5 LSB without offset calibration active  
Integrated selectable offset compensation  
14 + 1 analog channels (AD0…8; ISENSE, TSENSE and VSENSE, VS1SENSE, BANDGAP, plus calibration channel)  
Sequence- and Continuous Conversion Mode with IRQ for Sequence Complete indication  
Dedicated Result register for each channel  
5.20.2  
Modes of Operation  
The Analog Digital Converter Module is active only in normal mode; it is disabled in Sleep and Stop mode.  
5.20.3 External Signal Description  
This section lists and describes the signals that do connect off-chip. Table 196 shows all the pins and their functions that are  
controlled by the Analog Digital Converter Module.  
MM912_634 Advance Information, Rev. 11.0  
129  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 196. ADC - Pin Functions and Priorities  
Pin Function &  
Pin Function  
Pin Name  
I/O  
Description  
after Reset  
Priority  
AGND  
Analog Ground  
-
-
Analog Ground Connection  
-
Analog Digital Converter Regulator Filter Terminal. A capacitor CADC2p5 is  
required for operation.  
ADC2p5  
Analog Regulator  
-
5.20.4  
5.20.4.1  
Memory Map and Register Definition  
Module Memory Map  
Table 197 shows the register map of the Analog Digital Converter Module. All Register addresses given are referenced to the  
D2D interface offset.  
Table 197. Analog Digital Converter Module - Memory Map  
Register /  
Bit 7  
6
5
4
3
2
1
Bit 0  
Offset(138)  
R
W
R
0
0x80  
ACR  
SCIE  
SCF  
CCE  
OCE  
0
ADCRST  
0
PS2  
PS1  
PS0  
2p5CLF  
CCNT3  
CH11  
CCNT2  
CCNT1  
CCNT0  
0x81  
ASR  
W
R
0
0x82  
ACCR (hi)  
CH15  
CH14  
CH12  
CH10  
CH9  
CH8  
W
R
0x83  
ACCR (lo)  
CH7  
CH6  
CH5  
0
CH4  
CH3  
CH2  
CH1  
CC9  
CH0  
CC8  
W
R
CC15  
CC14  
CC12  
CC11  
CC10  
0x84  
ACCSR (hi)  
W
R
CC7  
CC6  
CC5  
CC4  
CC3  
CC2  
CC1  
CC0  
0x85  
ACCSR (lo)  
W
R
ADR0[9:2]  
0x86  
ADR0 (hi)  
W
R
ADR0[1:0]  
0x87  
ADR0 (lo)  
W
R
ADR1[9:2]  
ADR2[9:2]  
ADR3[9:2]  
ADR4[9:2]  
0x88  
ADR1 (hi)  
W
R
ADR1[1:0]  
ADR2[1:0]  
ADR3[1:0]  
0x89  
ADR1 (lo)  
W
R
0x8A  
ADR2 (hi)  
W
R
0x8B  
ADR2 (lo)  
W
R
0x8C  
ADR3 (hi)  
W
R
0x8D  
ADR3 (lo)  
W
R
0x8E  
ADR4 (hi)  
W
MM912_634 Advance Information, Rev. 11.0  
130  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 197. Analog Digital Converter Module - Memory Map (continued)  
Register /  
Offset(138)  
Bit 7  
6
5
4
3
2
1
Bit 0  
R
W
R
ADR4[1:0]  
ADR5[1:0]  
ADR6[1:0]  
ADR7[1:0]  
ADR8[1:0]  
ADR9[1:0]  
0x8F  
ADR4 (lo)  
ADR5[9:2]  
ADR6[9:2]  
ADR7[9:2]  
ADR8[9:2]  
ADR9[9:2]  
ADR10[9:2]  
ADR11[9:2]  
ADR12[9:2]  
0x90  
ADR5 (hi)  
W
R
0x91  
ADR5 (lo)  
W
R
0x92  
ADR6 (hi)  
W
R
0x93  
ADR6 (lo)  
W
R
0x94  
ADR7 (hi)  
W
R
0x95  
ADR7 (lo)  
W
R
0x96  
ADR8 (hi)  
W
R
0x97  
ADR8 (lo)  
W
R
0x98  
ADR9 (hi)  
W
R
0x99  
ADR9 (lo)  
W
R
0x9A  
ADR10 (hi)  
W
R
ADR10[1:0]  
ADR11[1:0]  
ADR12[1:0]  
0x9B  
ADR10 (lo)  
W
R
0x9C  
ADR11 (hi)  
W
R
0x9D  
ADR11 (lo)  
W
R
0x9E  
ADR12 (hi)  
W
R
0x9F  
ADR12 (lo)  
W
R
0xA0  
Reserved  
W
R
0xA1  
Reserved  
W
R
ADR14[9:2]  
0xA2  
ADR14 (hi)  
W
R
ADR14[1:0]  
0xA3  
ADR14 (lo)  
W
MM912_634 Advance Information, Rev. 11.0  
131  
Freescale Semiconductor  
Functional Description and Application Information  
Table 197. Analog Digital Converter Module - Memory Map (continued)  
Register /  
Offset(138)  
Bit 7  
6
5
4
3
2
1
Bit 0  
R
W
R
ADR15[9:2]  
0xA4  
ADR15 (hi)  
ADR15[1:0]  
0xA5  
ADR15 (lo)  
W
Note:  
138. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
5.20.4.2  
Register Definition  
5.20.4.2.1  
ADC Config Register (ACR)  
Table 198. ADC Config Register (ACR)  
Offset(139) 0x80  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
SCIE  
0
CCE  
0
OCE  
0
ADCRST  
0
PS2  
0
PS1  
0
PS0  
0
Reset  
0
Note:  
139. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 199. ACR - Register Field Descriptions  
Field  
Description  
Sequence Complete Interrupt Enable  
0 - Sequence Complete Interrupt Disabled  
1 - Sequence Complete Interrupt Enabled  
7 - SCIE  
Continuous Conversion Enable  
6 - CCE  
5 - OCE  
0 - Continuous Conversion Disabled  
1 - Continuous Conversion Enabled  
Offset Compensation Enable  
0 - Offset Compensation Disabled  
1 - Offset Compensation Enabled. This feature requires the CH15 bit in the ADC Conversion Control Register (ACCR)  
to be set for all conversions  
Analog Digital Converter RESET  
0 - Analog Digital Converter in Normal Operation  
4 - ADCRST  
1 - Analog Digital Converter in Reset Mode. All ADC registers will reset to initial values. The bit has to be cleared to allow  
ADC operation  
ADC Clock Prescaler Select (D2DCLK to ADCCLK divider)  
000 - 10  
001 - 8  
010 - 6  
011 - 4  
100 - 2  
101 - 1  
110 - 1  
111 - 1  
2-0  
PS2…0  
MM912_634 Advance Information, Rev. 11.0  
132  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
NOTE  
ADCRST is strongly recommended to be set during D2D clock frequency changes.  
5.20.4.2.2  
ADC Status Register (ASR)  
Table 200. ADC Status Register (ASR)  
Offset(140) 0x81  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
SCF  
2p5CLF  
0
0
CCNT3  
CCNT2  
CCNT1  
CCNT0  
Reset  
0
0
0
0
1
1
1
1
Note:  
140. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 201. ACR - Register Field Descriptions  
Field  
Description  
7 - SCF  
Sequence Complete Flag. Reading the ADC Status Register (ASR) will clear the Flag.  
ADC Reference Voltage Current Limitation Flag  
6 - 2p5CLF  
3-0  
CCNT3…0  
Conversion Counter Status. The content of CCNT reflects the current channel in conversion and the conversion of CCNT-1  
being complete. The conversion order is CH15, CH0, CH1,..., CH14.  
5.20.4.2.3  
ADC Conversion Control Register (ACCR)  
Table 202. ADC Conversion Control Register (ACCR)  
Offset(141) 0x82 (0x82 and 0x83 for 8-Bit access)  
Access: User read/write  
15  
14  
13  
12  
11  
10  
9
8
7
6
5
4
3
2
1
0
R
W
0
CH15 CH14  
CH12 CH11 CH10 CH9  
CH8  
0
CH7  
0
CH6  
0
CH5  
0
CH4  
0
CH3  
0
CH2  
0
CH1  
0
CH0  
0
Reset  
0
0
0
0
0
0
0
Note:  
141. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 203. ACCR - Register Field Descriptions  
Field  
Description  
Channel Select - If 1, the selected channel is included into the sequence. Writing ACCR will stop the current sequence and  
restart. Writing ACCR=0 will stop the conversion, All CCx flags will be cleared when ACCR is written.Conversion will start  
after write. 16-Bit write operation recommended, writing 8-bit: Only writing the High Byte will start the conversion with  
Channel 15, if selected. Write to the Low Byte will not start a conversion.  
15-0  
CHx  
Measure individual Channels by writing a sequence of one channel. Channel 15 needs to be selected in order to have the  
offset compensation functional.  
MM912_634 Advance Information, Rev. 11.0  
133  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.20.4.2.4  
ADC Conversion Complete Status Register (ACCSR)  
Table 204. ADC Conversion Complete Status Register (ACCSR)  
Offset(142) 0x84 (0x84 and 0x85 for 8-Bit access)  
Access: User read  
15  
14  
13  
12  
11  
10  
9
8
7
6
5
4
3
2
1
0
R
W
CC15 CC14  
0
CC12 CC11 CC10 CC9  
CC8  
CC7  
CC6  
CC5  
CC4  
CC3  
CC2  
CC1  
CC0  
Reset  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Note:  
142. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 205. ACCSR - Register Field Descriptions  
Field  
Description  
Conversion Complete Flag - Indicates the conversion being complete for channel x. Read operation only.16-bit read  
recommended. 8-Bit read will return the current status, no latching will be performed.  
15-0 CCx  
5.20.4.2.5  
ADC Data Result Register x (ADRx)  
Table 206. ADC Data Result Register x (ADRx)  
Offset(143) 0x86+x (0x86 and 0x87 for 8-Bit access)  
Access: User read  
15  
14  
13  
12  
11  
10  
9
8
7
6
5
4
3
2
1
0
R
W
ADRx  
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Note:  
143. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 207. ADRx - Register Field Descriptions  
Field  
Description  
ADC - Channel X left adjusted Result Register. Reading the register will clear the corresponding CCx register in the ACCSR  
register. 16-bit read recommended. 8-Bit read: Reading the low byte will latch the high byte for the next read, reading the  
high byte will clear the cc flag.  
15-6  
ADRx  
5.20.5  
5.20.5.1  
Functional Description  
Analog Channel Definitions  
The following analog Channels are routed to the analog multiplexer:  
Table 208. Analog Channels  
Channel  
Description  
0
1
2
3
4
AD0 - PTB0 Analog Input  
AD1 - PTB1 Analog Input  
AD2 - PTB2 Analog Input  
AD3 - L0 Analog Input  
AD4 - L1 Analog Input  
AD0  
AD1  
AD2  
AD3  
AD4  
MM912_634 Advance Information, Rev. 11.0  
134  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 208. Analog Channels (continued)  
Channel  
Description  
5
6
AD5 - L2 Analog Input  
AD6 - L3 Analog Input  
AD7 - L4 Analog Input  
AD8 - L5 Analog Input  
Current Sense  
AD5  
AD6  
7
AD7  
8
AD8  
9
ISENSE  
VSENSE  
TSENSE  
VS1SENSE  
n.i.  
10  
11  
12  
13  
14  
15  
Voltage Sense  
Temperature Sense  
VS1 Sense  
not implemented  
Bandgap(144)  
BANDGAP  
CAL  
Calibration Reference  
Note:  
144. Internal “bg1p25sleep” reference.  
5.20.5.2  
Automatic Offset Compensation  
To eliminate the Analog Digital Converter Offset, an automatic compensation is implemented. The compensation is based on a  
calibrated voltage reference connected to ADC Channel 15. The reference trim is accomplished by the correct CTRx Register  
content. See MM912_634 - Analog Die Trimming. The reference is factory trimmed to 8 LSB.  
To activate the Offset compensation feature, the OCE bit in the ADC Config Register (ACR) has to be set, and the CH15 has to  
be enabled when starting a new conversion, by writing to the ADC Conversion Control Register (ACCR). The compensation will  
work with single and sequence conversion.  
MCU – IFR (0x0_40C0...0x0_40C3) => CTR0...3  
OCE – Offset Compensation Enable = 1  
ACCR – ADC Conversion Control Register CH15=1 + CHx = 1  
internal  
CH15 is a trimmed  
reference of 8 LSB  
(requires CTRx)  
Sample CH15  
Offset is calculated as  
difference between  
result and 8 LSB  
Sample CHx  
All x  
Adjust CHx Result by  
calculated offset  
Read ADRx after SCF is set  
Figure 36. Automatic Offset Compensation  
MM912_634 Advance Information, Rev. 11.0  
135  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.20.5.3  
Conversion Timing  
The conversion timing is based on the ADCCLK generated by the ADC prescaler (PS) out of the D2DCLK signal. The prescaler  
needs to be configured to have the ADCCLK match the specified fADC clock limits.  
A conversion is divided into the following 27+ clock cycles:  
9 cycle sampling time  
18 cycle remaining conversion time  
A worst case (only channel 14) of 15 clock cycles to count up to the selected channel (15, 0, 1,....14)  
4 cycles between two channels  
Example 1. Single Conversion Channel 10 (VSENSE)  
12c (count up to Ch10) + 9c (sample) + 18c (conversion) = 39 cycles from start to end of conversion.  
Example 2. Sequence of Channel 10 (VSENSE) + Channel 15 (Offset Compensation)  
1c (count) + 9c (sample Ch15) + 18c (conversion Ch15) + 4c (in between) + 0c (count further to Ch10 is performed while  
converting ch15) + 9c (sample) + 18c (conversion) = 59 cycles from start to end of both conversions.  
5.21  
Current Sense Module - ISENSE  
The Current Sense Module is implemented to amplify the voltage drop across an external shunt resistor to  
MCU  
ANALOG  
measure the actual application current using the internal Analog Digital Converter Channel 9. Typical application  
is the motor current in a window lift control module  
.
Imot  
C
G
C  
2
Rfilt  
Cfilt  
P1  
P2  
Qin  
Qin  
Vout  
ADC  
Vin  
Rshunt  
Vin  
P1  
Rfilt  
G
C  
2
Figure 37. Current Sense Module with External Filter Option  
The implementation is based on a switched capacitor solution to eliminate unwanted offset.To fit several application scenarios,  
eight different GAIN setting are implemented.  
MM912_634 Advance Information, Rev. 11.0  
136  
Freescale Semiconductor  
Functional Description and Application Information  
5.21.1  
Register Definition  
5.21.1.1  
Current Sense Register (CSR)  
Table 209. Current Sense Register (CSR)  
Offset(142) 0x3C  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
CSE  
0
CCD  
0
CSGS  
0
Reset  
0
0
0
0
0
Note:  
145. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 210. CSR - Register Field Descriptions  
Field  
Description  
Current Sense Enable Bit  
0 - Current Sense Module Disabled  
1 - Current Sense Module Enabled  
7
CSE  
Input Filter Charge Compensation Disable Bit(146)  
0 - Enabled  
1 - Disabled  
3
CCD  
Current Sense Gain Select - Selects the amplification GAIN for the current sense module  
000 - 7 (typ.)  
001 - 9 (typ.)  
010 - 10 (typ.)  
011 - 12 (typ.)  
100 - 14 (typ.)  
101 - 18 (typ.)  
110 - 24 (typ.)  
111 - 36 (typ.)  
2-0  
CSGS  
Note:  
146. This feature should be used when implementing an external filter to the current sense ISENSEx inputs. In principal an internal charge  
compensation is activated in synch with the conversion to avoid the sample capacitors to be discharged by the external filter.  
5.22  
Temperature Sensor - TSENSE  
To be able to measure the current MM912_634 analog die chip temperature, the TSENSE feature is implemented.  
A constant temperature related gain of TSG can be routed to the internal Analog Digital Converter (Channel 11).  
MCU  
ANALOG  
MM912_634 Advance Information, Rev. 11.0  
137  
Freescale Semiconductor  
 
Functional Description and Application Information  
V
1,984V  
150°C  
Typ.  
2.5  
2.0  
1.5  
1.0  
0,15V  
-50°C  
Typ.  
0.5  
T
-50°C  
0°C  
50°C  
100°C  
150°C  
Figure 38. TSENSE - Graph  
Refer to Analog Digital Converter - ADC for details on the channel selection and analog measurement.  
NOTE  
Due to internal capacitor charging, temperature measurements are valid 200 ms (max) after  
system power up and wake-up.  
5.23  
Supply Voltage Sense - VSENSE  
The reverse battery protected VSENSE pin has been implemented to allow a direct measurement of the Battery  
level voltage. Bypassing the device VSUP capacitor and external reverse battery diode will detect undervoltage  
conditions without delay. A series resistor is required to protect the MM912_634 analog die from fast transients.  
MCU  
ANALOG  
LBI  
RVSENSE  
Prescaler  
RATIOVSENSE  
CH11  
VSENSE  
VS1  
ADC  
VS2  
Figure 39. VSENSE Module  
The voltage present on the VSENSE pin can be routed via an internal divider to the internal Analog Digital Converter or issue an  
interrupt (LBI) to alert the MCU.  
For the interrupt based alert, see Power Supply. For VSENSE measurement using the internal ADC see Analog Digital Converter  
- ADC.  
5.24  
Internal Supply Voltage Sense - VS1SENSE  
In addition to the VSENSE module, the internal VS1 supply can be routed to the analog digital converter as well. See Analog  
Digital Converter - ADC for details on the acquisition.  
MM912_634 Advance Information, Rev. 11.0  
138  
Freescale Semiconductor  
Functional Description and Application Information  
LVI  
RVSENSE  
VSENSE  
VS1  
Prescaler  
RATIOVS1  
CH12  
ADC  
VS2  
Figure 40. VS1Sense Module  
5.25  
Internal Bandgap Reference Voltage Sense - BANDGAP  
The internal reference bandgap voltage “bg1p25sleep” is generated fully independent from the Analog Digital Converter  
reference voltages.  
Measuring(147) the “bg1p25sleep” reference through the ADC-CH14 allows should return a conversion result within ADCH14  
under normal conditions. Any result outside the range would indicate faulty behavior of either the ADC chain or the 2p5sleep  
Bandgap circuity.  
Note:  
147. The maximum allowed sample frequency for Channel 14 is limited to fCH14. Increasing the sample frequency above can result in  
unwanted turn off of the LS drivers due to a false VREG overvoltage.  
5.26  
MM912_634 - Analog Die Trimming  
A trimming option is implemented to increase some device parameter accuracy. As the MM912_634 analog die is  
exclusively combined with a FLASH- MCU, the required trimming values can be calculated during the final test of  
the device, and stored to a fixed position in the FLASH memory. During start-up of the system, the trimming values  
have to be copied into the MM912_634 analog die trimming registers.  
MCU  
ANALOG  
The trimming registers will maintain their content during Low Power mode, Reset will set the default value.  
5.26.1  
Memory Map and Register Definition  
Module Memory Map  
5.26.1.1  
There are four trimming registers implemented (CTR0…CTR3), with CTR2 being reserved for future use. The following table  
shows the registers used.  
Table 211. MM912_634 Analog Die Trimming Registers  
Offset  
Name  
7
6
5
4
3
2
1
0
CTR0  
Trimming Reg 0  
CTR1  
Trimming Reg 1  
CTR2  
Trimming Reg 2  
CTR3  
Trimming Reg 3  
R
W
R
W
R
W
R
W
0xF0  
LINTRE  
LINTR  
WDCTRE  
CTR0_4  
CTR0_3  
WDCTR2  
WDCTR1  
WDCTR0  
BGTRIMU BGTRIMD  
0xF1  
0xF2  
BGTRE  
0
CTR1_6  
0
IREFTRE  
IREFTR2  
IREFTR1  
IREFTR0  
P
N
0
SLPBGTR SLPBG_LOC SLPBGTR SLPBGTR SLPBGTR  
E
K
2
1
0
OFFCTR OFFCTR  
0xF3  
Note:  
OFFCTR1 OFFCTR0  
CTR3_E  
CTR3_2  
CTR3_1  
CTR3_0  
E
2
148. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
At system startup, the trimming information have to be copied from the MCU IFR Flash location to the corresponding MM912_634  
analog die trimming registers. The following table shows the register correlation.  
MM912_634 Advance Information, Rev. 11.0  
139  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 212. MM912_634 - MCU vs. Analog Die Trimming Register Correlation  
Name  
MCU IFR Address  
Analog Offset(149)  
CTR0  
CTR1  
CTR2  
CTR3  
0x0_40C0  
0x0_40C1  
0x0_40C2  
0x0_40C3  
0xF0  
0xF1  
0xF2  
0xF3  
Note:  
149. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
NOTE  
Two word (16-Bit) transfers including CTR2 are recommended at system startup. The IFR  
register has to be enabled for reading (Program Page Index Register (PPAGE))  
NOTE  
To trim the bg1p25sleep there is two steps:  
Step 1: First choose the right trim step by adjusting SLPBGTR[2:0] with SLPBGTRE=1,  
SLPBG_LOCK bit has to stay at 0.  
Step 2: Once the trim value is known, correct SLPBGTR[2:0], SLPBGTRE and  
SLPBG_LOCK bits have to be set at the same time to apply and lock the trim. Once the trim  
is locked, no other trim on the parameter is possible.  
5.26.1.2  
Register Descriptions  
5.26.1.2.1  
Trimming Register 0 (CTR0)  
Table 213. Trimming Register 0 (CTR0)  
Offset(150) 0xF0  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
LINTRE  
0
LINTR  
0
WDCTRE  
0
CTR0_4  
0
CTR0_3  
0
WDCTR2  
0
WDCTR1  
0
WDCTR0  
0
Reset  
Note:  
150. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 214. CTR0 - Register Field Descriptions  
Field  
Description  
LIN trim enable  
0 - no trim can be done  
1- trim can be done by setting LINTR bit  
LIN trim bit  
7
LINTRE  
6
0 - default slope  
LINTR  
1 - adjust the slope  
Watchdog trim enable  
5
0 - no trim can be done  
WDCTRE  
1 - trim can be done by setting WDCTR[2:0] bits  
4
Spare Trim bit 4  
CTR0_4  
MM912_634 Advance Information, Rev. 11.0  
140  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 214. CTR0 - Register Field Descriptions (continued)  
Field  
Description  
3
Spare Trim bit 3  
CTR0_3  
Watchdog clock trim (Trim effect to the 100 kHz Watch dog base clock)  
000: 0%  
001: +5%  
010: +10%  
011: +15%  
100: -20%  
101: -15%  
110: -10%  
111: -5%  
2-0  
WDCTR2…0  
5.26.1.2.2  
Trimming Register 1 (CTR1)  
Table 215. Trimming Register 1 (CTR1)  
Offset(138) 0xF1  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
BGTRE  
0
CTR1_6  
0
BGTRIMUP  
0
BGTRIMDN  
0
IREFTRE  
0
IREFTR2  
0
IREFTR1  
0
IREFTR0  
0
Reset  
Note:  
151. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 216. CTR1 - Register Field Descriptions  
Field  
Description  
Bandgap trim enable  
7
0 - no trim can be done  
BGTRE  
1 - trim can be done by setting BGTRIMUP and BGTRIMDN bits  
Spare Trim Bit  
6
CTR1_6  
Bandgap trim up bit  
0 - default slope  
5
BGTRIMUP  
1 - increase bandgap slope  
Bandgap trim down bit  
0 - default slope  
4
BGTRIMDN  
1 - decrease bandgap slope  
MM912_634 Advance Information, Rev. 11.0  
141  
Freescale Semiconductor  
Functional Description and Application Information  
Table 216. CTR1 - Register Field Descriptions (continued)  
Field  
Description  
Iref trim enable bit  
3
0 - no trim can be done  
IREFTRE  
1 - trim can be done by setting IREFTR[2:0] bits  
Iref trim - This trim is used to adjust the internal zero TC current reference  
000: 0%  
001: +7.6%  
010: +16.43%  
011: +26.83%  
100: -8.54%  
101: -15.75%  
110: -21.79%  
111: 0%  
2-0  
IREFTR2…0  
5.26.1.2.3  
Trimming Register 2 (CTR2)  
Table 217. Trimming Register 2 (CTR2)  
Offset(152) 0xF2  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
0
0
0
SLPBGTRE  
0
SLPBG_LOCK  
0
SLPBGTR2  
0
SLPBGTR1  
0
SLPBGTR0  
0
Reset  
0
0
0
Note:  
152. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 218. CTR2 - Register Field Descriptions  
Field  
Description  
Sleep Bandgap trim enable  
0 no trim can be done  
4
SLPBGTRE  
1 trim lock can be done by setting SLPBGTR[2:0] bits and SLPBG_LOCK bit  
bg1p25sleep trim lock bit  
3
SLPBG_LOCK  
bg1p25sleep trim - This trim is used to adjust the internal sleep mode 1.25 V bandgap used as a reference for the VDD and  
VDDx overvoltage detection.  
000: -12.2% (default)  
001: -8.2%  
010: -4.2%  
2-0  
011: 0%  
SLPBGTR2…0  
100: +4.2%  
101: +8.3%  
110: +12.5%  
111: -12.2% (default)  
MM912_634 Advance Information, Rev. 11.0  
142  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.26.1.2.4  
Trimming Register 3 (CTR3)  
Table 219. Trimming Register 3 (CTR3)  
Offset(153) 0xF3  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
OFFCTRE  
0
OFFCTR2  
0
OFFCTR1  
0
OFFCTR0  
0
CTR3_E  
0
CTR3_2  
0
CTR3_1  
0
CTR3_0  
0
Reset  
Note:  
153. Offset related to 0x0200 for blocking access and 0x300 for non blocking access within the global address space.  
Table 220. CTR3 - Register Field Descriptions  
Field  
Description  
ADC offset compensation voltage trim enable bit  
0 - no trim can be done  
7
OFFCTRE  
1 - trim can be done by setting OFFCTR[2:0] bits  
ADCOFFC trim - This trim is used to adjust the internal ADC offset compensation voltage  
000: 0%  
001: +7.98%  
010: +15.97%  
011: +23.95%  
100: -23.95%  
101: -15.97%  
110: -7.98%  
111: 0%  
6-4  
OFFCTR2…0  
3
Spare Trim enable bit  
Spare Trim bit 2  
Spare Trim bit 1  
Spare Trim bit 0  
CTR3_E  
2
CTR3_2  
1
CTR3_1  
0
CTR3_0  
5.27  
MM912_634 - MCU Die Overview  
MCU  
ANALOG  
5.27.1  
Introduction  
The 9S12I32 micro controller implemented in the MM912_634 is designed as counter part to an analog die, and  
is not being offered as a standalone MCU.  
The 9S12I32 device contains a S12 Central Processing Unit (CPU), offers 64kB of Flash memory and 6.0 kB of system SRAM,  
up to eight general purpose I/Os, an on-chip oscillator and clock multiplier, one Serial Peripheral Interface (SPI), an interrupt  
module and debug capabilities via the on-chip debug module (DBG) in combination with the Background Debug Mode (BDM)  
interface. Additionally there is a die-to-die initiator (D2DI) which represents the communication interface to the companion  
(analog) die.  
MM912_634 Advance Information, Rev. 11.0  
143  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.27.2  
Features  
This section describes the key features of the 9S12I32 micro controller unit.  
5.27.2.1  
Chip-Level Features  
On-chip modules available within the family include the following features:  
S12 CPU core (CPU12_V1)  
Kbyte on-chip flash with ECC  
4.0 kbyte on-chip data flash with ECC  
6.0 kbyte on-chip SRAM  
Phase locked loop (IPLL) frequency multiplier with internal filter  
4–16 MHz amplitude controlled Pierce oscillator  
1.0 MHz internal RC oscillator  
One serial peripheral interface (SPI) module  
On-chip voltage regulator (VREG) for regulation of input supply and all internal voltages  
Die to Die Initiator (D2DI)  
5.27.3  
Module Features  
The following sections provide more details of the modules implemented on the 9S12I64.  
5.27.3.1  
S12 16-Bit Central Processor Unit (CPU)  
S12 CPU is a high-speed 16-bit processing unit:  
Full 16-bit data paths supports efficient arithmetic operation and high-speed math execution  
Includes many single-byte instructions. This allows much more efficient use of ROM space.  
Extensive set of indexed addressing capabilities, including:  
Using the stack pointer as an indexing register in all indexed operations  
Using the program counter as an indexing register in all but auto increment/decrement mode  
Accumulator offsets using A, B, or D accumulators  
Automatic index pre-decrement, pre-increment, post-decrement, and post-increment (by –8 to +8)  
5.27.3.2  
On-Chip Flash with ECC  
On-chip flash memory on the 9S12I64 features the following:  
kbyte of program flash memory  
32 data bits plus 7 syndrome ECC (Error Correction Code) bits allow single bit error correction and double fault  
detection  
Erase sector size 512 bytes  
Automated program and erase algorithm  
User margin level setting for reads  
Protection scheme to prevent accidental program or erase  
4.0 kbyte data flash memory  
16 data bits plus 6 syndrome ECC (Error Correction Code) bits allow single bit error correction and double-bit error  
detection  
Erase sector size 256 bytes  
Automated program and erase algorithm  
User margin level setting for reads  
5.27.3.3  
On-Chip SRAM  
6.0 kBytes of general-purpose RAM  
MM912_634 Advance Information, Rev. 11.0  
144  
Freescale Semiconductor  
Functional Description and Application Information  
5.27.3.4  
Main External Oscillator (XOSC)  
Loop controlled Pierce oscillator using a 4.0 MHz to 16 MHz crystal or resonator  
Current gain control on amplitude output  
Signal with low harmonic distortion  
Low power  
Good noise immunity  
Eliminates need for external current limiting resistor  
Transconductance sized for optimum start-up margin for typical crystals  
5.27.3.5  
Internal RC Oscillator (IRC)  
Trimmable internal reference clock.  
5.27.3.6  
Internal Phase-locked Loop (IPLL)  
Phase-locked loop clock frequency multiplier  
No external components required  
Reference divider and multiplier allow large variety of clock rates  
Automatic bandwidth control mode for low-jitter operation  
Automatic frequency lock detector  
Configurable option to spread spectrum for reduced EMC radiation (frequency modulation)  
Reference clock sources:  
External 4.0 to 16 MHz resonator/crystal (XOSC)  
Internal 1.0 MHz RC oscillator (IRC)  
5.27.3.7  
System Integrity Support  
Power-on reset (POR)  
System reset generation  
Illegal address detection with reset  
Low-voltage detection with interrupt or reset  
Real time interrupt (RTI)  
Computer operating properly (COP) watchdog  
Configurable as window COP for enhanced failure detection  
Initialized out of reset using option bits located in flash memory  
Clock monitor supervising the correct function of the oscillator  
5.27.3.8  
Serial Peripheral Interface Module (SPI)  
Configurable 8 or 16-bit data size  
Full-duplex or single-wire bidirectional  
Double-buffered transmit and receive  
Master or slave mode  
MSB-first or LSB-first shifting  
Serial clock phase and polarity options  
5.27.3.9  
On-Chip Voltage Regulator (VREG)  
Linear voltage regulator with bandgap reference  
Low-voltage detect (LVD) with low-voltage interrupt (LVI)  
Power-on reset (POR) circuit  
Low-voltage reset (LVR)  
5.27.3.10  
Background Debug (BDM)  
Non-intrusive memory access commands  
Supports in-circuit programming of on-chip nonvolatile memory  
MM912_634 Advance Information, Rev. 11.0  
145  
Freescale Semiconductor  
Functional Description and Application Information  
5.27.3.11  
Debugger (DBG)  
Trace buffer with depth of 64 entries  
Three comparators (A, B and C)  
Comparator A compares the full address bus and full 16-bit data bus  
Exact address or address range comparisons  
Two types of comparator matches  
Tagged: This matches just before a specific instruction begins execution  
Force: This is valid on the first instruction boundary after a match occurs  
Four trace modes  
Four stage state sequencer  
5.27.3.12  
Die to Die Initiator (D2DI)  
Up to 2.0 Mbyte/s data rate  
Configurable 4-bit or 8-bit wide data path  
Figure 41 shows 9S12I64 CPU and BDM local address translation to the global memory map. It indicates also the location of the  
internal resources in the memory map. The whole 256 k global memory space is visible through the P-Flash window located in  
the 64 k local memory map located at 0x8000 - 0xBFFF using the PPAGE register.  
MM912_634 Advance Information, Rev. 11.0  
146  
Freescale Semiconductor  
Functional Description and Application Information  
CPU and BDM  
Global Memory Map  
Local Memory Map  
0x0000  
0x0_0000  
Registers  
Registers  
0x0400  
Unimplemented  
D-Flash 4K Bytes  
0x0_2800  
RAM 6K  
0x1400  
Unpaged P-Flash  
Page 0x0C  
0x0_4000  
NVM Resources  
0x2800  
0x4000  
0x0_4400  
D-Flash  
RAM 6K Bytes  
0x0_5400  
NVM Resources  
0x0_8000  
Unimplemented  
Unpaged P-Flash  
Page 0x0D  
0x2_0000  
P-Flash  
4* 16K Pages  
0x8000  
0x3_0000  
Unpaged P-Flash  
0 0 0 0 P3P2P1P0  
PPAGE  
P-Flash window  
0x3_4000  
0xC000  
Unpaged P-Flash  
0x3_8000  
Unpaged P-Flash  
Page 0x0F  
0x3_C000  
0xFFFF  
Unpaged P-Flash  
0x3_FFFF  
Figure 41. 9S12I128 Global Memory Map  
MM912_634 Advance Information, Rev. 11.0  
147  
Freescale Semiconductor  
Functional Description and Application Information  
5.27.4  
Part ID Assignments  
The part ID is located in two 8-bit registers PARTIDH and PARTIDL (addresses 0x001A and 0x001B). The read-only value is a  
unique part ID for each revision of the chip. Table 221 shows the assigned part ID number and Mask Set number.  
The Version ID in Table 221 is a word located in a flash information row. The version ID number indicates a specific version of  
internal NVM controller.  
Table 221. Assigned Part ID Numbers  
Device  
Mask Set Number  
Part ID(154)  
Version ID  
9S12I64  
0N53A  
0x38C0  
0x0000  
Note:  
154. The coding is as follows:  
Bit 15-12: Major family identifier  
Bit 11-6: Minor family identifier  
Bit 5-4: Major mask set revision number including FAB transfers  
Bit 3-0: Minor — non full — mask set revision  
5.27.5  
System Clock Description  
For the system clock description refer to Port Integration Module (S12IPIMV1)”.  
5.27.6  
Modes of Operation  
The MCU can operate in different modes. These are described in Section 5.27.6.1, “Chip Configuration Summary". The MCU  
can operate in different power modes to facilitate power saving when full system performance is not required. These are  
described in Section 5.27.6.2, “Low Power Operation". Some modules feature a software programmable option to freeze the  
module status whilst the background debug module is active to facilitate debugging.  
5.27.6.1  
Chip Configuration Summary  
The different modes and the security state of the MCU affect the debug features (enabled or disabled).  
The operating mode out of reset is determined by the state of the MODC signal during reset (see Table 222). The MODC bit in  
the MODE register shows the current operating mode and provides limited mode switching during operation. The state of the  
MODC signal is latched into this bit on the rising edge of RESET.  
Table 222. Chip Modes  
Chip Modes  
MODC  
Normal single chip  
Special single chip  
1
0
5.27.6.1.1  
Normal Single-Chip Mode  
This mode is intended for normal device operation. The opcode from the on-chip memory is being executed after reset (requires  
the reset vector to be programmed correctly). The processor program is executed from internal memory.  
5.27.6.1.2  
Special Single-Chip Mode  
This mode is used for debugging single-chip operation, boot-strapping, or security related operations. The background debug  
module BDM is active in this mode. The CPU executes a monitor program located in an on-chip ROM. BDM firmware waits for  
additional serial commands through the BKGD pin.  
5.27.6.2  
Low Power Operation  
The MM912_634 has two static low-power modes Pseudo Stop and Stop Mode. For a detailed description refer to S12CPMU  
section.  
MM912_634 Advance Information, Rev. 11.0  
148  
Freescale Semiconductor  
 
 
 
 
 
Functional Description and Application Information  
5.27.7  
Security  
The MCU security mechanism prevents unauthorized access to the Flash memory. Refer to Port Integration Module  
(S12IPIMV1)”, Security, and Security.  
5.27.8  
Resets and Interrupts  
Consult the S12 CPU manual and the S12SINT section for information on exception processing.  
5.27.8.1  
Resets  
Table 223 lists all Reset sources and the vector locations. Resets are explained in detail in the Port Integration Module  
(S12IPIMV1)”.  
Table 223. Reset Sources and Vector Locations  
Vector Address  
Reset Source  
CCR Mask  
Local Enable  
$FFFE  
$FFFE  
$FFFE  
$FFFE  
$FFFC  
$FFFA  
Power-On Reset (POR)  
Low Voltage Reset (LVR)  
External pin RESET  
Illegal Address Reset  
Clock monitor reset  
None  
None  
None  
None  
None  
None  
None  
None  
None  
None  
OSCE Bit in CPMUOSC register  
CR[2:0] in CPMUCOP register  
COP watchdog reset  
5.27.8.2  
Interrupt Vectors  
Table 224 lists all interrupt sources and vectors in the default order of priority. The interrupt module (see Port Integration Module  
(S12IPIMV1)”) provides an interrupt vector base register (IVBR) to relocate the vectors.  
Table 224. Interrupt Vector Locations (Sheet 1 of 2)  
CCR  
Mask  
Wake-up  
from STOP  
Vector Address(155)  
Interrupt Source  
Local Enable  
Vector base + $F8  
Vector base+ $F6  
Vector base+ $F4  
Vector base+ $F2  
Vector base+ $F0  
Unimplemented instruction trap  
SWI  
None  
None  
X Bit  
I bit  
None  
None  
-
-
D2DI Error Interrupt  
D2DI External Error Interrupt  
RTI timeout interrupt  
None  
Yes  
Yes  
D2DCTL (D2DIE)  
CPMUINT (RTIE)  
I bit  
Vector base + $EE  
to  
Reserved  
Vector base + $DA  
Vector base + $D8  
SPI  
I bit  
SPICR1 (SPIE, SPTIE)  
No  
Vector base + $D6  
to  
Reserved  
Vector base + $CA  
Vector base + $C8  
Vector base + $C6  
Oscillator status interrupt  
PLL lock interrupt  
I bit  
I bit  
CPMUINT (OSCIE)  
CPMUINT (LOCKIE)  
No  
No  
Vector base + $C4  
to  
Reserved  
Vector base + $BC  
Vector base + $BA  
Vector base + $B8  
FLASH error  
I bit  
I bit  
FERCNFG (SFDIE, DFDIE)  
FCNFG (CCIE)  
No  
No  
FLASH command  
Vector base + $B6  
to  
Vector base + $8C  
Reserved  
I bit  
Vector base + $8A  
Low-voltage interrupt (LVI)  
CPMUCTRL (LVIE)  
No  
MM912_634 Advance Information, Rev. 11.0  
149  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 224. Interrupt Vector Locations (Sheet 2 of 2) (continued)  
CCR  
Mask  
Wake-up  
from STOP  
Vector Address(155)  
Interrupt Source  
Local Enable  
Vector base + $88  
to  
Reserved  
Vector base + $82  
Vector base + $80  
Spurious interrupt  
None  
-
Note:  
155. 16 bits vector address based  
5.27.8.3  
Effects of Reset  
When a reset occurs, MCU registers and control bits are initialized. Refer to the respective block sections for register reset states.  
On each reset, the Flash module executes a reset sequence to load Flash configuration registers.  
5.27.8.3.1  
Flash Configuration Reset Sequence Phase  
On each reset, the Flash module will hold CPU activity while loading Flash module registers from the Flash memory. If double  
faults are detected in the reset phase, Flash module protection and security may be active on leaving reset. This is explained in  
more detail in the Flash module Initialization.  
5.27.8.3.2  
Reset While Flash Command Active  
If a reset occurs while any Flash command is in progress, that command will be immediately aborted. The state of the word being  
programmed or the sector/block being erased is not guaranteed.  
5.27.8.3.3  
I/O Pins  
Refer to the PIM section for reset configurations of all peripheral module ports.  
5.27.8.3.4  
Memory  
The RAM arrays are not initialized out of reset.  
5.27.9  
COP Configuration  
The COP time-out rate bits CR[2:0] and the WCOP bit in the CPMUCOP register at address 0x003C are loaded from the Flash  
register FOPT. See Table 225 and Table 226 for coding. The FOPT register is loaded from the Flash configuration field byte at  
global address 0x3_FF0E during the reset sequence.  
Table 225. Initial COP Rate Configuration  
NV[2:0] in FOPT Register  
CR[2:0] in COPCTL Register  
000  
001  
010  
011  
100  
101  
110  
111  
111  
110  
101  
100  
011  
010  
001  
000  
MM912_634 Advance Information, Rev. 11.0  
150  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 226. Initial WCOP Configuration  
NV[3] in FOPT Register  
WCOP in COPCTL Register  
1
0
0
1
5.28  
Port Integration Module (S12IPIMV1)  
MCU  
ANALOG  
5.28.1  
Introduction  
The Port Integration Module (PIM) establishes the interface between the 9S12I128 peripheral modules SPI and  
Die-To-Die Interface module (D2DI) to the I/O pins of the MCU.  
All port A and port E pins support general purpose I/O functionality if not in use with other functions. The PIM controls the signal  
prioritization and multiplexing on shared pins.  
MISO  
MOSI  
SCK  
SS  
PA0  
PA1  
PA2  
PA3  
PA4  
PA5  
SPI  
Port Integration Module  
Elements  
Synchronous Serial IF  
PA6  
PA7  
CPMU OSC  
EXTAL  
XTAL  
PE0  
PE1  
D2DCLK  
D2DINT  
PC0  
PC1  
D2DI  
D2DDAT0  
D2DDAT1  
D2DDAT2  
D2DDAT3  
D2DDAT4  
D2DDAT5  
D2DDAT6  
D2DDAT7  
PD0  
PD1  
PD2  
PD3  
PD4  
PD5  
PD6  
PD7  
Die-to-Die IF  
Figure 42. Block Diagram  
5.28.1.1  
Features  
8-pin port A associated with the SPI module  
2-pin port C used as D2DI clock output and D2DI interrupt input  
8-pin port D used as 8 or 4 bit data I/O for the D2DI module  
2-pin port E associated with the CPMU OSC module  
GPIO function shared on port A, E pins  
Pull-down devices on PC1 and PD7-0 if used as D2DI inputs  
Reduced drive capability on PC0 and PD7-0 on per pin basis  
The Port Integration Module includes these distinctive registers:  
Data registers for ports A, E when used as general-purpose I/O  
Data direction registers for ports A, E when used as general-purpose I/O  
Port input register on ports A and E  
Reduced drive register on port C and D  
MM912_634 Advance Information, Rev. 11.0  
151  
Freescale Semiconductor  
Functional Description and Application Information  
5.28.2  
Memory Map and Register Definition  
This section provides a detailed description of all Port Integration Module registers.  
5.28.2.1  
Memory Map  
Register  
Name  
Bit 7  
6
5
4
3
2
1
Bit 0  
PA0  
R
W
R
0x0000  
PORTA  
PA7  
0
PA6  
0
PA5  
0
PA4  
0
PA3  
0
PA2  
0
PA1  
0x0001  
PORTB  
PE1  
PE0  
W
R
0x0002  
DDRA  
DDRA7  
0
DDRA6  
0
DDRA5  
0
DDRA4  
0
DDRA3  
0
DDRA2  
0
DDRA1  
DDRA0  
W
R
0x0003  
DDRB  
DDRE1  
0
DDRE0  
0
W
R
0x0004-  
0x0009  
Reserved  
0
0
0
0
0
0
0
0
W
R
W
R
0
0
0
0
0
0x000C  
PUCR  
BKPUE  
0
PDPEE  
0
0
0
0
0x000D  
RDRIV  
RDPD  
PTIA3  
RDPC  
PTIA2  
W
R
PTIA7  
PTIA6  
PTIA5  
PTIA4  
PTIA1  
PTIE1  
0
PTIA0  
PTIE0  
0
0x0120  
PTIA  
W
R
0
0
0
0
0
0
0
0
0
0
0
0
0x0121  
PTIB  
W
R
0x0122-  
0x17F  
Reserved  
W
= Unimplemented or Reserved  
5.28.2.2  
Port A Data Register (PORTA)  
Table 227. Port A Data Register (PORTA)  
Address 0x0000  
Access: User read/write(156)  
7
6
5
4
3
2
1
0
R
PA7  
PA6  
PA5  
PA4  
PA3  
PA2  
PA1  
PA0  
W
SPI  
Function  
0
0
0
0
SS  
0
SCK  
0
MOSI  
0
MISO  
0
Reset  
Note:  
156. Read: Anytime.  
Write: Anytime.  
MM912_634 Advance Information, Rev. 11.0  
152  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 228. PORTA Register Field Descriptions  
Field  
Description  
Port A general purpose input/output data—Data RegisterIn output mode the register bit is driven to the pin.  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered and  
synchronized pin input state is read.  
7–4  
PA  
Port A general purpose input/output data—Data Register, SPI SS input/output  
When not used with the alternative function, this pin can be used as general purpose I/O.  
In general purpose output mode the register bit is driven to the pin.  
3
PA  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered pin input  
state is read.  
• The SPI function takes precedence over the general purpose I/O function if enabled.  
Port A general purpose input/output data—Data Register, SPI SCK input/output  
When not used with the alternative function, this pin can be used as general purpose I/O.  
In general purpose output mode the register bit is driven to the pin.  
2
PA  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered pin input  
state is read.  
• The SPI function takes precedence over the general purpose I/O function if enabled.  
Port A general purpose input/output data—Data Register, SPI MOSI input/output  
When not used with the alternative function, this pin can be used as general purpose I/O.  
In general purpose output mode the register bit is driven to the pin.  
1
PA  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered pin input  
state is read.  
• The SPI function takes precedence over the general purpose I/O function if enabled.  
Port A general purpose input/output data—Data Register, SPI MISO input/output  
When not used with the alternative function, this pin can be used as general purpose I/O.  
In general purpose output mode the register bit is driven to the pin.  
0
PA  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered pin input  
state is read.  
• The SPI function takes precedence over the general purpose I/O function if enabled.  
5.28.2.3  
Port E Data Register (PORTE)  
Table 229. Port E Data Register (PORTE)  
Address 0x0001  
Access: User read/write(157)  
7
6
5
4
3
2
1
0
R
0
0
0
0
0
0
PE1  
PE0  
W
CPMU  
OSC  
Function  
0
0
0
0
0
0
XTAL  
0
EXTAL  
0
Reset  
Note:  
157. Read: Anytime.  
Write: Anytime.  
MM912_634 Advance Information, Rev. 11.0  
153  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 230. PORTE Register Field Descriptions  
Field  
Description  
Port E general purpose input/output data—Data Register, CPMU OSC XTAL signal  
When not used with the alternative function, this pin can be used as general purpose I/O.  
In general purpose output mode the register bit is driven to the pin.  
1
PE  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered pin input  
state is read.  
• The CPMU OSC function takes precedence over the general purpose I/O function if enabled.  
Port E general purpose input/output data—Data Register, CPMU OSC EXTAL signal  
When not used with the alternative function, this pin can be used as general purpose I/O.  
In general purpose output mode the register bit is driven to the pin.  
0
PE  
If the associated data direction bit of this pin is set to 1, a read returns the value of the port register, otherwise the buffered pin input  
state is read.  
• The CPMU OSC function takes precedence over the general purpose I/O function if enabled.  
5.28.2.4  
Port A Data Direction Register (DDRA)  
Table 231. Port A Data Direction Register (DDRA)  
Address 0x0002  
Access: User read/write(158)  
7
6
5
4
3
2
1
0
R
W
DDRA7  
0
DDRA6  
0
DDRA5  
0
DDRA4  
0
DDRA3  
0
DDRA2  
0
DDRA1  
0
DDRA0  
0
Reset  
Note:  
158. Read: Anytime.  
Write: Anytime.  
Table 232. DDRA Register Field Descriptions  
Field  
Description  
Port A Data Direction— This bit determines whether the associated pin is an input or output.  
1 Associated pin is configured as output.  
7–4  
DDRA  
0 Associated pin is configured as input.  
Port A Data Direction— This bit determines whether the associated pin is an input or output.  
Depending on the configuration of the enabled SPI the I/O state will be forced to input or output. In this case the data direction bits  
will not change.  
3–0  
DDRA  
1 Associated pin is configured as output.  
0 Associated pin is configured as input.  
MM912_634 Advance Information, Rev. 11.0  
154  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.28.2.5  
Port E Data Direction Register (DDRE)  
Table 233. Port E Data Direction Register (DDRE)  
Address 0x0003  
Access: User read/write(159)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
DDRE1  
0
DDRE0  
0
Reset  
0
0
0
0
0
0
Note:  
159. Read: Anytime.  
Write: Anytime.  
Table 234. DDRE Register Field Descriptions  
Field  
Description  
Port E Data Direction— This bit determines whether the associated pin is an input or output. The enabled CPMU OSC function  
connects the associated pins directly to the oscillator module. In this case the data direction bits will not change.  
1–0  
1 Associated pin is configured as output.  
0 Associated pin is configured as input.  
DDRE  
5.28.2.6  
PIM Reserved Registers  
These registers are reserved for factory testing of the PIM module. Writing to these addresses can alter the module functionality.  
Table 235. PIM Reserved Registers  
Address 0x0004-0x0009  
Access: User read(160)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Note:  
160. Read: Always reads 0x00  
Write: Not allowed  
5.28.2.7  
Pull Control Register (PUCR)  
Table 236. Pull Control Register (PUCR)  
Address 0x0124  
Access: User read/write(161)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
BKPUE  
1
PDPEE  
1
Reset  
0
0
0
0
0
0
Note:  
161. Read: Anytime.  
Write: Anytime.  
MM912_634 Advance Information, Rev. 11.0  
155  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 237. PUCR Register Field Descriptions  
Field  
Description  
BKGD pin pull-up Enable—Enable pull-up devices on BKGD pin. This bit configures whether a pull-up device is activated, if the  
pin is used as input. This bit has no effect if the pin is used as output. Out of reset the pull-up device is enabled.  
6
1 Pull-up device enabled.  
0 Pull-up device disabled.  
BKPUE  
Pull-down Port E Enable—Enable pull-down devices on all Port E input pins. This bit configures whether pull-down devices are  
activated, if the pins are used as inputs. This bit has no effect if the pins are used as outputs. Out of reset the pull-down devices  
are enabled. If the CPMU OSC function is active the pull-down devices are disabled. In this case the register bit will not change.  
1
PDPEE  
1 Pull-down devices enabled.  
0 Pull-down devices disabled.  
5.28.2.8  
Reduced Drive Register (RDRIV)  
Table 238. Reduced Drive Register (RDRIV)  
Address 0x000D  
Access: User read/write(162)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
RDPD  
0
RDPC  
0
Reset  
0
0
0
0
0
0
Note:  
162. Read: Anytime.  
Write: Anytime.  
Table 239. RDRIV Register Field Descriptions  
Field  
Description  
Port D reduced driveSelect reduced drive for output pins. This bit configures the drive strength of output pins as either full  
or reduced. If a pin is used as input this bit has no effect.  
3
1 Reduced drive selected (1/5 of the full drive strength)  
0 Full drive strength enabled  
RDPD  
Port C reduced driveSelect reduced drive for D2DCLK output pin. This bit configures the drive strength of D2DCLK output  
pin as either full or reduced.  
2
1 Reduced drive selected (1/5 of the full drive strength)  
0 Full drive strength enabled  
RDPC  
5.28.2.9  
Port A Input Register (PTIA)  
Table 240. Port A Input Register (PTIA)  
Address 0x0120  
Access: User read(163)  
7
6
5
4
3
2
1
0
R
W
PTIA7  
PTIA6  
PTIA5  
PTIA4  
PTIA3  
PTIA2  
PTIA1  
PTIA0  
Reset(164)  
u
u
u
u
u
u
u
u
Note:  
163. Read: Anytime.  
Write: Unimplemented. Writing to this register has no effect.  
164. u = Unaffected by reset  
MM912_634 Advance Information, Rev. 11.0  
156  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 241. PTIA Register Field Descriptions  
Field  
Description  
7–0  
Port A input data— A read always returns the buffered input state of the associated pin.It can be used to detect overload or short  
circuit conditions on output pins.  
PTIA  
5.28.2.10  
Port E Input Register (PTIE)  
Table 242. Port E Input Register (PTIE)  
Address 0x0121  
Access: User read(165)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
PTIE1  
PTIE0  
Reset(166)  
u
u
u
u
u
u
u
u
Note:  
165. Read: Anytime.  
Write: Unimplemented. Writing to this register has no effect.  
166. u = Unaffected by reset  
Table 243. PTIE Register Field Descriptions  
Field  
Description  
1–0  
Port E input data— A read always returns the buffered input state of the associated pin.It can be used to detect overload or short  
circuit conditions on output pins.  
PTIE  
5.28.2.11  
PIM Reserved Registers  
i
Table 244. PIM Reserved Register  
Address 0x0122-0x017F  
Access: User read(167)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
Note:  
167. Read: Anytime.  
Write: Unimplemented. Writing to this register has no effect.  
5.28.3  
Functional Description  
5.28.3.1  
Registers  
5.28.3.1.1  
Data register (PORTx)  
This register holds the value driven out to the pin if the pin is used as a general purpose I/O.  
Writing to this register has only an effect on the pin if the pin is used as general purpose output. When reading this address, the  
buffered and synchronized state of the pin is returned if the associated data direction register bit is set to “0”.  
If the data direction register bits are set to logic level “1”, the contents of the data register is returned. This is independent of any  
other configuration (Figure 43).  
MM912_634 Advance Information, Rev. 11.0  
157  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
5.28.3.1.2  
Data direction register (DDRx)  
This register defines whether the pin is used as an input or an output. If a peripheral module controls the pin the contents of the  
data direction register is ignored (Figure 43).  
5.28.3.1.3  
Input register (PTIx)  
This is a read-only register and always returns the buffered and synchronized state of the pin (Figure 43).  
synch.  
PTIx  
0
1
PIN  
0
PORTx  
1
0
DDRx  
1
data out  
output enable  
Periph.  
port enable  
Module  
data in  
Figure 43. Illustration of I/O Pin Functionality  
5.28.3.1.4  
Reduced Drive Register (RDRIV)  
If the pin is used as an output this register allows the configuration of the drive strength.  
5.28.3.1.5  
Pull Device Enable Register (PUCR)  
This register turns on a pull-up or pull-down device. It becomes active only if the pin is used as an input.  
5.28.3.2  
Ports  
Port A  
5.28.3.2.1  
This port is associated with the SPI. Port A pins PA7-0 can be used for general-purpose I/O and PA3-0 also with the SPI  
subsystem.  
5.28.3.2.2  
Port C  
This port is associated with the D2DI interface. Port C pins PC1-0 can be used as the D2DI interrupt input and D2DI clock output,  
respectively. A pull-down device is enabled on pin PC1 if used as D2DI input.A reduced drive strength can be selected on PC0  
if used as D2DI output. The D2DI interrupt input is synchronized and has an asynchronous bypass in STOP mode to allow the  
generation of a wake-up interrupt.  
5.28.3.2.3  
Port D  
This port is associated with the D2DI interface. Port D pins PD7-0 can be used with the D2DI data I/O. Pull-down devices are  
enabled on all pins if used as D2DI inputs.A reduced drive strength can be selected on all pins if used as D2DI outputs.  
5.28.3.2.4  
Port E  
This port is associated with the CPMU OSC. Port E pins PE1-0 can be used for general-purpose or with the CPMU OSC module.  
MM912_634 Advance Information, Rev. 11.0  
158  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.28.4  
Initialization Information  
5.28.4.1  
Port Data and Data Direction Register writes  
It is not recommended to write PTx and DDRx in a word access. When changing the register pins from inputs to outputs, the data  
may have extra transitions during the write access. Initialize the port data register before enabling the outputs.  
5.29  
Memory Map Control (S12PMMCV1)  
5.29.1  
Introduction  
The S12PMMC module controls the access to all internal memories and peripherals for the CPU12 and S12SBDM module. It  
regulates access priorities and determines the address mapping of the on-chip resources. Figure 44 shows a block diagram of  
the S12PMMC module.  
5.29.1.1  
Glossary  
Table 245. Glossary Of Terms  
Term  
Definition  
Local Addresses  
Address within the CPU12’s Local Address Map (Figure 49)  
Address within the Global Address Map (Figure 49)  
Bus access to an even address.  
Global Address  
Aligned Bus Access  
Misaligned Bus Access  
Bus access to an odd address.  
NS  
Normal Single-chip Mode  
SS  
Special Single-chip Mode  
Unimplemented Address Ranges  
Address ranges which are not mapped to any on-chip resource.  
Program Flash  
P-Flash  
D-Plash  
NVM  
Data Flash  
Non-volatile Memory; P-Flash or D-Flash  
NVM Information Row. Refer to FTMRC Block Guide  
IFR  
5.29.1.2  
Overview  
The S12PMMC connects the CPU12’s and the S12SBDM’s bus interfaces to the MCU’s on-chip resources (memories and  
peripherals). It arbitrates the bus accesses and determines all of the MCU’s memory maps. Furthermore, the S12PMMC is  
responsible for constraining memory accesses on secured devices and for selecting the MCU’s functional mode.  
5.29.1.3  
Features  
The main features of this block are:  
Paging capability to support a global 256 kByte memory address space  
Bus arbitration between the masters CPU12, S12SBDM to different resources.  
MCU operation mode control  
MCU security control  
Separate memory map schemes for each master CPU12, S12SBDM  
Generation of system reset when CPU12 accesses an unimplemented address (i.e., an address which does not belong  
to any of the on-chip modules) in single-chip modes  
MM912_634 Advance Information, Rev. 11.0  
159  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.29.1.4  
Modes of Operation  
The S12PMMC selects the MCU’s functional mode. It also determines the devices behavior in secured and unsecured state.  
5.29.1.4.1  
Functional Modes  
Two functional modes are implements on devices of the S12I product family:  
Normal Single Chip (NS)  
The mode used for running applications.  
Special Single Chip Mode (SS)  
A debug mode which causes the device to enter BDM Active Mode after each reset. Peripherals may also provide  
special debug features in this mode.  
5.29.1.4.2  
Security  
S12I derives can be secured to prohibit external access to the on-chip P-Flash. The S12PMMC module determines the access  
permissions to the on-chip memories in secured and unsecured state.  
5.29.1.5  
Block Diagram  
Figure 44 shows a block diagram of the S12PMMC.  
CPU  
BDM  
MMC  
Address Decoder & Priority  
DBG  
Target Bus Controller  
D-Flash  
P-Flash  
RAM  
Peripherals  
Figure 44. S12PMMC Block Diagram  
External Signal Description  
5.29.2  
The S12PMMC uses two external pins to determine the devices operating mode: RESET and MODC (Table 246) See Device  
User Guide (DUG) for the mapping of these signals to device pins.  
MM912_634 Advance Information, Rev. 11.0  
160  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 246. External System Pins Associated With S12PMMC  
Pin Name  
Pin Functions  
Description  
The RESET pin is used the select the MCU’s operating mode.  
RESET  
(See DUG)  
RESET  
MODC  
(See DUG)  
The MODC pin is captured at the rising edge of the RESET pin. The captured value  
determines the MCU’s operating mode.  
MODC  
5.29.3  
Memory Map and Registers  
Module Memory Map  
5.29.3.1  
A summary of the registers associated with the S12PMMC block is shown in Table 247. Detailed descriptions of the registers and  
bits are given in the subsections that follow.  
Table 247. MMC Register Summary  
Register  
Address  
Bit 7  
6
5
4
3
2
1
Bit 0  
Name  
0x000A  
R
W
R
0
0
0
0
0
0
0
0
Reserved  
0x000B  
0x0010  
0x0011  
0x0012  
0x0013  
0x0014  
0x0015  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
MODE  
Reserved  
DIRECT  
Reserved  
Reserved  
Reserved  
PPAGE  
MODC  
0
W
R
W
R
DP15  
0
DP14  
0
DP13  
0
DP12  
0
DP11  
0
DP10  
0
DP9  
0
DP8  
0
W
R
W
R
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
W
R
W
R
PIX3  
PIX2  
PIX1  
PIX0  
W
= Unimplemented or Reserved  
MM912_634 Advance Information, Rev. 11.0  
161  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
5.29.3.2  
Register Descriptions  
This section consists of the S12PMMC control register descriptions in address order.  
5.29.3.2.1  
Mode Register (MODE)  
Table 248. Mode Register (MODE)  
Address: 0x000B  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
MODC  
Reset  
MODC(168)  
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Note:  
168. External signal (see Table 246).  
Read: Anytime.  
Write: Only if a transition is allowed (see Figure 45).  
The MODC bit of the MODE register is used to select the MCU’s operating mode.  
Table 249. MODE Field Descriptions  
Field  
Description  
Mode Select Bit — This bit controls the current operating mode during RESET high (inactive). The external mode pin MODC  
determines the operating mode during RESET low (active). The state of the pin is registered into the respective register bit  
after the RESET signal goes inactive (see Figure 45).  
Write restrictions exist to disallow transitions between certain modes. Figure 45 illustrates all allowed mode changes.  
Attempting non authorized transitions will not change the MODE bit, but it will block further writes to the register bit except in  
special modes.  
7
MODC  
Write accesses to the MODE register are blocked when the device is secured.  
RESET  
1
0
Special  
Single-Chip  
(SS)  
Normal  
Single-Chip  
(NS)  
1
0
1
Figure 45. Mode Transition Diagram When MCU is Unsecured  
MM912_634 Advance Information, Rev. 11.0  
162  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.29.3.2.2  
Direct Page Register (DIRECT)  
Table 250. Direct Register (DIRECT)  
Address: 0x0011  
7
6
5
4
3
2
1
0
R
W
DP15  
0
DP14  
0
DP13  
0
DP12  
0
DP11  
0
DP10  
0
DP9  
0
DP8  
0
Reset  
Read: Anytime  
Write: anytime in special SS, write-one in NS.  
This register determines the position of the 256 Byte direct page within the memory map.It is valid for both global and local  
mapping scheme.  
Table 251. DIRECT Field Descriptions  
Field  
Description  
7–0  
DP[15:8]  
Direct Page Index Bits 15–8 — These bits are used by the CPU when performing accesses using the direct addressing mode.  
These register bits form bits [15:8] of the local address (see Figure 46).  
Bit0  
Bit15  
Bit8  
Bit7  
DP [15:8]  
CPU Address [15:0]  
Figure 46. DIRECT Address Mapping  
Example 1. This example demonstrates usage of the Direct Addressing Mode  
MOVB  
LDY  
#$80,DIRECT  
;Set DIRECT register to 0x80. Write once only.  
;Global data accesses to the range 0xXX_80XX can be direct.  
;Logical data accesses to the range 0x80XX are direct.  
<$00  
;Load the Y index register from 0x8000 (direct access).  
;< operator forces direct access on some assemblers but in  
;many cases assemblers are “direct page aware” and can  
;automatically select direct mode.  
MM912_634 Advance Information, Rev. 11.0  
163  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.29.3.2.3  
Program Page Index Register (PPAGE)  
Table 252. Program Page Index Register (PPAGE)  
Address: 0x0015  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
PIX3  
1
PIX2  
1
PIX1  
1
PIX0  
0
Reset  
0
0
0
0
Read: Anytime  
Write: Anytime  
These four index bits are used to map 16 kB blocks into the Flash page window located in the local (CPU or BDM) memory map  
from address 0x8000 to address 0xBFFF (see Figure 47). This supports accessing up to 256 kB of Flash (in the Global map)  
within the 6 kB Local map. The PPAGE index register is effectively used to construct paged Flash addresses in the Local map  
format. The CPU has special access to read and write this register directly during execution of CALL and RTC instructions.  
Global Address [17:0]  
Bit17  
Bit0  
Bit14 Bit13  
PPAGE Register [3:0]  
Address [13:0]  
Address: CPU Local Address  
or BDM Local Address  
Figure 47. PAGE Address Mapping  
NOTE  
Writes to this register using the special access of the CALL and RTC instructions will be  
complete before the end of the instruction execution.  
Table 253. PPAGE Field Descriptions  
Field  
Description  
3–0  
PIX[3:0]  
Program Page Index Bits 3–0 — These page index bits are used to select which of the 256 P-Flash or ROM array pages is to  
be accessed in the Program Page Window.  
The fixed 16 kB page from 0x0000 to 0x3FFF is the page number 0x0C. Parts of this page are covered by Registers, D-Flash  
and RAM space. See SoC Guide for details.  
The fixed 16 kB page from 0x4000–0x7FFF is the page number 0x0D.  
The reset value of 0x0E ensures that there is linear Flash space available between addresses 0x0000 and 0xFFFF out of reset.  
The fixed 16 kB page from 0xC000-0xFFFF is the page number 0x0F.  
5.29.4  
Functional Description  
The S12PMMC block performs several basic functions of the S12I sub-system operation: MCU operation modes, priority control,  
address mapping, select signal generation and access limitations for the system. Each aspect is described in the following  
subsections.  
MM912_634 Advance Information, Rev. 11.0  
164  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.29.4.1  
MCU Operating Modes  
Normal single chip mode  
This is the operation mode for running application code. There is no external bus in this mode.  
Special single chip mode  
This mode is generally used for debugging operation, boot-strapping or security related operations. The active  
background debug mode is in control of the CPU code execution and the BDM firmware is waiting for serial commands  
sent through the BKGD pin.  
5.29.4.2  
Memory Map Scheme  
5.29.4.2.1  
CPU and BDM Memory Map Scheme  
The BDM firmware lookup tables and BDM register memory locations share addresses with other modules; however they are not  
visible in the memory map during user’s code execution. The BDM memory resources are enabled only during the READ_BD  
and WRITE_BD access cycles to distinguish between accesses to the BDM memory area and accesses to the other modules.  
(Refer to BDM Block Guide for further details).  
When the MCU enters active BDM mode, the BDM firmware lookup tables and the BDM registers become visible in the local  
memory map in the range 0xFF00-0xFFFF (global address 0x3_FF00 - 0x3_FFFF) and the CPU begins execution of firmware  
commands or the BDM begins execution of hardware commands. The resources which share memory space with the BDM  
module will not be visible in the memory map during active BDM mode.  
Note: after the MCU enters active BDM mode the BDM firmware lookup tables and the BDM registers will also be visible between  
addresses 0xBF00 and 0xBFFF if the PPAGE register contains value of 0x0F.  
5.29.4.2.1.1  
Expansion of the Local Address Map  
Expansion of the CPU Local Address Map  
The program page index register in S12PMMC allows accessing up to 256 kB of P-Flash in the global memory map by using the  
four index bits (PPAGE[3:0]) to page 16x16 kB blocks into the program page window located from address 0x8000 to address  
0xBFFF in the local CPU memory map.  
The page value for the program page window is stored in the PPAGE register. The value of the PPAGE register can be read or  
written by normal memory accesses as well as by the CALL and RTC instructions (see Section 5.29.6.1, “CALL and RTC  
Instructions").  
Control registers, vector space and parts of the on-chip memories are located in unpaged portions of the 64 kB local CPU address  
space.  
The starting address of an interrupt service routine must be located in unpaged memory unless the user is certain that the PPAGE  
register will be set to the appropriate value when the service routine is called. However an interrupt service routine can call other  
routines that are in paged memory. The upper 16 kB block of the local CPU memory space (0xC000–0xFFFF) is unpaged. It is  
recommended that all reset and interrupt vectors point to locations in this area or to the other unmapped pages sections of the  
local CPU memory map.  
Expansion of the BDM Local Address Map  
PPAGE and BDMPPR register is also used for the expansion of the BDM local address to the global address. These registers  
can be read and written by the BDM.  
The BDM expansion scheme is the same as the CPU expansion scheme.  
The four BDMPPR Program Page index bits allow access to the full 256 kB address map that can be accessed with 18 address  
bits.  
The BDM program page index register (BDMPPR) is used only when the feature is enabled in BDM and, in the case the CPU is  
executing a firmware command which uses CPU instructions, or by a BDM hardware commands. See the BDM Block Guide for  
further details. (see Figure 48).  
MM912_634 Advance Information, Rev. 11.0  
165  
Freescale Semiconductor  
Functional Description and Application Information  
BDM HARDWARE COMMAND  
Global Address [17:0]  
Bit14 Bit13  
Bit17  
Bit0  
BDMPPR Register [3:0]  
BDM Local Address [13:0]  
BDM FIRMWARE COMMAND  
Global Address [17:0]  
Bit17  
Bit0  
Bit14 Bit13  
BDMPPR Register [3:0]  
Figure 48. BDMPPR Address Mapping  
CPU Local Address [13:0]  
MM912_634 Advance Information, Rev. 11.0  
166  
Freescale Semiconductor  
Functional Description and Application Information  
CPU and BDM  
Global Memory Map  
Local Memory Map  
0x0000  
0x0_0000  
REGISTERS  
REGISTERS  
0x0400  
Unimplemented Area  
D-Flash  
0x1400  
RAM_LOW  
RAM  
Unpaged P-Flash  
0x0_4000  
0x0_4400  
NVM Resources  
D-Flash  
RAM  
0x0_5400  
NVM Resources  
0x4000  
0x0_8000  
Unpaged P-Flash  
P-Flash  
10 *16K paged  
0x8000  
0x3_0000  
Unpaged P-Flash  
or  
0 0 0 0  
P3P2P1  
P0  
Unpaged P-Flash  
Unpaged P-Flash  
P-Flash window  
PPAGE  
0x3_4000  
0x3_8000  
0xC000  
Unpaged P-Flash  
Unpaged P-Flash  
Unpaged P-Flash  
0x3_C000  
0x3_FFFF  
0xFFFF  
Figure 49. Local to Global Address Mapping  
MM912_634 Advance Information, Rev. 11.0  
167  
Freescale Semiconductor  
Functional Description and Application Information  
Implemented Memory in the System Memory Architecture  
5.29.5  
Each memory can be implemented in its maximum allowed size. But some devices have been defined for smaller sizes, which  
means less implemented pages. All non implemented pages are called unimplemented areas.  
Registers has a fixed size of 1.0 kB, accessible via xbus0.  
SRAM has a maximum size of 11 kB, accessible via xbus0.  
D-Flash has a fixed size of 4.0 kB accessible via xbus0.  
P-Flash has a maximum size of 224 kB, accessible via xbus0.  
NVM resources (IFR, Scratch-RAM, ROM) including D-Flash have maximum size of 16 kB (PPAGE 0x01).  
5.29.5.0.1  
Implemented Memory Map  
The global memory spaces reserved for the internal resources (RAM, D-Flash, and P-Flash) are not determined by the MMC  
module. Size of the individual internal resources are however fixed in the design of the device cannot be changed by the user.  
Refer to the SoC Guide for further details. Figure 50 and Table 254 show the memory spaces occupied by the on-chip resources.  
Note: the memory spaces have fixed top addresses.  
Table 254. Global Implemented Memory Space  
Internal Resource  
Bottom Address  
Top Address  
Registers  
0x0_0000  
0x0_03FF  
RAM_LOW =  
System RAM  
D-Flash  
0x0_3FFF  
0x0_53FF  
0x3_FFFF  
0x0_4000 minus RAMSIZE(169)  
0x0_4400  
PF_LOW =  
0x4_0000 minus FLASHSIZE(170)  
P-Flash  
Note:  
169. RAMSIZE is the hexadecimal value of RAM SIZE in bytes  
170. FLASHSIZE is the hexadecimal value of FLASH SIZE in bytes  
In single-chip modes accesses by the CPU12 (except for firmware commands) to any of the unimplemented areas (see  
Figure 50) will result in an illegal access reset (system reset). BDM accesses to the unimplemented areas are allowed but the  
data will be undefined.  
No misaligned word access from the BDM module will occur; these accesses are blocked in the BDM module (Refer to BDM  
Block Guide).  
MM912_634 Advance Information, Rev. 11.0  
168  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
CPU and BDM  
Global Memory Map  
Local Memory Map  
0x0000  
REGISTERS  
0x0_0000  
REGISTERS  
0x0400  
D-Flash  
Unimplemented Area  
0x1400  
RAM_LOW  
Unpaged P-Flash  
RAM  
0x0_4000  
0x0_4400  
NVM Resources  
D-Flash  
RAM  
0x0_5400  
NVM Resources  
0x4000  
0x0_8000  
Unpaged P-Flash  
Unimplemented area  
0x8000  
0 0 0 0  
P3P2P1  
P0  
P-Flash window  
PPAGE  
PF_LOW  
0xC000  
P-Flash  
Unpaged P-Flash  
0xFFFF  
0x3_FFFF  
Figure 50. Implemented Global Address Mapping  
5.29.5.1  
Chip Bus Control  
The S12PMMC controls the address buses and the data buses that interface the bus masters (CPU12, S12SBDM) with the rest  
of the system (master buses). In addition the MMC handles all CPU read data bus swapping operations. All internal resources  
are connected to specific target buses (see Figure 51).  
MM912_634 Advance Information, Rev. 11.0  
169  
Freescale Semiconductor  
Functional Description and Application Information  
DBG  
CPU  
BDM  
S12X1  
S12X0  
MMC “Crossbar Switch”  
XBUS0  
BDM  
IPBI  
Peripherals  
P-Flash  
SRAM  
D-Flash  
resources  
Figure 51. S12I Platform  
5.29.5.1.1  
Master Bus Prioritization regarding Access Conflicts on Target Buses  
The arbitration scheme allows only one master to be connected to a target at any given time. The following rules apply when  
prioritizing accesses from different masters to the same target bus:  
CPU12 always has priority over BDM.  
BDM has priority over CPU12 when its access is stalled for more than 128 cycles. In the later case the CPU will be  
stalled after finishing the current operation and the BDM will gain access to the bus.  
5.29.5.2  
Interrupts  
The MMC does not generate any interrupts.  
5.29.6  
Initialization/Application Information  
CALL and RTC Instructions  
5.29.6.1  
CALL and RTC instructions are uninterruptable CPU instructions that automate page switching in the program page window. The  
CALL instruction is similar to the JSR instruction, but the subroutine that is called can be located anywhere in the local address  
space or in any Flash or ROM page visible through the program page window. The CALL instruction calculates and stacks a  
return address, stacks the current PPAGE value and writes a new instruction-supplied value to the PPAGE register. The PPAGE  
value controls which of the 256 possible pages is visible through the 16 kbyte program page window in the 64 kbyte local CPU  
memory map. Execution then begins at the address of the called subroutine.  
During the execution of the CALL instruction, the CPU performs the following steps:  
1. Writes the current PPAGE value into an internal temporary register and writes the new instruction-supplied PPAGE  
value into the PPAGE register  
2. Calculates the address of the next instruction after the CALL instruction (the return address) and pushes this 16-bit value  
onto the stack  
3. Pushes the temporarily stored PPAGE value onto the stack  
4. Calculates the effective address of the subroutine, refills the queue and begins execution at the new address  
This sequence is uninterruptable. There is no need to inhibit interrupts during the CALL instruction execution. A CALL instruction  
can be performed from any address to any other address in the local CPU memory space.  
The PPAGE value supplied by the instruction is part of the effective address of the CPU. For all addressing mode variations  
(except indexed-indirect modes) the new page value is provided by an immediate operand in the instruction. In indexed-indirect  
variations of the CALL instruction a pointer specifies memory locations where the new page value and the address of the called  
MM912_634 Advance Information, Rev. 11.0  
170  
Freescale Semiconductor  
Functional Description and Application Information  
subroutine are stored. Using indirect addressing for both the new page value and the address within the page allows usage of  
values calculated at run time rather than immediate values that must be known at the time of assembly.  
5.30  
Interrupt Module (S12SS12IPIMV1V1)  
5.30.1  
Introduction  
The S12IPIMV1 module decodes the priority of all system exception requests and provides the applicable vector for processing  
the exception to the CPU. The S12IPIMV1 module supports:  
I bit and X bit maskable interrupt requests  
A non-maskable unimplemented op-code trap  
A non-maskable software interrupt (SWI) or background debug mode request  
Three system reset vector requests  
A spurious interrupt vector  
Each of the I bit maskable interrupt requests is assigned to a fixed priority level.  
5.30.1.1 Glossary  
Table 255 contains terms and abbreviations used in the document.  
Table 255. Terminology  
Term  
Meaning  
CCR  
ISR  
Condition Code Register (in the CPU)  
Interrupt Service Routine  
MCU  
Micro-Controller Unit  
5.30.1.2  
Features  
Interrupt vector base register (IVBR)  
One spurious interrupt vector (at address vector base(171) + 0x0080).  
2–58 I bit maskable interrupt vector requests (at addresses vector base + 0x0082–0x00F2).  
I bit maskable interrupts can be nested.  
One X bit maskable interrupt vector request (at address vector base + 0x00F4).  
One non-maskable software interrupt request (SWI) or background debug mode vector request (at address vector base  
+ 0x00F6).  
One non-maskable unimplemented op-code trap (TRAP) vector (at address vector base + 0x00F8).  
Three system reset vectors (at addresses 0xFFFA–0xFFFE).  
Determines the highest priority interrupt vector requests, drives the vector to the bus on CPU request  
Wakes up the system from stop mode when an appropriate interrupt request occurs.  
Note:  
171. The vector base is a 16-bit address which is accumulated from the contents of the interrupt vector base register (IVBR, used as upper  
byte) and 0x00 (used as lower byte).  
5.30.1.3  
Modes of Operation  
Run mode  
This is the basic mode of operation.  
Stop Mode  
In stop mode, the clock to the S12IPIMV1 module is disabled. The S12IPIMV1 module is however capable of waking-up  
the CPU from stop mode if an interrupt occurs. Refer to Section 5.30.5.3, “Wake-up from Stop Mode" for details.  
Freeze mode (BDM active)  
In freeze mode (BDM active), the interrupt vector base register is overridden internally. Refer to Section 5.30.3.1.1,  
“Interrupt Vector Base Register (IVBR)" for details.  
MM912_634 Advance Information, Rev. 11.0  
171  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.30.1.4  
Block Diagram  
Figure 52 shows a block diagram of the S12IPIMV1 module.  
Peripheral  
Interrupt Requests  
Wake-up  
CPU  
Vector  
Address  
Non I bit Maskable Channels  
I bit Maskable Channels  
IVBR  
Interrupt  
Requests  
Figure 52. S12IPIMV1 Block Diagram  
5.30.2  
External Signal Description  
The S12IPIMV1 module has no external signals.  
5.30.3  
Memory Map and Register Definition  
This section provides a detailed description of all registers accessible in the S12IPIMV1 module.  
5.30.3.1  
Register Descriptions  
This section describes in address order all the S12IPIMV1 registers and their individual bits.  
5.30.3.1.1  
Interrupt Vector Base Register (IVBR)  
Table 256. Interrupt Vector Base Register (IVBR)  
Address: 0x001F  
7
6
5
4
3
2
1
0
R
W
IVB_ADDR[7:0]  
Reset  
1
1
1
1
1
1
1
1
Read: Anytime  
Write: Anytime  
Table 257. IVBR Field Descriptions  
Field  
Description  
Interrupt Vector Base Address Bits — These bits represent the upper byte of all vector addresses. Out of reset these bits  
are set to 0xFF (i.e., vectors are located at 0xFF80–0xFFFE) to ensure compatibility to HCS12.  
Note: A system reset will initialize the interrupt vector base register with “0xFF” before it is used to determine the reset  
vector address. Therefore, changing the IVBR has no effect on the location of the three reset vectors  
(0xFFFA–0xFFFE).  
7–0  
IVB_ADDR[7:0]  
Note: If the BDM is active (i.e., the CPU is in the process of executing BDM firmware code), the contents of IVBR are  
ignored and the upper byte of the vector address is fixed as “0xFF”. This is done to enable handling of all  
non-maskable interrupts in the BDM firmware.  
MM912_634 Advance Information, Rev. 11.0  
172  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.30.4  
Functional Description  
The S12IPIMV1 module processes all exception requests to be serviced by the CPU module. These exceptions include interrupt  
vector requests and reset vector requests. Each of these exception types and their overall priority level is discussed in the  
subsections below.  
5.30.4.1  
S12S Exception Requests  
The CPU handles both reset requests and interrupt requests. A priority decoder is used to evaluate the priority of pending  
interrupt requests.  
5.30.4.2  
Interrupt Prioritization  
The S12IPIMV1 module contains a priority decoder to determine the priority for all interrupt requests pending for the CPU. If more  
than one interrupt request is pending, the interrupt request with the higher vector address wins the prioritization.  
The following conditions must be met for an I bit maskable interrupt request to be processed.  
1. The local interrupt enabled bit in the peripheral module must be set.  
2. The I bit in the condition code register (CCR) of the CPU must be cleared.  
3. There is no SWI, TRAP, or X bit maskable request pending.  
NOTE  
All non I bit maskable interrupt requests always have higher priority than the I bit maskable  
interrupt requests. If the X bit in the CCR is cleared, it is possible to interrupt an I bit  
maskable interrupt by an X bit maskable interrupt. It is possible to nest non maskable  
interrupt requests, e.g., by nesting SWI or TRAP calls.  
Since an interrupt vector is only supplied at the time when the CPU requests it, it is possible that a higher priority interrupt request  
could override the original interrupt request that caused the CPU to request the vector. In this case, the CPU will receive the  
highest priority vector and the system will process this interrupt request first, before the original interrupt request is processed.  
If the interrupt source is unknown (for example, in the case where an interrupt request becomes inactive after the interrupt has  
been recognized, but prior to the CPU vector request), the vector address supplied to the CPU will default to that of the spurious  
interrupt vector.  
NOTE  
Care must be taken to ensure that all interrupt requests remain active until the system  
begins execution of the applicable service routine; otherwise, the exception request may not  
get processed at all or the result may be a spurious interrupt request (vector at address  
(vector base + 0x0080)).  
5.30.4.3  
Reset Exception Requests  
The S12IPIMV1 module supports three system reset exception request types (refer to the Clock and Reset generator module for  
details):  
1. Pin reset, power-on reset or illegal address reset, low voltage reset (if applicable)  
2. Clock monitor reset request  
3. COP watchdog reset request  
5.30.4.4  
Exception Priority  
The priority (from highest to lowest) and address of all exception vectors issued by the S12IPIMV1 module upon request by the  
CPU is shown in Table 258.  
Table 258. Exception Vector Map and Priority  
Vector Address(172)  
Source  
0xFFFE  
0xFFFC  
Pin reset, power-on reset, illegal address reset, low voltage reset (if applicable)  
Clock monitor reset  
0xFFFA  
COP watchdog reset  
(Vector base + 0x00F8)  
(Vector base + 0x00F6)  
Unimplemented opcode trap  
Software interrupt instruction (SWI) or BDM vector request  
MM912_634 Advance Information, Rev. 11.0  
173  
Freescale Semiconductor  
 
Functional Description and Application Information  
Source  
Table 258. Exception Vector Map and Priority (continued)  
Vector Address(172)  
(Vector base + 0x00F4)  
(Vector base + 0x00F2)  
X bit maskable interrupt request (XIRQ or D2D error interrupt)(173)  
IRQ or D2D interrupt request(174)  
Device specific I bit maskable interrupt sources (priority determined by the low byte of the vector address,  
in descending order)  
(Vector base + 0x00F0–0x0082)  
(Vector base + 0x0080)  
Spurious interrupt  
Note:  
172. 16 bits vector address based  
173. D2D error interrupt on MCUs featuring a D2D initiator module, otherwise XIRQ pin interrupt  
174. D2D interrupt on MCUs featuring a D2D initiator module, otherwise IRQ pin interrupt  
5.30.5  
Initialization/Application Information  
Initialization  
5.30.5.1  
After system reset, software should:  
1. Initialize the interrupt vector base register if the interrupt vector table is not located at the default location  
(0xFF80–0xFFF9).  
2. Enable I bit maskable interrupts by clearing the I bit in the CCR.  
3. Enable the X bit maskable interrupt by clearing the X bit in the CCR.  
5.30.5.2  
Interrupt Nesting  
The interrupt request scheme makes it possible to nest I bit maskable interrupt requests handled by the CPU. I bit maskable  
interrupt requests can be interrupted by an interrupt request with a higher priority.  
I bit maskable interrupt requests cannot be interrupted by other I bit maskable interrupt requests per default. In order to make an  
interrupt service routine (ISR) interruptible, the ISR must explicitly clear the I bit in the CCR (CLI). After clearing the I bit, other  
I bit maskable interrupt requests can interrupt the current ISR.  
An ISR of an interruptible I bit maskable interrupt request could basically look like this:  
1. Service interrupt, e.g., clear interrupt flags, copy data, etc.  
2. Clear I bit in the CCR by executing the instruction CLI (thus allowing other I bit maskable interrupt requests)  
3. Process data  
4. Return from interrupt by executing the instruction RTI  
5.30.5.3  
Wake-up from Stop Mode  
CPU Wake-up from Stop Mode  
5.30.5.3.1  
Every I bit maskable interrupt request is capable of waking the MCU from stop mode. To determine whether an I bit maskable  
interrupts is qualified to wake-up the CPU or not, the same conditions as in normal run mode are applied during stop mode: If the  
I bit in the CCR is set, all I bit maskable interrupts are masked from waking-up the MCU.  
Since there are no clocks running in stop mode, only interrupts which can be asserted asynchronously can wake-up the MCU  
from stop mode.  
The X bit maskable interrupt request can wake up the MCU from stop mode at anytime, even if the X bit in CCR is set.  
If the X bit maskable interrupt request is used to wake-up the MCU with the X bit in the CCR set, the associated ISR is not called.  
The CPU then resumes program execution with the instruction following the WAI or STOP instruction. This features works the  
same rules like any interrupt request, i.e. care must be taken that the X interrupt request used for wake-up remains active at least  
until the system begins execution of the instruction following the WAI or STOP instruction; otherwise, wake-up may not occur.  
MM912_634 Advance Information, Rev. 11.0  
174  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.31  
Background Debug Module (S12IPIMV1)  
5.31.1  
Introduction  
This section describes the functionality of the background debug module (BDM) sub-block of the HCS12S core platform.  
The background debug module (BDM) sub-block is a single-wire, background debug system implemented in on-chip hardware  
for minimal CPU intervention. All interfacing with the BDM is done via the BKGD pin.  
The BDM has enhanced capability for maintaining synchronization between the target and host while allowing more flexibility in  
clock rates. This includes a sync signal to determine the communication rate and a handshake signal to indicate when an  
operation is complete. The system is backwards compatible to the BDM of the S12 family with the following exceptions:  
TAGGO command not supported by S12SBDM  
External instruction tagging feature is part of the DBG module  
S12SBDM register map and register content modified  
Family ID readable from BDM ROM at global address 0x3_FF0F in active BDM (value for devices with HCS12S core is  
0xC2)  
Clock switch removed from BDM (CLKSW bit removed from BDMSTS register)  
5.31.1.1  
Features  
The BDM includes these distinctive features:  
Single-wire communication with host development system  
Enhanced capability for allowing more flexibility in clock rates  
SYNC command to determine communication rate  
GO_UNTIL(182) command  
Hardware handshake protocol to increase the performance of the serial communication  
Active out of reset in special single chip mode  
Nine hardware commands using free cycles, if available, for minimal CPU intervention  
Hardware commands not requiring active BDM  
14 firmware commands execute from the standard BDM firmware lookup table  
When secured, hardware commands are allowed to access the register space in special single chip mode, if the Flash  
erase tests fail.  
Family ID readable from BDM ROM at global address 0x3_FF0F in active BDM (value for devices with HCS12S core is  
0xC2)  
BDM hardware commands are operational until system stop mode is entered  
5.31.1.2  
Modes of Operation  
BDM is available in all operating modes but must be enabled before firmware commands are executed. Some systems may have  
a control bit that allows suspending the function during background debug mode.  
5.31.1.2.1  
Regular Run Modes  
All of these operations refer to the part in run mode and not being secured. The BDM does not provide controls to conserve power  
during run mode.  
Normal modes  
General operation of the BDM is available and operates the same in all normal modes.  
Special single chip mode  
In special single chip mode, background operation is enabled and active out of reset.This allows programming a system  
with blank memory.  
5.31.1.2.2  
Secure Mode Operation  
If the device is in secure mode, the operation of the BDM is reduced to a small subset of its regular run mode operation. Secure  
operation prevents access to Flash other than allowing erasure. For more information see Section 5.31.4.1, “Security".  
MM912_634 Advance Information, Rev. 11.0  
175  
Freescale Semiconductor  
Functional Description and Application Information  
5.31.1.2.3  
Low-power Modes  
The BDM can be used until stop mode is entered. The CPU cannot enter stop mode during BDM active mode.  
In stop mode the BDM clocks are stopped. When BDM clocks are disabled and stop mode is exited, the BDM clocks will restart  
and BDM will have a soft reset (clearing the instruction register, any command in progress and disable the ACK function). The  
BDM is now ready to receive a new command.  
5.31.1.3  
Block Diagram  
A block diagram of the BDM is shown in Figure 53.  
Host  
System  
Serial  
Interface  
Data  
16-Bit Shift Register  
BKGD  
Control  
Register Block  
Address  
Data  
Bus Interface  
and  
Control Logic  
TRACE  
Instruction Code  
and  
Control  
Clocks  
BDMACT  
Execution  
ENBDM  
SDV  
Standard BDM Firmware  
LOOKUP TABLE  
Secured BDM Firmware  
LOOKUP TABLE  
UNSEC  
BDMSTS  
Register  
Figure 53. BDM Block Diagram  
5.31.2  
External Signal Description  
A single-wire interface pin called the background debug interface (BKGD) pin is used to communicate with the BDM system.  
During reset, this pin is a mode select input which selects between normal and special modes of operation. After reset, this pin  
becomes the dedicated serial interface pin for the background debug mode.  
MM912_634 Advance Information, Rev. 11.0  
176  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.31.3  
Memory Map and Register Definition  
Module Memory Map  
5.31.3.1  
Table 259 shows the BDM memory map when BDM is active.  
Table 259. BDM Memory Map  
Size  
(Bytes)  
Global Address  
Module  
0x3_FF00–0x3_FF0B  
0x3_FF0C–0x3_FF0E  
BDM registers  
12  
3
BDM firmware ROM  
0x3_FF0F  
Family ID (part of BDM firmware ROM)  
BDM firmware ROM  
1
0x3_FF10–0x3_FFFF  
240  
5.31.3.2  
Register Descriptions  
A summary of the registers associated with the BDM is shown in Table 260. Registers are accessed by host-driven  
communications to the BDM hardware using READ_BD and WRITE_BD commands.  
Table 260. BDM Register Summary  
Global  
Address  
Register  
Name  
Bit 7  
6
5
4
3
2
1
Bit 0  
R
W
R
X
X
X
X
X
X
0
0
0x3_FF00  
0x3_FF01  
0x3_FF02  
0x3_FF03  
0x3_FF04  
0x3_FF05  
0x3_FF06  
0x3_FF07  
0x3_FF08  
0x3_FF09  
0x3_FF0A  
0x3_FF0B  
Reserved  
BDMSTS  
Reserved  
Reserved  
Reserved  
Reserved  
BDMCCR  
BDMACT  
0
X
X
X
X
SDV  
X
TRACE  
0
X
X
X
X
UNSEC  
0
X
X
X
X
ENBDM  
X
W
R
X
X
X
X
X
X
X
X
X
X
X
X
W
R
X
X
X
X
W
R
X
W
R
X
W
R
CCR7  
0
CCR6  
0
CCR5  
0
CCR4  
0
CCR3  
0
CCR2  
0
CCR1  
0
CCR0  
0
W
R
Reserved  
BDMPPR  
W
R
0
0
0
0
0
0
0
0
0
0
0
0
BPAE  
0
BPP3  
0
BPP2  
0
BPP1  
0
BPP0  
0
W
R
Reserved  
Reserved  
Reserved  
W
R
0
0
0
0
0
0
0
0
0
0
W
R
W
= Unimplemented, Reserved  
= Indeterminate  
= Implemented (do not alter)  
= Always read zero  
X
0
MM912_634 Advance Information, Rev. 11.0  
177  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.31.3.2.1  
BDM Status Register (BDMSTS)  
Register Global Address 0x3_FF01  
Table 261. BDM Status Register (BDMSTS)  
7
6
5
4
3
2
1
0
R
BDMACT  
0
SDV  
TRACE  
0
UNSEC  
0
ENBDM  
W
Reset  
Special Single-Chip Mode  
All Other Modes  
0(175)  
0
1
0
0
0
0
0
0
0
0
0
0(176)  
0
0
0
= Unimplemented, Reserved  
= Always read zero  
= Implemented (do not alter)  
0
Note:  
175. ENBDM is read as 1 by a debugging environment in special single chip mode when the device is not secured or secured but fully erased  
(Flash). This is because the ENBDM bit is set by the standard BDM firmware before a BDM command can be fully transmitted and  
executed.  
176. UNSEC is read as 1 by a debugging environment in special single chip mode when the device is secured and fully erased, else it is 0  
and can only be read if not secure (see also bit description).  
Read: All modes through BDM operation when not secured  
Write: All modes through BDM operation when not secured, but subject to the following:  
ENBDM should only be set via a BDM hardware command if the BDM firmware commands are needed. (This does  
not apply in special single chip mode).  
BDMACT can only be set by BDM hardware upon entry into BDM. It can only be cleared by the standard BDM  
firmware lookup table upon exit from BDM active mode.  
All other bits, while writable via BDM hardware or standard BDM firmware write commands, should only be altered  
by the BDM hardware or standard firmware lookup table as part of BDM command execution.  
Table 262. BDMSTS Field Descriptions  
Field  
Description  
Enable BDM — This bit controls whether the BDM is enabled or disabled. When enabled, BDM can be made active to allow  
firmware commands to be executed. When disabled, BDM cannot be made active but BDM hardware commands are still  
allowed.  
7
0
1
BDM disabled  
BDM enabled  
ENBDM  
Note: ENBDM is set out of reset in special single chip mode. In special single chip mode with the device secured, this bit will  
not be set until after the Flash erase verify tests are complete.  
BDM Active Status — This bit becomes set upon entering BDM. The standard BDM firmware lookup table is then enabled  
and put into the memory map. BDMACT is cleared by a carefully timed store instruction in the standard BDM firmware as part  
of the exit sequence to return to user code and remove the BDM memory from the map.  
6
BDMACT  
0
1
BDM not active  
BDM active  
Shift Data Valid — This bit is set and cleared by the BDM hardware. It is set after data has been transmitted as part of a BDM  
firmware or hardware read command or after data has been received as part of a BDM firmware or hardware write command.  
It is cleared when the next BDM command has been received or BDM is exited. SDV is used by the standard BDM firmware  
to control program flow execution.  
4
SDV  
0
1
Data phase of command not complete  
Data phase of command is complete  
MM912_634 Advance Information, Rev. 11.0  
178  
Freescale Semiconductor  
 
 
 
 
 
 
Functional Description and Application Information  
Table 262. BDMSTS Field Descriptions (continued)  
Field  
Description  
TRACE1 BDM Firmware Command is Being Executed — This bit gets set when a BDM TRACE1 firmware command is  
first recognized. It will stay set until BDM firmware is exited by one of the following BDM commands: GO or GO_UNTIL(182)  
.
3
0
1
TRACE1 command is not being executed  
TRACE1 command is being executed  
TRACE  
Unsecure — If the device is secured this bit is only writable in special single chip mode from the BDM secure firmware. It is  
in a zero state as secure mode is entered so that the secure BDM firmware lookup table is enabled and put into the memory  
map overlapping the standard BDM firmware lookup table.  
The secure BDM firmware lookup table verifies that the on-chip Flash is erased. This being the case, the UNSEC bit is set and  
the BDM program jumps to the start of the standard BDM firmware lookup table and the secure BDM firmware lookup table is  
turned off. If the erase test fails, the UNSEC bit will not be asserted.  
1
0
1
System is in a secured mode.  
System is in a unsecured mode.  
UNSEC  
Note: When UNSEC is set, security is off and the user can change the state of the secure bits in the on-chip Flash EEPROM.  
Note that if the user does not change the state of the bits to “unsecured” mode, the system will be secured again when  
it is next taken out of reset.After reset this bit has no meaning or effect when the security byte in the Flash EEPROM  
is configured for unsecure mode.  
Register Global Address 0x3_FF06  
Table 263. BDM CCR Holding Register (BDMCCR)  
7
6
5
4
3
2
1
0
R
CCR7  
CCR6  
CCR5  
CCR4  
CCR3  
CCR2  
CCR1  
CCR0  
W
Reset  
Special Single-Chip Mode  
All Other Modes  
1
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
Read: All modes through BDM operation when not secured  
Write: All modes through BDM operation when not secured  
NOTE  
When BDM is made active, the CPU stores the content of its CCR register in the BDMCCR  
register. However, out of special single-chip reset, the BDMCCR is set to 0xD8 and not 0xD0  
which is the reset value of the CCR register in this CPU mode. Out of reset in all other modes  
the BDMCCR register is read zero.  
When entering background debug mode, the BDM CCR holding register is used to save the condition code register of the user’s  
program. It is also used for temporary storage in the standard BDM firmware mode. The BDM CCR holding register can be written  
to modify the CCR value.  
5.31.3.2.2  
BDM Program Page Index Register (BDMPPR)  
Register Global Address 0x3_FF08  
Table 264. BDM Program Page Register (BDMPPR)  
7
6
5
4
3
2
1
0
R
W
0
0
0
BPAE  
0
BPP3  
0
BPP2  
0
BPP1  
0
BPP0  
0
Reset  
0
0
0
= Unimplemented, Reserved  
Read: All modes through BDM operation when not secured  
Write: All modes through BDM operation when not secured  
MM912_634 Advance Information, Rev. 11.0  
179  
Freescale Semiconductor  
Functional Description and Application Information  
Table 265. BDMPPR Field Descriptions  
Field  
Description  
BDM Program Page Access Enable Bit — BPAE enables program page access for BDM hardware and firmware read/write  
instructions. The BDM hardware commands used to access the BDM registers (READ_BD and WRITE_BD) can not be used  
for global accesses even if the BGAE bit is set.  
7
BPAE  
0
1
BDM Program Paging disabled  
BDM Program Paging enabled  
3–0  
BDM Program Page Index Bits 3–0 — These bits define the selected program page. For more detailed information regarding  
the program page window scheme, refer to the S12S_MMC Block Guide.  
BPP[3:0]  
5.31.3.3  
Family ID Assignment  
The family ID is an 8-bit value located in the BDM ROM in active BDM (at global address: 0x3_FF0F). The read-only value is a  
unique family ID which is 0xC2 for devices with an HCS12S core.  
5.31.4  
Functional Description  
The BDM receives and executes commands from a host via a single wire serial interface. There are two types of BDM commands:  
hardware and firmware commands.  
Hardware commands are used to read and write target system memory locations and to enter active background debug mode,  
see Section 5.31.4.3, “BDM Hardware Commands". Target system memory includes all memory that is accessible by the CPU.  
Firmware commands are used to read and write CPU resources and to exit from active background debug mode, see  
Section 5.31.4.4, “Standard BDM Firmware Commands". The CPU resources referred to are the accumulator (D), X index  
register (X), Y index register (Y), stack pointer (SP), and program counter (PC).  
Hardware commands can be executed at any time and in any mode excluding a few exceptions as highlighted (see  
Section 5.31.4.3, “BDM Hardware Commands") and in secure mode (see Section 5.31.4.1, “Security"). BDM firmware  
commands can only be executed when the system is not secure and is in active background debug mode (BDM).  
5.31.4.1  
Security  
If the user resets into special single chip mode with the system secured, a secured mode BDM firmware lookup table is brought  
into the map overlapping a portion of the standard BDM firmware lookup table. The secure BDM firmware verifies that the on-chip  
Flash EEPROM are erased. This being the case, the UNSEC and ENBDM bit will get set. The BDM program jumps to the start  
of the standard BDM firmware and the secured mode BDM firmware is turned off and all BDM commands are allowed. If the Flash  
do not verify as erased, the BDM firmware sets the ENBDM bit, without asserting UNSEC, and the firmware enters a loop. This  
causes the BDM hardware commands to become enabled, but does not enable the firmware commands. This allows the BDM  
hardware to be used to erase the Flash.  
BDM operation is not possible in any other mode than special single chip mode when the device is secured. The device can only  
be unsecured via BDM serial interface in special single chip mode. For more information regarding security, see the S12S_9SEC  
Block Guide.  
5.31.4.2  
Enabling and Activating BDM  
The system must be in active BDM to execute standard BDM firmware commands. BDM can be activated only after being  
enabled. BDM is enabled by setting the ENBDM bit in the BDM status (BDMSTS) register. The ENBDM bit is set by writing to the  
BDM status (BDMSTS) register, via the single-wire interface, using a hardware command such as WRITE_BD_BYTE.  
After being enabled, BDM is activated by one of the following(177)  
:
Hardware BACKGROUND command  
CPU BGND instruction  
Breakpoint force or tag mechanism(178)  
When BDM is activated, the CPU finishes executing the current instruction and then begins executing the firmware in the  
standard BDM firmware lookup table. When BDM is activated by a breakpoint, the type of breakpoint used determines if BDM  
becomes active before or after execution of the next instruction.  
Note:  
177. BDM is enabled and active immediately out of special single-chip reset.  
178. This method is provided by the S12S_DBG module.  
MM912_634 Advance Information, Rev. 11.0  
180  
Freescale Semiconductor  
 
 
 
 
Functional Description and Application Information  
NOTE  
If an attempt is made to activate BDM before being enabled, the CPU resumes normal  
instruction execution after a brief delay. If BDM is not enabled, any hardware  
BACKGROUND commands issued are ignored by the BDM and the CPU is not delayed.  
In active BDM, the BDM registers and standard BDM firmware lookup table are mapped to addresses 0x3_FF00 to 0x3_FFFF.  
BDM registers are mapped to addresses 0x3_FF00 to 0x3_FF0B. The BDM uses these registers which are readable anytime by  
the BDM. However, these registers are not readable by user programs.  
When BDM is activated while CPU executes code overlapping with BDM firmware space the saved program counter (PC) will be  
auto incremented by one from the BDM firmware, no matter what caused the entry into BDM active mode (BGND instruction,  
BACKGROUND command or breakpoints). In such a case the PC must be set to the next valid address via a WRITE_PC  
command before executing the GO command.  
5.31.4.3  
BDM Hardware Commands  
Hardware commands are used to read and write target system memory locations and to enter active background debug mode.  
Target system memory includes all memory that is accessible by the CPU such as on-chip RAM, Flash, I/O and control registers.  
Hardware commands are executed with minimal or no CPU intervention and do not require the system to be in active BDM for  
execution, although, they can still be executed in this mode. When executing a hardware command, the BDM sub-block waits for  
a free bus cycle so that the background access does not disturb the running application program. If a free cycle is not found within  
128 clock cycles, the CPU is momentarily frozen so that the BDM can steal a cycle. When the BDM finds a free cycle, the  
operation does not intrude on normal CPU operation provided that it can be completed in a single cycle. However, if an operation  
requires multiple cycles the CPU is frozen until the operation is complete, even though the BDM found a free cycle. The BDM  
hardware commands are listed in Table 266.  
The READ_BD and WRITE_BD commands allow access to the BDM register locations. These locations are not normally in the  
system memory map but share addresses with the application in memory. To distinguish between physical memory locations that  
share the same address, BDM memory resources are enabled just for the READ_BD and WRITE_BD access cycle. This allows  
the BDM to access BDM locations unobtrusively, even if the addresses conflict with the application memory map.  
Table 266. Hardware Commands  
Opcode  
Command  
Data  
Description  
(hex)  
Enter background mode if BDM is enabled. If enabled, an ACK will be issued when the part  
enters active background mode.  
BACKGROUND  
90  
None  
ACK_ENABLE  
ACK_DISABLE  
D5  
D6  
None  
None  
Enable Handshake. Issues an ACK pulse after the command is executed.  
Disable Handshake. This command does not issue an ACK pulse.  
16-bit address Read from memory with standard BDM firmware lookup table in map.  
Odd address data on low byte; even address data on high byte.  
READ_BD_BYTE  
READ_BD_WORD  
READ_BYTE  
E4  
EC  
E0  
E8  
C4  
CC  
C0  
16-bit data out  
16-bit address Read from memory with standard BDM firmware lookup table in map.  
Must be aligned access.  
16-bit data out  
16-bit address Read from memory with standard BDM firmware lookup table out of map.  
Odd address data on low byte; even address data on high byte.  
16-bit data out  
16-bit address Read from memory with standard BDM firmware lookup table out of map. Must be aligned  
READ_WORD  
access.  
16-bit data out  
16-bit address Write to memory with standard BDM firmware lookup table in map.  
WRITE_BD_BYTE  
WRITE_BD_WORD  
WRITE_BYTE  
Odd address data on low byte; even address data on high byte.  
16-bit data in  
16-bit address Write to memory with standard BDM firmware lookup table in map. Must be aligned access.  
16-bit data in  
16-bit address Write to memory with standard BDM firmware lookup table out of map.  
Odd address data on low byte; even address data on high byte.  
16-bit data in  
MM912_634 Advance Information, Rev. 11.0  
181  
Freescale Semiconductor  
 
 
 
 
Functional Description and Application Information  
Description  
Table 266. Hardware Commands (continued)  
Opcode  
Command  
Data  
(hex)  
16-bit address Write to memory with standard BDM firmware lookup table out of map. Must be aligned  
access.  
WRITE_WORD  
C8  
16-bit data in  
Note:  
179. If enabled, ACK will occur when data is ready for transmission for all BDM READ commands and will occur after the write is complete  
for all BDM WRITE commands.  
5.31.4.4  
Standard BDM Firmware Commands  
BDM firmware commands are used to access and manipulate CPU resources. The system must be in active BDM to execute  
standard BDM firmware commands, see Section 5.31.4.2, “Enabling and Activating BDM". Normal instruction execution is  
suspended while the CPU executes the firmware located in the standard BDM firmware lookup table. The hardware command  
BACKGROUND is the usual way to activate BDM.  
As the system enters active BDM, the standard BDM firmware lookup table and BDM registers become visible in the on-chip  
memory map at 0x3_FF00–0x3_FFFF, and the CPU begins executing the standard BDM firmware. The standard BDM firmware  
watches for serial commands and executes them as they are received.  
The firmware commands are shown in Table 267.  
Table 267. Firmware Commands  
Opcode  
(hex)  
Command(180)  
Data  
Description  
READ_NEXT(181)  
READ_PC  
READ_D  
62  
63  
64  
65  
66  
67  
16-bit data out Increment X index register by 2 (X = X + 2), then read word X points to.  
16-bit data out Read program counter.  
16-bit data out Read D accumulator.  
READ_X  
16-bit data out Read X index register.  
READ_Y  
16-bit data out Read Y index register.  
READ_SP  
WRITE_NEXT  
16-bit data out Read stack pointer.  
Increment X index register by 2 (X = X + 2), then write word to location  
pointed to by X.  
42  
16-bit data in  
WRITE_PC  
WRITE_D  
WRITE_X  
WRITE_Y  
WRITE_SP  
GO  
43  
44  
45  
46  
47  
08  
0C  
16-bit data in Write program counter.  
16-bit data in Write D accumulator.  
16-bit data in Write X index register.  
16-bit data in Write Y index register.  
16-bit data in Write stack pointer.  
none  
none  
Go to user program. If enabled, ACK will occur when leaving active background mode.  
Go to user program. If enabled, ACK will occur upon returning to active background mode.  
GO_UNTIL(182)  
TRACE1  
Execute one user instruction then return to active BDM. If enabled,  
ACK will occur upon returning to active background mode.  
10  
none  
TAGGO -> GO  
Note:  
(Previous enable tagging and go to user program.)  
This command will be deprecated and should not be used anymore.  
Opcode will be executed as a GO command.  
18  
none  
180. If enabled, ACK will occur when data is ready for transmission for all BDM READ commands and will occur after the write is complete  
for all BDM WRITE commands.  
181. When the firmware command READ_NEXT or WRITE_NEXT is used to access the BDM address space the BDM resources are  
accessed rather than user code. Writing BDM firmware is not possible.  
182. System stop disables the ACK function and ignored commands will not have an ACK-pulse (e.g., CPU in stop mode). The GO_UNTIL  
command will not get an Acknowledge if CPU executes the stop instruction before the “UNTIL” condition (BDM active again) is reached  
(see Section 5.31.4.7, “Serial Interface Hardware Handshake Protocol" last note).  
MM912_634 Advance Information, Rev. 11.0  
182  
Freescale Semiconductor  
 
 
 
 
 
 
 
 
Functional Description and Application Information  
5.31.4.5  
BDM Command Structure  
Hardware and firmware BDM commands start with an 8-bit opcode followed by a 16-bit address and/or a 16-bit data word,  
depending on the command. All the read commands return 16 bits of data despite the byte or word implication in the command  
name.{Satatement}  
8-bit reads return 16-bits of data, only one byte of which contains valid data. If reading an  
even address, the valid data will appear in the MSB. If reading an odd address, the valid data  
will appear in the LSB.  
16-bit misaligned reads and writes are generally not allowed. If attempted by BDM hardware  
command, the BDM ignores the least significant bit of the address and assumes an even  
address from the remaining bits.  
For hardware data read commands, the external host must wait at least 150 bus clock cycles after sending the address before  
attempting to obtain the read data. This is to be certain that valid data is available in the BDM shift register, ready to be shifted  
out. For hardware write commands, the external host must wait 150 bus clock cycles after sending the data to be written before  
attempting to send a new command. This is to avoid disturbing the BDM shift register before the write has been completed. The  
150 bus clock cycle delay in both cases includes the maximum 128 cycle delay that can be incurred as the BDM waits for a free  
cycle before stealing a cycle.  
For BDM firmware read commands, the external host should wait at least 48 bus clock cycles after sending the command opcode  
and before attempting to obtain the read data. The 48 cycle wait allows enough time for the requested data to be made available  
in the BDM shift register, ready to be shifted out.  
For BDM firmware write commands, the external host must wait 36 bus clock cycles after sending the data to be written before  
attempting to send a new command. This is to avoid disturbing the BDM shift register before the write has been completed.  
The external host should wait for at least for 76 bus clock cycles after a TRACE1 or GO command before starting any new serial  
command. This is to allow the CPU to exit gracefully from the standard BDM firmware lookup table and resume execution of the  
user code. Disturbing the BDM shift register prematurely may adversely affect the exit from the standard BDM firmware lookup  
table.  
NOTE  
If the bus rate of the target processor is unknown or could be changing, it is recommended  
that the ACK (acknowledge function) is used to indicate when an operation is complete.  
When using ACK, the delay times are automated.  
Figure 54 represents the BDM command structure. The command blocks illustrate a series of eight bit times starting with a falling  
edge. The bar across the top of the blocks indicates that the BKGD line idles in the high state. The time for an 8-bit command is  
8 16 target clock cycles.(183)  
Note:  
183. Target clock cycles are cycles measured using the target MCU’s serial clock rate. See Section 5.31.4.6, “BDM Serial Interface" and  
Section 5.31.3.2.1, “BDM Status Register (BDMSTS)" for information on how serial clock rate is selected.  
MM912_634 Advance Information, Rev. 11.0  
183  
Freescale Semiconductor  
 
Functional Description and Application Information  
8 Bits  
AT ~16 TC/Bit  
16 Bits  
AT ~16 TC/Bit  
150-BC  
Delay  
16 Bits  
AT ~16 TC/Bit  
Hardware  
Read  
Next  
Command  
Command  
Address  
Data  
150-BC  
Delay  
Hardware  
Write  
Next  
Command  
Command  
Address  
Data  
48-BC  
DELAY  
Firmware  
Read  
Next  
Command  
Command  
Command  
Data  
Command  
36-BC  
DELAY  
Firmware  
Write  
Next  
Command  
Data  
76-BC  
Delay  
GO,  
TRACE  
Next  
Command  
BC = Bus Clock Cycles  
TC = Target Clock Cycles  
Figure 54. BDM Command Structure  
5.31.4.6  
BDM Serial Interface  
The BDM communicates with external devices serially via the BKGD pin. During reset, this pin is a mode select input which  
selects between normal and special modes of operation. After reset, this pin becomes the dedicated serial interface pin for the  
BDM.  
This clock will be referred to as the target clock in the following explanation.  
The BDM serial interface uses a clocking scheme in which the external host generates a falling edge on the BKGD pin to indicate  
the start of each bit time. This falling edge is sent for every bit whether data is transmitted or received. Data is transferred most  
significant bit (MSB) first at 16 target clock cycles per bit. The interface times out if 512 clock cycles occur between falling edges  
from the host.  
The BKGD pin is a pseudo open-drain pin and has an weak on-chip active pull-up that is enabled at all times. It is assumed that  
there is an external pull-up and that drivers connected to BKGD do not typically drive the high level. Since R-C rise time could  
be unacceptably long, the target system and host provide brief driven-high (speedup) pulses to drive BKGD to a logic 1. The  
source of this speedup pulse is the host for transmit cases and the target for receive cases.  
The timing for host-to-target is shown in Figure 55 and that of target-to-host in Figure 56 and Figure 57. All four cases begin when  
the host drives the BKGD pin low to generate a falling edge. Since the host and target are operating from separate clocks, it can  
take the target system up to one full clock cycle to recognize this edge. The target measures delays from this perceived start of  
the bit time while the host measures delays from the point it actually drove BKGD low to start the bit up to one target clock cycle  
earlier. Synchronization between the host and target is established in this manner at the start of every bit time.  
Figure 55 shows an external host transmitting a logic 1 and transmitting a logic 0 to the BKGD pin of a target system. The host  
is asynchronous to the target, so there is up to a one clock-cycle delay from the host-generated falling edge to where the target  
recognizes this edge as the beginning of the bit time. Ten target clock cycles later, the target senses the bit level on the BKGD  
pin. Internal glitch detect logic requires the pin be driven high no later that eight target clock cycles after the falling edge for a  
logic 1 transmission.  
Since the host drives the high speedup pulses in these two cases, the rising edges look like digitally driven signals.  
MM912_634 Advance Information, Rev. 11.0  
184  
Freescale Semiconductor  
Functional Description and Application Information  
BDM Clock  
(Target MCU)  
Host  
Transmit 1  
Host  
Transmit 0  
Perceived  
Start of Bit Time  
Target Senses Bit  
Earliest  
Start of  
Next Bit  
10 Cycles  
Synchronization  
Uncertainty  
Figure 55. BDM Host-to-Target Serial Bit Timing  
The receive cases are more complicated. Figure 56 shows the host receiving a logic 1 from the target system. Since the host is  
asynchronous to the target, there is up to one clock-cycle delay from the host-generated falling edge on BKGD to the perceived  
start of the bit time in the target. The host holds the BKGD pin low long enough for the target to recognize it (at least two target  
clock cycles). The host must release the low drive before the target drives a brief high speedup pulse seven target clock cycles  
after the perceived start of the bit time. The host should sample the bit level about 10 target clock cycles after it started the bit time.  
BDM Clock  
(Target MCU)  
Host  
Drive to  
High-Impedance  
BKGD Pin  
Target System  
Speedup  
Pulse  
High-Impedance  
High-Impedance  
Perceived  
Start of Bit Time  
R-C Rise  
BKGD Pin  
10 Cycles  
10 Cycles  
Earliest  
Start of  
Next Bit  
Host Samples  
BKGD Pin  
Figure 56. BDM Target-to-Host Serial Bit Timing (Logic 1)  
Figure 57 shows the host receiving a logic 0 from the target. Since the host is asynchronous to the target, there is up to a one  
clock-cycle delay from the host-generated falling edge on BKGD to the start of the bit time as perceived by the target. The host  
initiates the bit time but the target finishes it. Since the target wants the host to receive a logic 0, it drives the BKGD pin low for  
13 target clock cycles then briefly drives it high to speed up the rising edge. The host samples the bit level about 10 target clock  
cycles after starting the bit time.  
MM912_634 Advance Information, Rev. 11.0  
185  
Freescale Semiconductor  
 
Functional Description and Application Information  
BDM Clock  
(Target MCU)  
Host  
Drive to  
BKGD Pin  
High-Impedance  
Speedup Pulse  
Target System  
Drive and  
Speedup Pulse  
Perceived  
Start of Bit Time  
BKGD Pin  
10 Cycles  
10 Cycles  
Earliest  
Start of  
Next Bit  
Host Samples  
BKGD Pin  
Figure 57. BDM Target-to-Host Serial Bit Timing (Logic 0)  
5.31.4.7  
Serial Interface Hardware Handshake Protocol  
BDM commands that require CPU execution are ultimately treated at the MCU bus rate. Since the BDM clock source can be  
modified, it is very helpful to provide a handshake protocol in which the host could determine when an issued command is  
executed by the CPU. The alternative is to always wait the amount of time equal to the appropriate number of cycles at the  
slowest possible rate the clock could be running. This sub-section will describe the hardware handshake protocol.  
The hardware handshake protocol signals to the host controller when an issued command was successfully executed by the  
target. This protocol is implemented by a 16 serial clock cycle low pulse followed by a brief speedup pulse in the BKGD pin. This  
pulse is generated by the target MCU when a command, issued by the host, has been successfully executed (see Figure 58).  
This pulse is referred to as the ACK pulse. After the ACK pulse has finished: the host can start the bit retrieval if the last issued  
command was a read command, or start a new command if the last command was a write command or a control command  
(BACKGROUND, GO, GO_UNTIL(182) or TRACE1). The ACK pulse is not issued earlier than 32 serial clock cycles after the BDM  
command was issued. The end of the BDM command is assumed to be the 16th tick of the last bit. This minimum delay assures  
enough time for the host to perceive the ACK pulse. Note also that, there is no upper limit for the delay between the command  
and the related ACK pulse, since the command execution depends upon the CPU bus, which in some cases could be very slow  
due to long accesses taking place.This protocol allows a great flexibility for the POD designers, since it does not rely on any  
accurate time measurement or short response time to any event in the serial communication.  
MM912_634 Advance Information, Rev. 11.0  
186  
Freescale Semiconductor  
Functional Description and Application Information  
BDM Clock  
(Target MCU)  
16 Cycles  
Target  
Transmits  
ACK Pulse  
High-Impedance  
32 Cycles  
High-Impedance  
Speedup Pulse  
Minimum Delay  
From the BDM Command  
BKGD Pin  
Earliest  
Start of  
Next Bit  
16th Tick of the  
Last Command Bit  
Figure 58. Target Acknowledge Pulse (ACK)  
NOTE  
If the ACK pulse was issued by the target, the host assumes the previous command was  
executed. If the CPU enters stop prior to executing a hardware command, the ACK pulse  
will not be issued meaning that the BDM command was not executed. After entering stop  
mode, the BDM command is no longer pending.  
Figure 59 shows the ACK handshake protocol in a command level timing diagram. The READ_BYTE instruction is used as an  
example. First, the 8-bit instruction opcode is sent by the host, followed by the address of the memory location to be read. The  
target BDM decodes the instruction. A bus cycle is grabbed (free or stolen) by the BDM and it executes the READ_BYTE  
operation. Having retrieved the data, the BDM issues an ACK pulse to the host controller, indicating that the addressed byte is  
ready to be retrieved. After detecting the ACK pulse, the host initiates the byte retrieval process. Note that data is sent in the form  
of a word and the host needs to determine which is the appropriate byte based on whether the address was odd or even.  
Target  
Host  
(2) Bytes are  
Retrieved  
New BDM  
Command  
BKGD Pin  
READ_BYTE  
Host  
Byte Address  
Target  
Host  
Target  
BDM Issues the  
ACK Pulse (out of scale)  
BDM Executes the  
READ_BYTE Command  
BDM Decodes  
the Command  
Figure 59. Handshake Protocol at the Command Level  
Differently from the normal bit transfer (where the host initiates the transmission), the serial interface ACK handshake pulse is  
initiated by the target MCU by issuing a negative edge on the BKGD pin. The hardware handshake protocol in Figure 58 specifies  
the timing when the BKGD pin is being driven, so the host should follow this timing constraint in order to avoid the risk of an  
electrical conflict on the BKGD pin.  
NOTE  
The only place the BKGD pin can have an electrical conflict is when one side is driving low  
and the other side is issuing a speedup pulse (high). Other “highs” are pulled rather than  
driven. However, at low rates the time of the speedup pulse can become lengthy and so the  
potential conflict time becomes longer as well.  
MM912_634 Advance Information, Rev. 11.0  
187  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
The ACK handshake protocol does not support nested ACK pulses. If a BDM command is not acknowledge by an ACK pulse,  
the host needs to abort the pending command first in order to be able to issue a new BDM command. When the CPU enters stop  
while the host issues a hardware command (e.g., WRITE_BYTE), the target discards the incoming command due to the stop  
being detected. Therefore, the command is not acknowledged by the target, which means that the ACK pulse will not be issued  
in this case. After a certain time the host (not aware of stop) should decide to abort any possible pending ACK pulse in order to  
be sure a new command can be issued. Therefore, the protocol provides a mechanism in which a command, and its  
corresponding ACK, can be aborted.  
NOTE  
The ACK pulse does not provide a timeout. This means for the GO_UNTIL(182) command  
that it can not be distinguished if a stop has been executed (command discarded and ACK  
not issued) or if the “UNTIL” condition (BDM active) is just not reached yet. Hence in any  
case where the ACK pulse of a command is not issued the possible pending command  
should be aborted before issuing a new command. See the handshake abort procedure  
described in Section 5.31.4.8, “Hardware Handshake Abort Procedure".  
5.31.4.8  
Hardware Handshake Abort Procedure  
The abort procedure is based on the SYNC command. In order to abort a command, which had not issued the corresponding  
ACK pulse, the host controller should generate a low pulse in the BKGD pin by driving it low for at least 128 serial clock cycles  
and then driving it high for one serial clock cycle, providing a speedup pulse.By detecting this long low pulse in the BKGD pin,  
the target executes the SYNC protocol, see Section 5.31.4.9, “SYNC — Request Timed Reference Pulse", and assumes that the  
pending command and therefore the related ACK pulse, are being aborted. Therefore, after the SYNC protocol has been  
completed the host is free to issue new BDM commands. For BDM firmware READ or WRITE commands it can not be  
guaranteed that the pending command is aborted when issuing a SYNC before the corresponding ACK pulse. There is a short  
latency time from the time the READ or WRITE access begins until it is finished and the corresponding ACK pulse is issued. The  
latency time depends on the firmware READ or WRITE command that is issued and on the selected bus clock rate. When the  
SYNC command starts during this latency time the READ or WRITE command will not be aborted, but the corresponding ACK  
pulse will be aborted. A pending GO, TRACE1 or GO_UNTIL(182) command can not be aborted. Only the corresponding ACK  
pulse can be aborted by the SYNC command.  
Although it is not recommended, the host could abort a pending BDM command by issuing a low pulse in the BKGD pin shorter  
than 128 serial clock cycles, which will not be interpreted as the SYNC command. The ACK is actually aborted when a negative  
edge is perceived by the target in the BKGD pin. The short abort pulse should have at least 4 clock cycles keeping the BKGD  
pin low, in order to allow the negative edge to be detected by the target.In this case, the target will not execute the SYNC protocol  
but the pending command will be aborted along with the ACK pulse. The potential problem with this abort procedure is when  
there is a conflict between the ACK pulse and the short abort pulse. In this case, the target may not perceive the abort pulse. The  
worst case is when the pending command is a read command (i.e., READ_BYTE). If the abort pulse is not perceived by the target  
the host will attempt to send a new command after the abort pulse was issued, while the target expects the host to retrieve the  
accessed memory byte. In this case, host and target will run out of synchronism. However, if the command to be aborted is not  
a read command the short abort pulse could be used. After a command is aborted the target assumes the next negative edge,  
after the abort pulse, is the first bit of a new BDM command.  
NOTE  
The details about the short abort pulse are being provided only as a reference for the reader  
to better understand the BDM internal behavior. It is not recommended that this procedure  
be used in a real application.  
Since the host knows the target serial clock frequency, the SYNC command (used to abort a command) does not need to consider  
the lower possible target frequency. In this case, the host could issue a SYNC very close to the 128 serial clock cycles length.  
Providing a small overhead on the pulse length in order to assure the SYNC pulse will not be misinterpreted by the target. See  
Section 5.31.4.9, “SYNC — Request Timed Reference Pulse".  
Figure 60 shows a SYNC command being issued after a READ_BYTE, which aborts the READ_BYTE command. Note that, after  
the command is aborted a new command could be issued by the host computer.  
MM912_634 Advance Information, Rev. 11.0  
188  
Freescale Semiconductor  
 
Functional Description and Application Information  
READ_BYTE CMD is Aborted  
by the SYNC Request  
(Out of Scale)  
SYNC Response  
From the Target  
(Out of Scale)  
BKGD Pin READ_BYTE  
Host  
Memory Address  
Target  
READ_STATUS  
Host Target  
New BDM Command  
Host Target  
BDM Decode  
New BDM Command  
and Starts to Execute  
the READ_BYTE Command  
Figure 60. ACK Abort Procedure at the Command Level  
NOTE  
Figure 60 does not represent the signals in a true timing scale  
Figure 61 shows a conflict between the ACK pulse and the SYNC request pulse. This conflict could occur if a POD device is  
connected to the target BKGD pin and the target is already in debug active mode. Consider that the target CPU is executing a  
pending BDM command at the exact moment the POD is being connected to the BKGD pin. In this case, an ACK pulse is issued  
along with the SYNC command. In this case, there is an electrical conflict between the ACK speedup pulse and the SYNC pulse.  
Since this is not a probable situation, the protocol does not prevent this conflict from happening.  
At Least 128 Cycles  
BDM Clock  
(Target MCU)  
ACK Pulse  
Target MCU  
High-Impedance  
Electrical Conflict  
Drives to  
BKGD Pin  
Speedup Pulse  
Host and  
Host  
Drives SYNC  
To BKGD Pin  
Target Drive  
to BKGD Pin  
Host SYNC Request Pulse  
BKGD Pin  
16 Cycles  
Figure 61. ACK Pulse and SYNC Request Conflict  
NOTE  
This information is being provided so that the MCU integrator will be aware that such a  
conflict could occur.  
The hardware handshake protocol is enabled by the ACK_ENABLE and disabled by the ACK_DISABLE BDM commands. This  
provides backwards compatibility with the existing POD devices which are not able to execute the hardware handshake protocol.  
It also allows for new POD devices, that support the hardware handshake protocol, to freely communicate with the target device.  
If desired, without the need for waiting for the ACK pulse.  
The commands are described as follows:  
ACK_ENABLE — enables the hardware handshake protocol. The target will issue the ACK pulse when a CPU  
command is executed by the CPU. The ACK_ENABLE command itself also has the ACK pulse as a response.  
ACK_DISABLE — disables the ACK pulse protocol. In this case, the host needs to use the worst case delay time at the  
appropriate places in the protocol.  
MM912_634 Advance Information, Rev. 11.0  
189  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
The default state of the BDM after reset is hardware handshake protocol disabled.  
All the read commands will ACK (if enabled) when the data bus cycle has completed and the data is then ready for reading out  
by the BKGD serial pin. All the write commands will ACK (if enabled) after the data has been received by the BDM through the  
BKGD serial pin and when the data bus cycle is complete. See Section 5.31.4.3, “BDM Hardware Commands" and  
Section 5.31.4.4, “Standard BDM Firmware Commands" for more information on the BDM commands.  
The ACK_ENABLE sends an ACK pulse when the command has been completed. This feature could be used by the host to  
evaluate if the target supports the hardware handshake protocol. If an ACK pulse is issued in response to this command, the host  
knows that the target supports the hardware handshake protocol. If the target does not support the hardware handshake protocol  
the ACK pulse is not issued. In this case, the ACK_ENABLE command is ignored by the target since it is not recognized as a  
valid command.  
The BACKGROUND command issues an ACK pulse when the CPU changes from normal to background mode. The ACK pulse  
related to this command could be aborted using the SYNC command.  
The GO command issues an ACK pulse when the CPU exits from background mode. The ACK pulse related to this command  
could be aborted using the SYNC command.  
The GO_UNTIL(182) command is equivalent to a GO command with exception that the ACK pulse, in this case, is issued when  
the CPU enters into background mode. This command is an alternative to the GO command and should be used when the host  
wants to trace if a breakpoint match occurs and causes the CPU to enter active background mode. Note that the ACK is issued  
whenever the CPU enters BDM, which could be caused by a breakpoint match or by a BGND instruction being executed. The  
ACK pulse related to this command could be aborted using the SYNC command.  
The TRACE1 command has the related ACK pulse issued when the CPU enters background active mode after one instruction  
of the application program is executed. The ACK pulse related to this command could be aborted using the SYNC command.  
5.31.4.9  
SYNC — Request Timed Reference Pulse  
The SYNC command is unlike other BDM commands because the host does not necessarily know the correct communication  
speed to use for BDM communications until after it has analyzed the response to the SYNC command. To issue a SYNC  
command, the host should perform the following steps:  
1. Drive the BKGD pin low for at least 128 cycles at the lowest possible BDM serial communication frequency  
2. Drive BKGD high for a brief speedup pulse to get a fast rise time (this speedup pulse is typically one cycle of the host  
clock.)  
3. Remove all drive to the BKGD pin so it reverts to high impedance.  
4. Listen to the BKGD pin for the sync response pulse.  
Upon detecting the SYNC request from the host, the target performs the following steps:  
1. Discards any incomplete command received or bit retrieved.  
2. Waits for BKGD to return to a logic one.  
3. Delays 16 cycles to allow the host to stop driving the high speedup pulse.  
4. Drives BKGD low for 128 cycles at the current BDM serial communication frequency.  
5. Drives a one-cycle high speedup pulse to force a fast rise time on BKGD.  
6. Removes all drive to the BKGD pin so it reverts to high impedance.  
The host measures the low time of this 128 cycle SYNC response pulse and determines the correct speed for subsequent BDM  
communications. Typically, the host can determine the correct communication speed within a few percent of the actual target  
speed and the communication protocol can easily tolerate speed errors of several percent.  
As soon as the SYNC request is detected by the target, any partially received command or bit retrieved is discarded. This is  
referred to as a soft-reset, equivalent to a time-out in the serial communication. After the SYNC response, the target will consider  
the next negative edge (issued by the host) as the start of a new BDM command or the start of new SYNC request.  
Another use of the SYNC command pulse is to abort a pending ACK pulse. The behavior is exactly the same as in a regular  
SYNC command. Note that one of the possible causes for a command to not be acknowledged by the target is a host-target  
synchronization problem. In this case, the command may not have been understood by the target and so an ACK response pulse  
will not be issued.  
MM912_634 Advance Information, Rev. 11.0  
190  
Freescale Semiconductor  
Functional Description and Application Information  
5.31.4.10  
Instruction Tracing  
When a TRACE1 command is issued to the BDM in active BDM, the CPU exits the standard BDM firmware and executes a single  
instruction in the user code. Once this has occurred, the CPU is forced to return to the standard BDM firmware and the BDM is  
active and ready to receive a new command. If the TRACE1 command is issued again, the next user instruction will be executed.  
This facilitates stepping or tracing through the user code one instruction at a time.  
If an interrupt is pending when a TRACE1 command is issued, the interrupt stacking operation occurs but no user instruction is  
executed. Once back in standard BDM firmware execution, the program counter points to the first instruction in the interrupt  
service routine.  
Be aware when tracing through the user code that the execution of the user code is done step by step but peripherals are free  
running. Hence possible timing relations between CPU code execution and occurrence of events of other peripherals no longer  
exist.  
Do not trace the CPU instruction BGND used for soft breakpoints. Tracing over the BGND instruction will result in a return address  
pointing to BDM firmware address space.  
When tracing through user code which contains stop instructions the following will happen when the stop instruction is traced:  
The CPU enters stop mode and the TRACE1 command can not be finished before leaving the low power mode. This is  
the case because BDM active mode can not be entered after CPU executed the stop instruction. However all BDM  
hardware commands except the BACKGROUND command are operational after tracing a stop instruction and still being  
in stop mode. If system stop mode is entered (all bus masters are in stop mode) no BDM command is operational.  
As soon as stop mode is exited the CPU enters BDM active mode and the saved PC value points to the entry of the  
corresponding interrupt service routine.  
In case the handshake feature is enabled the corresponding ACK pulse of the TRACE1 command will be discarded  
when tracing a stop instruction. Hence there is no ACK pulse when BDM active mode is entered as part of the TRACE1  
command after CPU exited from stop mode. All valid commands sent during CPU being in stop mode or after CPU  
exited from stop mode will have an ACK pulse. The handshake feature becomes disabled only when system stop mode  
has been reached. Hence after a system stop mode the handshake feature must be enabled again by sending the  
ACK_ENABLE command.  
5.31.4.11  
Serial Communication Timeout  
The host initiates a host-to-target serial transmission by generating a falling edge on the BKGD pin. If BKGD is kept low for more  
than 128 target clock cycles, the target understands that a SYNC command was issued. In this case, the target will keep waiting  
for a rising edge on BKGD in order to answer the SYNC request pulse. If the rising edge is not detected, the target will keep  
waiting forever without any timeout limit.  
Consider now the case where the host returns BKGD to logic one before 128 cycles. This is interpreted as a valid bit transmission,  
and not as a SYNC request. The target will keep waiting for another falling edge marking the start of a new bit. If, however, a new  
falling edge is not detected by the target within 512 clock cycles since the last falling edge, a timeout occurs and the current  
command is discarded without affecting memory or the operating mode of the MCU. This is referred to as a soft-reset.  
If a read command is issued but the data is not retrieved within 512 serial clock cycles, a soft-reset will occur causing the  
command to be disregarded. The data is not available for retrieval after the timeout has occurred. This is the expected behavior  
if the handshake protocol is not enabled. In order to allow the data to be retrieved even with a large clock frequency mismatch  
(between BDM and CPU) when the hardware handshake protocol is enabled, the time out between a read command and the  
data retrieval is disabled. Therefore, the host could wait for more then 512 serial clock cycles and still be able to retrieve the data  
from an issued read command. However, once the handshake pulse (ACK pulse) is issued, the timeout feature is re-activated,  
meaning that the target will time out after 512 clock cycles. Therefore, the host needs to retrieve the data within a 512 serial clock  
cycles time frame after the ACK pulse had been issued. After that period, the read command is discarded and the data is no  
longer available for retrieval. Any negative edge in the BKGD pin after the timeout period is considered to be a new command or  
a SYNC request.  
Note that whenever a partially issued command, or partially retrieved data, has occurred the timeout in the serial communication  
is active. This means that if a time frame higher than 512 serial clock cycles is observed between two consecutive negative edges  
and the command being issued or data being retrieved is not complete, a soft-reset will occur causing the partially received  
command or data retrieved to be disregarded. The next negative edge in the BKGD pin, after a soft-reset has occurred, is  
considered by the target as the start of a new BDM command, or the start of a SYNC request pulse.  
MM912_634 Advance Information, Rev. 11.0  
191  
Freescale Semiconductor  
Functional Description and Application Information  
5.32  
S12S Debug Module (S12IPIMV1V2)  
5.32.1  
Introduction  
The S12IPIMV1 module provides an on-chip trace buffer with flexible triggering capability to allow non-intrusive debug of  
application software. The S12IPIMV1 module is optimized for S12SCPU debugging.  
Typically the S12IPIMV1 module is used in conjunction with the S12SBDM module, whereby the user configures the S12IPIMV1  
module for a debugging session over the BDM interface. Once configured the S12IPIMV1 module is armed and the device leaves  
BDM returning control to the user program, which is then monitored by the S12IPIMV1 module. Alternatively the S12IPIMV1  
module can be configured over a serial interface using SWI routines.  
5.32.1.1  
Glossary Of Terms  
COF: Change Of Flow. Change in the program flow due to a conditional branch, indexed jump or interrupt.  
BDM: Background Debug Mode  
S12SBDM: Background Debug Module  
DUG: Device User Guide, describing the features of the device into which the DBG is integrated.  
WORD: 16 bit data entity  
Data Line: 20 bit data entity  
CPU: S12SCPU module  
DBG: S12SDBG module  
POR: Power On Reset  
Tag: Tags can be attached to CPU opcodes as they enter the instruction pipe. If the tagged opcode reaches the execution stage  
a tag hit occurs.  
5.32.1.2  
Overview  
The comparators monitor the bus activity of the CPU module. A match can initiate a state sequencer transition. On a transition  
to the Final State, bus tracing is triggered and/or a breakpoint can be generated.  
Independent of comparator matches a transition to Final State with associated tracing and breakpoint can be triggered  
immediately by writing to the TRIG control bit.  
The trace buffer is visible through a 2-byte window in the register address map and can be read out using standard 16-bit word  
reads. Tracing is disabled when the MCU system is secured.  
5.32.1.3  
Features  
Three comparators (A, B and C)  
Comparators A compares the full address bus and full 16-bit data bus  
Comparator A features a data bus mask register  
Comparators B and C compare the full address bus only  
Each comparator features selection of read or write access cycles  
Comparator B allows selection of byte or word access cycles  
Comparator matches can initiate state sequencer transitions  
Three comparator modes  
Simple address/data comparator match mode  
Inside address range mode, Addmin Address Addmax  
Outside address range match mode, Address Addminor Address Addmax  
Two types of matches  
Tagged — This matches just before a specific instruction begins execution  
Force — This is valid on the first instruction boundary after a match occurs  
Two types of breakpoints  
CPU breakpoint entering BDM on breakpoint (BDM)  
CPU breakpoint executing SWI on breakpoint (SWI)  
Trigger mode independent of comparators  
TRIG Immediate software trigger  
MM912_634 Advance Information, Rev. 11.0  
192  
Freescale Semiconductor  
Functional Description and Application Information  
Four trace modes  
Normal: change of flow (COF) PC information is stored (see Section 5.32.4.5.2.1, “Normal Mode") for change of  
flow definition.  
Loop1: same as Normal but inhibits consecutive duplicate source address entries  
Detail: address and data for all cycles except free cycles and opcode fetches are stored  
Compressed Pure PC: all program counter addresses are stored  
4-stage state sequencer for trace buffer control  
Tracing session trigger linked to Final State of state sequencer  
Begin and End alignment of tracing to trigger  
5.32.1.4  
Modes of Operation  
The DBG module can be used in all MCU functional modes.  
During BDM hardware accesses and whilst the BDM module is active, CPU monitoring is disabled. When the CPU enters active  
BDM Mode through a BACKGROUND command, the DBG module, if already armed, remains armed.  
The DBG module tracing is disabled if the MCU is secure, however, breakpoints can still be generated  
Table 268. Mode Dependent Restriction Summary  
BDM  
Enable  
BDM  
Active  
MCU  
Secure  
Comparator  
Matches Enabled  
Breakpoints  
Possible  
Tagging  
Possible  
Tracing  
Possible  
x
0
0
1
1
x
0
1
0
1
1
0
0
0
0
Yes  
Yes  
Yes  
Yes  
Yes  
No  
Only SWI  
Yes  
Active BDM not possible when not enabled  
Yes  
No  
Yes  
No  
Yes  
No  
Yes  
No  
5.32.1.5  
Block Diagram  
TAGS  
TAGHITS  
BREAKPOINT REQUESTS  
TO CPU  
SECURE  
CPU BUS  
TRANSITION  
MATCH0  
MATCH1  
MATCH2  
COMPARATOR A  
TAG &  
MATCH  
CONTROL  
LOGIC  
STATE SEQUENCER  
COMPARATOR B  
COMPARATOR C  
STATE  
TRACE  
CONTROL  
TRIGGER  
TRACE BUFFER  
READ TRACE DATA (DBG READ DATA BUS)  
Figure 62. Debug Module Block Diagram  
MM912_634 Advance Information, Rev. 11.0  
193  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.32.2  
External Signal Description  
There are no external signals associated with this module.  
5.32.3  
Memory Map and Registers  
Module Memory Map  
5.32.3.1  
A summary of the registers associated with the DBG sub-block is shown in Figure 269. Detailed descriptions of the registers and  
bits are given in the subsections that follow.  
Table 269. Quick Reference to DBG Registers  
Address  
Name  
Bit 7  
6
5
4
3
2
1
Bit 0  
R
W
R
0
TRIG  
0
0
0
0x0020  
DBGC1  
ARM  
BDM  
0
DBGBRK  
0
COMRV  
TBF(184)  
0
0
SSF2  
SSF1  
0
SSF0  
0x0021  
0x0022  
0x0023  
0x0024  
0x0025  
0x0026  
0x0027  
0x0027  
0x0028  
0x0028  
0x0028  
0x0029  
0x002A  
0x002B  
0x002C  
0x002D  
DBGSR  
DBGTCR  
DBGC2  
W
R
0
0
0
0
TSOURCE  
0
TRCMOD  
TALIGN  
W
R
0
0
0
ABCM  
W
R
Bit 15  
Bit 7  
TBF  
0
Bit 14  
Bit 13  
Bit 5  
Bit 12  
Bit 4  
Bit 11  
Bit 3  
Bit 10  
Bit 2  
Bit 9  
Bit 1  
Bit 8  
Bit 0  
DBGTBH  
DBGTBL  
DBGCNT  
DBGSCRX  
DBGMFR  
DBGACTL  
DBGBCTL  
DBGCCTL  
DBGXAH  
DBGXAM  
DBGXAL  
DBGADH  
DBGADL  
W
R
Bit 6  
W
R
0
0
0
CNT  
W
R
0
0
0
0
SC3  
0
SC2  
MC2  
SC1  
MC1  
SC0  
MC0  
W
R
0
W
R
SZE  
SZ  
TAG  
TAG  
BRK  
BRK  
RW  
RW  
RWE  
RWE  
NDB  
0
COMPE  
COMPE  
COMPE  
Bit 16  
Bit 8  
W
R
SZE  
0
SZ  
0
W
R
0
TAG  
0
BRK  
0
RW  
0
RWE  
0
W
R
0
0
Bit 17  
W
R
Bit 15  
Bit 7  
14  
6
13  
5
12  
4
11  
3
10  
2
9
1
9
1
W
R
Bit 0  
W
R
Bit 15  
Bit 7  
14  
6
13  
5
12  
4
11  
3
10  
2
Bit 8  
W
R
Bit 0  
W
MM912_634 Advance Information, Rev. 11.0  
194  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 269. Quick Reference to DBG Registers (continued)  
Address  
Name  
Bit 7  
6
5
4
3
2
1
Bit 0  
R
W
R
0x002E  
DBGADHM  
Bit 15  
14  
13  
12  
11  
10  
9
Bit 8  
0x002F  
Note:  
DBGADLM  
Bit 7  
6
5
4
3
2
1
Bit 0  
W
184. This bit is visible at DBGCNT[7] and DBGSR[7]  
185. This represents the contents if the Comparator A control register is blended into this address.  
186. This represents the contents if the Comparator B control register is blended into this address.  
187. This represents the contents if the Comparator C control register is blended into this address.  
5.32.3.2  
Register Descriptions  
This section consists of the DBG control and trace buffer register descriptions in address order. Each comparator has a bank of  
registers that are visible through an 8-byte window between 0x0028 and 0x002F in the DBG module register address map. When  
ARM is set in DBGC1, the only bits in the DBG module registers that can be written are ARM, TRIG, and COMRV[1:0]  
5.32.3.2.1  
Debug Control Register 1 (DBGC1)  
Table 270. Debug Control Register (DBGC1)  
Address: 0x0020  
7
6
5
4
3
2
1
0
R
W
0
TRIG  
0
0
0
ARM  
0
BDM  
0
DBGBRK  
0
COMRV  
Reset  
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Bits 7, 1, 0 anytime  
Bit 6 can be written anytime but always reads back as 0.  
Bits 4:3 anytime DBG is not armed.  
NOTE  
When disarming the DBG by clearing ARM with software, the contents of bits[4:3] are not  
affected by the write, since up until the write operation, ARM = 1 preventing these bits from  
being written. These bits must be cleared using a second write if required.  
MM912_634 Advance Information, Rev. 11.0  
195  
Freescale Semiconductor  
Functional Description and Application Information  
Table 271. DBGC1 Field Descriptions  
Field  
Description  
Arm Bit — The ARM bit controls whether the DBG module is armed. This bit can be set and cleared by user software and is  
automatically cleared on completion of a debug session, or if a breakpoint is generated with tracing not enabled. On setting  
this bit the state sequencer enters State1.  
7
ARM  
0
1
Debugger disarmed  
Debugger armed  
Immediate Trigger Request Bit — This bit when written to 1 requests an immediate trigger independent of state sequencer  
status. When tracing is complete a forced breakpoint may be generated depending upon DBGBRK and BDM bit settings. This  
bit always reads back a 0. Writing a 0 to this bit has no effect. If the DBGTCR_TSOURCE bit is clear no tracing is carried out.  
If tracing has already commenced using BEGIN trigger alignment, it continues until the end of the tracing session as defined  
by the TALIGN bit, thus TRIG has no affect. In secure mode tracing is disabled and writing to this bit cannot initiate a tracing  
session.  
6
TRIG  
The session is ended by setting TRIG and ARM simultaneously.  
0
1
Do not trigger until the state sequencer enters the Final State.  
Trigger immediately  
Background Debug Mode Enable — This bit determines if a breakpoint causes the system to enter Background Debug Mode  
(BDM) or initiate a Software Interrupt (SWI). If this bit is set but the BDM is not enabled by the ENBDM bit in the BDM module,  
then breakpoints default to SWI.  
4
BDM  
0
1
Breakpoint to Software Interrupt if BDM inactive. Otherwise no breakpoint.  
Breakpoint to BDM, if BDM enabled. Otherwise breakpoint to SWI  
S12IPIMV1 Breakpoint Enable Bit — The DBGBRK bit controls whether the debugger will request a breakpoint on reaching  
the state sequencer Final State. If tracing is enabled, the breakpoint is generated on completion of the tracing session. If tracing  
is not enabled, the breakpoint is generated immediately.  
3
DBGBRK  
0
1
No Breakpoint generated  
Breakpoint generated  
Comparator Register Visibility Bits — These bits determine which bank of comparator register is visible in the 8-byte window  
of the S12SDBG module address map, located between 0x0028 to 0x002F. Furthermore these bits determine which register  
is visible at the address 0x0027. See Table 272.  
1–0  
COMRV  
Table 272. COMRV Encoding  
COMRV  
Visible Comparator  
Visible Register at 0x0027  
00  
01  
10  
11  
Comparator A  
Comparator B  
Comparator C  
None  
DBGSCR1  
DBGSCR2  
DBGSCR3  
DBGMFR  
5.32.3.2.2  
Debug Status Register (DBGSR)  
Table 273. Debug Status Register (DBGSR)  
Address: 0x0021  
7
6
5
4
3
2
1
0
R
TBF  
0
0
0
0
SSF2  
SSF1  
SSF0  
W
Reset  
POR  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Never  
MM912_634 Advance Information, Rev. 11.0  
196  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 274. DBGSR Field Descriptions  
Field  
Description  
Trace Buffer Full — The TBF bit indicates that the trace buffer has stored 64 or more lines of data since it was last armed. If  
this bit is set, then all 64 lines will be valid data, regardless of the value of DBGCNT bits. The TBF bit is cleared when ARM in  
DBGC1 is written to a one. The TBF is cleared by the power on reset initialization. Other system generated resets have no  
affect on this bit  
7
TBF  
This bit is also visible at DBGCNT[7]  
State Sequencer Flag Bits — The SSF bits indicate in which state the State Sequencer is currently in. During a debug session  
on each transition to a new state these bits are updated. If the debug session is ended by software clearing the ARM bit, then  
these bits retain their value to reflect the last state of the state sequencer before disarming. If a debug session is ended by an  
internal event, then the state sequencer returns to state0 and these bits are cleared to indicate that state0 was entered during  
the session. On arming the module the state sequencer enters state1 and these bits are forced to SSF[2:0] = 001. See  
Table 275.  
2–0  
SSF[2:0]  
Table 275. SSF[2:0] — State Sequence Flag Bit Encoding  
SSF[2:0]  
Current State  
000  
001  
State0 (disarmed)  
State1  
010  
State2  
011  
State3  
100  
Final State  
Reserved  
101,110,111  
5.32.3.2.3  
Debug Trace Control Register (DBGTCR)  
Table 276. Debug Trace Control Register (DBGTCR)  
Address: 0x0022  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
TSOURCE  
0
TRCMOD  
0
TALIGN  
0
Reset  
0
0
0
0
0
Read: Anytime  
Write: Bit 6 only when DBG is neither secure nor armed.Bits 3,2,0 anytime the module is disarmed.  
Table 277. DBGTCR Field Descriptions  
Field  
Description  
Trace Source Control Bit — The TSOURCE bit enables a tracing session given a trigger condition. If the MCU system is  
secured, this bit cannot be set and tracing is inhibited.  
This bit must be set to read the trace buffer.  
6
TSOURCE  
0
1
Debug session without tracing requested  
Debug session with tracing requested  
Trace Mode Bits — See Section 5.32.4.5.2, “Trace Modes" for detailed Trace Mode descriptions. In Normal Mode, change of  
flow information is stored. In Loop1 Mode, change of flow information is stored but redundant entries into trace memory are  
inhibited. In Detail Mode, address and data for all memory and register accesses is stored. In Compressed Pure PC mode the  
program counter value for each instruction executed is stored. See Table 278.  
3–2  
TRCMOD  
Trigger Align Bit — This bit controls whether the trigger is aligned to the beginning or end of a tracing session.  
0
0
1
Trigger at end of stored data  
Trigger before storing data  
TALIGN  
MM912_634 Advance Information, Rev. 11.0  
197  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 278. TRCMOD Trace Mode Bit Encoding  
TRCMOD  
Description  
00  
01  
10  
Normal  
Loop1  
Detail  
11  
Compressed Pure PC  
5.32.3.2.4  
Debug Control Register2 (DBGC2)  
Table 279. Debug Control Register2 (DBGC2)  
Address: 0x0023  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
ABCM  
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Anytime the module is disarmed.  
This register configures the comparators for range matching.  
Table 280. DBGC2 Field Descriptions  
Field  
Description  
1–0  
A and B Comparator Match Control — These bits determine the A and B comparator match mapping as described in Table 281.  
ABCM[1:0]  
Table 281. ABCM Encoding  
ABCM  
Description  
00  
01  
10  
11  
Match0 mapped to comparator A match: Match1 mapped to comparator B match.  
Match 0 mapped to comparator A/B inside range: Match1 disabled.  
Match 0 mapped to comparator A/B outside range: Match1 disabled.  
Reserved(188)  
Note:  
188. Currently defaults to Comparator A, Comparator B disabled  
5.32.3.2.5  
Debug Trace Buffer Register (DBGTBH:DBGTBL)  
Table 282. Debug Trace Buffer Register (DBGTB)  
Address: 0x0024, 0x0025  
15 14  
13  
12  
11  
10  
9
8
7
6
5
4
3
2
1
0
R
W
Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9  
Bit 8  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
POR  
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Other  
Resets  
MM912_634 Advance Information, Rev. 11.0  
198  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Read: Only when unlocked AND unsecured AND not armed AND TSOURCE set.  
Write: Aligned word writes when disarmed unlock the trace buffer for reading but do not affect trace buffer contents.  
Table 283. DBGTB Field Descriptions  
Field  
Description  
Trace Buffer Data Bits — The Trace Buffer Register is a window through which the 20-bit wide data lines of the Trace Buffer  
may be read 16 bits at a time. Each valid read of DBGTB increments an internal trace buffer pointer which points to the next  
address to be read. When the ARM bit is set the trace buffer is locked to prevent reading. The trace buffer can only be unlocked  
for reading by writing to DBGTB with an aligned word write when the module is disarmed. The DBGTB register can be read  
only as an aligned word, any byte reads or misaligned access of these registers return 0 and do not cause the trace buffer  
pointer to increment to the next trace buffer address. Similarly reads while the debugger is armed or with the TSOURCE bit  
clear, return 0 and do not affect the trace buffer pointer. The POR state is undefined. Other resets do not affect the trace buffer  
contents.  
15–0  
Bit[15:0]  
5.32.3.2.6  
Debug Count Register (DBGCNT)  
Table 284. Debug Count Register (DBGCNT)  
Address: 0x0026  
7
6
5
4
3
2
1
0
R
TBF  
0
CNT  
W
Reset  
POR  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Never  
Table 285. DBGCNT Field Descriptions  
Field  
Description  
Trace Buffer Full — The TBF bit indicates that the trace buffer has stored 64 or more lines of data since it was last armed. If  
this bit is set, then all 64 lines will be valid data, regardless of the value of DBGCNT bits. The TBF bit is cleared when ARM in  
DBGC1 is written to a one. The TBF is cleared by the power on reset initialization. Other system generated resets have no  
affect on this bit  
7
TBF  
This bit is also visible at DBGSR[7]  
Count Value — The CNT bits indicate the number of valid data 20-bit data lines stored in the Trace Buffer. Table 286 shows  
the correlation between the CNT bits and the number of valid data lines in the Trace Buffer. When the CNT rolls over to zero,  
the TBF bit in DBGSR is set and incrementing of CNT will continue in end-trigger mode. The DBGCNT register is cleared when  
ARM in DBGC1 is written to a one. The DBGCNT register is cleared by power-on-reset initialization but is not cleared by other  
system resets. Thus should a reset occur during a debug session, the DBGCNT register still indicates after the reset, the  
number of valid trace buffer entries stored before the reset occurred. The DBGCNT register is not decremented when reading  
from the trace buffer.  
5–0  
CNT[5:0]  
MM912_634 Advance Information, Rev. 11.0  
199  
Freescale Semiconductor  
Functional Description and Application Information  
Table 286. CNT Decoding Table  
TBF  
CNT[5:0]  
Description  
0
000000  
No data valid  
000001  
000010  
000100  
000110  
1 line valid  
2 lines valid  
4 lines valid  
6 lines valid  
0
111111  
63 lines valid  
64 lines valid; if using Begin trigger alignment,  
ARM bit will be cleared and the tracing session ends.  
1
1
000000  
000001  
64 lines valid,  
oldest data has been overwritten by most recent data  
111110  
5.32.3.2.7  
Debug State Control Registers  
There is a dedicated control register for each of the state sequencer states 1 to 3 that determines if transitions from that state are  
allowed, depending upon comparator matches or tag hits, and defines the next state for the state sequencer following a match.  
The three debug state control registers are located at the same address in the register address map (0x0027). Each register can  
be accessed using the COMRV bits in DBGC1 to blend in the required register. The COMRV = 11 value blends in the match flag  
register (DBGMFR).  
Table 287. State Control Register Access Encoding  
COMRV  
Visible State Control Register  
00  
01  
10  
11  
DBGSCR1  
DBGSCR2  
DBGSCR3  
DBGMFR  
5.32.3.2.7.1  
Debug State Control Register 1 (DBGSCR1)  
Table 288. Debug State Control Register 1 (DBGSCR1)  
Address: 0x0027  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
SC3  
0
SC2  
0
SC1  
0
SC0  
0
Reset  
0
0
0
0
= Unimplemented or Reserved  
Read: If COMRV[1:0] = 00  
Write: If COMRV[1:0] = 00 and DBG is not armed.  
This register is visible at 0x0027 only with COMRV[1:0] = 00. The state control register 1 selects the targeted next state whilst in  
State1. The matches refer to the match channels of the comparator match control logic as depicted in Figure 62 and described  
in Section 5.32.3.2.8.1, “Debug Comparator Control Register (DBGXCTL)". Comparators must be enabled by setting the  
comparator enable bit in the associated DBGXCTL control register.  
MM912_634 Advance Information, Rev. 11.0  
200  
Freescale Semiconductor  
Functional Description and Application Information  
Table 289. DBGSCR1 Field Descriptions  
Field  
Description  
3–0  
These bits select the targeted next state whilst in State1, based upon the match event.  
SC[3:0]  
Table 290. State1 Sequencer Next State Selection  
SC[3:0]  
Description (Unspecified matches have no effect)  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
1111  
Any match to Final State  
Match1 to State3  
Match2 to State2  
Match1 to State2  
Match0 to State2....... Match1 to State3  
Match1 to State3.........Match0 to Final State  
Match0 to State2....... Match2 to State3  
Either Match0 or Match1 to State2  
Reserved  
Match0 to State3  
Reserved  
Reserved  
Reserved  
Either Match0 or Match2 to Final State........Match1 to State2  
Reserved  
Reserved  
The priorities described in Table 323 dictate that in the case of simultaneous matches, a match leading to final state has priority  
followed by the match on the lower channel number (0,1,2). Thus with SC[3:0]=1101 a simultaneous match0/match1 transitions  
to final state.  
5.32.3.2.7.2  
Debug State Control Register 2 (DBGSCR2)  
Table 291. Debug State Control Register 2 (DBGSCR2)  
Address: 0x0027  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
SC3  
0
SC2  
0
SC1  
0
SC0  
0
Reset  
0
0
0
0
= Unimplemented or Reserved  
Read: If COMRV[1:0] = 01  
Write: If COMRV[1:0] = 01 and DBG is not armed.  
This register is visible at 0x0027 only with COMRV[1:0] = 01. The state control register 2 selects the targeted next state whilst in  
State2. The matches refer to the match channels of the comparator match control logic as depicted in Figure 62 and described  
in Section 5.32.3.2.8.1, “Debug Comparator Control Register (DBGXCTL)". Comparators must be enabled by setting the  
comparator enable bit in the associated DBGXCTL control register.  
MM912_634 Advance Information, Rev. 11.0  
201  
Freescale Semiconductor  
Functional Description and Application Information  
Table 292. DBGSCR2 Field Descriptions  
Field  
Description  
3–0  
These bits select the targeted next state whilst in State2, based upon the match event.  
SC[3:0]  
Table 293. State2 —Sequencer Next State Selection  
SC[3:0]  
Description (Unspecified matches have no effect)  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
1111  
Match0 to State1....... Match2 to State3.  
Match1 to State3  
Match2 to State3  
Match1 to State3....... Match0 Final State  
Match1 to State1....... Match2 to State3.  
Match2 to Final State  
Match2 to State1..... Match0 to Final State  
Either Match0 or Match1 to Final State  
Reserved  
Reserved  
Reserved  
Reserved  
Either Match0 or Match1 to Final State........Match2 to State3  
Reserved  
Reserved  
Either Match0 or Match1 to Final State........Match2 to State1  
The priorities described in Table 323 dictate that in the case of simultaneous matches, a match leading to final state has priority  
followed by the match on the lower channel number (0,1,2)  
5.32.3.2.7.3  
Debug State Control Register 3 (DBGSCR3)  
Table 294. Debug State Control Register 3 (DBGSCR3)  
Address: 0x0027  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
SC3  
0
SC2  
0
SC1  
0
SC0  
0
Reset  
0
0
0
0
= Unimplemented or Reserved  
Read: If COMRV[1:0] = 10  
Write: If COMRV[1:0] = 10 and DBG is not armed.  
This register is visible at 0x0027 only with COMRV[1:0] = 10. The state control register three selects the targeted next state whilst  
in State3. The matches refer to the match channels of the comparator match control logic as depicted in Figure 62 and described  
in Section 5.32.3.2.8.1, “Debug Comparator Control Register (DBGXCTL)". Comparators must be enabled by setting the  
comparator enable bit in the associated DBGXCTL control register.  
MM912_634 Advance Information, Rev. 11.0  
202  
Freescale Semiconductor  
Functional Description and Application Information  
Table 295. DBGSCR3 Field Descriptions  
Field  
Description  
3–0  
These bits select the targeted next state whilst in State3, based upon the match event.  
SC[3:0]  
Table 296. State3 — Sequencer Next State Selection  
SC[3:0]  
Description (Unspecified matches have no effect)  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
1111  
Match0 to State1  
Match2 to State2........ Match1 to Final State  
Match0 to Final State....... Match1 to State1  
Match1 to Final State....... Match2 to State1  
Match1 to State2  
Match1 to Final State  
Match2 to State2........ Match0 to Final State  
Match0 to Final State  
Reserved  
Reserved  
Either Match1 or Match2 to State1....... Match0 to Final State  
Reserved  
Reserved  
Either Match1 or Match2 to Final State....... Match0 to State1  
Match0 to State2....... Match2 to Final State  
Reserved  
The priorities described in Table 323 dictate that in the case of simultaneous matches, a match leading to final state has priority  
followed by the match on the lower channel number (0,1,2).  
5.32.3.2.7.4  
Debug Match Flag Register (DBGMFR)  
Table 297. Debug Match Flag Register (DBGMFR)  
Address: 0x0027  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
MC2  
MC1  
MC0  
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: If COMRV[1:0] = 11  
Write: Never  
DBGMFR is visible at 0x0027 only with COMRV[1:0] = 11. It features 3 flag bits each mapped directly to a channel. Should a  
match occur on the channel during the debug session, then the corresponding flag is set and remains set until the next time the  
module is armed by writing to the ARM bit. Thus the contents are retained after a debug session for evaluation purposes. These  
flags cannot be cleared by software, they are cleared only when arming the module. A set flag does not inhibit the setting of other  
flags. Once a flag is set, further comparator matches on the same channel in the same session have no affect on that flag.  
MM912_634 Advance Information, Rev. 11.0  
203  
Freescale Semiconductor  
Functional Description and Application Information  
5.32.3.2.8  
Comparator Register Descriptions  
Each comparator has a bank of registers that are visible through an 8-byte window in the DBG module register address map.  
Comparator A consists of 8 register bytes (3 address bus compare registers, two data bus compare registers, two data bus mask  
registers and a control register). Comparator B consists of four register bytes (three address bus compare registers and a control  
register). Comparator C consists of four register bytes (three address bus compare registers and a control register).  
Each set of comparator registers can be accessed using the COMRV bits in the DBGC1 register. Unimplemented registers (e.g.  
Comparator B data bus and data bus masking) read as zero and cannot be written. The control register for comparator B differs  
from those of comparators A and C.  
Table 298. Comparator Register Layout  
0x0028  
0x0029  
0x002A  
0x002B  
0x002C  
0x002D  
0x002E  
0x002F  
CONTROL  
ADDRESS HIGH  
Read/Write  
Read/Write  
Read/Write  
Read/Write  
Read/Write  
Read/Write  
Read/Write  
Read/Write  
Comparators A,B and C  
Comparators A,B and C  
Comparators A,B and C  
Comparators A,B and C  
Comparator A only  
ADDRESS MEDIUM  
ADDRESS LOW  
DATA HIGH COMPARATOR  
DATA LOW COMPARATOR  
DATA HIGH MASK  
Comparator A only  
Comparator A only  
DATA LOW MASK  
Comparator A only  
5.32.3.2.8.1  
Debug Comparator Control Register (DBGXCTL)  
The contents of this register bits 7 and 6 differ depending upon which comparator registers are visible in the 8-byte window of the  
DBG module register address map.  
Table 299. Debug Comparator Control Register DBGACTL (Comparator A)  
Address: 0x0028  
7
6
5
4
3
2
1
0
R
W
SZE  
0
SZ  
0
TAG  
0
BRK  
0
RW  
0
RWE  
0
NDB  
0
COMPE  
0
Reset  
= Unimplemented or Reserved  
Table 300. Debug Comparator Control Register DBGBCTL (Comparator B)  
Address: 0x0028  
7
6
5
4
3
2
1
0
R
W
0
SZE  
0
SZ  
0
TAG  
0
BRK  
0
RW  
0
RWE  
0
COMPE  
0
Reset  
0
= Unimplemented or Reserved  
Table 301. Debug Comparator Control Register DBGCCTL (Comparator C)  
Address: 0x0028  
7
6
5
4
3
2
1
0
R
W
0
0
0
TAG  
0
BRK  
0
RW  
0
RWE  
0
COMPE  
0
Reset  
0
0
0
= Unimplemented or Reserved  
MM912_634 Advance Information, Rev. 11.0  
204  
Freescale Semiconductor  
Functional Description and Application Information  
Read: DBGACTL if COMRV[1:0] = 00  
DBGBCTL if COMRV[1:0] = 01  
DBGCCTL if COMRV[1:0] = 10  
Write: DBGACTL if COMRV[1:0] = 00 and DBG not armed  
DBGBCTL if COMRV[1:0] = 01 and DBG not armed  
DBGCCTL if COMRV[1:0] = 10 and DBG not armed  
Table 302. DBGXCTL Field Descriptions  
Field  
Description  
Size Comparator Enable Bit — The SZE bit controls whether access size comparison is enabled for the associated  
comparator. This bit is ignored if the TAG bit in the same register is set.  
7
SZE  
0
1
Word/Byte access size is not used in comparison  
Word/Byte access size is used in comparison  
(Comparators  
A and B)  
Size Comparator Value Bit — The SZ bit selects either word or byte access size in comparison for the associated  
comparator. This bit is ignored if the SZE bit is cleared or if the TAG bit in the same register is set.  
6
SZ  
0
1
Word access size is compared  
Byte access size is compared  
(Comparators  
A and B)  
Tag Select — This bit controls whether the comparator match has immediate effect, causing an immediate state sequencer  
transition or tag the opcode at the matched address. Tagged opcodes trigger only if they reach the execution stage of the  
instruction queue.  
5
TAG  
0
1
Allow state sequencer transition immediately on match  
On match, tag the opcode. If the opcode is about to be executed allow a state sequencer transition  
Break — This bit controls whether a comparator match terminates a debug session immediately, independent of state  
sequencer state. To generate an immediate breakpoint the module breakpoints must be enabled using the DBGC1 bit  
DBGBRK.  
4
0
1
The debug session termination is dependent upon the state sequencer and trigger conditions.  
BRK  
A match on this channel terminates the debug session immediately; breakpoints if active are generated, tracing,  
if active, is terminated and the module disarmed.  
Read/Write Comparator Value Bit — The RW bit controls whether read or write is used in compare for the associated  
comparator. The RW bit is not used if RWE = 0. This bit is ignored if the TAG bit in the same register is set.  
3
RW  
0
Write cycle is matched1 Read cycle is matched  
Read/Write Enable Bit — The RWE bit controls whether read or write comparison is enabled for the associated  
comparator.This bit is ignored if the TAG bit in the same register is set  
2
0
1
Read/Write is not used in comparison  
Read/Write is used in comparison  
RWE  
Not Data Bus — The NDB bit controls whether the match occurs when the data bus matches the comparator register value  
or when the data bus differs from the register value. This bit is ignored if the TAG bit in the same register is set. This bit is  
only available for comparator A.  
1
NDB  
(Comparator A)  
0
1
Match on data bus equivalence to comparator register contents  
Match on data bus difference to comparator register contents  
Determines if comparator is enabled  
0
0
1
The comparator is not enabled  
The comparator is enabled  
COMPE  
Table 303 shows the effect for RWE and RW on the comparison conditions. These bits are ignored if the corresponding TAG bit  
is set since the match occurs based on the tagged opcode reaching the execution stage of the instruction queue.  
MM912_634 Advance Information, Rev. 11.0  
205  
Freescale Semiconductor  
Functional Description and Application Information  
Table 303. Read or Write Comparison Logic Table  
RWE Bit  
RW Bit  
RW Signal  
Comment  
0
0
1
1
1
1
x
x
0
0
1
1
0
1
0
1
0
1
RW not used in comparison  
RW not used in comparison  
Write data bus  
No match  
No match  
Read data bus  
5.32.3.2.8.2  
Debug Comparator Address High Register (DBGXAH)  
Table 304. Debug Comparator Address High Register (DBGXAH)  
Address: 0x0029  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
Bit 17  
0
Bit 16  
0
Reset  
0
0
0
0
0
0
= Unimplemented or Reserved  
The DBGC1_COMRV bits determine which comparator address registers are visible in the 8-byte window from 0x0028 to 0x002F  
as shown in Table 305.  
Table 305. Comparator Address Register Visibility  
COMRV  
Visible Comparator  
00  
01  
10  
11  
DBGAAH, DBGAAM, DBGAAL  
DBGBAH, DBGBAM, DBGBAL  
DBGCAH, DBGCAM, DBGCAL  
None  
Read: Anytime. See Table 305 for visible register encoding.  
Write: If DBG not armed. See Table 305 for visible register encoding.  
Table 306. DBGXAH Field Descriptions  
Field  
Description  
Comparator Address High Compare Bits — The Comparator address high compare bits control whether the selected  
comparator compares the address bus bits [17:16] to a logic one or logic zero.  
1–0  
0
1
Compare corresponding address bit to a logic zero  
Compare corresponding address bit to a logic one  
Bit[17:16]  
MM912_634 Advance Information, Rev. 11.0  
206  
Freescale Semiconductor  
 
Functional Description and Application Information  
Debug Comparator Address Mid Register (DBGXAM)  
5.32.3.2.8.3  
Table 307. Debug Comparator Address Mid Register (DBGXAM)  
Address: 0x002A  
7
6
5
4
3
2
1
0
R
W
Bit 15  
0
Bit 14  
0
Bit 13  
0
Bit 12  
0
Bit 11  
0
Bit 10  
0
Bit 9  
0
Bit 8  
0
Reset  
Read: Anytime. See Table 305 for visible register encoding.  
Write: If DBG not armed. See Table 305 for visible register encoding.  
Table 308. DBGXAM Field Descriptions  
Field  
Description  
Comparator Address Mid Compare Bits — The Comparator address mid compare bits control whether the selected  
comparator compares the address bus bits [15:8] to a logic one or logic zero.  
7–0  
0
1
Compare corresponding address bit to a logic zero  
Compare corresponding address bit to a logic one  
Bit[15:8]  
5.32.3.2.8.4  
Debug Comparator Address Low Register (DBGXAL)  
Table 309. Debug Comparator Address Low Register (DBGXAL)  
Address: 0x002B  
7
6
5
4
3
2
1
0
R
W
Bit 7  
0
Bit 6  
0
Bit 5  
0
Bit 4  
0
Bit 3  
0
Bit 2  
0
Bit 1  
0
Bit 0  
0
Reset  
Read: Anytime. See Table 305 for visible register encoding.  
Write: If DBG not armed. See Table 305 for visible register encoding.  
Table 310. DBGXAL Field Descriptions  
Field  
Description  
Comparator Address Low Compare Bits — The Comparator address low compare bits control whether the selected  
comparator compares the address bus bits [7:0] to a logic one or logic zero.  
7–0  
0
1
Compare corresponding address bit to a logic zero  
Compare corresponding address bit to a logic one  
Bits[7:0]  
MM912_634 Advance Information, Rev. 11.0  
207  
Freescale Semiconductor  
Functional Description and Application Information  
5.32.3.2.8.5  
Debug Comparator Data High Register (DBGADH)  
Table 311. Debug Comparator Data High Register (DBGADH)  
Address: 0x002C  
7
6
5
4
3
2
1
0
R
W
Bit 15  
0
Bit 14  
0
Bit 13  
0
Bit 12  
0
Bit 11  
0
Bit 10  
0
Bit 9  
0
Bit 8  
0
Reset  
Read: If COMRV[1:0] = 00  
Write: If COMRV[1:0] = 00 and DBG not armed.  
Table 312. DBGADH Field Descriptions  
Field  
Description  
Comparator Data High Compare Bits— The Comparator data high compare bits control whether the selected comparator  
compares the data bus bits [15:8] to a logic one or logic zero. The comparator data compare bits are only used in comparison  
if the corresponding data mask bit is logic 1. This register is available only for comparator A. Data bus comparisons are only  
performed if the TAG bit in DBGACTL is clear.  
7–0  
Bits[15:8]  
0
1
Compare corresponding data bit to a logic zero  
Compare corresponding data bit to a logic one  
5.32.3.2.8.6  
Debug Comparator Data Low Register (DBGADL)  
Table 313. Debug Comparator Data Low Register (DBGADL)  
Address: 0x002D  
7
6
5
4
3
2
1
0
R
W
Bit 7  
0
Bit 6  
0
Bit 5  
0
Bit 4  
0
Bit 3  
0
Bit 2  
0
Bit 1  
0
Bit 0  
0
Reset  
Read: If COMRV[1:0] = 00  
Write: If COMRV[1:0] = 00 and DBG not armed.  
Table 314. DBGADL Field Descriptions  
Field  
Description  
Comparator Data Low Compare Bits — The Comparator data low compare bits control whether the selected comparator  
compares the data bus bits [7:0] to a logic one or logic zero. The comparator data compare bits are only used in comparison if  
the corresponding data mask bit is logic 1. This register is available only for comparator A. Data bus comparisons are only  
performed if the TAG bit in DBGACTL is clear  
7–0  
Bits[7:0]  
0
1
Compare corresponding data bit to a logic zero  
Compare corresponding data bit to a logic one  
MM912_634 Advance Information, Rev. 11.0  
208  
Freescale Semiconductor  
Functional Description and Application Information  
Debug Comparator Data High Mask Register (DBGADHM)  
5.32.3.2.8.7  
Table 315. Debug Comparator Data High Mask Register (DBGADHM)  
Address: 0x002E  
7
6
5
4
3
2
1
0
R
W
Bit 15  
0
Bit 14  
0
Bit 13  
0
Bit 12  
0
Bit 11  
0
Bit 10  
0
Bit 9  
0
Bit 8  
0
Reset  
Read: If COMRV[1:0] = 00  
Write: If COMRV[1:0] = 00 and DBG not armed.  
Table 316. DBGADHM Field Descriptions  
Field  
Description  
Comparator Data High Mask Bits — The Comparator data high mask bits control whether the selected comparator compares  
the data bus bits [15:8] to the corresponding comparator data compare bits. Data bus comparisons are only performed if the  
TAG bit in DBGACTL is clear  
7–0  
Bits[15:8]  
0
1
Do not compare corresponding data bit Any value of corresponding data bit allows match.  
Compare corresponding data bit  
5.32.3.2.8.8  
Debug Comparator Data Low Mask Register (DBGADLM)  
Table 317. Debug Comparator Data Low Mask Register (DBGADLM)  
Address: 0x002F  
7
6
5
4
3
2
1
0
R
W
Bit 7  
0
Bit 6  
0
Bit 5  
0
Bit 4  
0
Bit 3  
0
Bit 2  
0
Bit 1  
0
Bit 0  
0
Reset  
Read: If COMRV[1:0] = 00  
Write: If COMRV[1:0] = 00 and DBG not armed.  
Table 318. DBGADLM Field Descriptions  
Field  
Description  
Comparator Data Low Mask Bits — The Comparator data low mask bits control whether the selected comparator compares  
the data bus bits [7:0] to the corresponding comparator data compare bits. Data bus comparisons are only performed if the  
TAG bit in DBGACTL is clear  
7–0  
Bits[7:0]  
0
1
Do not compare corresponding data bit. Any value of corresponding data bit allows match  
Compare corresponding data bit  
5.32.4  
Functional Description  
This section provides a complete functional description of the DBG module. If the part is in secure mode, the DBG module can  
generate breakpoints but tracing is not possible.  
5.32.4.1  
S12IPIMV1 Operation  
Arming the DBG module by setting ARM in DBGC1 allows triggering the state sequencer, storing of data in the trace buffer and  
generation of breakpoints to the CPU. The DBG module is made up of four main blocks, the comparators, control logic, the state  
sequencer, and the trace buffer.  
MM912_634 Advance Information, Rev. 11.0  
209  
Freescale Semiconductor  
Functional Description and Application Information  
The comparators monitor the bus activity of the CPU. All comparators can be configured to monitor address bus activity.  
Comparator A can also be configured to monitor data bus activity and mask out individual data bus bits during a compare.  
Comparators can be configured to use R/W and word/byte access qualification in the comparison. A match with a comparator  
register value can initiate a state sequencer transition to another state (see Figure 64). Either forced or tagged matches are  
possible. Using a forced match, a state sequencer transition can occur immediately on a successful match of system busses and  
comparator registers. Whilst tagging, at a comparator match, the instruction opcode is tagged and only if the instruction reaches  
the execution stage of the instruction queue can a state sequencer transition occur. In the case of a transition to Final State, bus  
tracing is triggered and/or a breakpoint can be generated.  
A state sequencer transition to final state (with associated breakpoint, if enabled) can be initiated by writing to the TRIG bit in the  
DBGC1 control register.  
The trace buffer is visible through a 2-byte window in the register address map and must be read out using standard 16-bit word  
reads.  
TAGS  
TAGHITS  
BREAKPOINT REQUESTS  
TO CPU  
SECURE  
CPU BUS  
TRANSITION  
MATCH0  
MATCH1  
MATCH2  
COMPARATOR A  
COMPARATOR B  
COMPARATOR C  
TAG &  
MATCH  
CONTROL  
LOGIC  
STATE SEQUENCER  
STATE  
TRACE  
CONTROL  
TRIGGER  
TRACE BUFFER  
READ TRACE DATA (DBG READ DATA BUS)  
Figure 63. DBG Overview  
5.32.4.2  
Comparator Modes  
The DBG contains three comparators, A, B and C. Each comparator compares the system address bus with the address stored  
in DBGXAH, DBGXAM, and DBGXAL. Furthermore, comparator A also compares the data buses to the data stored in DBGADH,  
DBGADL and allows masking of individual data bus bits.  
All comparators are disabled in BDM and during BDM accesses.  
The comparator match control logic (see Figure 63) configures comparators to monitor the buses for an exact address or an  
address range, whereby either an access inside or outside the specified range generates a match condition. The comparator  
configuration is controlled by the control register contents and the range control by the DBGC2 contents.  
A match can initiate a transition to another state sequencer state (see Section 5.32.4.4, “State Sequence Control"). The  
comparator control register also allows the type of access to be included in the comparison through the use of the RWE, RW,  
SZE, and SZ bits. The RWE bit controls whether read or write comparison is enabled for the associated comparator and the RW  
bit selects either a read or write access for a valid match. Similarly the SZE and SZ bits allow the size of access (word or byte)  
to be considered in the compare. Only comparators A and B feature SZE and SZ.  
The TAG bit in each comparator control register is used to determine the match condition. By setting TAG, the comparator  
qualifies a match with the output of opcode tracking logic and a state sequencer transition occurs when the tagged instruction  
reaches the CPU execution stage. Whilst tagging the RW, RWE, SZE, and SZ bits and the comparator data registers are ignored;  
the comparator address register must be loaded with the exact opcode address.  
MM912_634 Advance Information, Rev. 11.0  
210  
Freescale Semiconductor  
 
Functional Description and Application Information  
If the TAG bit is clear (forced type match) a comparator match is generated when the selected address appears on the system  
address bus. If the selected address is an opcode address, the match is generated when the opcode is fetched from the memory,  
which precedes the instruction execution by an indefinite number of cycles due to instruction pipelining. For a comparator match  
of an opcode at an odd address when TAG = 0, the corresponding even address must be contained in the comparator register.  
Thus for an opcode at odd address (n), the comparator register must contain address (n–1).  
Once a successful comparator match has occurred, the condition that caused the original match is not verified again on  
subsequent matches. Thus if a particular data value is verified at a given address, this address may not still contain that data  
value when a subsequent match occurs.  
Match[0, 1, 2] map directly to Comparators [A, B, C] respectively, except in range modes (see Section 5.32.3.2.4, “Debug Control  
Register2 (DBGC2)"). Comparator channel priority rules are described in the priority section (Section 5.32.4.3.4, “Channel  
Priorities").  
5.32.4.2.1  
Single Address Comparator Match  
With range comparisons disabled, the match condition is an exact equivalence of address bus with the value stored in the  
comparator address registers. Further qualification of the type of access (R/W, word/byte) and data bus contents is possible,  
depending on comparator channel.  
5.32.4.2.1.1  
Comparator C  
Comparator C offers only address and direction (R/W) comparison. The exact address is compared, thus with the comparator  
address register loaded with address (n) a word access of address (n–1) also accesses (n) but does not cause a match.  
Table 319. Comparator C Access Considerations  
Condition For Valid Match  
Comp C Address  
RWE  
RW  
Examples  
LDAA ADDR[n]  
STAA #$BYTE ADDR[n]  
Read and write accesses of ADDR[n]  
ADDR[n](189)  
0
X
Write accesses of ADDR[n]  
Read accesses of ADDR[n]  
ADDR[n]  
ADDR[n]  
1
1
0
1
STAA #$BYTE ADDR[n]  
LDAA #$BYTE ADDR[n]  
Note:  
189. A word access of ADDR[n-1] also accesses ADDR[n] but does not generate a match. The comparator address register must contain  
the exact address from the code.  
5.32.4.2.1.2  
Comparator B  
Comparator B offers address, direction (R/W) and access size (word/byte) comparison. If the SZE bit is set the access size (word  
or byte) is compared with the SZ bit value such that only the specified size of access causes a match. Thus if configured for a  
byte access of a particular address, a word access covering the same address does not lead to match.  
Assuming the access direction is not qualified (RWE=0), for simplicity, the size access considerations are shown in Table 320.  
Table 320. Comparator B Access Size Considerations  
Condition For Valid Match  
Comp B Address  
RWE  
SZE  
SZ8  
Examples  
MOVB #$BYTE ADDR[n]  
MOVW #$WORD ADDR[n]  
Word and byte accesses of ADDR[n]  
ADDR[n](190)  
0
0
X
MOVW #$WORD ADDR[n]  
LDD ADDR[n]  
Word accesses of ADDR[n] only  
ADDR[n]  
0
1
0
Note:  
190. A word access of ADDR[n-1] also accesses ADDR[n] but does not generate a match. The comparator address register must contain  
the exact address from the code.  
Access direction can also be used to qualify a match for Comparator B in the same way as described for Comparator C in  
Table 319.  
MM912_634 Advance Information, Rev. 11.0  
211  
Freescale Semiconductor  
 
 
 
 
Functional Description and Application Information  
5.32.4.2.1.3  
Comparator A  
Comparator A offers address, direction (R/W), access size (word/byte) and data bus comparison.  
Table 321 lists access considerations with data bus comparison. On word accesses the data byte of the lower address is mapped  
to DBGADH. Access direction can also be used to qualify a match for Comparator A in the same way as described for Comparator  
C in Table 319.  
Table 321. Comparator A Matches When Accessing ADDR[n]  
DBGADHM,  
SZE  
SZ  
Access DH=DBGADH, DL=DBGADL  
Comment  
No data bus comparison  
DBGADLM  
Byte  
Word  
0
0
X
X
$0000  
Byte, data(ADDR[n])=DH  
Word, data(ADDR[n])=DH, data(ADDR[n+1])=X  
Match data(ADDR[n])  
$FF00  
0
0
0
0
1
1
1
1
1
1
X
X
X
X
0
0
0
0
1
1
$00FF  
$00FF  
$FFFF  
$FFFF  
$0000  
$00FF  
$FF00  
$FFFF  
$0000  
$FF00  
Word, data(ADDR[n])=X, data(ADDR[n+1])=DL  
Byte, data(ADDR[n])=X, data(ADDR[n+1])=DL  
Word, data(ADDR[n])=DH, data(ADDR[n+1])=DL  
Byte, data(ADDR[n])=DH, data(ADDR[n+1])=DL  
Word  
Match data(ADDR[n+1])  
Possible unintended match  
Match data(ADDR[n], ADDR[n+1])  
Possible unintended match  
No data bus comparison  
Word, data(ADDR[n])=X, data(ADDR[n+1])=DL  
Word, data(ADDR[n])=DH, data(ADDR[n+1])=X  
Word, data(ADDR[n])=DH, data(ADDR[n+1])=DL  
Byte  
Match only data at ADDR[n+1]  
Match only data at ADDR[n]  
Match data at ADDR[n] & ADDR[n+1]  
No data bus comparison  
Byte, data(ADDR[n])=DH  
Match data at ADDR[n]  
5.32.4.2.1.4  
Comparator A Data Bus Comparison NDB Dependency  
Comparator A features an NDB control bit, which allows data bus comparators to be configured to either trigger on equivalence  
or trigger on difference. This allows monitoring of a difference in the contents of an address location from an expected value.  
When matching on an equivalence (NDB=0), each individual data bus bit position can be masked out by clearing the  
corresponding mask bit (DBGADHM/DBGADLM) so that it is ignored in the comparison. A match occurs when all data bus bits  
with corresponding mask bits set are equivalent. If all mask register bits are clear, then a match is based on the address bus only,  
the data bus is ignored.  
When matching on a difference, mask bits can be cleared to ignore bit positions. A match occurs when any data bus bit with  
corresponding mask bit set is different. Clearing all mask bits, causes all bits to be ignored and prevents a match because no  
difference can be detected. In this case address bus equivalence does not cause a match.  
Table 322. NDB and MASK Bit Dependency  
NDB  
DBGADHM[n] /DBGADLM[n]  
Comment  
0
0
1
1
0
1
0
1
Do not compare data bus bit.  
Compare data bus bit. Match on equivalence.  
Do not compare data bus bit.  
Compare data bus bit. Match on difference.  
5.32.4.2.2  
Range Comparisons  
Using the AB comparator pair for a range comparison, the data bus can also be used for qualification by using the comparator A  
data registers. Furthermore the DBGACTL RW and RWE bits can be used to qualify the range comparison on either a read or a  
write access. The corresponding DBGBCTL bits are ignored. The SZE and SZ control bits are ignored in range mode. The  
comparator A TAG bit is used to tag range comparisons. The comparator B TAG bit is ignored in range modes. In order for a  
range comparison using comparators A and B, both COMPEA and COMPEB must be set; to disable range comparisons both  
must be cleared. The comparator A BRK bit is used to for the AB range, the comparator B BRK bit is ignored in range mode.  
When configured for range comparisons and tagging, the ranges are accurate only to word boundaries.  
MM912_634 Advance Information, Rev. 11.0  
212  
Freescale Semiconductor  
 
Functional Description and Application Information  
Inside Range (CompA_Addr Address CompB_Addr)  
5.32.4.2.2.1  
In the Inside Range comparator mode, comparator pair A and B can be configured for range comparisons. This configuration  
depends upon the control register (DBGC2). The match condition requires that a valid match for both comparators happens on  
the same bus cycle. A match condition on only one comparator is not valid. An aligned word access which straddles the range  
boundary is valid only if the aligned address is inside the range.  
5.32.4.2.2.2  
Outside Range (address < CompA_Addr or Address > CompB_Addr)  
In the Outside Range comparator mode, comparator pair A and B can be configured for range comparisons. A single match  
condition on either of the comparators is recognized as valid. An aligned word access which straddles the range boundary is valid  
only if the aligned address is outside the range.  
Outside range mode in combination with tagging can be used to detect if the opcode fetches are from an unexpected range. In  
forced match mode the outside range match would typically be activated at any interrupt vector fetch or register access. This can  
be avoided by setting the upper range limit to $3FFFF or lower range limit to $00000 respectively.  
5.32.4.3  
Match Modes (Forced or Tagged)  
Match modes are used as qualifiers for a state sequencer change of state. The Comparator control register TAG bits select the  
match mode. The modes are described in the following sections.  
5.32.4.3.1  
Forced Match  
When configured for forced matching, a comparator channel match can immediately initiate a transition to the next state  
sequencer state whereby the corresponding flags in DBGSR are set. The state control register for the current state determines  
the next state. Forced matches are typically generated 2-3 bus cycles after the final matching address bus cycle, independent of  
comparator RWE/RW settings. Furthermore since opcode fetches occur several cycles before the opcode execution a forced  
match of an opcode address typically precedes a tagged match at the same address.  
5.32.4.3.2  
Tagged Match  
If a CPU taghit occurs a transition to another state sequencer state is initiated and the corresponding DBGSR flags are set. For  
a comparator related taghit to occur, the DBG must first attach tags to instructions as they are fetched from memory. When the  
tagged instruction reaches the execution stage of the instruction queue a taghit is generated by the CPU. This can initiate a state  
sequencer transition.  
5.32.4.3.3  
Immediate Trigger  
Independent of comparator matches it is possible to initiate a tracing session and/or breakpoint by writing to the TRIG bit in  
DBGC1. If configured for begin aligned tracing, this triggers the state sequencer into the Final State, if configured for end  
alignment, setting the TRIG bit disarms the module, ending the session and issues a forced breakpoint request to the CPU.  
It is possible to set both TRIG and ARM simultaneously to generate an immediate trigger, independent of the current state of  
ARM.  
5.32.4.3.4  
Channel Priorities  
In case of simultaneous matches the priority is resolved according to Table 323. The lower priority is suppressed. It is thus  
possible to miss a lower priority match if it occurs simultaneously with a higher priority. The priorities described in Table 323  
dictate that in the case of simultaneous matches, the match pointing to final state has highest priority followed by the lower  
channel number (0,1,2).  
Table 323. Channel Priorities  
Priority  
Source  
Action  
Highest  
TRIG  
Enter Final State  
Channel pointing to Final State  
Match0 (force or tag hit)  
Match1 (force or tag hit)  
Match2 (force or tag hit)  
Transition to next state as defined by state control registers  
Transition to next state as defined by state control registers  
Transition to next state as defined by state control registers  
Transition to next state as defined by state control registers  
Lowest  
MM912_634 Advance Information, Rev. 11.0  
213  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.32.4.4  
State Sequence Control  
ARM = 0  
ARM = 1  
State 0  
State1  
State2  
(Disarmed)  
ARM = 0  
Session Complete  
(Disarm)  
State3  
Final State  
ARM = 0  
Figure 64. State Sequencer Diagram  
The state sequencer allows a defined sequence of events to provide a trigger point for tracing of data in the trace buffer. Once  
the DBG module has been armed by setting the ARM bit in the DBGC1 register, then state1 of the state sequencer is entered.  
Further transitions between the states are then controlled by the state control registers and channel matches. From Final State  
the only permitted transition is back to the disarmed state0. Transition between any of the states 1 to 3 is not restricted. Each  
transition updates the SSF[2:0] flags in DBGSR accordingly to indicate the current state.  
Alternatively writing to the TRIG bit in DBGSC1, provides an immediate trigger independent of comparator matches.  
Independent of the state sequencer, each comparator channel can be individually configured to generate an immediate  
breakpoint when a match occurs through the use of the BRK bits in the DBGxCTL registers. Thus it is possible to generate an  
immediate breakpoint on selected channels, whilst a state sequencer transition can be initiated by a match on other channels. If  
a debug session is ended by a match on a channel the state sequencer transitions through Final State for a clock cycle to state0.  
This is independent of tracing and breakpoint activity, thus with tracing and breakpoints disabled, the state sequencer enters  
state0 and the debug module is disarmed.  
5.32.4.4.1  
Final State  
On entering Final State a trigger may be issued to the trace buffer according to the trace alignment control as defined by the  
TALIGN bit (see Section 5.32.3.2.3, “Debug Trace Control Register (DBGTCR)"). If the TSOURCE bit in DBGTCR is clear then  
the trace buffer is disabled and the transition to Final State can only generate a breakpoint request. In this case or upon  
completion of a tracing session when tracing is enabled, the ARM bit in the DBGC1 register is cleared, returning the module to  
the disarmed state0. If tracing is enabled a breakpoint request can occur at the end of the tracing session. If neither tracing nor  
breakpoints are enabled then when the final state is reached it returns automatically to state0 and the debug module is disarmed.  
5.32.4.5  
Trace Buffer Operation  
The trace buffer is a 64 lines deep by 20-bits wide RAM array. The DBG module stores trace information in the RAM array in a  
circular buffer format. The system accesses the RAM array through a register window (DBGTBH:DBGTBL) using 16-bit wide  
word accesses. After each complete 20-bit trace buffer line is read, an internal pointer into the RAM increments so that the next  
read receives fresh information. Data is stored in the format shown in Table 324 and Table 328. After each store the counter  
register DBGCNT is incremented. Tracing of CPU activity is disabled when the BDM is active. Reading the trace buffer whilst the  
DBG is armed returns invalid data and the trace buffer pointer is not incremented.  
5.32.4.5.1  
Trace Trigger Alignment  
Using the TALIGN bit (see Section 5.32.3.2.3, “Debug Trace Control Register (DBGTCR)") it is possible to align the trigger with  
the end or the beginning of a tracing session.  
If end alignment is selected, tracing begins when the ARM bit in DBGC1 is set and State1 is entered; the transition to Final State  
signals the end of the tracing session. Tracing with Begin-Trigger starts at the opcode of the trigger. Using end alignment or when  
the tracing is initiated by writing to the TRIG bit whilst configured for begin alignment, tracing starts in the second cycle after the  
DBGC1 write cycle.  
MM912_634 Advance Information, Rev. 11.0  
214  
Freescale Semiconductor  
Functional Description and Application Information  
5.32.4.5.1.1  
Storing with Begin Trigger Alignment  
Storing with begin alignment, data is not stored in the Trace Buffer until the Final State is entered. Once the trigger condition is  
met the DBG module remains armed until 64 lines are stored in the Trace Buffer. If the trigger is at the address of the  
change-of-flow instruction the change of flow associated with the trigger is stored in the Trace Buffer. Using begin alignment  
together with tagging, if the tagged instruction is about to be executed then the trace is started. Upon completion of the tracing  
session the breakpoint is generated, thus the breakpoint does not occur at the tagged instruction boundary.  
5.32.4.5.1.2  
Storing with End Trigger Alignment  
Storing with end alignment, data is stored in the Trace Buffer until the Final State is entered, at which point the DBG module  
becomes disarmed and no more data is stored. If the trigger is at the address of a change of flow instruction, the trigger event is  
not stored in the Trace Buffer. If all trace buffer lines have been used before a trigger event occurs then the trace continues at  
the first line, overwriting the oldest entries.  
5.32.4.5.2  
Trace Modes  
Four trace modes are available. The mode is selected using the TRCMOD bits in the DBGTCR register. Tracing is enabled using  
the TSOURCE bit in the DBGTCR register. The modes are described in the following subsections.  
5.32.4.5.2.1  
Normal Mode  
In Normal Mode, change of flow (COF) program counter (PC) addresses are stored.  
COF addresses are defined as follows:  
Source address of taken conditional branches (long, short, bit-conditional, and loop primitives)  
Destination address of indexed JMP, JSR, and CALL instruction  
Destination address of RTI, RTS, and RTC instructions  
Vector address of interrupts, except for BDM vectors  
LBRA, BRA, BSR, BGND as well as non-indexed JMP, JSR, and CALL instructions are not classified as change of flow and are  
not stored in the trace buffer.  
Stored information includes the full 18-bit address bus and information bits, which contains a source/destination bit to indicate  
whether the stored address was a source address or destination address.  
NOTE  
When a COF instruction with destination address is executed, the destination address is  
stored to the trace buffer on instruction completion, indicating the COF has taken place. If  
an interrupt occurs simultaneously then the next instruction carried out is actually from the  
interrupt service routine. The instruction at the destination address of the original program  
flow gets executed after the interrupt service routine.  
In the following example an IRQ interrupt occurs during execution of the indexed JMP at  
address MARK1. The BRN at the destination (SUB_1) is not executed until after the IRQ  
service routine but the destination address is entered into the trace buffer to indicate that the  
indexed JMP COF has taken place.  
LDX  
JMP  
NOP  
#SUB_1  
0,X  
MARK1  
MARK2  
; IRQ interrupt occurs during execution of this  
;
SUB_1  
ADDR1  
BRN  
*
; JMP Destination address TRACE BUFFER ENTRY 1  
; RTI Destination address TRACE BUFFER ENTRY 3  
;
NOP  
DBNE  
A,PART5  
; Source address TRACE BUFFER ENTRY 4  
IRQ_ISR LDAB  
#$F0  
; IRQ Vector $FFF2 = TRACE BUFFER ENTRY 2  
STAB  
RTI  
VAR_C1  
;
The execution flow taking into account the IRQ is as follows  
#SUB_1  
LDX  
MARK1  
JMP  
0,X  
;
MM912_634 Advance Information, Rev. 11.0  
215  
Freescale Semiconductor  
Functional Description and Application Information  
IRQ_ISR LDAB  
#$F0  
VAR_C1  
;
;
STAB  
RTI  
SUB_1  
BRN  
*
NOP  
DBNE  
;
;
ADDR1  
A,PART5  
5.32.4.5.2.2  
Loop1 Mode  
Loop1 Mode, similarly to Normal Mode also stores only COF address information to the trace buffer, it however allows the filtering  
out of redundant information.  
The intent of Loop1 Mode is to prevent the Trace Buffer from being filled entirely with duplicate information from a looping  
construct such as delays using the DBNE instruction or polling loops using BRSET/BRCLR instructions. Immediately after  
address information is placed in the Trace Buffer, the DBG module writes this value into a background register. This prevents  
consecutive duplicate address entries in the Trace Buffer resulting from repeated branches.  
Loop1 Mode only inhibits consecutive duplicate source address entries that would typically be stored in most tight looping  
constructs. It does not inhibit repeated entries of destination addresses or vector addresses, since repeated entries of these  
would most likely indicate a bug in the user’s code that the DBG module is designed to help find.  
5.32.4.5.2.3  
Detail Mode  
In Detail Mode, address and data for all memory and register accesses is stored in the trace buffer. This mode is intended to  
supply additional information on indexed, indirect addressing modes where storing only the destination address would not  
provide all information required for a user to determine where the code is in error. This mode also features information bit storage  
to the trace buffer, for each address byte storage. The information bits indicate the size of access (word or byte) and the type of  
access (read or write).  
When tracing in Detail Mode, all cycles are traced except those when the CPU is either in a free or opcode fetch cycle.  
5.32.4.5.2.4  
Compressed Pure PC Mode  
In Compressed Pure PC Mode, the PC addresses of all executed opcodes, including illegal opcodes are stored. A compressed  
storage format is used to increase the effective depth of the trace buffer. This is achieved by storing the lower order bits each  
time and using 2 information bits to indicate if a 64 byte boundary has been crossed, in which case the full PC is stored.  
Each Trace Buffer row consists of 2 information bits and 18 PC address bits  
NOTE:  
When tracing is terminated using forced breakpoints, latency in breakpoint generation  
means that opcodes following the opcode causing the breakpoint can be stored to the trace  
buffer. The number of opcodes is dependent on program flow. This can be avoided by using  
tagged breakpoints.  
5.32.4.5.3  
Trace Buffer Organization (Normal, Loop1, Detail modes)  
ADRH, ADRM, ADRL denote address high, middle and low byte respectively. The numerical suffix refers to the tracing count.  
The information format for Loop1 and Normal modes is identical. In Detail mode, the address and data for each entry are stored  
on consecutive lines, thus the maximum number of entries is 32. In this case DBGCNT bits are incremented twice, once for the  
address line and once for the data line, on each trace buffer entry. In Detail mode CINF comprises of R/W and size access  
information (CRW and CSZ respectively).  
Single byte data accesses in Detail Mode are always stored to the low byte of the trace buffer (DATAL) and the high byte is  
cleared. When tracing word accesses, the byte at the lower address is always stored to trace buffer byte1 and the byte at the  
higher address is stored to byte0.  
MM912_634 Advance Information, Rev. 11.0  
216  
Freescale Semiconductor  
Functional Description and Application Information  
Table 324. Trace Buffer Organization (Normal,Loop1,Detail modes)  
4-bits  
8-bits  
8-bits  
Entry  
Mode  
Number  
Field 2  
Field 1  
Field 0  
CINF1,ADRH1  
ADRM1  
DATAH1  
ADRM2  
DATAH2  
PCM1  
ADRL1  
DATAL1  
ADRL2  
DATAL2  
PCL1  
Entry 1  
Entry 2  
0
CINF2,ADRH2  
0
Detail Mode  
Entry 1  
Entry 2  
PCH1  
Normal/Loop1  
Modes  
PCH2  
PCM2  
PCL2  
5.32.4.5.3.1  
Information Bit Organization  
The format of the bits is dependent upon the active trace mode as described below.  
Field2 Bits in Detail Mode  
Table 325. Field2 Bits in Detail Mode  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
CSZ  
CRW  
ADDR[17]  
ADDR[16]  
In Detail Mode the CSZ and CRW bits indicate the type of access being made by the CPU.  
Table 326. Field Descriptions  
Bit  
Description  
Access Type Indicator — This bit indicates if the access was a byte or word size when tracing in Detail Mode  
3
CSZ  
0
1
Word Access  
Byte Access  
Read Write Indicator — This bit indicates if the corresponding stored address corresponds to a read or write access when  
tracing in Detail Mode.  
2
0
1
Write Access  
Read Access  
CRW  
1
Address Bus bit 17 — Corresponds to system address bus bit 17.  
ADDR[17]  
0
Address Bus bit 16 — Corresponds to system address bus bit 16.  
ADDR[16]  
Field2 Bits in Normal and Loop1 Modes  
Figure 65. Information Bits PCH  
Bit 3  
CSD  
Bit 2  
Bit 1  
Bit 0  
CVA  
PC17  
PC16  
MM912_634 Advance Information, Rev. 11.0  
217  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 327. PCH Field Descriptions  
Bit  
Description  
Source Destination Indicator — In Normal and Loop1 mode this bit indicates if the corresponding stored address is a source  
or destination address. This bit has no meaning in Compressed Pure PC mode.  
3
0
1
Source Address  
CSD  
Destination Address  
Vector Indicator — In Normal and Loop1 mode this bit indicates if the corresponding stored address is a vector address.  
Vector addresses are destination addresses, thus if CVA is set, then the corresponding CSD is also set. This bit has no  
meaning in Compressed Pure PC mode.  
2
CVA  
0
1
Non-Vector Destination Address  
Vector Destination Address  
1
Program Counter bit 17 — In Normal and Loop1 mode this bit corresponds to program counter bit 17.  
PC17  
0
Program Counter bit 16 — In Normal and Loop1 mode this bit corresponds to program counter bit 16.  
PC16  
5.32.4.5.4  
Trace Buffer Organization (Compressed Pure PC mode)  
Table 328. Trace Buffer Organization Example (Compressed PurePC mode)  
2-bits  
6-bits  
6-bits  
6-bits  
Line  
Mode  
Number  
Field 3  
Field 2  
Field 1  
Field 0  
Line 1  
Line 2  
Line 3  
Line 4  
Line 5  
Line 6  
00  
11  
01  
00  
10  
00  
PC1 (Initial 18-bit PC Base Address)  
PC4  
0
PC3  
PC2  
PC5  
0
Compressed  
Pure PC Mode  
PC6 (New 18-bit PC Base Address)  
PC8  
0
PC7  
PC9 (New 18-bit PC Base Address)  
NOTE  
Configured for end aligned triggering in compressed PurePC mode, then after rollover it is  
possible that the oldest base address is overwritten. In this case all entries between the  
pointer and the next base address have lost their base address following rollover. For  
example in Table 329 if one line of rollover has occurred, Line 1, PC1, is overwritten with a  
new entry. Thus the entries on Lines 2 and 3 have lost their base address. For reconstruction  
of program flow the first base address following the pointer must be used, in the example,  
Line 4. The pointer points to the oldest entry, Line 2.  
5.32.4.5.5  
Field3 Bits in Compressed Pure PC Modes  
Table 329. Compressed Pure PC Mode Field 3 Information Bit Encoding  
INF1  
INF0  
TRACE BUFFER ROW CONTENT  
Base PC address TB[17:0] contains a full PC[17:0] value  
0
0
1
1
0
1
0
1
Trace Buffer[5:0] contain incremental PC relative to base address zero value  
Trace Buffer[11:0] contain next 2 incremental PCs relative to base address zero value  
Trace Buffer[17:0] contain next 3 incremental PCs relative to base address zero value  
Each time that PC[17:6] differs from the previous base PC[17:6], then a new base address is stored. The base address zero value  
is the lowest address in the 64 address range  
The first line of the trace buffer always gets a base PC address, this applies also on rollover.  
MM912_634 Advance Information, Rev. 11.0  
218  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.32.4.5.6  
Reading Data from Trace Buffer  
The data stored in the Trace Buffer can be read provided the DBG module is not armed, is configured for tracing (TSOURCE bit  
is set) and the system not secured. When the ARM bit is written to 1 the trace buffer is locked to prevent reading. The trace buffer  
can only be unlocked for reading by a single aligned word write to DBGTB when the module is disarmed.  
The Trace Buffer can only be read through the DBGTB register using aligned word reads, any byte or misaligned reads return 0  
and do not cause the trace buffer pointer to increment to the next trace buffer address. The Trace Buffer data is read out first-in  
first-out. By reading CNT in DBGCNT the number of valid lines can be determined. DBGCNT does not decrement as data is read.  
Whilst reading an internal pointer is used to determine the next line to be read. After a tracing session, the pointer points to the  
oldest data entry, thus if no rollover has occurred, the pointer points to line0, otherwise it points to the line with the oldest entry.  
In compressed Pure PC mode on rollover the line with the oldest data entry may also contain newer data entries in fields 0 and  
1. Thus if rollover is indicated by the TBF bit, the line status must be decoded using the INF bits in field3 of that line. If both INF  
bits are clear then the line contains only entries from before the last rollover.  
If INF0=1 then field 0 contains post rollover data but fields 1 and 2 contain pre rollover data.  
If INF1=1 then fields 0 and 1 contain post rollover data but field 2 contains pre rollover data.  
The pointer is initialized by each aligned write to DBGTBH to point to the oldest data again. This enables an interrupted trace  
buffer read sequence to be easily restarted from the oldest data entry.  
The least significant word of line is read out first. This corresponds to the fields 1 and 0 of Table 324. The next word read returns  
field 2 in the least significant bits [3:0] and “0” for bits [15:4].  
Reading the Trace Buffer while the DBG module is armed returns invalid data and no shifting of the RAM pointer occurs.  
5.32.4.5.7  
Trace Buffer Reset State  
The Trace Buffer contents and DBGCNT bits are not initialized by a system reset. Thus should a system reset occur, the trace  
session information from immediately before the reset occurred can be read out and the number of valid lines in the trace buffer  
is indicated by DBGCNT. The internal pointer to the current trace buffer address is initialized by unlocking the trace buffer and  
points to the oldest valid data even if a reset occurred during the tracing session. To read the trace buffer after a reset, TSOURCE  
must be set, otherwise the trace buffer reads as all zeroes. Generally debugging occurrences of system resets is best handled  
using end trigger alignment since the reset may occur before the trace trigger, which in the begin trigger alignment case means  
no information would be stored in the trace buffer.  
The Trace Buffer contents and DBGCNT bits are undefined following a POR.  
NOTE  
An external pin RESET that occurs simultaneous to a trace buffer entry can, in very seldom  
cases, lead to either that entry being corrupted or the first entry of the session being  
corrupted. In such cases the other contents of the trace buffer still contain valid tracing  
information. The case occurs when the reset assertion coincides with the trace buffer entry  
clock edge.  
5.32.4.6  
Tagging  
A tag follows program information as it advances through the instruction queue. When a tagged instruction reaches the head of  
the queue a tag hit occurs and can initiate a state sequencer transition.  
Each comparator control register features a TAG bit, which controls whether the comparator match causes a state sequencer  
transition immediately or tags the opcode at the matched address. If a comparator is enabled for tagged comparisons, the  
address stored in the comparator match address registers must be an opcode address.  
Using Begin trigger together with tagging, if the tagged instruction is about to be executed then the transition to the next state  
sequencer state occurs. If the transition is to the Final State, tracing is started. Only upon completion of the tracing session can  
a breakpoint be generated. Using End alignment, when the tagged instruction is about to be executed and the next transition is  
to Final State then a breakpoint is generated immediately, before the tagged instruction is carried out.  
R/W monitoring, access size (SZ) monitoring and data bus monitoring are not useful if tagging is selected, since the tag is  
attached to the opcode at the matched address and is not dependent on the data bus nor on the type of access. Thus these bits  
are ignored if tagging is selected.  
When configured for range comparisons and tagging, the ranges are accurate only to word boundaries.  
Tagging is disabled when the BDM becomes active.  
MM912_634 Advance Information, Rev. 11.0  
219  
Freescale Semiconductor  
Functional Description and Application Information  
5.32.4.7  
Breakpoints  
It is possible to generate breakpoints from channel transitions to final state or using software to write to the TRIG bit in the DBGC1  
register.  
5.32.4.7.1  
Breakpoints From Comparator Channels  
Breakpoints can be generated when the state sequencer transitions to the Final State. If configured for tagging, then the  
breakpoint is generated when the tagged opcode reaches the execution stage of the instruction queue.  
If a tracing session is selected by the TSOURCE bit, breakpoints are requested when the tracing session has completed, thus if  
Begin aligned triggering is selected, the breakpoint is requested only on completion of the subsequent trace (see Table 330). If  
no tracing session is selected, breakpoints are requested immediately.  
If the BRK bit is set, then the associated breakpoint is generated immediately independent of tracing trigger alignment.  
Table 330. Breakpoint Setup For CPU Breakpoints  
BRK  
TALIGN  
DBGBRK  
Breakpoint Alignment  
0
0
0
0
1
1
0
0
1
1
x
x
0
1
0
1
1
0
Fill Trace Buffer until trigger then disarm (no breakpoints)  
Fill Trace Buffer until trigger, then breakpoint request occurs  
Start Trace Buffer at trigger (no breakpoints)  
Start Trace Buffer at trigger. A breakpoint request occurs when Trace Buffer is full  
Terminate tracing and generate breakpoint immediately on trigger  
Terminate tracing immediately on trigger  
5.32.4.7.2  
Breakpoints Generated Via The TRIG Bit  
If a TRIG triggers occur, the Final State is entered whereby tracing trigger alignment is defined by the TALIGN bit. If a tracing  
session is selected by the TSOURCE bit, breakpoints are requested when the tracing session has completed, thus if Begin  
aligned triggering is selected, the breakpoint is requested only on completion of the subsequent trace (see Table 330). If no  
tracing session is selected, breakpoints are requested immediately. TRIG breakpoints are possible with a single write to DBGC1,  
setting ARM and TRIG simultaneously.  
5.32.4.7.3  
Breakpoint Priorities  
If a TRIG trigger occurs after Begin aligned tracing has already started, then the TRIG no longer has an effect. When the  
associated tracing session is complete, the breakpoint occurs. Similarly if a TRIG is followed by a subsequent comparator  
channel match, it has no effect, since tracing has already started.  
If a forced SWI breakpoint coincides with a BGND in user code with BDM enabled, then the BDM is activated by the BGND and  
the breakpoint to SWI is suppressed.  
5.32.4.7.3.1  
DBG Breakpoint Priorities And BDM Interfacing  
Breakpoint operation is dependent on the state of the BDM module. If the BDM module is active, the CPU is executing out of  
BDM firmware, thus comparator matches and associated breakpoints are disabled. In addition, while executing a BDM TRACE  
command, tagging into BDM is disabled. If BDM is not active, the breakpoint gives priority to BDM requests over SWI requests  
if the breakpoint happens to coincide with a SWI instruction in user code. On returning from BDM, the SWI from user code gets  
executed.  
Table 331. Breakpoint Mapping Summary  
DBGBRK  
BDM Bit (DBGC1[4])  
BDM Enabled  
BDM Active  
Breakpoint Mapping  
0
1
X
1
1
X
0
X
1
1
X
X
1
0
1
X
0
1
X
0
No Breakpoint  
Breakpoint to SWI  
No Breakpoint  
Breakpoint to SWI  
Breakpoint to BDM  
MM912_634 Advance Information, Rev. 11.0  
220  
Freescale Semiconductor  
 
Functional Description and Application Information  
BDM cannot be entered from a breakpoint unless the ENABLE bit is set in the BDM. If entry to BDM via a BGND instruction is  
attempted and the ENABLE bit in the BDM is cleared, the CPU actually executes the BDM firmware code, checks the ENABLE  
and returns if ENABLE is not set. If not serviced by the monitor then the breakpoint is re-asserted when the BDM returns to normal  
CPU flow.  
If the comparator register contents coincide with the SWI/BDM vector address then an SWI in user code could coincide with a  
DBG breakpoint. The CPU ensures that BDM requests have a higher priority than SWI requests. Returning from the BDM/SWI  
service routine care must be taken to avoid a repeated breakpoint at the same address.  
Should a tagged or forced breakpoint coincide with a BGND in user code, then the instruction that follows the BGND instruction  
is the first instruction executed when normal program execution resumes.  
NOTE  
When program control returns from a tagged breakpoint using an RTI or BDM GO command  
without program counter modification it returns to the instruction whose tag generated the  
breakpoint. To avoid a repeated breakpoint at the same location reconfigure the DBG  
module in the SWI routine, if configured for an SWI breakpoint, or over the BDM interface  
by executing a TRACE command before the GO to increment the program flow past the  
tagged instruction.  
5.32.5  
Application Information  
State Machine scenarios  
5.32.5.1  
Defining the state control registers as SCR1,SCR2, SCR3 and M0,M1,M2 as matches on channels 0,1,2 respectively. SCR  
encoding supported by S12SDBGV1 are shown in black. SCR encoding supported only in S12SDBGV2 are shown in red. For  
backwards compatibility the new scenarios use a 4th bit in each SCR register. Thus the existing encoding for SCRx[2:0] is not  
changed.  
5.32.5.2  
Scenario 1  
A trigger is generated if a given sequence of 3 code events is executed.  
SCR2=0010  
SCR3=0111  
SCR1=0011  
M0  
M2  
M1  
Final State  
State3  
State2  
State1  
Figure 66. Scenario 1  
Scenario 1 is possible with S12SDBGV1 SCR encoding  
5.32.5.3  
Scenario 2  
A trigger is generated if a given sequence of 2 code events is executed.  
SCR2=0101  
SCR1=0011  
M2  
M1  
Final State  
State2  
State1  
Figure 67. Scenario 2a  
A trigger is generated if a given sequence of 2 code events is executed, whereby the first event is entry into a range  
(COMPA,COMPB configured for range mode). M1 is disabled in range modes.  
MM912_634 Advance Information, Rev. 11.0  
221  
Freescale Semiconductor  
Functional Description and Application Information  
SCR2=0101  
SCR1=0111  
M2  
M01  
Final State  
State2  
State1  
Figure 68. Scenario 2b  
A trigger is generated if a given sequence of 2 code events is executed, whereby the second event is entry into a range  
(COMPA,COMPB configured for range mode)  
SCR2=0011  
SCR1=0010  
M0  
M2  
Final State  
State2  
State1  
Figure 69. Scenario 2c  
All 3 scenarios 2a,2b,2c are possible with the S12SDBGV1 SCR encoding  
5.32.5.4 Scenario 3  
A trigger is generated immediately when one of up to 3 given events occurs  
SCR1=0000  
M012  
Final State  
State1  
Figure 70. Scenario 3  
Scenario 3 is possible with S12SDBGV1 SCR encoding  
5.32.5.5 Scenario 4  
Trigger if a sequence of 2 events is carried out in an incorrect order. Event A must be followed by event B and event B must be  
followed by event A. 2 consecutive occurrences of event A without an intermediate event B cause a trigger. Similarly 2  
consecutive occurrences of event B without an intermediate event A cause a trigger. This is possible by using CompA and  
CompC to match on the same address as shown.  
M0  
SCR2=0011  
SCR1=0100  
State2  
M0  
State1  
M2  
M1  
M1  
Final State  
State 3  
SCR3=0001  
M1  
Figure 71. Scenario 4a  
This scenario is currently not possible using 2 comparators only. S12SDBGV2 makes it possible with 2 comparators, State 3  
allowing a M0 to return to state 2, whilst a M2 leads to final state as shown.  
MM912_634 Advance Information, Rev. 11.0  
222  
Freescale Semiconductor  
Functional Description and Application Information  
M0  
SCR2=1100  
SCR1=0110  
SCR3=1110  
State2  
State1  
M0  
M01  
M2  
M2  
M1 disabled in  
range mode  
Final State  
State 3  
M2  
Figure 72. Scenario 4b (with 2 comparators)  
The advantage of using only 2 channels is that now range comparisons can be included (channel0)  
This however violates the S12SDBGV1 specification, which states that a match leading to final state always has priority in case  
of a simultaneous match, whilst priority is also given to the lowest channel number. For S12SDBG the corresponding CPU priority  
decoder is removed to support this, such that on simultaneous taghits, taghits pointing to final state have highest priority. If no  
taghit points to final state then the lowest channel number has priority. Thus with the above encoding from State3, the CPU and  
DBG would break on a simultaneous M0/M2.  
5.32.5.6  
Scenario 5  
Trigger if following event A, event C precedes event B. i.e. the expected execution flow is A->B->C.  
SCR2=0110  
SCR1=0011  
M0  
M1  
M2  
Figure 73. Scenario 5  
Final State  
State2  
State1  
Scenario 5 is possible with the S12SDBGV1 SCR encoding  
5.32.5.7 Scenario 6  
Trigger if event A occurs twice in succession before any of 2 other events (BC) occurs. This scenario is not possible using the  
S12SDBGV1 SCR encoding. S12SDBGV2 includes additions shown in red. The change in SCR1 encoding also has the  
advantage that a State1->State3 transition using M0 is now possible. This is advantageous because range and data bus  
comparisons use channel0 only.  
SCR3=1010  
SCR1=1001  
M0  
M0  
M12  
Figure 74. Scenario 6  
Final State  
State3  
State1  
5.32.5.8  
Scenario 7  
Trigger when a series of 3 events is executed out of order. Specifying the event order as M1,M2,M0 to run in loops (120120120).  
Any deviation from that order should trigger. This scenario is not possible using the S12SDBGV1 SCR encoding because OR  
possibilities are very limited in the channel encoding. By adding OR forks as shown in red this scenario is possible.  
MM912_634 Advance Information, Rev. 11.0  
223  
Freescale Semiconductor  
Functional Description and Application Information  
M01  
SCR2=1100  
SCR3=1101  
M12  
SCR1=1101  
M2  
M1  
Final State  
State3  
State2  
State1  
M0  
M02  
Figure 75. Scenario 7  
On simultaneous matches the lowest channel number has priority so with this configuration the forking from State1 has the  
peculiar effect that a simultaneous match0/match1 transitions to final state but a simultaneous match2/match1transitions to  
state2.  
5.32.5.9  
Scenario 8  
Trigger when a routine/event at M2 follows either M1 or M0.  
SCR2=0101  
SCR1=0111  
M2  
M01  
Final State  
State2  
Figure 76. Scenario 8a  
Trigger when an event M2 is followed by either event M0 or event M1  
State1  
SCR2=0111  
SCR1=0010  
M01  
M2  
Final State  
State2  
State1  
Figure 77. Scenario 8b  
Scenario 8a and 8b are possible with the S12SDBGV1 and S12SDBGV2 SCR encoding.  
5.32.5.10 Scenario 9  
Trigger when a routine/event at A (M2) does not follow either B or C (M1 or M0) before they are executed again. This cannot be  
realized with theS12SDBGV1 SCR encoding due to OR limitations. By changing the SCR2 encoding as shown in red this  
scenario becomes possible.  
SCR2=1111  
SCR1=0111  
M01  
M01  
M2  
Final State  
State2  
State1  
Figure 78. Scenario 9  
5.32.5.11  
Scenario 10  
Trigger if an event M0 occurs following up to two successive M2 events without the resetting event M1. As shown up to 2  
consecutive M2 events are allowed, whereby a reset to State1 is possible after either one or two M2 events. If an event M0 occurs  
following the second M2, before M1 resets to State1 then a trigger is generated. Configuring CompA and CompC the same, it is  
possible to generate a breakpoint on the third consecutive occurrence of event M0 without a reset M1.  
MM912_634 Advance Information, Rev. 11.0  
224  
Freescale Semiconductor  
Functional Description and Application Information  
M1  
M2  
SCR2=0100  
SCR3=0010  
SCR1=0010  
M0  
M2  
Final State  
State3  
State2  
State1  
M1  
Figure 79. Scenario 10a  
M0  
SCR2=0011  
SCR3=0000  
SCR1=0010  
State1  
M1  
M2  
Final State  
State3  
State2  
M0  
Figure 80. Scenario 10b  
Scenario 10b shows the case that after M2 then M1 must occur before M0. Starting from a particular point in code, event M2 must  
always be followed by M1 before M0. If after any M2, event M0 occurs before M1 then a trigger is generated.  
5.33  
Security (S12XS12IPIMV1V2)  
5.33.1  
Introduction  
This specification describes the function of the security mechanism in the S12I chip family (S12IPIMV1).  
NOTE  
No security feature is absolutely secure. However, Freescale’s strategy is to make reading  
or copying the FLASH and/or EEPROM difficult for unauthorized users.  
5.33.1.1  
Features  
The user must be reminded that part of the security must lie with the application code. An extreme example would be application  
code that dumps the contents of the internal memory. This would defeat the purpose of security. At the same time, the user may  
also wish to put a back door in the application program. An example of this is the user downloads a security key through the SCI,  
which allows access to a programming routine that updates parameters stored in another section of the Flash memory.  
The security features of the S12I chip family (in secure mode) are:  
Protect the content of non-volatile memories (Flash, EEPROM)  
Execution of NVM commands is restricted  
Disable access to internal memory via background debug module (BDM)  
5.33.1.2  
Modes of Operation  
Table 332 gives an overview over availability of security relevant features in unsecure and secure modes.  
Figure 81 shows all modules affected by security in an MCU.  
MM912_634 Advance Information, Rev. 11.0  
225  
Freescale Semiconductor  
Functional Description and Application Information  
Table 332. Feature Availability in Unsecure and Secure Modes on S12I  
Unsecure Mode  
NX ES  
Secure Mode  
NX ES  
NS  
SS  
EX  
ST  
NS  
SS  
EX  
ST  
Note:  
191. Restricted NVM command set only. Refer to the NVM wrapper block guides for detailed information.  
192. BDM hardware commands restricted to peripheral registers only.  
xmmc  
xbdm  
secreq  
flash  
unsecure  
security control  
security status  
mmc_secure  
xgate  
xdbg  
eeprom  
Figure 81. Chip Security Block Diagram  
The security mechanism relies on non-volatile bits contained in the FLASH module. The state of these bits is passed to the  
S12XMMC. Several of the MCU modules are involved in blocking certain operations which would reveal the contents of the  
protected FLASH and EEPROM.  
5.34  
Impact on MCU modules  
When the device is in secure mode, the following blocks are affected by security  
5.34.1 MMC  
There is a signal called “secure” from the FLASH or EEPROM which indicates if the security is enabled. There is also a signal  
from the xbdm, which is used in the process of unsecuring the chip. This signal is called “unsecure”. These two signals and the  
resulting state of “device security” are shown in Table 333.  
MM912_634 Advance Information, Rev. 11.0  
226  
Freescale Semiconductor  
Functional Description and Application Information  
Table 333. : Security Bits - System Control  
secreq  
bdm_unsecure  
mmc_secure  
0
0
1
1
0
1
0
1
0 (unsecured)  
0 (unsecured)  
1 (secured)  
0 (unsecured)  
In expanded modes, if the “mmc_secure_t2” signal is asserted, the ROMON and EEON bits are forced to zero. This operation is  
independent of how the part got to expanded mode (straight out of reset or by writing the mode register).  
When security is enabled and the part is brought up in special single chip mode, the secure BDM firmware is brought into the  
map along with the standard BDM firmware. The secure firmware has higher priority, but does not fill the whole space. It occupies  
$7F_FF80 to $7F_FFFF.  
One cycle after bdm_unsecure is asserted the secure firmware is disabled from the map.  
In secure mode aBDM access to a non register address will be translated to a peripheral register address, and BDM registers  
are not accessible.  
No BDM global access is possible if the chip is secured.  
In secured expanded mode or emulation mode, FLASH and EEPROM are disabled by the MMC.  
5.34.2  
BDM  
When security is active and the blank check is performed and failed, only BDM hardware commands are available. If the blank  
check is succeeds, all BDM commands are available.  
The BDM status register contains a bit called UNSEC. This bit is only writable by the secure firmware in special single chip mode.  
Based on the state of this bit, the BDM generates a signal called “unsecure”. The bit and signal are always reset to 0 (=  
de-asserted = secure).  
If the user resets into special single chip mode with the part secured, an alternate BDM firmware (“SECURE firmware”), is placed  
in the map along with the standard BDM firmware. The secure firmware has higher priority than the standard firmware, but it is  
smaller (less bytes). The secure firmware covers the vector space, but does not reach the beginning of the BDM firmware space.  
When blank check is successfully performed, UNSEC is asserted. The BDM program jumps to the start of the standard BDM  
firmware program and the secure firmware is turned off. If the blank check fails, then the ENBDM bit in the BDMSTS register is  
set without asserting UNSEC, and the BDM firmware code enters a loop. This enables the BDM hardware commands. In secure  
mode the MMC restricts BDM accesses to the register space.  
With UNSEC asserted, security is off and the user can change the state of the secure bits in the FLASH. Note that if the user  
does not change the state of these bits to “unsecured”, the part will be secured again when it is next taken out of reset.  
5.34.3  
DBG  
S12X_DBG will disable the trace buffer, but breakpoints are still valid.  
5.34.4  
XGATE  
XGATE internal registers XGCCR, XGPC, and XGR1 - XGR7 can not be written and will read zero from IPBI.  
Single stepping in XGATE is not possible.  
XGATE code residing in the internal RAM cannot be protected:  
1. start MCU in NSC, let it run for a while  
2. reset into SSC, MASERS the NVM  
3. reset into SSC, blank check of BDM secure firmware succeeds  
4. MCU is temporarily unsecured  
5. BDM can be used to read internal RAM (contents not affected by reset)  
MM912_634 Advance Information, Rev. 11.0  
227  
Freescale Semiconductor  
Functional Description and Application Information  
5.35  
Secure firmware Code Overview  
The BDM contains a secure firmware code. This firmware code is invoked when the user comes out of reset in special single chip  
mode with security enabled. The function of the firmware code is straight forward:  
Verify the FLASH is erased  
Verify the EEPROM is erased  
If both are erased, release security  
If either the FLASH or the EEPROM is not erased, then security is not released. The ENBDM bit is set and the code enters a  
loop. This allows BDM hardware commands, which may be used to erase the EEPROM and FLASH.  
Note that erasing the memories and erasing / reprogramming the security bits is NOT part of the firmware code. The user must  
perform these operations.  
The blank check of FLASH and EEPROM is done in the BDM firmware. As such it could be changed on future parts. The current  
scheme uses the NVM command state-machines (FTX, EETX) to perform the blank check.  
5.35.0.1  
Securing the Microcontroller  
Once the user has programmed the Flash and EEPROM, the chip can be secured by programming the security bits located in  
the options/security byte in the Flash memory array. These non-volatile bits will keep the device secured through reset and  
power-down.  
The options/security byte is located at address 0xFF0F (= global address 0x7F_FF0F) in the Flash memory array. This byte can  
be erased and programmed like any other Flash location. Two bits of this byte are used for security (SEC[1:0]). On devices which  
have a memory page window, the Flash options/security byte is also available at address 0xBF0F by selecting page 0x3F with  
the PPAGE register. The contents of this byte are copied into the Flash security register (FSEC) during a reset sequence.  
Table 334. Flash Options/Security Byte  
7
6
5
4
3
2
1
0
0xFF0F  
KEYEN1  
KEYEN0  
NV5  
NV4  
NV3  
NV2  
SEC1  
SEC0  
The meaning of the bits KEYEN[1:0] is shown in Table 335. Refer to Section 5.35.0.2.5, “Unsecuring the MCU Using the Back  
door Key Access"” for more information.  
Table 335. Backdoor Key Access Enable Bits  
KEYEN[1:0]  
Back door Key Access Enabled  
00  
01  
10  
11  
0 (disabled)  
0 (disabled)  
1 (enabled)  
0 (disabled)  
The meaning of the security bits SEC[1:0] is shown in Table 336. For security reasons, the state of device security is controlled  
by two bits. To put the device in unsecured mode, these bits must be programmed to SEC[1:0] = ‘10’. All other combinations put  
the device in a secured mode. The recommended value to put the device in secured state is the inverse of the unsecured state,  
i.e. SEC[1:0] = ‘01’.  
Table 336. Security Bits  
SEC[1:0]  
Security State  
00  
01  
10  
11  
1 (secured)  
1 (secured)  
0 (unsecured)  
1 (secured)  
MM912_634 Advance Information, Rev. 11.0  
228  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
NOTE  
Refer to the Flash block guide for actual security configuration (in section “Flash Module  
Security”).  
5.35.0.2  
Operation of the Secured Microcontroller  
By securing the device, unauthorized access to the EEPROM and Flash memory contents can be prevented. However, it must  
be understood that the security of the EEPROM and Flash memory contents also depends on the design of the application  
program. For example, if the application has the capability of downloading code through a serial port and then executing that  
code (e.g. an application containing bootloader code), then this capability could potentially be used to read the EEPROM and  
Flash memory contents even when the microcontroller is in the secure state. In this example, the security of the application could  
be enhanced by requiring a challenge/response authentication before any code can be downloaded.  
Secured operation has the following effects on the microcontroller:  
5.35.0.2.1  
Normal Single Chip Mode (NS)  
Background debug module (BDM) operation is completely disabled.  
Execution of Flash and EEPROM commands is restricted. Refer to the NVM block guide for details.  
Tracing code execution using the DBG module is disabled.  
5.35.0.2.2  
Special Single Chip Mode (SS)  
BDM firmware commands are disabled.  
BDM hardware commands are restricted to the register space.  
Execution of Flash and EEPROM commands is restricted. Refer to the NVM block guide for details.  
Tracing code execution using the DBG module is disabled.  
Special single chip mode means BDM is active after reset. The availability of BDM firmware commands depends on the security  
state of the device. The BDM secure firmware first performs a blank check of both the Flash memory and the EEPROM. If the  
blank check succeeds, security will be temporarily turned off and the state of the security bits in the appropriate Flash memory  
location can be changed If the blank check fails, security will remain active, only the BDM hardware commands will be enabled,  
and the accessible memory space is restricted to the peripheral register area. This will allow the BDM to be used to erase the  
EEPROM and Flash memory without giving access to their contents. After erasing both Flash memory and EEPROM, another  
reset into special single chip mode will cause the blank check to succeed and the options/security byte can be programmed to  
“unsecured” state via BDM.  
While the BDM is executing the blank check, the BDM interface is completely blocked, which means that all BDM commands are  
temporarily blocked.  
5.35.0.2.3  
Executing from Internal Memory in Expanded Mode  
The user may choose to operate from internal memory while in expanded mode. To do this the user must start in single chip mode  
and write to the mode bits selecting expanded operation. In this mode internal visibility and IPIPE are blocked. If the users  
program tries to execute from outside the program memory space (internal space occupied by the FLASH), the FLASH and  
EEPROM will be disabled. BDM operations will be blocked.  
If the user begins operation in single chip mode with security on, the user is constrained to operate out of internal memory - even  
if the user changes to expanded mode. To accomplish this the MMC needs to register that the part started in single chip mode  
and was secured. The CPU will provide the state of the two high-order bits of the Program Counter. All this information, plus the  
firmware size information is used to determine that the part is executing in the proper space. If the program strays, the selects  
for FLASH and EEPROM are disabled by the MMC until the part goes through reset.  
5.35.0.2.4  
Unsecuring the Microcontroller  
Unsecuring the microcontroller can be done by three different methods:  
1. Back door key access  
2. Reprogramming the security bits  
3. Complete memory erase (special modes)  
MM912_634 Advance Information, Rev. 11.0  
229  
Freescale Semiconductor  
Functional Description and Application Information  
Unsecuring the MCU Using the Back door Key Access  
5.35.0.2.5  
In normal modes (single chip and expanded), security can be temporarily disabled using the back door key access method. This  
method requires that:  
The back door key at 0xFF00–0xFF07 (= global addresses 0x7F_FF00–0x7F_FF07) has been programmed to a valid  
value.  
The KEYEN[1:0] bits within the Flash options/security byte select ‘enabled’.  
In single chip mode, the application program programmed into the microcontroller must be designed to have the  
capability to write to the back door key locations.  
The back door key values themselves would not normally be stored within the application data, which means the application  
program would have to be designed to receive the back door key values from an external source (e.g. through a serial port).  
The back door key access method allows debugging of a secured microcontroller without having to erase the Flash. This is  
particularly useful for failure analysis.  
NOTE  
No word of the back door key is allowed to have the value 0x0000 or 0xFFFF.  
5.35.0.3  
Reprogramming the Security Bits  
In normal single chip mode (NS), security can also be disabled by erasing and reprogramming the security bits within Flash  
options/security byte to the unsecured value. Because the erase operation will erase the entire sector from 0xFE00–0xFFFF  
(0x7F_FE00–0x7F_FFFF), the back door key and the interrupt vectors will also be erased; this method is not recommended for  
normal single chip mode. The application software can only erase and program the Flash options/security byte if the Flash sector  
containing the Flash options/security byte is not protected (see Flash protection). Thus Flash protection is a useful means of  
preventing this method. The microcontroller will enter the unsecured state after the next reset following the programming of the  
security bits to the unsecured value.  
This method requires that:  
The application software previously programmed into the microcontroller has been designed to have the capability to  
erase and program the Flash options/security byte, or security is first disabled using the back door key method, allowing  
BDM to be used to issue commands to erase and program the Flash options/security byte.  
The Flash sector containing the Flash options/security byte is not protected.  
5.35.0.4  
Complete Memory Erase (Special Modes)  
The microcontroller can be unsecured in special modes by erasing the entire EEPROM and Flash memory contents.  
When a secure microcontroller is reset into special single chip mode (SS), the BDM firmware verifies whether the EEPROM and  
Flash memory are erased. If any EEPROM or Flash memory address is not erased, only BDM hardware commands are enabled.  
BDM hardware commands can then be used to write to the EEPROM and Flash registers to mass erase the EEPROM and all  
Flash memory blocks.  
When next reset into special single chip mode, the BDM firmware will again verify whether all EEPROM and Flash memory are  
erased, and this being the case, will enable all BDM commands, allowing the Flash options/security byte to be programmed to  
the unsecured value. The security bits SEC[1:0] in the Flash security register will indicate the unsecure state following the next  
reset.  
5.36  
Initialization of a Virgin Device  
“Virgin” cells in the Flash array will read all programmed and the MCU will be secured as the SEC[1:0] bits would be loaded with  
‘00’ from the Flash security byte.  
At wafer probe NVM BIST mode is used to test and initialize the Flash IFR block. Wafer probe will leave the Flash block erased  
so the MCU will be secured.  
For blind-assembled products, the following sequence must be used to initialize the Flash array:  
Reset the MCU into special mode.  
Set FCLKDIV to provide a proper FCLK period.  
Set FPROT register to the unprotected state.  
Set the WRALL bit in the FTSTMOD register, if available.  
Load the Flash Pulse Timer with the mass erase time by executing a LDPTMR command write sequence.  
Execute MASERSI commands to mass erase the Flash main block and Flash IFR block.  
MM912_634 Advance Information, Rev. 11.0  
230  
Freescale Semiconductor  
Functional Description and Application Information  
Execute the LDPTMR and PGMI command write sequence to program all timing parameters into the Flash IFR block.  
Reset the MCU into special single chip mode. After the reset the BDM secure firmware executes a blank check  
command. If the blank check succeeds the MCU will be temporarily unsecured.  
Execute the PGM command write sequence to program the security byte to the unsecured state.  
Blocking access to memories which can be secured during SCAN testing is necessary. While it would take a fair amount of  
sophistication on the part of a “thief”, our DFT people still consider this a major risk to security. It is therefore highly recommended  
that accesses to the FLASH and EEPROM arrays be blocked at chip level during scan test. Blocking or not blocking security at  
the core level will not help this.  
5.37  
Impact of Security on Test  
When silicon comes out of processing, it is extremely unlikely that the security bits will be configured for unsecure. There will  
need to be “hooks” for running BIST (if present) or Burn-in by bypassing the security.  
If wafer level burn-in is to be used, security must have a bypass which can be connected to by the burn-in layer. In burn-in,  
security is bypassed, but when the burn-in layer is removed, the state of secreq determines whether the part is secured or not.  
This may require some sort of weak pull-up device. At some point during testing the internal FLASH and EEPROM will need to  
be unsecured. This test program should follow the same sequence as a user to unsecure the part: erase the memories, bring the  
part up in special mode, erase and program the security bits to the unsecured state.  
5.38  
S12 Clock, Reset and Power Management Unit (S12IPIMV1)  
5.38.1  
Introduction  
This specification describes the function of the Clock, Reset and Power Management Unit.  
The Pierce oscillator (OSCLCP) provides a robust, low-noise and low-power external clock source. It is designed for  
optimal start-up margin with typical crystal oscillators.  
The Voltage regulator (IVREG) operates from the range 3.13 to 5.5 V. It provides all the required chip internal voltages  
and voltage monitors.  
The Phase Locked Loop (PLL) provides a highly accurate frequency multiplier with internal filter.  
The Internal Reference Clock (IRC1M) provides a 1.0 MHz clock.  
5.38.1.1  
Features  
The Pierce Oscillator (OSCLCP) contains circuitry to dynamically control current gain in the output amplitude. This ensures a  
signal with low harmonic distortion, low power and good noise immunity.  
Supports crystals or resonators from 4.0 to 16 MHz.  
High noise immunity due to input hysteresis and spike filtering.  
Low RF emissions with peak-to-peak swing limited dynamically  
Transconductance (gm) sized for optimum start-up margin for typical crystals  
Dynamic gain control eliminates the need for external current limiting resistor  
Integrated resistor eliminates the need for external bias resistor.  
Low power consumption: Operates from internal 1.8 V (nominal) supply, Amplitude control limits power  
The Voltage Regulator (IVREG) has the following features:  
Input voltage range from 3.13 to 5.5 V  
Low-voltage detect (LVD) with low-voltage interrupt (LVI)  
Power-on reset (POR)  
Low-voltage reset (LVR)  
during scan pattern execution option to go to RPM to support IDDq test.  
external voltage reference used for HV-stress test and MIM screen, the external voltage on VDDA, divided by series  
resistors, will be used as input to the regulating loop of the IVREG  
The Phase Locked Loop (PLL) has the following features:  
highly accurate and phase locked frequency multiplier  
Configurable internal filter for best stability and lock time.  
Frequency modulation for defined jitter and reduced emission  
Automatic frequency lock detector  
MM912_634 Advance Information, Rev. 11.0  
231  
Freescale Semiconductor  
Functional Description and Application Information  
Interrupt request on entry or exit from locked condition  
Reference clock either external (crystal) or internal square wave (1.0 MHz IRC1M) based.  
PLL stability is sufficient for LIN communication, even if using IRC1M as reference clock  
The Internal Reference Clock (IRC1M) has the following features:  
Trimmable in frequency  
Factory trimmed value for 1.0 MHz in Flash Memory, can be overwritten by application if required  
Other features of the S12IPIMV1 include  
Clock monitor to detect loss of crystal  
Autonomous periodical interrupt (API)  
Bus Clock Generator  
Clock switch to select either PLLCLK or external crystal/resonator based Bus Clock  
PLLCLK divider to adjust system speed  
System Reset generation from the following possible sources:  
Power-on reset (POR)  
Low-voltage reset (LVR)  
Illegal address access  
COP timeout  
Loss of oscillation (clock monitor fail)  
External pin RESET  
5.38.1.2  
Modes of Operation  
This subsection lists and briefly describes all operating modes supported by the S12IPIMV1.  
5.38.1.2.1 Run Mode  
The voltage regulator is in Full Performance Mode (FPM).  
The Phase-locked Loop (PLL) is on.  
The Internal Reference Clock (IRC1M) is on.  
The API is available.  
PLL Engaged Internal (PEI)  
This is the default mode after System Reset and Power-on Reset.  
The Bus Clock is based on the PLLCLK.  
After reset the PLL is configured for 64 MHz VCOCLK operation  
Post divider is 0x03, so PLLCLK is VCOCLK divided by 4, that is 16 MHz and Bus Clock is 8.0 MHz.  
The PLL can be reconfigured for other bus frequencies.  
The reference clock for the PLL (REFCLK) is based on internal reference clock IRC1M  
PLL Engaged External (PEE)  
The Bus Clock is based on the PLLCLK.  
This mode can be entered from default mode PEI by performing the following steps:  
Configure the PLL for desired bus frequency.  
Program the reference divider (REFDIV[3:0] bits) to divide down oscillator frequency if necessary.  
Enable the external oscillator (OSCE bit)  
PLL Bypassed External (PBE)  
The Bus Clock is based on the Oscillator Clock (OSCCLK).  
This mode can be entered from default mode PEI by performing the following steps:  
Enable the external oscillator (OSCE bit)  
Wait for oscillator to start up (UPOSC=1)  
Select the Oscillator Clock (OSCCLK) as Bus Clock (PLLSEL=0)  
The PLLCLK is still on to filter possible spikes of the external oscillator clock  
MM912_634 Advance Information, Rev. 11.0  
232  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.1.2.2  
Stop Mode  
This mode is entered by executing the CPU STOP instruction.  
The voltage regulator is in Reduced Power mode (RPM)  
The API is available  
The Phase Locked Loop (PLL) is off  
The Internal Reference Clock (IRC1M) is off  
Core Clock, Bus Clock and BDM Clock are stopped  
Depending on the setting of the PSTP and the OSCE bit, Stop mode can be differentiated between Full Stop mode (PSTP = 0 or  
OSCE=0) and Pseudo Stop mode (PSTP = 1 and OSCE=1).  
Full Stop mode (pstp = 0 or osce=0)  
The external oscillator (OSCLCP) is disabled  
After wake-up from Full Stop mode the Core Clock and Bus Clock are running on PLLCLK (PLLSEL=1). After wake-up  
from Full Stop mode the COP and RTI are running on IRCCLK (COPOSCSEL=0, RTIOSCSEL=0)  
Pseudo Stop Mode (PSTP = 1 and OSCE=1)  
The external oscillator (OSCLCP) continues to run. If the respective enable bits are set the COP and RTI will continue  
to run.  
The clock configuration bits PLLSEL, COPOSCSEL, RTIOSCSEL are unchanged  
NOTE  
When starting up the external oscillator (either by programming OSCE bit to 1 or on exit from  
Full Stop Mode with OSCE bit already 1) the software must wait for a minimum time  
equivalent to the startup-time of the external oscillator tUPOSC before entering Pseudo Stop  
mode.  
MM912_634 Advance Information, Rev. 11.0  
233  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.1.3  
S12IPIMV1 Block Diagram  
Illegal Address Access  
MMC  
VDDR  
VDD, VDDF  
(core supplies)  
Low Voltage Detect VDDA  
ILAF  
Low Voltage Interrupt  
LVDS  
LVIE  
VSS  
Low Voltage Detect VDDX  
VDDX  
VSSX  
VDDA  
VSSA  
RESET  
Voltage  
LVRF  
COP time out  
S12CPMU  
Regulator  
Power-On Detect  
3.13 to 5.5V  
PORF  
Power-On Reset  
System Reset  
Reset  
monitor fail  
Generator  
Clock  
Monitor  
Oscillator status Interrupt  
OSCIE  
UPOSC  
UPOSC=0 sets PLLSEL bit  
Loop  
CAN_OSCCLK  
(to MSCAN)  
EXTAL  
XTAL  
OSCCLK  
Controlled  
Pierce  
Oscillator  
(OSCLCP)  
4MHz-16MHz  
Adaptive  
Oscillator  
Filter  
&
OSCFILT[4:0]  
OSCBW  
PLLSEL  
REFDIV[3:0]  
IRCTRIM[9:0]  
POSTDIV[4:0]  
ECLK2X  
(Core Clock)  
Internal  
Reference  
Clock  
Reference  
Divider  
Post  
Divider  
1,2,…,32  
PLLCLK  
PSTP  
(IRC1M)  
divide  
by 2  
ECLK  
(Bus Clock)  
divide  
by 4  
IRCCLK  
(to LCD)  
OSCE  
VCOFRQ[1:0]  
divide  
by 8  
BDM Clock  
VCOCLK  
Phase  
locked  
REFCLK  
FBCLK  
Lock  
detect  
Loop with  
internal  
Filter (PLL)  
REFFRQ[1:0]  
PLL Lock Interrupt  
LOCK  
LOCKIE  
Bus Clock  
Divide by  
Autonomous  
API_EXTCLK  
2*(SYNDIV+1)  
Periodic  
ACLK  
RC  
Interrupt (API)  
Osc.  
SYNDIV[5:0]  
API Interrupt  
RTI Interrupt  
APICLK  
APIE  
RTIE  
UPOSC  
UPOSC=0 clears  
IRCCLK  
IRCCLK  
Real Time  
Interrupt (RTI)  
COP time out  
to Reset  
Generator  
COP  
Watchdog  
COPCLK  
RTICLK  
OSCCLK  
OSCCLK  
COPOSCSEL  
RTIOSCSEL  
CPMUCOP  
CPMURTI  
PCE  
PRE  
Figure 82. Block diagram of S12IPIMV1  
MM912_634 Advance Information, Rev. 11.0  
234  
Freescale Semiconductor  
Functional Description and Application Information  
Figure 83 shows a block diagram of the OSCLCP.  
OSCCLK  
Peak  
Detector  
Gain Control  
VDD = 1.8 V  
VSS  
Rf  
XTAL  
EXTAL  
Figure 83. OSCLCP Block Diagram  
5.38.2  
Signal Description  
This section lists and describes the signals that connect off chip.  
5.38.2.1  
RESET  
RESET is an active-low bidirectional pin. As an input it initializes the MCU asynchronously to a known start-up state. As an  
open-drain output it indicates that an MCU-internal reset has been triggered.  
5.38.2.2  
EXTAL and XTAL  
These pins provide the interface for a crystal to control the internal clock generator circuitry. EXTAL is the external clock input or  
the input to the crystal oscillator amplifier. XTAL is the output of the crystal oscillator amplifier. The MCU internal OSCCLK is  
derived from the EXTAL input frequency. If OSCE=0, the EXTAL pin is pulled down by an internal resistor of approximately 200  
kand the XTAL pin is pulled down by an internal resistor of approximately 700 k.  
NOTE  
Freescale recommends an evaluation of the application board and chosen resonator or  
crystal by the resonator or crystal supplier. Loop controlled circuit is not suited for overtone  
resonators and crystals.  
5.38.2.3  
VDDR — Regulator Power Input Pin  
Pin VDDR is the power input of IVREG. All currents sourced into the regulator loads flow through this pin.  
An off-chip decoupling capacitor (100 nF...220 nF, X7R ceramic) between VDDR and VSS can smooth ripple on VDDR  
.
MM912_634 Advance Information, Rev. 11.0  
235  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.38.2.4  
5.38.2.5  
VSS — Ground Pin  
VSS must be grounded.VDDA, VSSA — Regulator Reference Supply Pins  
Pins VDDA and VSSA are used to supply the analog parts of the regulator.  
Internal precision reference circuits are supplied from these signals.  
An off-chip decoupling capacitor (100 nF...220 nF, X7R ceramic) between VDDA and VSSA can improve the quality of this supply.  
5.38.2.6  
VDDX, VSSX— Pad Supply Pins  
This supply domain is monitored by the Low Voltage Reset circuit.  
An off-chip decoupling capacitor (100 nF...220 nF, X7R ceramic) between VDDX and VSSX can improve the quality of this supply.  
NOTE  
Depending on the device package following device supply pins are maybe combined into  
one supply pin: VDDR, VDDX and VDDA.  
Depending on the device package following device supply pins are maybe combined into  
one supply pin: VSS, VSSX and VSSA.  
Refer to the device Reference Manual for information if device supply pins are combined into  
one supply pin for certain packages and which supply pins are combined together.  
An off-chip decoupling capacitor (100 nF...220 nF, X7R ceramic) between the combined  
supply pin pair can improve the quality of this supply.  
5.38.2.7  
VDD — Internal Regulator Output Supply (Core Logic)  
Node VDD is a device internal supply output of the voltage regulator that provides the power supply for the core logic. This supply  
domain is monitored by the Low Voltage Reset circuit.  
5.38.2.8  
VDDF — Internal Regulator Output Supply (NVM Logic)  
Node VDDF is a device internal supply output of the voltage regulator that provides the power supply for the NVM logic. This  
supply domain is monitored by the Low Voltage Reset circuit  
5.38.2.9  
— API external clock output pin  
API_EXTCLK  
This pin provides the signal selected via APIES and is enabled with APIEA bit. See device specification to which pin it connects.  
5.38.2.10  
vddf_test, vdd_test, vddpll_test — supply testmode pins  
These pins allow to measure internal VDDF, VDD, VDDPLL.  
5.38.2.11  
cpmu_test_clk  
This signal is connected to a device pin and allows measuring internal clocks if cpmu_test_clk_en bit is set.  
5.38.2.12  
cpmu_test_xfc  
This signal is connected to a device pin and allows measuring the internal PLL filter node if cpmu_test_xfc_en bit is set.  
5.38.2.13  
REGFT[2:0] and REGT[2:0]  
With the ipt_trim_ld_en signal of the PTI, the trim values for VDD and VDDF of the VREG are loaded into CPMUTEST3 register  
which directly trims the VREG.  
5.38.3  
Memory Map and Registers  
This section provides a detailed description of all registers accessible in the S12IPIMV1.  
5.38.3.1  
Module Memory Map  
The S12IPIMV1 registers are shown in Figure 337.  
MM912_634 Advance Information, Rev. 11.0  
236  
Freescale Semiconductor  
Functional Description and Application Information  
Table 337. CPMU Register Summary  
Address  
Name  
Bit 7  
6
5
4
3
2
1
Bit 0  
R
W
R
CPMU  
SYNR  
0x0034  
VCOFRQ[1:0]  
SYNDIV[5:0]  
0
0
0
CPMU  
REFDIV  
0x0035  
0x0036  
0x0037  
0x0038  
0x0039  
0x003A  
0x003B  
0x003C  
REFFRQ[1:0]  
REFDIV[3:0]  
W
R
0
0
CPMU  
POSTDIV  
POSTDIV[4:0]  
W
R
LOCK  
0
UPOSC  
0
CPMUFLG  
CPMUINT  
CPMUCLKS  
CPMUPLL  
CPMURTI  
CPMUCOP  
RTIF  
RTIE  
PORF  
0
LVRF  
0
LOCKIF  
ILAF  
0
OSCIF  
OSCIE  
W
R
LOCKIE  
0
W
R
0
RTI  
OSCSEL  
COP  
OSCSEL  
PLLSEL  
0
PSTP  
0
PRE  
0
PCE  
0
W
R
0
0
FM1  
FM0  
W
R
RTDEC  
WCOP  
RTR6  
RTR5  
RTR4  
0
RTR3  
0
RTR2  
RTR1  
RTR0  
CR0  
W
R
0
RSBCK  
CR2  
0
CR1  
W
WRTMASK  
fmcs_reg_se cpmu_test cpmu_test_ fc_force_e  
test_sqw_o  
sc0  
R
vcofrq20  
fm_test0  
RESERVEDC  
PMUTEST0  
l0  
_gfe0  
xfc_en0  
n0  
0x003D  
0x003E  
W
cpmu_test osc_lcp_m osc_lcp_ex  
_clk_sel[0] onitor_disa tsqw_enabl  
pfd_force_e cpmu_test cpmu_test_  
pfd_force_u pfd_force_  
R
RESERVEDC  
PMUTEST1  
n0  
_clk_en0  
clk_sel[1]0  
p0  
down0  
0
ble0  
e0  
W
R
RESERVEDC  
PMUFMCS  
0x003E  
0x003F  
0x02F0  
0x02F1  
0x02F2  
0x02F3  
0x02F4  
0x02F5  
fmcs_cs[7:0]  
W
R
0
Bit 7  
0
0
Bit 6  
0
0
Bit 5  
0
0
Bit 4  
0
0
Bit 3  
0
0
Bit 2  
0
0
Bit 1  
0
0
Bit 0  
0
CPMU  
ARMCOP  
W
R
RESERVED  
W
R
0
0
0
0
0
0
0
LVDS  
CPMU  
LVCTL  
LVIE  
LVIF  
W
R
CPMU  
APICTL  
APICLK  
APITR5  
APIR15  
APIR7  
APIES  
APITR2  
APIR12  
APIR4  
APIEA  
APITR1  
APIR11  
APIR3  
APIFE  
APITR0  
APIR10  
APIR2  
APIE  
0
APIF  
0
W
R
CPMUAPITR  
CPMUAPIRH  
CPMUAPIRL  
APITR4  
APIR14  
APIR6  
APITR3  
APIR13  
APIR5  
W
R
APIR9  
APIR1  
APIR8  
APIR0  
W
R
W
= Unimplemented or Reserved  
MM912_634 Advance Information, Rev. 11.0  
237  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 337. CPMU Register Summary (continued)  
Address  
Name  
Bit 7  
6
5
4
3
2
1
Bit 0  
0vdd_exter  
nal_en  
R
0 LVRT  
0 REGFT2 0 REGFT1 0 REGFT0 0 REGT2  
0 REGT1  
0 REGT0  
RESERVEDC  
PMUTEST3  
0x02F6  
W
R
0
0
0
0
0
0
0
0
0
0x02F7  
0x02F8  
0x02F9  
RESERVED  
W
R
CPMU  
IRCTRIMH  
TCTRIM[4:0]  
IRCTRIM[9:8]  
W
R
CPMU  
IRCTRIML  
IRCTRIM[7:0]  
W
OSCPINS_  
EN  
R
0x02FA  
CPMUOSC  
OSCE  
0
OSCBW  
0
OSCFILT[4:0]  
0
W
R
0
0
0
0
0
0x02FB  
0x02FC  
CPMUPROT  
PROT  
W
R
0
0
0 LVRS  
0 LVRFS  
0 LVRXS  
0
0RCEXA  
RESERVEDC  
PMUTEST2  
W
= Unimplemented or Reserved  
5.38.3.2  
Register Descriptions  
This section describes all the S12IPIMV1 registers and their individual bits.  
Address order is as listed in Table 337.  
5.38.3.2.1  
S12IPIMV1 Synthesizer Register (CPMUSYNR)  
The CPMUSYNR register controls the multiplication factor of the PLL and selects the VCO frequency range.  
Table 338. S12IPIMV1 Synthesizer Register (CPMUSYNR)  
0x0034  
7
6
5
4
3
2
1
0
R
W
VCOFRQ[1:0]  
SYNDIV[5:0]  
Reset  
0
1
0
1
1
1
1
1
Read: Anytime  
Write: Anytime if PROT=0 (CPMUPROT register) and PLLSEL=1 (CPMUCLKS register). Else write has no effect.  
NOTE  
Writing to this register clears the LOCK and UPOSC status bits.  
f
= 2 f  
 SYNDIV + 1  
If PLL has locked (LOCK=1)  
VCO  
REF  
NOTE  
VCO must be within the specified VCO frequency lock range. Bus frequency fBUS must not  
exceed the specified maximum.  
f
MM912_634 Advance Information, Rev. 11.0  
238  
Freescale Semiconductor  
Functional Description and Application Information  
The VCOFRQ[1:0] bits are used to configure the VCO gain for optimal stability and lock time. For correct PLL operation the  
VCOFRQ[1:0] bits have to be selected according to the actual target VCOCLK frequency as shown in Table 339. Setting the  
VCOFRQ[1:0] bits incorrectly can result in a non functional PLL (no locking and/or insufficient stability).  
Table 339. VCO Clock Frequency Selection  
VCOCLK Frequency Ranges  
VCOFRQ[1:0]  
32 MHz <= fVCO<= 48 MHz  
48 MHz < fVCO<= 6 4MHz  
Reserved  
00  
01  
10  
11  
Reserved  
5.38.3.2.2  
S12IPIMV1 Reference Divider Register (CPMUREFDIV)  
The CPMUREFDIV register provides a finer granularity for the PLL multiplier steps when using the external oscillator as  
reference.  
Table 340. S12IPIMV1 Reference Divider Register (CPMUREFDIV)  
0x0035  
7
6
5
4
3
2
1
0
R
W
0
0
REFFRQ[1:0]  
REFDIV[3:0]  
Reset  
0
0
0
0
1
1
1
1
Read: Anytime  
Write: Anytime if PROT=0 (CPMUPROT register) and PLLSEL=1 (CPMUCLKS register). Else write has no effect.  
NOTE  
Write to this register clears the LOCK and UPOSC status bits.  
f
OSC  
-------------------------------------  
f
=
If OSCLCP is enabled (OSCE=1)  
If OSCLCP is disabled (OSCE=0)  
REF  
REFDIV + 1  
f
= f  
REF  
IRC1M  
The REFFRQ[1:0] bits are used to configure the internal PLL filter for optimal stability and lock time. For correct PLL operation  
the REFFRQ[1:0] bits have to be selected according to the actual REFCLK frequency as shown in Table 341.  
If IRC1M is selected as REFCLK (OSCE=0) the PLL filter is fixed configured for the 1.0 MHz <= fREF <= 2.0 MHz range. The bits  
can still be written but will have no effect on the PLL filter configuration.  
For OSCE=1, setting the REFFRQ[1:0] bits incorrectly can result in a non functional PLL (no locking and/or insufficient stability).  
Table 341. Reference Clock Frequency Selection if OSC_LCP is enabled  
REFCLK Frequency Ranges (OSCE=1)  
REFFRQ[1:0]  
1.0 MHz <= fREF <= 2.0 MHz  
2.0 MHz < fREF <= 6.0 MHz  
6.0 MHz < fREF <= 12.0 MHz  
fREF >12 MHz  
00  
01  
10  
11  
5.38.3.2.3  
S12IPIMV1 Post Divider Register (CPMUPOSTDIV)  
The POSTDIV register controls the frequency ratio between the VCOCLK and the PLLCLK.  
MM912_634 Advance Information, Rev. 11.0  
239  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 342. S12IPIMV1 Post Divider Register (CPMUPOSTDIV)  
0x0036  
7
6
5
4
3
2
1
0
R
W
0
0
0
POSTDIV[4:0]  
0
Reset  
0
0
0
0
0
1
1
= Unimplemented or Reserved  
Read: Anytime  
Write: Anytime if PLLSEL=1. Else write has no effect.  
f
VCO  
------------------------------------------  
=
If PLL is locked (LOCK=1)  
If PLL is not locked (LOCK=0)  
If PLL is selected (PLLSEL=1)  
f
PLL  
POSTDIV + 1  
f
VCO  
---------------  
f
=
PLL  
bus  
4
f
PLL  
------------  
f
=
2
5.38.3.2.4  
S12IPIMV1 Flags Register (CPMUFLG)  
This register provides S12IPIMV1 status bits and flags.  
Table 343. S12IPIMV1 Flags Register (CPMUFLG)  
0x0037  
7
6
5
4
3
2
1
0
R
W
LOCK  
UPOSC  
RTIF  
0
PORF  
LVRF  
LOCKIF  
0
ILAF  
OSCIF  
0
(193)  
(194)  
(195)  
Reset  
0
0
= Unimplemented or Reserved  
Note:  
193. PORF is set to 1 when a power on reset occurs. Unaffected by System Reset.  
194. LVRF is set to 1 when a low voltage reset occurs. Unaffected by System Reset. Set by power on reset.  
195. ILAF is set to 1 when an illegal address reset occurs. Unaffected by System Reset. Cleared by power on reset.  
Read: Anytime  
Write: Refer to each bit for individual write conditions  
Table 344. CPMUFLG Field Descriptions  
Field  
Description  
Real Time Interrupt Flag — RTIF is set to 1 at the end of the RTI period. This flag can only be cleared by writing a 1. Writing  
a 0 has no effect. If enabled (RTIE=1), RTIF causes an interrupt request.  
7
0
1
RTI timeout has not yet occurred.  
RTI timeout has occurred.  
RTIF  
Power on Reset Flag — PORF is set to 1 when a power on reset occurs. This flag can only be cleared by writing a 1. Writing  
a 0 has no effect.  
6
0
1
Power on reset has not occurred.  
Power on reset has occurred.  
PORF  
MM912_634 Advance Information, Rev. 11.0  
240  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 344. CPMUFLG Field Descriptions (continued)  
Field  
Description  
Low Voltage Reset Flag — LVRF is set to 1 when a low voltage reset occurs. This flag can only be cleared by writing a 1.  
Writing a 0 has no effect.  
5
0
1
Low voltage reset has not occurred.  
Low voltage reset has occurred.  
LVRF  
PLL Lock Interrupt Flag — LOCKIF is set to 1 when LOCK status bit changes. This flag can only be cleared by writing a 1.  
Writing a 0 has no effect.If enabled (LOCKIE=1), LOCKIF causes an interrupt request.  
4
0
1
No change in LOCK bit.  
LOCK bit has changed.  
LOCKIF  
Lock Status Bit — LOCK reflects the current state of PLL lock condition. Writes have no effect. While PLL is unlocked  
(LOCK=0) fPLL is fVCO / 4 to protect the system from high core clock frequencies during the PLL stabilization time tlock.  
3
0
1
VCOCLK is not within the desired tolerance of the target frequency. fPLL = fVCO/4.  
LOCK  
VCOCLK is within the desired tolerance of the target frequency. fPLL = fVCO/(POSTDIV+1).  
Illegal Address Reset Flag — ILAF is set to 1 when an illegal address reset occurs. Refer to MMC chapter for details. This  
flag can only be cleared by writing a 1. Writing a 0 has no effect.  
2
0
1
Illegal address reset has not occurred.  
Illegal address reset has occurred.  
ILAF  
Oscillator Interrupt Flag — OSCIF is set to 1 when UPOSC status bit changes. This flag can only be cleared by writing a 1.  
Writing a 0 has no effect.If enabled (OSCIE=1), OSCIF causes an interrupt request.  
1
0
1
No change in UPOSC bit.  
UPOSC bit has changed.  
OSCIF  
Oscillator Status Bit — UPOSC reflects the status of the oscillator. Writes have no effect. While UPOSC=0 the OSCCLK  
going to the MSCAN module is off. Entering Full Stop Mode UPOSC is cleared.  
0
0
1
The oscillator is off or oscillation is not qualified by the PLL.  
The oscillator is qualified by the PLL.  
UPOSC  
NOTE  
The Adaptive Oscillator Filter uses the VCO clock as a reference to continuously qualify the  
external oscillator clock. Because of this, the PLL is always active and a valid PLL  
configuration is required for the system to work properly. Furthermore, the Adaptive  
Oscillator Filter is used to determine the status of the external oscillator (reflected in the  
UPOSC bit). Since this function also relies on the VCO clock, loosing PLL lock status  
(LOCK=0, except for entering Pseudo Stop mode) means loosing the oscillator status  
information as well (UPOSC=0).  
MM912_634 Advance Information, Rev. 11.0  
241  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.3.2.5  
S12IPIMV1 Interrupt Enable Register (CPMUINT)  
This register enables S12IPIMV1 interrupt requests.  
Table 345. S12IPIMV1 Interrupt Enable Register (CPMUINT)  
0x0038  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
RTIE  
0
LOCKIE  
0
OSCIE  
0
Reset  
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Anytime  
Table 346. CRGINT Field Descriptions  
Field  
Description  
Real Time Interrupt Enable Bit  
7
0
1
Interrupt requests from RTI are disabled.  
Interrupt will be requested whenever RTIF is set.  
RTIE  
PLL Lock Interrupt Enable Bit  
4
0
1
PLL LOCK interrupt requests are disabled.  
Interrupt will be requested whenever LOCKIF is set.  
LOCKIE  
Oscillator Corrupt Interrupt Enable Bit  
1
0
1
Oscillator Corrupt interrupt requests are disabled.  
Interrupt will be requested whenever OSCIF is set.  
OSCIE  
5.38.3.2.6  
S12IPIMV1 Clock Select Register (CPMUCLKS)  
This register controls S12IPIMV1 clock selection.  
Table 347. S12IPIMV1 Clock Select Register (CPMUCLKS)  
0x0039  
7
6
5
4
3
2
1
0
R
W
0
0
RTI  
OSCSEL  
COP  
OSCSEL  
PLLSEL  
1
PSTP  
0
PRE  
0
PCE  
0
Reset  
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write:  
1. Only possible if PROT=0 (CPMUPROT register) in all MCU Modes (Normal and Special mode).  
2. All bits in Special mode (if PROT=0).  
3. PLLSEL, PSTP, PRE, PCE, RTIOSCSEL: In Normal mode (if PROT=0).  
4. COPOSCSEL: In Normal mode (if PROT=0) until CPMUCOP write once is taken. If COPOSCSEL was cleared by  
UPOSC=0 (entering full stop mode with COPOSCSEL=1 or insufficient OSCCLK quality), then COPOSCSEL can be  
set again once.  
NOTE  
After writing CPMUCLKS register, it is strongly recommended to read back CPMUCLKS  
register to make sure that write of PLLSEL, RTIOSCSEL and COPOSCSEL was successful.  
MM912_634 Advance Information, Rev. 11.0  
242  
Freescale Semiconductor  
Functional Description and Application Information  
Table 348. CPMUCLKS Descriptions  
Field  
Description  
PLL Select Bit  
This bit selects the PLLCLK as source of the System Clocks (Core Clock and Bus Clock).  
PLLSEL can only be set to 0, if UPOSC=1.  
UPOSC= 0 sets the PLLSEL bit.  
7
PLLSEL  
Entering Full Stop Mode sets the PLLSEL bit.  
0
1
System clocks are derived from OSCCLK if oscillator is up (UPOSC=1, fBUS = fOSC / 2.  
System clocks are derived from PLLCLK, fBUS = fPLL / 2.  
Pseudo Stop Bit  
This bit controls the functionality of the oscillator during Stop Mode.  
0
1
Oscillator is disabled in Stop Mode (Full Stop Mode).  
Oscillator continues to run in Stop Mode (Pseudo Stop Mode), option to run RTI and COP.  
6
Note: Pseudo Stop Mode allows for faster STOP recovery and reduces the mechanical stress and aging of the resonator in  
case of frequent STOP conditions at the expense of a slightly increased power consumption.  
Note: When starting up the external oscillator (either by programming OSCE bit to 1 or on exit from Full Stop Mode with OSCE  
bit is already 1) the software must wait for a minimum time equivalent to the startup-time of the external oscillator tUPOSC  
before entering Pseudo Stop Mode.  
PSTP  
RTI Enable During Pseudo Stop Bit — PRE enables the RTI during Pseudo Stop Mode.  
0
1
RTI stops running during Pseudo Stop Mode.  
3
PRE  
RTI continues running during Pseudo Stop Mode if RTIOSCSEL=1.  
Note: If PRE=0 or RTIOSCSEL=0 then the RTI will go static while Stop Mode is active. The RTI counter will not be reset.  
COP Enable During Pseudo Stop Bit — PCE enables the COP during Pseudo Stop Mode.  
0
1
COP stops running during Pseudo Stop Mode  
2
PCE  
COP continues running during Pseudo Stop Mode if COPOSCSEL=1  
Note: If PCE=0 or COPOSCSEL=0 then the COP will go static while Stop Mode is active. The COP counter will not be reset.  
RTI Clock Select — RTIOSCSEL selects the clock source to the RTI. Either IRCCLK or OSCCLK. Changing the RTIOSCSEL  
bit re-starts the RTI timeout period.  
RTIOSCSEL can only be set to 1, if UPOSC=1.  
UPOSC= 0 clears the RTIOSCSEL bit.  
1
RTIOSCSEL  
0
1
RTI clock source is IRCCLK.  
RTI clock source is OSCCLK.  
COP Clock Select — COPOSCSEL selects the clock source to the COP. Either IRCCLK or OSCCLK. Changing the  
COPOSCSEL bit re-starts the COP timeout period.  
COPOSCSEL can only be set to 1, if UPOSC=1.  
UPOSC= 0 clears the COPOSCSEL bit.  
0
COPOSCSEL  
0
1
COP clock source is IRCCLK.  
COP clock source is OSCCLK  
MM912_634 Advance Information, Rev. 11.0  
243  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.3.2.7  
S12IPIMV1 PLL Control Register (CPMUPLL)  
This register controls the PLL functionality.  
Table 349. S12IPIMV1 PLL Control Register (CPMUPLL)  
0x003A  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
FM1  
0
FM0  
0
Reset  
0
0
0
0
0
0
Read: Anytime  
Write: Anytime if PROT=0 (CPMUPROT register) and PLLSEL=1 (CPMUCLKS register). Else write has no effect.  
NOTE  
Write to this register clears the LOCK and UPOSC status bits.  
Care should be taken to ensure that the bus frequency does not exceed the specified  
maximum when frequency modulation is enabled.  
The frequency modulation (FM1 and FM0) can not be used if the Adaptive Oscillator Filter  
is enabled.  
Table 350. CPMUPLL Field Descriptions  
Field  
Description  
5, 4  
PLL Frequency Modulation Enable Bits — FM1 and FM0 enable frequency modulation on the VCOCLK. This is to reduce  
noise emission. The modulation frequency is fref divided by 16. See Table 351 for coding.  
FM1, FM0  
Table 351. FM Amplitude selection  
FM Amplitude /  
FM1  
FM0  
fVCO Variation  
0
0
1
1
0
1
0
1
FM off  
1%  
2%  
4%  
5.38.3.2.8  
S12IPIMV1 RTI Control Register (CPMURTI)  
This register selects the timeout period for the Real Time Interrupt.  
The clock source for the RTI is either IRCCLK or OSCCLK depending on the setting of the RTIOSCSEL bit. In Stop Mode with  
PSTP=1 (Pseudo Stop Mode) and RTIOSCSEL=1 the RTI continues to run, else the RTI counter halts in Stop Mode.  
Table 352. S12IPIMV1 RTI Control Register (CPMURTI)  
0x003B  
7
6
5
4
3
2
1
0
R
W
RTDEC  
0
RTR6  
0
RTR5  
0
RTR4  
0
RTR3  
0
RTR2  
0
RTR1  
0
RTR0  
0
Reset  
Read: Anytime  
Write: Anytime  
MM912_634 Advance Information, Rev. 11.0  
244  
Freescale Semiconductor  
 
Functional Description and Application Information  
NOTE  
A write to this register starts the RTI timeout period. A change of the RTIOSCSEL bit (writing  
a different value or loosing UPOSC status) restarts the RTI timeout period.  
Table 353. CPMURTI Field Descriptions  
Field  
Description  
Decimal or Binary Divider Select Bit — RTDEC selects decimal or binary based prescaler values.  
7
0
1
Binary based divider value. See Table 354  
Decimal based divider value. See Table 355  
RTDEC  
6–4  
Real Time Interrupt Prescale Rate Select Bits — These bits select the prescale rate for the RTI. See Table 354 and  
Table 355.  
RTR[6:4]  
3–0  
Real Time Interrupt Modulus Counter Select Bits — These bits select the modulus counter target value to provide additional  
granularity.Table 354 and Table 355 show all possible divide values selectable by the CPMURTI register.  
RTR[3:0]  
Table 354. RTI Frequency Divide Rates for RTDEC = 0  
RTR[3:0]  
RTR[6:4] =  
000  
001  
010  
011  
100  
101  
110  
111  
(OFF)  
(210  
)
(211  
)
(212  
)
(213  
)
(214  
)
(215  
)
(216  
)
0000 (1)  
0001 (2)  
0010 (3)  
0011 (4)  
0100 (5)  
0101 (6)  
0110 (7)  
0111 (8)  
1000 (9)  
1001 (10)  
1010 (11)  
1011 (12)  
1100 (13)  
1101 (14)  
1110 (15)  
1111 (16)  
OFF(196)  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
OFF  
210  
211  
212  
213  
214  
215  
216  
2x210  
3x210  
4x210  
5x210  
6x210  
7x210  
8x210  
9x210  
10x210  
11x210  
12x210  
13x210  
14x210  
15x210  
16x210  
2x211  
3x211  
4x211  
5x211  
6x211  
7x211  
8x211  
9x211  
10x211  
11x211  
12x211  
13x211  
14x211  
15x211  
16x211  
2x212  
3x212  
2x213  
3x213  
4x213  
5x213  
6x213  
7x213  
8x213  
9x213  
10x213  
11x213  
12x213  
13x213  
14x213  
15x213  
16x213  
2x214  
3x214  
4x214  
5x214  
6x214  
7x214  
8x214  
9x214  
10x214  
11x214  
12x214  
13x214  
14x214  
15x214  
16x214  
2x215  
3x215  
4x215  
5x215  
6x215  
7x215  
8x215  
9x215  
10x215  
11x215  
12x215  
13x215  
14x215  
15x215  
16x215  
2x216  
3x216  
4x216  
5x216  
6x216  
7x216  
8x216  
9x216  
10x216  
11x216  
12x216  
13x216  
14x216  
15x216  
16x216  
4x212  
5x212  
6x212  
7x212  
8x212  
9x212  
10x212  
11x212  
12x212  
13x212  
14x212  
15x212  
16x212  
Note:  
196. Denotes the default value out of reset.This value should be used to disable the RTI to ensure future backwards compatibility.  
MM912_634 Advance Information, Rev. 11.0  
245  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 355. RTI Frequency Divide Rates for RTDEC=1  
RTR[3:0]  
RTR[6:4] =  
000  
001  
010  
011  
100  
101  
110  
111  
(1x103)  
(2x103)  
(5x103)  
(10x103)  
(20x103)  
(50x103)  
(100x103)  
(200x103)  
0000 (1)  
0001 (2)  
0010 (3)  
0011 (4)  
0100 (5)  
0101 (6)  
0110 (7)  
0111 (8)  
1000 (9)  
1001 (10)  
1010 (11)  
1011 (12)  
1100 (13)  
1101 (14)  
1110 (15)  
1111 (16)  
1x103  
2x103  
2x103  
4x103  
5x103  
10x103  
15x103  
20x103  
25x103  
30x103  
35x103  
40x103  
45x103  
50x103  
55x103  
60x103  
65x103  
70x103  
75x103  
80x103  
10x103  
20x103  
30x103  
40x103  
50x103  
60x103  
70x103  
80x103  
90x103  
100x103  
110x103  
120x103  
130x103  
140x103  
150x103  
160x103  
20x103  
40x103  
50x103  
100x103  
150x103  
200x103  
250x103  
300x103  
350x103  
400x103  
450x103  
500x103  
550x103  
600x103  
650x103  
700x103  
750x103  
800x103  
100x103  
200x103  
300x103  
400x103  
500x103  
600x103  
700x103  
800x103  
900x103  
1x106  
200x103  
400x103  
600x103  
800x103  
1x106  
3x103  
6x103  
60x103  
4x103  
8x103  
80x103  
5x103  
10x103  
12x103  
14x103  
16x103  
18x103  
20x103  
22x103  
24x103  
26x103  
28x103  
30x103  
32x103  
100x103  
120x103  
140x103  
160x103  
180x103  
200x103  
220x103  
240x103  
260x103  
280x103  
300x103  
320x103  
6x103  
1.2x106  
1.4x106  
1.6x106  
1.8x106  
2x106  
7x103  
8x103  
9x103  
10 x103  
11 x103  
12x103  
13x103  
14x103  
15x103  
16x103  
1.1x106  
1.2x106  
1.3x106  
1.4x106  
1.5x106  
1.6x106  
2.2x106  
2.4x106  
2.6x106  
2.8x106  
3x106  
3.2x106  
5.38.3.2.9  
S12IPIMV1 COP Control Register (CPMUCOP)  
This register controls the COP (Computer Operating Properly) watchdog.  
The clock source for the COP is either IRCCLK or OSCCLK depending on the setting of the COPOSCSEL bit. In Stop Mode with  
PSTP=1(Pseudo Stop Mode), COPOSCSEL=1 and PCE=1 the COP continues to run, else the COP counter halts in Stop Mode.  
Table 356. S12IPIMV1 COP Control Register (CPMUCOP)  
0x003C  
7
6
5
4
3
2
1
0
R
W
0
0
0
WCOP  
RSBCK  
CR2  
CR1  
CR0  
WRTMASK  
0
Reset  
F
0
0
0
0
F
0
F
0
F
0
Reset  
0
= Unimplemented or Reserved  
Note:  
197. After de-assert of System Reset the values are automatically loaded from the Flash memory. See Device specification for details.  
Read: Anytime  
Write:  
1. RSBCK: anytime in Special Mode; write to “1” but not to “0” in Normal Mode  
2. WCOP, CR2, CR1, CR0:  
MM912_634 Advance Information, Rev. 11.0  
246  
Freescale Semiconductor  
Functional Description and Application Information  
Anytime in Special Mode, when WRTMASK is 0, otherwise it has no effect  
Write once in Normal Mode, when WRTMASK is 0, otherwise it has no effect.  
Writing CR[2:0] to “000” has no effect, but counts for the “write once” condition.  
Writing WCOP to “0” has no effect, but counts for the “write once” condition.  
When a non-zero value is loaded from Flash to CR[2:0] the COP timeout period is started.  
A change of the COPOSCSEL bit (writing a different value or loosing UPOSC status) re-starts the COP timeout period.  
In Normal Mode the COP timeout period is restarted if either of these conditions is true:  
1. Writing a non-zero value to CR[2:0] (anytime in Special Mode, once in Normal Mode) with WRTMASK = 0.  
2. Writing WCOP bit (anytime in Special Mode, once in Normal Mode) with WRTMASK = 0.  
3. Changing RSBCK bit from “0” to “1”.  
In Special Mode, any write access to CPMUCOP register restarts the COP timeout period.  
Table 357. CPMUCOP Field Descriptions  
Field  
Description  
Window COP Mode Bit — When set, a write to the CPMUARMCOP register must occur in the last 25% of the selected period.  
A write during the first 75% of the selected period generates a COP reset. As long as all writes occur during this window, $55  
can be written as often as desired. Once $AA is written after the $55, the time-out logic restarts and the user must wait until  
the next window before writing to CPMUARMCOP. Table 358 shows the duration of this window for the seven available COP  
rates.  
7
WCOP  
0
1
Normal COP operation  
Window COP operation  
COP and RTI Stop in Active BDM Mode Bit  
6
0
1
Allows the COP and RTI to keep running in Active BDM mode.  
RSBCK  
Stops the COP and RTI counters whenever the part is in Active BDM mode.  
Write Mask for WCOP and CR[2:0] Bit — This write-only bit serves as a mask for the WCOP and CR[2:0] bits while writing  
the CPMUCOP register. It is intended for BDM writing the RSBCK without changing the content of WCOP and CR[2:0].  
5
0
1
Write of WCOP and CR[2:0] has an effect with this write of CPMUCOP  
WRTMASK  
Write of WCOP and CR[2:0] has no effect with this write of CPMUCOP. (Does not count for “write once”.)  
COP Watchdog Timer Rate Select — These bits select the COP timeout rate (see Table 358). Writing a nonzero value to  
CR[2:0] enables the COP counter and starts the timeout period. A COP counter timeout causes a System Reset. This can be  
avoided by periodically (before timeout) initializing the COP counter via the CPMUARMCOP register.  
While all of the following four conditions are true the CR[2:0], WCOP bits are ignored and the COP operates at highest timeout  
2–0  
CR[2:0]  
24  
period (2  
cycles) in normal COP mode (Window COP mode disabled):  
1) COP is enabled (CR[2:0] is not 000)  
2) BDM mode active  
3) RSBCK = 0  
4) Operation in Special Mode  
Table 358. COP Watchdog Rates  
COPCLK - Cycles to Timeout (COPCLK is either IRCCLK  
or OSCCLK depending on the COPOSCSEL bit)  
CR2  
CR1  
CR0  
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
COP disabled  
2 14  
2 16  
2 18  
2 20  
2 22  
2 23  
2 24  
MM912_634 Advance Information, Rev. 11.0  
247  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.38.3.2.10  
Reserved Register CPMUTEST0  
NOTE  
This reserved register is designed for factory test purposes only, and is not intended for  
general user access. Writing to this register when in Special Mode can alter the S12IPIMV1’s  
functionality.  
Table 359. Reserved Register (CPMUTEST0)  
0x003D  
7
6
5
4
3
2
1
0
fmcs_reg_se cpmu_test_ cpmu_test_x  
test_sqw_o  
sc0  
R
fc_force_en0  
vcofrq20  
0
fm_test0  
l0  
0
gfe0  
fc_en0  
W
Reset  
Note 10  
0
0
0
0
0
0
1) Power on reset clears the crg_test_gfe bit  
= Unimplemented or Reserved  
Read: Anytime  
Write: Only in Special Mode  
Table 360. CPMUTEST0 Field Descriptions  
Field  
Description  
FMCS Register Select Bit— This bit switches either CPMUTEST1 or CPMUFMCS test register to address 0x003E.  
0 CPMUTEST1 register is visible on address 0x003E, fm_cs[7:0] of hard macro driven dynamically (triangular)  
if fm_enable=1.  
7
fmcs_reg_sel  
1 CPMUFMCS register is visible on address 0x003E, fm_cs[7:0] of hard macro driven to value of FMCS register.  
Glitch Filter Enable Test Bit — This bit goes to the PTI controller, it is intended to enable the RESET pad glitch filter in  
functional test mode (where it is by default disabled).  
6
0 Glitch Filter disable request  
1 Glitch Filter enable request  
cpmu_test_gfe  
XFC Test Pin Enable — This bit routes the external XFC test pin to the internal filter node. Using this test feature make sure  
that only one source is driving the internal filter node (FC). So for this case write fc_force_en=0, pfd_force_en=1,  
pfd_force_up=pfd_force_down=0.  
5
cpmu_test_xfc  
_en  
0 external XFC test pin not connected to internal filter node  
1 external XFC test pin connected to internal filter node  
FC Force Enable Bit — This bit allows to force the internal filter node FC to defined values. If fc_force_en=1, REFFRQ[1] bit  
(in CPMUREFDIV register) selects either 1/2 or 1/3 VDDPLL voltage to be driven on FC node. Using this test feature make sure  
that only one source is driving the internal filter node (FC). So for this case write cpmu_test_xfc_en=0, pfd_force_en=1,  
pfd_force_up=pfd_force_down=0.  
4
fc_force_en  
0 Internal filter node (FC) not driven from defined values (1/2 or 1/3 VDDPLL  
1 If REFFRQ[1]=1 then internal filter node (FC) is driven to VDDPLL/3.  
If REFFRQ[1]=0 then internal filter node (FC) is driven to VDDPLL/2.  
)
3
VCO gain Bit 2 — This bit selects together with the VCOFRQ[1:0] bits of the CPMUSYNR register the gain of the VtoI  
converter in the PLL. Setting vcofrq2-0 all to 1 is intended for 160MHz VCOCLK generation.  
vcofrq2  
FM test amplitude Bit — This bit multiplies FM amplitude determined by FM1,FM0 and CPMUFMCS[7:0] by 4. This is to  
amplify frequency variation on VCOCLK when using PLL test modes (pfd_force_en, fc_force_en). A higher frequency variation  
is easier to measure on tester.  
1
fm_test  
0 FM amplitude multiplied by 1  
1 FM amplitude multiplied by 4  
Test square wave enable Bit — Enables XTAL pin digital input data used for Oscillator test.  
0 XTAL pin as digital input disabled  
1 XTAL pin as digital input enabled  
0
test_sqw_osc  
MM912_634 Advance Information, Rev. 11.0  
248  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.3.2.11  
Reserved Register CPMUTEST1  
NOTE  
This reserved register is designed for factory test purposes only, and is not intended for  
general user access. Writing to this register when in Special Mode can alter the S12IPIMV1’s  
functionality.  
Table 361. Reserved Register (CPMUTEST1)  
0x003E  
7
6
5
4
3
2
1
0
osc_lcp_mo  
nitor_disable  
0
pfd_force_e cpmu_test_c cpmu_test_c cpmu_test_c  
osc_lcp_exts pfd_force_u pfd_force_d  
R
n0  
lk_en0  
lk_sel[1]0  
lk_sel[0]0  
qw_enable0  
p0  
own0  
W
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Only in Special Mode  
Table 362. CPMUTEST1 Field Descriptions  
Field  
Description  
Phase Detector Force Enable Bit— This bit breaks the PLL feedback loop and allows force of phase detector via  
pfd_force_up or pfd_force_down bit or cpmu_test_xfc pin or fc_force_en.  
7
0 Normal functionality of Phase Detector using REFCLK and FBCLK.  
1 Phase detector de-connected from REFCLK and FBCLK (PLL loop open).  
pfd_force_en  
CPMU test clock enable Bit— This bits routes the clock selected by cpmu_test_clk_sel[1:0] to external pin cpmu_test_clk.  
0 CPMU test clock not observable.  
1 CPMU test clock observable at external pin.  
6
cpmu_test_clk_  
en  
5, 4  
CPMU test clock select Bits— These bits select the CPMU test clock to be observed on external pin cpmu_test_clk for test  
or characterization purposes.  
00 = IRCCLK, 01=OSCCLK, 10=VCOCLK, 11=VCOCLK_DIV4.  
cpmu_test_clk_  
sel[1:0]  
Oscillator clock monitor disable Bit — to disable the clock monitor in special single chip mode.  
0 Clock monitor always enabled with OSCE=1.  
1 Clock monitor disabled regardless of OSCE Bit.  
3
osc_lcp_monito  
r_disable  
2
Oscillator external square wave enable Bit — Drives directly osc_lcp_extsqw_enable input of OSCLCP hardmacro.  
osc_lcp_extsq  
w_enable  
Phase Detector Force Up Bit — If pfd_force_en=1, this bits force the PLL charge pump to drive the internal filter voltage down,  
that is VCOCLK frequency goes up. Using this test feature make sure that only one source is driving the internal filter node  
(FC). So for this case write xfc_en=fc_force_en=pfd_force_down=0.  
1
pfd_force_up  
0 No effect.  
1 If pfd_force_en=1 then the charge pump continuously drives internal filter node down.  
Phase Detector Force Down Bit — If pfd_force_en=1, this bits force the PLL charge pump to drive the internal filter voltage  
up, that is VCOCLK frequency goes down. Using this test feature make sure that only one source is driving the internal filter  
node (FC). So for this case write xfc_en=fc_force_en=pfd_force_up=0.  
0
pfd_force_up  
0 No effect.  
1 If pfd_force_en=1 then the charge pump continuously drives internal filter node up.  
MM912_634 Advance Information, Rev. 11.0  
249  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.3.2.12  
Reserved Register CPMUFMCS  
Table 363. Reserved Register (CPMUFMCS)  
0x003E  
7
6
5
4
3
2
1
0
R
W
fm_cs[7:0]  
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Only in special mode  
Table 364. CPMUFMCS Field Descriptions  
Field  
Description  
Frequency Modulation Amplitude Bits— If fmcs_reg_sel = 1 (CPMUTEST0 register) then fm_cs[7:0] adds current of  
0(fm_cs=$00) to 1 (fm_cs=$ff) times the value determined by FME1, FM0 bits to the VCO current. As a result VCOCLK  
frequency will increase.  
7
fm_cs[7:0]  
5.38.3.2.13  
S12IPIMV1 COP Timer Arm/Reset Register (CPMUARMCOP)  
This register is used to restart the COP timeout period.  
Table 365. S12IPIMV1 CPMUARMCOP Register  
0x003F  
7
6
5
4
3
2
1
0
R
W
0
Bit 7  
0
0
Bit 6  
0
0
Bit 5  
0
0
Bit 4  
0
0
Bit 3  
0
0
Bit 2  
0
0
Bit 1  
0
0
Bit 0  
0
Reset  
Read: Always reads $00  
Write: Anytime  
When the COP is disabled (CR[2:0] = “000”) writing to this register has no effect.  
When the COP is enabled by setting CR[2:0] nonzero, the following applies:  
Writing any value other than $55 or $AA causes a COP reset. To restart the COP timeout period write $55 followed by  
a write of $AA. These writes do not need to occur back to back, but the sequence ($55, $AA) must be completed prior  
to COP end of timeout period to avoid a COP reset. Sequences of $55 writes are allowed. When the WCOP bit is set,  
$55 and $AA writes must be done in the last 25% of the selected timeout period; writing any value in the first 75% of  
the selected period will cause a COP reset.  
MM912_634 Advance Information, Rev. 11.0  
250  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.3.2.14  
Low Voltage Control Register (CPMULVCTL)  
The CPMULVCTL register allows the configuration of the low-voltage detect features.  
Table 366. Low Voltage Control Register (CPMULVCTL)  
0x02F1  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
LVDS  
LVIE  
0
LVIF  
U
Reset  
0
0
0
0
0
U
= Unimplemented or Reserved  
Note:  
198. The Reset state of LVDS and LVIF depends on the external supplied VDDA level  
Read: Anytime  
Write: LVIE and LVIF are write anytime, LVDS is read only  
Table 367. CPMULVCTL Field Descriptions  
Field  
Description  
Low-voltage Detect Status Bit — This read-only status bit reflects the voltage level on VDDRX. Writes have no effect.  
2
0
1
Input voltage VDDRX is above level VLVID or RPM.  
Input voltage VDDRX is below level VLVIA and FPM.  
LVDS  
Low-voltage Interrupt Enable Bit  
1
LVIE  
0
1
Interrupt request is disabled.  
Interrupt will be requested whenever LVIF is set.  
Low-voltage Interrupt Flag — LVIF is set to 1 when LVDS status bit changes. This flag can only be cleared by writing a 1.  
Writing a 0 has no effect. If enabled (LVIE = 1), LVIF causes an interrupt request.  
0
0
1
No change in LVDS bit.  
LVDS bit has changed.  
LVIF  
5.38.3.2.15  
Autonomous Periodical Interrupt Control Register (CPMUAPICTL)  
The CPMUAPICTL register allows the configuration of the autonomous periodical interrupt features.  
Table 368. Autonomous Periodical Interrupt Control Register (CPMUAPICTL)  
0x02F2  
7
6
5
4
3
2
1
0
R
W
0
0
APICLK  
0
APIES  
0
APIEA  
0
APIFE  
0
APIE  
0
APIF  
0
Reset  
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Anytime  
MM912_634 Advance Information, Rev. 11.0  
251  
Freescale Semiconductor  
Functional Description and Application Information  
Table 369. CPMUAPICTL Field Descriptions  
Field  
Description  
Autonomous Periodical Interrupt Clock Select Bit — Selects the clock source for the API. Writable only if APIFE = 0.  
APICLK cannot be changed if APIFE is set by the same write operation.  
7
0
1
Autonomous periodical interrupt clock used as source.  
Bus Clock used as source.  
APICLK  
Autonomous Periodical Interrupt External Select Bit — Selects the waveform at the external pin API_EXTCLK as shown  
in Figure . See device level specification for connectivity of API_EXTCLK pin.  
4
0
1
If APIEA and APIFE are set, at the external pin API_EXTCLK periodic high pulses are visible at the end of every selected  
period with the size of half of the minimum period (APIR=0x0000 in Table 376).  
If APIEA and APIFE are set, at the external pin API_EXTCLK a clock is visible with 2 times the selected API Period.  
APIES  
Autonomous Periodical Interrupt External Access Enable Bit — If set, the waveform selected by bit APIES can be  
accessed externally. See device level specification for connectivity.  
3
0
1
Waveform selected by APIES can not be accessed externally.  
Waveform selected by APIES can be accessed externally, if APIFE is set.  
APIEA  
Autonomous Periodical Interrupt Feature Enable Bit — Enables the API feature and starts the API timer when set.  
2
0
1
Autonomous periodical interrupt is disabled.  
Autonomous periodical interrupt is enabled and timer starts running.  
APIFE  
Autonomous Periodical Interrupt Enable Bit  
1
0
1
API interrupt request is disabled.  
API interrupt will be requested whenever APIF is set.  
APIE  
Autonomous Periodical Interrupt Flag — APIF is set to 1 when the in the API configured time has elapsed. This flag can  
only be cleared by writing a 1. Writing a 0 has no effect. If enabled (APIE = 1), APIF causes an interrupt request.  
0
0
1
API time-out has not yet occurred.  
API time-out has occurred.  
APIF  
API min period / 2  
APIES=0  
APIES=1  
API period  
Figure 84. Waveform selected on API_EXTCLK pin (APIEA=1, APIFE=1)  
MM912_634 Advance Information, Rev. 11.0  
252  
Freescale Semiconductor  
 
Functional Description and Application Information  
Autonomous Periodical Interrupt Trimming Register (CPMUAPITR)  
5.38.3.2.16  
The CPMUAPITR register configures the trimming of the API time-out period.  
Table 370. Autonomous Periodical Interrupt Trimming Register (CPMUAPITR)  
0x02F3  
7
6
5
4
3
2
1
0
R
W
0
0
APITR5  
APITR4  
APITR3  
APITR2  
APITR1  
APITR0  
Reset  
Reset  
F
0
F
0
F
0
F
0
F
0
F
0
0
0
After de-assert of System Reset a value is automatically loaded from the Flash memory.  
Read: Anytime  
Write: Anytime  
Table 371. CPMUAPITR Field Descriptions  
Field  
Description  
7–2  
Autonomous Periodical Interrupt Period Trimming Bits — See Table 372 for trimming effects. The APITR[5:0] value  
represents a signed number influencing the ACLK period time.  
APITR[5:0]  
Table 372. Trimming Effect of APITR  
Bit  
Trimming Effect  
APITR[5]  
APITR[4]  
APITR[3]  
APITR[2]  
APITR[1]  
APITR[0]  
Increases period  
Decreases period less than APITR[5] increased it  
Decreases period less than APITR[4]  
Decreases period less than APITR[3]  
Decreases period less than APITR[2]  
Decreases period less than APITR[1]  
5.38.3.2.17  
Autonomous Periodical Interrupt Rate High and Low Register (CPMUAPIRH / CPMUAPIRL)  
The CPMUAPIRH and CPMUAPIRL registers allow the configuration of the autonomous periodical interrupt rate.  
Table 373. Autonomous Periodical Interrupt Rate High Register (CPMUAPIRH)  
0x02F4  
7
6
5
4
3
2
1
0
R
W
APIR15  
0
APIR14  
0
APIR13  
0
APIR12  
0
APIR11  
0
APIR10  
0
APIR9  
0
APIR8  
0
Reset  
= Unimplemented or Reserved  
MM912_634 Advance Information, Rev. 11.0  
253  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 374. Autonomous Periodical Interrupt Rate Low Register (CPMUAPIRL)  
0x02F5  
7
6
5
4
3
2
1
0
R
APIR7  
0
APIR6  
0
APIR5  
0
APIR4  
0
APIR3  
0
APIR2  
0
APIR1  
0
APIR0  
0
W
Reset  
Read: Anytime  
Write: Anytime if APIFE=0. Else writes have no effect.  
Table 375. CPMUAPIRH / CPMUAPIRL Field Descriptions  
Field  
Description  
15-0  
Autonomous Periodical Interrupt Rate Bits — These bits define the time-out period of the API. See Table 376 for details of  
the effect of the autonomous periodical interrupt rate bits.  
APIR[15:0]  
The period can be calculated as follows depending on logical value of the APICLK bit:  
APICLK=0: Period = 2*(APIR[15:0] + 1) * fACLK  
APICLK=1: Period = 2*(APIR[15:0] + 1) * Bus Clock period  
Table 376. Selectable Autonomous Periodical Interrupt Periods  
APICLK  
APIR[15:0]  
Selected Period  
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
0000  
0001  
0002  
0003  
0004  
0005  
.....  
0.2 ms1  
0.4 ms1  
0.6 ms1  
0.8 ms1  
1.0 ms1  
1.2 ms1  
.....  
FFFD  
FFFE  
FFFF  
0000  
0001  
0002  
0003  
0004  
0005  
.....  
13106.8 ms1  
13107.0 ms1  
13107.2 ms1  
2 * Bus Clock period  
4 * Bus Clock period  
6 * Bus Clock period  
8 * Bus Clock period  
10 * Bus Clock period  
12 * Bus Clock period  
.....  
FFFD  
FFFE  
FFFF  
131068 * Bus Clock period  
131070 * Bus Clock period  
131072 * Bus Clock period  
1
When fACLK is trimmed to 10KHz.  
MM912_634 Advance Information, Rev. 11.0  
254  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.38.3.2.18  
Reserved Register CPMUTEST3  
NOTE  
This reserved register is designed for factory test purposes only, and is not intended for  
general user access. Writing to this register when in Special mode can alter the S12IPIMV1’s  
functionality.  
Table 377. Reserved Register (CPMUTEST3)  
0x02F6  
7
6
5
4
3
2
1
0
0vdd_extern  
al_en  
R
0LVRT  
0REGFT2  
0REGFT1  
0REGFT0  
0REGT2  
0REGT1  
0REGT0  
W
Reset  
0
0
0
0
0
0
0
0
Power on  
Reset  
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Only in Special Mode  
5.38.3.2.19  
S12IPIMV1 IRC1M Trim Registers (CPMUIRCTRIMH / CPMUIRCTRIML)  
Table 378. S12IPIMV1 IRC1M Trim High Register (CPMUIRCTRIMH)  
0x02F8  
15  
14  
13  
12  
11  
10  
9
8
R
W
0
TCTRIM[4:0]  
IRCTRIM[9:8]  
Reset  
F
0
F
0
F
0
F
0
0
0
F
1
F
1
Reset  
Note:  
199. After de-assert of System Reset a factory programmed trim value is automatically loaded from the Flash memory to provide trimmed  
Internal Reference Frequency fIRC1M_TRIM  
0
0
.
Table 379. S12IPIMV1 IRC1M Trim Low Register (CPMUIRCTRIML)  
0x02F9  
7
6
5
4
3
2
1
0
R
W
IRCTRIM[7:0]  
Reset  
F
1
F
1
F
1
F
1
F
1
F
1
F
1
F
1
Reset  
Note:  
200. After de-assert of System Reset a factory programmed trim value is automatically loaded from the Flash memory to provide trimmed  
Internal Reference Frequency fIRC1M_TRIM  
.
Read: Anytime  
Write: Anytime if PROT=0 (CPMUPROT register). Else write has no effect  
NOTE  
Writes to these registers while PLLSEL=1 clears the LOCK and UPOSC status bits.  
MM912_634 Advance Information, Rev. 11.0  
255  
Freescale Semiconductor  
Functional Description and Application Information  
Table 380. CPMUIRCTRIMH/L Field Descriptions  
Field  
Description  
IRC1M temperature coefficient Trim Bits  
Trim bits for the Temperature Coefficient (TC) of the IRC1M frequency.  
Figure 86 shows the influence of the bits TCTRIM4:0] on the relationship between frequency and temperature.  
Figure 86 shows an approximate TC variation, relative to the nominal TC of the IRC1M (i.e. for TCTRIM[4:0]=0x00000 or  
0x10000).  
15-11  
TCTRIM  
IRC1M Frequency Trim Bits — Trim bits for Internal Reference Clock  
After System Reset the factory programmed trim value is automatically loaded into these registers, resulting in an Internal  
Reference Frequency fIRC1M_TRIM. See device electrical characteristics for value of fIRC1M_TRIM  
.
9-0  
The frequency trimming consists of two different trimming methods:  
IRCTRIM  
A rough trimming controlled by bits IRCTRIM[9:6] can be done with frequency leaps of about 6% in average.  
A fine trimming controlled by the bits IRCTRIM[5:0] can be done with frequency leaps of about 0.3% (this trimming determines  
the precision of the frequency setting of 0.15%, i.e. 0.3% is the distance between two trimming values).  
Figure 85 shows the relationship between the trim bits and the resulting IRC1M frequency.  
IRC1M frequency (IRCCLK)  
IRCTRIM[9:6]  
1.5 MHz  
IRCTRIM[5:0]  
......  
1.0 MHz  
600 kHz  
IRCTRIM[9:0]  
$3FF  
$1FF  
$000  
Figure 85. IRC1M Frequency Trimming Diagram  
MM912_634 Advance Information, Rev. 11.0  
256  
Freescale Semiconductor  
 
Functional Description and Application Information  
frequency  
0x11111  
...  
0x10101  
0x10100  
0x10011  
0x10010  
0x10001  
TC increases  
TCTRIM[4:0] = 0x10000 or 0x00000 (nominal TC)  
0x00001  
0x00010  
0x00011  
0x00100  
0x00101  
...  
TC decreases  
0x01111  
$1FF  
150C  
- 40C  
temperature  
Figure 86. Influence of TCTRIM[4:0] on the Temperature Coefficient  
NOTE  
The frequency is not necessarily linear with the temperature (in most cases it will not be).  
The above diagram is meant only to give the direction (positive or negative) of the variation  
of the TC, relative to the nominal TC.  
Setting TCTRIM[4:0] at 0x00000 or 0x10000 does not mean that the temperature coefficient  
will be zero. These two combinations basically switch off the TC compensation module,  
which result in the nominal TC of the IRC1M.  
Table 381. TC Trimming of the Frequency of the IRC1M  
IRC1M indicative frequency drift for  
TCTRIM[4:0]  
IRC1M indicative relative TC variation  
relative TC variation  
00000  
00001  
00010  
00011  
00100  
00101  
00110  
00111  
01000  
01001  
01010  
01011  
01100  
01101  
01110  
01111  
10000  
10001  
0 (nominal TC of the IRC)  
0%  
-0.27%  
-0.54%  
-0.5%  
-0.9%  
-1.3%  
-1.7%  
-2.0%  
-2.2%  
-2.5%  
-3.0%  
-3.4%  
-3.9%  
-4.3%  
-4.7%  
-5.1%  
-5.6%  
-5.9%  
0%  
-0.81%  
-1.08%  
-1.35%  
-1.63%  
-1.9%  
-2.20%  
-2.47%  
-2.77%  
-3.04  
-3.33%  
-3.6%  
-3.91%  
-4.18%  
0 (nominal TC of the IRC)  
+0.27%  
+0.5%  
MM912_634 Advance Information, Rev. 11.0  
257  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 381. TC Trimming of the Frequency of the IRC1M (continued)  
IRC1M indicative frequency drift for  
relative TC variation  
TCTRIM[4:0]  
IRC1M indicative relative TC variation  
10010  
10011  
10100  
10101  
10110  
10111  
11000  
11001  
11010  
11011  
11100  
11101  
11110  
11111  
+0.54%  
+0.81%  
+1.07%  
+1.34%  
+1.59%  
+1.86%  
+2.11%  
+2.38%  
+2.62%  
+2.89%  
+3.12%  
+3.39%  
+3.62%  
+3.89%  
+0.9%  
+1.3%  
+1.7%  
+2.0%  
+2.2%  
+2.5%  
+3.0%  
+3.4%  
+3.9%  
+4.3%  
+4.7%  
+5.1%  
+5.6%  
+5.9%  
NOTE  
Since the IRC1M frequency is not a linear function of the temperature, but more like a  
parabola, the above relative variation is only an indication and should be considered with  
care.  
Be aware that the output frequency varies with the TC trimming. A frequency trimming  
correction is therefore necessary. The values provided in Table 381 are typical values at  
ambient temperature which can vary from device to device.  
5.38.3.2.20  
S12IPIMV1 Oscillator Register (CPMUOSC)  
This register configures the external oscillator (OSCLCP).  
Table 382. S12IPIMV1 Oscillator Register (CPMUOSC)  
0x02FA  
7
6
5
4
3
2
1
0
R
W
OSCPINS_EN  
OSCE  
0
OSCBW  
0
OSCFILT[4:0]  
0
Reset  
0
0
0
0
0
Read: Anytime  
Write: Anytime if PROT=0 (CPMUPROT register) and PLLSEL=1 (CPMUCLKS register). Else write has no effect.  
NOTE  
Write to this register clears the LOCK and UPOSC status bits.  
If the chosen VCOCLK-to-OSCCLK ratio divided by two ((fVCO / fOSC)/2) is not an integer  
number, the filter can not be used and the OSCFILT[4:0] bits must be set to 0.  
The frequency modulation (FM1 and FM0) can not be used if the Adaptive Oscillator Filter  
is enabled.  
MM912_634 Advance Information, Rev. 11.0  
258  
Freescale Semiconductor  
Functional Description and Application Information  
Table 383. CPMUOSC Field Descriptions  
Field  
Description  
Oscillator Enable Bit — This bit enables the external oscillator (OSCLCP). The UPOSC status bit in the CPMUFLG  
register indicates when the oscillation is stable and OSCCLK can be selected as Bus Clock or source of the COP or RTI.  
A loss of oscillation will lead to a clock monitor reset.  
0
External oscillator is disabled. REFCLK for PLL is IRCCLK.  
7
1
External oscillator is enabled.Clock monitor is enabled. REFCLK for PLL is external oscillator clock divided by  
OSCE  
REFDIV.  
Note: When starting up the external oscillator (either by programming OSCE bit to 1 or on exit from Full Stop Mode with  
OSCE bit already 1) the software must wait for a minimum time equivalent to the startup-time of the external  
oscillator tUPOSC before entering Pseudo Stop Mode.  
Oscillator Filter Bandwidth Bit — If the VCOCLK frequency exceeds 25 MHz wide bandwidth must be selected. The  
Oscillator Filter is described in more detail at Section 5.38.4.5.2, “The Adaptive Oscillator Filter"  
6
0
1
Oscillator filter bandwidth is narrow (window for expected OSCCLK edge is one VCOCLK cycle).  
Oscillator filter bandwidth is wide (window for expected OSCCLK edge is three VCOCLK cycles).  
OSCBW  
Oscillator Pins EXTAL and XTAL Enable Bit  
If OSCE=1 this read-only bit is set. It can only be cleared with the next reset.  
Enabling the external oscillator reserves the EXTAL and XTAL pins exclusively for oscillator application.  
5
OSCPINS_EN  
0
1
EXTAL and XTAL pins are not reserved for oscillator.  
EXTAL and XTAL pins exclusively reserved for oscillator.  
Oscillator Filter Bits — When using the oscillator a noise filter can be enabled, which filters noise from the incoming  
external oscillator clock and detects if the external oscillator clock is qualified or not (quality status shown by bit UPOSC).  
4-0  
OSCFILT  
The VCOCLK-to-OSCCLK ratio divided by two ((fVCO / fOSC)/2) must be an integer value. This value must be written to the  
OSCFILT[4:0] bits to enable the Adaptive Oscillator Filter.  
0x0000 Adaptive Oscillator Filter disabled.  
else Adaptive Oscillator Filter enabled]  
5.38.3.2.21  
S12IPIMV1 Protection Register (CPMUPROT)  
This register protects the following clock configuration registers from accidental overwrite:  
CPMUSYNR, CPMUREFDIV, CPMUCLKS, CPMUPLL, CPMUIRCTRIMH/L and CPMUOSC  
Table 384. S12IPIMV1 Protection Register (CPMUPROT)  
0x02FB  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
PROT  
0
Reset  
0
0
0
0
0
0
0
Read: Anytime  
Write: Anytime  
Table 385. Clock Configuration Registers Protection Bit  
Field  
Description  
Clock Configuration Registers Protection Bit — This bit protects the clock configuration registers from accidental overwrite  
(see list of protected registers above).  
Writing 0x26 to the CPMUPROT register clears the PROT bit, other write accesses set the PROT bit.  
0
0
1
Protection of clock configuration registers is disabled.  
Protection of clock configuration registers is enabled. (see list of protected registers above)  
MM912_634 Advance Information, Rev. 11.0  
259  
Freescale Semiconductor  
Functional Description and Application Information  
5.38.3.2.22  
Reserved Register CPMUTEST2  
NOTE  
This reserved register is designed for factory test purposes only, and is not intended for  
general user access. Writing to this register when in Special Mode can alter the S12IPIMV1’s  
functionality.  
Table 386. Reserved Register CPMUTEST2  
0x02FC  
7
6
5
4
3
2
1
0
R
W
0
0
0 LVRS  
0 LVRFS  
0 LVRXS  
0
0
0RCEXA  
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Only in Special Mode  
The reserved register allows several setting to aid to perform device parametric tests This register can only be written after writing  
a $E3 before into this register.  
Table 387. CPMUTEST2 Field Descriptions  
Field  
Description  
Low Voltage Reset Detect VDD Status Bit — This read-only status bit reflects the Status of the Low Voltage Reset on VDD  
when core reset disabled for parametric tests. Writes have no effect.  
5
0
1
Input voltage VDD is above level VLVRA or device is in Reduced Performance Mode (RPM).  
Input voltage VDD is below level VLVRA and device is in Full Performance Mode (FPM).  
LVRS  
Low Voltage Reset Detect VDDF Status Bit — This read-only status bit reflects the Status of the Low Voltage Reset on VDDF  
when core reset disabled for parametric tests. Writes have no effect.  
4
0
1
Input voltage VDDF is above level VLVRFA or device is in RPM.  
Input voltage VDDF is below level VLVRFA and device is in FPM.  
LVRFS  
Low Voltage Reset Detect VDDX Status Bit — This read-only status bit reflects the Status of the Low Voltage Reset on VDDX  
when core reset disabled for parametric tests. Writes have no effect.  
3
0
1
Input voltage VDDX is above level VLVRXA or device is in RPM.  
Input voltage VDDX is below level VLVRXA and device is in FPM.  
LVRXS  
Autonomous Periodical Interrupt clock (ACLK) External Access Enable Bit — The Autonomous Periodical Interrupt clock  
(ACLK) can be mapped also to an output pin. See Section 1 (Device Overview) and Section Port Integration Module for details.  
0
0 The Autonomous Periodical Interrupt clock (ACLK) is not mapped to an output pin.  
RCEXA  
1 The Autonomous Periodical Interrupt clock (ACLK) is mapped to an output pin if APIFE is set and APIEA=0.  
5.38.4  
5.38.4.1  
Functional Description  
Phase-locked Loop with Internal Filter (PLL)  
The PLL is used to generate a high speed PLLCLK based on a low frequency REFCLK.  
The REFCLK is by default the IRCCLK which is trimmed to fIRC1M_TRIM=1.0 MHz.  
If using the oscillator (OSCE=1) REFCLK will be based on OSCCLK. For increased flexibility, OSCCLK can be divided in a range  
of 1 to 16 to generate the reference frequency REFCLK using the REFDIV[3:0] bits. Based on the SYNDIV[5:0] bits the PLL  
generates the VCOCLK by multiplying the reference clock by a 2, 4, 6,... 126, 128. Based on the POSTDIV[4:0] bits the VCOCLK  
can be divided in a range of 1,2, 3, 4, 5, 6,... to 32 to generate the PLLCLK.  
MM912_634 Advance Information, Rev. 11.0  
260  
Freescale Semiconductor  
Functional Description and Application Information  
f
OSC  
-------------------------------------  
=
f
If Oscillator is enabled (OSCE=1)  
If Oscillator is disabled (OSCE=0)  
REF  
REFDIV + 1  
= f  
f
REF  
IRC1M  
f
= 2 f  
 SYNDIV + 1  
VCO  
REF  
f
VCO  
------------------------------------------  
=
If PLL is locked (LOCK=1)  
f
PLL  
f
POSTDIV + 1  
f
VCO  
---------------  
=
If PLL is not locked (LOCK=0)  
If PLL is selected (PLLSEL=1)  
PLL  
4
f
PLL  
------------  
f
=
bus  
2
NOTE  
Although it is possible to set the dividers to command a very high clock frequency, do not  
exceed the specified bus frequency limit for the MCU.  
Several examples of PLL divider settings are shown in Table 388. The following rules help to achieve optimum stability and  
shortest lock time:  
Use lowest possible fVCO / fREF ratio (SYNDIV value).  
Use highest possible REFCLK frequency fREF  
.
Table 388. Examples of PLL Divider Settings  
fosc  
REFDIV[3:0]  
fREF  
REFFRQ[1:0]  
SYNDIV[5:0]  
fVCO  
VCOFRQ[1:0]  
POSTDIV[4:0]  
fPLL  
fbus  
off  
off  
$00  
$00  
$00  
$00  
1.0 MHz  
1.0 MHz  
1.0 MHz  
4.0 MHz  
00  
00  
00  
01  
$1F  
$1F  
$0F  
$03  
64 MHz  
64 MHz  
32 MHz  
32 MHz  
01  
01  
00  
01  
$03  
$00  
$00  
$00  
16 MHz 8.0 MHz  
64 MHz  
32 MHz  
32 MHz  
32 MHz  
16 MHz  
16 MHz  
off  
4.0 MHz  
The phase detector inside the PLL compares the feedback clock (FBCLK = VCOCLK/(SYNDIV+1) with the reference clock  
(REFCLK = (IRC1M or OSCCLK)/(REFDIV+1)). Correction pulses are generated based on the phase difference between the two  
signals. The loop filter alters the DC voltage on the internal filter capacitor, based on the width and direction of the correction  
pulse, which leads to a higher or lower VCO frequency.  
The user must select the range of the REFCLK frequency (REFFRQ[1:0] bits) and the range of the VCOCLK frequency  
(VCOFRQ[1:0] bits) to ensure that the correct PLL loop bandwidth is set.  
The lock detector compares the frequencies of the FBCLK and the REFCLK. Therefore the speed of the lock detector is directly  
proportional to the reference clock frequency. The circuit determines the lock condition based on this comparison.  
If PLL LOCK interrupt requests are enabled, the software can wait for an interrupt request and for instance check the LOCK bit.  
If interrupt requests are disabled, software can poll the LOCK bit continuously (during PLL start-up) or at periodic intervals. In  
either case, only when the LOCK bit is set, the VCOCLK will have stabilized to the programmed frequency.  
The LOCK bit is a read-only indicator of the locked state of the PLL.  
The LOCK bit is set when the VCO frequency is within the tolerance, Lock, and is cleared when the VCO frequency is  
out of the tolerance, unl  
.
Interrupt requests can occur if enabled (LOCKIE = 1) when the lock condition changes, toggling the LOCK bit.  
5.38.4.2  
Startup from Reset  
An example of startup of clock system from Reset is given in Figure 87.  
MM912_634 Advance Information, Rev. 11.0  
261  
Freescale Semiconductor  
 
Functional Description and Application Information  
System  
Reset  
768 cycles  
fVCORST  
f
=32 MHz  
f
=16MHz  
fPLL increasing  
PLL  
PLL  
PLLCLK  
LOCK  
) (  
tlock  
SYNDIV  
$1F (default target fVCO=64MHz)  
POSTDIV  
$03 (default target fPLL=fVCO/4 = 16MHz)  
reset state  
$01  
example change  
of POSTDIV  
CPU  
vector fetch, program execution  
Figure 87. Startup of Clock System After Reset  
5.38.4.3  
Stop Mode using PLLCLK as Bus Clock  
An example of what happens going into Stop mode and exiting Stop mode after an interrupt is shown in Figure 88. Disable PLL  
Lock interrupt (LOCKIE=0) before going into Stop mode.  
wake-up  
interrupt continue execution  
execution  
STOP instruction  
CPU  
tSTP_REC  
PLLCLK  
LOCK  
tlock  
Figure 88. Stop Mode Using PLLCLK as Bus Clock  
5.38.4.4  
Full Stop Mode using Oscillator Clock as Bus Clock  
An example of what happens going into Full Stop mode and exiting Full Stop mode after an interrupt is shown in Figure 89.  
Disable PLL Lock interrupt (LOCKIE=0) and oscillator status change interrupt (OSCIE=0) before going into Full Stop mode.  
MM912_634 Advance Information, Rev. 11.0  
262  
Freescale Semiconductor  
 
Functional Description and Application Information  
wake-up  
interrupt continue execution  
execution  
STOP instruction  
CPU  
Core  
Clock  
tSTP_REC  
tlock  
PLLCLK  
OSCCLK  
UPOSC  
select OSCCLK as Core/Bus Clock by writing PLLSEL to “0”  
PLLSEL  
automatically set when going into Full Stop Mode  
Figure 89. Full Stop Mode Using Oscillator Clock as Bus Clock  
External Oscillator  
Enabling the External Oscillator  
5.38.4.5  
5.38.4.5.1  
An example of how to use the oscillator as Bus Clock is shown in Figure 90.  
enable external oscillator by writing OSCE bit to one.  
OSCE  
crystal/resonator starts oscillating  
EXTAL  
UPOSC flag is set upon successful start of oscillation  
UPOSC  
OSCCLK  
PLLSEL  
select OSCCLK as Core/Bus Clock by writing PLLSEL to zero  
based on OSCCLK  
based on PLLCLK  
Core  
Clock  
Figure 90. Enabling the External Oscillator  
5.38.4.5.2  
The Adaptive Oscillator Filter  
A spike in the oscillator clock can disturb the function of the modules driven by this clock.  
The Adaptive Oscillator Filter includes two features:  
1. Filter noise (spikes) from the incoming external oscillator clock. The filter feature is illustrated in Figure 91.  
MM912_634 Advance Information, Rev. 11.0  
263  
Freescale Semiconductor  
 
Functional Description and Application Information  
enable external oscillator  
OSCE  
configure the Adaptive Oscillator Filter  
OSC  
FILT  
0
> 0  
crystal/resonator starts oscillating  
EXTAL  
LOCK  
UPOSC  
filtered  
filtered  
OSCCLK  
(filtered)  
Figure 91. Noise Filtered by the Adaptive Oscillator Filter  
2. Detect severe noise disturbance on external oscillator clock which can not be filtered and indicate the critical situation  
to the software by clearing the UPOSC and LOCK status bit and setting the OSCIF and LOCKIF flag. An example for  
the detection of critical noise is illustrated in Figure 92  
enable external oscillator  
OSCE  
configure the Adaptive Oscillator Filter  
OSC  
0
> 0  
FILT  
crystal/resonator starts oscillating  
phase shift can not be filtered but detected  
EXTAL  
LOCK  
UPOSC  
OSCCLK  
(filtered)  
Figure 92. Critical Noise Detected by the Adaptive Oscillator Filter  
NOTE  
If the LOCK bit is clear due to severe noise disturbance on the external oscillator clock the  
PLLCLK is derived from the VCO clock (with its actual frequency) divided by four (see also  
Section 5.38.3.2.3, “S12IPIMV1 Post Divider Register (CPMUPOSTDIV)").  
The use of the filter function is only possible if the VCOCLK-to-OSCCLK ratio divided by two ((fVCO / fOSC)/2) is an integer number.  
This integer value must be written to the OSCFILT[4:0] bits.  
If enabled, the Adaptive Oscillator Filter is sampling the incoming external oscillator clock signal (EXTAL) with the VCOCLK  
frequency.  
Using VCOCLK, a time window is defined during which an edge of the OSCCLK is expected. In case of OSCBW = 1 the width  
of this window is three VCOCLK cycles, if the OSCBW = 0 it is one VCOCLK cycle.  
The noise detection is active for certain combinations of OSCFILT[4:0] and OSCBW bit settings as shown in Table 389.  
Table 389. Noise Detection Settings  
OSCFILT[4:0]  
OSCBW  
Detection  
Filter  
0
1
x
x
0
1
x
disabled  
disabled  
active  
disabled  
active  
active  
active  
active  
2 or 3  
>=4  
disabled  
active  
MM912_634 Advance Information, Rev. 11.0  
264  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
NOTE  
If the VCOCLK frequency is higher than 25 MHz the wide bandwidth must be selected  
(OSCBW = 1).  
5.38.4.6  
System Clock Configurations  
PLL Engaged Internal Mode (PEI)  
5.38.4.6.1  
This mode is the default mode after System Reset or Power-on Reset.  
The Bus Clock is based on the PLLCLK, the reference clock for the PLL is internally generated (IRC1M). The PLL is configured  
to 64 MHz VCOCLK with POSTDIV set to 0x03. If locked (LOCK=1) this results in a PLLCLK of 16 MHz and a Bus Clock of  
8.0 MHz. The PLL can be re-configured to other bus frequencies.  
The clock sources for COP and RTI are based on the internal reference clock generator (IRC1M).  
5.38.4.6.2  
PLL Engaged External Mode (PEE)  
In this mode, the Bus Clock is based on the PLLCLK as well (like PEI). The reference clock for the PLL is based on the external  
oscillator. The adaptive spike filter and detection logic which uses the VCOCLK to filter and qualify the external oscillator clock  
can be enabled.  
The clock sources for COP and RTI can be based on the internal reference clock generator or on the external oscillator clock.  
This mode can be entered from default mode PEI by performing the following steps:  
1. Configure the PLL for desired bus frequency.  
2. Optionally the adaptive spike filter and detection logic can be enabled by calculating the integer value for the  
OSCFIL[4:0] bits and setting the bandwidth (OSCBW) accordingly.  
3. Enable the external Oscillator (OSCE bit).  
4. Wait for the PLL being locked (LOCK = 1) and the oscillator to start-up and additionally being qualified if the Adaptive  
Oscillator Filter is enabled (UPOSC =1).  
5. Clear all flags in the CPMUFLG register to be able to detect any future status bit change.  
6. Optionally status interrupts can be enabled (CPMUINT register).  
Since the Adaptive Oscillator Filter (adaptive spike filter and detection logic) uses the VCOCLK to continuously filter and qualify  
the external oscillator clock, loosing PLL lock status (LOCK=0) means loosing the oscillator status information as well  
(UPOSC=0).  
The impact of loosing the oscillator status in PEE mode is as follows:  
The PLLCLK is derived from the VCO clock (with its actual frequency) divided by four until the PLL locks again.  
Application software needs to be prepared to deal with the impact of loosing the oscillator status at any time.  
5.38.4.6.3  
PLL Bypassed External Mode (PBE)  
In this mode, the Bus Clock is based on the external oscillator clock. The reference clock for the PLL is based on the external  
oscillator. The adaptive spike filter and detection logic can be enabled which uses the VCOCLK to filter and qualify the external  
oscillator clock.  
The clock sources for COP and RTI can be based on the internal reference clock generator or on the external oscillator clock.  
This mode can be entered from default mode PEI by performing the following steps:  
1. Make sure the PLL configuration is valid.  
2. Optionally the adaptive spike filter and detection logic can be enabled by calculating the integer value for the  
OSCFIL[4:0] bits and setting the bandwidth (OSCBW) accordingly.  
3. Enable the external Oscillator (OSCE bit)  
4. Wait for the PLL being locked (LOCK = 1) and the oscillator to start-up and additionally being qualified if the Adaptive  
Oscillator Filter is enabled (UPOSC=1).  
5. Clear all flags in the CPMUFLG register to be able to detect any status bit change.  
6. Optionally status interrupts can be enabled (CPMUINT register).  
7. Select the Oscillator Clock (OSCCLK) as Bus Clock (PLLSEL=0)  
Since the Adaptive Oscillator Filter (adaptive spike filter and detection logic) uses the VCOCLK to continuously filter and qualify  
the external oscillator clock, loosing PLL lock status (LOCK=0) means loosing the oscillator status information as well  
(UPOSC=0).  
MM912_634 Advance Information, Rev. 11.0  
265  
Freescale Semiconductor  
 
Functional Description and Application Information  
The impact of loosing the oscillator status in PBE mode is as follows:  
PLLSEL is set automatically and the Bus Clock is switched back to the PLLCLK.  
The PLLCLK is derived from the VCO clock (with its actual frequency) divided by four until the PLL locks again.  
Application software needs to be prepared to deal with the impact of loosing the oscillator status at any time.  
In the PBE mode, not every noise disturbance can be indicated by bits LOCK and UPOSC (both bits are based on the Bus Clock  
domain). There are clock disturbances possible, after which UPOSC and LOCK both stay asserted while occasional pauses on  
the filtered OSCCLK and resulting Bus Clock occur. The adaptive spike filter is still functional and protects the Bus Clock from  
frequency overshoot due to spikes on the external oscillator clock. The filtered OSCCLK and resulting Bus Clock will pause until  
the PLL has stabilized again.  
5.38.5  
Resets  
5.38.5.1  
General  
All reset sources are listed in Table 390. Refer to MCU specification for related vector addresses and priorities  
.
Table 390. Reset Summary  
Reset Source  
Local Enable  
Power-On Reset (POR)  
Low Voltage Reset (LVR)  
External pin RESET  
Illegal Address Reset  
Clock Monitor Reset  
COP Reset  
None  
None  
None  
None  
OSCE Bit in CPMUOSC register  
CR[2:0] in CPMUCOP register  
5.38.5.2  
Description of Reset Operation  
Upon detection of any reset of Table 390, an internal circuit drives the RESET pin low for 512 PLLCLK cycles. After 512 PLLCLK  
cycles the RESET pin is released. The reset generator of the S12IPIMV1 waits for additional 256 PLLCLK cycles and then  
samples the RESET pin to determine the originating source. Table 391 shows which vector will be fetched.  
Table 391. Reset Vector Selection  
COP  
Sampled RESET Pin  
(256 cycles after release)  
Oscillator monitor  
fail pending  
time out  
pending  
Vector Fetch  
POR  
LVR  
1
0
0
Illegal Address Reset  
External pin RESET  
1
1
1
0
X
1
Clock Monitor Reset  
COP Reset  
POR  
LVR  
0
X
X
Illegal Address Reset  
External pin RESET  
NOTE  
While System Reset is asserted the PLLCLK runs with the frequency fVCORST  
.
The internal reset of the MCU remains asserted while the reset generator completes the 768 PLLCLK cycles long reset  
sequence. In case the RESET pin is externally driven low for more than these 768 PLLCLK cycles (External Reset), the internal  
reset remains asserted longer.  
MM912_634 Advance Information, Rev. 11.0  
266  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
RESET  
S12_CPMU drives  
RESET pin low  
S12_CPMU releases  
RESET pin  
fVCORST  
fVCORST  
)
)
)
PLLCLK  
(
(
(
512 cycles  
256 cycles  
possibly  
RESET driven  
low  
Figure 93. RESET Timing  
5.38.5.2.1  
Clock Monitor Reset  
If the external oscillator is enabled (OSCE=1) in case of loss of oscillation or the oscillator frequency is below the failure assert  
frequency fCMFA (see device electrical characteristics for values), the S12IPIMV1 generates a Clock Monitor Reset. In Full Stop  
mode the external oscillator and the clock monitor are disabled.  
5.38.5.2.2  
Computer Operating Properly Watchdog (COP) Reset  
The COP (free running watchdog timer) enables the user to check that a program is running and sequencing properly. When the  
COP is being used, software is responsible for keeping the COP from timing out. If the COP times out it is an indication that the  
software is no longer being executed in the intended sequence; thus COP reset is generated.  
The clock source for the COP is either IRCCLK or OSCCLK depending on the setting of the COPOSCSEL bit. In Stop Mode with  
PSTP=1 (Pseudo Stop Mode), COPOSCSEL=1 and PCE=1 the COP continues to run, else the COP counter halts in Stop Mode.  
Three control bits in the CPMUCOP register allow selection of seven COP time-out periods.  
When COP is enabled, the program must write $55 and $AA (in this order) to the CPMUARMCOP register during the selected  
time-out period. Once this is done, the COP time-out period is restarted. If the program fails to do this and the COP times out, a  
COP reset is generated. Also, if any value other than $55 or $AA is written, a COP reset is generated.  
Windowed COP operation is enabled by setting WCOP in the CPMUCOP register. In this mode, writes to the CPMUARMCOP  
register to clear the COP timer must occur in the last 25% of the selected time-out period. A premature write will immediately  
reset the part.  
5.38.5.3  
Power-On Reset (POR)  
The on-chip POR circuitry detects when the internal supply VDD drops below an appropriate voltage level. The POR is  
deasserted, if the internal supply VDD exceeds an appropriate voltage level (voltage levels are not specified in this document  
because this internal supply is not visible on device pins).  
5.38.5.4  
Low-voltage Reset (LVR)  
The on-chip LVR circuitry detects when one of the supply voltages VDD, VDDF or VDDX drops below an appropriate voltage  
level. If LVR is deasserted the MCU is fully operational at the specified maximum speed. The LVR assert and deassert levels for  
the supply voltage VDDX are VLVRXA and VLVRXD and are specified in the device Reference Manual.  
5.38.6  
Interrupts  
The interrupt/reset vectors requested by the S12IPIMV1 are listed in Table 392. Refer to MCU specification for related vector  
addresses and priorities.  
MM912_634 Advance Information, Rev. 11.0  
267  
Freescale Semiconductor  
Functional Description and Application Information  
Table 392. S12IPIMV1 Interrupt Vectors  
Interrupt Source  
CCR Mask  
Local Enable  
RTI timeout interrupt  
PLL lock interrupt  
I bit  
I bit  
I bit  
I bit  
CPMUINT (RTIE)  
CPMUINT (LOCKIE)  
CPMUINT (OSCIE)  
CPMULVCTL (LVIE)  
Oscillator status interrupt  
Low voltage interrupt  
Autonomous Periodical  
Interrupt  
I bit  
CPMUAPICTL (APIE)  
5.38.6.1  
Description of Interrupt Operation  
Real Time Interrupt (RTI)  
5.38.6.1.1  
The clock source for the RTI is either IRCCLK or OSCCLK depending on the setting of the RTIOSCSEL bit. In Stop mode with  
PSTP=1 (Pseudo Stop mode), RTIOSCSEL=1 and PRE=1 the RTI continues to run, else the RTI counter halts in Stop mode.  
The RTI can be used to generate hardware interrupts at a fixed periodic rate. If enabled (by setting RTIE=1), this interrupt will  
occur at the rate selected by the CPMURTI register. At the end of the RTI timeout period the RTIF flag is set to one and a new  
RTI timeout period starts immediately.  
A write to the CPMURTI register restarts the RTI timeout period.  
5.38.6.1.2  
PLL Lock Interrupt  
The S12IPIMV1 generates a PLL Lock interrupt when the lock condition (LOCK status bit) of the PLL changes, either from a  
locked state to an unlocked state or vice versa. Lock interrupts are locally disabled by setting the LOCKIE bit to zero. The PLL  
Lock interrupt flag (LOCKIF) is set to 1 when the lock condition has changed, and is cleared to 0 by writing a 1 to the LOCKIF bit.  
5.38.6.1.3  
Oscillator Status Interrupt  
The Adaptive Oscillator Filter contains two different features:  
1. Filters spikes of the external oscillator clock.  
2. Qualify the external oscillator clock.  
When the OSCE bit is 0, then UPOSC stays 0. When OSCE=1 and OSCFILT = 0, then the filter is transparent and no spikes are  
filtered. The UPOSC bit is then set after the LOCK bit is set.  
Upon detection of a status change (UPOSC), that is an unqualified oscillation becomes qualified or vice versa, the OSCIF flag is  
set. Going into Full Stop Mode or disabling the oscillator can also cause a status change of UPOSC.  
Also, since the Adaptive Oscillator Filter is based on the PLLCLK, any change in PLL configuration or any other event which  
causes the PLL lock status to be cleared leads to a loss of the oscillator status information as well (UPOSC=0).  
Oscillator status change interrupts are locally enabled with the OSCIE bit.  
NOTE  
Loosing the oscillator status (UPOSC=0) affects the clock configuration of the system(201)  
This needs to be dealt with in application software.  
.
Note:  
201. For details refer to “5.38.4.6, “System Clock Configurations“”  
5.39  
Serial Peripheral Interface (S12S12IPIMV1V5)  
Preface  
Terminology  
5.39.1  
Introduction  
The SPI module allows a duplex, synchronous, serial communication between the MCU and peripheral devices. Software can  
poll the SPI status flags or the SPI operation can be interrupt driven.  
MM912_634 Advance Information, Rev. 11.0  
268  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.39.1.1  
Glossary of Terms  
SPI  
SS  
Serial Peripheral Interface  
Slave Select  
SCK  
MOSI  
MISO  
MOMI  
SISO  
Serial Clock  
Master Output, Slave Input  
Master Input, Slave Output  
Master Output, Master Input  
Slave Input, Slave Output  
5.39.1.2  
Features  
The S12IPIMV1 includes these distinctive features:  
Master mode and slave mode  
Selectable 8 or 16-bit transfer width  
Bi-directional mode  
Slave select output  
Mode fault error flag with CPU interrupt capability  
Double-buffered data register  
Serial clock with programmable polarity and phase  
5.39.1.3  
Modes of Operation  
The SPI functions in two modes: run and stop.  
Run mode  
This is the basic mode of operation.  
Stop mode  
The SPI is inactive in stop mode for reduced power consumption. If the SPI is configured as a master, any transmission  
in progress stops, but is resumed after CPU goes into run mode. If the SPI is configured as a slave, reception and  
transmission of data continues, so that the slave stays synchronized to the master.  
For a detailed description of operating modes, refer to Section 5.39.4.7, “Low Power Mode Options".  
5.39.1.4 Block Diagram  
Figure 94 gives an overview on the SPI architecture. The main parts of the SPI are status, control and data registers, shifter logic,  
baud rate generator, master/slave control logic, and port control logic.  
MM912_634 Advance Information, Rev. 11.0  
269  
Freescale Semiconductor  
Functional Description and Application Information  
SPI  
2
2
SPI Control Register 1  
BIDIROE  
SPC0  
SPI Control Register 2  
SPI Status Register  
Slave  
Control  
CPOL  
CPHA  
MOSI  
SPIF  
MODF SPTEF  
Phase +  
SCK In  
Interrupt Control  
Polarity  
Control  
Slave Baud Rate  
Master Baud Rate  
SPI  
Interrupt  
Phase +  
Polarity  
Control  
SCK Out  
Request  
Port  
Control  
Logic  
SCK  
SS  
Baud Rate Generator  
Counter  
Master  
Control  
Bus Clock  
Baud Rate  
Prescaler  
Clock Select  
Shift  
Clock  
Sample  
Clock  
SPPR  
3
3
SPR  
Shifter  
LSBFE=0  
LSBFE=1  
SPI Baud Rate Register  
Data In  
LSBFE=1  
MSB  
SPI Data Register  
LSB  
LSBFE=0  
Data Out  
LSBFE=0  
LSBFE=1  
Figure 94. SPI Block Diagram  
5.39.2  
External Signal Description  
This section lists the name and description of all ports including inputs and outputs that do, or may, connect off chip. The  
S12IPIMV1 module has a total of four external pins.  
5.39.2.1  
MOSI — Master Out/Slave In Pin  
This pin is used to transmit data out of the SPI module when it is configured as a master and receive data when it is configured  
as slave.  
5.39.2.2  
MISO — Master In/Slave Out Pin  
This pin is used to transmit data out of the SPI module when it is configured as a slave and receive data when it is configured as  
master.  
MM912_634 Advance Information, Rev. 11.0  
270  
Freescale Semiconductor  
Functional Description and Application Information  
5.39.2.3  
SS — Slave Select Pin  
This pin is used to output the select signal from the SPI module to another peripheral with which a data transfer is to take place  
when it is configured as a master and it is used as an input to receive the slave select signal when the SPI is configured as slave.  
5.39.2.4  
SCK — Serial Clock Pin  
In master mode, this is the synchronous output clock. In slave mode, this is the synchronous input clock.  
5.39.3  
Memory Map and Register Definition  
This section provides a detailed description of address space and registers used by the SPI.  
5.39.3.1  
Module Memory Map  
The memory map for the S12IPIMV1 is given in Figure 393. The address listed for each register is the sum of a base address  
and an address offset. The base address is defined at the SoC level and the address offset is defined at the module level. Reads  
from the reserved bits return zeros and writes to the reserved bits have no effect.  
Table 393. SPI Register Summary  
Register  
Bit 7  
6
5
4
3
2
1
Bit 0  
LSBFE  
SPC0  
Name  
R
W
R
SPICR1  
SPIE  
0
SPE  
SPTIE  
0
MSTR  
CPOL  
CPHA  
0
SSOE  
SPICR2  
SPIBR  
XFRW  
MODFEN  
BIDIROE  
0
SPISWAI  
W
R
0
SPPR2  
0
SPPR1  
SPTEF  
SPPR0  
MODF  
SPR2  
0
SPR1  
0
SPR0  
0
W
R
SPIF  
0
SPISR  
W
R
R15  
T15  
R7  
R14  
T14  
R6  
R13  
T13  
R5  
R12  
T12  
R4  
R11  
T11  
R3  
R10  
T10  
R2  
R9  
T9  
R1  
T1  
R8  
T8  
R0  
T0  
SPIDRH  
SPIDRL  
Reserved  
Reserved  
W
R
W
R
T7  
T6  
T5  
T4  
T3  
T2  
W
R
W
= Unimplemented or Reserved  
5.39.3.2  
Register Descriptions  
This section consists of register descriptions in address order. Each description includes a standard register diagram with an  
associated figure number. Details of register bit and field function follow the register diagrams, in bit order.  
MM912_634 Advance Information, Rev. 11.0  
271  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.39.3.2.1  
SPI Control Register 1 (SPICR1)  
Table 394. SPI Control Register 1 (SPICR1)  
7
6
5
4
3
2
1
0
R
W
SPIE  
0
SPE  
0
SPTIE  
0
MSTR  
0
CPOL  
0
CPHA  
1
SSOE  
0
LSBFE  
0
Reset  
Read: Anytime  
Write: Anytime  
Table 395. SPICR1 Field Descriptions  
Field  
Description  
SPI Interrupt Enable Bit — This bit enables SPI interrupt requests, if SPIF or MODF status flag is set.  
7
0
1
SPI interrupts disabled.  
SPI interrupts enabled.  
SPIE  
SPI System Enable Bit — This bit enables the SPI system and dedicates the SPI port pins to SPI system functions. If SPE  
is cleared, SPI is disabled and forced into idle state, status bits in SPISR register are reset.  
6
0
1
SPI disabled (lower power consumption).  
SPE  
SPI enabled, port pins are dedicated to SPI functions.  
SPI Transmit Interrupt Enable — This bit enables SPI interrupt requests, if SPTEF flag is set.  
5
0
1
SPTEF interrupt disabled.  
SPTEF interrupt enabled.  
SPTIE  
SPI Master/Slave Mode Select Bit — This bit selects whether the SPI operates in master or slave mode. Switching the SPI  
from master to slave or vice versa forces the SPI system into idle state.  
4
0
1
SPI is in slave mode.  
SPI is in master mode.  
MSTR  
SPI Clock Polarity Bit — This bit selects an inverted or non-inverted SPI clock. To transmit data between SPI modules, the  
SPI modules must have identical CPOL values. In master mode, a change of this bit will abort a transmission in progress and  
force the SPI system into idle state.  
3
CPOL  
0
1
Active-high clocks selected. In idle state SCK is low.  
Active-low clocks selected. In idle state SCK is high.  
SPI Clock Phase Bit — This bit is used to select the SPI clock format. In master mode, a change of this bit will abort a  
transmission in progress and force the SPI system into idle state.  
2
0
1
Sampling of data occurs at odd edges (1,3,5,...) of the SCK clock.  
Sampling of data occurs at even edges (2,4,6,...) of the SCK clock.  
CPHA  
Slave Select Output Enable — The SS output feature is enabled only in master mode, if MODFEN is set, by asserting the  
SSOE as shown in Table 396. In master mode, a change of this bit will abort a transmission in progress and force the SPI  
system into idle state.  
1
SSOE  
LSB-First Enable — This bit does not affect the position of the MSB and LSB in the data register. Reads and writes of the  
data register always have the MSB in the highest bit position. In master mode, a change of this bit will abort a transmission in  
progress and force the SPI system into idle state.  
0
LSBFE  
0
1
Data is transferred most significant bit first.  
Data is transferred least significant bit first.  
MM912_634 Advance Information, Rev. 11.0  
272  
Freescale Semiconductor  
Functional Description and Application Information  
Table 396. SS Input / Output Selection  
MODFEN  
SSOE  
Master Mode  
Slave Mode  
0
0
1
1
0
1
0
1
SS not used by SPI  
SS not used by SPI  
SS input  
SS input  
SS input  
SS input  
SS input with MODF feature  
SS is slave select output  
5.39.3.2.2  
SPI Control Register 2 (SPICR2)  
Table 397. SPI Control Register 2 (SPICR2)  
7
6
5
4
3
2
1
0
R
W
0
0
0
XFRW  
0
MODFEN  
0
BIDIROE  
0
SPISWAI  
0
SPC0  
0
Reset  
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Anytime; writes to the reserved bits have no effect  
Table 398. SPICR2 Field Descriptions  
Field  
Description  
Transfer Width — This bit is used for selecting the data transfer width. If 8-bit transfer width is selected, SPIDRL becomes  
the dedicated data register and SPIDRH is unused. If 16-bit transfer width is selected, SPIDRH and SPIDRL form a 16-bit data  
register. Refer to Section 5.39.3.2.4, “SPI Status Register (SPISR)" for information about transmit/receive data handling and  
the interrupt flag clearing mechanism. In master mode, a change of this bit will abort a transmission in progress and force the  
SPI system into idle state.  
6
XFRW  
0 8-bit Transfer Width (n = 8)(202)  
1 16-bit Transfer Width (n = 16)(202)  
Mode Fault Enable Bit — This bit allows the MODF failure to be detected. If the SPI is in master mode and MODFEN is  
cleared, then the SS port pin is not used by the SPI. In slave mode, the SS is available only as an input regardless of the value  
of MODFEN. For an overview on the impact of the MODFEN bit on the SS port pin configuration, refer to Table 396. In master  
mode, a change of this bit will abort a transmission in progress and force the SPI system into idle state.  
4
MODFEN  
0
1
SS port pin is not used by the SPI.  
SS port pin with MODF feature.  
Output Enable in the Bidirectional Mode of Operation — This bit controls the MOSI and MISO output buffer of the SPI,  
when in bidirectional mode of operation (SPC0 is set). In master mode, this bit controls the output buffer of the MOSI port, in  
slave mode it controls the output buffer of the MISO port. In master mode, with SPC0 set, a change of this bit will abort a  
transmission in progress and force the SPI into idle state.  
3
BIDIROE  
0
1
Output buffer disabled.  
Output buffer enabled.  
1
-
Reserved — For internal use  
0
Serial Pin Control Bit 0 — This bit enables bidirectional pin configurations as shown in Table 399. In master mode, a change  
of this bit will abort a transmission in progress and force the SPI system into idle state.  
SPC0  
Note:  
202. n is used later in this document as a placeholder for the selected transfer width.  
MM912_634 Advance Information, Rev. 11.0  
273  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 399. Bidirectional Pin Configurations  
Pin Mode  
SPC0  
BIDIROE  
MISO  
MOSI  
Master Mode of Operation  
Normal  
0
1
X
0
1
Master In  
Master Out  
Master In  
Bidirectional  
MISO not used by SPI  
Master I/O  
Slave Mode of Operation  
Normal  
0
1
X
0
1
Slave Out  
Slave In  
Slave In  
Bidirectional  
MOSI not used by SPI  
Slave I/O  
5.39.3.2.3  
SPI Baud Rate Register (SPIBR)  
Table 400. SPI Baud Rate Register (SPIBR)  
7
6
5
4
3
2
1
0
R
W
0
0
SPPR2  
0
SPPR1  
0
SPPR0  
0
SPR2  
0
SPR1  
0
SPR0  
0
Reset  
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Anytime; writes to the reserved bits have no effect  
Table 401. SPIBR Field Descriptions  
Field  
Description  
6–4  
SPI Baud Rate Preselection Bits These bits specify the SPI baud rates as shown in Table 402. In master mode, a change  
of these bits will abort a transmission in progress and force the SPI system into idle state.  
SPPR[2:0]  
2–0  
SPI Baud Rate Selection Bits These bits specify the SPI baud rates as shown in Table 402. In master mode, a change of  
these bits will abort a transmission in progress and force the SPI system into idle state.  
SPR[2:0]  
The baud rate divisor equation is as follows:  
BaudRateDivisor = (SPPR + 1) 2(SPR + 1)  
The baud rate can be calculated with the following equation:  
Eqn. 95  
Eqn. 96  
Baud Rate = BusClock / BaudRateDivisor  
NOTE  
For maximum allowed baud rates, refer to the SPI Electrical Specification in the Electricals  
chapter of this data sheet.  
MM912_634 Advance Information, Rev. 11.0  
274  
Freescale Semiconductor  
Functional Description and Application Information  
Table 402. Example SPI Baud Rate Selection (25 MHz us Clock)  
Baud Rate  
Divisor  
SPPR2  
SPPR1  
SPPR0  
SPR2  
SPR1  
SPR0  
Baud Rate  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
2
4
12.5 Mbit/s  
6.25 Mbit/s  
8
3.125 Mbit/s  
1.5625 Mbit/s  
781.25 kbit/s  
390.63 kbit/s  
195.31 kbit/s  
97.66 kbit/s  
6.25 Mbit/s  
16  
32  
64  
128  
256  
4
8
3.125 Mbit/s  
1.5625 Mbit/s  
781.25 kbit/s  
390.63 kbit/s  
195.31 kbit/s  
97.66 kbit/s  
48.83 kbit/s  
4.16667 Mbit/s  
2.08333 Mbit/s  
1.04167 Mbit/s  
520.83 kbit/s  
260.42 kbit/s  
130.21 kbit/s  
65.10 kbit/s  
32.55 kbit/s  
3.125 Mbit/s  
1.5625 Mbit/s  
781.25 kbit/s  
390.63 kbit/s  
195.31 kbit/s  
97.66 kbit/s  
48.83 kbit/s  
24.41 kbit/s  
2.5 Mbit/s  
16  
32  
64  
128  
256  
512  
6
12  
24  
48  
96  
192  
384  
768  
8
16  
32  
64  
128  
256  
512  
1024  
10  
20  
1.25 Mbit/s  
40  
625 kbit/s  
80  
312.5 kbit/s  
156.25 kbit/s  
78.13 kbit/s  
39.06 kbit/s  
19.53 kbit/s  
2.08333 Mbit/s  
160  
320  
640  
1280  
12  
MM912_634 Advance Information, Rev. 11.0  
275  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 402. Example SPI Baud Rate Selection (25 MHz us Clock) (continued)  
Baud Rate  
Divisor  
SPPR2  
SPPR1  
SPPR0  
SPR2  
SPR1  
SPR0  
Baud Rate  
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
24  
48  
1.04167 Mbit/s  
520.83 kbit/s  
260.42 kbit/s  
130.21 kbit/s  
65.10 kbit/s  
32.55 kbit/s  
16.28 kbit/s  
1.78571 Mbit/s  
892.86 kbit/s  
446.43 kbit/s  
223.21 kbit/s  
111.61 kbit/s  
55.80 kbit/s  
27.90 kbit/s  
13.95 kbit/s  
1.5625 Mbit/s  
781.25 kbit/s  
390.63 kbit/s  
195.31 kbit/s  
97.66 kbit/s  
48.83 kbit/s  
24.41 kbit/s  
12.21 kbit/s  
96  
192  
384  
768  
1536  
14  
28  
56  
112  
224  
448  
896  
1792  
16  
32  
64  
128  
256  
512  
1024  
2048  
5.39.3.2.4  
SPI Status Register (SPISR)  
Table 403. SPI Status Register (SPISR)  
7
6
5
4
3
2
1
0
R
W
SPIF  
0
SPTEF  
MODF  
0
0
0
0
Reset  
0
0
1
0
0
0
0
0
= Unimplemented or Reserved  
Read: Anytime  
Write: Has no effect  
MM912_634 Advance Information, Rev. 11.0  
276  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 404. SPISR Field Descriptions  
Field  
Description  
SPIF Interrupt Flag — This bit is set after received data has been transferred into the SPI data register. For information about  
clearing SPIF Flag, refer to Table 405.  
7
0
1
Transfer not yet complete.  
New data copied to SPIDR.  
SPIF  
SPI Transmit Empty Interrupt Flag — If set, this bit indicates that the transmit data register is empty. For information about  
clearing this bit and placing data into the transmit data register, refer to Table 406.  
5
0
1
SPI data register not empty.  
SPI data register empty.  
SPTEF  
Mode Fault Flag — This bit is set if the SS input becomes low while the SPI is configured as a master and mode fault detection  
is enabled, MODFEN bit of SPICR2 register is set. Refer to MODFEN bit description in Section 5.39.3.2.2, “SPI Control  
Register 2 (SPICR2)". The flag is cleared automatically by a read of the SPI status register (with MODF set) followed by a  
write to the SPI control register 1.  
4
MODF  
0
1
Mode fault has not occurred.  
Mode fault has occurred.  
Table 405. SPIF Interrupt Flag Clearing Sequence  
XFRW Bit  
SPIF Interrupt Flag Clearing Sequence  
0
Read SPISR with SPIF = 1  
then  
Read SPIDRL  
Byte Read SPIDRL (203)  
or  
1
Read SPISR with SPIF = 1  
then  
Byte Read SPIDRH (204)  
Byte Read SPIDRL  
or  
Word Read (SPIDRH:SPIDRL)  
Note:  
203. Data in SPIDRH is lost in this case.  
204. SPIDRH can be read repeatedly without any effect on SPIF. SPIF Flag is cleared only by the read of SPIDRL after reading SPISR with  
SPIF = 1.  
Table 406. SPTEF Interrupt Flag Clearing Sequence  
XFRW Bit  
SPTEF Interrupt Flag Clearing Sequence  
0
Read SPISR with SPTEF = 1  
Read SPISR with SPTEF = 1  
then  
Write to SPIDRL (205)  
Byte Write to SPIDRL (205)(206)  
or  
1
then  
Byte Write to SPIDRH (205)(207)  
Byte Write to SPIDRL (205)  
or  
Word Write to (SPIDRH:SPIDRL) (205)  
Note:  
205. Any write to SPIDRH or SPIDRL with SPTEF = 0 is effectively ignored.  
206. Data in SPIDRH is undefined in this case.  
207. SPIDRH can be written repeatedly without any effect on SPTEF. SPTEF Flag is cleared only by writing to SPIDRL after reading SPISR  
with SPTEF = 1.  
MM912_634 Advance Information, Rev. 11.0  
277  
Freescale Semiconductor  
 
 
 
 
 
 
 
Functional Description and Application Information  
5.39.3.2.5  
SPI Data Register (SPIDR = SPIDRH:SPIDRL)  
Table 407. SPI Data Register High (SPIDRH)  
7
6
5
4
3
2
1
0
R
W
R15  
T15  
0
R14  
T14  
0
R13  
T13  
0
R12  
T12  
0
R11  
T11  
0
R10  
T10  
0
R9  
T9  
0
R8  
T8  
0
Reset  
Table 408. SPI Data Register Low (SPIDRL)  
7
6
5
4
3
2
1
0
R
W
R7  
T7  
0
R6  
T6  
0
R5  
T5  
0
R4  
T4  
0
R3  
T3  
0
R2  
T2  
0
R1  
T1  
0
R0  
T0  
0
Reset  
Read: Anytime; read data only valid when SPIF is set  
Write: Anytime  
The SPI data register is both the input and output register for SPI data. A write to this register allows data to be queued and  
transmitted. For an SPI configured as a master, queued data is transmitted immediately after the previous transmission has  
completed. The SPI transmitter empty flag SPTEF in the SPISR register indicates when the SPI data register is ready to accept  
new data.  
Received data in the SPIDR is valid when SPIF is set.  
If SPIF is cleared and data has been received, the received data is transferred from the receive shift register to the SPIDR and  
SPIF is set.  
If SPIF is set and not serviced, and a second data value has been received, the second received data is kept as valid data in the  
receive shift register until the start of another transmission. The data in the SPIDR does not change.  
If SPIF is set and valid data is in the receive shift register, and SPIF is serviced before the start of a third transmission, the data  
in the receive shift register is transferred into the SPIDR and SPIF remains set (see Figure 97).  
If SPIF is set and valid data is in the receive shift register, and SPIF is serviced after the start of a third transmission, the data in  
the receive shift register has become invalid and is not transferred into the SPIDR (see Figure 98).  
Data A Received  
Data B Received  
Data C Received  
SPIF Serviced  
Receive Shift Register  
SPIF  
Data B  
Data A  
Data C  
Data C  
SPI Data Register  
Data B  
Data A  
= Unspecified  
= Reception in progress  
Figure 97. Reception with SPIF Serviced in Time  
MM912_634 Advance Information, Rev. 11.0  
278  
Freescale Semiconductor  
 
Functional Description and Application Information  
Data A Received  
Data B Received  
Data C Received  
Data B Lost  
SPIF Serviced  
Receive Shift Register  
SPIF  
Data B  
Data C  
Data C  
Data A  
SPI Data Register  
Data A  
= Unspecified  
= Reception in progress  
Figure 98. Reception with SPIF Serviced Too Late  
Functional Description  
5.39.4  
The SPI module allows a duplex, synchronous, serial communication between the MCU and peripheral devices. Software can  
poll the SPI status flags or SPI operation can be interrupt driven.  
The SPI system is enabled by setting the SPI enable (SPE) bit in SPI control register 1. While SPE is set, the four associated  
SPI port pins are dedicated to the SPI function as:  
Slave select (SS)  
Serial clock (SCK)  
Master out/slave in (MOSI)  
Master in/slave out (MISO)  
The main element of the SPI system is the SPI data register. The n-bit(208) data register in the master and the n-bit(208) data  
register in the slave are linked by the MOSI and MISO pins to form a distributed 2n-bit(208) register. When a data transfer  
operation is performed, this 2n-bit(208) register is serially shifted n(208) bit positions by the S-clock from the master, so data is  
exchanged between the master and the slave. Data written to the master SPI data register becomes the output data for the slave,  
and data read from the master SPI data register after a transfer operation is the input data from the slave.  
A read of SPISR with SPTEF = 1 followed by a write to SPIDR puts data into the transmit data register. When a transfer is  
complete and SPIF is cleared, received data is moved into the receive data register. This data register acts as the SPI receive  
data register for reads and as the SPI transmit data register for writes. A common SPI data register address is shared for reading  
data from the read data buffer and for writing data to the transmit data register.  
The clock phase control bit (CPHA) and a clock polarity control bit (CPOL) in the SPI control register 1 (SPICR1) select one of  
four possible clock formats to be used by the SPI system. The CPOL bit simply selects a non-inverted or inverted clock. The  
CPHA bit is used to accommodate two fundamentally different protocols by sampling data on odd numbered SCK edges or on  
even numbered SCK edges (see Section 5.39.4.3, “Transmission Formats").  
The SPI can be configured to operate as a master or as a slave. When the MSTR bit in SPI control register1 is set, master mode  
is selected, when the MSTR bit is clear, slave mode is selected.  
Note:  
208. n depends on the selected transfer width, refer to Section 5.39.3.2.2, “SPI Control Register 2 (SPICR2)"  
NOTE  
A change of CPOL or MSTR bit while there is a received byte pending in the receive shift  
register will destroy the received byte and must be avoided.  
MM912_634 Advance Information, Rev. 11.0  
279  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.39.4.1  
Master Mode  
The SPI operates in master mode when the MSTR bit is set. Only a master SPI module can initiate transmissions. A transmission  
begins by writing to the master SPI data register. If the shift register is empty, data immediately transfers to the shift register. Data  
begins shifting out on the MOSI pin under the control of the serial clock.  
Serial clock  
The SPR2, SPR1, and SPR0 baud rate selection bits, in conjunction with the SPPR2, SPPR1, and SPPR0 baud rate  
preselection bits in the SPI baud rate register, control the baud rate generator and determine the speed of the  
transmission. The SCK pin is the SPI clock output. Through the SCK pin, the baud rate generator of the master controls  
the shift register of the slave peripheral.  
MOSI, MISO pin  
In master mode, the function of the serial data output pin (MOSI) and the serial data input pin (MISO) is determined by  
the SPC0 and BIDIROE control bits.  
SS pin  
If MODFEN and SSOE are set, the SS pin is configured as slave select output. The SS output becomes low during each  
transmission and is high when the SPI is in idle state.  
If MODFEN is set and SSOE is cleared, the SS pin is configured as input for detecting mode fault error. If the SS input  
becomes low this indicates a mode fault error where another master tries to drive the MOSI and SCK lines. In this case,  
the SPI immediately switches to slave mode, by clearing the MSTR bit and also disables the slave output buffer MISO  
(or SISO in bidirectional mode). So the result is that all outputs are disabled and SCK, MOSI, and MISO are inputs. If a  
transmission is in progress when the mode fault occurs, the transmission is aborted and the SPI is forced into idle state.  
This mode fault error also sets the mode fault (MODF) flag in the SPI status register (SPISR). If the SPI interrupt enable  
bit (SPIE) is set when the MODF flag becomes set, then an SPI interrupt sequence is also requested.  
When a write to the SPI data register in the master occurs, there is a half SCK-cycle delay. After the delay, SCK is started  
within the master. The rest of the transfer operation differs slightly, depending on the clock format specified by the SPI  
clock phase bit, CPHA, in SPI control register 1 (see Section 5.39.4.3, “Transmission Formats").  
NOTE  
A change of the bits CPOL, CPHA, SSOE, LSBFE, XFRW, MODFEN, SPC0, or BIDIROE  
with SPC0 set, SPPR2-SPPR0 and SPR2-SPR0 in master mode will abort a transmission  
in progress and force the SPI into idle state. The remote slave cannot detect this, therefore  
the master must ensure that the remote slave is returned to idle state.  
5.39.4.2  
Slave Mode  
The SPI operates in slave mode when the MSTR bit in SPI control register 1 is clear.  
Serial clock  
In slave mode, SCK is the SPI clock input from the master.  
MISO, MOSI pin  
In slave mode, the function of the serial data output pin (MISO) and serial data input pin (MOSI) is determined by the  
SPC0 bit and BIDIROE bit in SPI control register 2.  
SS pin  
The SS pin is the slave select input. Before a data transmission occurs, the SS pin of the slave SPI must be low. SS  
must remain low until the transmission is complete. If SS goes high, the SPI is forced into idle state.  
The SS input also controls the serial data output pin, if SS is high (not selected), the serial data output pin is high  
impedance, and, if SS is low, the first bit in the SPI data register is driven out of the serial data output pin. Also, if the  
slave is not selected (SS is high), then the SCK input is ignored and no internal shifting of the SPI shift register occurs.  
Although the SPI is capable of duplex operation, some SPI peripherals are capable of only receiving SPI data in a slave  
mode. For these simpler devices, there is no serial data out pin.  
NOTE  
When peripherals with duplex capability are used, take care not to simultaneously enable  
two receivers whose serial outputs drive the same system slave’s serial data output line.  
As long as no more than one slave device drives the system slave’s serial data output line, it is possible for several slaves to  
receive the same transmission from a master, although the master would not receive return information from all of the receiving  
slaves.  
MM912_634 Advance Information, Rev. 11.0  
280  
Freescale Semiconductor  
Functional Description and Application Information  
If the CPHA bit in SPI control register 1 is clear, odd numbered edges on the SCK input cause the data at the serial data input  
pin to be latched. Even numbered edges cause the value previously latched from the serial data input pin to shift into the LSB or  
MSB of the SPI shift register, depending on the LSBFE bit.  
If the CPHA bit is set, even numbered edges on the SCK input cause the data at the serial data input pin to be latched. Odd  
numbered edges cause the value previously latched from the serial data input pin to shift into the LSB or MSB of the SPI shift  
register, depending on the LSBFE bit.  
When CPHA is set, the first edge is used to get the first data bit onto the serial data output pin. When CPHA is clear and the SS  
input is low (slave selected), the first bit of the SPI data is driven out of the serial data output pin. After the nth(209) shift, the transfer  
is considered complete and the received data is transferred into the SPI data register. To indicate transfer is complete, the SPIF  
flag in the SPI status register is set.  
Note:  
209. n depends on the selected transfer width, refer to Section 5.39.3.2.2, “SPI Control Register 2 (SPICR2)"  
NOTE  
A change of the bits CPOL, CPHA, SSOE, LSBFE, MODFEN, SPC0, or BIDIROE with  
SPC0 set in slave mode will corrupt a transmission in progress and must be avoided.  
5.39.4.3  
Transmission Formats  
During an SPI transmission, data is transmitted (shifted out serially) and received (shifted in serially) simultaneously. The serial  
clock (SCK) synchronizes shifting and sampling of the information on the two serial data lines. A slave select line allows selection  
of an individual slave SPI device; slave devices that are not selected do not interfere with SPI bus activities. Optionally, on a  
master SPI device, the slave select line can be used to indicate multiple-master bus contention.  
MASTER SPI  
SLAVE SPI  
MISO  
MOSI  
MISO  
MOSI  
SHIFT REGISTER  
SHIFT REGISTER  
SCK  
SS  
SCK  
SS  
BAUD RATE  
GENERATOR  
VDD  
Figure 99. Master/Slave Transfer Block Diagram  
Clock Phase and Polarity Controls  
5.39.4.3.1  
Using two bits in the SPI control register 1, software selects one of four combinations of serial clock phase and polarity.  
The CPOL clock polarity control bit specifies an active high or low clock and has no significant effect on the transmission format.  
The CPHA clock phase control bit selects one of two fundamentally different transmission formats.  
Clock phase and polarity should be identical for the master SPI device and the communicating slave device. In some cases, the  
phase and polarity are changed between transmissions to allow a master device to communicate with peripheral slaves having  
different requirements.  
5.39.4.3.2  
CPHA = 0 Transfer Format  
The first edge on the SCK line is used to clock the first data bit of the slave into the master and the first data bit of the master into  
the slave. In some peripherals, the first bit of the slave’s data is available at the slave’s data out pin as soon as the slave is  
selected. In this format, the first SCK edge is issued a half cycle after SS has become low.  
A half SCK cycle later, the second edge appears on the SCK line. When this second edge occurs, the value previously latched  
from the serial data input pin is shifted into the LSB or MSB of the shift register, depending on LSBFE bit.  
After this second edge, the next bit of the SPI master data is transmitted out of the serial data output pin of the master to the serial  
input pin on the slave. This process continues for a total of 16 edges on the SCK line, with data being latched on odd numbered  
edges and shifted on even numbered edges.  
MM912_634 Advance Information, Rev. 11.0  
281  
Freescale Semiconductor  
 
Functional Description and Application Information  
Data reception is double buffered. Data is shifted serially into the SPI shift register during the transfer and is transferred to the  
parallel SPI data register after the last bit is shifted in.  
After 2n(210) (last) SCK edges:  
Data that was previously in the master SPI data register should now be in the slave data register and the data that was  
in the slave data register should be in the master.  
The SPIF flag in the SPI status register is set, indicating that the transfer is complete.  
Figure 100 is a timing diagram of an SPI transfer where CPHA = 0. SCK waveforms are shown for CPOL = 0 and CPOL = 1. The  
diagram may be interpreted as a master or slave timing diagram because the SCK, MISO, and MOSI pins are connected directly  
between the master and the slave. The MISO signal is the output from the slave and the MOSI signal is the output from the  
master. The SS pin of the master must be either high or reconfigured as a general-purpose output not affecting the SPI.  
Note:  
210. n depends on the selected transfer width, refer to Section 5.39.3.2.2, “SPI Control Register 2 (SPICR2)"  
End of Idle State  
Begin of Idle State  
Begin  
3
End  
Transfer  
1
2
4
5
6
7
8
9
10 11 12 13 14 15 16  
SCK Edge Number  
SCK (CPOL = 0)  
SCK (CPOL = 1)  
SAMPLE I  
MOSI/MISO  
CHANGE O  
MOSI pin  
CHANGE O  
MISO pin  
SEL SS (O)  
Master only  
SEL SS (I)  
t
tT  
tI  
tL  
L
MSB first (LSBFE = 0): MSB  
LSB first (LSBFE = 1): LSB  
Bit 6  
Bit 1  
Bit 5  
Bit 2  
Bit 4  
Bit 3  
Bit 3  
Bit 4  
Bit 2  
Bit 5  
Bit 1  
Bit 6  
LSB Minimum 1/2 SCK  
MSB  
for tT, tl, tL  
tL = Minimum leading time before the first SCK edge  
tT = Minimum trailing time after the last SCK edge  
tI = Minimum idling time between transfers (minimum SS high time)  
tL, tT, and tI are guaranteed for the master mode and required for the slave mode.  
Figure 100. SPI Clock Format 0 (CPHA = 0), with 8-bit Transfer Width Selected (XFRW = 0)  
MM912_634 Advance Information, Rev. 11.0  
282  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
End of Idle State  
Begin of Idle State  
End  
Begin  
Transfer  
1
3
5
7
9
11 13 15 17 19 21 23 25 27 29 31  
10 12 14 16 18 20 22 24 26 28 30 32  
SCK Edge Number  
2
4
6
8
SCK (CPOL = 0)  
SCK (CPOL = 1)  
SAMPLE I  
MOSI/MISO  
CHANGE O  
MOSI pin  
CHANGE O  
MISO pin  
SEL SS (O)  
Master only  
SEL SS (I)  
t
L
tT tI tL  
Minimum 1/2 SCK  
for tT, tl, tL  
MSB Bit 14Bit 13Bit 12Bit 11Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 LSB  
LSB Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Bit 8 Bit 9 Bit 10Bit 11Bit 12Bit 13Bit 14 MSB  
MSB first (LSBFE = 0)  
LSB first (LSBFE = 1)  
tL = Minimum leading time before the first SCK edge  
tT = Minimum trailing time after the last SCK edge  
tI = Minimum idling time between transfers (minimum SS high time)  
tL, tT, and tI are guaranteed for the master mode and required for the slave mode.  
Figure 101. SPI Clock Format 0 (CPHA = 0), with 16-Bit Transfer Width Selected (XFRW = 1)  
In slave mode, if the SS line is not deasserted between the successive transmissions then the content of the SPI data register is  
not transmitted; instead the last received data is transmitted. If the SS line is deasserted for at least minimum idle time (half SCK  
cycle) between successive transmissions, then the content of the SPI data register is transmitted.  
In master mode, with slave select output enabled the SS line is always deasserted and reasserted between successive transfers  
for at least minimum idle time.  
5.39.4.3.3  
CPHA = 1 Transfer Format  
Some peripherals require the first SCK edge before the first data bit becomes available at the data out pin, the second edge  
clocks data into the system. In this format, the first SCK edge is issued by setting the CPHA bit at the beginning of the n(211)-cycle  
transfer operation.  
The first edge of SCK occurs immediately after the half SCK clock cycle synchronization delay. This first edge commands the  
slave to transfer its first data bit to the serial data input pin of the master.  
A half SCK cycle later, the second edge appears on the SCK pin. This is the latching edge for both the master and slave.  
When the third edge occurs, the value previously latched from the serial data input pin is shifted into the LSB or MSB of the SPI  
shift register, depending on LSBFE bit. After this edge, the next bit of the master data is coupled out of the serial data output pin  
of the master to the serial input pin on the slave.  
This process continues for a total of n edges on the SCK line with data being latched on even numbered edges and shifting taking  
place on odd numbered edges.  
Note:  
211. n depends on the selected transfer width, refer to Section 5.39.3.2.2, “SPI Control Register 2 (SPICR2)"  
MM912_634 Advance Information, Rev. 11.0  
283  
Freescale Semiconductor  
 
Functional Description and Application Information  
Data reception is double buffered, data is serially shifted into the SPI shift register during the transfer and is transferred to the  
parallel SPI data register after the last bit is shifted in.  
After 2n SCK edges:  
Data that was previously in the SPI data register of the master is now in the data register of the slave, and data that was  
in the data register of the slave is in the master.  
The SPIF flag bit in SPISR is set indicating that the transfer is complete.  
Figure 102 shows two clocking variations for CPHA = 1. The diagram may be interpreted as a master or slave timing diagram  
because the SCK, MISO, and MOSI pins are connected directly between the master and the slave. The MISO signal is the output  
from the slave, and the MOSI signal is the output from the master. The SS line is the slave select input to the slave. The SS pin  
of the master must be either high or reconfigured as a general-purpose output not affecting the SPI.  
End of Idle State  
SCK Edge Number  
SCK (CPOL = 0)  
Begin  
4
End  
Begin of Idle State  
Transfer  
1
2
3
5
6
7
8
9
10 11 12 13 14 15 16  
SCK (CPOL = 1)  
SAMPLE I  
MOSI/MISO  
CHANGE O  
MOSI pin  
CHANGE O  
MISO pin  
SEL SS (O)  
Master only  
SEL SS (I)  
t
tT  
tI  
tL  
L
MSB first (LSBFE = 0): MSB  
LSB first (LSBFE = 1): LSB  
Bit 6  
Bit 1  
Bit 5  
Bit 2  
Bit 4  
Bit 3  
Bit 3  
Bit 4  
Bit 2  
Bit 5  
Bit 1  
Bit 6  
LSB Minimum 1/2 SCK  
MSB  
for tT, tl, tL  
tL = Minimum leading time before the first SCK edge, not required for back-to-back transfers  
tT = Minimum trailing time after the last SCK edge  
tI = Minimum idling time between transfers (minimum SS high time), not required for back-to-back transfers  
Figure 102. SPI Clock Format 1 (CPHA = 1), with 8-Bit Transfer Width Selected (XFRW = 0)  
MM912_634 Advance Information, Rev. 11.0  
284  
Freescale Semiconductor  
 
Functional Description and Application Information  
End of Idle State  
Begin of Idle State  
Begin  
End  
Transfer  
1
3
5
7
9
11 13 15 17 19 21 23 25 27 29 31  
SCK Edge Number  
2
4
6
8
10 12 14 16 18 20 22 24 26 28 30 32  
SCK (CPOL = 0)  
SCK (CPOL = 1)  
SAMPLE I  
MOSI/MISO  
CHANGE O  
MOSI pin  
CHANGE O  
MISO pin  
SEL SS (O)  
Master only  
SEL SS (I)  
tT tI tL  
t
L
Minimum 1/2 SCK  
for tT, tl, tL  
MSB Bit 14Bit 13Bit 12Bit 11Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 LSB  
LSB Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Bit 8 Bit 9 Bit 10Bit 11Bit 12Bit 13Bit 14 MSB  
MSB first (LSBFE = 0)  
LSB first (LSBFE = 1)  
tL = Minimum leading time before the first SCK edge, not required for back-to-back transfers  
tT = Minimum trailing time after the last SCK edge  
tI = Minimum idling time between transfers (minimum SS high time), not required for back-to-back transfers  
Figure 103. SPI Clock Format 1 (CPHA = 1), with 16-Bit Transfer Width Selected (XFRW = 1)  
The SS line can remain active low between successive transfers (can be tied low at all times). This format is sometimes preferred  
in systems having a single fixed master and a single slave that drive the MISO data line.  
Back-to-back transfers in master mode  
In master mode, if a transmission has completed and new data is available in the SPI data register, this data is sent out  
immediately without a trailing and minimum idle time.  
The SPI interrupt request flag (SPIF) is common to both the master and slave modes. SPIF gets set one half SCK cycle after the  
last SCK edge.  
5.39.4.4  
SPI Baud Rate Generation  
Baud rate generation consists of a series of divider stages. Six bits in the SPI baud rate register (SPPR2, SPPR1, SPPR0, SPR2,  
SPR1, and SPR0) determine the divisor to the SPI module clock which results in the SPI baud rate.  
The SPI clock rate is determined by the product of the value in the baud rate preselection bits (SPPR2–SPPR0) and the value  
in the baud rate selection bits (SPR2–SPR0). The module clock divisor equation is shown in Equation 104.  
BaudRateDivisor = (SPPR + 1) 2(SPR + 1)  
Eqn. 104  
When all bits are clear (the default condition), the SPI module clock is divided by 2. When the selection bits (SPR2–SPR0) are  
001 and the preselection bits (SPPR2–SPPR0) are 000, the module clock divisor becomes 4. When the selection bits are 010,  
the module clock divisor becomes 8, etc.  
When the preselection bits are 001, the divisor determined by the selection bits is multiplied by 2. When the preselection bits are  
010, the divisor is multiplied by 3, etc. See Table 402 for baud rate calculations for all bit conditions, based on a 25 MHz bus  
clock. The two sets of selects allows the clock to be divided by a non-power of two to achieve other baud rates such as divide by  
6, divide by 10, etc.  
MM912_634 Advance Information, Rev. 11.0  
285  
Freescale Semiconductor  
 
Functional Description and Application Information  
The baud rate generator is activated only when the SPI is in master mode and a serial transfer is taking place. In the other cases,  
the divider is disabled to decrease IDD current.  
NOTE  
For maximum allowed baud rates, refer to the SPI Electrical Specification in the Electricals  
chapter of this data sheet.  
5.39.4.5  
Special Features  
SS Output  
5.39.4.5.1  
The SS output feature automatically drives the SS pin low during transmission to select external devices and drives it high during  
idle to deselect external devices. When SS output is selected, the SS output pin is connected to the SS input pin of the external  
device.  
The SS output is available only in master mode during normal SPI operation by asserting SSOE and MODFEN bit as shown in  
Table 396.  
The mode fault feature is disabled while SS output is enabled.  
NOTE  
Care must be taken when using the SS output feature in a multimaster system because the  
mode fault feature is not available for detecting system errors between masters.  
5.39.4.5.2  
Bidirectional Mode (MOMI or SISO)  
The bidirectional mode is selected when the SPC0 bit is set in SPI control register 2 (see Table 409). In this mode, the SPI uses  
only one serial data pin for the interface with external device(s). The MSTR bit decides which pin to use. The MOSI pin becomes  
the serial data I/O (MOMI) pin for the master mode, and the MISO pin becomes serial data I/O (SISO) pin for the slave mode.  
The MISO pin in master mode and MOSI pin in slave mode are not used by the SPI.  
Table 409. Normal Mode and Bidirectional Mode  
When SPE = 1  
Master Mode MSTR = 1  
Slave Mode MSTR = 0  
Serial Out  
Serial In  
SPI  
MOSI  
MISO  
MOSI  
MISO  
Normal Mode  
SPC0 = 0  
SPI  
Serial Out  
Serial In  
Serial In  
Serial Out  
SPI  
MOMI  
Bidirectional Mode  
SPC0 = 1  
BIDIROE  
SPI  
BIDIROE  
Serial In  
Serial Out  
SISO  
The direction of each serial I/O pin depends on the BIDIROE bit. If the pin is configured as an output, serial data from the shift  
register is driven out on the pin. The same pin is also the serial input to the shift register.  
The SCK is output for the master mode and input for the slave mode.  
The SS is the input or output for the master mode, and it is always the input for the slave mode.  
The bidirectional mode does not affect SCK and SS functions.  
MM912_634 Advance Information, Rev. 11.0  
286  
Freescale Semiconductor  
 
Functional Description and Application Information  
NOTE  
In bidirectional master mode, with mode fault enabled, both data pins MISO and MOSI can  
be occupied by the SPI, though MOSI is normally used for transmissions in bidirectional  
mode and MISO is not used by the SPI. If a mode fault occurs, the SPI is automatically  
switched to slave mode. In this case MISO becomes occupied by the SPI and MOSI is not  
used. This must be considered, if the MISO pin is used for another purpose.  
5.39.4.6  
Error Conditions  
The SPI has one error condition:  
Mode fault error  
5.39.4.6.1  
Mode Fault Error  
If the SS input becomes low while the SPI is configured as a master, it indicates a system error where more than one master may  
be trying to drive the MOSI and SCK lines simultaneously. This condition is not permitted in normal operation, the MODF bit in  
the SPI status register is set automatically, provided the MODFEN bit is set.  
In the special case where the SPI is in master mode and MODFEN bit is cleared, the SS pin is not used by the SPI. In this special  
case, the mode fault error function is inhibited and MODF remains cleared. In case the SPI system is configured as a slave, the  
SS pin is a dedicated input pin. Mode fault error doesn’t occur in slave mode.  
If a mode fault error occurs, the SPI is switched to slave mode, with the exception that the slave output buffer is disabled. So  
SCK, MISO, and MOSI pins are forced to be high impedance inputs to avoid any possibility of conflict with another output driver.  
A transmission in progress is aborted and the SPI is forced into idle state.  
If the mode fault error occurs in the bidirectional mode for a SPI system configured in master mode, output enable of the MOMI  
(MOSI in bidirectional mode) is cleared if it was set. No mode fault error occurs in the bidirectional mode for SPI system  
configured in slave mode.  
The mode fault flag is cleared automatically by a read of the SPI status register (with MODF set) followed by a write to SPI control  
register 1. If the mode fault flag is cleared, the SPI becomes a normal master or slave again.  
NOTE  
If a mode fault error occurs and a received data byte is pending in the receive shift register,  
this data byte will be lost.  
5.39.4.7  
Low Power Mode Options  
SPI in Run Mode  
5.39.4.7.1  
In run mode with the SPI system enable (SPE) bit in the SPI control register clear, the SPI system is in a low-power, disabled  
state. SPI registers remain accessible, but clocks to the core of this module are disabled.  
5.39.4.7.2  
SPI in Stop Mode  
Stop mode is dependent on the system. The SPI enters stop mode when the module clock is disabled (held high or low). If the  
SPI is in master mode and exchanging data when the CPU enters stop mode, the transmission is frozen until the CPU exits stop  
mode. After stop, data to and from the external SPI is exchanged correctly. In slave mode, the SPI will stay synchronized with  
the master.  
The stop mode is not dependent on the SPISWAI bit.  
5.39.4.7.3  
Reset  
The reset values of registers and signals are described in Section 5.29.3, “Memory Map and Registers", which details the  
registers and their bit fields.  
If a data transmission occurs in slave mode after reset without a write to SPIDR, it will transmit garbage, or the data last  
received from the master before the reset.  
Reading from the SPIDR after reset will always read zeros.  
MM912_634 Advance Information, Rev. 11.0  
287  
Freescale Semiconductor  
Functional Description and Application Information  
5.39.4.7.4  
Interrupts  
The S12IPIMV1 only originates interrupt requests when SPI is enabled (SPE bit in SPICR1 set). The following is a description of  
how the S12IPIMV1 makes a request and how the MCU should acknowledge that request. The interrupt vector offset and  
interrupt priority are chip dependent.  
The interrupt flags MODF, SPIF, and SPTEF are logically ORed to generate an interrupt request.  
5.39.4.7.4.1  
MODF  
MODF occurs when the master detects an error on the SS pin. The master SPI must be configured for the MODF feature (see  
Table 396). After MODF is set, the current transfer is aborted and the following bit is changed:  
MSTR = 0, The master bit in SPICR1 resets.  
The MODF interrupt is reflected in the status register MODF flag. Clearing the flag will also clear the interrupt. This interrupt will  
stay active while the MODF flag is set. MODF has an automatic clearing process which is described in Section 5.39.3.2.4, “SPI  
Status Register (SPISR)".  
5.39.4.7.4.2  
SPIF  
SPIF occurs when new data has been received and copied to the SPI data register. After SPIF is set, it does not clear until it is  
serviced. SPIF has an automatic clearing process, which is described in Section 5.39.3.2.4, “SPI Status Register (SPISR)".  
5.39.4.7.4.3  
SPTEF  
SPTEF occurs when the SPI data register is ready to accept new data. After SPTEF is set, it does not clear until it is serviced.  
SPTEF has an automatic clearing process, which is described in Section 5.39.3.2.4, “SPI Status Register (SPISR)".  
5.40  
64 KByte Flash Module (S12FTMRC64K1V1)  
5.40.1  
Introduction  
The module implements the following:  
kbytes of P-Flash (Program Flash) memory  
kbytes of D-Flash (Data Flash) memory  
The Flash memory is ideal for single-supply applications allowing for field reprogramming without requiring external high voltage  
sources for program or erase operations. The Flash module includes a memory controller that executes commands to modify  
Flash memory contents. The user interface to the memory controller consists of the indexed Flash Common Command Object  
(FCCOB) register which is written to with the command, global address, data, and any required command parameters. The  
memory controller must complete the execution of a command before the FCCOB register can be written to with a new command.  
CAUTION  
A Flash word or phrase must be in the erased state before being programmed. Cumulative  
programming of bits within a Flash word or phrase is not allowed.  
The Flash memory may be read as bytes, aligned words, or misaligned words. Read access time is one bus cycle for bytes and  
aligned words, and two bus cycles for misaligned words. For Flash memory, an erased bit reads 1 and a programmed bit reads 0.  
It is possible to read from P-Flash memory while some commands are executing on D-Flash memory. It is not possible to read  
from D-Flash memory while a command is executing on P-Flash memory. Simultaneous P-Flash and D-Flash operations are  
discussed in Allowed Simultaneous P-Flash and D-Flash Operations.  
Both P-Flash and D-Flash memories are implemented with Error Correction Codes (ECC) that can resolve single bit faults and  
detect double bit faults. For P-Flash memory, the ECC implementation requires that programming be done on an aligned 8 byte  
basis (a Flash phrase). Since P-Flash memory is always read by half-phrase, only one single bit fault in an aligned 4 byte  
half-phrase containing the byte or word accessed will be corrected.  
5.40.1.1  
Glossary  
Command Write Sequence — An MCU instruction sequence to execute built-in algorithms (including program and erase) on  
the Flash memory.  
D-Flash Memory — The D-Flash memory constitutes the nonvolatile memory store for data.  
D-Flash Sector — The D-Flash sector is the smallest portion of the D-Flash memory that can be erased. The D-Flash sector  
consists of four 64 byte rows for a total of 256 bytes.  
MM912_634 Advance Information, Rev. 11.0  
288  
Freescale Semiconductor  
Functional Description and Application Information  
NVM Command Mode — An NVM mode using the CPU to setup the FCCOB register to pass parameters required for Flash  
command execution.  
Phrase — An aligned group of four 16-bit words within the P-Flash memory. Each phrase includes two sets of aligned double  
words with each set including 7 ECC bits for single bit fault correction and double bit fault detection within each double word.  
P-Flash Memory — The P-Flash memory constitutes the main nonvolatile memory store for applications.  
P-Flash Sector — The P-Flash sector is the smallest portion of the P-Flash memory that can be erased. Each P-Flash sector  
contains 512 bytes.  
Program IFR — Nonvolatile information register located in the P-Flash block that contains the Device ID, Version ID, and the  
Program Once field.  
5.40.1.2  
Features  
5.40.1.2.1  
P-Flash Features  
Single bit fault correction and double bit fault detection within a 32-bit double word during read operations  
Automated program and erase algorithm with verify and generation of ECC parity bits  
Fast sector erase and phrase program operation  
Ability to read the P-Flash memory while programming a word in the D-Flash memory  
Flexible protection scheme to prevent accidental program or erase of P-Flash memory  
5.40.1.2.2  
D-Flash Features  
Single bit fault correction and double bit fault detection within a word during read operations  
Automated program and erase algorithm with verify and generation of ECC parity bits  
Fast sector erase and word program operation  
Protection scheme to prevent accidental program or erase of D-Flash memory  
Ability to program up to four words in a burst sequence  
5.40.1.2.3  
Other Flash Module Features  
No external high-voltage power supply required for Flash memory program and erase operations  
Interrupt generation on Flash command completion and Flash error detection  
Security mechanism to prevent unauthorized access to the Flash memory  
5.40.1.3  
Block Diagram  
The block diagram of the Flash module is shown in Figure 105.  
5.40.2  
External Signal Description  
The Flash module contains no signals that connect off-chip.  
5.40.3  
Memory Map and Registers  
This section describes the memory map and registers for the Flash module. Read data from unimplemented memory space in  
the Flash module is undefined. Write access to unimplemented or reserved memory space in the Flash module will be ignored  
by the Flash module.  
5.40.3.1  
Module Memory Map  
The S12 architecture places the P-Flash memory between global addresses.The P-Flash memory map is shown in.  
The FPROT register, described in P-Flash Protection Register (FPROT), can be set to protect regions in the Flash memory from  
accidental program or erase. The Flash memory addresses covered by these protectable regions are shown in the P-Flash  
memory map. The higher address region is mainly targeted to hold the boot loader code since it covers the vector space. Default  
protection settings as well as security information that allows the MCU to restrict access to the Flash module are stored in the  
Flash configuration field as described in Table 410.  
MM912_634 Advance Information, Rev. 11.0  
289  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 410. Flash Configuration Field  
Global Address  
Size (Bytes)  
Description  
Back door Comparison Key  
0x3_FF00-0x3_FF07  
8
Refer to Section 5.40.4.5.11, “Verify Backdoor Access Key Command", and  
Section 5.40.5.1, “Unsecuring the MCU using Back door Key Access"  
0x3_FF08-0x3_FF0B  
0x3_FF0C  
4
1
Reserved  
P-Flash Protection byte.  
Refer to Section 5.40.3.2.9, “P-Flash Protection Register (FPROT)"  
D-Flash Protection byte.  
0x3_FF0D  
0x3_FF0E  
0x3_FF0F  
1
1
1
Refer to Section 5.40.3.2.11, “D-Flash Protection Register (DFPROT)"  
Flash Nonvolatile byte  
Refer to Section 5.40.3.2.17, “Flash Option Register (FOPT)"  
Flash Security byte  
Refer to Section 5.40.3.2.2, “Flash Security Register (FSEC)"  
Note:  
212. 0x3FF08-0x3_FF0F form a Flash phrase and must be programmed in a single command write sequence. Each byte in the 0x3_FF08  
- 0x3_FF0B reserved field should be programmed to 0xFF.  
Table 411. Program IFR Fields  
Global Address  
Size (Bytes)  
Field Description  
0x0_4000 – 0x0_4007  
0x0_4008 – 0x0_40B5  
0x0_40B6 – 0x0_40B7  
0x0_40B8 – 0x0_40BF  
8.0  
174  
2.0  
8.0  
Reserved  
Reserved  
Version ID  
Reserved  
Program Once Field  
Refer to Section 5.40.4.5.6, “Program Once Command"  
0x0_40C0 – 0x0_40FF  
64  
Note:  
213. For patch code storage, see Section 5.40.4.2, “IFR Version ID Word"  
214. Used to track firmware patch versions, see Section 5.40.4.2, “IFR Version ID Word"  
Table 412. D-Flash and Memory Controller Resource Fields  
Global Address  
Size (Bytes)  
Description  
0x0_4000 – 0x0_43FF  
0x0_4400 – 0x0_53FF  
0x0_5400 – 0x0_57FF  
0x0_5800 – 0x0_5AFF  
0x0_5B00 – 0x0_5FFF  
0x0_6000 – 0x0_67FF  
0x0_6800 – 0x0_7FFF  
1,024  
4,096  
1,024  
768  
Reserved  
D-Flash Memory  
Reserved  
Memory Controller Scratch RAM  
Reserved  
1,280  
2,048  
6,144  
Reserved  
Reserved  
MM912_634 Advance Information, Rev. 11.0  
290  
Freescale Semiconductor  
 
Functional Description and Application Information  
0x0_4000  
0x0_40FF  
P-Flash IFR 1 Kbyte  
D-Flash Start = 0x0_4400  
D-Flash Memory  
4 Kbytes  
D-Flash End = 0x0_53FF  
Reserved 1 Kbyte  
RAM Start = 0x0_5800  
RAM End = 0x0_5AFF  
Scratch Ram 768 bytes  
Reserved 1280 bytes  
Reserved 2 Kbytes  
0x0_6000  
0x0_6800  
Reserved 6 Kbytes  
0x0_7FFF  
Figure 105. D-Flash and Memory Controller Resource Memory Map  
5.40.3.2  
Register Descriptions  
The Flash module contains a set of 20 control and status registers located between Flash module base + 0x0000 and 0x0013.  
A summary of the Flash module registers is given in Figure 413 with detailed descriptions in the following subsections.  
CAUTION  
Writes to any Flash register must be avoided while a Flash command is active (CCIF=0) to  
prevent corruption of Flash register contents and adversely affect Memory Controller  
behavior.  
Table 413. FTMRC64K1 Register Summary  
Address  
7
6
5
4
3
2
1
0
& Name  
R
W
R
FDIVLD  
FCLKDIV  
FDIVLCK  
KEYEN0  
FDIV5  
RNV5  
FDIV4  
RNV4  
FDIV3  
RNV3  
FDIV2  
RNV2  
FDIV1  
SEC1  
FDIV0  
SEC0  
KEYEN1  
FSEC  
FCCOBIX  
FRSV0  
W
R
0
0
0
0
0
0
0
0
0
0
0
0
0
0
CCOBIX2  
0
CCOBIX1  
0
CCOBIX0  
0
W
R
0
W
R
0
0
0
0
FCNFG  
CCIE  
0
IGNSF  
0
FDFD  
FSFD  
W
R
FERCNFG  
FSTAT  
DFDIE  
SFDIE  
W
R
MGBUSY  
RSVD  
MGSTAT1  
MGSTAT0  
CCIF  
ACCERR  
FPVIOL  
W
MM912_634 Advance Information, Rev. 11.0  
291  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 413. FTMRC64K1 Register Summary (continued)  
Address  
7
6
5
4
3
2
1
0
& Name  
R
W
R
0
0
0
0
0
0
FERSTAT  
DFDIF  
DPS1  
CCOB9  
SFDIF  
DPS0  
CCOB8  
0
0
0
DFPROT  
FCCOBHI  
FCCOBLO  
FRSV1  
DPOPEN  
CCOB15  
DPS3  
DPS2  
W
R
CCOB14  
CCOB13  
CCOB12  
CCOB11  
CCOB10  
W
R
CCOB7  
0
CCOB6  
0
CCOB5  
0
CCOB4  
0
CCOB3  
0
CCOB2  
0
CCOB1  
0
CCOB0  
0
W
R
W
R
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
FRSV2  
W
R
FRSV3  
W
R
0
0
0
0
0
0
0
0
FRSV4  
W
R
NV7  
0
NV6  
0
NV5  
0
NV4  
0
NV3  
0
NV2  
0
NV1  
0
NV0  
0
FOPT  
W
R
FRSV5  
W
R
0
0
0
0
0
0
0
0
FRSV6  
W
R
0
0
0
0
0
0
0
0
FRSV7  
W
= Unimplemented or Reserved  
5.40.3.2.1  
Flash Clock Divider Register (FCLKDIV)  
The FCLKDIV register is used to control timed events in program and erase algorithms.  
Table 414. Flash Clock Divider Register (FCLKDIV)  
7
6
5
4
3
2
1
0
R
W
FDIVLD  
FDIVLCK  
0
FDIV[5:0]  
Reset  
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FCLKDIV register are readable, bit 7 is not writable, bit 6 is write-once-hi and controls the writability of the FDIV field.  
CAUTION  
The FCLKDIV register must never be written to while a Flash command is executing  
(CCIF=0). The FCLKDIV register is writable during the Flash reset sequence even though  
CCIF is clear.  
MM912_634 Advance Information, Rev. 11.0  
292  
Freescale Semiconductor  
Functional Description and Application Information  
Table 415. FCLKDIV Field Descriptions  
Field  
Description  
Clock Divider Loaded  
7
0
1
FCLKDIV register has not been written since the last reset  
FCLKDIV register has been written since the last reset  
FDIVLD  
Clock Divider Locked  
6
0
FDIV field is open for writing  
FDIVLCK  
1
FDIV value is locked and cannot be changed. Once the lock bit is set high, only reset can clear this bit and restore  
writability to the FDIV field.  
Clock Divider Bits — FDIV[5:0] must be set to effectively divide BUSCLK down to 1 MHz to control timed events during Flash  
program and erase algorithms. Table 416 shows recommended values for FDIV[5:0] based on the BUSCLK frequency. Refer  
to Section 5.40.4.3, “Flash Command Operations", for more information.  
5–0  
FDIV[5:0]  
Table 416. FDIV values for various BUSCLK Frequencies  
BUSCLK Frequency (MHz)  
BUSCLK Frequency (MHz)  
FDIV[5:0]  
FDIV[5:0]  
MIN(215)  
MAX(216)  
MIN(215)  
MAX(216)  
1.0  
1.6  
1.6  
2.6  
0x00  
0x01  
0x02  
0x03  
0x04  
0x05  
0x06  
0x07  
0x08  
0x09  
0x0A  
0x0B  
0x0C  
0x0D  
0x0E  
0x0F  
16.6  
17.6  
18.6  
19.6  
20.6  
21.6  
22.6  
23.6  
24.6  
25.6  
26.6  
27.6  
28.6  
29.6  
30.6  
31.6  
17.6  
18.6  
19.6  
20.6  
21.6  
22.6  
23.6  
24.6  
25.6  
26.6  
27.6  
28.6  
29.6  
30.6  
31.6  
32.6  
0x10  
0x11  
0x12  
0x13  
0x14  
0x15  
0x16  
0x17  
0x18  
0x19  
0x1A  
0x1B  
0x1C  
0x1D  
0x1E  
0x1F  
2.6  
3.6  
3.6  
4.6  
4.6  
5.6  
5.6  
6.6  
6.6  
7.6  
7.6  
8.6  
8.6  
9.6  
9.6  
10.6  
11.6  
12.6  
13.6  
14.6  
15.6  
16.6  
10.6  
11.6  
12.6  
13.6  
14.6  
15.6  
Note:  
215. BUSCLK is Greater Than this value.  
216. BUSCLK is Less Than or Equal to this value.  
5.40.3.2.2  
Flash Security Register (FSEC)  
The FSEC register holds all bits associated with the security of the MCU and Flash module.  
Table 417. Flash Security Register (FSEC)  
7
6
5
4
3
2
1
0
R
W
KEYEN[1:0]  
RNV[5:2]  
SEC[1:0]  
Reset  
F
F
F
F
F
F
F
F
= Unimplemented or Reserved  
MM912_634 Advance Information, Rev. 11.0  
293  
Freescale Semiconductor  
 
 
 
 
 
Functional Description and Application Information  
All bits in the FSEC register are readable but not writable.  
During the reset sequence, the FSEC register is loaded with the contents of the Flash security byte in the Flash configuration  
field at global address 0x3_FF0F located in P-Flash memory (see Table 410) as indicated by reset condition F in Figure 417. If  
a double bit fault is detected while reading the P-Flash phrase containing the Flash security byte during the reset sequence, all  
bits in the FSEC register will be set to leave the Flash module in a secured state with back door key access disabled.  
Table 418. FSEC Field Descriptions  
Field  
Description  
7–6  
Backdoor Key Security Enable Bits — The KEYEN[1:0] bits define the enabling of back door key access to the Flash module  
as shown in Table 419.  
KEYEN[1:0]  
5–2  
Reserved Nonvolatile Bits — The RNV bits should remain in the erased state for future enhancements.  
RNV[5:2}  
1–0  
Flash Security Bits — The SEC[1:0] bits define the security state of the MCU as shown in Table 420. If the Flash module is  
unsecured using back door key access, the SEC bits are forced to 10.  
SEC[1:0]  
Table 419. Flash KEYEN States  
KEYEN[1:0]  
Status of Backdoor Key Access  
00  
01  
10  
11  
DISABLED  
DISABLED(217)  
ENABLED  
DISABLED  
Note:  
217. Preferred KEYEN state to disable backdoor key access.  
Table 420. Flash Security States  
SEC[1:0]  
Status of Security  
00  
01  
10  
11  
SECURED  
SECURED(218)  
UNSECURED  
SECURED  
Note:  
218. Preferred SEC state to set MCU to secured state  
The security function in the Flash module is described in Section 5.40.5, “Security".  
5.40.3.2.3 Flash CCOB Index Register (FCCOBIX)  
The FCCOBIX register is used to index the FCCOB register for Flash memory operations.  
Table 421. FCCOB Index Register (FCCOBIX)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
CCOBIX[2:0]  
0
Reset  
0
0
0
0
0
0
0
= Unimplemented or Reserved  
CCOBIX bits are readable and writable while remaining bits read 0 and are not writable.  
MM912_634 Advance Information, Rev. 11.0  
294  
Freescale Semiconductor  
 
 
 
 
 
Functional Description and Application Information  
Table 422. FCCOBIX Field Descriptions  
Field  
Description  
2–0  
Common Command Register Index — The CCOBIX bits are used to select which word of the FCCOB register array is  
being read or written to. See Section 5.40.3.2.12, “Flash Common Command Object Register (FCCOB)”, for more details.  
CCOBIX[1:0]  
5.40.3.2.4  
Flash Reserved0 Register (FRSV0)  
This Flash register is reserved for factory testing.  
Table 423. Flash Reserved0 Register (FRSV0)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV0 register read 0 and are not writable.  
5.40.3.2.5 Flash Configuration Register (FCNFG)  
The FCNFG register enables the Flash command complete interrupt and forces ECC faults on Flash array read access from the  
CPU.  
Table 424. Flash Configuration Register (FCNFG)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
CCIE  
0
IGNSF  
0
FDFD  
0
FSFD  
0
Reset  
0
0
0
0
= Unimplemented or Reserved  
CCIE, IGNSF, FDFD, and FSFD bits are readable and writable while remaining bits read 0 and are not writable.  
Table 425. FCNFG Field Descriptions  
Field  
Description  
Command Complete Interrupt Enable — The CCIE bit controls interrupt generation when a Flash command has completed.  
7
0
1
Command complete interrupt disabled  
CCIE  
An interrupt will be requested whenever the CCIF flag in the FSTAT register is set (see Section 5.40.3.2.7, “Flash  
Status Register (FSTAT)")  
Ignore Single Bit Fault — The IGNSF controls single bit fault reporting in the FERSTAT register (see Section 5.40.3.2.8,  
“Flash Error Status Register (FERSTAT)").  
4
0
1
All single bit faults detected during array reads are reported  
IGNSF  
Single bit faults detected during array reads are not reported and the single bit fault interrupt will not be generated  
MM912_634 Advance Information, Rev. 11.0  
295  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 425. FCNFG Field Descriptions (continued)  
Field  
Description  
Force Double Bit Fault Detect — The FDFD bit allows the user to simulate a double bit fault during Flash array read  
operations and check the associated interrupt routine. The FDFD bit is cleared by writing a 0 to FDFD. The FECCR registers  
will not be updated during the Flash array read operation with FDFD set unless an actual double bit fault is detected.  
1
0
Flash array read operations will set the DFDIF flag in the FERSTAT register only if a double bit fault is detected  
FDFD  
1
Any Flash array read operation will force the DFDIF flag in the FERSTAT register to be set (see Section 5.40.3.2.7,  
“Flash Status Register (FSTAT)") and an interrupt will be generated as long as the DFDIE interrupt enable in the FERCNFG  
register is set (see Section 5.40.3.2.6, “Flash Error Configuration Register (FERCNFG)")  
Force Single Bit Fault Detect — The FSFD bit allows the user to simulate a single bit fault during Flash array read operations  
and check the associated interrupt routine. The FSFD bit is cleared by writing a 0 to FSFD. The FECCR registers will not be  
updated during the Flash array read operation with FSFD set unless an actual single bit fault is detected.  
0
0
Flash array read operations will set the SFDIF flag in the FERSTAT register only if a single bit fault is detected  
FSFD  
1
Flash array read operation will force the SFDIF flag in the FERSTAT register to be set (see Section 5.40.3.2.7, “Flash  
Status Register (FSTAT)") and an interrupt will be generated as long as the SFDIE interrupt enable in the FERCNFG  
register is set (see Section 5.40.3.2.6, “Flash Error Configuration Register (FERCNFG)")  
5.40.3.2.6  
Flash Error Configuration Register (FERCNFG)  
The FERCNFG register enables the Flash error interrupts for the FERSTAT flags.  
Table 426. Flash Error Configuration Register (FERCNFG)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
DFDIE  
0
SFDIE  
0
Reset  
0
0
0
0
0
0
= Unimplemented or Reserved  
All assigned bits in the FERCNFG register are readable and writable.  
Table 427. FERCNFG Field Descriptions  
Field  
Description  
Double Bit Fault Detect Interrupt Enable — The DFDIE bit controls interrupt generation when a double bit fault is detected  
during a Flash block read operation.  
1
0
DFDIF interrupt disabled  
DFDIE  
1
An interrupt will be requested whenever the DFDIF flag is set (see Section 5.40.3.2.8, “Flash Error Status Register  
(FERSTAT)")  
Single Bit Fault Detect Interrupt Enable — The SFDIE bit controls interrupt generation when a single bit fault is detected  
during a Flash block read operation.  
0
0
SFDIF interrupt disabled whenever the SFDIF flag is set (see Section 5.40.3.2.8, “Flash Error Status Register  
(FERSTAT)")  
SFDIE  
1
An interrupt will be requested whenever the SFDIF flag is set (see Section 5.40.3.2.8, “Flash Error Status Register  
(FERSTAT)")  
MM912_634 Advance Information, Rev. 11.0  
296  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.40.3.2.7  
Flash Status Register (FSTAT)  
The FSTAT register reports the operational status of the Flash module.  
Table 428. Flash Status Register (FSTAT)  
7
6
5
4
3
2
1
0
R
W
0
MGBUSY  
RSVD  
MGSTAT[1:0]  
CCIF  
1
ACCERR  
0
FPVIOL  
0
Reset  
0
0
0
0(219)  
0(219)  
= Unimplemented or Reserved  
Note:  
219. Reset value can deviate from the value shown if a double bit fault is detected during the reset sequence (see Section 5.40.6).  
CCIF, ACCERR, and FPVIOL bits are readable and writable, MGBUSY and MGSTAT bits are readable but not writable, while  
remaining bits read 0 and are not writable.  
Table 429. FSTAT Field Descriptions  
Field  
Description  
Command Complete Interrupt Flag — The CCIF flag indicates that a Flash command has completed. The CCIF flag is  
cleared by writing a 1 to CCIF to launch a command and CCIF will stay low until command completion or command violation.  
7
0
1
Flash command in progress  
CCIF  
Flash command has completed  
Flash Access Error Flag — The ACCERR bit indicates an illegal access has occurred to the Flash memory caused by either  
a violation of the command write sequence (see Section 5.40.4.3.2) or issuing an illegal Flash command. While ACCERR is  
set, the CCIF flag cannot be cleared to launch a command. The ACCERR bit is cleared by writing a 1 to ACCERR. Writing  
a 0 to the ACCERR bit has no effect on ACCERR.  
5
ACCERR  
0
1
No access error detected  
Access error detected  
Flash Protection Violation Flag —The FPVIOL bit indicates an attempt was made to program or erase an address in a  
protected area of P-Flash or D-Flash memory during a command write sequence. The FPVIOL bit is cleared by writing a 1  
to FPVIOL. Writing a 0 to the FPVIOL bit has no effect on FPVIOL. While FPVIOL is set, it is not possible to launch a  
command or start a command write sequence.  
4
FPVIOL  
0
1
No protection violation detected  
Protection violation detected  
Memory Controller Busy Flag — The MGBUSY flag reflects the active state of the Memory Controller.  
3
0
Memory Controller is idle  
MGBUSY  
1
Memory Controller is busy executing a Flash command (CCIF = 0)  
2
Reserved Bit — This bit is reserved and always reads 0.  
RSVD  
Memory Controller Command Completion Status Flag — One or more MGSTAT flag bits are set if an error is detected  
during execution of a Flash command or during the Flash reset sequence. See Section 5.40.4.5, “Flash Command  
Description" and Section 5.40.6, “Initialization" for details.  
1–0  
MGSTAT[1:0]  
MM912_634 Advance Information, Rev. 11.0  
297  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
5.40.3.2.8  
Flash Error Status Register (FERSTAT)  
The FERSTAT register reflects the error status of internal Flash operations.  
Table 430. Flash Error Status Register (FERSTAT)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
DFDIF  
0
SFDIF  
0
Reset  
0
0
0
0
0
0
= Unimplemented or Reserved  
All flags in the FERSTAT register are readable and only writable to clear the flag.  
Table 431. FERSTAT Field Descriptions  
Field  
Description  
Double Bit Fault Detect Interrupt Flag — The setting of the DFDIF flag indicates that a double bit fault was detected in the  
stored parity and data bits during a Flash array read operation, or that a Flash array read operation was attempted on a Flash  
block that was under a Flash command operation.(220) The DFDIF flag is cleared by writing a 1 to DFDIF. Writing a 0 to DFDIF  
has no effect on DFDIF.  
1
DFDIF  
0
1
No double bit fault detected  
Double bit fault detected or an invalid Flash array read operation attempted  
Single Bit Fault Detect Interrupt Flag — With the IGNSF bit in the FCNFG register clear, the SFDIF flag indicates that a  
single bit fault was detected in the stored parity and data bits during a Flash array read operation, or that a Flash array read  
operation was attempted on a Flash block that was under a Flash command operation. (220) The SFDIF flag is cleared by  
writing a 1 to SFDIF. Writing a 0 to SFDIF has no effect on SFDIF.  
0
SFDIF  
0
1
No single bit fault detected  
Single bit fault detected and corrected or an invalid Flash array read operation attempted  
Note:  
220. The single bit fault and double bit fault flags are mutually exclusive for parity errors (an ECC fault occurrence can be either single fault  
or double fault, but never both). A simultaneous access collision (read attempted while command running) is indicated when both SFDIF  
and DFDIF flags are high.  
5.40.3.2.9  
P-Flash Protection Register (FPROT)  
The FPROT register defines which P-Flash sectors are protected against program and erase operations.  
Table 432. P-Flash Protection Register (FPROT)  
7
6
5
4
3
2
1
0
R
W
RNV6  
FPOPEN  
F
FPHDIS  
F
FPHS[1:0]  
FPLDIS  
F
FPLS[1:0]  
Reset  
F
F
F
F
F
= Unimplemented or Reserved  
The (unreserved) bits of the FPROT register are writable with the restriction that the size of the protected region can only be  
increased.  
During the reset sequence, the FPROT register is loaded with the contents of the P-Flash protection byte in the Flash  
configuration field at global address 0x3_FF0C located in P-Flash memory (see Table 410) as indicated by reset condition ‘F’ in  
Table 432. To change the P-Flash protection that will be loaded during the reset sequence, the upper sector of the P-Flash  
memory must be unprotected, then the P-Flash protection byte must be reprogrammed. If a double bit fault is detected while  
reading the P-Flash phrase containing the P-Flash protection byte during the reset sequence, the FPOPEN bit will be cleared  
and remaining bits in the FPROT register will be set to leave the P-Flash memory fully protected.  
Trying to alter data in any protected area in the P-Flash memory will result in a protection violation error and the FPVIOL bit will  
be set in the FSTAT register. The block erase of a P-Flash block is not possible if any of the P-Flash sectors contained in the  
same P-Flash block are protected.  
MM912_634 Advance Information, Rev. 11.0  
298  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 433. FPROT Field Descriptions  
Field  
Description  
Flash Protection Operation Enable — The FPOPEN bit determines the protection function for program or  
erase operations as shown in Table 10-17 for the P-Flash block.  
7
0
When FPOPEN is clear, the FPHDIS and FPLDIS bits define unprotected address ranges as specified by the  
corresponding FPHS and FPLS bid  
FPOPEN  
1
When FPOPEN is set, the FPHDIS and FPLDIS bits enable protection for the address range specified by the  
corresponding FPHS and FPLS bits  
6
Reserved Nonvolatile Bit — The RNV bit should remain in the erased state for future enhancements.  
RNV[6]  
Flash Protection Higher Address Range Disable — The FPHDIS bit determines whether there is a protected/unprotected  
area in a specific region of the P-Flash memory ending with global address 0x3_FFFF.  
5
0
1
Protection/Unprotection enabled  
Protection/Unprotection disabled  
FPHDIS  
4–3  
Flash Protection Higher Address Size — The FPHS bits determine the size of the protected/unprotected area in P-Flash  
memory as shown inTable 435. The FPHS bits can only be written to while the FPHDIS bit is set.  
FPHS[1:0]  
Flash Protection Lower Address Range Disable — The FPLDIS bit determines whether there is a  
protected/unprotected area in a specific region of the P-Flash memory beginning with global address 0x3_8000.  
2
0
1
Protection/Unprotection enabled  
Protection/Unprotection disabled  
FPLDIS  
1-0  
Flash Protection Lower Address Size — The FPLS bits determine the size of the protected/unprotected area  
FPLS  
in P-Flash memory as shown in Table 436. The FPLS bits can only be written to while the FPLDIS bit is set.  
Table 434. P-Flash Protection Function  
FPOPEN  
FPHDIS  
FPLDIS  
Function  
1
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
No P-Flash Protection  
1
Protected Low Range  
1
Protected High Range  
1
Protected High and Low Ranges  
Full P-Flash Memory Protected  
Unprotected Low Range  
Unprotected High Range  
Unprotected High and Low Ranges  
0
0
0
0
Note:  
221. For range sizes, refer to Table 435 and Table 436.  
Table 435. P-Flash Protection Higher Address Range  
FPHS[1:0]  
Global Address Range  
Protected Size  
00  
01  
10  
11  
0x3_F800–0x3_FFFF  
0x3_F000–0x3_FFFF  
0x3_E000–0x3_FFFF  
0x3_C000–0x3_FFFF  
2.0 kByte  
4.0 kByte  
8.0 kByte  
16 kByte  
MM912_634 Advance Information, Rev. 11.0  
299  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 436. P-Flash Protection Lower Address Range  
FPLS[1:0]  
Global Address Range  
Protected Size  
00  
01  
10  
11  
0x3_8000–0x3_83FF  
0x3_8000–0x3_87FF  
0x3_8000–0x3_8FFF  
0x3_8000–0x3_9FFF  
1.0 kByte  
2.0 kByte  
4.0 kByte  
8.0 kByte  
All possible P-Flash protection scenarios are shown in Table 106. Although the protection scheme is loaded from the Flash  
memory at global address 0x3_FF0C during the reset sequence, it can be changed by the user. The P-Flash protection scheme  
can be used by applications requiring reprogramming in single chip mode while providing as much protection as possible if  
reprogramming is not required.  
FPHDIS = 1  
FPLDIS = 1  
FPHDIS = 1  
FPLDIS = 0  
FPHDIS = 0  
FPLDIS = 1  
FPHDIS = 0  
FPLDIS = 0  
Scenario  
7
6
5
4
FLASH START  
0x3_8000  
0x3_FFFF  
Scenario  
3
2
1
0
FLASH START  
0x3_8000  
0x3_FFFF  
Protected region with size  
defined by FPLS  
Unprotected region  
Protected region  
Protected region with size  
defined by FPHS  
not defined by FPLS, FPHS  
Figure 106. P-Flash Protection Scenarios  
5.40.3.2.10  
P-Flash Protection Restrictions  
The general guideline is that P-Flash protection can only be added and not removed. Table 437 specifies all valid transitions  
between P-Flash protection scenarios. Any attempt to write an invalid scenario to the FPROT register will be ignored. The  
contents of the FPROT register reflect the active protection scenario. See the FPHS and FPLS bit descriptions for additional  
restrictions.  
MM912_634 Advance Information, Rev. 11.0  
300  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 437. P-Flash Protection Scenario Transitions  
(222)  
From  
To Protection Scenario  
Protection  
Scenario  
0
1
X
X
2
3
X
X
X
X
X
X
X
X
4
5
6
7
0
X
X
1
2
3
4
5
6
X
X
X
X
X
X
X
X
X
X
X
X
X
7
X
X
Note:  
222. Allowed transitions marked with X, see Figure 10-14 for a definition of the scenarios.  
5.40.3.2.11  
D-Flash Protection Register (DFPROT)  
The DFPROT register defines which D-Flash sectors are protected against program and erase operations.  
Table 438. D-Flash Protection Register (DFPROT)  
7
6
5
4
3
2
1
0
R
W
0
0
0
DPOPEN  
F
DPS[3:0]  
Reset  
0
0
0
F
F
F
F
= Unimplemented or Reserved  
The (unreserved) bits of the DFPROT register are writable with the restriction that protection can be added but not removed.  
Writes must increase the DPS value and the DPOPEN bit can only be written from 1 (protection disabled) to 0 (protection  
enabled). If the DPOPEN bit is set, the state of the DPS bits is irrelevant.  
During the reset sequence, the DFPROT register is loaded with the contents of the D-Flash protection byte in the Flash  
configuration field at global address 0x3_FF0D located in P-Flash memory (see Table 410) as indicated by reset condition F in  
Figure 438. To change the D-Flash protection that will be loaded during the reset sequence, the P-Flash sector containing the  
D-Flash protection byte must be unprotected, then the D-Flash protection byte must be programmed. If a double bit fault is  
detected while reading the P-Flash phrase containing the D-Flash protection byte during the reset sequence, the DPOPEN bit  
will be cleared and DPS bits will be set to leave the D-Flash memory fully protected.  
Trying to alter data in any protected area in the D-Flash memory will result in a protection violation error and the FPVIOL bit will  
be set in the FSTAT register. Block erase of the D-Flash memory is not possible if any of the D-Flash sectors are protected.  
MM912_634 Advance Information, Rev. 11.0  
301  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
Table 439. DFPROT Field Descriptions  
Field  
Description  
D-Flash Protection Control  
7
0
1
Enables D-Flash memory protection from program and erase with protected address range defined by DPS bits  
Disables D-Flash memory protection from program and erase  
DPOPEN  
3–0  
D-Flash Protection Size — The DPS[3:0] bits determine the size of the protected area in the D-Flash memory as shown in  
Table 440.  
DPS[3:0]  
5.40.3.2.12  
Flash Common Command Object Register (FCCOB)  
Table 440. D-Flash Protection Address Range  
DPS[3:0]  
Global Address Range  
Protected Size  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
1111  
0x0_4400 – 0x0_44FF  
0x0_4400 – 0x0_45FF  
0x0_4400 – 0x0_46FF  
0x0_4400 – 0x0_47FF  
0x0_4400 – 0x0_48FF  
0x0_4400 – 0x0_49FF  
0x0_4400 – 0x0_4AFF  
0x0_4400 – 0x0_4BFF  
0x0_4400 – 0x0_4CFF  
0x0_4400 – 0x0_4DFF  
0x0_4400 – 0x0_4EFF  
0x0_4400 – 0x0_4FFF  
0x0_4400 – 0x0_50FF  
0x0_4400 – 0x0_51FF  
0x0_4400 – 0x0_52FF  
0x0_4400 – 0x0_53FF  
256 bytes  
512 bytes  
768 bytes  
1024 bytes  
1280 bytes  
1536 bytes  
1792 bytes  
2048 bytes  
2304 bytes  
2560 bytes  
2816 bytes  
3072 bytes  
3328 bytes  
3584 bytes  
3840 bytes  
4096 bytes  
The FCCOB is an array of six words addressed via the CCOBIX index found in the FCCOBIX register. Byte wide reads and writes  
are allowed to the FCCOB register.  
Table 441. Flash Common Command Object High Register (FCCOBHI)  
7
6
5
4
3
2
1
0
R
W
CCOB[15:8]  
Reset  
0
0
0
0
0
0
0
0
Table 442. Flash Common Command Object Low Register (FCCOBLO)  
7
6
5
4
3
2
1
0
R
W
CCOB[7:0]  
Reset  
0
0
0
0
0
0
0
0
MM912_634 Advance Information, Rev. 11.0  
302  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.40.3.2.12.1  
FCCOB - NVM Command Mode  
NVM command mode uses the indexed FCCOB register to provide a command code and its relevant parameters to the Memory  
Controller. The user first sets up all required FCCOB fields and then initiates the command’s execution by writing a 1 to the CCIF  
bit in the FSTAT register (a 1 written by the user clears the CCIF command completion flag to 0). When the user clears the CCIF  
bit in the FSTAT register all FCCOB parameter fields are locked and cannot be changed by the user until the command completes  
(as evidenced by the Memory Controller returning CCIF to 1). Some commands return information to the FCCOB register array.  
The generic format for the FCCOB parameter fields in NVM command mode is shown in Table 443. The return values are  
available for reading after the CCIF flag in the FSTAT register has been returned to 1 by the Memory Controller. Writes to the  
unimplemented parameter fields (CCOBIX = 110 and CCOBIX = 111) are ignored with reads from these fields returning 0x0000.  
Table 443 shows the generic Flash command format. The high byte of the first word in the CCOB array contains the command  
code, followed by the parameters for this specific Flash command. For details on the FCCOB settings required by each  
command, see the Flash command descriptions in Section 5.40.4.5, “Flash Command Description".  
Table 443. FCCOB - NVM Command Mode (Typical Usage)  
CCOBIX[2:0]  
Byte  
FCCOB Parameter Fields (NVM Command Mode)  
HI  
LO  
HI  
FCMD[7:0] defining Flash command  
6’h0, Global address [17:16]  
Global address [15:8]  
Global address [7:0]  
Data 0 [15:8]  
000  
001  
010  
011  
100  
101  
LO  
HI  
LO  
HI  
Data 0 [7:0]  
Data 1 [15:8]  
LO  
HI  
Data 1 [7:0]  
Data 2 [15:8]  
LO  
HI  
Data 2 [7:0]  
Data 3 [15:8]  
LO  
Data 3 [7:0]  
5.40.3.2.13  
Flash Reserved1 Register (FRSV1)  
This Flash register is reserved for factory testing.  
Table 444. Flash Reserved1 Register (FRSV1)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV1 register read 0 and are not writable.  
MM912_634 Advance Information, Rev. 11.0  
303  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.40.3.2.14  
Flash Reserved2 Register (FRSV2)  
This Flash register is reserved for factory testing.  
Table 445. Flash Reserved2 Register (FRSV2)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV2 register read 0 and are not writable.  
5.40.3.2.15 Flash Reserved3 Register (FRSV3)  
This Flash register is reserved for factory testing.  
Table 446. Flash Reserved3 Register (FRSV3)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV3 register read 0 and are not writable.  
5.40.3.2.16 Flash Reserved4 Register (FRSV4)  
This Flash register is reserved for factory testing.  
Table 447. Flash Reserved4 Register (FRSV4)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV4 register read 0 and are not writable.  
5.40.3.2.17 Flash Option Register (FOPT)  
The FOPT register is the Flash option register.  
Table 448. Flash Option Register (FOPT)  
7
6
5
4
3
2
1
0
R
W
NV[7:0]  
Reset  
F
F
F
F
F
F
F
F
= Unimplemented or Reserved  
All bits in the FOPT register are readable but are not writable.  
MM912_634 Advance Information, Rev. 11.0  
304  
Freescale Semiconductor  
 
Functional Description and Application Information  
During the reset sequence, the FOPT register is loaded from the Flash nonvolatile byte in the Flash configuration field at global  
address 0x3_FF0E located in P-Flash memory (see Table 410) as indicated by reset condition F in Table 448. If a double bit fault  
is detected while reading the P-Flash phrase containing the Flash nonvolatile byte during the reset sequence, all bits in the FOPT  
register will be set.  
Table 449. FOPT Field Descriptions  
Field  
Description  
7–0  
Nonvolatile Bits — The NV[7:0] bits are available as nonvolatile bits. Refer to the device user guide for proper use of the NV  
bits.  
NV[7:0]  
5.40.3.2.18  
Flash Reserved5 Register (FRSV5)  
This Flash register is reserved for factory testing.  
Table 450. Flash Reserved5 Register (FRSV5)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV5 register read 0 and are not writable.  
5.40.3.2.19 Flash Reserved6 Register (FRSV6)  
This Flash register is reserved for factory testing.  
Table 451. Flash Reserved6 Register (FRSV6)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV6 register read 0 and are not writable.  
5.40.3.2.20 Flash Reserved7 Register (FRSV7)  
This Flash register is reserved for factory testing.  
Table 452. Flash Reserved7 Register (FRSV7)  
7
6
5
4
3
2
1
0
R
W
0
0
0
0
0
0
0
0
Reset  
0
0
0
0
0
0
0
0
= Unimplemented or Reserved  
All bits in the FRSV7 register read 0 and are not writable.  
MM912_634 Advance Information, Rev. 11.0  
305  
Freescale Semiconductor  
Functional Description and Application Information  
5.40.4  
Functional Description  
Modes of Operation  
5.40.4.1  
The FTMRC64K1 module provides the modes of operation shown in Table 453. The operating mode is determined by  
module-level inputs and affects the FCLKDIV, FCNFG, and DFPROT registers, Scratch RAM writes, and the command set  
availability (see Table 455).  
Table 453. Modes and Mode Control Inputs  
FTMRC Input  
Operating Mode  
mmc_mode_ss_t2  
Normal:  
Special:  
0
1
5.40.4.2  
IFR Version ID Word  
The version ID word is stored in the IFR at address 0x0_40B6. The contents of the word are defined in Table 454.  
Table 454. IFR Version ID Fields  
[15:4]  
[3:0]  
Reserved  
VERNUM  
VERNUM: Version number. The first version is number 0b_0001 with both 0b_0000 and 0b_1111 meaning ‘none’.  
5.40.4.3  
Flash Command Operations  
Flash command operations are used to modify Flash memory contents.  
The next sections describe:  
How to write the FCLKDIV register that is used to generate a time base (FCLK) derived from BUSCLK for Flash program  
and erase command operations  
The command write sequence used to set Flash command parameters and launch execution  
Valid Flash commands available for execution  
5.40.4.3.1  
Writing the FCLKDIV Register  
Prior to issuing any Flash program or erase command after a reset, the user is required to write the FCLKDIV register to divide  
BUSCLK down to a target FCLK of 1 MHz. Table 416 shows recommended values for the FDIV field based on BUSCLK  
frequency.  
NOTE  
Programming or erasing the Flash memory cannot be performed if the bus clock runs at less  
than 0.8 MHz. Setting FDIV too high can destroy the Flash memory due to overstress.  
Setting FDIV too low can result in incomplete programming or erasure of the Flash memory  
cells.  
When the FCLKDIV register is written, the FDIVLD bit is set automatically. If the FDIVLD bit is 0, the FCLKDIV register has not  
been written since the last reset. If the FCLKDIV register has not been written, any Flash program or erase command loaded  
during a command write sequence will not execute and the ACCERR bit in the FSTAT register will set.  
5.40.4.3.2  
Command Write Sequence  
The Memory Controller will launch all valid Flash commands entered using a command write sequence.  
Before launching a command, the ACCERR and FPVIOL bits in the FSTAT register must be clear (see Section 5.40.3.2.7, “Flash  
Status Register (FSTAT)") and the CCIF flag should be tested to determine the status of the current command write sequence.  
If CCIF is 0, the previous command write sequence is still active, a new command write sequence cannot be started, and all  
writes to the FCCOB register are ignored.  
MM912_634 Advance Information, Rev. 11.0  
306  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
CAUTION  
Writes to any Flash register must be avoided while a Flash command is active (CCIF=0) to  
prevent corruption of Flash register contents and Memory Controller behavior.  
5.40.4.3.2.1  
Define FCCOB Contents  
The FCCOB parameter fields must be loaded with all required parameters for the Flash command being executed. Access to the  
FCCOB parameter fields is controlled via the CCOBIX bits in the FCCOBIX register (see Section 5.40.3.2.3, “Flash CCOB Index  
Register (FCCOBIX)").  
The contents of the FCCOB parameter fields are transferred to the Memory Controller when the user clears the CCIF command  
completion flag in the FSTAT register (writing 1 clears the CCIF to 0). The CCIF flag will remain clear until the Flash command  
has completed. Upon completion, the Memory Controller will return CCIF to 1 and the FCCOB register will be used to  
communicate any results. The flow for a generic command write sequence is shown in Figure 107.  
MM912_634 Advance Information, Rev. 11.0  
307  
Freescale Semiconductor  
Functional Description and Application Information  
START  
Read: FCLKDIV register  
no  
Clock Divider  
Value Check  
FDIV  
Correct?  
no  
CCIF  
Set?  
Read: FSTAT register  
yes  
yes  
Note: FCLKDIV must be  
set after each reset  
FCCOB  
Availability Check  
Read: FSTAT register  
no  
Write: FCLKDIV register  
CCIF  
Set?  
yes  
Results from previous Command  
ACCERR/  
FPVIOL  
Set?  
yes  
Access Error and  
Protection Violation  
Check  
Write: FSTAT register  
Clear ACCERR/FPVIOL 0x30  
no  
Write to FCCOBIX register  
to identify specific command  
parameter to load.  
Write to FCCOB register  
to load required command parameter.  
More  
Parameters?  
yes  
no  
Write: FSTAT register (to launch command)  
Clear CCIF 0x80  
Read: FSTAT register  
Bit Polling for  
Command Completion  
Check  
no  
CCIF Set?  
yes  
EXIT  
Figure 107. Generic Flash Command Write Sequence Flowchart  
MM912_634 Advance Information, Rev. 11.0  
308  
Freescale Semiconductor  
Functional Description and Application Information  
5.40.4.3.3  
Valid Flash Module Commands  
Table 455. Flash Commands by Mode  
Unsecured  
Secured  
FCMD  
Command  
NS(223) SS(224) NS(225) SS(226)  
0x01  
0x02  
0x03  
0x04  
0x06  
0x07  
0x08  
0x09  
0x0A  
0x0B  
0x0C  
0x0D  
0x0E  
0x10  
0x11  
0x12  
Erase Verify All Blocks  
Erase Verify Block  
Erase Verify P-Flash Section  
Read Once  
Program P-Flash  
Program Once  
Erase All Blocks  
Erase Flash Block  
Erase P-Flash Sector  
Unsecure Flash  
Verify Backdoor Access Key  
Set User Margin Level  
Set Field Margin Level  
Erase Verify D-Flash Section  
Program D-Flash  
Erase D-Flash Sector  
Note:  
223. Unsecured Normal Single Chip mode  
224. Unsecured Special Single Chip mode  
225. Secured Normal Single Chip mode  
226. Secured Special Single Chip mode  
5.40.4.3.4  
P-Flash Commands  
Table 456 summarizes the valid P-Flash commands along with the effects of the commands on the P-Flash block and other  
resources within the Flash module.  
Table 456. P-Flash Commands  
FCMD  
Command  
Erase Verify All Blocks Verify that all P-Flash (and D-Flash) blocks are erased.  
Erase Verify Block Verify that a P-Flash block is erased.  
Function on P-Flash Memory  
0x01  
0x02  
Erase Verify P-Flash Verify that a given number of words starting at the address provided are erased.  
Section  
0x03  
Read a dedicated 64 byte field in the nonvolatile information register in P-Flash block that was  
previously programmed using the Program Once command.  
0x04  
0x06  
0x07  
Read Once  
Program P-Flash  
Program Once  
Program a phrase in a P-Flash block.  
Program a dedicated 64 byte field in the nonvolatile information register in P-Flash block that is  
allowed to be programmed only once.  
Erase all P-Flash (and D-Flash) blocks.  
0x08  
0x09  
Erase All Blocks  
An erase of all Flash blocks is only possible when the FPLDIS, FPHDIS, and FPOPEN bits in the  
FPROT register and the DPOPEN bit in the DFPROT register are set prior to launching the command.  
Erase a P-Flash (or D-Flash) block.  
An erase of the full P-Flash block is only possible when FPLDIS, FPHDIS and FPOPEN bits in the  
FPROT register are set prior to launching the command.  
Erase Flash Block  
MM912_634 Advance Information, Rev. 11.0  
309  
Freescale Semiconductor  
 
 
 
 
 
 
Functional Description and Application Information  
Function on P-Flash Memory  
Table 456. P-Flash Commands (continued)  
FCMD  
Command  
0x0A  
Erase P-Flash Sector Erase all bytes in a P-Flash sector.  
Supports a method of releasing MCU security by erasing all P-Flash (and D-Flash) blocks and  
verifying that all P-Flash (and D-Flash) blocks are erased.  
0x0B  
0x0C  
Unsecure Flash  
Verify Backdoor  
Access Key  
Supports a method of releasing MCU security by verifying a set of security keys.  
0x0D  
0x0E  
Set User Margin Level Specifies a user margin read level for all P-Flash blocks.  
Set Field Margin Level Specifies a field margin read level for all P-Flash blocks (special modes only).  
5.40.4.3.5  
D-Flash Commands  
Table 457 summarizes the valid D-Flash commands along with the effects of the commands on the D-Flash block.  
Table 457. D-Flash Commands  
FCMD  
Command  
Function on D-Flash Memory  
0x01  
0x02  
Erase Verify All Blocks Verify that all D-Flash (and P-Flash) blocks are erased.  
Erase Verify Block  
Erase All Blocks  
Verify that the D-Flash block is erased.  
Erase all D-Flash (and P-Flash) blocks.  
An erase of all Flash blocks is only possible when the FPLDIS, FPHDIS, and FPOPEN bits in the FPROT  
register and the DPOPEN bit in the DFPROT register are set prior to launching the command.  
0x08  
Erase a D-Flash (or P-Flash) block.  
0x09  
0x0B  
Erase Flash Block  
Unsecure Flash  
An erase of the full D-Flash block is only possible when DPOPEN bit in the DFPROT register is set prior  
to launching the command.  
Supports a method of releasing MCU security by erasing all D-Flash (and P-Flash) blocks and verifying  
that all D-Flash (and P-Flash) blocks are erased.  
0x0D  
0x0E  
Set User Margin Level Specifies a user margin read level for the D-Flash block.  
Set Field Margin Level Specifies a field margin read level for the D-Flash block (special modes only).  
Erase Verify D-Flash Verify that a given number of words starting at the address provided are erased.  
Section  
0x10  
0x11  
0x12  
Program D-Flash  
Program up to four words in the D-Flash block.  
Erase D-Flash Sector Erase all bytes in a sector of the D-Flash block.  
MM912_634 Advance Information, Rev. 11.0  
310  
Freescale Semiconductor  
 
Functional Description and Application Information  
Allowed Simultaneous P-Flash and D-Flash Operations  
5.40.4.4  
Only the operations marked ‘OK’ in Table 458 are permitted to be run simultaneously on the Program Flash and Data Flash  
blocks. Some operations cannot be executed simultaneously because certain hardware resources are shared by the two  
memories. The priority has been placed on permitting Program Flash reads while program and erase operations execute on the  
Data Flash, providing read (P-Flash) while write (D-Flash) functionality.  
Table 458. Allowed P-Flash and D-Flash Simultaneous Operations  
Data Flash  
Program Flash  
Read  
Read  
Margin Read(227)  
OK  
Program  
Sector Erase  
Mass Erase(229)  
OK  
OK  
Margin Read(227)  
Program  
OK(228)  
Sector Erase  
Mass Erase(227)  
OK  
OK  
Note:  
227. A ‘Margin Read’ is any read after executing the margin setting commands ‘Set User Margin Level’ or ‘Set Field Margin Level’ with  
anything but the ‘normal’ level specified.  
228. See the Note on margin settings in Section 5.40.4.5.12, “Set User Margin Level Command" and Section 5.40.4.5.13, “Set Field Margin  
Level Command".  
229. The ‘Mass Erase’ operations are commands ‘Erase All Blocks’ and ‘Erase Flash Block’.  
5.40.4.5  
Flash Command Description  
This section provides details of all available Flash commands launched by a command write sequence. The ACCERR bit in the  
FSTAT register will be set during the command write sequence if any of the following illegal steps are performed, causing the  
command not to be processed by the Memory Controller:  
Starting any command write sequence that programs or erases Flash memory before initializing the FCLKDIV register  
Writing an invalid command as part of the command write sequence  
For additional possible errors, refer to the error handling table provided for each command  
If a Flash block is read during execution of an algorithm (CCIF = 0) on that same block, the read operation will return invalid data.  
If the SFDIF or DFDIF flags were not previously set when the invalid read operation occurred, both the SFDIF and DFDIF flags  
will be set.  
If the ACCERR or FPVIOL bits are set in the FSTAT register, the user must clear these bits before starting any command write  
sequence (see Section 5.40.3.2.7, “Flash Status Register (FSTAT)").  
CAUTION  
A Flash word or phrase must be in the erased state before being programmed. Cumulative  
programming of bits within a Flash word or phrase is not allowed.  
5.40.4.5.1  
Erase Verify All Blocks Command  
The Erase Verify All Blocks command will verify that all P-Flash and D-Flash blocks have been erased.  
Table 459. Erase Verify All Blocks Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
0x01  
Not required  
Upon clearing CCIF to launch the Erase Verify All Blocks command, the Memory Controller will verify that the entire Flash  
memory space is erased. The CCIF flag will set after the Erase Verify All Blocks operation has completed.  
MM912_634 Advance Information, Rev. 11.0  
311  
Freescale Semiconductor  
 
 
 
 
Functional Description and Application Information  
Error Condition  
Table 460. Erase Verify All Blocks Command Error Handling  
Register  
Error Bit  
ACCERR  
FPVIOL  
Set if CCOBIX[2:0] != 000 at command launch  
None  
FSTAT  
MGSTAT1  
MGSTAT0  
Set if any errors have been encountered during the read  
Set if any non-correctable errors have been encountered during the read  
5.40.4.5.2  
Erase Verify Block Command  
The Erase Verify Block command allows the user to verify that an entire P-Flash or D-Flash block has been erased. The FCCOB  
upper global address bits determine which block must be verified.  
Table 461. Erase Verify Block Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] of the  
Flash block to be verified.  
000  
0x02  
Upon clearing CCIF to launch the Erase Verify Block command, the Memory Controller will verify that the selected P-Flash or  
D-Flash block is erased. The CCIF flag will set after the Erase Verify Block operation has completed.  
Table 462. Erase Verify Block Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 000 at command launch  
ACCERR  
Set if an invalid global address [17:16] is supplied  
None  
FSTAT  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if any errors have been encountered during the read  
Set if any non-correctable errors have been encountered during the read  
5.40.4.5.3  
Erase Verify P-Flash Section Command  
The Erase Verify P-Flash Section command will verify that a section of code in the P-Flash memory is erased. The Erase Verify  
P-Flash Section command defines the starting point of the code to be verified and the number of phrases.  
Table 463. Erase Verify P-Flash Section Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
001  
010  
0x03  
Global address [17:16] of a P-Flash block  
Global address [15:0] of the first phrase to be verified  
Number of phrases to be verified  
Upon clearing CCIF to launch the Erase Verify P-Flash Section command, the Memory Controller will verify the selected section  
of Flash memory is erased. The CCIF flag will set after the Erase Verify P-Flash Section operation has completed.  
MM912_634 Advance Information, Rev. 11.0  
312  
Freescale Semiconductor  
Functional Description and Application Information  
Table 464. Erase Verify P-Flash Section Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 010 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid global address [17:0] is supplied  
ACCERR  
Set if a misaligned phrase address is supplied (global address [2:0] != 000)  
Set if the requested section crosses a 128 Kbyte boundary  
None  
FSTAT  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if any errors have been encountered during the read  
Set if any non-correctable errors have been encountered during the read  
5.40.4.5.4  
Read Once Command  
The Read Once command provides read access to a reserved 64 byte field (8 phrases) located in the nonvolatile information  
register of P-Flash. The Read Once field is programmed using the Program Once command described in Section 5.40.4.5.6,  
“Program Once Command". The Read Once command must not be executed from the Flash block containing the Program Once  
reserved field to avoid code runaway.  
Table 465. Read Once Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
001  
010  
011  
100  
101  
0x04  
Not Required  
Read Once phrase index (0x0000 - 0x0007)  
Read Once word 0 value  
Read Once word 1 value  
Read Once word 2 value  
Read Once word 3 value  
Upon clearing CCIF to launch the Read Once command, a Read Once phrase is fetched and stored in the FCCOB indexed  
register. The CCIF flag will set after the Read Once operation has completed. Valid phrase index values for the Read Once  
command range from 0x0000 to 0x0007. During execution of the Read Once command, any attempt to read addresses within  
P-Flash block will return invalid data.  
Table 466. Read Once Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 001 at command launch  
ACCERR  
Set if command not available in current mode (see Table 455)  
Set if an invalid phrase index is supplied  
FSTAT  
FPVIOL  
MGSTAT1  
MGSTAT0  
None  
Set if any errors have been encountered during the read  
Set if any non-correctable errors have been encountered during the read  
5.40.4.5.5  
Program P-Flash Command  
The Program P-Flash operation will program a previously erased phrase in the P-Flash memory using an embedded algorithm.  
CAUTION  
A P-Flash phrase must be in the erased state before being programmed. Cumulative  
programming of bits within a Flash phrase is not allowed.  
MM912_634 Advance Information, Rev. 11.0  
313  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 467. Program P-Flash Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] to identify  
P-Flash block  
000  
0x06  
001  
010  
011  
100  
101  
Global address [15:0] of phrase location to be programmed(230)  
Word 0 program value  
Word 1 program value  
Word 2 program value  
Word 3 program value  
Note:  
230. Global address [2:0] must be 000  
Upon clearing CCIF to launch the Program P-Flash command, the Memory Controller will program the data words to the supplied  
global address and will then proceed to verify the data words read back as expected. The CCIF flag will set after the Program  
P-Flash operation has completed.  
Table 468. Program P-Flash Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 101 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid global address [17:0] is supplied  
ACCERR  
FSTAT  
Set if a misaligned phrase address is supplied (global address [2:0] != 000)  
Set if the global address [17:0] points to a protected area  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
5.40.4.5.6  
Program Once Command  
The Program Once command restricts programming to a reserved 64 byte field (8 phrases) in the nonvolatile information register  
located in P-Flash. The Program Once reserved field can be read using the Read Once command as described in  
Section 5.40.4.5.4, “Read Once Command". The Program Once command must only be issued once since the nonvolatile  
information register in P-Flash cannot be erased. The Program Once command must not be executed from the Flash block  
containing the Program Once reserved field to avoid code runaway.  
Table 469. Program Once Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
001  
010  
011  
100  
101  
0x07  
Not Required  
Program Once phrase index (0x0000 - 0x0007)  
Program Once word 0 value  
Program Once word 1 value  
Program Once word 2 value  
Program Once word 3 value  
Upon clearing CCIF to launch the Program Once command, the Memory Controller first verifies that the selected phrase is  
erased. If erased, then the selected phrase will be programmed and then verified with read back. The CCIF flag will remain clear,  
setting only after the Program Once operation has completed.  
The reserved nonvolatile information register accessed by the Program Once command cannot be erased and any attempt to  
program one of these phrases a second time will not be allowed. Valid phrase index values for the Program Once command range  
MM912_634 Advance Information, Rev. 11.0  
314  
Freescale Semiconductor  
 
Functional Description and Application Information  
from 0x0000 to 0x0007. During execution of the Program Once command, any attempt to read addresses within P-Flash will  
return invalid data.  
Table 470. Program Once Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 101 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid phrase index is supplied  
ACCERR  
FSTAT  
Set if the requested phrase has already been programmed(231)  
FPVIOL  
MGSTAT1  
MGSTAT0  
None  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
Note:  
231. If a Program Once phrase is initially programmed to 0xFFFF_FFFF_FFFF_FFFF, the Program Once command will be allowed  
to execute again on that same phrase.  
5.40.4.5.7  
Erase All Blocks Command  
The Erase All Blocks operation will erase the entire P-Flash and D-Flash memory space.  
Table 471. Erase All Blocks Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
0x08  
Not required  
Upon clearing CCIF to launch the Erase All Blocks command, the Memory Controller will erase the entire Flash memory space  
and verify that it is erased. If the Memory Controller verifies that the entire Flash memory space was properly erased, security  
will be released. During the execution of this command (CCIF=0) the user must not write to any Flash module register. The CCIF  
flag will set after the Erase All Blocks operation has completed.  
Table 472. Erase All Blocks Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 000 at command launch  
ACCERR  
Set if command not available in current mode (see Table 455)  
FSTAT  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if any area of the P-Flash or D-Flash memory is protected  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
5.40.4.5.8  
Erase Flash Block Command  
The Erase Flash Block operation will erase all addresses in a P-Flash or D-Flash block.  
Table 473. Erase Flash Block Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] to identify  
000  
001  
0x09  
Flash block  
Global address [15:0] in Flash block to be erased  
Upon clearing CCIF to launch the Erase Flash Block command, the Memory Controller will erase the selected Flash block and  
verify that it is erased. The CCIF flag will set after the Erase Flash Block operation has completed.  
MM912_634 Advance Information, Rev. 11.0  
315  
Freescale Semiconductor  
 
Functional Description and Application Information  
Error Condition  
Table 474. Erase Flash Block Command Error Handling  
Register  
Error Bit  
Set if CCOBIX[2:0] != 001 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid global address [17:16] is supplied  
ACCERR  
Set if the supplied P-Flash address is not phrase-aligned or if the D-Flash address is not  
word-aligned  
FSTAT  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if an area of the selected Flash block is protected  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
5.40.4.5.9  
Erase P-Flash Sector Command  
The Erase P-Flash Sector operation will erase all addresses in a P-Flash sector.  
Table 475. Erase P-Flash Sector Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] to identify  
000  
0x0A  
P-Flash block to be erased  
Global address [15:0] anywhere within the sector to be erased.  
Refer to Section 5.40.1.2.1, “P-Flash Features" for the P-Flash sector size.  
001  
Upon clearing CCIF to launch the Erase P-Flash Sector command, the Memory Controller will erase the selected Flash sector  
and then verify that it is erased. The CCIF flag will be set after the Erase P-Flash Sector operation has completed.  
Table 476. Erase P-Flash Sector Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 001 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid global address [17:16] is supplied  
ACCERR  
FSTAT  
Set if a misaligned phrase address is supplied (global address [2:0] != 000)  
Set if the selected P-Flash sector is protected  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
5.40.4.5.10  
Unsecure Flash Command  
The Unsecure Flash command will erase the entire P-Flash and D-Flash memory space and, if the erase is successful, will  
release security.  
Table 477. Unsecure Flash Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
0x0B  
Not required  
Upon clearing CCIF to launch the Unsecure Flash command, the Memory Controller will erase the entire P-Flash and D-Flash  
memory space and verify that it is erased. If the Memory Controller verifies that the entire Flash memory space was properly  
erased, security will be released. If the erase verify is not successful, the Unsecure Flash operation sets MGSTAT1 and  
terminates without changing the security state. During the execution of this command (CCIF=0) the user must not write to any  
Flash module register. The CCIF flag is set after the Unsecure Flash operation has completed.  
MM912_634 Advance Information, Rev. 11.0  
316  
Freescale Semiconductor  
Functional Description and Application Information  
Error Condition  
Table 478. Unsecure Flash Command Error Handling  
Register  
Error Bit  
Set if CCOBIX[2:0] != 000 at command launch  
ACCERR  
Set if command not available in current mode (see Table 455)  
FSTAT  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if any area of the P-Flash or D-Flash memory is protected  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
5.40.4.5.11  
Verify Backdoor Access Key Command  
The Verify Backdoor Access Key command will only execute if it is enabled by the KEYEN bits in the FSEC register (see  
Table 419). The Verify Backdoor Access Key command releases security if user-supplied keys match those stored in the Flash  
security bytes of the Flash configuration field (see Table 410). The Verify Backdoor Access Key command must not be executed  
from the Flash block containing the back door comparison key to avoid code runaway.  
Table 479. Verify Backdoor Access Key Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
001  
010  
011  
100  
0x0C  
Not required  
Key 0  
Key 1  
Key 2  
Key 3  
Upon clearing CCIF to launch the Verify Backdoor Access Key command, the Memory Controller will check the FSEC KEYEN  
bits to verify that this command is enabled. If not enabled, the Memory Controller sets the ACCERR bit in the FSTAT register and  
terminates. If the command is enabled, the Memory Controller compares the key provided in FCCOB to the buckaroo comparison  
key in the Flash configuration field with Key 0 compared to 0x3_FF00, etc. If the back door keys match, security will be released.  
If the back door keys do not match, security is not released and all future attempts to execute the Verify Backdoor Access Key  
command are aborted (set ACCERR) until a reset occurs. The CCIF flag is set after the Verify Backdoor Access Key operation  
has completed.  
Table 480. Verify Backdoor Access Key Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 100 at command launch  
Set if an incorrect back door key is supplied  
ACCERR  
Set if back door key access has not been enabled (KEYEN[1:0] != 10, see Section 5.40.3.2.2,  
“Flash Security Register (FSEC)")  
FSTAT  
Set if the back door key has mismatched since the last reset  
FPVIOL  
MGSTAT1  
MGSTAT0  
None  
None  
None  
5.40.4.5.12  
Set User Margin Level Command  
The Set User Margin Level command causes the Memory Controller to set the margin level for future read operations of the  
P-Flash or D-Flash block.  
MM912_634 Advance Information, Rev. 11.0  
317  
Freescale Semiconductor  
 
Functional Description and Application Information  
Table 481. Set User Margin Level Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] to identify the Flash  
block  
000  
001  
0x0D  
Margin level setting  
Upon clearing CCIF to launch the Set User Margin Level command, the Memory Controller will set the user margin level for the  
targeted block and then set the CCIF flag.  
NOTE  
When the D-Flash block is targeted, the D-Flash user margin levels are applied only to the  
D-Flash reads. However, when the P-Flash block is targeted, the P-Flash user margin levels  
are applied to both P-Flash and D-Flash reads. It is not possible to apply user margin levels  
to the P-Flash block only.  
Valid margin level settings for the Set User Margin Level command are defined in Table 482.  
Table 482. Valid Set User Margin Level Settings  
CCOB (CCOBIX=001)  
Level Description  
0x0000  
0x0001  
0x0002  
Return to Normal Level  
User Margin-1 Level(232)  
User Margin-0 Level(233)  
Note:  
232. Read margin to the erased state  
233. Read margin to the programmed state  
Table 483. Set User Margin Level Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 001 at command launch  
Set if command not available in current mode (see Table 455)  
ACCERR  
Set if an invalid global address [17:16] is supplied  
FSTAT  
Set if an invalid margin level setting is supplied  
FPVIOL  
MGSTAT1  
MGSTAT0  
None  
None  
None  
NOTE  
User margin levels can be used to check that Flash memory contents have adequate margin  
for normal level read operations. If unexpected results are encountered when checking  
Flash memory contents at user margin levels, a potential loss of information has been  
detected.  
5.40.4.5.13  
Set Field Margin Level Command  
The Set Field Margin Level command, valid in special modes only, causes the Memory Controller to set the margin level specified  
for future read operations of the P-Flash or D-Flash block.  
MM912_634 Advance Information, Rev. 11.0  
318  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 484. Set Field Margin Level Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
000  
001  
0x0E  
Global address [17:16] to identify the Flash block  
Margin level setting  
Upon clearing CCIF to launch the Set Field Margin Level command, the Memory Controller will set the field margin level for the  
targeted block and then set the CCIF flag.  
NOTE  
When the D-Flash block is targeted, the D-Flash field margin levels are applied only to the  
D-Flash reads. However, when the P-Flash block is targeted, the P-Flash field margin levels  
are applied to both P-Flash and D-Flash reads. It is not possible to apply field margin levels  
to the P-Flash block only.  
Valid margin level settings for the Set Field Margin Level command are defined in Table 485.  
Table 485. Valid Set Field Margin Level Settings  
CCOB (CCOBIX=001)  
Level Description  
0x0000  
0x0001  
Return to Normal Level  
User Margin-1 Level(234)  
User Margin-0 Level(235)  
Field Margin-1 Level(234)  
Field Margin-0 Level(235)  
0x0002  
0x0003  
0x0004  
Note:  
234. Read margin to the erased state  
235. Read margin to the programmed state  
Table 486. Set Field Margin Level Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 001 at command launch  
Set if command not available in current mode (see Table 455)  
ACCERR  
Set if an invalid global address [17:16] is supplied  
FSTAT  
Set if an invalid margin level setting is supplied  
FPVIOL  
MGSTAT1  
MGSTAT0  
None  
None  
None  
CAUTION  
Field margin levels must only be used during verify of the initial factory programming.  
NOTE  
Field margin levels can be used to check that Flash memory contents have adequate margin  
for data retention at the normal level setting. If unexpected results are encountered when  
checking Flash memory contents at field margin levels, the Flash memory contents should  
be erased and reprogrammed.  
5.40.4.5.14  
Erase Verify D-Flash Section Command  
The Erase Verify D-Flash Section command will verify that a section of code in the D-Flash is erased. The Erase Verify D-Flash  
Section command defines the starting point of the data to be verified and the number of words.  
MM912_634 Advance Information, Rev. 11.0  
319  
Freescale Semiconductor  
 
 
 
Functional Description and Application Information  
Table 487. Erase Verify D-Flash Section Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] to  
identify the D-Flash block  
000  
0x10  
001  
010  
Global address [15:0] of the first word to be verified  
Number of words to be verified  
Upon clearing CCIF to launch the Erase Verify D-Flash Section command, the Memory Controller will verify the selected section  
of D-Flash memory is erased. The CCIF flag will set after the Erase Verify D-Flash Section operation has completed.  
Table 488. Erase Verify D-Flash Section Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 010 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid global address [17:0] is supplied  
ACCERR  
Set if a misaligned word address is supplied (global address [0] != 0)  
Set if the requested section breaches the end of the D-Flash block  
None  
FSTAT  
FPVIOL  
MGSTAT1  
MGSTAT0  
Set if any errors have been encountered during the read  
Set if any non-correctable errors have been encountered during the read  
5.40.4.5.15  
Program D-Flash Command  
The Program D-Flash operation programs one to four previously erased words in the D-Flash block. The Program D-Flash  
operation will confirm that the targeted location(s) were successfully programmed upon completion.  
CAUTION  
A Flash word must be in the erased state before being programmed. Cumulative  
programming of bits within a Flash word is not allowed.  
Table 489. Program D-Flash Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] to identify  
000  
0x11  
the D-Flash block  
001  
010  
011  
100  
101  
Global address [15:0] of word to be programmed  
Word 0 program value  
Word 1 program value, if desired  
Word 2 program value, if desired  
Word 3 program value, if desired  
Upon clearing CCIF to launch the Program D-Flash command, the user-supplied words will be transferred to the Memory  
Controller and be programmed if the area is unprotected. The CCOBIX index value at Program D-Flash command launch  
determines how many words will be programmed in the D-Flash block. The CCIF flag is set when the operation has completed.  
MM912_634 Advance Information, Rev. 11.0  
320  
Freescale Semiconductor  
Functional Description and Application Information  
Error Condition  
Table 490. Program D-Flash Command Error Handling  
Register  
Error Bit  
Set if CCOBIX[2:0] < 010 at command launch  
Set if CCOBIX[2:0] > 101 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid global address [17:0] is supplied  
ACCERR  
FSTAT  
Set if a misaligned word address is supplied (global address [0] != 0)  
Set if the requested group of words breaches the end of the D-Flash block  
Set if the selected area of the D-Flash memory is protected  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
FPVIOL  
MGSTAT1  
MGSTAT0  
5.40.4.5.16  
Erase D-Flash Sector Command  
The Erase D-Flash Sector operation will erase all addresses in a sector of the D-Flash block.  
Table 491. Erase D-Flash Sector Command FCCOB Requirements  
CCOBIX[2:0]  
FCCOB Parameters  
Global address [17:16] to identify  
000  
0x12  
D-Flash block  
Global address [15:0] anywhere within the sector to be erased.  
See Section 5.40.1.2.2, “D-Flash Features" for D-Flash sector size.  
001  
Upon clearing CCIF to launch the Erase D-Flash Sector command, the Memory Controller will erase the selected Flash sector  
and verify that it is erased. The CCIF flag will set after the Erase D-Flash Sector operation has completed.  
Table 492. Erase D-Flash Sector Command Error Handling  
Register  
Error Bit  
Error Condition  
Set if CCOBIX[2:0] != 001 at command launch  
Set if command not available in current mode (see Table 455)  
Set if an invalid global address [17:0] is supplied  
ACCERR  
FSTAT  
Set if a misaligned word address is supplied (global address [0] != 0)  
Set if the selected area of the D-Flash memory is protected  
Set if any errors have been encountered during the verify operation  
Set if any non-correctable errors have been encountered during the verify operation  
FPVIOL  
MGSTAT1  
MGSTAT0  
5.40.4.6  
Interrupts  
The Flash module can generate an interrupt when a Flash command operation has completed or when a Flash command  
operation has detected an ECC fault.  
Table 493. Flash Interrupt Sources  
Interrupt Source  
Interrupt Flag  
Local Enable  
Global (CCR) Mask  
Flash Command Complete  
CCIF  
(FSTAT register)  
CCIE  
(FCNFG register)  
I Bit  
ECC Double Bit Fault on Flash Read  
ECC Single Bit Fault on Flash Read  
DFDIF  
(FERSTAT register)  
DFDIE  
(FERCNFG register)  
I Bit  
I Bit  
SFDIF  
(FERSTAT register)  
SFDIE  
(FERCNFG register)  
MM912_634 Advance Information, Rev. 11.0  
321  
Freescale Semiconductor  
Functional Description and Application Information  
NOTE  
Vector addresses and their relative interrupt priority are determined at the MCU level.  
5.40.4.6.1  
Description of Flash Interrupt Operation  
The Flash module uses the CCIF flag in combination with the CCIE interrupt enable bit to generate the Flash command interrupt  
request. The Flash module uses the DFDIF and SFDIF flags in combination with the DFDIE and SFDIE interrupt enable bits to  
generate the Flash error interrupt request. For a detailed description of the register bits involved, refer to Section 5.40.3.2.5,  
“Flash Configuration Register (FCNFG)", Section 5.40.3.2.6, “Flash Error Configuration Register (FERCNFG)",  
Section 5.40.3.2.7, “Flash Status Register (FSTAT)", and Section 5.40.3.2.8, “Flash Error Status Register (FERSTAT)".  
The logic used for generating the Flash module interrupts is shown in Figure 108.  
Flash Command Interrupt Request  
Flash Error Interrupt Request  
CCIE  
CCIF  
DFDIE  
DFDIF  
SFDIE  
SFDIF  
Figure 108. Flash Module Interrupts Implementation  
5.40.4.7  
Stop Mode  
If a Flash command is active (CCIF = 0) when the MCU requests stop mode, the current Flash operation will be completed before  
the CPU is allowed to enter stop mode.  
5.40.5  
Security  
The Flash module provides security information to the MCU. The Flash security state is defined by the SEC bits of the FSEC  
register (see Table 420). During reset, the Flash module initializes the FSEC register using data read from the security byte of  
the Flash configuration field at global address 0x3_FF0F. The security state out of reset can be permanently changed by  
programming the security byte assuming that the MCU is starting from a mode where the necessary P-Flash erase and program  
commands are available and that the upper region of the P-Flash is unprotected. If the Flash security byte is successfully  
programmed, its new value will take affect after the next MCU reset.  
The following subsections describe these security-related subjects:  
Unsecuring the MCU using Back door Key Access  
Unsecuring the MCU in Special Single Chip Mode using BDM  
Mode and Security Effects on Flash Command Availability  
5.40.5.1  
Unsecuring the MCU using Back door Key Access  
The MCU may be unsecured by using the back door key access feature which requires knowledge of the contents of the back  
door keys (four 16-bit words programmed at addresses 0x3_FF00-0x3_FF07). If the KEYEN[1:0] bits are in the enabled state  
(see Section 5.40.3.2.2, “Flash Security Register (FSEC)"), the Verify Backdoor Access Key command (see Section 5.40.4.5.11,  
“Verify Backdoor Access Key Command") allows the user to present four prospective keys for comparison to the keys stored in  
the Flash memory via the Memory Controller. If the keys presented in the Verify Backdoor Access Key command match the back  
door keys stored in the Flash memory, the SEC bits in the FSEC register (see Table 420) will be changed to unsecure the MCU.  
Key values of 0x0000 and 0xFFFF are not permitted as back door keys. While the Verify Backdoor Access Key command is  
active, P-Flash memory and D-Flash memory will not be available for read access and will return invalid data.  
The user code stored in the P-Flash memory must have a method of receiving the back door keys from an external stimulus. This  
external stimulus would typically be through one of the on-chip serial ports.  
MM912_634 Advance Information, Rev. 11.0  
322  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
If the KEYEN[1:0] bits are in the enabled state (see Section 5.40.3.2.2, “Flash Security Register (FSEC)"), the MCU can be  
unsecured by the back door key access sequence described below:  
1. Follow the command sequence for the Verify Backdoor Access Key command as explained in Section 5.40.4.5.11,  
“Verify Backdoor Access Key Command"  
2. If the Verify Backdoor Access Key command is successful, the MCU is unsecured and the SEC[1:0] bits in the FSEC  
register are forced to the unsecure state of 10  
The Verify Backdoor Access Key command is monitored by the Memory Controller and an illegal key will prohibit future use of  
the Verify Backdoor Access Key command. A reset of the MCU is the only method to re-enable the Verify Backdoor Access Key  
command. The security as defined in the Flash security byte (0x3_FF0F) is not changed by using the Verify Backdoor Access  
Key command sequence. The back door keys stored in addresses 0x3_FF00-0x3_FF07 are unaffected by the Verify Backdoor  
Access Key command sequence. The Verify Backdoor Access Key command sequence has no effect on the program and erase  
protections defined in the Flash protection register, FPROT.  
After the back door keys have been correctly matched, the MCU will be unsecured. After the MCU is unsecured, the sector  
containing the Flash security byte can be erased and the Flash security byte can be reprogrammed to the unsecure state, if  
desired. In the unsecure state, the user has full control of the contents of the back door keys by programming addresses  
0x3_FF00-0x3_FF07 in the Flash configuration field.  
5.40.5.2  
Unsecuring the MCU in Special Single Chip Mode using BDM  
A secured MCU can be unsecured in special single chip mode by using the following method to erase the P-Flash and D-Flash  
memory:  
1. Reset the MCU into special single chip mode  
2. Delay while the BDM executes the Erase Verify All Blocks command write sequence to check if the P-Flash and D-Flash  
memories are erased  
3. Send BDM commands to disable protection in the P-Flash and D-Flash memory  
4. Execute the Erase All Blocks command write sequence to erase the P-Flash and D-Flash memory  
5. After the CCIF flag sets to indicate that the Erase All Blocks operation has completed, reset the MCU into special single  
chip mode  
6. Delay while the BDM executes the Erase Verify All Blocks command write sequence to verify that the P-Flash and  
D-Flash memory are erased  
If the P-Flash and D-Flash memory are verified as erased, the MCU will be unsecured. All BDM commands will now be enabled  
and the Flash security byte may be programmed to the unsecure state by continuing with the following steps:  
7. Send BDM commands to execute the Program P-Flash command write sequence to program the Flash security byte to  
the unsecured state  
8. Reset the MCU  
5.40.5.3  
Mode and Security Effects on Flash Command Availability  
The availability of Flash module commands depends on the MCU operating mode and security state as shown in Table 455.  
5.40.6  
Initialization  
On each system reset the Flash module executes a reset sequence which establishes initial values for the Flash Block  
Configuration Parameters, the FPROT and DFPROT protection registers, and the FOPT and FSEC registers. The Flash module  
reverts to using built-in default values that leave the module in a fully protected and secured state if errors are encountered during  
execution of the reset sequence. If a double bit fault is detected during the reset sequence, both MGSTAT bits in the FSTAT  
register will be set.  
CCIF remains clear throughout the reset sequence. The Flash module holds off all CPU access for the initial portion of the reset  
sequence. While Flash memory reads and access to most Flash registers are possible when the hold is removed, writes to the  
FCCOBIX, FCCOBHI, and FCCOBLO registers are ignored. Completion of the reset sequence is marked by setting CCIF high  
which enables writes to the FCCOBIX, FCCOBHI, and FCCOBLO registers to launch any available Flash command.  
If a reset occurs while any Flash command is in progress, that command will be immediately aborted. The state of the word being  
programmed or the sector/block being erased is not guaranteed.  
MM912_634 Advance Information, Rev. 11.0  
323  
Freescale Semiconductor  
Functional Description and Application Information  
5.41  
Die-to-Die Initiator (S12IPIMV1)  
5.41.0.1  
Preface  
This document contains the user specification of the D2D Initiator.  
5.41.0.1.1 Acronyms and Abbreviations  
Table 494 contains sample acronyms and abbreviations used in this document.  
Table 494. Acronyms and Abbreviated Terms  
Term  
Meaning  
D2D  
Die-to-Die  
5.41.0.1.2  
Glossary  
Table 245 shows a glossary of the major terms used in this document.  
Table 495. Glossary  
Term  
Definition  
Active low  
Active high  
Asserted  
Customer  
EOT  
The signal is asserted when it changes to logic-level zero.  
The signal is asserted when it changes to logic-level one.  
Discrete signal is in active logic state.  
The end user of an SoC design or device.  
End of Transaction  
Negated  
Pin  
A discrete signal is in inactive logic state.  
External physical connection.  
Revision  
Signal  
Revised or new version of a document. Revisions produce versions; there can be no ‘Rev 0.0.’  
Electronic construct whose state or change in state conveys information.  
A read or write on the CPU bus following the IP-Bus protocol.  
Command, address and if required data sent on the D2D interface. A transaction is finished by the EOT acknowledge cycle.  
Particular form or variation of an earlier or original document.  
Transfer  
Transaction  
Version  
5.41.1  
Introduction  
This section describes the functionality of the die-to-die (S12IPIMV1) initiator block especially designed for low cost connections  
between a microcontroller die (Interface Initiator) and an analog die (Interface Target) located in the same package.  
The D2DI block  
realizes the initiator part of the D2D interface, including supervision and error interrupt generation  
generates the clock for this interface  
disables/enables the interrupt from the D2D interface  
5.41.1.1  
Overview  
The D2DI is the initiator for a data transfer to and from a target typically located on another die in the same package. It provides  
a set of configuration registers and two memory mapped 256 Byte address windows. When writing to a window a transaction is  
initiated sending a write command, followed by an 8-bit address and the data byte or word to the target. When reading from a  
window a transaction is initiated sending a read command, followed by an 8-bit address to the target. The target then responds  
with the data. The basic idea is that a peripheral located on another die, can be addressed like an on-chip peripheral, except for  
a small transaction delay.  
MM912_634 Advance Information, Rev. 11.0  
324  
Freescale Semiconductor  
 
Functional Description and Application Information  
D2DCW  
Address Bus  
Write Data Bus  
Read Data Bus  
D2DDAT[7:0]  
D2DINT  
D2DIF  
D2DINTI  
D2DERR_INT  
D2DIE  
xfr_wait  
D2DCLKDIV  
/n  
Bus Clock  
D2DCLK  
n=1 … 4  
Figure 109. Die-to-Die Initiator (D2DI) Block Diagram  
5.41.1.2  
Features  
The main features of this block are  
Software transparent, memory mapped access to peripherals on target die  
256 Byte address window  
Supports blocking read or write as well as non-blocking write transactions  
Scalable interface clock divide by 1, 2, 3, or 4 of bus clock  
Clock halt on system STOP  
Configurable for 4 or 8-bit wide transfers  
Configurable timeout period  
Non-maskable interrupt on transaction errors  
Transaction Status and Error Flags  
Interrupt enable for receiving interrupt (from D2D target)  
5.41.1.3  
Modes of Operation  
5.41.1.3.1  
D2DI in STOP mode  
The D2DI stops working in STOP mode. The D2DCLK signal as well as the data signals used are driven low (only after the end  
of the current high phase, as defined by D2DCLKDIV).  
Waking from STOP mode, the D2DCLK line starts clocking again and the data lines will be driven low until the first transaction  
starts.  
STOP mode is entered by different CPU instructions. Every (enabled) interrupt can be used to leave the STOP mode.  
MM912_634 Advance Information, Rev. 11.0  
325  
Freescale Semiconductor  
Functional Description and Application Information  
5.41.1.3.2  
D2DI in special modes  
The MCU can enter a special mode (used for test and debugging purposes as well as programming the FLASH). In the D2DI the  
“write-once” feature is disabled. See the MCU description for details.  
5.41.2  
External Signal Description  
The D2DI optionally uses 6 or 10 port pins. The functions of those pins depends on the settings in the D2DCTL0 register, when  
the D2DI module is enabled.  
5.41.2.1  
D2DCLK  
When the D2DI is enabled this pin is the clock output. This signal is low if the initiator is disabled, in STOP mode (with D2DSWAI  
asserted), otherwise it is a continuos clock. This pin may be shared with general purpose functionality if the D2DI is disabled.  
5.41.2.2  
D2DDAT[7:4]  
When the D2DI is enabled and the interface connection width D2DCW is set to be 8-bit wide, those lines carry the data bits 7:4  
acting as outputs or inputs. When they act as inputs pull-down elements are enabled. If the D2DI is disabled or if the interface  
connection width is set as 4-bit wide, the pins may be shared with general purpose pin functionality.  
5.41.2.3  
D2DDAT[3:0]  
When the D2DI is enabled those lines carry the data bits 3:0 acting as outputs or inputs. When they act as inputs pull-down  
elements are enabled. If the D2DI is disabled the pins and may be shared with general purpose pin functionality.  
5.41.2.4  
D2DINT  
The D2DINT is an active input interrupt input driven by the target device. The pin has an active pull-down device. If the D2DI is  
disabled the pin may be shared with general purpose pin functionality.  
Table 496. Signal Properties  
Secondary  
Name  
Primary (D2DEN=1)  
I/O  
Reset  
Comment  
Pull down  
(D2DEN=0)  
D2DDAT[7:0]  
D2DCLK  
D2DINT  
Bi-directional Data Lines  
Interface Clock Signal  
Active High Interrupt  
I/O  
O
I
GPIO  
GPIO  
GPIO  
0
0
driven low if in STOP mode  
low if in STOP mode  
Active(236)  
Active(237)  
Note:  
236. Active if in input state, only if D2DEN=1  
237. only if D2DEN=1  
See the port interface module (PIM) guide for details of the GPIO function.  
5.41.3  
Memory Map and Register Definition  
Memory Map  
5.41.3.1  
The D2DI memory map is split into three sections.  
1. An eight-byte set of control registers  
2. A 256 byte window for blocking transactions  
3. A 256 byte window for non-blocking transactions  
See the chapter “Device Memory Map” for the register layout (distribution of these sections).  
MM912_634 Advance Information, Rev. 11.0  
326  
Freescale Semiconductor  
 
 
Functional Description and Application Information  
D2DREGS  
8 Byte Control  
Registers  
D2DBLK  
256 Byte Window  
Blocking Access  
D2DNBLK  
256 Byte Window  
Non-blocking Write  
Figure 110. D2DI Top Level Memory Map  
A summary of the registers associated with the D2DI block is shown in Table 247. Detailed descriptions of the registers and bits  
are given in the subsections that follow.  
Table 497. D2DI Register Summary  
Register  
Offset  
Bit 7  
D2DEN  
D2DIE  
ERRIF  
6
5
4
3
2
1
Bit 0  
Name  
0x0  
R
0
0
0
D2DCTL0  
D2DCTL1  
D2DCW  
0
D2DSWAI  
0
D2DCLKDIV[1:0]  
W
0x1  
0x2  
0x3  
0x4  
0x5  
0x6  
0x7  
0
TIMEOUT[3:0]  
PARF PAR1  
R
ACKERF  
D2DBSY  
SZ8  
CNCLF  
TIMEF  
0
TERRF  
PAR0  
D2DSTAT0  
D2DSTAT1  
W
0
0
0
0
0
0
0
0
D2DIF  
RWB  
R
W
R
NBLK  
0
0
D2DADRHI  
D2DADRLO  
D2DDATAHI  
D2DDATALO  
ADR[7:0]  
W
R
DATA[15:8]  
DATA[7:0]  
W
R
W
= Unimplemented or Reserved  
MM912_634 Advance Information, Rev. 11.0  
327  
Freescale Semiconductor  
Functional Description and Application Information  
5.41.3.2  
5.41.3.3  
Register Definition  
D2DI Control Register 0 (D2DCTL0)  
This register is used to enable and configure the interface width, the wait behavior and the frequency of the interface clock.  
Table 498. D2DI Control Register 0 (D2DCTL0)  
Offset 0x0  
Access: User read/write  
7
6
5
4
3
2
1
0
R
0
0
0
D2DEN  
0
D2DCW  
0
D2DSWAI  
0
D2DCLKDIV[1:0]  
W
Reset  
0
0
0
0
0
Table 499. D2DCTL0 Register Field Descriptions  
Field  
Description  
D2DI Enable — Enables the D2DI module. This bit is write-once in normal mode and can always be written in special modes.  
7
0
D2DI initiator is disabled. No lines are not used, the pins have their GPIO (secondary) function.  
D2DEN  
1
D2DI initiator is enabled. After setting D2DEN=1 the D2DDAT[7:0] (or [3:0], see D2DCW) lines are driven low with  
the IDLE command; the D2DCLK is driven by the divided bus clock.  
D2D Connection Width — Sets the number of data lines used by the interface. This bit is write-once in normal modes and  
can always be written in special modes.  
6
0
1
Lines D2DDAT[3:0] are used for four line data transfer. D2DDAT[7:4] are unused.  
All eight interface lines D2DDAT[7:0] are used for data transfer.  
D2DCW  
5
-
Reserved — For internal use  
4:2  
Reserved, should be written to 0 to ensure compatibility with future versions of this interface.  
Interface Clock Divider — Determines the frequency of the interface clock. These bits are write-once in normal modes and  
can be always written in special modes. See Figure 111 for details on the clock waveforms  
00 Encoding 0. Bus clock divide by 1.  
01 Encoding 1. Bus clock divide by 2.  
10 Encoding 2. Bus clock divide by 3.  
11 Encoding 3. Bus clock divide by 4.  
1:0  
D2DCLKDIV  
The Clock Divider will provide the waveforms as shown in Figure 111. The duty cycle of the clock is not always 50%, the high  
cycle is shorter than 50% or equal but never longer, since this is beneficial for the transaction speed.  
bus clock  
00  
01  
10  
11  
Figure 111. Interface Clock Waveforms for various D2DCLKDIV Encoding  
MM912_634 Advance Information, Rev. 11.0  
328  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.41.3.4  
D2DI Control Register 1 (D2DCTL1)  
This register is used to enable the D2DI interrupt and set number of D2DCLK cycles before a timeout error is asserted.  
Table 500. D2DI Control Register 1 (D2DCTL1)  
Offset 0x1  
Access: User read/write  
7
6
5
4
3
2
1
0
R
0
0
0
D2DIE  
0
TIMOUT[3:0]  
W
Reset  
0
0
0
0
0
0
0
Table 501. D2DCTL1 Register Field Descriptions  
Field  
Description  
D2D Interrupt Enable — Enables the external interrupt  
7
0
1
External Interrupt is disabled  
External Interrupt is enabled  
D2DIE  
6:4  
Reserved, should be written to 0 to ensure compatibility with future versions of this interface.  
Timeout Setting — Defines the number of D2DCLK cycles to wait after the last transaction cycle until a timeout is asserted. In  
case of a timeout the TIMEF flag in the D2DSTAT0 register will be set.  
These bits are write-once in normal modes and can always be written in special modes.  
3:0  
TIMOUT  
0000: The acknowledge is expected directly after the last transfer, i.e. the target must not insert a wait cycle.  
0001 - 1111: The target may insert up to TIMOUT wait states before acknowledging a transaction until a timeout is asserted  
The selected value of TIMOUT depends on the application. Determining factors include the frequency of blocking accesses or  
consecutive accesses on the D2D interface.  
NOTE  
“Write-once“ means that after writing D2DCNTL0.D2DEN=1 the write accesses to these bits  
have no effect.  
5.41.3.5  
D2DI Status Register 0 (D2DSTAT0)  
This register reflects the status of the D2DI transactions.  
Table 502. D2DI Status Register 0 (D2DSTAT0)  
Offset 0x2  
Access: User read/write  
7
6
5
4
3
2
1
0
R
W
ACKERF  
CNCLF  
TIMEF  
TERRF  
PARF  
PAR1  
PAR0  
ERRIF  
0
Reset  
0
0
0
0
0
0
0
Table 503. D2DI Status Register 0 Field Descriptions  
Field  
Description  
D2DI error interrupt flag — This status bit indicates that the D2D initiator has detected an error condition (summary of the  
following five flags).This interrupt is not locally maskable. Write a 1 to clear the flag. Writing a 0 has no effect.  
7
0
1
D2DI has not detected an error during a transaction.  
D2DI has detected an error during a transaction.  
ERRIF  
6
Acknowledge Error Flag— This read-only flag indicates that in the acknowledge cycle not all data inputs are sampled high,  
indicating a potential broken wire. This flag is cleared when the ERRIF bit is cleared by writing a 1 to the ERRIF bit.  
ACKERF  
5
CNCLF — This read-only flag indicates the initiator has canceled a transaction and replaced it by an IDLE command due to a  
pending error flag (ERRIF). This flag is cleared when the ERRIF bit is cleared by writing a 1 to the ERRIF bit.  
CNCLF  
MM912_634 Advance Information, Rev. 11.0  
329  
Freescale Semiconductor  
Functional Description and Application Information  
Table 503. D2DI Status Register 0 Field Descriptions (continued)  
Field  
Description  
4
Time Out Error Flag — This read-only flag indicates the initiator has detected a timeout error. This flag is cleared when the ERRIF  
bit is cleared by writing a 1 to the ERRIF bit.  
TIMEF  
3
Transaction Error Flag — This read-only flag indicates the initiator has detected the error signal during the acknowledge cycle of  
the transaction. This flag is cleared when the ERRIF bit is cleared by writing a 1 to the ERRIF bit.  
TERRF  
2
Parity Error Flag — This read-only flag indicates the initiator has detected a parity error. Parity bits[1:0] contain further information.  
This flag is cleared when the ERRIF bit is cleared by writing a 1 to the ERRIF bit.  
PARF  
1
Parity Bit — P[1] as received by the D2DI  
Parity Bit — P[0] as received by the D2DI  
PAR1  
0
PAR0  
5.41.3.6  
D2DI Status Register 1 (D2DSTAT1)  
This register holds the status of the external interrupt pin and an indicator about the D2DI transaction status.  
Table 504. D2DI Status Register 1 (D2DSTAT1)  
Offset 0x3  
Access: User read  
7
6
5
4
3
2
1
0
R
W
D2DBSY  
0
0
0
0
0
0
D2DIF  
0
Reset  
0
0
0
0
0
0
0
Table 505. D2DSTAT1 Register Field Descriptions  
Field  
Description  
D2D Interrupt Flag — This read-only flag reflects the status of the D2DINT Pin. The D2D interrupt flag can only be cleared by a  
target specific interrupt acknowledge sequence.  
7
0
1
External Interrupt is negated  
External Interrupt is asserted  
D2DIF  
D2D Initiator Busy — This read-only status bit indicates that a D2D transaction is ongoing.  
6
0
1
D2D initiator idle.  
D2DBSY  
D2D initiator transaction ongoing.  
5:0  
Reserved, should be masked to ensure compatibility with future versions of this interface.  
5.41.3.7  
D2DI Address Buffer Register (D2DADR)  
This read-only register contains information about the ongoing D2D interface transaction. The register content will be updated  
when a new transaction starts. In error cases the user can track back, which transaction failed.  
Table 506. D2DI Address Buffer Register (D2DADR)  
Offset 0x4/0x5  
Access: User read  
15  
14  
13  
12  
11  
10  
9
8
7
6
5
4
3
2
1
0
R
W
RWB  
SZ8  
0
NBLK  
0
0
0
0
ADR[7:0]  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Reset  
MM912_634 Advance Information, Rev. 11.0  
330  
Freescale Semiconductor  
Functional Description and Application Information  
Table 507. D2DI Address Buffer Register Bit Descriptions  
Field  
Description  
Transaction Read-Write Direction — This read-only bit reflects the direction of the transaction  
15  
RWB  
0
1
Write Transaction  
Read Transaction  
Transaction Size — This read-only bit reflects the data size of the transaction  
14  
SZ8  
0
1
16-bit transaction.  
8-bit transaction.  
13  
Reserved, should be masked to ensure compatibility with future versions of this interface.  
Transaction Mode — This read-only bit reflects the mode of the transaction  
12  
NBLK  
0
1
Blocking transaction.  
Non-blocking transaction.  
11:8  
Reserved, should be masked to ensure compatibility with future versions of this interface.  
7:0  
Transaction Address — Those read-only bits contain the address of the transaction  
ADR[7:0]  
5.41.3.8  
D2DI Data Buffer Register (D2DDATA)  
This read-only register contains information about the ongoing D2D interface transaction. For a write transaction the data  
becomes valid at the begin of the transaction. For a read transaction the data will be updated during the transaction and is  
finalized when the transaction is acknowledged by the target. In error cases the user can track back what has happened.  
Table 508. D2DI Data Buffer Register (D2DDATA)  
Offset 0x6/0x7  
Access: User read  
15  
14  
13  
12  
11  
10  
9
8
7
6
5
4
3
2
1
0
R
DATA15:0  
W
Reset  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Table 509. D2DI Data Buffer Register Bit Descriptions  
Field  
Description  
15:0  
Transaction Data — Those read-only bits contain the data of the transaction  
DATA  
Both D2DDATA and D2DADR can be read with byte accesses.  
5.41.4  
Functional Description  
Initialization  
5.41.4.1  
Out of reset the interface is disabled. The interface must be initialized by setting the interface clock speed, the time-out value,  
the transfer width and finally enabling the interface. This should be done using a 16-bit write or if using 8-bit write D2DCTL1 must  
be written before D2D2CTL0.D2DEN=1 is written. Once it is enabled in normal modes, only a reset can disable it again  
(write-once feature).  
5.41.4.2  
Transactions  
A transaction on the D2D Interface is triggered by writing to either the 256 byte address window or reading from the address  
window (see STAA/LDAA 0/1 in the next figure). Depending on which address window is used a blocking or a non-blocking  
transaction is performed. The address for the transaction is the 8-bit wide window relative address. The data width of the CPU  
MM912_634 Advance Information, Rev. 11.0  
331  
Freescale Semiconductor  
Functional Description and Application Information  
read or write instructions determines if 8-bit or 16-bit wide data are transferred. There is always only one transaction active.  
Figure 112 shows the various types of transactions explained in more detail below.  
For all 16-bit read/write accesses of the CPU the addresses are assigned according the big-endian model:  
word [15:8]: addr  
word[7:0]: addr+1  
addr: byte-address (8 bit wide) inside the blocking or non-blocking window, as provided by the CPU and transferred to the D2D  
target word: CPU data, to be transferred from/to the D2D target The application must care for the stretched CPU cycles (limited  
by the TIMOUT value, caused by blocking or consecutive accesses), which could affect time limits, including COP (computer  
operates properly) supervision. The stretched CPU cycles cause the “CPU halted” phases (see Figure 112).  
CPU activity  
D2D activity  
STAA 0  
CPU Halted  
LDAA # STAA 1  
CPU Halted  
NOP  
Blocking  
Write  
Write Transaction 0  
Write Transaction 1  
CPU activity  
CPU  
STAA 0 LDAA # STAA 1  
NOP  
Write Transaction 1  
Halted  
Non-Blocking  
Write  
Write Transaction 0  
D2D activity  
CPU activity  
D2D activity  
STAA  
MEM  
LDAA 0  
CPU Halted  
Transaction 0  
Figure 112. Blocking and Non-Blocking Transfers.  
LDAA 1  
CPU Halted  
NOP  
Blocking  
Read  
Transaction 1  
5.41.4.2.1  
Blocking Writes  
When writing to the address window associated with blocking transactions, the CPU is held until the transaction is completed,  
before completing the instruction. Figure 112 shows the behavior of the CPU for a blocking write transaction shown in the  
following example.  
STAA  
LDAA  
STAA  
NOP  
BLK_WINDOW+OFFS0; WRITE0 8-bit as a blocking transaction  
#BYTE1  
BLK_WINDOW+OFFS1 ; WRITE1 is executed after WRITE0 transaction is completed  
Blocking writes should be used when clearing interrupt flags located in the target or other writes which require that the operation  
at the target is completed before proceeding with the CPU instruction stream.  
5.41.4.3  
Non-Blocking Writes  
When writing to the address window associated with non-blocking transactions, the CPU can continue before the transaction is  
completed. However if there was a transaction ongoing when doing the 2nd write the CPU is held until the first one is completed,  
before executing the 2nd one. Figure 112 shows the behavior of the CPU for a blocking write transaction shown in the following  
example.  
STAA  
LDAA  
STAA  
NOP  
NONBLK_WINDOW+OFFS0; write 8-bit as a non blocking transaction  
#BYTE1 ; load next byte  
NONBLK_WINDOW+OFFS1; executed right after the first  
As the figure illustrates non-blocking writes have a performance advantage, but care must be taken that the following instructions  
are not affected by the change in the target caused by the previous transaction.  
MM912_634 Advance Information, Rev. 11.0  
332  
Freescale Semiconductor  
 
Functional Description and Application Information  
5.41.4.4  
Blocking Read  
When reading from the address window associated with blocking transactions, the CPU is held until the data is returned from the  
target, before completing the instruction.Figure 112 shows the behavior of the CPU for a blocking read transaction shown in the  
following example.  
LDAA  
STAA  
LDAA  
BLK_WINDOW+OFFS0; Read 8-bit as a blocking transaction  
MEM ; Store result to local Memory  
BLK_WINDOW+OFFS1; Read 8-bit as a blocking transaction  
5.41.4.5  
Non-Blocking Read  
Read access to the non-blocking window is reserved for future use. When reading from the address window associated with  
non-blocking writes, the read returns an all 0s data byte or word. This behavior can change in future revisions.  
5.41.4.6  
Transfer Width  
8-bit wide writes or reads are translated into 8-bit wide interface transactions. 16-bit wide, aligned writes or reads are translated  
into a16-bit wide interface transactions. 16-bit wide, misaligned writes or reads are split up into two consecutive 8-bit transactions  
with the transaction on the odd address first followed by the transaction on the next higher even address. Due to the much more  
complex error handling (by the MCU), misaligned 16-bit transfers should be avoided.  
5.41.4.7  
Error Conditions and Handling faults  
Since the S12 CPU (as well as the S08) do not provide a method to abort a transfer once started, the D2DI asserts an  
D2DERRINT. The ERRIF Flag is set in the D2DSTAT0 register. Depending on the error condition further error flags will be set as  
described below. The content of the address and data buffers are frozen and all transactions will be replaced by an IDLE  
command, until the error flag is cleared. If an error is detected during the read transaction of a read-modify-write instruction or a  
non-blocking write transaction was followed by another write or read transaction, the second transaction is cancelled. The CNCLF  
is set in the D2DSTAT0 register to indicate that a transaction has been cancelled. The D2DERRINT handler can read the address  
and data buffer register to assess the error situation. Any further transaction will be replaced by IDLE until the ERRIF is cleared.  
5.41.4.7.1  
Missing Acknowledge  
If the target detects a wrong command it will not send back an acknowledge. The same situation occurs if the acknowledge is  
corrupted. The D2DI detects this missing acknowledge after the timeout period configured in the TIMOUT parameter of the  
D2DCTL1 register. In case of a timeout the ERRIF and the TIMEF flags in the D2DSTAT0 register will be set.  
5.41.4.7.2  
Parity error  
In the final acknowledge cycle of a transaction the target sends two parity bits. If this parity does not match the parity calculated  
by the initiator, the ERRIF and the PARF flags in the D2DSTAT0 register will be set. The PAR[1:0] bits contain the parity value  
received by the D2DI.  
5.41.4.7.3  
Error Signal  
During the acknowledge cycle the target can signal a target specific error condition. If the D2DI finds the error signal asserted  
during a transaction, the ERRIF and the TERRF flags in the D2DSTAT0 register will be set.  
5.41.4.8  
Low Power Mode Options  
D2DI in Run Mode  
5.41.4.8.1  
In run mode with the D2D Interface enable (D2DEN) bit in the D2D control register 0 clear, the D2DI system is in a low-power,  
disabled state. D2D registers remain accessible, but clocks to the core of this module are disabled. On D2D lines the GPIO  
function is activated.  
5.41.4.8.2  
D2DI in Stop Mode  
If the CPU enters the STOP mode, any pending transmission is completed. When the D2DCLK output is driven low, clock  
generation is stopped. All internal clocks to the D2DCLK are stopped as well, and the module enters a power saving state.  
MM912_634 Advance Information, Rev. 11.0  
333  
Freescale Semiconductor  
Functional Description and Application Information  
5.41.4.8.3  
Reset  
In case of reset any transaction is immediately stopped and the D2DI module is disabled.  
5.41.4.8.4  
Interrupts  
The D2DI only originates interrupt requests, when D2DI is enabled (D2DIE bit in D2DCTL0 set). There are two different interrupt  
requests from the D2D module. The interrupt vector offset and interrupt priority are chip dependent.  
5.41.4.8.4.1  
D2D External Interrupt  
This is a level sensitive active high external interrupt driven by the D2DINT input. This interrupt is enabled if the D2DIE bit in the  
D2DCTL1 register is set. The interrupt must be cleared using an target specific clearing sequence. The status of the D2D input  
pin can be observed by reading the D2DIF bit in the D2DSTAT1 register.  
The D2DINIT signal is asserted also in the stop mode; it can be used to leave these modes.  
To read data bus (D2DSTAT1.D2DIF)  
D2DINTI  
D2DINT  
D2DIE  
Figure 113. D2D External Interrupt Scheme  
5.41.4.8.4.2  
D2D Error Interrupt  
Those D2D interface specific interrupts are level sensitive and are all cleared by writing a 1 to the ERRIF flag in the D2DSTAT0  
register. This interrupt is not locally maskable and should be tied to the highest possible interrupt level in the system, on an S12  
architecture to the XIRQ. See the chapter “Vectors” of the MCU description for details.  
ACKERF  
CNCLF  
ERRIF  
1
TIMEF  
TERRF  
PARF  
D2DERRINT  
D2DEN  
Figure 114. D2D Internal Interrupts  
5.41.5  
Initialization Information  
During initialization the transfer width, clock divider and timeout value must be set according to the capabilities of the target device  
before starting any transaction. See the D2D Target specification for details.  
5.41.6  
Application Information  
Entering low power mode  
5.41.6.1  
The D2DI module is typically used on a microcontroller along with an analog companion device containing the D2D target  
interface and supplying the power. Interface specification does not provide special wires for signalling low power modes to the  
target device. The CPU should determine when it is time to enter one of the above power modes.The basic flow is as follows:  
1. CPU determines there is no more work pending.  
2. CPU writes a byte to a register on the analog die using blocking write configuring which mode to enter.  
3. Analog die acknowledges that write sending back an acknowledge symbol on the interface.  
MM912_634 Advance Information, Rev. 11.0  
334  
Freescale Semiconductor  
Functional Description and Application Information  
4. CPU executes STOP command.  
5. Analog die can enter low power mode - (S12 needs some more cycles to stack data)  
; Example shows S12 code  
SEI  
; disable interrupts during test  
; check is there is work pending?  
; if yes, branch off and re-enable interrupt  
; else  
LDAA  
STAA  
CLI  
#STOP_ENTRY  
MODE_REG  
; re-enable right before the STOP instruction  
; stack and turn off all clocks inc. interface clock  
; store to the analog die mode reg (use blocking write here)  
STOP  
For wake-up from STOP the basic flow is as follows:  
1. Analog die detects a wake-up condition, e.g. on a switch input or start bit of a LIN message.  
2. Analog die exits Voltage Regulator low power mode.  
3. Analog die asserts the interrupt signal D2DINT.  
4. CPU starts clock generation.  
5. CPU enters interrupt handler routine.  
6. CPU services interrupt and acknowledges the source on the analog die.  
NOTE  
Entering STOP mode with D2DSWAI asserted the clock will complete the high duty cycle  
portion and settle at low level.  
MM912_634 Advance Information, Rev. 11.0  
335  
Freescale Semiconductor  
Packaging  
6
Packaging  
6.1  
Package Dimensions  
For the most current package revision, visit www.freescale.com and perform a keyword search using the “98A” listed below.  
AE SUFFIX  
48-PIN LQFP-EP  
98ASA00173D  
REVISION 0  
MM912_634 Advance Information, Rev. 11.0  
336  
Freescale Semiconductor  
Packaging  
AE SUFFIX  
48-PIN LQFP-EP  
98ASA00173D  
REVISION 0  
MM912_634 Advance Information, Rev. 11.0  
337  
Freescale Semiconductor  
Packaging  
AE SUFFIX  
48-PIN LQFP  
98ASA00173D  
REVISION 0  
MM912_634 Advance Information, Rev. 11.0  
338  
Freescale Semiconductor  
Packaging  
AP SUFFIX  
48-PIN  
98ASH00962A  
REVISION G  
MM912_634 Advance Information, Rev. 11.0  
339  
Freescale Semiconductor  
Packaging  
AP SUFFIX  
48-PIN  
98ASH00962A  
REVISION G  
MM912_634 Advance Information, Rev. 11.0  
340  
Freescale Semiconductor  
Revision History  
7
Revision History  
.
Revision  
Date  
Description  
1.0  
2.0  
11/2010  
4/2011  
Initial release. Preliminary.  
Advance Information release.  
Added a note to the Ordering Information Table defining the addition of R2 to the part number  
Updated the Table 3 part numbering scheme  
3.0  
4.0  
5.0  
5/2011  
5/2011  
9/2011  
Corrected errors in Table 49. ESD and Latch-up Protection Characteristics  
Corrected errors in table 213, MCU IFR Address  
Corrected an address error in table 252.  
Corrected register note in table Table 160.  
Corrected header “Access” in Table 190, Table 191, Table 192, and Table 193.  
Removed section on the MMC Control Register (MMCCTL1), and references to RAMON, IFRON,  
and ROMON bits.  
6.0  
1/2012  
Added to description of pin 46  
Corrected Figure 36.  
7.0  
8.0  
9.0  
3/2012  
11/2012  
12/2012  
Corrected Table 213  
Added P-Flash Protection Register table.  
Added information to D@DCTL1 Register Field Description table.  
Various corrections and adjustments throughout the spec. No change of content.  
Split out and better identified Package Thermal Resistance  
Added voltage definitions in Table 10  
Added note to table 11  
Added comments regarding OpenLoad detection  
Validated current part numbers  
10.0  
11.0  
1/2013  
4/2014  
Update of the FPROT register description  
Updated back page and format links. No change to content.  
MM912_634 Advance Information, Rev. 11.0  
341  
Freescale Semiconductor  
Information in this document is provided solely to enable system and software implementers to use Freescale products.  
There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based  
on the information in this document.  
How to Reach Us:  
Home Page:  
freescale.com  
Web Support:  
freescale.com/support  
Freescale reserves the right to make changes without further notice to any products herein. Freescale makes no  
warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does  
Freescale assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any  
and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be  
provided in Freescale data sheets and/or specifications can and do vary in different applications, and actual performance  
may vary over time. All operating parameters, including “typicals,” must be validated for each customer application by  
customer’s technical experts. Freescale does not convey any license under its patent rights nor the rights of others.  
Freescale sells products pursuant to standard terms and conditions of sale, which can be found at the following address:  
freescale.com/SalesTermsandConditions.  
Freescale, the Freescale logo, and the MagniV logo are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. &  
Tm. Off. SMARTMOS is a trademark of Freescale Semiconductor, Inc. All other product or service names are the  
property of their respective owners.  
© 2010-2014 Freescale Semiconductor, Inc.  
Document Number: MM912_634D1  
Rev. 11.0  
4/2014  

相关型号:

MM912G634CV2AP

Integrated S12 Based Relay Driver with LIN
FREESCALE

MM912G634CV2AP

SPECIALTY ANALOG CIRCUIT, PQFP48, 7 X 7 MM, 1.40 MM HEIGHT, 0.50 MM PITCH, MS-026BBC, LQFP-48
NXP

MM912G634CV2APR2

SPECIALTY ANALOG CIRCUIT, PQFP48, 7 X 7 MM, 1.40 MM HEIGHT, 0.50 MM PITCH, MS-026BBC, LQFP-48
NXP

MM912G634DM1AE

MagniV S12 Relay Driver, 2x HS/ LS, I-sense, 16-bit MCU, 6KB RAM, 48KB Flash, LIN, QFP-EP 48, Tray
NXP

MM912G634DM1AER2

MagniV S12 Relay Driver, 2x HS/ LS, I-sense, 16-bit MCU, 6KB RAM, 48KB Flash, LIN, QFP-EP 48, Reel
NXP

MM912G634DV1AE

MagniV S12 Relay Driver, 2x HS/ LS, I-sense, 16-bit MCU, 6KB RAM, 48KB Flash, LIN, QFP-EP 48, Tray
NXP

MM912G634DV1AER2

MagniV S12 Relay Driver, 2x HS/ LS, I-sense, 16-bit MCU, 6KB RAM, 48KB Flash, LIN, QFP-EP 48, Reel
NXP

MM912G634DV2AP

MagniV S12 Relay Driver, 2x HS/ LS, VReg, 16-bit MCU, 6KB RAM, 48KB Flash, LIN, QFP 48, Tray
NXP

MM912G634DV2APR2

MagniV S12 Relay Driver, 2x HS/ LS, VReg, 16-bit MCU, 6KB RAM, 48KB Flash, LIN, QFP 48, Reel
NXP

MM912H634CM1AE

Integrated S12 Based Relay Driver with LIN
FREESCALE

MM912H634CM1AER2

SPECIALTY ANALOG CIRCUIT, PQFP48, 7 X 7 MM, 1.40 MM HEIGHT, 0.50 MM PITCH, MS-026BBC, LQFP-48
NXP

MM912H634CV1AE

Integrated S12 Based Relay Driver with LIN
FREESCALE