MC9S12C Family
Data Sheet
Also covers
MC9S12GC Family
HCS12
Microcontrollers
MC9S12C Family
Rev. 1.15
7/2005
freescale.com
HCS12
Microcontrollers
MC9S12C Family
also covers
MC9S12GC Family
MC9S12C Family
Rev. 1.15
7/2005
freescale.com
To provide the most up-to-date information, the revision of our documents on the World Wide Web will be
the most current. Your printed copy may be an earlier revision. To verify you have the latest information
available, refer to:
http://freescale.com/
A full list of family members and options is included in the appendices.
The following revision history table summarizes changes contained in this document.
This document contains information for all constituent modules, with the exception of the S12 CPU. For
S12 CPU information please refer to the CPU S12 Reference Manual.
Revision History
Date
June, 200501.14New Book
July, 200501.15
Revision
Level
Removed 16MHz option for 128K, 96K and 64K versions
Minor corrections following review
Description
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
This product incorporates SuperFlash® technology licensed from SST.
The MC9S12C-Family and the MC9S12GC Family are 48/52/80 pin Flash-based industrial/automotive
network control MCU families, which deliver the power and flexibility of the 16-bit core (CPU12) family
to a whole new range of cost and space sensitive, general purpose industrial and automotive network
applications. All MC9S12C-Family and MC9S12GC Family members are comprised of standard on-chip
peripherals including a 16-bit central processing unit (CPU12), up to 128K bytes of Flash EEPROM, up
to 4K bytes of RAM, an asynchronous serial communications interface (SCI), a serial peripheral interface
(SPI), an 8-channel 16-bit timer module (TIM), a 6-channel 8-bit pulse width modulator (PWM), an 8channel, 10-bit analog-to-digital converter (ADC). The MC9S12C-Family members also feature a CAN
2.0 A, B software compatible module (MSCAN12). All family members feature full 16-bit data paths
throughout. The inclusion of a PLL circuit allows power consumption and performance to be adjusted to
suit operational requirements. In addition to the I/O ports availablein each module, up to 10dedicated I/O
port bits are available with wake-up capability from stop or wait mode. The devices are available in 48-,
52-, and 80-pin QFP packages, with the 80-pin version pin compatible to the HCS12 A, B, and D Family
derivatives.
1.1.1Features
•16-bit HCS12 core:
— HCS12 CPU
– Upward compatible with M68HC11 instruction set
– Interrupt stacking and programmer’s model identical to M68HC11
– Instruction queue
– Enhanced indexed addressing
— MMC (memory map and interface)
— INT (interrupt control)
— BDM (background debug mode)
— DBG12 (enhanced debug12 module, including breakpoints and change-of-flow trace buffer)
— MEBI (multiplexed expansion bus interface) available only in 80-pin package version
•Wake-up interrupt inputs:
— Up to 12 port bits available for wake up interrupt function with digital filtering
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor19
Chapter 1 Device Overview
•Memory options:
— 16K or 32Kbyte Flash EEPROM (erasable in 512-byte sectors)
64K, 96K, or 128Kbyte Flash EEPROM (erasable in 1024-byte sectors)
— 1K, 2K, or 4K Byte RAM
•Analog-to-digital converters:
— One 8-channel module with 10-bit resolution
— External conversion trigger capability
•Available on MC9S12C Family:
— One 1M bit per second, CAN 2.0 A, B software compatible module
— Five receive and three transmit buffers
— Flexible identifier filter programmable as 2 x 32 bit, 4 x 16 bit, or 8 x 8 bit
— Four separate interrupt channels for Rx, Tx, error, and wake-up
— Low-pass filter wake-up function
— Loop-back for self test operation
•Timer module (TIM):
— 8-channel timer
— Each channel configurable as either input capture or output compare
— Simple PWM mode
— Modulo reset of timer counter
— 16-bit pulse accumulator
— External event counting
— Gated time accumulation
•PWM module:
— Programmable period and duty cycle
— 8-bit 6-channel or 16-bit 3-channel
— Separate control for each pulse width and duty cycle
— Center-aligned or left-aligned outputs
— Programmable clock select logic with a wide range of frequencies
— Fast emergency shutdown input
•Serial interfaces:
— One asynchronous serial communications interface (SCI)
— One synchronous serial peripheral interface (SPI)
— Real time interrupt
— Clock monitor
— Pierce or low current Colpitts oscillator
— Phase-locked loop clock frequency multiplier
— Limp home mode in absence of external clock
— Low power 0.5MHz to 16MHz crystal oscillator reference clock
MC9S12C128 Data Sheet, Rev. 1.15
20Freescale Semiconductor
•Operating frequency:
— 32MHz equivalent to 16MHz bus speed for single chip
— 32MHz equivalent to 16MHz bus speed in expanded bus modes
— Option of 9S12C Family: 50MHz equivalent to 25MHz bus speed
— All 9S12GC Family members allow a 50MHz operating frequency.
•Internal 2.5V regulator:
— Supports an input voltage range from 2.97V to 5.5V
— Low power mode capability
— Includes low voltage reset (LVR) circuitry
— Includes low voltage interrupt (LVI) circuitry
•48-pin LQFP, 52-pin LQFP, or 80-pin QFP package:
— Up to 58 I/O lines with 5V input and drive capability (80-pin package)
— Up to 2 dedicated 5V input only lines (IRQ, XIRQ)
— 5V 8 A/D converter inputs and 5V I/O
The partID is located intwo 8-bit registersPARTIDH and PARTIDL (addresses0x001A and ox001B after
reset). The read-only value is a unique part ID for each revision of the chip. Table 1-3 shows the assigned
part ID numbers for production mask sets.
1. The coding is as follows:
Bit 15–12: Major family identifier
Bit 11–8: Minor family identifier
Bit 7–4: Major mask set revision number including FAB transfers
Bit 3–0: Minor — non full — mask set revision
(1)
The device memory sizes are located in two 8-bit registers MEMSIZ0 and MEMSIZ1 (addresses 0x001C
and 0x001D after reset). Table 1-4 showsthe read-only values of theseregisters. Refer to Module Mapping
and Control (MMC) Block Guide for further details.
Signals shown in Bold are not available on the 52- or 48-pin package
Signals shown in Bold Italic are available in the 52-pin, but not the 48-pin package
Figure 1-7. Pin Assignments in 80-Pin QFP
MC9S12C128 Data Sheet, Rev. 1.15
48Freescale Semiconductor
Chapter 1 Device Overview
PW3/KWP3/PP3
PW0/IOC0/PT0
PW1/IOC1/PT1
PW2/IOC2/PT2
PW3/IOC3/PT3
V
DD1
V
SS1
PW4/IOC4/PT4
IOC5/PT5
IOC6/PT6
IOC7/PT7
MODC/BKGD
PB4
PP4/KWP4/PW4
PP5/KWP5/PW5
52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
ECLK/PE4
XCLKS/PE7
51
15
DDXVSSX
V
50
49
MC9S12C-Family
MC9S12GC Family
16
17
SSR
DDR
V
V
PM0/RXCAN
PM1/TXCAN
PM2/MISO
48
47
46
18
19
20
XFC
DDPLL
V
RESET
PM3/SS
45
21
SSPLL
V
PM4/MOSI
PM5/SCK
44
43
22
23
XTAL
EXTAL
PS1/TXD
PS0/RXD
42
41
24
25
PP
IRQ/PE1
TEST/V
SSA
V
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
XIRQ/PE0
V
RH
V
DDA
PAD07/AN07
PAD06/AN06
PAD05/AN05
PAD04/AN04
PAD03/AN03
PAD02/AN02
PAD01/AN01
PAD00/AN00
PA 2
PA 1
PA 0
* Signals shown in Bold italic are not available on the 48-pin package
Figure 1-8. Pin Assignments in 52-Pin LQFP
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor49
Chapter 1 Device Overview
PW0/IOC0/PT0
PW1/IOC1/PT1
PW2/IOC2/PT2
PW3/IOC3/PT3
V
DD1
V
SS1
PW4/IOC4/PT4
IOC5/PT5
IOC6/PT6
IOC7/PT7
MODC/BKGD
PB4
PP5/KWP5/PW5
V
48
1
47
2
3
4
5
6
7
8
9
10
11
12
13
14
ECLK/PE4
XCLKS/PE7
DDXVSSX
46
15
SSR
V
PM0/RXCAN
PM1/TXCAN
PM2/MISO
PM3/SS
45
44
43
42
MC9S12C-Family
MC9S12GC Family
16
17
18
19
DDR
V
RESET
DDPLL
V
XFC
PM4/MOSI
PM5/SCK
41
40
20
21
SSPLL
EXTAL
V
PS1/TXD
PS0/RXD
39
38
22
23
PP
XTAL
TEST/V
SSA
V
37
36
35
34
33
32
31
30
29
28
27
26
25
24
IRQ/PE1
V
RH
V
DDA
PAD07/AN07
PAD06/AN06
PAD05/AN05
PAD04/AN04
PAD03/AN03
PAD02/AN02
PAD01/AN01
PAD00/AN00
PA 0
XIRQ/PE0
Figure 1-9. Pin Assignments in 48-Pin LQFP
MC9S12C128 Data Sheet, Rev. 1.15
50Freescale Semiconductor
1.3.2Signal Properties Summary
Table 1-5. Signal Properties
Pin Name
Function 1
EXTAL——V
XTAL——V
RESET——V
XFC——V
TESTV
BKGDMODCTAGHIV
PE7NOACC
PE6IPIPE1MODBV
PE5IPIPE0MODAV
PE4ECLK—V
PE3LSTRBTAGLOV
PE2R/
PE1
PE0
PA[7:3]
PA[2:1]
PA[0]
PB[7:5]
PB[4]
PB[3:0]
PAD[7:0]AN[7:0]—V
PP[7]KWP[7]—V
PP[6]KWP[6]ROMCTLV
PP[5]KWP[5]PW5V
PP[4:3]KWP[4:3]PW[4:3]V
Pin Name
Function 2
PP
Pin Name
Function 3
—V
Domain
XCLKSV
W—V
IRQ—V
XIRQ—V
ADDR[15:1/
DATA[15:1]
ADDR[10:9/
DATA[10:9]
ADDR[8]/
DATA[8]
ADDR[7:5]/
DATA[7:5]
ADDR[4]/
DATA[4]
ADDR[3:0]/
DATA[3:0]
—V
—V
—V
—V
—V
—V
Power
DDPLL
DDPLL
DDX
DDPLL
SSX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDA
DDX
DDX
DDX
DDX
CTRL
NANAOscillator pins
NANA
NoneNoneExternal reset pin
NANAPLL loop filter pin
NANATest pin only
UpUpBackground debug, mode pin, tag signal high
PUCRUpPort E I/O pin, access, clock select
pin is low: Down
pin is low: Down
PUCR
PUCR
PUCR
PUCRUpPort E input, external interrupt pin
PUCRUpPort E input, non-maskable interrupt pin
PUCRDisabled
PUCRDisabled
PUCRDisabled
PUCRDisabled
PUCRDisabled
PUCRDisabled
PERAD/P
PSAD
PERP/
PPSP
PERP/
PPSP
PERP/
PPSP
PERP/
PPSP
Internal Pull
Resistor
Reset
State
While RESET
While RESET
Mode
Dep
Mode
Dep
Mode
Dep
Disabled
Disabled
Disabled
Disabled
Disabled
Chapter 1 Device Overview
Description
Port E I/O pin and pipe status
Port E I/O pin and pipe status
Port E I/O pin, bus clock output
(1)
Port E I/O pin, low strobe, tag signal low
1
Port E I/O pin, R/W in expanded modes
1
Port A I/O pin and multiplexed address/data
Port A I/O pin and multiplexed address/data
Port A I/O pin and multiplexed address/data
Port B I/O pin and multiplexed address/data
Port B I/O pin and multiplexed address/data
Port B I/O pin and multiplexed address/data
Port AD I/O pins and ATD inputs
Port P I/O pins and keypad wake-up
Port P I/O pins, keypad wake-up, and ROMON
enable.
Port P I/O pin, keypad wake-up, PW5 output
Port P I/O pin, keypad wake-up, PWM output
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor51
Chapter 1 Device Overview
Table 1-5. Signal Properties (continued)
Internal Pull
Pin Name
Function 1
PP[2:0]KWP[2:0]PW[2:0]V
PJ[7:6]KWJ[7:6]—V
PM5SCK—V
PM4MOSI—V
PM3SS—V
PM2MISO—V
PM1TXCAN—V
PM0RXCAN—V
PS[3:2]——V
PS1TXD—V
PS0RXD—V
PT[7:5]IOC[7:5]—V
PT[4:0]IOC[4:0]PW[4:0]V
1. The Port E output buffer enable signal control at reset is determined by the PEAR register and is mode dependent. For
example, in special test mode RDWE= LSTRE = 1 which enables the PE[3:2] output buffersand disables the pull-ups. Refer
to S12_MEBI user guide for PEAR register details.
2. CAN functionality is not available on the MC9S12GC Family members.
Pin Name
Function 2
Pin Name
Function 3
Power
Domain
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
Resistor
CTRL
PERP/
PPSP
PERJ/
PPSJ
PERM/
PPSM
PERM/
PPSM
PERM/
PPSM
PERM/
PPSM
PERM/
PPSM
PERM/
PPSM
PERS/
PPSS
PERS/
PPSS
PERS/
PPSS
PERT/
PPST
PERT/
PPST
Reset
State
Disabled
Disabled
Up
Up
Up
Up
Up
Up
Up
Up
Up
Disabled
Disabled
Description
Port P I/O pins, keypad wake-up, PWM outputs
Port J I/O pins and keypad wake-up
Port M I/O pin and SPI SCK signal
Port M I/O pin and SPI MOSI signal
Port M I/O pin and SPI SS signal
Port M I/O pin and SPI MISO signal
Port M I/O pin and CAN transmit signal
Port M I/O pin and CAN receive signal
Port S I/O pins
Port S I/O pin and SCI transmit signal
Port S I/O pin and SCI receive signal
Port T I/O pins shared with timer (TIM)
Port T I/O pins shared with timer and PWM
(2)
2
1.3.3Pin Initialization for 48- and 52-Pin LQFP Bond Out Versions
Not Bonded Pins:
If the port pins are not bonded out in the chosen package the user should initialize the registers to
be inputs with enabled pull resistance to avoid excess current consumption. This applies to the
following pins:
(48LQFP): Port A[7:1], Port B[7:5], Port B[3:0], PortE[6,5,3,2], Port P[7:6], PortP[4:0], Port
J[7:6], PortS[3:2]
(52LQFP): Port A[7:3], Port B[7:5], Port B[3:0], PortE[6,5,3,2], Port P[7:6], PortP[2:0], Port
J[7:6], PortS[3:2]
MC9S12C128 Data Sheet, Rev. 1.15
52Freescale Semiconductor
Chapter 1 Device Overview
1.3.4Detailed Signal Descriptions
1.3.4.1EXTAL, XTAL — Oscillator Pins
EXTAL and XTAL are the crystal driver and external clock pins. On reset all the deviceclocks are derived
from the EXTAL input frequency. XTAL is the crystal output.
1.3.4.2RESET — External Reset Pin
RESET is an activelow bidirectional control signal that acts as an input to initialize the MCU to a known
start-up state. It also acts as an open-drain output to indicate that an internal failure has been detected in
either the clock monitor or COP watchdog circuit. External circuitry connected to the
not include a largecapacitance that would interfere with the ability of this signal to rise to a validlogic one
within 32 ECLK cycles after the low drive is released. Upon detection of any reset, an internal circuit
drives the
RESET pin low and a clocked reset sequence controls when the MCU can begin normal
processing.
1.3.4.3TEST / VPP — Test Pin
This pin is reserved for test and must be tied to VSS in all applications.
RESET pin should
1.3.4.4XFC — PLL Loop Filter Pin
Dedicated pin used to create the PLL loop filter. See CRG BUG for more detailed information.PLL loop
filter. Please ask your Freescale representative for the interactive application note to compute PLL loop
filter elements. Any current leakage on this pin must be avoided.
XFC
R
0
MCU
Figure 1-10. PLL Loop Filter Connections
V
DDPLL
C
S
V
DDPLL
C
P
1.3.4.5BKGD / TAGHI / MODC — Background Debug, Tag High, and Mode Pin
The BKGD / TAGHI / MODC pin is used as a pseudo-open-drain pin for the background debug
communication. In MCU expanded modes of operation when instruction tagging is on, an input low on
this pin during the falling edge of E-clock tags the high half of the instruction word being read into the
instruction queue. It is also used as a MCU operating mode select pin at the rising edge during reset, when
the state of this pin is latched to the MODC bit.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor53
Chapter 1 Device Overview
1.3.4.6PA[7:0] / ADDR[15:8] / DATA[15:8] — Port A I/O Pins
PA7–PA0 are general purpose input or output pins,. In MCU expanded modes of operation, these pins are
used for the multiplexedexternal address and data bus.PA[7:1]pins arenot availablein the 48-pinpackage
version. PA[7:3] are not available in the 52-pin package version.
1.3.4.7PB[7:0] / ADDR[7:0] / DATA[7:0] — Port B I/O Pins
PB7–PB0 are general purpose input or output pins. In MCU expanded modes of operation, these pins are
used for the multiplexed external address and data bus. PB[7:5] and PB[3:0] pins are not available in the
48-pin nor 52-pin package version.
1.3.4.8PE7 / NOACC / XCLKS — Port E I/O Pin 7
PE7 is a general purpose input or output pin. During MCU expanded modes of operation, the NOACC
signal, when enabled, is used to indicate that the current buscycle is an unused or “free” cycle. This signal
will assert when the CPU is not using the bus.The
crystal in combination with the internal Colpitts (low power) oscillator is used or whether Pierce
oscillator/external clock circuitry is used. The state of this pin is latched at the rising edge of
the input is a logic low the EXTAL pin is configured for an external clock drive or a Pierce oscillator. If
input is a logic high a Colpitts oscillator circuit is configured on EXTAL and XTAL. Since this pin is an
input with a pull-up device during reset, if the pin is left floating, the default configuration is a Colpitts
oscillator circuit on EXTAL and XTAL.
XCLKS is an input signal which controls whether a
RESET. If
EXTAL
1
CDC
MCU
XTAL
1. Due to the nature of a translated ground Colpitts oscillator a DC voltage
bias is applied to the crystal. Please contact the crystal manufacturer for
crystal DC.
PE6 is a general purpose input or output pin. It is used as a MCU operating mode select pin during reset.
The state of this pin is latched to the MODB bit at the rising edge of
RESET. This pin is shared with the
instruction queue tracking signal IPIPE1. This pin is an input with a pull-down devicewhich is only active
RESET is low. PE[6] is not available in the 48- / 52-pin package versions.
when
1.3.4.10PE5 / MODA / IPIPE0 — Port E I/O Pin 5
PE5 is a general purpose input or output pin. It is used as a MCU operating mode select pin during reset.
The state of this pin is latched to the MODA bit at the rising edge of
instruction queue tracking signal IPIPE0. This pin is an input with a pull-down devicewhich is only active
RESET is low. This pin is not available in the 48- / 52-pin package versions.
when
RESET. This pin is shared with the
1.3.4.11PE4 / ECLK— Port E I/O Pin [4] / E-Clock Output
ECLK is the output connection for the internal bus clock. It is used to demultiplex the address and data in
expanded modes and is used as a timing reference. ECLK frequency is equal to 1/2 the crystal frequency
out of reset. The ECLK pin is initially configured as ECLK output with stretch in all expanded modes. The
E clock output function depends upon the settings of the NECLK bit in the PEAR register, the IVIS bit in
the MODE register and the ESTR bit in the EBICTL register. All clocks, including the E clock, are halted
when the MCU is in stop mode. It is possible to configure the MCU to interface to slowexternal memory.
ECLK can be stretched for such accesses. Reference the MISC register (EXSTR[1:0] bits) for more
information. In normal expanded narrow mode, the E clock is available for use in external select decode
logic or as a constant speed clock for use in the external application system. AlternativelyPE4 can be used
as a general purpose input or output pin.
1.3.4.12PE3 / LSTRB — Port E I/O Pin [3] / Low-Byte Strobe (LSTRB)
In all modes this pin can be used as a general-purpose I/O and is an input with an active pull-up out of
reset. Ifthe strobe function is required, it should be enabled by settingthe LSTRE bit in the PEAR register.
This signal is used in write operations. Therefore external low byte writes will not be possible until this
function is enabled. This pin is also used as
LSTRB function. This pin is not available in the 48- / 52-pin package versions.
the
TAGLO in special expanded modes and is multiplexed with
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor55
Chapter 1 Device Overview
1.3.4.13PE2 / R/W — Port E I/O Pin [2] / Read/Write
In all modes this pin can be used as a general-purpose I/O and is an input with an active pull-up out of
reset. If the read/write function is required it should be enabled by setting the RDWE bit in the PEAR
register. External writes will not be possible until enabled. This pin is not available in the 48- / 52-pin
package versions.
1.3.4.14PE1 / IRQ — Port E Input Pin [1] / Maskable Interrupt Pin
The IRQ input provides a means of applying asynchronous interrupt requests to the MCU. Either falling
edge-sensitive triggering or level-sensitive triggering is program selectable (INTCR register).
IRQ is
always enabled and configured to level-sensitive triggering out of reset. It can be disabled by clearing
IRQEN bit (INTCR register). When the MCU is reset the
IRQ function is masked in the condition code
register. This pin is always an input and can always be read. There is an active pull-up on this pin while in
reset and immediately out of reset. The pull-up can be turned off by clearing PUPEE in the PUCR register.
1.3.4.15PE0 / XIRQ — Port E input Pin [0] / Non Maskable Interrupt Pin
The XIRQ input provides a means of requesting a non-maskable interrupt after reset initialization. During
reset, the X bit in the condition code register (CCR) is set and any interrupt is masked until MCU software
enables it. Because the
network. This pin is always an input and can always be read. There is an active pull-up on this pin while
in reset and immediately out of reset. The pull-up can be turned off by clearing PUPEE in the PUCR
register.
XIRQ input is level sensitive, it can be connected to a multiple-source wired-OR
1.3.4.16PAD[7:0] / AN[7:0] — Port AD I/O Pins [7:0]
PAD7–PAD0 are general purpose I/O pins and also analog inputs for the analog to digital converter. In
order to use a PAD pin as a standard input, the corresponding ATDDIEN register bit must be set. These
bits are cleared out of reset to configure the PAD pins for A/D operation.
When the A/D converter is active in multi-channel mode, port inputs are scanned and converted
irrespective of Port AD configuration. Thus Port AD pins that are configured as digital inputs or digital
outputs are also converted in the A/D conversion sequence.
1.3.4.17PP[7] / KWP[7] — Port P I/O Pin [7]
PP7 is a general purpose input or output pin, shared with the keypad interrupt function. When configured
as an input, it can generate interrupts causing the MCU to exit stop or wait mode. This pin is not available
in the 48- / 52-pin package versions.
1.3.4.18PP[6] / KWP[6]/ROMCTL — Port P I/O Pin [6]
PP6 is a general purpose input or output pin, shared with the keypad interrupt function. When configured
as an input, it can generate interrupts causing the MCU to exit stop or wait mode. This pin is not available
in the 48- / 52-pin package versions. During MCU expanded modes of operation, this pin is used to enable
MC9S12C128 Data Sheet, Rev. 1.15
56Freescale Semiconductor
Chapter 1 Device Overview
the Flash EEPROM memory in the memory map (ROMCTL). At the rising edge of RESET, the state of
this pin is latched to the ROMON bit.
•PP6 = 1 in emulation modes equates to ROMON = 0 (ROM space externally mapped)
•PP6 = 0 in expanded modes equates to ROMON = 0 (ROM space externally mapped)
1.3.4.19PP[5:0] / KWP[5:0] / PW[5:0] — Port P I/O Pins [5:0]
PP[5:0] are general purpose input or output pins, shared with the keypad interrupt function. When
configured as inputs, they can generate interrupts causing the MCU to exit stop or wait mode.
PP[5:0] are also shared with the PWM output signals, PW[5:0]. Pins PP[2:0] are only available in the 80pin package version. Pins PP[4:3] are not available in the 48-pin package version.
1.3.4.20PJ[7:6] / KWJ[7:6] — Port J I/O Pins [7:6]
PJ[7:6] are general purpose input or output pins, shared with the keypad interrupt function. When
configured as inputs, they can generate interrupts causing the MCU to exit stop or wait mode. These pins
are not available in the 48-pin package version nor in the 52-pin package version.
1.3.4.21PM5 / SCK — Port M I/O Pin 5
PM5 is a general purpose input or output pin and also the serial clock pin SCK for the serial peripheral
interface (SPI).
1.3.4.22PM4 / MOSI — Port M I/O Pin 4
PM4 is a general purpose input or output pin and also the master output (during master mode) or slave
input (during slave mode) pin for the serial peripheral interface (SPI).
1.3.4.23PM3 / SS — Port M I/O Pin 3
PM3 is a general purpose input or output pin and also the slave select pin SS for the serial peripheral
interface (SPI).
1.3.4.24PM2 / MISO — Port M I/O Pin 2
PM2 is a general purpose input or output pin and also the master input (during master mode) or slave
output (during slave mode) pin for the serial peripheral interface (SPI).
1.3.4.25PM1 / TXCAN — Port M I/O Pin 1
PM1 is a general purpose input or output pin and the transmit pin, TXCAN, of the CAN module if
available.
1.3.4.26PM0 / RXCAN — Port M I/O Pin 0
PM0 is a general purpose input or output pinand the receivepin, RXCAN, of the CAN module if available.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor57
Chapter 1 Device Overview
1.3.4.27PS[3:2] — Port S I/O Pins [3:2]
PS3 and PS2 are general purpose input or output pins. These pins are not available in the 48- / 52-pin
package versions.
1.3.4.28PS1 / TXD — Port S I/O Pin 1
PS1 is a general purpose input or output pin and the transmit pin, TXD, of serial communication interface
(SCI).
1.3.4.29PS0 / RXD — Port S I/O Pin 0
PS0 is a general purpose input or output pin and the receive pin, RXD, of serial communication interface
(SCI).
1.3.4.30PPT[7:5] / IOC[7:5] — Port T I/O Pins [7:5]
PT7–PT5 are general purpose input or output pins. They can also be configured as the timer system input
capture or output compare pins IOC7-IOC5.
1.3.4.31PT[4:0] / IOC[4:0] / PW[4:0]— Port T I/O Pins [4:0]
PT4–PT0 are general purpose input or output pins. They can also be configured as the timer system input
capture or output compare pins IOC[n] or as the PWM outputs PW[n].
1.3.5Power Supply Pins
1.3.5.1V
DDX,VSSX
External powerand ground for I/O drivers.Bypass requirements depend on how heavily the MCUpins are
loaded.
1.3.5.2V
DDR
, V
Voltage Regulator
External power and ground for the internal voltage regulator. Connecting V
internal voltage regulator.
1.3.5.3V
Poweris supplied to theMCU through VDDand VSS. This2.5V supply is derivedfrom the internalvoltage
regulator.There isno static loadon those pins allowed.The internal voltageregulatoris turned off,if V
is tied to ground.
DD1
, V
— Power and Ground Pins for I/O Drivers
— Power and Ground Pins for I/O Drivers and for Internal
SSR
to ground disables the
DDR
DD2
, V
SS1
, V
— Internal Logic Power Pins
SS2
DDR
MC9S12C128 Data Sheet, Rev. 1.15
58Freescale Semiconductor
Chapter 1 Device Overview
1.3.5.4V
V
DDA,VSSA
are the powersupply and ground input pins for the voltage regulator reference and the analog
DDA
, V
— Power Supply Pins for ATD and VREG
SSA
to digital converter.
1.3.5.5VRH, VRL — ATD Reference Voltage Input Pins
VRH and VRL are the reference voltage input pins for the analog to digital converter.
1.3.5.6V
DDPLL
Provides operating voltage and ground for the oscillator and the phased-locked loop. This allows the
supply voltage to the oscillator and PLL to be bypassed independently. This 2.5V voltage is generated by
the internal voltage regulator.
Mnemonic
V
, V
DD1
DD2
V
, V
SS1
SS2
V
DDR
V
SSR
V
DDX
V
SSX
V
DDA
V
SSA
V
RH
V
RL
V
DDPLL
V
SSPLL
Nominal
Voltage (V)
, V
SSPLL
— Power Supply Pins for PLL
Table 1-6. Power and Ground Connection Summary
Description
2.5Internal power and ground generated by internal regulator. These also allow an external source
0
5.0External power and ground, supply to internal voltage regulator.
0
5.0External power and ground, supply to pin drivers.
0
5.0Operating voltage and ground for the analog-to-digital converters and the reference for the
0
5.0Reference voltage low for the ATD converter.
0
2.5Providesoperatingvoltage and groundforthe phased-locked loop. This allowsthe supply voltage
0
to supply the core V
In the 48 and 52 LQFP packages V
internal voltage regulator, allows the supply voltage to the A/D to be bypassed independently.
In the 48 and 52 LQFP packages V
to the PLL to be bypassed independently. Internal power and ground generated by internal
regulator.
voltages and bypass the internal voltage regulator.
DD/VSS
and V
DD2
is bonded to V
RL
are not available.
SS2
.
SSA
NOTE
All V
pins must be connected together in the application. Because fast
SS
signal transitions place high, short-duration current demands on the power
supply, use bypass capacitors with high-frequency characteristics and place
them as close to the MCU as possible. Bypass requirements depend on
MCU pin load.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor59
Chapter 1 Device Overview
1.4System Clock Description
The clock and reset generator provides the internal clock signals for the core and all peripheral modules.
Figure 1-14 shows the clock connections from the CRG to all modules. Consult the CRG Block User
Guide for details on clock generation.
EXTAL
XTAL
CRG
Core Clock
Bus Clock
Oscillator Clock
Figure 1-14. Clock Connections
S12_CORE
Flash
RAM
TIM
ATD
PIM
SCI
SPI
MSCAN
Not on 9S12GC
VREG
TPM
1.5Modes of Operation
Eight possible modes determine the device operating configuration. Each mode has an associated default
memory map and external bus configuration controlled by a further pin.
Three low power modes exist for the device.
1.5.1Chip Configuration Summary
The operating mode out ofreset is determined bythe states ofthe MODC, MODB, andMODA pins during
reset. The MODC, MODB, and MODA bits in the MODE register show the current operating mode and
provide limited mode switching during operation. The states of the MODC, MODB, and MODA pins are
latched into these bits on the rising edge of the reset signal. The ROMCTL signal allows the setting of the
ROMONbit in the MISC register thus controlling whether the internal Flash is visible in the memory map.
ROMON = 1 mean the Flash is visible in the memory map. The state of the ROMCTL pin is latched into
the ROMON bit in the MISC register on the rising edge of the reset signal.
MC9S12C128 Data Sheet, Rev. 1.15
60Freescale Semiconductor
Table 1-7. Mode Selection
Chapter 1 Device Overview
BKGD =
MODC
000 X 1
001
010X0Special Test (Expanded Wide), BDM allowed
011
100X1Normal Single Chip, BDM allowed
101
110 X 1
111
PE6 =
MODB
PE5 =
MODA
PP6 =
ROMCTL
01Emulation Expanded Narrow, BDM allowed
10
01Emulation Expanded Wide, BDM allowed
10
00Normal Expanded Narrow, BDM allowed
11
00Normal Expanded Wide, BDM allowed
11
ROMON
Bit
Mode Description
Special Single Chip, BDM allowed and ACTIVE. BDM is allowed in
all other modes but a serial command is required to make BDM
active.
Peripheral; BDM allowed but bus operations would cause bus
conflicts (must not be used)
For further explanation on the modes refer to the S12_MEBI block guide.
The device will make available a security feature preventing the unauthorized read and write of the
memory contents. This feature allows:
•Protection of the contents of FLASH,
•Operation in single-chip mode,
•Operation from external memory with internal FLASH disabled.
The user must be reminded that part of the security must lie with the user’s code. An extreme example
would be user’scode that dumps the contents of the internal program. This code would defeat the purpose
of security. At the same time the user may also wish to put a back door in the user’sprogram. An example
of this is the user downloads a key through the SCI which allows access to a programming routine that
updates parameters.
1.5.2.1Securing the Microcontroller
Once the user has programmed the FLASH, the part can be secured by programming the security bits
located in the FLASH module. These non-volatile bits will keep the part secured through resetting the part
and through powering down the part.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor61
Chapter 1 Device Overview
The security byte resides in a portion of the Flash array.
Check the Flash Block User Guide for more details on the security configuration.
1.5.2.2Operation of the Secured Microcontroller
1.5.2.2.1Normal Single Chip Mode
This will bethe most common usage of the secured part.Everything will appear the same as if the part was
not secured with the exception of BDM operation. The BDM operation will be blocked.
1.5.2.2.2Executing from External Memory
The user may wish to execute from external space with a secured microcontroller. This is accomplished
by resetting directly into expanded mode. The internal FLASH will be disabled. BDM operations will be
blocked.
1.5.2.3Unsecuring the Microcontroller
In order to unsecure the microcontroller, the internal FLASH must be erased. This can be done through an
externalprogram in expanded mode or via a sequence of BDM commands. Unsecuring is also possible via
the Backdoor Key Access. Refer to Flash Block Guide for details.
Once the user has erased the FLASH, the part can be reset into special single chip mode. This invokes a
program that verifies the erasure of the internal FLASH. Once this program completes, the user can erase
and program the FLASH security bits to the unsecured state. This is generally done through the BDM, but
the user could also change to expanded mode (by writing the mode bits through the BDM) and jumping to
an external program (again through BDM commands). Note that if the part goes through a reset before the
security bits are reprogrammed to the unsecure state, the part will be secured again.
1.5.3Low-Power Modes
The microcontroller features three main low power modes. Consult the respective Block User Guide for
information on the module behavior in stop, pseudo stop, and wait mode. An important source of
information about the clock system is the Clock and Reset Generator User Guide (CRG).
1.5.3.1Stop
Executing the CPU STOP instruction stops all clocks and the oscillator thus putting the chip in fully static
mode. Wake up from this mode can be done via reset or external interrupts.
1.5.3.2Pseudo Stop
This mode is entered by executing the CPU STOP instruction. In this mode the oscillator is still running
and the real time interrupt (RTI) or watchdog (COP) sub module can stay active. Other peripherals are
turned off.This mode consumes more current than thefull stop mode, butthe wakeup time from thismode
is significantly shorter.
MC9S12C128 Data Sheet, Rev. 1.15
62Freescale Semiconductor
Chapter 1 Device Overview
1.5.3.3Wait
This mode is entered by executing the CPU WAI instruction. In this mode the CPU will not execute
instructions. The internal CPU signals (address and data bus) will be fully static. All peripherals stay
active.For further power consumption reduction the peripherals can individuallyturn off theirlocal clocks.
1.5.3.4Run
Although this is not a low-power mode, unused peripheral modules should not be enabled in order to save
power.
1.6Resets and Interrupts
Consult the Exception Processing section of the CPU12 Reference Manual for information.
1.6.1Vectors
Table 1-9 lists interrupt sources and vectors in default order of priority.
Resets are a subset of the interrupts featured in Table 1-9. The different sources capable of generating a
system reset are summarized in Table 1-10. When a reset occurs, MCU registers and control bits are
changed to known start-up states. Refer to the respective module Block User Guides for register reset
states.
1.6.2.1Reset Summary Table
Table 1-10. Reset Summary
ResetPrioritySourceVector
Power-on Reset1CRG module0xFFFE, 0xFFFF
External Reset1
Low Voltage Reset1VREG module0xFFFE, 0xFFFF
Clock Monitor Reset2CRG module0xFFFC, 0xFFFD
COP Watchdog Reset3CRG module0xFFFA, 0xFFFB
1.6.2.2Effects of Reset
When a reset occurs, MCU registers and control bits are changed to known start-up states. Refer to the
respective module Block User Guides for register reset states. Refer to the HCS12 Multiplexed External
Bus Interface (MEBI) Block Guide for mode dependent pin configuration of port A, B and E out of reset.
RESET pin0xFFFE, 0xFFFF
Refer to the PIM Block User Guide for reset configurations of all peripheral module ports.
Refer to Figure 1-2to Figure 1-6footnotes for locations of the memoriesdepending on theoperating mode
after reset.
The RAM array is not automatically initialized out of reset.
NOTE
For devices assembled in 48-pin or 52-pin LQFP packages all non-bonded
out pins should be configured as outputs after reset in order to avoid current
drawn from floating inputs. Refer to Table 1-5 for affected pins.
1.7Device Specific Information and Module Dependencies
1.7.1PPAGE
External paging is not supported on these devices. In order to access the 16K flash blocks in the address
range 0x8000–0xBFFF the PPAGE register must be loaded with the corresponding value for this range.
Refer to Table 1-11 for device specific page mapping.
For all devices Flash Page 3F is visible in the 0xC000–0xFFFF range if ROMON is set. For all devices
(except MC9S12GC16) Page 3E is also visible in the 0x4000–0x7FFF range if ROMHM is cleared and
ROMON is set. For all devices apart from MC9S12C32 Flash Page 3D is visible in the 0x0000–0x3FFF
range if ROMON is set...
The BDM section reference to alternate clock is equivalent to the oscillator clock.
1.7.3Extended Address Range Emulation Implications
In order to emulate the MC9S12GC or MC9S12C-Familydevices, external addressing of a 128K memory
map is required. This is provided in a 112 LQFP package version which includes the 3 necessary extra
external address bus signals via PortK[2:0]. This package version is for emulation only and not provided
as a general production package.
The reset state of DDRK is 0x0000, configuring the pins as inputs.
The reset state of PUPKE in the PUCR register is “1” enabling the internal Port K pullups.
In this reset state the pull-ups provide a defined state and prevent a floating input, thereby preventing
unnecessary current flow at the input stage.
To prevent unnecessary current flow in production package options, the states of DDRK and PUPKE
should not be changed by software.
MC9S12C128 Data Sheet, Rev. 1.15
66Freescale Semiconductor
1.7.4VREGEN
Chapter 1 Device Overview
The VREGEN input mentioned in the VREG section is device internal, connected internally to V
1.7.5V
DD1
, V
DD2
, V
SS1
, V
SS2
DDR
.
In the 80-pin QFP package versions, both internal VDDand VSSof the 2.5V domain are bonded out on 2
sides of the device as two pin pairs (V
internally. V
SS1
and V
are connected together internally. The extra pin pair enables systems using the
SS2
DD1,VSS1
&V
DD2,VSS2
). V
DD1
and V
are connected together
DD2
80-pin package to employ better supply routing and further decoupling.
1.7.6Clock Reset Generator And VREG Interface
The low voltage reset feature uses the low voltage reset signal from the VREG module as an input to the
CRG module. When the regulator output voltage supply to the internal chip logic falls below a specified
threshold the LVR signal from the VREG module causes the CRG module to generate a reset.
NOTE
If thevoltage regulator isshut down by connecting V
to groundthen the
DDR
LVRF flag in the CRG flags register (CRGFLG) is undefined.
1.7.7Analog-to-Digital Converter
In the 48- and 52-pin package versions, the VRL pad is bonded internally to the V
SSA
pin.
1.7.8MODRR Register Port T And Port P Mapping
The MODRR register within the PIM allows for mapping of PWM channels to port T in the absence of
port P pins for the low pin count packages. For the 80QFP package option it is recommended not to use
MODRR since this is intended to support PWM channel availability in low pin count packages. Note that
when mapping PWM channels to port T in an 80QFP option, the associated PWM channels are then
mapped to both port P and port T.
1.7.9Port AD Dependency On PIM And ATD Registers
The port AD pins interface to the PIM module. However, the port pin digital state can be read from either
the PORTAD register in the ATD register map or from the PTAD register in the PIM register map.
In order to read a digital pin value from PORTAD the corresponding ATDDIEN bit must be set. If the
corresponding ATDDIEN bit is cleared then the pin is configured as an analog input and the PORTAD bit
reads back as "1".
In order to read a digital pin value from PTAD, the corresponding DDRAD bit must be cleared, to
configure the pin as an input.
Furthermore in order to use a port AD pin as an analog input, the corresponding DDRAD bit must be
cleared to configure the pin as an input
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor67
Chapter 1 Device Overview
1.8Recommended Printed Circuit Board Layout
The PCB must be carefully laid out to ensure proper operation of the voltage regulator as well as of the
MCU itself. The following rules must be observed:
•Every supply pair must be decoupled by a ceramic capacitor connected as near as possible to the
corresponding pins (C1–C6).
•Central point of the ground star should be the V
•Use low ohmic low inductance connections between V
•V
must be directly connected to V
SSPLL
•Keep traces of V
, EXTAL, and XTAL as short as possible and occupied board area for C7,
SSPLL
SSR
.
C8, C11, and Q1 as small as possible.
•Do not place other signals or supplies underneath area occupied by C7, C8, C10, and Q1 and the
connection area to the MCU.
Figure 2-2. Quick Reference to PIM Registers (Sheet 3 of 3)
MC9S12C128 Data Sheet, Rev. 1.15
80Freescale Semiconductor
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2Register Descriptions
Table 2-2 summarizes the effect on the various configuration bits — data direction (DDR), input/output
level (I/O), reduced drive (RDR), pull enable (PE), pull select (PS), and interrupt enable (IE) for the ports.
The configuration bit PS is used for two purposes:
1. Configure the sensitive interrupt edge (rising or falling), if interrupt is enabled.
2. Select either a pull-up or pull-down device if PE is active.
Table 2-2. Pin Configuration Summary
DDRIORDRPEPSIE
0XX0X0InputDisabledDisabled
0XX100InputPull upDisabled
0XX110InputPull downDisabled
0XX001InputDisabledFalling edge
0XX011InputDisabledRising edge
0XX101InputPull upFalling edge
0XX111InputPull downrising edge
100XX0Output, full drive to 0DisabledDisabled
110XX0Output, full drive to 1DisabledDisabled
101XX0Output, reduced drive to 0DisabledDisabled
111XX0Output, reduced drive to 1DisabledDisabled
100X01Output, full drive to 0DisabledFalling edge
110X11Output, full drive to 1DisabledRising edge
101X01Output, reduced drive to 0DisabledFalling edge
111X11Output, reduced drive to 1DisabledRising edge
1. Applicable only on ports P and J.
(1)
FunctionPull DeviceInterrupt
NOTE
Allbits of allregisters inthis moduleare completely synchronous to internal
clocks during a register read.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor81
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.1Port T Registers
2.3.2.1.1Port T I/O Register (PTT)
Module Base + 0x0000
76543210
R
PTT7PTT6PTT5PTT4PTT3PTT2PTT1PTT0
W
TIMIOC7IOC6IOC5IOC4IOC3IOC2IOC1IOC0
PWMPWM4PWM3PWM2PWM1PWM0
Reset00000000
= Unimplemented or Reserved
Figure 2-3. Port T I/O Register (PTT)
Read: Anytime.
Write: Anytime.
If the data direction bits of the associated I/O pins are set to 1, a read returns the value of the port register,
otherwise the value at the pins is read.
If a TIM-channel is defined as output, the related port T is assigned to IOC function.
In addition to the possible timer functionality of port T pins PWM channels [4:0] can be routed to port
T[4:0]. For this the Module Routing Register (MODRR) needs to be configured.
Table 2-3. Port T[4:0] Pin Functionality Configurations
1. All fields in the that are not shaded are standard use cases.
2. TIMEN[x] means that the timer is enabled (TSCR1[7]), the related channel is
configured for output compare function (TIOS[x] or special output on a timer
overflowevent— configurable in TTOV[x])and the timer outputis routed to the
port pin (TCTL1/TCTL2).
TIMEN[x]
(2)
Port T[x] Output
(1)
MC9S12C128 Data Sheet, Rev. 1.15
82Freescale Semiconductor
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.1.2Port T Input Register (PTIT)
Module Base + 0x0001
76543210
RPTIT7PTIT6PTIT5PTIT4PTIT3PTIT2PTIT1PTIT0
W
Reset————————
= Unimplemented or Reserved
Figure 2-4. Port T Input Register (PTIT)
Read: Anytime.
Write: Never, writes to this register have no effect.
Table 2-4. PTIT Field Descriptions
FieldDescription
7–0
PTIT[7:0]
Port T Input Register — This register always reads back the status of the associated pins. This can also be
used to detect overload or short circuit conditions on output pins.
2.3.2.1.3Port T Data Direction Register (DDRT)
Module Base + 0x0002
76543210
R
DDRT7DDRT6DDRT5DDRT4DDRT3DDRT2DDRT1DDRT0
W
Reset00000000
Figure 2-5. Port T Data Direction Register (DDRT)
Read: Anytime.
Write: Anytime.
Table 2-5. DDRT Field Descriptions
FieldDescription
7–0
DDRT[7:0]
Data Direction Port T — This register configures each port T pin as either input or output.
The standard TIM / PWM modules forcesthe I/Ostate tobe anoutput foreach standard TIM / PWM module port
associated with an enabled output compare. In these cases the data direction bits will not change.
The DDRT bits revert to controlling the I/O direction of a pin when the associated timer output compare is
disabled.
The timer input capture always monitors the state of the pin.
0 Associated pin is configured as input.
1 Associated pin is configured as output.
Note: Due to internalsynchronization circuits,it can takeup to 2 bus cycles until the correct value is read on PTT
or PTIT registers, when changing the DDRT register.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor83
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.1.4Port T Reduced Drive Register (RDRT)
Module Base + 0x0003
76543210
R
RDRT7RDRT6RDRT5RDRT4RDRT3RDRT2RDRT1RDRT0
W
Reset00000000
Figure 2-6. Port T Reduced Drive Register (RDRT)
Read: Anytime.
Write: Anytime.
Table 2-6. RDRT Field Descriptions
FieldDescription
7–0
RDRT[7:0]
Reduced Drive Port T — This register configures the drive strength of each port T output pin as either full or
reduced. If the port is used as input this bit is ignored.
0 Full drive strength at output.
1 Associated pin drives at about 1/3 of the full drive strength.
2.3.2.1.5Port T Pull Device Enable Register (PERT)
Module Base + 0x0004
76543210
R
PERT7PERT6PERT5PERT4PERT3PERT2PERT1PERT0
W
Reset00000000
Figure 2-7. Port T Pull Device Enable Register (PERT)
Read: Anytime.
Write: Anytime.
Table 2-7. PERT Field Descriptions
FieldDescription
7–0
PERT[7:0]
Pull Device Enable — This register configures whether a pull-up or a pull-down device is activated, if the port
is used as input. This bit has no effect if the port is used as output. Out of reset no pull device is enabled.
0 Pull-up or pull-down device is disabled.
1 Either a pull-up or pull-down device is enabled.
MC9S12C128 Data Sheet, Rev. 1.15
84Freescale Semiconductor
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.1.6Port T Polarity Select Register (PTTST)
Module Base + 0x0005
76543210
R
PPST7PPST6PPST5PPST4PPST3PPST2PPST1PPST0
W
Reset00000000
Figure 2-8. Port T Polarity Select Register (PPST)
Read: Anytime.
Write: Anytime.
Table 2-8. PPST Field Descriptions
FieldDescription
7–0
PPST[7:0]
Pull Select Port T — This register selects whether a pull-down or a pull-up device is connected to the pin.
0 A pull-up device is connected to the associated port T pin, if enabled by the associated bit in register PERT
and if the port is used as input.
1 A pull-down deviceis connectedto the associated port Tpin, if enabled by the associated bit in register PERT
and if the port is used as input.
2.3.2.1.7Port T Module Routing Register (MODRR)
Module Base + 0x0007
76543210
R000
W
Reset———00000
= Unimplemented or Reserved
MODRR4MODRR3MODRR2MODRR1MODRR0
Figure 2-9. Port T Module Routing Register (MODRR)
Read: Anytime.
Write: Anytime.
Table 2-9. MODRR Field Descriptions
FieldDescription
4–0
MODRR[4:0]
Freescale Semiconductor85
Module Routing Register Port T — This register selects the module connected to port T.
0 Associated pin is connected to TIM module
1 Associated pin is connected to PWM module
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.2Port S Registers
2.3.2.2.1Port S I/O Register (PTS)
Module Base + 0x0008
76543210
R0000
W
SCI——————TXDRXD
Reset00000000
= Unimplemented or Reserved
Figure 2-10. Port S I/O Register (PTS)
Read: Anytime.
Write: Anytime.
If the data direction bits of the associated I/O pins are set to 1, a read returns the value of the port register,
otherwise the value at the pins is read.
PTS3PTS2PTS1PTS0
The SCI port associated with transmit pin 1 is configured as output if the transmitter is enabled and the
SCI pin associated with receive pin 0 is configured as input if the receiver is enabled. Please refer to SCIBlock User Guide for details.
2.3.2.2.2Port S Input Register (PTIS)
Module Base + 0x0009
76543210
R0000PTIS3PTIS2PTIS1PTIS0
W
Reset00000000
= Unimplemented or Reserved
Figure 2-11. Port S Input Register (PTIS)
Read: Anytime.
Write: Never, writes to this register have no effect.
Table 2-10. PTIS Field Descriptions
FieldDescription
3–0
PTIS[3:0]
86Freescale Semiconductor
Port S Input Register — This register always reads back the status of the associated pins. This also can be
used to detect overload or short circuit conditions on output pins.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.2.3Port S Data Direction Register (DDRS)
Module Base + 0x000A
76543210
R0000
W
Reset00000000
= Unimplemented or Reserved
DDRS3DDRS2DDRS1DDRS0
Figure 2-12. Port S Data Direction Register (DDRS)
Read: Anytime.
Write: Anytime.
Table 2-11. DDRS Field Descriptions
FieldDescription
3–0
DDRS[3:0]
Direction Register Port S — This register configures each port S pin as either input or output.
If the associated SCI transmit or receive channel is enabled this register has no effect on the pins. The pin is
forcedto be an output if the SCI transmitchannel is enabled, it is forced to be an input if the SCI receive channel
is enabled.
The DDRS bits revert to controlling the I/O direction of a pin when the associated channel is disabled.
0 Associated pin is configured as input.
1 Associated pin is configured as output.
Note: Due to internalsynchronization circuits, itcan take upto 2bus cycles untilthe correct valueis read on PTS
or PTIS registers, when changing the DDRS register.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor87
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.2.4Port S Reduced Drive Register (RDRS)
Module Base + 0x000B
76543210
R0000
W
Reset00000000
= Unimplemented or Reserved
RDRS3RDRS2RDRS1RDRS0
Figure 2-13. Port S Reduced Drive Register (RDRS)
Read: Anytime.
Write: Anytime.
Table 2-12. RDRS Field Descriptions
FieldDescription
3–0
RDRS[3:0]
Reduced Drive Port S — This register configures the drive strength of each port S output pin as either full or
reduced. If the port is used as input this bit is ignored.
0 Full drive strength at output.
1 Associated pin drives at about 1/3 of the full drive strength.
2.3.2.2.5Port S Pull Device Enable Register (PERS)
Module Base + 0x000C
76543210
R0000
W
Reset00001111
= Unimplemented or Reserved
PERS3PERS2PERS1PERS0
Figure 2-14. Port S Pull Device Enable Register (PERS)
Read: Anytime.
Write: Anytime.
Table 2-13. PERS Field Descriptions
FieldDescription
3–0
PERS[3:0]
88Freescale Semiconductor
Reduced Drive PortS — This register configureswhether apull-up or a pull-down deviceis activated, if the port
is used as input or as output in wired-or (open drain) mode. This bit has no effect if the port is used as push-pull
output. Out of reset a pull-up device is enabled.
0 Pull-up or pull-down device is disabled.
1 Either a pull-up or pull-down device is enabled.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.2.6Port S Polarity Select Register (PPSS)
Module Base + 0x000D
76543210
R0000
W
Reset00000000
= Unimplemented or Reserved
PPSS3PPSS2PPSS1PPSS0
Figure 2-15. Port S Polarity Select Register (PPSS)
Read: Anytime.
Write: Anytime.
Table 2-14. PPSS Field Descriptions
FieldDescription
3–0
PPSS[3:0]
Pull Select Port S — This register selects whether a pull-down or a pull-up device is connected to the pin.
0 A pull-up device is connected to the associated port S pin, if enabled by the associated bit in register PERS
and if the port is used as input or as wired-or output.
1 A pull-down deviceis connected to the associatedport S pin, if enabled bythe associated bit in registerPERS
and if the port is used as input.
2.3.2.2.7Port S Wired-OR Mode Register (WOMS)
Module Base + 0x000E
76543210
R0000
W
Reset00000000
= Unimplemented or Reserved
WOMS3WOMS2WOMS1WOMS0
Figure 2-16. Port S Wired-Or Mode Register (WOMS)
Read: Anytime.
Write: Anytime.
Table 2-15. WOMS Field Descriptions
FieldDescription
3–0
WOMS[3:0]
Freescale Semiconductor89
Wired-OR Mode Port S — This register configures the output pins as wired-or. If enabled the output is driven
active low only (open-drain). A logic level of “1” is not driven. This bit has no influence on pins used as inputs.
0 Output buffers operate as push-pull outputs.
1 Output buffers operate as open-drain outputs.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.3Port M Registers
2.3.2.3.1Port M I/O Register (PTM)
Module Base + 0x0010
76543210
R00
W
PTM5PTM4PTM3PTM2PTM1PTM0
MSCAN/
SPI
Reset00000000
——SCKMOSI
= Unimplemented or Reserved
SSMISOTXCANRXCAN
Figure 2-17. Port M I/O Register (PTM)
Read: Anytime.
Write: Anytime.
If the data direction bits of the associated I/O pins are set to 1, a read returns the value of the port register,
otherwise the value at the pins is read.
The SPI pin configurations (PM[5:2]) is determined by several status bits in the SPI module. Please refer
to the SPI Block User Guide for details.
2.3.2.3.2Port M Input Register (PTIM)
Module Base + 0x0011
76543210
R00PTIM5PTIM4PTIM3PTIM2PTIM1PTIM0
W
Reset————————
= Unimplemented or Reserved
Figure 2-18. Port M Input Register (PTIM)
Read: Anytime.
Write: Never, writes to this register have no effect.
Table 2-16. PTIM Field Descriptions
FieldDescription
5–0
PTIM[5:0]
90Freescale Semiconductor
Port M Input Register — This register always reads back the status of the associated pins. This also can be
used to detect overload or short circuit conditions on output pins.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.3.3Port M Data Direction Register (DDRM)
Module Base + 0x0012
76543210
R00
W
Reset——000000
= Unimplemented or Reserved
DDRM5DDRM4DDRM3DDRM2DDRM1DDRM0
Figure 2-19. Port M Data Direction Register (DDRM)
Read: Anytime.
Write: Anytime.
Table 2-17. DDRM Field Descriptions
FieldDescription
5–0
DDRM[5:0]
Data Direction Port M — This register configures each port S pin as either input or output
If SPI or MSCAN is enabled, the SPI and MSCAN modules determines thepin directions.Please referto the SPI
and MSCAN Block User Guides for details.
If the associated SCI or MSCAN transmitor receivechannels are enabled,this registerhas noeffect on the pins.
Thepins are forcedto beoutputsif the SCI orMSCAN transmit channels areenabled,theyare forced to be inputs
if the SCI or MSCAN receive channels are enabled.
The DDRS bits revert to controlling the I/O direction of a pin when the associated channel is disabled.
0 Associated pin is configured as input.
1 Associated pin is configured as output.
Note: Due tointernal synchronizationcircuits, it cantakeup to 2bus cycles until thecorrect value isread on PTM
or PTIM registers, when changing the DDRM register.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor91
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.3.4Port M Reduced Drive Register (RDRM)
Module Base + 0x0013
76543210
R00
W
Reset00000000
= Unimplemented or Reserved
RDRM5RDRM4RDRM3RDRM2RDRM1RDRM0
Figure 2-20. Port M Reduced Drive Register (RDRM)
Read: Anytime.
Write: Anytime.
Table 2-18. RDRM Field Descriptions
FieldDescription
5–0
RDRM[5:0]
Reduced Drive Port M — This register configures the drive strength of each port M output pin as either full or
reduced. If the port is used as input this bit is ignored.
0 Full drive strength at output.
1 Associated pin drives at about 1/3 of the full drive strength.
2.3.2.3.5Port M Pull Device Enable Register (PERM)
Module Base + 0x0014
76543210
R00
W
Reset00111111
= Unimplemented or Reserved
PERM5PERM4PERM3PERM2PERM1PERM0
Figure 2-21. Port M Pull Device Enable Register (PERM)
Read: Anytime.
Write: Anytime.
Table 2-19. PERM Field Descriptions
FieldDescription
5–0
PERM[5:0]
92Freescale Semiconductor
Pull Device Enable Port M — This register configures whether a pull-up or a pull-down device is activated, if
the port is used as input or as output in wired-or (open drain) mode. This bit has no effect if the port is used as
push-pull output. Out of reset a pull-up device is enabled.
0 Pull-up or pull-down device is disabled.
1 Either a pull-up or pull-down device is enabled.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.3.6Port M Polarity Select Register (PPSM)
Module Base + 0x0015
76543210
R00
W
Reset00000000
= Unimplemented or Reserved
PPSM5PPSM4PPSM3PPSM2PPSM1PPSM0
Figure 2-22. Port M Polarity Select Register (PPSM)
Read: Anytime.
Write: Anytime.
Table 2-20. PPSM Field Descriptions
FieldDescription
5–0
PPSM[5:0]
Polarity Select Port M — This register selects whether a pull-down or a pull-up device is connected to the pin.
0 A pull-up device is connected to the associated port M pin, if enabled by the associated bit in register PERM
and if the port is used as input or as wired-or output.
1 A pull-down device is connectedto the associated port M pin,if enabled by the associatedbit in registerPERM
and if the port is used as input.
2.3.2.3.7Port M Wired-OR Mode Register (WOMM)
Module Base + 0x0016
76543210
R00
W
Reset00000000
= Unimplemented or Reserved
WOMM5WOMM4WOMM3WOMM2WOMM1WOMM0
Figure 2-23. Port M Wired-OR Mode Register (WOMM)
Read: Anytime.
Write: Anytime.
Table 2-21. WOMM Field Descriptions
FieldDescription
5–0
WOMM[5:0]
Freescale Semiconductor93
Wired-OR Mode Port M — This register configures the output pins as wired-or. If enabled the output is driven
active low only (open-drain). A logic level of “1” is not driven. This bit has no influence on pins used as inputs.
0 Output buffers operate as push-pull outputs.
1 Output buffers operate as open-drain outputs.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.4Port P Registers
2.3.2.4.1Port P I/O Register (PTP)
Module Base + 0x0018
76543210
R
PTP7PTP6PTP5PTP4PTP3PTP2PTP1PTP0
W
PWM——PWM5PWM4PWM3PWM2PWM1PWM0
Reset00000000
Figure 2-24. Port P I/O Register (PTP)
Read: Anytime.
Write: Anytime.
If the data direction bits of the associated I/O pins are set to 1, a read returns the value of the port register,
otherwise the value at the pins is read.
2.3.2.4.2Port P Input Register (PTIP)
Module Base + 0x0019
76543210
RPTIP7PTIP6PTIP5PTIP4PTIP3PTIP2PTIP1PTIP0
W
Reset————————
= Unimplemented or Reserved
Figure 2-25. Port P Input Register (PTIP)
Read: Anytime.
Write: Never, writes to this register have no effect.
This register always reads back the status of the associated pins. This can be also used to detect overload
or short circuit conditions on output pins.
MC9S12C128 Data Sheet, Rev. 1.15
94Freescale Semiconductor
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.4.3Port P Data Direction Register (DDRP)
Module Base + 0x001A
76543210
R
DDRP7DDRP6DDRP5DDRP4DDRP3DDRP2DDRP1DDRP0
W
Reset00000000
Figure 2-26. Port P Data Direction Register (DDRP)
Read: Anytime.
Write: Anytime.
Table 2-22. DDRP Field Descriptions
FieldDescription
7–0
DDRP[7:0]
Data Direction Port P — This register configures each port P pin as either input or output.
0 Associated pin is configured as input.
1 Associated pin is configured as output.
Note: Due to internalsynchronization circuits, itcan take upto 2bus cycles untilthe correct valueis read on PTP
or PTIP registers, when changing the DDRP register.
2.3.2.4.4Port P Reduced Drive Register (RDRP)
Module Base + 0x001B
76543210
R
RDRP7RDRP6RDRP5RDRP4RDRP3RDRP2RDRP1RDRP0
W
Reset00000000
Figure 2-27. Port P Reduced Drive Register (RDRP)
Read: Anytime.
Write: Anytime.
Table 2-23. RDRP Field Descriptions
FieldDescription
7–0
RDRP[7:0]
Freescale Semiconductor95
Reduced Drive Port P — This register configures the drive strength of each port P output pin as either full or
reduced. If the port is used as input this bit is ignored.
0 Full drive strength at output.
1 Associated pin drives at about 1/3 of the full drive strength.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.4.5Port P Pull Device Enable Register (PERP)
Module Base + 0x001C
76543210
R
PERP7PERP6PERP5PERP4PERP3PERP2PERP1PERP0
W
Reset00000000
Figure 2-28. Port P Pull Device Enable Register (PERP)
Read: Anytime.
Write: Anytime.
Table 2-24. PERP Field Descriptions
FieldDescription
7–0
PERP[7:0]
Pull Device Enable Port P — Thisregister configureswhether a pull-up or a pull-down device is activated, if the
port is used as input. This bit has no effect if the port is used as output. Out of reset no pull device is enabled.
0 Pull-up or pull-down device is disabled.
1 Either a pull-up or pull-down device is enabled.
2.3.2.4.6Port P Polarity Select Register (PPSP)
Module Base + 0x001D
76543210
R
PPSP7PPSP6PPSP5PPSP4PPSP3PPSP2PPSP1PPSP0
W
Reset00000000
Figure 2-29. Port P Polarity Select Register (PPSP)
Read: Anytime.
Write: Anytime.
Table 2-25. PPSP Field Descriptions
FieldDescription
7–0
PPSP[7:0]
Pull Select Port P — This register serves a dual purpose by selecting the polarity of the active interrupt edge
as well as selecting a pull-up or pull-down device if enabled.
0 Falling edge on the associated port P pin sets the associated flag bit in the PIFP register.A pull-up device is
connected to theassociated port P pin,if enabled bytheassociated bit in register PERPand if the portis used
as input.
1 Rising edge on the associated port P pin sets the associated flag bit in the PIFP register.A pull-down device
is connected to the associated port P pin, if enabled by the associated bit in register PERP and if the port is
used as input.
MC9S12C128 Data Sheet, Rev. 1.15
96Freescale Semiconductor
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.4.7Port P Interrupt Enable Register (PIEP)
Module Base + 0x001E
76543210
R
PIEP7PIEP6PIEP5PIEP4PIEP3PIEP2PIEP1PIEP0
W
Reset00000000
Figure 2-30. Port P Interrupt Enable Register (PIEP)
Read: Anytime.
Write: Anytime.
Table 2-26. PIEP Field Descriptions
FieldDescription
7–0
PIEP[7:0]
Pull Select Port P — This register disables or enables on a per pin basis the edge sensitive external interrupt
associated with port P.
0 Interrupt is disabled (interrupt flag masked).
1 Interrupt is enabled.
2.3.2.4.8Port P Interrupt Flag Register (PIFP)
Module Base + 0x001F
76543210
R
PIFP7PIFP6PIFP5PIFP4PIFP3PIFP2PIFP1PIFP0
W
Reset00000000
Figure 2-31. Port P Interrupt Flag Register (PIFP)
Read: Anytime.
Write: Anytime.
Table 2-27. PIFP Field Descriptions
FieldDescription
7–0
PIFP[7:0]
Interrupt Flags Port P — Each flag is set by an active edge on the associated input pin. This could be a rising
or a falling edge based on the state of the PPSP register. To clear this flag, write a “1” to the corresponding bit
in the PIFP register. Writing a “0” has no effect.
0 No active edge pending.
Writing a “0” has no effect.
1 Active edge on the associated bit has occurred (an interrupt will occur if the associated enable bit is set).
Writing a “1” clears the associated flag.
MC9S12C128 Data Sheet, Rev. 1.15
Freescale Semiconductor97
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.5Port J Registers
2.3.2.5.1Port J I/O Register (PTJ)
Module Base + 0x0028
76543210
R
PTJ7PTJ6
W
Reset00——————
= Unimplemented or Reserved
Read: Anytime.
Write: Anytime.
If the data direction bits of the associated I/O pins are set to 1, a read returns the value of the port register,
otherwise the value at the pins is read.
000000
Figure 2-32. Port J I/O Register (PTJ)
2.3.2.5.2Port J Input Register (PTIJ)
Module Base + 0x0029
76543210
RPTIJ7PTIJ6000000
W
Reset00——————
= Unimplemented or Reserved
Figure 2-33. Port J Input Register (PTIJ)
Read: Anytime.
Write: Never, writes to this register have no effect.
This register always reads back the status of the associated pins. This can be used to detect overload or
short circuit conditions on output pins.
MC9S12C128 Data Sheet, Rev. 1.15
98Freescale Semiconductor
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.3.2.5.3Port J Data Direction Register (DDRJ)
Module Base + 0x002A
76543210
R
DDRJ7DDRJ6
W
Reset00——————
= Unimplemented or Reserved
000000
Figure 2-34. Port J Data Direction Register (DDRJ)
Read: Anytime.
Write: Anytime.
Table 2-28. DDRJ Field Descriptions
FieldDescription
7–6
DDRJ[7:6]
Data Direction Port J — This register configures port pins J[7:6] as either input or output.
DDRJ[7:6] — Data Direction Port J
0 Associated pin is configured as input.
1 Associated pin is configured as output.
Note: Due to internal synchronization circuits,it cantake up to 2 buscycles untilthe correctvalue is read on PTJ
or PTIJ registers, when changing the DDRJ register.
2.3.2.5.4Port J Reduced Drive Register (RDRJ)
Module Base + 0x002B
76543210
R
RDRJ7RDRJ6
W
Reset00——————
= Unimplemented or Reserved
000000
Figure 2-35. Port J Reduced Drive Register (RDRJ)
Read: Anytime.
Write: Anytime.
Table 2-29. RDRJ Field Descriptions
FieldDescription
7–6
RDRJ[7:6]
Freescale Semiconductor99
Reduced Drive Port J — This register configures the drive strength of each port J output pin as either full or
reduced. If the port is used as input this bit is ignored.
0 Full drive strength at output.
1 Associated pin drives at about 1/3 of the full drive strength.
MC9S12C128 Data Sheet, Rev. 1.15
Chapter 2 Port Integration Module (PIM9C32) Block Description
Figure 2-36. Port J Pull Device Enable Register (PERJ)
Read: Anytime.
Write: Anytime.
Table 2-30. PERJ Field Descriptions
FieldDescription
7–6
PERJ[7:6]
Reduced Drive Port J —This registerconfigures whethera pull-upor apull-down device isactivated, if the port
is used as input or as wired-or output. This bit has no effect if the port is used as push-pull output.
0 Pull-up or pull-down device is disabled.
1 Either a pull-up or pull-down device is enabled.
2.3.2.5.6Port J Polarity Select Register (PPSJ)
Module Base + 0x002D
76543210
R
PPSJ7PPSJ6
W
Reset00——————
= Unimplemented or Reserved
000000
Figure 2-37. Port J Polarity Select Register (PPSJ)
Read: Anytime.
Write: Anytime.
Table 2-31. PPSJ Field Descriptions
FieldDescription
7–6
PPSJ[7:6]
100Freescale Semiconductor
Reduced Drive Port J —This register servesa dual purposeby selecting the polarity of the activeinterrupt edge
as well as selecting a pull-up or pull-down device if enabled.
0 Falling edge on the associated port J pin sets the associated flag bit in the PIFJ register.
A pull-up device is connected to the associated port J pin, if enabled by the associated bit in register PERJ
and if the port is used as general purpose input.
1 Rising edge on the associated port J pin sets the associated flag bit in the PIFJ register.
A pull-down device is connected to the associated port J pin, if enabled bythe associated bit in register PERJ
and if the port is used as input.
MC9S12C128 Data Sheet, Rev. 1.15
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.