The information given in this document shall in no event be regarded as a guarantee of conditions or
characteristics (“Beschaffenheitsgarantie”). With respect to any examples or hints given herein, any typical values
stated herein and/or any information regarding the application of the device, Infineon Technologies hereby
disclaims any and all warranties and liabilities of any kind, including without limitation warranties of noninfringement of intellectual property rights of any third party.
Information
For further information on technology, delivery terms and conditions and prices please contact your nearest
Infineon Technologies Office (www.infineon.com).
Warnings
Due to technical requirements components may contain dangerous substances. For information on the types in
question please contact your nearest Infineon Technologies Office.
Infineon Technologies Components may only be used in life-support devices or systems with the express written
approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure
of that life-support device or system, or to affect the safety or effectiveness of that device or system. Life support
devices or systems are intended to be implanted in the human body, or to support and/or maintain and sustain
and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may
be endangered.
Data Sheet, V2.2, March 2006
XC164CS-16F
16-Bit Single-Chip Microcontroller
with C166SV2 Core
allLayout of graphics and text structures has been adapted to the new
company documentation rules.
55Footnote about leakage current at P3.15 added.
67Minimum oscillator period corrected
71Output delay/hold time of A23 … A16 moved from tc11->tc12, tc21->tc23
74Chapter “Package and Reliability” added.
We Listen to Your Comments
Any information within this document that you feel is wrong, unclear or missing at all?
Your feedback will help us to continuously improve the quality of this document.
Please send your proposal (including a reference to this document) to:
XC16416-Bit Single-Chip Microcontroller with C166SV2 Core
XC166 Family
1Summary of Features
•High Performance 16-bit CPU with 5-Stage Pipeline
– 25 ns Instruction Cycle Time at 40 MHz CPU Clock (Single-Cycle Execution)
– 1-Cycle Multiplication (16 × 16 bit), Background Division (32 / 16 bit) in 21 Cycles
– 1-Cycle Multiply-and-Accumulate (MAC) Instructions
– Enhanced Boolean Bit Manipulation Facilities
– Zero-Cycle Jump Execution
– Additional Instructions to Support HLL and Operating Systems
– Register-Based Design with Multiple Variable Register Banks
– Fast Context Switching Support with Two Additional Local Register Banks
– 16 Mbytes Total Linear Address Space for Code and Data
– 1024 Bytes On-Chip Special Function Register Area (C166 Family Compatible)
•16-Priority-Level Interrupt System with up to 75 Sources, Sample-Rate down to 50 ns
•8-Channel Interrupt-Driven Single-Cycle Data Transfer Facilities via
Peripheral Event Controller (PEC), 24-Bit Pointers Cover Total Address Space
•Clock Generation via on-chip PLL (factors 1:0.15 … 1:10), or
via Prescaler (factors 1:1 … 60:1)
•On-Chip Peripheral Modules
– 14-Channel A/D Converter with Programmable Resolution (10-bit or 8-bit) and
Conversion Time (down to 2.55 µs or 2.15 µs)
– Two 16-Channel General Purpose Capture/Compare Units (12 Input/Output Pins)
– Capture/Compare Unit for flexible PWM Signal Generation (CAPCOM6)
(3/6 Capture/Compare Channels and 1 Compare Channel)
– Multi-Functional General Purpose Timer Unit with 5 Timers
– Two Synchronous/Asynchronous Serial Channels (USARTs)
– Two High-Speed-Synchronous Serial Channels
– On-Chip TwinCAN Interface (Rev. 2.0B active) with 32 Message Objects
(Full CAN/Basic CAN) on Two CAN Nodes, and Gateway Functionality
– On-Chip Real Time Clock
•Idle, Sleep, and Power Down Modes with Flexible Power Management
1)
1)
1) Depends on the respective derivative. The derivatives are listed in Table 1.
Data Sheet4V2.2, 2006-03
Summary of Features
•Programmable Watchdog Timer and Oscillator Watchdog
•Up to 12 Mbytes External Address Space for Code and Data
– Programmable External Bus Characteristics for Different Address Ranges
– Multiplexed or Demultiplexed External Address/Data Buses
– Selectable Address Bus Width
– 16-Bit or 8-Bit Data Bus Width
– Four Programmable Chip-Select Signals
•Up to 79 General Purpose I/O Lines,
partly with Selectable Input Thresholds and Hysteresis
•On-Chip Bootstrap Loader
•Supported by a Large Range of Development Tools like C-Compilers,
Macro-Assembler Packages, Emulators, Evaluation Boards, HLL-Debuggers,
Simulators, Logic Analyzer Disassemblers, Programming Boards
•On-Chip Debug Support via JTAG Interface
•100-Pin TQFP Package, 0.5 mm (19.7 mil) pitch
XC164-16
Derivatives
Ordering Information
The ordering code for Infineon microcontrollers provides an exact reference to the
required product. This ordering code identifies:
•the derivative itself, i.e. its function set, the temperature range, and the supply voltage
•the package and the type of delivery.
For the available ordering codes for the XC164 please refer to the “Product CatalogMicrocontrollers”, which summarizes all available microcontroller variants.
Note: The ordering codes for Mask-ROM versions are defined for each product after
verification of the respective ROM code.
This document describes several derivatives of the XC164 group. Table 1 enumerates
these derivatives and summarizes the differences. As this document refers to all of these
derivatives, some descriptions may not apply to a specific product.
For simplicity all versions are referred to by the term XC164 throughout this document.
Data Sheet5V2.2, 2006-03
Table 1XC164 Derivative Synopsis
Derivative
1)
Temp.
Range
Program
Memory
XC164-16
Derivatives
Summary of Features
On-Chip RAMInterfaces
SAK-XC164CS-16F40F,
SAK-XC164CS-16F20F
SAK-XC164CS-16R40F,
SAK-XC164CS-16R20F
SAF-XC164CS-16F40F,
SAF-XC164CS-16F20F
SAF-XC164CS-16R40F,
SAF-XC164CS-16R20F
SAK-XC164CS-8F40F,
SAK-XC164CS-8F20F
SAK-XC164CS-8R40F,
SAK-XC164CS-8R20F
-40 °C to
125 °C
-40 °C to
125 °C
-40 °C to
85 °C
-40 °C to
85 °C
-40 °C to
125 °C
-40 °C to
125 °C
128 Kbytes
Flash
128 Kbytes
ROM
128 Kbytes
Flash
128 Kbytes
ROM
64 Kbytes
Flash
64 Kbytes
ROM
2 Kbytes DPRAM,
4 Kbytes DSRAM,
2 Kbytes PSRAM
2 Kbytes DPRAM,
4 Kbytes DSRAM,
2 Kbytes PSRAM
2 Kbytes DPRAM,
4 Kbytes DSRAM,
2 Kbytes PSRAM
2 Kbytes DPRAM,
4 Kbytes DSRAM,
2 Kbytes PSRAM
2 Kbytes DPRAM,
2 Kbytes DSRAM,
2 Kbytes PSRAM
2 Kbytes DPRAM,
2 Kbytes DSRAM,
2 Kbytes PSRAM
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
SAF-XC164CS-8F40F,
SAF-XC164CS-8F20F
SAF-XC164CS-8R40F,
SAF-XC164CS-8R20F
1) This Data Sheet is valid for devices starting with and including design step AD of the Flash version, and design
step AA of the ROM version.
-40 °C to
85 °C
-40 °C to
85 °C
64 Kbytes
Flash
64 Kbytes
ROM
2 Kbytes DPRAM,
2 Kbytes DSRAM,
2 Kbytes PSRAM
2 Kbytes DPRAM,
2 Kbytes DSRAM,
2 Kbytes PSRAM
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
ASC0, ASC1,
SSC0, SSC1,
CAN0, CAN1
Data Sheet6V2.2, 2006-03
XC164-16
Derivatives
General Device Information
2General Device Information
2.1Introduction
The XC164 derivatives are high-performance members of the Infineon XC166 Family of
full featured single-chip CMOS microcontrollers. These devices extend the functionality
and performance of the C166 Family in terms of instructions (MAC unit), peripherals, and
speed. They combine high CPU performance (up to 40 million instructions per second)
with high peripheral functionality and enhanced IO-capabilities. They also provide clock
generation via PLL and various on-chip memory modules such as program ROM or
Flash, program RAM, and data RAM.
Port 20
5 bit
XTAL1
XTAL2
NMI
RSTIN
RSTOUT
EA
ALE
RD
V
AREF
V
AGND
XC164
V
DDI/P
V
SSI/P
PORT0
16 bit
PORT1
16 bit
Port 3
14 bit
Port 4
8 bit
WR/WRL
Port 5
14 bit
Port 9
6 bit
JTAGTRSTDebug
via Port 3
MCA05554_XC 164
Figure 1Logic Symbol
Data Sheet7V2.2, 2006-03
XC164-16
Derivatives
General Device Information
2.2Pin Configuration and Definition
The pins of the XC164 are described in detail in Table 2, including all their alternate
functions. Figure 2 summarizes all pins in a condensed way, showing their location on
the 4 sides of the package. E*) and C*) mark pins to be used as alternate external
interrupt inputs, C*) marks pins that can have CAN interface lines assigned to them.
RSTIN1IReset Input with Schmitt-Trigger characteristics. A low level
at this pin while the oscillator is running resets the XC164.
A spike filter suppresses input pulses <10 ns. Input pulses
>100 ns safely pass the filter. The minimum duration for a
safe recognition should be 100 ns + 2 CPU clock cycles.
Note: The reset duration must be sufficient to let the
hardware configuration signals settle.
External circuitry must guarantee low level at the
RSTIN
pin at least until both power supply voltages
have reached the operating range.
P20.122IOFor details, please refer to the description of P20.
NMI
3INon-Maskable Interrupt Input. A high to low transition at this
pin causes the CPU to vector to the NMI trap routine. When
the PWRDN (power down) instruction is executed, the NMI
pin must be low in order to force the XC164 into power down
mode. If NMI
is high, when PWRDN is executed, the part will
continue to run in normal mode.
If not used, pin NMI
should be pulled high externally.
P0H.0P0H.3
4 … 7IOFor details, please refer to the description of PORT0.
Data Sheet9V2.2, 2006-03
Table 2Pin Definitions and Functions (cont’d)
XC164-16
Derivatives
General Device Information
Symbol Pin
Num.
P9
P9.0
P9.1
P9.2
P9.3
P9.4
P9.5
10
11
12
13
14
15
Input
Outp.
IO
I/O
I
I
I/O
O
I
I/O
I
I
I/O
O
I
I/O
I/O
Function
Port 9 is a 6-bit bidirectional I/O port. Each pin can be
programmed for input (output driver in high-impedance
state) or output (configurable as push/pull or open drain
driver). The input threshold of Port 9 is selectable (standard
or special).
The following Port 9 pins also serve for alternate functions:
CC16IOCAPCOM2: CC16 Capture Inp./Compare Outp.,
CAN2_RxD CAN Node 2 Receive Data Input,
EX7INFast External Interrupt 7 Input (alternate pin B)
CC17IOCAPCOM2: CC17 Capture Inp./Compare Outp.,
CAN2_TxD CAN Node 2 Transmit Data Output,
EX6INFast External Interrupt 6 Input (alternate pin B)
CC18IOCAPCOM2: CC18 Capture Inp./Compare Outp.
CAN1_RxD CAN Node 1 Receive Data Input,
EX7INFast External Interrupt 7 Input (alternate pin A)
CC19IOCAPCOM2: CC19 Capture Inp./Compare Outp.,
CAN1_TxD CAN Node 1 Transmit Data Output,
EX6INFast External Interrupt 6 Input (alternate pin A)
CC20IOCAPCOM2: CC20 Capture Inp./Compare Outp.
CC21IOCAPCOM2: CC21 Capture Inp./Compare Outp.
TRST36ITest-System Reset Input. A high level at this pin activates
the XC164’s debug system. For normal system operation,
P3
IO
pin TRST
Port 3 is a 14-bit bidirectional I/O port. Each pin can be
should be held low.
programmed for input (output driver in high-impedance
state) or output (configurable as push/pull or open drain
driver). The input threshold of Port 3 is selectable (standard
or special).
The following Port 3 pins also serve for alternate functions:
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
P3.8
P3.9
P3.10
P3.11
P3.12
P3.13
P3.15
39
40
41
42
43
44
45
46
47
48
49
50
51
52
O
I/O
I
I
I
I
O
O
I
I
I
O
O
I
I
I
I/O
I/O
O
I
I/O
I
O
O
I
I/O
I
O
O
T6OUTGPT2 Timer T6 Toggle Latch Output,
RxD1ASC1 Data Input (Async.) or Inp./Outp. (Sync.),
EX1INFast External Interrupt 1 Input (alternate pin A),
TCKDebug System: JTAG Clock Input
CAPINGPT2 Register CAPREL Capture Input,
TDIDebug System: JTAG Data In
T3OUTGPT1 Timer T3 Toggle Latch Output,
TDODebug System: JTAG Data Out
T3EUDGPT1 Timer T3 External Up/Down Control
Debug System: Break Out
T3INGPT1 Timer T3 Count/Gate Input
T2INGPT1 Timer T2 Count/Gate/Reload/Capture Inp
BRKIN
Debug System: Break In
MRST0SSC0 Master-Receive/Slave-Transmit In/Out.
MTSR0SSC0 Master-Transmit/Slave-Receive Out/In.
TxD0ASC0 Clock/Data Output (Async./Sync.),
EX2INFast External Interrupt 2 Input (alternate pin B)
RxD0ASC0 Data Input (Async.) or Inp./Outp. (Sync.),
EX2INFast External Interrupt 2 Input (alternate pin A)
BHE
WRH
External Memory High Byte Enable Signal,
External Memory High Byte Write Strobe,
EX3INFast External Interrupt 3 Input (alternate pin B)
SCLK0SSC0 Master Clock Output / Slave Clock Input.,
EX3INFast External Interrupt 3 Input (alternate pin A)
CLKOUTSystem Clock Output (= CPU Clock),
FOUTProgrammable Frequency Output
Data Sheet11V2.2, 2006-03
Table 2Pin Definitions and Functions (cont’d)
XC164-16
Derivatives
General Device Information
Symbol Pin
Num.
P4
P4.0
P4.1
P4.2
P4.3
P4.4
P4.5
P4.6
P4.7
53
54
55
56
57
58
59
60
Input
Outp.
IO
O
O
O
O
O
O
O
O
O
I
I
O
I
I
O
O
I
O
I
O
I
Function
Port 4 is an 8-bit bidirectional I/O port. Each pin can be
programmed for input (output driver in high-impedance
state) or output (configurable as push/pull or open drain
driver). The input threshold of Port 4 is selectable (standard
or special).
Port 4 can be used to output the segment address lines, the
optional chip select lines, and for serial interface lines:
1)
A16Least Significant Segment Address Line,
CS3
Chip Select 3 Output
A17Segment Address Line,
CS2
Chip Select 2 Output
A18Segment Address Line,
CS1
Chip Select 1 Output
A19Segment Address Line,
CS0
Chip Select 0 Output
A20Segment Address Line,
CAN2_RxD CAN Node 2 Receive Data Input,
EX5INFast External Interrupt 5 Input (alternate pin B)
A21Segment Address Line,
CAN1_RxD CAN Node 1 Receive Data Input,
EX4INFast External Interrupt 4 Input (alternate pin B)
A22Segment Address Line,
CAN1_TxD CAN Node 1 Transmit Data Output,
EX5INFast External Interrupt 5 Input (alternate pin A)
A23Most Significant Segment Address Line,
CAN1_RxD CAN Node 1 Receive Data Input,
CAN2_TxD CAN Node 2 Transmit Data Output,
EX4INFast External Interrupt 4 Input (alternate pin A)
Data Sheet12V2.2, 2006-03
Table 2Pin Definitions and Functions (cont’d)
XC164-16
Derivatives
General Device Information
Symbol Pin
Num.
P20
P20.0
P20.1
P20.4
P20.5
P20.12
63
64
65
66
2
Input
Outp.
IO
O
O
O
I
O
Function
Port 20 is a 5-bit bidirectional I/O port. Each pin can be
programmed for input (output driver in high-impedance
state) or output. The input threshold of Port 20 is selectable
(standard or special).
The following Port 20 pins also serve for alternate functions:
RD
External Memory Read Strobe, activated for
every external instruction or data read access.
WR
/WRLExternal Memory Write Strobe.
In WR
-mode this pin is activated for every
external data write access.
In WRL
-mode this pin is activated for low byte
data write accesses on a 16-bit bus, and for
every data write access on an 8-bit bus.
ALEAddress Latch Enable Output.
Can be used for latching the address into
external memory or an address latch in the
multiplexed bus modes.
EA
External Access Enable pin.
A low level at this pin during and after Reset
forces the XC164 to latch the configuration from
PORT0 and pin RD
, and to begin instruction
execution out of external memory.
A high level forces the XC164 to latch the
configuration from pins RD
, ALE, and WR, and
to begin instruction execution out of the internal
program memory. "ROMless" versions must
have this pin tied to ‘0’.
RSTOUT
Internal Reset Indication Output.
Is activated asynchronously with an external
hardware reset. It may also be activated
(selectable) synchronously with an internal
software or watchdog reset.
Is deactivated upon the execution of the EINIT
instruction, optionally at the end of reset, or at
any time (before EINIT) via user software.
Note: Port 20 pins may input configuration values (see EA
Data Sheet13V2.2, 2006-03
).
Table 2Pin Definitions and Functions (cont’d)
XC164-16
Derivatives
General Device Information
Symbol Pin
Num.
PORT0
P0L.0-
67 - 74
P0L.7
P0H.0-
4 - 7
P0H.3
P0H.4-
75 - 78
P0H.7
PORT1
P1L.0
P1L.1
P1L.2
P1L.3
P1L.4
P1L.5
P1L.6
P1L.7
P1H
79
80
81
82
83
84
85
86
…
Input
Function
Outp.
IOPORT0 consists of the two 8-bit bidirectional I/O ports P0L
and P0H. Each pin can be programmed for input (output
driver in high-impedance state) or output.
In case of an external bus configuration, PORT0 serves as
the address (A) and address/data (AD) bus in multiplexed
bus modes and as the data (D) bus in demultiplexed bus
modes.
PORT1 consists of the two 8-bit bidirectional I/O ports P1L
and P1H. Each pin can be programmed for input (output
driver in high-impedance state) or output.
PORT1 is used as the 16-bit address bus (A) in
demultiplexed bus modes (also after switching from a
demultiplexed to a multiplexed bus mode).
The following PORT1 pins also serve for alt. functions:
I/O
O
I/O
O
I/O
O
O
I
CC60CAPCOM6: Input / Output of Channel 0
COUT60CAPCOM6: Output of Channel 0
CC61CAPCOM6: Input / Output of Channel 1
COUT61CAPCOM6: Output of Channel 1
CC62CAPCOM6: Input / Output of Channel 2
COUT62CAPCOM6: Output of Channel 2
COUT63Output of 10-bit Compare Channel
CTRAP
CTRAP
CAPCOM6: Trap Input
is an input pin with an internal pull-up resistor. A low
level on this pin switches the CAPCOM6 compare outputs to
the logic level defined by software (if enabled).
I/O
CC22IOCAPCOM2: CC22 Capture Inp./Compare Outp.
… continued …
Data Sheet14V2.2, 2006-03
Table 2Pin Definitions and Functions (cont’d)
XC164-16
Derivatives
General Device Information
Symbol Pin
Num.
PORT1
(cont’d)
P1H.0
P1H.1
P1H.2
P1H.3
P1H.4
P1H.5
P1H.6
P1H.7
89
90
91
92
93
94
95
96
Input
Outp.
IO
I
I
I/O
I
I
I/O
I
I
I/O
I
I/O
I
I
I/O
I
I/O
I
I/O
I
I/O
I
XTAL2:Output of the oscillator amplifier circuit
XTAL1:Input to the oscillator amplifier and input to the
internal clock generator
To clock the device from an external source, drive XTAL1,
while leaving XTAL2 unconnected. Minimum and maximum
high/low and rise/fall times specified in the AC
Characteristics must be observed.
V
V
V
AREF
AGND
DDI
28–Reference voltage for the A/D converter.
29–Reference ground for the A/D converter.
35, 97–Digital Core Supply Voltage (On-Chip Modules):
+2.5 V during normal operation and idle mode.
Please refer to the Operating Condition Parameters
Data Sheet15V2.2, 2006-03
Table 2Pin Definitions and Functions (cont’d)
XC164-16
Derivatives
General Device Information
Symbol Pin
Num.
V
DDP
9, 17,
38, 61,
87
V
V
SSI
SSP
34, 98–Digital Ground.
8, 16,
37, 62,
88
Input
Function
Outp.
–Digital Pad Supply Voltage (Pin Output Drivers):
+5 V during normal operation and idle mode.
Please refer to the Operating Condition Parameters
–
Connect decoupling capacitors to adjacent
as close as possible to the pins.
All
V
pins must be connected to the ground-line or ground-
SS
plane.
1) The CAN interface lines are assigned to ports P4 and P9 under software control.
V
DD/VSS
pin pairs
Data Sheet16V2.2, 2006-03
XC164-16
Derivatives
Functional Description
3Functional Description
The architecture of the XC164 combines advantages of RISC, CISC, and DSP
processors with an advanced peripheral subsystem in a very well-balanced way. In
addition, the on-chip memory blocks allow the design of compact systems-on-silicon with
maximum performance (computing, control, communication).
The on-chip memory blocks (program code-memory and SRAM, dual-port RAM, data
SRAM) and the set of generic peripherals are connected to the CPU via separate buses.
Another bus, the LXBus, connects additional on-chip resources as well as external
resources (see Figure 3).
This bus structure enhances the overall system performance by enabling the concurrent
operation of several subsystems of the XC164.
The following block diagram gives an overview of the different on-chip components and
of the advanced, high bandwidth internal bus structure of the XC164.
Flash/ROM
64/128 Kbytes
Debug Support
Osc / PLL
Clock Generator
XTAL
ADC
8-Bi t/
10-Bit
14 Ch
PSRAM
ProgMem
OCDS
GPT
T2
T3
T4
T5
T6
DPRAM
CPU
PMU
C166SV2 - Core
RTCWD TInterrupt & PEC
ASC0
USART
BRGen BRGen BRGen BRGen
ASC1
USART
SSC0
SPI
SSC1
SPI
CC1
T0
T1
DMU
Interr upt Bus
CC2
T7
T8
CC6
T12
T13
DSRAM
EBC
LXBus Control
Exter nal Bus
Control
LXB us
Twin
CAN
A B
Peripheral Data Bus
P 20 P 9Port 5Port 4Port 3PORT1PORT0
56
14
16148
16
MCB04323_X416
Figure 3Block Diagram
Data Sheet17V2.2, 2006-03
XC164-16
Derivatives
Functional Description
3.1Memory Subsystem and Organization
The memory space of the XC164 is configured in a Von Neumann architecture, which
means that all internal and external resources, such as code memory, data memory,
registers and I/O ports, are organized within the same linear address space. This
common memory space includes 16 Mbytes and is arranged as 256 segments of
64 Kbytes each, where each segment consists of four data pages of 16 Kbytes each.
The entire memory space can be accessed bytewise or wordwise. Portions of the onchip DPRAM and the register spaces (E/SFR) have additionally been made directly
bitaddressable.
The internal data memory areas and the Special Function Register areas (SFR and
ESFR) are mapped into segment 0, the system segment.
The Program Management Unit (PMU) handles all code fetches and, therefore, controls
accesses to the program memories, such as Flash memory, ROM, and PSRAM.
The Data Management Unit (DMU) handles all data transfers and, therefore, controls
accesses to the DSRAM and the on-chip peripherals.
Both units (PMU and DMU) are connected via the high-speed system bus to exchange
data. This is required if operands are read from program memory, code or data is written
to the PSRAM, code is fetched from external memory, or data is read from or written to
external resources, including peripherals on the LXBus (such as TwinCAN). The system
bus allows concurrent two-way communication for maximum transfer performance.
64/128 Kbytes
1)
of on-chip Flash memory or mask-programmable ROM store code
or constant data. The on-chip Flash memory is organized as four 8-Kbyte sectors, one
32-Kbyte sector, and one 64-Kbyte sector. Each sector can be separately write
protected
2)
, erased and programmed (in blocks of 128 Bytes). The complete Flash or
ROM area can be read-protected. A password sequence temporarily unlocks protected
areas. The Flash module combines very fast 64-bit one-cycle read accesses with
protected and efficient writing algorithms for programming and erasing. Thus, program
execution out of the internal Flash results in maximum performance. Dynamic error
correction provides extremely high read data security for all read accesses.
For timing characteristics, please refer to Section 4.4.2.
2 Kbytes of on-chip Program SRAM (PSRAM) are provided to store user code or data.
The PSRAM is accessed via the PMU and is therefore optimized for code fetches.
2/4 Kbytes
1)
of on-chip Data SRAM (DSRAM) are provided as a storage for general
user data. The DSRAM is accessed via the DMU and is therefore optimized for data
accesses.
2 Kbytes of on-chip Dual-Port RAM (DPRAM) are provided as a storage for user
defined variables, for the system stack, and general purpose register banks. A register
1) Depends on the respective derivative. The derivatives are listed in Table 1.
2) Each two 8-Kbyte sectors are combined for write-protection purposes.
Data Sheet18V2.2, 2006-03
XC164-16
Derivatives
Functional Description
bank can consist of up to 16 wordwide (R0 to R15) and/or bytewide (RL0, RH0, …, RL7,
RH7) so-called General Purpose Registers (GPRs).
The upper 256 bytes of the DPRAM are directly bitaddressable. When used by a GPR,
any location in the DPRAM is bitaddressable.
1024 bytes (2 × 512 bytes) of the address space are reserved for the Special Function
Register areas (SFR space and ESFR space). SFRs are wordwide registers which are
used for controlling and monitoring functions of the different on-chip units. Unused SFR
addresses are reserved for future members of the XC166 Family. Therefore, they should
either not be accessed, or written with zeros, to ensure upward compatibility.
In order to meet the needs of designs where more memory is required than is provided
on chip, up to 12 Mbytes (approximately, see Table 3) of external RAM and/or ROM can
be connected to the microcontroller.
Table 3XC164 Memory Map
1)
Address AreaStart Loc.End Loc.Area Size
Flash register spaceFF’F000
Reserved (Acc. trap)F8’0000
Reserved for PSRAME0’0800
Program SRAME0’0000
Reserved for program
C2’0000
H
H
H
H
H
FF’FFFF
FF’EFFF
F7’FFFF
E0’07FF
DF’FFFF
4 KbytesFlash only
H
< 0.5 MbytesMinus Flash register
H
< 1.5 MbytesMinus PSRAM
H
2 KbytesMaximum
H
< 2 MbytesMinus Flash/ROM
H
memory
Program Flash/ROMC0’0000
ReservedBF’0000
External memory area40’0000
External IO area
5)
20’0800
TwinCAN registers20’0000
H
H
H
H
H
C1’FFFF
BF’FFFF
BE’FFFF
3F’FFFF
20’07FF
128 Kbytes
H
64 Kbytes–
H
< 8 MbytesMinus reserved
H
< 2 MbytesMinus TwinCAN
H
2 Kbytes–
H
2)
Notes
3)
space
4)
segment
External memory area01’0000
Data RAMs and SFRs00’8000
External memory area00’0000
1) Accesses to the shaded areas generate external bus accesses.
2) The areas marked with “<” are slightly smaller than indicated, see column “Notes”.
3) Not defined register locations return a trap code.
4) Depends on the respective derivative. The derivatives are listed in Table 1.
5) Several pipeline optimizations are not active within the external IO area. This is necessary to control external
peripherals properly.
H
H
H
1F’FFFF
00’FFFF
00’7FFF
< 2 MbytesMinus segment 0
H
32 KbytesPartly used
H
32 Kbytes–
H
4)
Data Sheet19V2.2, 2006-03
XC164-16
Derivatives
Functional Description
3.2External Bus Controller
All of the external memory accesses are performed by a particular on-chip External Bus
Controller (EBC). It can be programmed either to Single Chip Mode when no external
memory is required, or to one of four different external memory access modes
are as follows:
In the demultiplexed bus modes, addresses are output on PORT1 and data is
input/output on PORT0 or P0L, respectively. In the multiplexed bus modes both
addresses and data use PORT0 for input/output. The high order address (segment) lines
use Port 4. The number of active segment address lines is selectable, restricting the
external address space to 8 Mbytes … 64 Kbytes. This is required when interface lines
are assigned to Port 4.
1)
, which
Up to 4 external CS
signals (3 windows plus default) can be generated in order to save
external glue logic. External modules can directly be connected to the common
address/data bus and their individual select lines.
Important timing characteristics of the external bus interface have been made
programmable (via registers TCONCSx/FCONCSx) to allow the user the adaption of a
wide range of different types of memories and external peripherals.
In addition, up to 4 independent address windows may be defined (via registers
ADDRSELx) which control the access to different resources with different bus
characteristics. These address windows are arranged hierarchically where window 4
overrides window 3, and window 2 overrides window 1. All accesses to locations not
covered by these 4 address windows are controlled by TCONCS0/FCONCS0. The
currently active window can generate a chip select signal.
Note: The chip select signal of address window 4 is not available on a pin.
The external bus timing is related to the rising edge of the reference clock output
CLKOUT. The external bus protocol is compatible with that of the standard C166 Family.
The EBC also controls accesses to resources connected to the on-chip LXBus. The
LXBus is an internal representation of the external bus and allows accessing integrated
peripherals and modules in the same way as external components.
The TwinCAN module is connected and accessed via the LXBus.
1) Bus modes are switched dynamically if several address windows with different mode settings are used.
Data Sheet20V2.2, 2006-03
XC164-16
Derivatives
Functional Description
3.3Central Processing Unit (CPU)
The main core of the CPU consists of a 5-stage execution pipeline with a 2-stage
instruction-fetch pipeline, a 16-bit arithmetic and logic unit (ALU), a 32-bit/40-bit multiply
and accumulate unit (MAC), a register-file providing three register banks, and dedicated
SFRs. The ALU features a multiply and divide unit, a bit-mask generator, and a barrel
shifter.
CPU
Prefetch
Branch
Multiply
Unit
Unit
FIFO
IDX0
IDX1
QX0
QX1
+/-
Unit
+/-
CSPIP
CPUCON1
CPUCON2
Return
Stack
QR0
QR1
+/-
MRW
MCW
MSW
IFU
DPP0
DPP1
DPP2
DPP3
Division Unit
M ultip ly U n it
MDC
PSW
VECSEG
TFR
Injection/
Exception
Handler
SPSEG
SP
STKOV
STKUN
Bit-Mask-Gen.
Barrel-Shifter
+/-
ADU
PMU
2-Stage
5-Stage
R15
R14
GPRs
GPRs
RF
Prefetch
Pipeline
Pipeline
CP
R15
R15
R14
R14
GPRs
R1
R1
R0
R1
R0
R0
PSRAM
Flash/ROM
DPRAM
IPIP
R15
R14
GPRs
R1
R0
MAC
MAH
MAL
MDH
ZEROS
MDL
ONES
ALU
Buffer
DMU
WB
DSRAM
EBC
Peripherals
mca04917_x.vsd
Figure 4CPU Block Diagram
Based on these hardware provisions, most of the XC164’s instructions can be executed
in just one machine cycle which requires 25 ns at 40 MHz CPU clock. For example, shift
Data Sheet21V2.2, 2006-03
XC164-16
Derivatives
Functional Description
and rotate instructions are always processed during one machine cycle independent of
the number of bits to be shifted. Also multiplication and most MAC instructions execute
in one single cycle. All multiple-cycle instructions have been optimized so that they can
be executed very fast as well: for example, a division algorithm is performed in 18 to 21
CPU cycles, depending on the data and division type. Four cycles are always visible, the
rest runs in the background. Another pipeline optimization, the branch target prediction,
allows eliminating the execution time of branch instructions if the prediction was correct.
The CPU has a register context consisting of up to three register banks with 16 wordwide
GPRs each at its disposal. The global register bank is physically allocated within the onchip DPRAM area. A Context Pointer (CP) register determines the base address of the
active global register bank to be accessed by the CPU at any time. The number of
register banks is only restricted by the available internal RAM space. For easy parameter
passing, a register bank may overlap others.
A system stack of up to 32 Kwords is provided as a storage for temporary data. The
system stack can be allocated to any location within the address space (preferably in the
on-chip RAM area), and it is accessed by the CPU via the stack pointer (SP) register.
Two separate SFRs, STKOV and STKUN, are implicitly compared against the stack
pointer value upon each stack access for the detection of a stack overflow or underflow.
The high performance offered by the hardware implementation of the CPU can efficiently
be utilized by a programmer via the highly efficient XC164 instruction set which includes
the following instruction classes:
•Standard Arithmetic Instructions
•DSP-Oriented Arithmetic Instructions
•Logical Instructions
•Boolean Bit Manipulation Instructions
•Compare and Loop Control Instructions
•Shift and Rotate Instructions
•Prioritize Instruction
•Data Movement Instructions
•System Stack Instructions
•Jump and Call Instructions
•Return Instructions
•System Control Instructions
•Miscellaneous Instructions
The basic instruction length is either 2 or 4 bytes. Possible operand types are bits, bytes
and words. A variety of direct, indirect or immediate addressing modes are provided to
specify the required operands.
Data Sheet22V2.2, 2006-03
Loading...
+ 54 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.