Covers MC9S12XS Family
MC9S12XS256
MC9S12XS128
MC9S12XS64
HCS12
Microcontrollers
MC9S12XS256RMV1
Rev. 1.13
08/2012
freescale.com
Page 2
To provide the most up-to-date information, the document revision on the World Wide Web is the most
current. A printed copy may be an earlier revision. To verify you have the latest information available,
refer to freescale.com.
This document contains information for the complete S12XS Family and thus includes a set of separate
flash (FTMR) module sections to cover the whole family. A full list of family members and options is
included in the appendices.
This document contains information forall constituent modules, with the exception of the CPU. For CPU
information please refer to CPU12XV1 in the CPU12/CPU12X Reference Manual.
Revision History
Date
November,
2010
Jul, 20111.12
Aug, 20121.13
Revision
Level
1.11
Description
Updated Chapter 3 Memory Mapping Control (S12XMMCV4)
Updated Chapter 11 Freescale’s Scalable Controller Area Network
(S12MSCANV3)
Updated Chapter 14 Serial Communication Interface (S12SCIV5)
Updated footnotes on table 1-2
Updated note in Appendix F Ordering Information
Corrected API accuracy in feature list
Corrected name of pin #27 in 80QFP pinout (PE5->PE4)
Updated Chapter 2 Port Integration Module (S12XSPIMV1)
Updated Chapter 11 Freescale’s Scalable Controller Area Network
(S12MSCANV3)
Updated Chapter 4 Interrupt (S12XINTV2)
Updated Chapter 8 S12XE Clocks and Reset Generator (S12XECRGV1)
Updated V
The new S12XS family of 16-bit micro controllers is a compatible, reduced version of the S12XE family.
These families provide an easy approach to develop common platforms from low-end to high-end
applications, minimizing the redesign of software and hardware.
Targeted at generic automotive applications and CAN nodes, some typical examples of these applications
are: Body Controllers, Occupant Detection, Door Modules, RKE Receivers, Smart Actuators, Lighting
Modules and Smart Junction Boxes amongst many others.
The S12XS family retains many of the features of the S12XE family including Error Correction Code
(ECC) on Flash memory, a separate Data-Flash Module for code or data storage, a Frequency Modulated
Locked Loop (IPLL) that improves the EMC performance and a fast ATD converter.
S12XS family delivers 32-bit performance with all the advantages and efficiencies of a 16-bit MCU while
retaining the low cost, power consumption, EMC and code-size efficiency advantages currently enjoyed
by users of Freescale’s existing 16-bit S12 and S12X MCU families. Like members of other S12X
families, the S12XS family runs 16-bit wide accesses without wait states for all peripherals and memories.
The S12XS family is available in 112-pin LQFP, 80-pin QFP, 64-pin LQFP package options and maintains
a high level of pin compatibility with the S12XE family. In addition to the I/O ports available in each
module, up to 18 further I/O ports are available with interrupt capability allowing Wake-Up from stop or
wait modes.
The peripheral set includes MSCAN, SPI, two SCIs, an 8-channel 24-bit periodic interrupt timer, 8channel 16-bit Timer, 8-channel PWM and up to 16- channel 12-bit ATD converter.
Software controlled peripheral-to-port routing enables access to a flexible mix of the peripheral modules
in the lower pin count package options.
1.1.1Features
Features of the S12XS Family are listed here. Please see Table D-1 for memory options and Table D-2 for
the peripheral features that are available on the different family members.
•16-bit CPU12X
— Upward compatible with S12 instruction set with the exception of five Fuzzy instructions
(MEM, WAV, WAVR, REV, REVW) which have been removed
— Enhanced indexed addressing
— Access to large data segments independent of PPAGE
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor19
Page 20
Device Overview S12XS Family
•INT (interrupt module)
— Seven levels of nested interrupts
— Flexible assignment of interrupt sources to each interrupt level.
— External non-maskable high priority interrupt (XIRQ)
— The following inputs can act as Wake-up Interrupts
– IRQ and non-maskable XIRQ
– CAN receive pins
– SCI receive pins
– Depending on the package option up to 20 pins on ports J, H and P configurable as rising or
falling edge sensitive
•MMC (module mapping control)
•DBG (debug module)
— Monitoring of CPU bus with tag-type or force-type breakpoint requests
— 64 x 64-bit circular trace buffer captures change-of-flow or memory access information
•BDM (background debug mode)
•OSC_LCP (oscillator)
— Low power loop control Pierce oscillator utilizing a 4MHz to 16MHz crystal
— Good noise immunity
— Full-swing Pierce option utilizing a 2MHz to 40MHz crystal
— Transconductance sized for optimum start-up margin for typical crystals
•IPLL (Internally filtered, frequency modulated phase-locked-loop clock generation)
— No external components required
— Configurable option to spread spectrum for reduced EMC radiation (frequency modulation)
•CRG (clock and reset generation)
— COP watchdog
— Real time interrupt
— Clock monitor
— Fast wake up from STOP in self clock mode
•Memory Options
— 64, 128 and 256 Kbyte Flash
— Flash General Features
– 64 data bits plus 8 syndrome ECC (Error Correction Code) bits allow single bit failure
correction and double fault detection
– Erase sector size 1024 bytes
– Automated program and erase algorithm
– Protection scheme to prevent accidental program or erase
– Security option to prevent unauthorized access
– Sense-amp margin level setting for reads
— 4 and 8 Kbyte Data Flash space
S12XS Family Reference Manual, Rev. 1.13
20Freescale Semiconductor
Page 21
Device Overview S12XS Family
– 16 data bits plus 6 syndrome ECC (Error Correction Code) bits allow single bit failure
correction and double fault detection
– Erase sector size 256 bytes
– Automated program and erase algorithm
— 4, 8 and 12 Kbyte RAM
•16-channel, 12-bit Analog-to-Digital converter
— 8/10/12 Bit resolution
—3µs, 10-bit single conversion time
— Left or right justified result data
— External and internal conversion trigger capability
— Internal oscillator for conversion in Stop modes
— Wake from low power modes on analog comparison > or <= match
— Continuous conversion mode
— Multiplexer for 16 analog input channels
— Multiple channel scans
— Pins can also be used as digital I/O
•MSCAN (1 M bit per second, CAN 2.0 A, B software compatible module)
— 1 Mbit per second, CAN 2.0 A, B software compatible module
– Standard and extended data frames
– 0 - 8 bytes data length
– Programmable bit rate up to 1 Mbps
— Five receive buffers with FIFO storage scheme
— Three transmit buffers with internal prioritization
— Flexible identifier acceptance filter programmable as:
– 2 x 32-bit
– 4 x 16-bit
– 8 x 8-bit
— Wake-up with integrated low pass filter option
— Loop back for self test
— Listen-only mode to monitor CAN bus
— Bus-off recovery by software intervention or automatically
— 16-bit time stamp of transmitted/received messages
•TIM (standard timer module)
— 8 x 16-bit channels for input capture or output compare
— 16-bit free-running counter with 8-bit precision prescaler
— 1 x 16-bit pulse accumulator
•PIT (periodic interrupt timer)
— Up to four timers with independent time-out periods
— Time-out periods selectable between 1 and 2
24
bus clock cycles
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor21
Page 22
Device Overview S12XS Family
— Time-out interrupt and peripheral triggers
— Start of timers can be aligned
•Up to 8 channel x 8-bit or 4 channel x 16-bit Pulse Width Modulator
— Programmable period and duty cycle per channel
— Center- or left-aligned outputs
— Programmable clock select logic with a wide range of frequencies
•Serial Peripheral Interface Module (SPI)
— Configurable for 8 or 16-bit data size
— Full-duplex or single-wire bidirectional
— Double-buffered transmit and receive
— Master or Slave mode
— MSB-first or LSB-first shifting
— Serial clock phase and polarity options
•Two Serial Communication Interfaces (SCI)
— Full-duplex or single wire operation
— Standard mark/space non-return-to-zero (NRZ) format
— Selectable IrDA 1.4 return-to-zero-inverted (RZI) format with programmable pulse widths
— 13-bit baud rate selection
— Programmable character length
— Programmable polarity for transmitter and receiver
— Receive wakeup on active edge
— Break detect and transmit collision detect supporting LIN
•On-Chip Voltage Regulator
— Two parallel, linear voltage regulators with bandgap reference
— Low-voltage detect (LVD) with low-voltage interrupt (LVI)
— Power-on reset (POR) circuit
— Low-voltage reset (LVR)
•Low-power wake-up timer (API)
— Internal oscillator driving a down counter
— Trimmable to +/-5% accuracy
— Time-out periods range from 0.2ms to ~13s with a 0.2ms resolution
•Input/Output
— Up to 91 general-purpose input/output (I/O) pins depending on the package option and 2 input-
only pins
— Hysteresis and configurable pull up/pull down device on all input pins
— Configurable drive strength on all output pins
Reserved register space shown in Table 1-1 is not allocated to any module.
This register space is reserved for future use. Writing to these locations has
no effect. Read access to these locations returns zero.
1.1.5Address Mapping
Figure 1-2 shows S12XS CPU and BDM local address translation to the global memory map. It indicates
also the location of the internal resources in the memory map.
S12XS Family Reference Manual, Rev. 1.13
26Freescale Semiconductor
Page 27
Device Overview S12XS Family
CPU and BDM
Local Memory Map
0x0000
0x0800
0x0C00
0x1000
0x2000
0x4000
2K REGISTERS
1K DFLASH window
Reserved
4K RAM window
8K RAM
Unpaged
16K FLASH
EPAGE
RPAGE
0x00_0000
0x00_07FF
RAM_LOW
0x0F_FFFF
DF_HIGH
0x13_FFFF
Global Memory Map
2K REGISTERS
Unimplemented
RAM
RAM
RAMSIZE
DFLASH
DFLASH
Resources
0x8000
0xC000
0xFFFF
16K FLASH window
Unpaged
16K FLASH
Vectors
Unimplemented
PPAGE
0x3F_FFFF
Unimplemented
FLASH_LOW
0x7F_FFFF
Figure 1-2. S12XS Family Global Memory Map
Space
FLASH
FLASH
FLASHSIZE
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor27
Page 28
Device Overview S12XS Family
Accessing the reserved area in the range of 0x0C00 to 0x0FFF will return undefined data values.
A CPU access to any unimplemented space causes an illegal address reset.
The range between 0x10_0000 and 0x13_FFFF is mapped to DFLASH (Data Flash). The DFLASH block
sizes are listed in Table 1-2.
Table 1-2. Derivative Dependent Memory Parameters of Device Internal Resources
Number of 16K pages addressable via PPAGE register
1
Number of 4K pages addressing the RAM via PPAGE register
2
Number of 1K pages addressing the DFLASH via the EPAGE register starting upwards from 0x00
3
SIZE/
PPAGE
1
RAM_LOW
SIZE/
RPAGE
2
DF_HIGH
SIZE/
EPAGE
3
1.1.6Detailed Register Map
The detailed register map is listed in the appendix of the reference manual.
1.1.7Part ID Assignments
The part ID is located in two 8-bit registers PARTIDH and PARTIDL (addresses 0x001A and 0x001B).
The read-only value is a unique part ID for each revision of the chip. Table 1-3 shows the assigned part ID
number and Mask Set number.
The Version ID is a word located in a flash information row at 0x40_00E8. The version ID number
indicates a specific version of internal NVM variables used to patch NVM errata. The default is no patch
(0xFFFF).
Bit 15-12: Major family identifier
Bit 11-6: Minor family identifier
Bit 5-4: Major mask set revision number including FAB transfers
Bit 3-0: Minor — non full — mask set revision
S12XS Family Reference Manual, Rev. 1.13
28Freescale Semiconductor
1
Version ID
Page 29
Device Overview S12XS Family
1.2Signal Description
This section describes signals that connect off-chip. It includes a pinout diagram, a table of signal
properties, and detailed discussion of signals. It is built from the signal description sections of the
individual IP blocks on the device.
1.2.1Device Pinout
The XS family of devices offers pin-compatible packaged devices to assist with system development and
accommodate expansion of the application.
The S12XS family devices are offered in the following package options:
“X” denotes reset condition, “O” denotes a possiblererouting
1
under software control
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor33
Page 34
34Freescale Semiconductor
Table 1-6 provides a pin out summary listing the availability and functionality of individual pins for each package option.
Device Overview S12XS Family
S12XS Family Reference Manual, Rev. 1.13
Table 1-6. Pin-Out Summary
Package TerminalFunction
LQFP
112
QFP80LQFP
64
Pin
2nd
Func.
3rd
Func.
4th
Func.
5th
Func.
111PP3KWP3PWM3——V
1
Power
Supply
DDX
Internal Pull
Resistor
Description
CTRL
Reset
State
PERP/PPSPDisabledPort P I/O, interrupt,
PWM channel
222PP2KWP2PWM2IOC2TXD1V
DDX
PERP/PPSPDisabledPort P I/O, interrupt,
PWM/TIMchannel,TXD
of SCI1
333PP1KWP1PWM1IOC1—V
DDX
PERP/PPSPDisabledPort P I/O, interrupt,
PWM/TIM channel
444PP0KWP0PWM0IOC0RXD1V
DDX
PERP/PPSPDisabledPort P I/O, interrupt,
PWM/TIM channel,
RXD of SCI1
5--PK3————V
6--PK2————V
7--PK1————V
8--PK0————V
955PT0IOC0———V
1066PT1IOC1———V
1177PT2IOC2———V
1288PT3IOC3———V
DDX
DDX
DDX
DDX
DDX
DDX
DDX
DDX
PUCRUpPort K I/O
PUCRUpPort K I/O
PUCRUpPort K I/O
PUCRUpPort K I/O
PERT/PPSTDisabledPort T I/O, TIM channel
PERT/PPSTDisabledPort T I/O, TIM channel
PERT/PPSTDisabledPort T I/O, TIM channel
PERT/PPSTDisabledPort T I/O, TIM channel
PUCRDisabledPort B I/O
PUCRDisabledPort B I/O
PUCRDisabledPort B I/O
PUCRDisabledPort B I/O
PUCRDisabledPort B I/O
PUCRDisabledPort B I/O
PUCRDisabledPort B I/O
PUCRDisabledPort B I/O
PERH/PPSHDisabledPort H I/O, interrupt
PERH/PPSHDisabledPort H I/O, interrupt
PERH/PPSHDisabledPort H I/O, interrupt
PERH/PPSHDisabledPort H I/O, interrupt
PERH/PPSHDisabledPort H I/O, interrupt
PERH/PPSHDisabledPort H I/O, interrupt
PERH/PPSHDisabledPort H I/O, interrupt
PERH/PPSHDisabledPort H I/O, interrupt
PUCRDisabledPort A I/O
PUCRDisabledPort A I/O
PUCRDisabledPort A I/O
PUCRDisabledPort A I/O
PUCRDisabledPort A I/O
PUCRDisabledPort A I/O
PUCRDisabledPort A I/O
PUCRDisabledPort A I/O
654937VDD————————
665038VSS2————————
675139PAD00AN00———V
DDA
PER1ADDisabledPort AD I/O,
analog input of ATD
68--PAD08AN08———V
DDA
PER0ADDisabledPort AD I/O,
analog input of ATD
695240PAD01AN01———V
DDA
PER1ADDisabledPort AD I/O,
analog input of ATD
70--PAD09AN09———V
DDA
PER0ADDisabledPort AD I/O,
analog input of ATD
715341PAD02AN02———V
DDA
PER1ADDisabledPort AD I/O,
analog input of ATD
Device Overview S12XS Family
Page 38
38Freescale Semiconductor
Table 1-6. Pin-Out Summary1 (continued)
Device Overview S12XS Family
S12XS Family Reference Manual, Rev. 1.13
Package TerminalFunction
LQFP
112
QFP80LQFP
64
Pin
2nd
Func.
3rd
Func.
4th
Func.
5th
Func.
72--PAD10AN10———V
735442PAD03AN03———V
74--PAD11AN11———V
755543PAD04AN04———V
76--PAD12AN12———V
775644PAD05AN05———V
78--PAD13AN13———V
795745PAD06AN06———V
Power
Supply
DDA
DDA
DDA
DDA
DDA
DDA
DDA
DDA
Internal Pull
Resistor
Description
CTRL
Reset
State
PER0ADDisabledPort AD I/O,
analog input of ATD
PER1ADDisabledPort AD I/O,
analog input of ATD
PER0ADDisabledPort AD I/O,
analog input of ATD
PER1ADDisabledPort AD I/O,
analog input of ATD
PER0ADDisabledPort AD I/O,
analog input of ATD
PER1ADDisabledPort AD I/O,
analog input of ATD
PER0ADDisabledPort AD I/O,
analog input of ATD
PER1ADDisabledPort AD I/O,
analog input of ATD
80--PAD14AN14———V
DDA
PER0ADDisabledPort AD I/O,
analog input of ATD
815846PAD07AN07———V
DDA
PER1ADDisabledPort AD I/O,
analog input of ATD
82--PAD15AN15———V
DDA
PER0ADDisabledPort AD I/O,
analog input of ATD
835947VDDA————————
846048VRH————————
856149VRL
PERM/PPSMDisabledPort M I/O
PERM/PPSMDisabledPort M I/O
PERS/PPSSUpPort S I/O, RXD of SCI0
PERS/PPSSUpPort S I/O, TXD of SCI0
PERS/PPSSUpPort S I/O, RXD of SCI1
PERS/PPSSUpPort S I/O, TXD of SCI1
PERS/PPSSUpPortS I/O, MISO of SPI0
PERS/PPSSUpPortS I/O, MOSI of SPI0
PERS/PPSSUpPort S I/O, SCK of SPI0
PERS/PPSSUpPort S I/O, SS of SPI0
Table shows a superset of pin functions. Not all functions are available on all derivatives
1
For compatibility to XE family
2
VRL and VSSA share single pin on 64 package option
3
Page 41
Device Overview S12XS Family
1.2.3Detailed Signal Descriptions
NOTE
The pin list of the largest package version of each S12XS Family derivative
gives the complete of interface signals that also exist on smaller package
options, although some of them are not bonded out. For devices assembled
in smaller 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-6 for affected pins.
1.2.3.1EXTAL, XTAL — Oscillator Pins
EXTAL and XTAL are the crystal driver and external clock pins. On reset all the device clocks are derived
from the EXTAL input frequency. XTAL is the oscillator output.
1.2.3.2RESET — External Reset Pin
The RESET pin is an active low bidirectional control signal. It acts as an input to initialize the MCU to a
known start-up state. As an output it is driven low to indicate when any internal MCU reset source triggers.
RESET pin has an internal pull-up device.
The
1.2.3.3TEST — Test Pin
This input only pin is reserved for factory test. This pin has a pull-down device.
NOTE
The TEST pin must be tied to V
in all applications.
SS
1.2.3.4BKGD / MODC — Background Debug and Mode Pin
The BKGD/MODC pin is used as a pseudo-open-drain pin for the background debug communication. It
is used as a MCU operating mode select pin during reset. The state of this pin is latched to the MODC bit
at the rising edge of
RESET. The BKGD pin has an internal pull-up device.
1.2.3.5PAD[15:0] / AN[15:0] — Port AD Input Pins of ATD0
PAD[15:0] are general-purpose input or output pins and analog inputs AN[15:0] of the analog-to-digital
converter ATD0.
1.2.3.6PA[7:0] — Port A I/O Pins
PA[7:0] are general-purpose input or output pins.
1.2.3.7PB[7:0] — Port B I/O Pins
PB[7:0] are general-purpose input or output pins.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor41
Page 42
Device Overview S12XS Family
1.2.3.8PE7 / ECLKX2 / XCLKS — Port E I/O Pin 7
PE7 is a general-purpose input or output pin. ECLKX2 is a clock output of twice the internal bus
frequency. The
loop controlled Pierce oscillator is used or whether full swing Pierce oscillator/external clock circuitry is
used (refer to Section 1.10 Oscillator Configuration). An internal pull-up is enabled during reset.
XCLKS is an input signal which controls whether a crystal in combination with the internal
1.2.3.9PE[6:5] — Port E I/O Pin 6-5
PE[6:5] are a general-purpose input or output pins.
1.2.3.10PE4 / ECLK — Port E I/O Pin 4
PE4 is a general-purpose input or output pin. It can be configured to output the internal bus clock ECLK.
ECLK can be used as a timing reference. The ECLK output has a programmable prescaler.
1.2.3.11PE[3:2] — Port E I/O Pin 3
PE[3:2] are a general-purpose input or output pins.
1.2.3.12PE1 / IRQ — Port E Input Pin 1
PE1 is a general-purpose input pin and the maskable interrupt request input that provides a means of
applying asynchronous interrupt requests. This will wake up the MCU from stop or wait mode.
1.2.3.13PE0 / XIRQ — Port E Input Pin 0
PE0 is a general-purpose input pin and the non-maskable interrupt request input that provides a means of
applying asynchronous interrupt requests. This will wake up the MCU from stop or wait mode. The XIRQ
interrupt is level sensitive and active low. As XIRQ is level sensitive, while this pin is low the MCU will
not enter STOP mode.
1.2.3.14PH[7:0] / KWH[7:0] — Port H I/O Pins
PH[7:0] are a general-purpose input or output pins. They can be configured as keypad wakeup inputs.
1.2.3.15PJ[7:6] / KWJ[7:6] — PORT J I/O Pins 7-6
PJ[7:6] are a general-purpose input or output pins. They can be configured as keypad wakeup inputs.
1.2.3.16PJ[1:0] / KWJ[1:0] — PORT J I/O Pins 1-0
PJ[1:0] are a general-purpose input or output pins. They can be configured as keypad wakeup inputs.
1.2.3.17PK[7,5:0] — Port K I/O Pins 7 and 5-0
PK[7,5:0] are a general-purpose input or output pins.
S12XS Family Reference Manual, Rev. 1.13
42Freescale Semiconductor
Page 43
Device Overview S12XS Family
1.2.3.18PM[7:6] — Port M I/O Pins 7-6
PM[7:6] are a general-purpose input or output pins.
1.2.3.19PM5 / SCK0 — Port M I/O Pin 5
PM5 is a general-purpose input or output pin. It can be configured as the serial clock pin SCK of the serial
peripheral interface 0 (SPI0).
1.2.3.20PM4 / MOSI0 — Port M I/O Pin 4
PM4 is a general-purpose input or output pin. It can be configured as the master output (during master
mode) or slave input pin (during slave mode) MOSI for the serial peripheral interface 0 (SPI0).
1.2.3.21PM3 / SS0 — Port M I/O Pin 3
PM3 is a general-purpose input or output pin. It can be configured as the slave select pin SS of the serial
peripheral interface 0 (SPI0).
1.2.3.22PM2 / MISO0 — Port M I/O Pin 2
PM2 is a general-purpose input or output pin. It can be configured as the master input (during master
mode) or slave output pin (during slave mode) MISO for the serial peripheral interface 0 (SPI0).
1.2.3.23PM1 / TXCAN0 / TXD1 — Port M I/O Pin 1
PM1 is a general-purpose input or output pin. It can be configured as the transmit pin TXCAN of the
scalable controller area network controller 0 (CAN0). It can be configured as the transmit pin TXD of
serial communication interface 1 (SCI1).
1.2.3.24PM0 / RXCAN0 / RXD1 — Port M I/O Pin 0
PM0 is a general-purpose input or output pin. It can be configured as the receive pin RXCAN of the
scalable controller area network controller 0 (CAN0). It can be configured as the receive pin RXD of serial
communication interface 1 (SCI1).
1.2.3.25PP7 / KWP7 / PWM7 — Port P I/O Pin 7
PP7 is a general-purpose input or output pin. It can be configured as keypad wakeup input. It can be
configured as pulse width modulator (PWM) channel 7 output or emergency shutdown input.
1.2.3.26PP[6:3] / KWP[6:3] / PWM[6:3] — Port P I/O Pins 6-3
PP[6:3] are a general-purpose input or output pins. They can be configured as keypad wakeup inputs. They
can be configured as pulse width modulator (PWM) channel 6-3 output.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor43
Page 44
Device Overview S12XS Family
1.2.3.27PP2 / KWP2 / PWM2 / TXD1 / IOC2 — Port P I/O Pin 2
PP2 is a general-purpose input or output pin. It can be configured as a keypad wakeup input. It can be
configured as pulse width modulator (PWM) channel 2 output, TIM channel 2 or as the transmit pin TXD
of serial communication interface 1 (SCI1).
1.2.3.28PP1 / KWP1 / PWM1 / IOC1 — Port P I/O Pin 1
PP1 is a general-purpose input or output pin. It can be configured as a keypad wakeup input. It can be
configured as pulse width modulator (PWM) channel 1 output, TIM channel 1.
1.2.3.29PP0 / KWP0 / PWM0 / RXD1 / IOC0 — Port P I/O Pin 0
PP0 is a general-purpose input or output pin. It can be configured as a keypad wakeup input. It can be
configured as pulse width modulator (PWM) channel 0 output, TIM channel 0 or as the receive pin RXD
of serial communication interface 1 (SCI1).
1.2.3.30PS7 / SS0 — Port S I/O Pin 7
PS7 is a general-purpose input or output pin. It can be configured as the slave select pin SS of the serial
peripheral interface 0 (SPI0).
1.2.3.31PS6 / SCK0 — Port S I/O Pin 6
PS6 is a general-purpose input or output pin. It can be configured as the serial clock pin SCK of the serial
peripheral interface 0 (SPI0).
1.2.3.32PS5 / MOSI0 — Port S I/O Pin 5
PS5 is a general-purpose input or output pin. It can be configured as master output (during master mode)
or slave input pin (during slave mode) MOSI of the serial peripheral interface 0 (SPI0).
1.2.3.33PS4 / MISO0 — Port S I/O Pin 4
PS4 is a general-purpose input or output pin. It can be configured as master input (during master mode) or
slave output pin (during slave mode) MOSI of the serial peripheral interface 0 (SPI0).
1.2.3.34PS3 / TXD1 — Port S I/O Pin 3
PS3 is a general-purpose input or output pin. It can be configured as the transmit pin TXD of serial
communication interface 1 (SCI1).
1.2.3.35PS2 / RXD1 — Port S I/O Pin 2
PS2 is a general-purpose input or output pin. It can be configured as the receive pin RXD of serial
communication interface 1 (SCI1).
S12XS Family Reference Manual, Rev. 1.13
44Freescale Semiconductor
Page 45
Device Overview S12XS Family
1.2.3.36PS1 / TXD0 — Port S I/O Pin 1
PS1 is a general-purpose input or output pin. It can be configured as the transmit pin TXD of serial
communication interface 0 (SCI0).
1.2.3.37PS0 / RXD0 — Port S I/O Pin 0
PS0 is a general-purpose input or output pin. It can be configured as the receive pin RXD of serial
communication interface 0 (SCI0).
1.2.3.38PT[7:6] / IOC[7:6] / PWM[7:6] — Port T I/O Pins 7-6
PT[7:6] are general-purpose input or output pins. They can be configured as timer (TIM) channel 7-6 or
pulse width modulator (PWM) outputs 7-6
1.2.3.39PT5 / IOC5 / VREG_API — Port T I/O Pin 5
PT[5] is a general-purpose input or output pin. It can be configured as timer (TIM) channel 5, pulse width
modulator (PWM) output 5 or as the VREG_API signal output.
1.2.3.40PT4 / IOC4 / PWM4 — Port T I/O Pin 4
PT4 is a general-purpose input or output pin. It can be configured as timer (TIM) channel 4 or pulse width
modulator (PWM) output 4.
1.2.3.41PT[3:0] / IOC[3:0] — Port T I/O Pin [3:0]
PT[3:0] are a general-purpose input or output pins. They can be configured as timer (TIM) channels 3-0.
1.2.4Power Supply Pins
S12XS Family power and ground pins are described below.
Because fast 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.
NOTE
All V
1.2.4.1VDDX[2:1], VSSX[2:1] — Power and Ground Pins for I/O Drivers
External power and ground for I/O drivers. Bypass requirements depend on how heavily the MCU pins are
loaded. All V
DDX
pins must be connected together in the application.
SS
pins are connected together internally. All V
SSX
pins are connected together internally.
1.2.4.2VDDR — Power Pin for Internal Voltage Regulator
Power supply input to the internal voltage regulator.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor45
Page 46
Device Overview S12XS Family
1.2.4.3VDD, VSS2, VSS3 — Core Power Pins
The voltage supply of nominally 1.8 V is derived from the internal voltage regulator. The return current
path is through the VSS2 and VSS3 pins. No static external loading of these pins is permitted.
1.2.4.4VDDF, VSS1 — NVM Power Pins
The voltage supply of nominally 2.8 V is derived from the internal voltage regulator. The return current
path is through the VSS1 pin. No static external loading of these pins is permitted.
1.2.4.5VDDA, VSSA — Power Supply Pins for ATD and Voltage Regulator
These are the power supply and ground input pins for the analog-to-digital converters and the voltage
regulator.
1.2.4.6VRH, VRL — ATD Reference Voltage Input Pins
VRH and VRL are the reference voltage input pins for the analog-to-digital converter.
1.2.4.7VDDPLL, VSSPLL — Power Supply Pins for PLL
These pins provide operating voltage and ground for the oscillator and the phased-locked loop. The voltage
supply of nominally 1.8 V is derived from the internal voltage regulator. This allows the supply voltage to
the oscillator and PLL to be bypassed independently. This voltage is generated by the internal voltage
regulator. No static external loading of these pins is permitted.
Table 1-7. Power and Ground Connection Summary
Mnemonic
VDDR5.0 VExternal power supply to internal voltage
VDDX[2:1]5.0 VExternal power and ground, supply to pin
VSSX[2:1]0 V
VDDA5.0 VOperating voltage and ground for the
VSSA0 V
VRL0 VReferencevoltages for the analog-to-digital
VRH5.0 V
VDD1.8 VInternal power and ground generated by
VSS1, VSS2,
VSS3
Nominal
Voltage
0 V
Description
regulator
drivers
analog-to-digital converters and the
reference for the internal voltage regulator,
allows the supply voltage to the A/D to be
bypassed independently.
converter.
internal regulator for the internal core.
VDDF2.8 VInternal power and ground generated by
internal regulator for the internal NVM.
S12XS Family Reference Manual, Rev. 1.13
46Freescale Semiconductor
Page 47
Device Overview S12XS Family
Table 1-7. Power and Ground Connection Summary
Mnemonic
VDDPLL1.8 VProvides operating voltage and ground for
VSSPLL0 V
Nominal
Voltage
Description
the phased-locked loop. This allows the
supply voltage to the PLL to be bypassed
independently. Internal power and ground
generated by internal regulator.
S12XS Family Reference Manual, Rev. 1.13
47Freescale Semiconductor
Page 48
Device Overview S12XS Family
1.3System Clock Description
The clock and reset generator module (CRG) provides the internal clock signals for the core and all
peripheral modules. Figure 1-6 shows the clock connections from the CRG to all modules.
Consult the S12XECRG section for details on clock generation.
NOTE
The XS family uses the XE family clock and reset generator module.
Therefore all CRG references are related to S12XECRG.
SCI0 . . SCI 1
SPI0
CAN0
ATD0
Bus Clock
PIT
EXTAL
CRG
XTAL
Core Clock
RAMS12XFLASH
Figure 1-6. Clock Connections
Oscillator Clock
TIM
PIM
PWM
The system clock can be supplied in several ways enabling a range of system operating frequencies to be
supported:
•The on-chip phase locked loop (PLL)
•the PLL self clocking
•the oscillator
S12XS Family Reference Manual, Rev. 1.13
48Freescale Semiconductor
Page 49
Device Overview S12XS Family
The clock generated by the PLL or oscillator provides the main system clock frequencies core clock and
bus clock. As shown in Figure 1-6, these system clocks are used throughout the MCU to drive the core,
the memories, and the peripherals.
The program Flash memory is supplied by the bus clock and the oscillator clock. The oscillator clock is
used as a time base to derive the program and erase times for the NVMs.
The CAN modules may be configured to have their clock sources derived either from the bus clock or
directly from the oscillator clock. This allows the user to select its clock based on the required jitter
performance.
In order to ensure the presence of the clock the MCU includes an on-chip clock monitor connected to the
output of the oscillator. The clock monitor can be configured to invoke the PLL self-clocking mode or to
generate a system reset if it is allowed to time out as a result of no oscillator clock being present.
In addition to the clock monitor, the MCU also provides a clock quality checker which performs a more
accurate check of the clock. The clock quality checker counts a predetermined number of clock edges
within a defined time window to insure that the clock is running. The checker can be invoked following
specific events such as on wake-up or clock monitor failure.
1.4Modes of Operation
The MCU can operate in different modes. These are described in 1.4.1 Chip Configuration Summary.
The MCU can operate in different power modes to facilitate power saving when full system performance
is not required. These are described in 1.4.2 Power Modes.
Some modules feature a software programmable option to freeze the module status whilst the background
debug module is active to facilitate debugging. This is described in 1.4.3 Freeze Mode.
1.4.1Chip Configuration Summary
The different modes and the security state of the MCU affect the debug features (enabled or disabled).
The operating mode out of reset is determined by the state of the MODC signal during reset (see Table 1-
8). The MODC bit in the MODE register shows the current operating mode and provides limited mode
switching during operation. The state of the MODC signal is latched into this bit on the rising edge of
RESET.
Table 1-8. Chip Modes
Chip ModesMODC
Normal single chip1
Special single chip0
1.4.1.1Normal Single-Chip Mode
This mode is intended for normal device operation. The opcode from the on-chip memory is being
executed after reset (requires the reset vector to be programmed correctly). The processor program is
executed from internal memory.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor49
Page 50
Device Overview S12XS Family
1.4.1.2Special Single-Chip Mode
This mode is used for debugging single-chip operation, boot-strapping, or security related operations. The
background debug module BDM is active in this mode. The CPU executes a monitor program located in
an on-chip ROM. BDM firmware waits for additional serial commands through the BKGD pin.
1.4.2Power Modes
The MCU features two main low-power modes. Consult the respective section for module specific
behavior in system stop, system pseudo stop, and system wait mode. An important source of information
about the clock system is the Clock and Reset Generator section (CRG).
1.4.2.1System Stop Modes
The system stop modes are entered if the CPU executes the STOP instruction unless an NVM command
is active. Depending on the state of the PSTP bit in the CLKSEL register the MCU goes into pseudo stop
mode or full stop mode. Please refer to CRG section. Asserting
that is not masked exits system stop modes. System stop modes can be exited by CPU activity, depending
on the configuration of the interrupt request.
If the CPU executes the STOP instruction whilst an NVM command is being processed, then the system
clocks continue running until NVM activity is completed. If a non-masked interrupt occurs within this time
then the system does not effectively enter stop mode although the STOP instruction has been executed.
RESET, XIRQ, IRQ or any other interrupt
1.4.2.2Full Stop Mode
The oscillator is stopped in this mode. By default all clocks are switched off and all counters and dividers
remain frozen. The Autonomous Periodic Interrupt (API) and ATD module may be enabled to self wake
the device. A Fast wake up mode is available to allow the device to wake from Full Stop mode immediately
on the PLL internal clock without starting the oscillator clock.
1.4.2.3Pseudo Stop Mode
In this mode the system clocks are stopped but the oscillator is still running and the real time interrupt
(RTI) and watchdog (COP), API and ATD modules may be enabled. Other peripherals are turned off. This
mode consumes more current than system stop mode but, as the oscillator continues to run, the full speed
wake up time from this mode is significantly shorter.
1.4.2.4Wait Mode
This mode is entered when the CPU executes the WAI instruction. In this mode the CPU will not execute
instructions. The internal CPU clock is switched off. All peripherals can be active in system wait mode.
For further power consumption the peripherals can individually turn off their local clocks. Asserting
RESET, XIRQ, IRQ or any other interrupt that is not masked ends system wait mode.
S12XS Family Reference Manual, Rev. 1.13
50Freescale Semiconductor
Page 51
Device Overview S12XS Family
1.4.2.5Run Mode
Although this is not a low-power mode, unused peripheral modules should not be enabled in order to save
power.
1.4.3Freeze Mode
The timer module, pulse width modulator, analog-to-digital converters, and the periodic interrupt timer
provide a software programmable option to freeze the module status when the background debug module
is active. This is useful when debugging application software. For detailed description of the behavior of
the ATD, TIM, PWM, and PIT when the background debug module is active consult the corresponding
section.
1.5Security
The MCU security mechanism prevents unauthorized access to the Flash memory. For a detailed
description of the security features refer to the S12XS9SEC section.
1.6Resets and Interrupts
Consult the CPU12/CPU12X Reference Manual and the S12XINT section for information on exception
processing.
NOTE
When referring to the S12XINT section please be aware that the XS family
neither features an XGATE nor an MPU module.
1.6.1Resets
Resets are explained in detail in the Clock Reset Generator (S12XECRG) section.
Vector base+ $DCTIM Pulse accumulator A overflowI bitPACTL (PAOVI)NoYes
1
Interrupt Source
IRQI bitIRQCR (IRQEN)YesYes
CCR
Mask
Local Enable
STOP
Wake up
interrupt section
Wake up
WAIT
Vector base + $DATIM Pulse accumulator input edgeI bitPACTL (PAI)NoYes
Vector base + $D8SPI0I bitSPI0CR1 (SPIE, SPTIE)NoYes
Vector base+ $D6SCI0I bitSCI0CR2
(TIE, TCIE, RIE, ILIE)
Vector base + $D4SCI1I bitSCI1CR2
(TIE, TCIE, RIE, ILIE)
Vector base + $D2ATD0I bitATD0CTL2 (ASCIE)YesYes
Vector base + $D0
Vector base + $CEPort JI bitPIEJ (PIEJ7-PIEJ0)YesYes
Vector base + $CCPort HI bitPIEH (PIEH7-PIEH0)YesYes
Vector base + $CA
Vector base + $C8
Vector base + $C6CRG PLL lockI bitCRGINT(LOCKIE)Refer to CRG
Vector base + $C4CRG self-clock modeI bitCRGINT (SCMIE)Refer to CRG
Vector base + $C2
to
Vector base + $BC
Reserved
Reserved
Reserved
Reserved
YesYes
YesYes
interrupt section
interrupt section
S12XS Family Reference Manual, Rev. 1.13
52Freescale Semiconductor
Page 53
Table 1-10. Interrupt Vector Locations (Sheet 2 of 2)
Device Overview S12XS Family
Vector Address
Vector base + $BAFLASH Fault DetectI bit FCNFG2 (SFDIE, DFDIE)NoNo
Vector base + $B8FLASHI bitFCNFG (CCIE)NoYes
Vector base + $B6CAN0 wake-upI bitCAN0RIER (WUPIE)YesYes
Vector base + $B4CAN0 errorsI bitCAN0RIER (CSCIE,
Vector base + $B2CAN0 receiveI bitCAN0RIER (RXFIE)NoYes
Vector base + $B0CAN0 transmitI bitCAN0TIER (TXEIE[2:0])NoYes
Vector base + $AE
to
Vector base + $90
Vector base + $8EPort P InterruptI bitPIEP (PIEP7-PIEP0)YesYes
Vector base + $80Low-voltage interrupt (LVI)I bitVREGCTRL (LVIE)NoYes
Vector base + $7EAutonomous periodical interrupt (API)I bitVREGAPICTRL (APIE)YesYes
Vector base + $7CHigh Temperature Interrupt (HTI)I bitVREGHTCL (HTIE)NoYes
1
Interrupt Source
CCR
Mask
Reserved
Reserved
Local Enable
OVRIE)
STOP
Wake up
NoYes
WAIT
Wake up
Vector base + $7APeriodic interrupt timer channel 0I bitPITINTE (PINTE0)NoYes
Vector base + $78Periodic interrupt timer channel 1I bitPITINTE (PINTE1)NoYes
Vector base + $76Periodic interrupt timer channel 2I bitPITINTE (PINTE2)NoYes
Vector base + $74Periodic interrupt timer channel 3I bitPITINTE (PINTE3)NoYes
Vector base + $72
to
Vector base + $40
Vector base + $3EATD0 Compare InterruptI bitATD0CTL2 (ACMPIE)YesYes
Vector base + $3C
to
Vector base + $14
Vector base + $12System Call Interrupt (SYS)—None——
Vector base + $10Spurious interrupt—None——
16 bits vector address based
1
Reserved
Reserved
1.6.3Effects of Reset
When a reset occurs, MCU registers and control bits are initialized. Refer to the respective block sections
for register reset states.
On each reset, the Flash module executes a reset sequence to load Flash configuration registers.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor53
Page 54
Device Overview S12XS Family
1.6.3.1Flash Configuration Reset Sequence Phase
On each reset, the Flash module will hold CPU activity while loading Flash module registers from the
Flash memory. If double faults are detected in the reset phase, Flash module protection and security may
be active on leaving reset. This is explained in more detail in the Flash module section.
1.6.3.2Reset While Flash Command Active
If a reset occurs while any Flash command is in progress, that command will be immediately aborted. The
state of the word being programmed or the sector/block being erased is not guaranteed.
1.6.3.3I/O Pins
Refer to the PIM section for reset configurations of all peripheral module ports.
1.6.3.4Memory
The RAM arrays are not initialized out of reset.
1.6.3.5COP Configuration
The COP time-out rate bits CR[2:0] and the WCOP bit in the COPCTL register are loaded from the Flash
register FOPT. See Table 1-11 and Table 1-12 for coding. The FOPT register is loaded from the Flash
configuration field byte at global address $7FFF0E during the reset sequence.
If the MCU is secured the COP time-out rate is always set to the longest period (CR[2:0] = 111) after any
reset into Special Single Chip mode.
The ATD module includes four external trigger inputs ETRIG0, ETRIG1, ETRIG2, and ETRIG3. The
external trigger allows the user to synchronize ATD conversion to external trigger events. Table 1-13
shows the connection of the external trigger inputs.
Consult the ATD section for information about the analog-to-digital converter module. References to
freeze mode are equivalent to active BDM mode.
1.7.2ATD0 Channel[17] Connection
Further to the 16 externally available channels, ATD0 features an extra channel[17] that is connected to
the internal temperature sensor at device level. To access this channel ATD0 must use the channel encoding
SC:CD:CC:CB:CA = 1:0:0:0:1 in ATDCTL5. For more temperature sensor information, please refer to
1.8.1 Temperature Sensor Configuration.
1.8VREG Configuration
The device must be configured with the internal voltage regulator enabled. Operation in conjunction with
an external voltage regulator is not supported.
The API trimming register APITR is loaded from the Flash IFR option field at global address 0x40_00F0
bits[5:0] during the reset sequence. Currently factory programming of this IFR range is not supported.
Read access to reserved VREG register space returns “0”. Write accesses have no effect. This device does
not support access abort of reserved VREG register space.
1.8.1Temperature Sensor Configuration
The VREG high temperature trimming register bits VREGHTTR[3:0] are loaded from the internal Flash
during the reset sequence. To use the high temperature interrupt within the specified limits (T
T
) these bits must be loaded with 0x8. Currently factory programming is not supported.
HTID
The device temperature can be monitored on ATD0 channel[17]. The internal bandgap reference voltage
can also be mapped to ATD0 analog input channel[17]. The voltage regulator VSEL bit when set, maps
the bandgap and, when clear, maps the temperature sensor to ATD0 channel[17].
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor55
HTIA
and
Page 56
Device Overview S12XS Family
1.9BDM Clock Configuration
The BDM alternate clock source is the oscillator clock.
1.10Oscillator Configuration
The XCLKS is an input signal which controls whether a crystal in combination with the internal loop
controlled (low power) Pierce oscillator is used or whether full swing Pierce oscillator/external clock
circuitry is used.
XCLKS signal selects the oscillator configuration during reset low phase while a clock quality check
The
is ongoing. This is the case for:
• Power on reset or low-voltage reset
• Clock monitor reset
• Any reset while in self-clock mode or full stop mode
S12XS Family Reference Manual, Rev. 1.13
56Freescale Semiconductor
Page 57
Device Overview S12XS Family
The selected oscillator configuration is frozen with the rising edge of the RESET pin in any of these above
described reset cases.
V01.0808 Jul 2011Table 2-2./2-65 • Corrected typo in PPSP register name in register map
V01.0911 Sep 2012 • Minor editorial corrections
Revision Date
Sections
Affected
2.3.56/2-111
2.3.57/2-112
Description of Changes
• Corrected addresses of PPSH,PIEH and PIFH in Register Descriptions
2.1Introduction
2.1.1Overview
The S12XS family Port Integration Module establishes the interface between the peripheral modules and
the I/O pins for all ports. It controls the electrical pin properties as well as the signal prioritization and
multiplexing on shared pins.
This document covers:
•Port A, B and K used as general purpose I/O
•Port E associated with the
•Port T associated with 1 timer module
IRQ, XIRQ interrupt inputs
•Port S associated with 2 SCI module and 1 SPI module
•Port M associated with 1 MSCAN
•Port P connected to the PWM - inputs can be used as an external interrupt source
•Port H and J used as general purpose I/O - inputs can be used as an external interrupt source
•Port AD associated with one 16-channel ATD module
Most I/O pins can be configured by register bits to select data direction and drive strength, to enable and
select pull-up or pull-down devices.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor59
Page 60
Port Integration Module (S12XSPIMV1)
NOTE
This document assumes the availability of all features (112-pin package
option). Some functions are not available on lower pin count package
options. Refer to the pin-out summary section.
2.1.2Features
The Port Integration Module includes these distinctive registers:
•Data and data direction registers for Ports A, B, E, K, T, S, M, P, H, J, and AD when used as
general-purpose I/O
•Control registers to enable/disable pull-device and select pull-ups/pull-downs on Ports T, S, M, P,
H, and J on per-pin basis
•Control registers to enable/disable pull-up devices on Port AD on per-pin basis
•Single control register to enable/disable pull-ups on Ports A, B, E, and K on per-port basis and on
BKGD pin
•Control registersto enable/disable reduced output driveon Ports T,S, M, P, H, J, and AD onper-pin
basis
•Single control register to enable/disable reduced output drive on Ports A, B, E, and K on per-port
basis
•Control registers to enable/disable open-drain (wired-or) mode on Ports S, and M
•Interrupt flag register for pin interrupts on Ports P, H, and J
•Control register to configure
IRQ pin operation
•Routing registers to support module port relocation
•Free-running clock outputs
A standard port pin has the following minimum features:
•Input/output selection
•5V output drive with two selectable drive strengths
•5V digital and analog input
•Input with selectable pull-up or pull-down device
Optional features supported on dedicated pins:
•Open drain for wired-or connections
•Interrupt inputs with glitch filtering
2.2External Signal Description
This section lists and describes the signals that connect off-chip.
Table 2-1 shows all the pins and their functions that are controlled by the Port Integration Module. Refer
to the device definition for the availability of the individual pins in the different package options.
S12XS Family Reference Manual, Rev. 1.13
60Freescale Semiconductor
Page 61
Port Integration Module (S12XSPIMV1)
NOTE
If there is more than one function associated with a pin, the priority is
indicated by the position in the table from top (highest priority) to bottom
(lowest priority)
Table 2-1. Pin Functions and Priorities
Port Pin Name
-BKGDMODC
APA[7:0]GPIOI/O General purposeGPIO
BPB[7:0]GPIOI/O General purposeGPIO
EPE[7]XCLKS
PE[6:5]GPIOI/O General purpose
PE[4]ECLKO Free-running clock at bus clock rate or programmable
PE[3:2]GPIOI/O General purpose
PE[1]
PE[0]XIRQINon-maskable level-sensitive interrupt
Pin Function
& Priority
2
BKGDI/O S12X_BDM communication pin
ECLKX2O Free-running clock at core clock rate (ECLK x 2)
GPIOI/O General purpose
GPIOI/O General purpose
IRQIMaskable level- or falling edge-sensitive interrupt
GPIIGeneral-purpose
I/ODescription
1
IMODC input during RESETBKGD
2
IExternal clock selection input during RESETGPIO
down-scaled bus clock
Pin Function
after Reset
GPIIGeneral-purpose
KPK[7,5:0]GPIOI/O General purposeGPIO
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor61
Page 62
Port Integration Module (S12XSPIMV1)
Table 2-1. Pin Functions and Priorities (continued)
(TXD1)O Serial Communication Interface 1 transmit pin
GPIO/KWP2I/O General purpose; with interrupt
(IOC1)I/O Timer Channel 1
GPIO/KWP1I/O General purpose; with interrupt
(IOC0)I/O Timer Channel 0
(RXD1)ISerial Communication Interface 1 receive pin
GPIO/KWP0I/O General purpose; with interrupt
I/ODescription
1
Pin Function
after Reset
HPH[7:0]GPIO/KWH[7:0]I/O General purpose; with interruptGPIO
JPJ[7:6]GPIO/KWJ[7:6]I/O General purpose; with interruptGPIO
PJ[1:0]GPIO/KWJ[1:0]I/O General purpose; with interrupt
ADPAD[15:0]GPIOI/O General purposeGPIO
AN[15:0]IATD analog
1
Signals in brackets denote alternative module routing pins.
2
Function active when RESET asserted.
2.3Memory Map and Register Definition
This section provides a detailed description of all Port Integration Module registers.
S12XS Family Reference Manual, Rev. 1.13
64Freescale Semiconductor
Page 65
Port Integration Module (S12XSPIMV1)
2.3.1Memory Map
Table 2-2 shows the register map of the Port Integration Module.
Table 2-2. Block Memory Map
Offset or
Port
Address
AB0x0000PORTA—Port A Data RegisterR/W0x002.3.3/2-75
0x0001PORTB—Port B Data RegisterR/W0x002.3.4/2-75
0x0002DDRA—Port A Data Direction RegisterR/W0x002.3.5/2-76
0x0003DDRB—Port B Data Direction RegisterR/W0x002.3.6/2-76
RegisterAccess Reset Value Section/Page
0x0004
PIM ReservedR0x002.3.7/2-77
:
0x0007
E0x0008PORTE—Port E Data RegisterR/W
0x0009DDRE—Port E Data Direction RegisterR/W
0x000A
Non-PIM address range
2
1
1
0x002.3.8/2-77
0x002.3.9/2-78
---
:
0x000B
0x000CPUCR—Pull-up Control RegisterR/W
A
B
0x000DRDRIV—Reduced Drive RegisterR/W
E
1
1
0xD02.3.10/2-79
0x002.3.11/2-80
K
0x000E
Non-PIM address range
2
---
:
0x001B
1
E0x001CECLKCTL—ECLK Control RegisterR/W
0b3100_00002.3.12/2-81
0x001DPIM ReservedR0x002.3.13/2-82
0x001EIRQCR—IRQ Control RegisterR/W
K0x0032PORTK—Port K Data RegisterR/W0x002.3.16/2-84
0x0033DDRK—Port K Data Direction RegisterR/W0x002.3.17/2-84
0x0034
Non-PIM address range
2
---
:
0x023F
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor65
Page 66
Port Integration Module (S12XSPIMV1)
Table 2-2. Block Memory Map (continued)
Offset or
Port
Address
T0x0240PTT—Port T Data RegisterR/W0x002.3.18/2-85
0x0241PTIT—Port T Input RegisterR
0x0242DDRT—Port T Data Direction RegisterR/W0x002.3.20/2-87
0x0243RDRT—Port T Reduced Drive RegisterR/W0x002.3.21/2-87
0x0244PERT—Port T Pull Device Enable RegisterR/W0x002.3.22/2-88
0x0245PPST—Port T Polarity Select RegisterR/W0x002.3.23/2-88
0x0246PIM ReservedR0x002.3.24/2-89
0x0247Port T Routing RegisterR/W0x002.3.25/2-89
S0x0248PTS—Port S Data RegisterR/W0x002.3.26/2-91
0x0249PTIS—Port S Input RegisterR
0x024ADDRS—Port S Data Direction RegisterR/W0x002.3.28/2-93
0x024BRDRS—Port S Reduced Drive RegisterR/W0x002.3.29/2-94
RegisterAccess Reset Value Section/Page
4
4
2.3.19/2-86
2.3.27/2-92
0x024CPERS—Port S Pull Device Enable RegisterR/W0xFF2.3.30/2-94
0x024DPTPS—Port S Polarity Select RegisterR/W0x002.3.31/2-95
0x024EWOMS—Port S Wired-Or Mode RegisterR/W0x002.3.32/2-95
0x024FPIM ReservedR0x002.3.33/2-96
M0x0250PTM—Port M Data RegisterR/W0x002.3.34/2-96
0x0251PTIM—Port M Input RegisterR
4
2.3.35/2-98
0x0252DDRM—Port M Data Direction RegisterR/W0x002.3.36/2-98
0x0253RDRM—Port M Reduced Drive RegisterR/W0x002.3.37/2-99
0x0254PERM—Port M Pull Device Enable RegisterR/W0x002.3.38/2-100
0x0255PPSM—Port M Polarity Select RegisterR/W0x002.3.39/2-100
0x0256WOMM—Port M Wired-Or Mode RegisterR/W0x002.3.40/2-101
0x0257MODRR—Module Routing RegisterR/W0x002.3.41/2-101
P0x0258PTP—Port P Data RegisterR/W0x002.3.42/2-102
0x0259PTIP—Port P Input RegisterR
4
2.3.43/2-104
0x025ADDRP—Port P Data Direction RegisterR/W0x002.3.44/2-105
0x025BRDRP—Port P Reduced Drive RegisterR/W0x002.3.45/2-106
0x025CPERP—Port P Pull Device Enable RegisterR/W0x002.3.46/2-106
0x025DPPSP—Port P Polarity Select RegisterR/W0x002.3.47/2-107
0x025EPIEP—Port P Interrupt Enable RegisterR/W0x002.3.48/2-107
0x025FPIFP—Port P Interrupt Flag RegisterR/W0x002.3.49/2-108
S12XS Family Reference Manual, Rev. 1.13
66Freescale Semiconductor
Page 67
Port Integration Module (S12XSPIMV1)
Table 2-2. Block Memory Map (continued)
Offset or
Port
Address
H0x0260PTH—Port H Data RegisterR/W0x002.3.50/2-108
0x0261PTIH—Port H Input RegisterR
0x0262DDRH—Port H Data Direction RegisterR/W0x002.3.52/2-109
0x0263RDRH—Port H Reduced Drive RegisterR/W0x002.3.53/2-110
0x0264PERH—Port H Pull Device Enable RegisterR/W0x002.3.54/2-110
0x0265PPSH—Port H Polarity Select RegisterR/W0x002.3.55/2-111
0x0266PIEH—Port H Interrupt Enable RegisterR/W0x002.3.56/2-111
0x0267PIFH—Port H Interrupt Flag RegisterR/W0x002.3.57/2-112
J0x0268PTJ—Port J Data RegisterR/W0x002.3.58/2-112
0x0269PTIJ—Port J Input RegisterR
0x026ADDRJ—Port J Data Direction RegisterR/W0x002.3.60/2-113
0x026BRDRJ—Port J Reduced Drive RegisterR/W0x002.3.61/2-114
The following table summarizes the effect of the various configuration bits, i.e. data direction (DDR),
output level (IO), reduced drive (RDR), pull enable (PE), pull select (PS) on the pin function and pull
device activity.
The configuration bit PS is used for two purposes:
1. Configure the sensitive interrupt edge (rising or falling), if interrupt enabled.
2. Select either a pull-up or pull-down device if PE is active.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor73
Page 74
Port Integration Module (S12XSPIMV1)
Table 2-3. Pin Configuration Summary
DDRIORDRPEPS
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
Always “0” on Port A, B, E, K, and AD.
2
Applicable only on Port P, H, and J.
1
IE
2
FunctionPull DeviceInterrupt
NOTE
All register bits in this module are completely synchronous to internal
clocks during a register read.
NOTE
Figures of port data registers also display the alternative functions if
applicable on the related pin as defined in Table 2-1. Names in brackets
denote the availability of the function when using a specific routing option.
NOTE
Figures of module routing registers also display the module instance or
module channel associated with the related routing bit.
S12XS Family Reference Manual, Rev. 1.13
74Freescale Semiconductor
Page 75
2.3.3Port A Data Register (PORTA)
Port Integration Module (S12XSPIMV1)
Address 0x0000 (PRR)Access: User read/write
76543210
R
W
Reset00000000
PA7PA6PA5PA4PA3PA2PA1PA0
Figure 2-1. Port A Data Register (PORTA)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
Table 2-4. PORTA Register Field Descriptions
FieldDescription
7-0
PA
Port A general purpose input/output data—Data Register
The associated pin can be used as general purpose I/O. In general purpose output mode the register bit value is
driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
2.3.4Port B Data Register (PORTB)
Address 0x0001 (PRR)Access: User read/write
1
1
76543210
R
W
Reset00000000
PB7PB6PB5PB4PB3PB2PB1PB0
Figure 2-2. Port B Data Register (PORTB)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
Table 2-5. PORTB Register Field Descriptions
FieldDescription
7-0
PB
Port B general purpose input/output data—Data Register
The associated pin can be used as general purpose I/O. In general purpose output mode the register bit value is
driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor75
Page 76
Port Integration Module (S12XSPIMV1)
2.3.5Port A Data Direction Register (DDRA)
Address 0x0002 (PRR)Access: User read/write
76543210
R
DDRA7DDRA6DDRA5DDRA4DDRA3DDRA2DDRA1DDRA0
W
Reset00000000
Figure 2-3. Port A Data Direction Register (DDRA)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
Table 2-6. DDRA Register Field Descriptions
FieldDescription
7-0
DDRA
Port A Data Direction—
This bit determines whether the associated pin is an input or output.
1 Associated pin configured as output
0 Associated pin configured as input
2.3.6Port B Data Direction Register (DDRB)
Address 0x0003 (PRR)Access: User read/write
1
1
76543210
R
DDRB7DDRB6DDRB5DDRB4DDRB3DDRB2DDRB1DDRB0
W
Reset00000000
Figure 2-4. Port B Data Direction Register (DDRB)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
Table 2-7. DDRB Register Field Descriptions
FieldDescription
7-0
DDRB
Port B Data Direction—
This bit determines whether the associated pin is an input or output.
1 Associated pin configured as output
0 Associated pin configured as input
S12XS Family Reference Manual, Rev. 1.13
76Freescale Semiconductor
Page 77
2.3.7PIM Reserved Registers
Port Integration Module (S12XSPIMV1)
Address 0x0004 (PRR) to 0x0007 (PRR)Access: User read
76543210
R00000000
W
Reset00000000
= Unimplemented or Reserved
Figure 2-5. PIM Reserved Registers
1
Read: Always reads 0x00
Write: Unimplemented
2.3.8Port E Data Register (PORTE)
Address 0x0008 (PRR)Access: User read/write
76543210
W
Altern.
Function
R
PE7PE6PE5PE4PE3PE2
XCLKS——ECLK——IRQXIRQ
PE1PE0
1
1
ECLKX2———————
Reset000000—
2
—
= Unimplemented or Reserved
Figure 2-6. Port E Data Register (PORTE)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
2
These registers are reset to zero. Two bus clock cycles after reset release the register values are updated with the associated
pin values.
2
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor77
Page 78
Port Integration Module (S12XSPIMV1)
Table 2-8. PORTE Register Field Descriptions
FieldDescription
7
PE
6-5, 3-2PEPort E general purpose input/output data—Data Register
4
PE
1
PE
0
PE
Port E general purpose input/output data—Data Register, ECLKX2 output,
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The ECLKX2 output function takes precedence over the general purpose I/O function if enabled.
• The external clock selection feature (
The associated pin can be used as general purpose I/O. In general purpose output mode the register bit value is
driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
Port E general purpose input/output data—Data Register, ECLK output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The ECLK output function takes precedence over the general purpose I/O function if enabled.
Port E general purpose input data and interrupt—Data Register,
This pin can be used as general purpose and
Port E general purpose input data and interrupt—Data Register, XIRQ input.
This pin can be used as general purpose and
XCLKS) is only active during RESET=0
IRQ input.
XIRQ input.
XCLKS input
IRQ input.
2.3.9Port E Data Direction Register (DDRE)
Address 0x0009 (PRR)Access: User read/write
76543210
R
DDRE7DDRE6DDRE5DDRE4DDRE3DDRE2
W
Reset00000000
= Unimplemented or Reserved
Figure 2-7. Port E Data Direction Register (DDRE)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
00
1
S12XS Family Reference Manual, Rev. 1.13
78Freescale Semiconductor
Page 79
Table 2-9. DDRE Register Field Descriptions
FieldDescription
Port Integration Module (S12XSPIMV1)
7-2
DDRE
Port E Data Direction—
This bit determines whether the associated pin is an input or output.
1 Associated pin configured as output
0 Associated pin configured as input
2.3.10Ports ABEK, BKGD pin Pull-up Control Register (PUCR)
Address 0x000C (PRR)Access: User read/write
76543210
R
PUPKEBKPUE
W
Reset11010000
= Unimplemented or Reserved
Figure 2-8. Ports ABEK, BKGD pin Pull-up Control Register (PUCR)
1
Read: Anytime in single-chip modes
Write: Anytime, except BKPUE which is writable in Special Single-Chip Mode only
Table 2-10. PUCR Register Field Descriptions
FieldDescription
0
PUPEE
00
PUPBEPUPAE
1
7
PUPKE
6
BKPUE
4
PUPEE
Port K Pull-up Enable—Enable pull-up devices on all port input pins
This bit configures whether a pull-up device is activated on all associated port input pins. If a pin is used as output
this bit has no effect.
BKGD pin pull-up Enable—Enable pull-up device on pin
This bit configures whether a pull-up device is activated, if the pin is used as input. If a pin is used as output this bit
has no effect.
Port E Pull-up Enable—Enable pull-up devices on all port input pins except pins 5 and 6
This bit configures whether a pull-up device is activated on all associated port input pins. If a pin is used as output
this bit has no effect.
Pins 5 and 6 have pull-down devices enabled only during reset. This bit has no effect on these pins.
Table 2-10. PUCR Register Field Descriptions (continued)
FieldDescription
1
PUPBE
0
PUPAE
Port B Pull-up Enable—Enable pull-up devices on all port input pins
This bit configures whether a pull-up device is activated on all associated port input pins. If a pin is used as output
this bit has no effect.
Port A Pull-up Enable—Enable pull-up devices on all port input pins
This bit configures whether a pull-up device is activated on all associated port input pins. If a pin is used as output
this bit has no effect.
Read: Anytime, the data source depends on the data direction value
Write: Anytime
This register is used to select reduced drive for the pins associated with ports A, B, E, and K. If enabled,
the pins drive at approx. 1/5 of the full drive strength.
Table 2-11. RDRIV Register Field Descriptions
FieldDescription
7
RDPK
4
RDPE
Port K reduced drive—Select reduced drive for output port
This bit configures the drive strength of all associated port output pins as either full or reduced. If a pin is used as
input this bit has no effect. The reduced drivefunction is independent of which function is being used on a particular
pin.
1 Reduced drive selected (approx. 1/5 of the full drive strength)
0 Full drive strength enabled
Port E reduced drive—Select reduced drive for output port
This bit configures the drive strength of all associated port output pins as either full or reduced. If a pin is used as
input this bit has no effect. The reduced drivefunction is independent of which function is being used on a particular
pin.
1 Reduced drive selected (approx. 1/5 of the full drive strength)
0 Full drive strength enabled
S12XS Family Reference Manual, Rev. 1.13
80Freescale Semiconductor
Page 81
Table 2-11. RDRIV Register Field Descriptions (continued)
FieldDescription
Port Integration Module (S12XSPIMV1)
1
RDPB
0
RDPA
Port B reduced drive—Select reduced drive for output port
This bit configures the drive strength of all associated port output pins as either full or reduced. If a pin is used as
input this bit has no effect. The reduced drivefunction is independent of which function is being used on a particular
pin.
1 Reduced drive selected (approx. 1/5 of the full drive strength)
0 Full drive strength enabled
Port A reduced drive—Select reduced drive for output port
This bit configures the drive strength of all associated port output pins as either full or reduced. If a pin is used as
input this bit has no effect. The reduced drivefunction is independent of which function is being used on a particular
pin.
1 Reduced drive selected (approx. 1/5 of the full drive strength)
0 Full drive strength enabled
2.3.12ECLK Control Register (ECLKCTL)
Address 0x001C (PRR)Access: User read/write
76543210
R
NECLKNCLKX2DIV16EDIV4EDIV3EDIV2EDIV1EDIV0
W
Mode
Reset:
Depen-
dent
1000000
1
Special
single-chip
Normal
single-chip
1
Read: Anytime
Write: Anytime
01000000
11000000
= Unimplemented or Reserved
Figure 2-10. ECLK Control Register (ECLKCTL)
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor81
Page 82
Port Integration Module (S12XSPIMV1)
Table 2-12. ECLKCTL Register Field Descriptions
FieldDescription
7
NECLK
6
NCLKX2
5
DIV16
4-0
EDIV
No ECLK—Disable ECLK output
This bit controls the availabilityof a free-running clock on the ECLK pin. This clock has a fixed rate equivalent to the
internal bus clock.
1 ECLK disabled
0 ECLK enabled
No ECLKX2—Disable ECLKX2 output
This bit controls the availability of a free-running clock on the ECLKX2 pin. This clock has a fixed rate of twice the
internal bus clock.
1 ECLKX2 disabled
0 ECLKX2 enabled
Free-running ECLK predivider—Divide by 16
This bit enables a divide-by-16 stage on the selected EDIV rate.
Free-running ECLK Divider—Configure ECLK rate
These bits determine the rate of the free-running clock on the ECLK pin.
00000 ECLK rate = bus clock rate
00001 ECLK rate = bus clock rate divided by 2
00010 ECLK rate = bus clock rate divided by 3
...
11111 ECLK rate = bus clock rate divided by 32
2.3.13PIM Reserved Register
Address 0x001D (PRR)Access: User read
76543210
R00000000
W
Reset00000000
= Unimplemented or Reserved
Figure 2-11. PIM Reserved Register
1
Read: Always reads 0x00
Write: Unimplemented
S12XS Family Reference Manual, Rev. 1.13
82Freescale Semiconductor
1
Page 83
2.3.14IRQ Control Register (IRQCR)
Port Integration Module (S12XSPIMV1)
Address 0x001EAccess: User read/write
76543210
R
IRQEIRQEN
W
Reset01000000
= Unimplemented or Reserved
000000
Figure 2-12. IRQ Control Register (IRQCR)
1
Read: See individual bit descriptions below
Write: See individual bit descriptions below
Table 2-13. IRQCR Register Field Descriptions
FieldDescription
7
IRQE
IRQ select edge sensitive only—
Special mode: Read or write anytime
Normal mode: Read anytime, write once
1
IRQ configured to respond only to falling edges. Falling edges on the IRQ pin will be detected anytime IRQE=1
and will be cleared only upon a reset or the servicing of the
0
IRQ configured for low level recognition.
IRQ interrupt.
1
6
IRQEN
2.3.15PIM Reserved Register PIMTEST
IRQ enable—
Read or write anytime
1
IRQ pin is connected to interrupt logic.
0
IRQ pin is disconnected from interrupt logic.
1
This register is reserved for factory testing of the PIM module and is not available in normal operation.
Writing to this register when in special modes can alter the pin functionality.
Address 0x001FAccess: User read
76543210
R00000000
W
Reset00000000
= Unimplemented or Reserved
Figure 2-13. PIM Reserved Register
1
1. Implementation pim_xe.01.01 and later
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor83
Page 84
Port Integration Module (S12XSPIMV1)
1
Read: Always reads 0x00
Write: Unimplemented
2.3.16Port K Data Register (PORTK)
Address 0x0032 (PRR)Access: User read/write
76543210
R
PK7
0
PK5PK4PK3PK2PK1PK0
W
Reset00000000
Figure 2-14. Port K Data Register (PORTK)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
Table 2-14. PORTK Register Field Descriptions
FieldDescription
7,5-0PKPort K general purpose input/output data—Data Register
The associated pin can be used as general purpose I/O. In general purpose output mode the register bit value is
driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
2.3.17Port K Data Direction Register (DDRK)
Address 0x0033 (PRR)Access: User read/write
1
1
76543210
R
DDRK7
0
DDRK5DDRK4DDRK3DDRK2DDRK1DDRK0
W
Reset00000000
Figure 2-15. Port K Data Direction Register (DDRK)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
S12XS Family Reference Manual, Rev. 1.13
84Freescale Semiconductor
Page 85
Table 2-15. DDRK Register Field Descriptions
FieldDescription
Port Integration Module (S12XSPIMV1)
7,5-0
DDRK
Port K Data Direction—
This bit determines whether the associated pin is an input or output.
1 Associated pin configured as output
0 Associated pin configured as input
2.3.18Port T Data Register (PTT)
Address 0x0240Access: User read/write
76543210
R
PTT7PTT6PTT5PTT4PTT3PTT2PTT1PTT0
W
Altern.
Function
Reset00000000
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
IOC7IOC6IOC5IOC4IOC3IOC2IOC1IOC0
(PWM7)(PWM6)(PWM5)(PWM4)————
——VREG_API—————
Figure 2-16. Port T Data Register (PTT)
1
Table 2-16. PTT Register Field Descriptions
FieldDescription
7-6, 4
PTT
Port T general purpose input/output data—Data Register, TIM output, routed PWM output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The TIM output function takes precedence over the routed PWM and the general purpose I/O function if the
related channel is enabled.
• The routed PWM function takes precedence over the general purpose I/O function if the related channel is
enabled.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor85
Page 86
Port Integration Module (S12XSPIMV1)
Table 2-16. PTT Register Field Descriptions (continued)
FieldDescription
5
PTT
3-0
PTT
Port T general purpose input/output data—Data Register, TIM output, routed PWM output, VREG_API output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The TIM output function takes precedence over the routed PWM, VREG_API function and the general purpose
I/O function if the related channel is enabled.
• The routed PWM function takes precedence over VREG_API and the general purpose I/O function if the related
channel is enabled.
• The VREG_API takes precedence over the general purpose I/O function if enabled.
Port T general purpose input/output data—Data Register, TIM output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• TheTIM output function takes precedence over the general purpose I/O function if the related channel is enabled.
2.3.19Port T Input Register (PTIT)
Address 0x0241Access: User read
76543210
RPTIT7PTIT6PTIT5PTIT4PTIT3PTIT2PTIT1PTIT0
1
W
Resetuuuuuuuu
= Unimplemented or Reservedu = Unaffected by reset
Figure 2-17. Port T Input Register (PTIT)
1
Read: Anytime
Write:Never, writes to this register have no effect
Table 2-17. PTIT Register Field Descriptions
FieldDescription
7-0
PTIT
Port T input data—
A read always returns the buffered input state of the associated pin. It can be used to detect overload or short circuit
conditions on output pins.
S12XS Family Reference Manual, Rev. 1.13
86Freescale Semiconductor
Page 87
2.3.20Port T Data Direction Register (DDRT)
Port Integration Module (S12XSPIMV1)
Address 0x0242Access: User read/write
76543210
R
DDRT7DDRT6DDRT5DDRT4DDRT3DDRT2DDRT1DDRT0
W
Reset00000000
Figure 2-18. Port T Data Direction Register (DDRT)
1
Read: Anytime
Write: Anytime
Table 2-18. DDRT Register Field Descriptions
FieldDescription
7-6, 4
DDRT
5
DDRT
Port T data direction—
This bit determines whether the pin is an input or output.
The TIM forces the I/O state to be an output for a timer port associated with an enabled output compare. Else the
routed PWM forces the I/O state to be an output for an enabled channel. In these cases the data direction bit will not
change.
1 Associated pin configured as output
0 Associated pin configured as input
Port T data direction—
This bit determines whether the pin is an input or output.
The TIM forces the I/O state to be an output for a timer port associated with an enabled output compare. Else the
routed PWM forces the I/O state to be an output for an enabled channel. Else the VREG_API forces the I/O state to
be an output if enabled. In these cases the data direction bit will not change.
1
1 Associated pin configured as output
0 Associated pin configured as input
3-0
DDRT
Port T data direction—
This bit determines whether the pin is an input or output.
The TIM forces the I/O state to be an output for a timer port associated with an enabled output compare. In this case
the data direction bit will not change.
1 Associated pin configured as output
0 Associated pin configured as input
2.3.21Port T Reduced Drive Register (RDRT)
Address 0x0243Access: User read/write
76543210
R
RDRT7RDRT6RDRT5RDRT4RDRT3RDRT2RDRT1RDRT0
W
Reset00000000
Figure 2-19. Port T Reduced Drive Register (RDRT)
S12XS Family Reference Manual, Rev. 1.13
1
Freescale Semiconductor87
Page 88
Port Integration Module (S12XSPIMV1)
1
Read: Anytime
Write: Anytime
Table 2-19. RDRT Register Field Descriptions
FieldDescription
7-0
RDRT
Port T reduced drive—Select reduced drive for output pin
This bit configures the drive strength of the associated output pin as either full or reduced. If a pin is used as input
this bit has no effect. The reduced drive function is independent of which function is being used on a particular pin.
1 Reduced drive selected (approx. 1/5 of the full drive strength)
0 Full drive strength enabled
2.3.22Port T Pull Device Enable Register (PERT)
Address 0x0244Access: User read/write
76543210
R
PERT7PERT6PERT5PERT4PERT3PERT2PERT1PERT0
W
Reset00000000
Figure 2-20. Port T Pull Device Enable Register (PERT)
1
Read: Anytime
Write: Anytime
Table 2-20. PERT Register Field Descriptions
FieldDescription
1
7-0
PERT
Port T pull device enable—Enable pull device on input pin
This bit controls whether a pull device on the associated port input pin is active. If a pin is used as output this bit has
no effect. The polarity is selected by the related polarity select register bit.
1 Pull device enabled
0 Pull device disabled
2.3.23Port T Polarity Select Register (PPST)
Address 0x0245Access: User read/write
76543210
R
PPST7PPST6PPST5PPST4PPST3PPST2PPST1PPST0
W
Reset00000000
Figure 2-21. Port T Polarity Select Register (PPST)
1
Read: Anytime
Write: Anytime
S12XS Family Reference Manual, Rev. 1.13
88Freescale Semiconductor
1
Page 89
Table 2-21. PPST Register Field Descriptions
FieldDescription
Port Integration Module (S12XSPIMV1)
7-0
PPST
Port T pull device select—Configure pull device polarity on input pin
This bit selects a pull-up or a pull-down device if enabled on the associated port input pin.
1 A pull-down device selected
0 A pull-up device selected
2.3.24PIM Reserved Register
Address 0x0246Access: User read
76543210
R00000000
W
Reset00000000
= Unimplemented or Reserved
Figure 2-22. PIM Reserved Register
1
Read: Always reads 0x00
Write: Unimplemented
2.3.25Port T Routing Register (PTTRR)
1
Address 0x0247Access: User read
76543210
R
PTTRR7PTTRR6PTTRR5PTTRR4
W
Routing
Option
Reset00000000
PWM7PWM6PWM5PWM4—IOC2IOC1IOC0
= Unimplemented or Reserved
0
PTTRR2PTTRR1PTTRR0
Figure 2-23. Port T Routing Register (PTTRR)
1
Read: Anytime
Write: Anytime
This register configures the re-routing of PWM and TIM channels on alternative pins.
1
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor89
Page 90
Port Integration Module (S12XSPIMV1)
Table 2-22. PTTRR Register Field Descriptions
FieldDescription
7
PTTRR
6
PTTRR
5
PTTRR
4
PTTRR
2
PTTRR
Port T peripheral routing—
This register controls the routing of PWM channel 7.
1 PWM7 routed to PT7
0 PWM7 routed to PP7
Port T peripheral routing—
This register controls the routing of PWM channel 6.
1 PWM6 routed to PT6
0 PWM6 routed to PP6
Port T peripheral routing—
This register controls the routing of PWM channel 5.
1 PWM5 routed to PT5
0 PWM5 routed to PP5
Port T peripheral routing—
This register controls the routing of PWM channel 4.
1 PWM4 routed to PT4
0 PWM4 routed to PP4
Port T peripheral routing—
This register controls the routing of TIM channel 2.
1 IOC2 routed to PP2
0 IOC2 routed to PT2
1
PTTRR
0
PTTRR
Port T peripheral routing—
This register controls the routing of TIM channel 1.
1 IOC1 routed to PP1
0 IOC1 routed to PT1
Port T peripheral routing—
This register controls the routing of TIM channel 0.
1 IOC0 routed to PP0
0 IOC0 routed to PT0
S12XS Family Reference Manual, Rev. 1.13
90Freescale Semiconductor
Page 91
2.3.26Port S Data Register (PTS)
Port Integration Module (S12XSPIMV1)
Address 0x0248Access: User read/write
76543210
R
PTS7PTS6PTS5PTS4PTS3PTS2PTS1PTS0
W
Altern.
Function
Reset00000000
SS0SCK0MOSI0MISO0TXD1RXD1TXD0RXD0
Figure 2-24. Port S Data Register (PTS)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
Table 2-23. PTS Register Field Descriptions
FieldDescription
7
PTS
Port S general purpose input/output data—Data Register, SPI0
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
SS input/output
1
6
PTS
5
PTS
4
PTS
Port S general purpose input/output data—Data Register, SPI0 SCK input/output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
Port S general purpose input/output data—Data Register, SPI0 MOSI input/output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
Port S general purpose input/output data—Data Register, SPI0 MISO input/output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor91
Page 92
Port Integration Module (S12XSPIMV1)
Table 2-23. PTS Register Field Descriptions (continued)
FieldDescription
3
PTS
2
PTS
1
PTS
0
PTS
Port S general purpose input/output data—Data Register, SCI1 TXD output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SCI1 function takes precedence over the general purpose I/O function if enabled.
Port S general purpose input/output data—Data Register, SCI1 RXD input
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SCI1 function takes precedence over the general purpose I/O function if enabled.
Port S general purpose input/output data—Data Register, SCI0 TXD output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SCI0 function takes precedence over the general purpose I/O function if enabled.
Port S general purpose input/output data—Data Register, SCI0 RXD input
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SCI0 function takes precedence over the general purpose I/O function if enabled.
2.3.27Port S Input Register (PTIS)
Address 0x0249Access: User read
76543210
RPTIS7PTIS6PTIS5PTIS4PTIS3PTIS2PTIS1PTIS0
W
Resetuuuuuuuu
= Unimplemented or Reservedu = Unaffected by reset
Figure 2-25. Port S Input Register (PTIS)
1
Read: Anytime
Write:Never, writes to this register have no effect
1
S12XS Family Reference Manual, Rev. 1.13
92Freescale Semiconductor
Page 93
Table 2-24. PTIS Register Field Descriptions
FieldDescription
Port Integration Module (S12XSPIMV1)
7-0
PTIS
Port S input data—
A read always returns the buffered input state of the associated pin. It can be used to detect overload or short circuit
conditions on output pins.
2.3.28Port S Data Direction Register (DDRS)
Address 0x0249Access: User read/write
76543210
R
DDRS7DDRS6DDRS5DDRS4DDRS3DDRS2DDRS1DDRS0
W
Reset00000000
Figure 2-26. Port S Data Direction Register (DDRS)
1
Read: Anytime
Write: Anytime
Table 2-25. DDRS Register Field Descriptions
FieldDescription
7-4
DDRS
Port S data direction—
This bit determines whether the associated pin is an input or output.
Depending on the configuration of the enabledSPI0 the I/O state will be forced to be input or output. In this case the
data direction bit will not change.
1
3-2
DDRS
1-0
DDRS
1 Associated pin configured as output
0 Associated pin configured as input
Port S data direction—
This bit determines whether the associated pin is an input or output.
Depending on the configuration of the enabled SCI1 the I/O state will be forced to be input or output. In this case the
data direction bit will not change.
1 Associated pin configured as output
0 Associated pin configured as input
Port S data direction—
This bit determines whether the associated pin is an input or output.
Depending on the configuration of the enabled SCI0 the I/O state will be forced to be input or output. In this case the
data direction bit will not change.
1 Associated pin configured as output
0 Associated pin configured as input
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor93
Page 94
Port Integration Module (S12XSPIMV1)
2.3.29Port S Reduced Drive Register (RDRS)
Address 0x024AAccess: User read/write
76543210
R
RDRS7RDRS6RDRS5RDRS4RDRS3RDRS2RDRS1RDRS0
W
Reset00000000
Figure 2-27. Port S Reduced Drive Register (RDRS)
1
Read: Anytime
Write: Anytime
Table 2-26. RDRS Register Field Descriptions
FieldDescription
7-0
RDRS
Port S reduced drive—Select reduced drive for output pin
This bit configures the drive strength of the associated output pin as either full or reduced. If a pin is used as input
this bit has no effect. The reduced drive function is independent of which function is being used on a particular pin.
1 Reduced drive selected (approx. 1/5 of the full drive strength)
0 Full drive strength enabled
2.3.30Port S Pull Device Enable Register (PERS)
1
Address 0x024BAccess: User read/write
76543210
R
PERS7PERS6PERS5PERS4PERS3PERS2PERS1PERS0
W
Reset11111111
Figure 2-28. Port S Pull Device Enable Register (PERS)
1
Read: Anytime
Write: Anytime
Table 2-27. PERS Register Field Descriptions
FieldDescription
7-0
PERS
Port S pull device enable—Enable pull device on input pin or wired-or output pin
This bit controls whether a pull device on the associated port input pin is active. If a pin is used as output this bit has
only effect if used in wired-or mode. The polarity is selected by the related polarity select register bit.
1 Pull device enabled
0 Pull device disabled
1
S12XS Family Reference Manual, Rev. 1.13
94Freescale Semiconductor
Page 95
2.3.31Port S Polarity Select Register (PPSS)
Port Integration Module (S12XSPIMV1)
Address 0x024CAccess: User read/write
76543210
R
PPSS7PPSS6PPSS5PPSS4PPSS3PPSS2PPSS1PPSS0
W
Reset00000000
Figure 2-29. Port S Polarity Select Register (PPSS)
1
Read: Anytime
Write: Anytime
Table 2-28. PPSS Register Field Descriptions
FieldDescription
7-0
PPSS
Port S pull device select—Configure pull device polarity on input pin
This bit selects a pull-up or a pull-down device if enabled on the associated port input pin.
1 A pull-down device selected
0 A pull-up device selected
2.3.32Port S Wired-Or Mode Register (WOMS)
Address 0x024CAccess: User read/write
1
1
76543210
R
WOMS7WOMS6WOMS5WOMS4WOMS3WOMS2WOMS1WOMS0
W
Reset00000000
Figure 2-30. Port S Wired-Or Mode Register (WOMS)
1
Read: Anytime
Write: Anytime
Table 2-29. WOMS Register Field Descriptions
FieldDescription
7-0
WOMS
Port S wired-or mode—Enable open-drain functionality on output pin
This bit configures an output pin as wired-or (open-drain) or push-pull independent of the function used on the pins.
In wired-or mode a logic “0” is driven active low while a logic “1” remains undriven. This allows a multipoint
connection of several serial modules. The bit has no influence on pins used as input.
1 Output buffer operates as open-drain output.
0 Output buffer operates as push-pull output.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor95
Page 96
Port Integration Module (S12XSPIMV1)
2.3.33PIM Reserved Register
Address 0x024FAccess: User read
76543210
R00000000
W
Reset00000000
= Unimplemented or Reservedu = Unaffected by reset
Figure 2-31. PIM Reserved Register
1
Read: Always reads 0x00
Write: Unimplemented
2.3.34Port M Data Register (PTM)
Address 0x0250Access: User read/write
76543210
R
PTM7PTM6PTM5PTM4PTM3PTM2PTM1PTM0
W
Altern.
Function
——(SCK0)(MOSI0)(
SS0)(MISO0)TXCAN0RXCAN0
1
1
——————(TXD1)(RXD1)
Reset00000000
Figure 2-32. Port M Data Register (PTM)
1
Read: Anytime, the data source depends on the data direction value
Write: Anytime
Table 2-30. PTM Register Field Descriptions
FieldDescription
7-6
PTM
5
PTM
Port M general purpose input/output data—Data Register
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
Port M general purpose input/output data—Data Register, routed SPI0 SCK input/output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
S12XS Family Reference Manual, Rev. 1.13
96Freescale Semiconductor
Page 97
Table 2-30. PTM Register Field Descriptions (continued)
FieldDescription
Port Integration Module (S12XSPIMV1)
4
PTM
3
PTM
2
PTM
1
PTM
Port M general purpose input/output data—Data Register, routed SPI0 MOSI input/output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
Port M general purpose input/output data—Data Register, routed SPI0
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
Port M general purpose input/output data—Data Register, routed SPI0 MISO input/output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The SPI0 function takes precedence over the general purpose I/O function if enabled.
Port M general purpose input/output data—Data Register, CAN0 TXCAN output, SCI1 TXD output
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
SS input/output
0
PTM
• The CAN0 function takes precedence over the general purpose I/O function if enabled.
• The SCI1 function takes precedence over the general purpose I/O function if enabled.
Port M general purpose input/output data—Data Register, CAN0 RXCAN input, SCI1 RXD input
When not used with the alternative function, the associated pin can be used as general purpose I/O. In general
purpose output mode the register bit value is driven to the pin.
If the associated data direction bit is set to 1, a read returns the value of the port register bit, otherwise the buffered
pin input state is read.
• The CAN0 function takes precedence over the general purpose I/O function if enabled.
• The SCI1 function takes precedence over the general purpose I/O function if enabled.
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor97
Page 98
Port Integration Module (S12XSPIMV1)
2.3.35Port M Input Register (PTIM)
Address 0x0251Access: User read
76543210
RPTIM7PTIM6PTIM5PTIM4PTIM3PTIM2PTIM1PTIM0
W
Resetuuuuuuuu
= Unimplemented or Reservedu = Unaffected by reset
Figure 2-33. Port M Input Register (PTIM)
1
Read: Anytime
Write:Never, writes to this register have no effect
Table 2-31. PTIM Register Field Descriptions
FieldDescription
7-0
PTIM
Port M input data—
A read always returns the buffered input state of the associated pin. It can be used to detect overload or short circuit
conditions on output pins.
2.3.36Port M Data Direction Register (DDRM)
Address 0x0252Access: User read/write
1
1
76543210
R
DDRM7DDRM6DDRM5DDRM4DDRM3DDRM2DDRM1DDRM0
W
Reset00000000
Figure 2-34. Port M Data Direction Register (DDRM)
1
Read: Anytime
Write: Anytime
S12XS Family Reference Manual, Rev. 1.13
98Freescale Semiconductor
Page 99
Table 2-32. DDRM Register Field Descriptions
FieldDescription
Port Integration Module (S12XSPIMV1)
7-6
DDRM
5-2
DDRM
1
DDRM
0
DDRM
Port M data direction—
This bit determines whether the associated pin is an input or output.
1 Associated pin configured as output
0 Associated pin configured as input
Port M data direction—
This bit determines whether the associated pin is an input or output.
Depending on the configuration of the enabledSPI0 the I/O state will be forced to be input or output. In this case the
data direction bit will not change.
1 Associated pin configured as output
0 Associated pin configured as input
Port M data direction—
This bit determines whether the associated pin is an input or output.
The enabled CAN0 or SCI1 forces the I/O state to be an output. In this case the data direction bit will not change.
1 Associated pin configured as output
0 Associated pin configured as input
Port M data direction—
This bit determines whether the associated pin is an input or output.
The enabled CAN0 or SCI1 forces the I/O state to be an input. In this case the data direction bit will not change.
1 Associated pin configured as output
0 Associated pin configured as input
2.3.37Port M Reduced Drive Register (RDRM)
Address 0x0253Access: User read/write
76543210
R
RDRM7RDRM6RDRM5RDRM4RDRM3RDRM2RDRM1RDRM0
W
Reset00000000
Figure 2-35. Port M Reduced Drive Register (RDRM)
1
Read: Anytime
Write: Anytime
Table 2-33. RDRM Register Field Descriptions
FieldDescription
7-0
RDRM
Port M reduced drive—Select reduced drive for output pin
This bit configures the drive strength of the associated output pin as either full or reduced. If a pin is used as input
this bit has no effect. The reduced drive function is independent of which function is being used on a particular pin.
1 Reduced drive selected (approx. 1/5 of the full drive strength)
0 Full drive strength enabled
1
S12XS Family Reference Manual, Rev. 1.13
Freescale Semiconductor99
Page 100
Port Integration Module (S12XSPIMV1)
2.3.38Port M Pull Device Enable Register (PERM)
Address 0x0254Access: User read/write
76543210
R
PERM7PERM6PERM5PERM4PERM3PERM2PERM1PERM0
W
Reset00000000
Figure 2-36. Port M Pull Device Enable Register (PERM)
1
Read: Anytime
Write: Anytime
Table 2-34. PERM Register Field Descriptions
FieldDescription
7-0
PERM
Port M pull device enable—Enable pull device on input pin or wired-or output pin
This bit controls whether a pull device on the associated port input pin is active. If a pin is used as output this bit has
only effect if used in wired-or mode. The polarity is selected by the related polarity select register bit.
1 Pull device enabled
0 Pull device disabled
2.3.39Port M Polarity Select Register (PPSM)
1
Address 0x0255Access: User read/write
76543210
R
PPSM7PPSM6PPSM5PPSM4PPSM3PPSM2PPSM1PPSM0
W
Reset00000000
Figure 2-37. Port M Polarity Select Register (PPSM)
1
Read: Anytime
Write: Anytime
Table 2-35. PPSM Register Field Descriptions
FieldDescription
7-0
PPSM
Port M pull device select—Configure pull device polarity on input pin
This bit selects a pull-up or a pull-down device if enabled on the associated port input pin.
If CAN0 is active the selection of a pull-down device on the RXCAN input will have no effect.
1 A pull-down device selected
0 A pull-up device selected
1
S12XS Family Reference Manual, Rev. 1.13
100Freescale Semiconductor
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.