MC9S12C128
Data Sheet
Covers MC9S12C Family
And MC9S12GC Family
HCS12
Microcontrollers
MC9S12C128
01/2006
freescale.com
HCS12
Microcontrollers
MC9S12C128
also covers
MC9S12GC Family
MC9S12C128
Rev 01.19
01/2006
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
Oct, 200501.16
Dec, 200501.17Added note to PIM block diagram figure
Dec, 200501.18Added PIM rerouting information to 80-pin package diagram
Jan, 200601.19
Revision
Level
Description
Removed 16MHz option for 128K, 96K and 64K versions
Minor corrections following review
Chapter 1
MC9S12C and MC9S12GC Device Overview (MC9S12C128)
1.1Introduction
The MC9S12C-Family / MC9S12GC-Family and the MC9S12GC Family are 48/52/80 pin Flash-based
industrial/automotivenetwork control MCU families, which deliver thepower and flexibilityof the16-bit
core (CPU12) family to a whole new range of cost and space sensitive, general purpose industrial and
automotive network applications. All MC9S12C-Family / MC9S12GC-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 8-channel, 10-bit analog-to-digital converter
(ADC). The MC9S12C-Family / MC9S12GC-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 available in each module, up to 10 dedicated I/O port bits are
available with wake-up capability from stop or wait mode. The devices are available in 48-, 52-, and 80pin 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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
•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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
•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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
1.2.3Part ID Assignments
The part IDislocated in two8-bitregistersPARTIDH and PARTIDL (addresses 0x001Aand 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.
Table 1-3. Assigned Part ID Numbers
DeviceMask Set NumberPart ID
MC9S12C321L45J$3300
MC9S12C322L45J$3302
MC9S12C321M34C$3311
MC9S12C642L09S$3102
MC9S12C962L09S$3102
MC9S12C1282L09S$3102
MC9S12GC162L45J$3302
MC9S12GC322L45J$3302
MC9S12GC321M34C$3311
MC9S12GC642L09S$3102
MC9S12GC962L09S$3102
MC9S12GC1282L09S$3102
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 two8-bit registers MEMSIZ0 and MEMSIZ1 (addresses 0x001C
and 0x001D after reset).Table 1-4 shows the read-onlyvaluesofthese registers. Refer toModuleMapping
and Control (MMC) Block Guide for further details.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
5
4
3
2
0
L
1.3Signal Description
1.3.1Device Pinouts
SS
PP4/KWP4/PW4
DDXVSSX
PP5/KWP5/PW5
PP7/KWP7
V
PM0/RXCAN
PM1/TXCAN
PM4/MOSI
PM2/MISO
PM3/
PM5/SCK
PJ6/KWJ6
PJ7/KWJ7
PP6/KWP6/ROMCT
PS3
PS2
PS1/TXD
PS0/RXD
SSAVRL
V
PW3/KWP3/PP3
PW2/KWP2/PP2
PW1/KWP1/PP1
PW0/KWP0/PP0
PW0/IOC0/PT0
PW1/IOC1/PT1
PW2/IOC2/PT2
PW3/IOC3/PT3
V
PW4/IOC4/PT4
MODC/
ADDR0/DATA0/PB0
ADDR1/DATA1/PB1
ADDR2/DATA2/PB2
ADDR3/DATA3/PB3
ADDR4/DATA4/PB4
V
IOC5/PT5
IOC6/PT6
IOC7/PT7
TAGHI/BKGD
DD1
SS1
80797877767574737271706968676665646362
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21222324252627282930313233343536373839
ADDR5/DATA5/PB5
ADDR6/DATA6/PB6
ADDR7/DATA7/PB7
MC9S12C-Family /
MC9S12GC-Family
ECLK/PE4
MODA/IPIPE0/PE5
MODB/IPIPE1/PE6
XCLKS/NOACC/PE7
SSR
V
V
DDR
DDPLL
V
RESET
XFC
SSPLL
V
EXTAL
PP
XTAL
TEST/V
W/PE2
IRQ/PE1
R/
LSTRB/TAGLO/PE3
61
60
V
RH
59
V
DDA
58
PAD07/AN07
57
PAD06/AN06
56
PAD05/AN05
55
PAD04/AN04
54
PAD03/AN03
53
PAD02/AN02
52
PAD01/AN01
51
PAD00/AN00
50
V
SS2
49
V
DD2
48
PA7/ADDR15/DATA1
47
PA6/ADDR14/DATA1
46
PA5/ADDR13/DATA1
45
PA4/ADDR12/DATA1
44
PA3/ADDR11/DATA11
43
PA2/ADDR10/DATA1
42
PA1/ADDR9/DATA9
41
PA0/ADDR8/DATA8
40
XIRQ/PE0
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
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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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 buffers and 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]
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
1.3.4Detailed Signal Descriptions
1.3.4.1EXTAL, XTAL — Oscillator Pins
EXTAL and XTAL are the crystal driver andexternal clock pins.On resetall the deviceclocks arederived
from the EXTAL input frequency. XTAL is the crystal output.
1.3.4.2RESET — External Reset Pin
RESET is an active low 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 alarge capacitance thatwould interfere withthe ability of this signalto rise toa valid logicone
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 Motorola 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 modeselect pinat therising edge during reset, when
the state of this pin is latched to the MODC bit.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
1.3.4.6PA[7:0] / ADDR[15:8] / DATA[15:8] — Port A I/O Pins
PA7–PA0are general purpose input or output pins,. In MCU expanded modes of operation, these pins are
used for the multiplexed external address anddatabus.PA[7:1] pinsarenot available in 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 usedto indicatethat the current bus cycle is an unusedor “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.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
EXTAL
MCU
XTAL
Figure 1-13. External Clock Connections (PE7 = 0)
Not Connected
CMOS Compatible
External Oscillator
(V
Level)
DDPLL
1.3.4.9PE6 / MODB / IPIPE1 — Port E I/O Pin 6
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 trackingsignal IPIPE1.This pin isan inputwith a pull-downdevicewhich 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 trackingsignal IPIPE0.This pin isan inputwith a pull-downdevicewhich 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 pinis initially configured as ECLKoutput with stretchin all expandedmodes. The
E clock output function dependsupon the settings of the NECLK bit in the PEAR register, the IVIS bit in
the MODEregister and the ESTRbit in the EBICTL register. All clocks, including the E clock, are halted
when theMCU is in stop mode. It ispossible to configure the MCU to interface to slow external 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 asa constantspeed clock foruse inthe external applicationsystem. Alternatively PE4 canbe 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. If thestrobe function isrequired,it should beenabled by settingthe LSTRE bitinthe 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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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 isalways an input andcan alwaysbe read. There is an activepull-up on this pin while in
reset and immediately out of reset.The pull-upcan beturned 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 ameans ofrequesting anon-maskable interrupt after reset initialization. During
reset, the X bit in the conditioncode register (CCR)is set and any interruptis maskeduntil 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 aninput, it can generate interrupts causing theMCU to exit stop or wait mode. This pinis 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 aninput, it can generate interrupts causing theMCU to exit stop or wait mode. This pinis not available
in the 48- / 52-pinpackage versions. During MCU expanded modesof operation, this pin isused toenable
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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 ageneral purpose inputor output pinand the receive pin, RXCAN,ofthe CAN moduleif available.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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 isa generalpurpose 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 power and groundfor I/O drivers. Bypass requirementsdepend on howheavilythe MCU pinsare
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 tothe MCU through VDDand VSS. This 2.5Vsupplyis derived from theinternal voltage
regulator.Thereis no static loadonthosepins 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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
1.3.5.4V
V
DDA,VSSA
are the powersupply and groundinput pins forthe voltage regulator referenceand 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
DD1, VDD2
V
SS1, VSS2
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.5Provides operating voltage and ground for the phased-locked loop. This allows the 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, usebypass capacitors with high-frequency characteristicsand place
them as close to the MCU as possible. Bypass requirements depend on
MCU pin load.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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 outofreset is determinedbythe states oftheMODC, MODB, and MODA 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 intothese bits on the risingedge of the reset signal. The ROMCTL signal allows the setting of the
ROMONbit in the MISCregister thus controllingwhetherthe internal Flashis visible inthememory 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.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
Table 1-7. Mode Selection
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.
Table 1-8. Clock Selection Based on PE7
PE7 = XCLKSDescription
1Colpitts Oscillator selected
0Pierce Oscillator/external clock selected
1.5.2Security
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’s codethat dumpsthe contentsof theinternal program.This code would defeatthe purpose
of security.At thesame timethe user may also wish to put a back door in the user’s program. 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 theFLASH module.These non-volatile bitswill keep thepart secured throughresetting thepart
and through powering down the part.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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 commonusage of thesecured part. Everythingwill appear thesame as ifthe 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 expandedmode or viaa sequence ofBDM commands. Unsecuringis also possiblevia
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 unsecuredstate. Thisis generallydone through the BDM, but
the user could also change to expandedmode (bywriting themode bits through the BDM) and jumping to
an external program (again throughBDM commands).Note that if the part goes through a resetbefore 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 instructionstops allclocks andthe oscillatorthus puttingthe chipin fullystatic
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 modeconsumesmore current thanthefull stop mode,butthe wake up timefromthis mode
is significantly shorter.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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.Forfurther power consumption reductionthe peripherals canindividuallyturn off their localclocks.
1.5.3.4Run
Although thisis nota low-power mode, unused peripheralmodules shouldnot 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.
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
1.6.2Resets
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-2 to Figure 1-6 footnotesforlocations of thememoriesdepending on the operatingmode
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 avoidcurrent
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-Family / MC9S12GC-Family devices, 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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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 the voltage regulator isshutdown by connectingV
to ground thenthe
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 interfaceto 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 and the
correspondingDDRDAbitcleared. If the correspondingATDDIEN bit is clearedthenthepin 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
Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128)
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.
•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 C6,
SSPLL
SSR
.
C7, C11, and Q1 as small as possible.
•Do not place other signals or supplies underneath area occupied by C6, C7, C5, and Q1 and the
connection area to the MCU.
Note: The MODRRregister within thePIM allows formapping of PWMchannels to PortT inthe absence
of Port P pins for the lowpin countpackages. For the80QFP 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.
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), pullselect (PS), and interrupt enable(IE) forthe 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 all registers in this moduleare completelysynchronous tointernal
clocks during a register read.
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 to1, 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
MODRR[x]PWME[x]
000General Purpose I/O
001Timer
010General Purpose I/O
011Timer
100General Purpose I/O
101Timer
110PWM
111PWM
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
overflow event — configurable in TTOV[x]) and the timer output is routed to the
port pin (TCTL1/TCTL2).
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 forces the I/O state to be an output for each 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 internal synchronization circuits, it can take up to 2 bus cycles until the correct value is read on PTT
or PTIT registers, when changing the DDRT register.
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.
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 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.
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)
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
Rev 01.19
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 thedata direction bits of theassociated I/O pins are setto 1, a read returnsthe 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.
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.
Rev 01.19
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
forced to be an output if the SCI transmit channel 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 internal synchronization circuits, it can take up to 2 bus cycles until the correct value is read on PTS
or PTIS registers, when changing the DDRS register.
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)
Reduced Drive Port S — 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.
Rev 01.19
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 device is connected to the associated port S pin, if enabled by the associated bit in register PERS
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.
Rev 01.19
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 thedata direction bits of theassociated I/O pins are setto 1, a read returnsthe value of the port register,
otherwise the value at the pins is read.
The SPI pin configurations (PM[5:2]) is determined by several statusbits 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.
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.
Rev 01.19
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 the pin directions. Please refer to the SPI
and MSCAN Block User Guides for details.
If the associated SCI or MSCAN transmit or receive channels are enabled, this register has no effect on the pins.
The pins are forced to be outputs if the SCI or MSCAN transmit channels are enabled, they are 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 to internal synchronization circuits, it can take up to 2 bus cycles until the correct value is read on PTM
or PTIM registers, when changing the DDRM register.
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)
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.
Rev 01.19
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 connected to the associated port M pin, if enabled by the associated bit in register PERM
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.
Rev 01.19
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 thedata direction bits of theassociated I/O pins are setto 1, a read returnsthe 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
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 internal synchronization circuits, it can take up to 2 bus cycles until the correct value is read on PTP
or PTIP registers, when changing the DDRP register.
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.
Rev 01.19
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 — 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.
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 the associated port P pin, if enabled by the associated bit in register PERP and if the port is 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.
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).
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 thedata direction bits of theassociated I/O pins are setto 1, a read returnsthe 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