The information herein is given to describe certain components and shall not be considered as warranted
characteristics.
Terms of delivery and rights to technical change reserved.
We hereby disclaim any and all warranties, including but not limited to warranties of non-infringement, regarding
circuits, descriptions and charts stated herein.
Infineon Technologies is an approved CECC manufacturer.
Information
For further information on technology, delivery terms and conditions and prices please contact your nearest
Infineon Technologies Office in Germany or our Infineon Technologies Representatives worldwide.
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.0, May 2001
C164CI/SI
C164CL/SL
16-Bit Single-Chip Microcontroller
Microcontrollers
Never stop thinking.
C164CI
Revision History:2001-05V2.0
Previous Version:1999-08
1998-02(Preliminary)
04.97(Advance Information)
PageSubjects (major changes since last revision)
1)
AllConverted to Infineon layout
1Operating frequency up to 25 MHz
1 et al.References to Flash removed
1Timer Unit with three timers
1, 12, 73On-chip XRAM described
2Derivative table updated
10Supply voltage is 5 V
21Functionality of reduced CAPCOM6 corrected
22fTimer description improved
29, 30Sections “Oscillator Watchdog” and “Power Management” added
37POCON reset values adjusted
41 to 73Parameter section reworked
1)
These changes refer to the last two versions. Version 1998-02 covers OTP and ROM derivatives, while version
1999-08 ist the most recent one.
Controller Area Network (CAN): License of Robert Bosch GmbH
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:
mcdocu.comments@infineon.com
C164CI16-Bit Single-Chip Microcontroller
C166 Family
C164CI/SI, C164CL/SL
• High Performance 16-bit CPU with 4-Stage Pipeline
– 80 ns Instruction Cycle Time at 25 MHz CPU Clock
– 400 ns Multiplication (16 × 16 bit), 800 ns Division (32 / 16 bit)
– Enhanced Boolean Bit Manipulation Facilities
– Additional Instructions to Support HLL and Operating Systems
– Register-Based Design with Multiple Variable Register Banks
– Single-Cycle Context Switching Support
– 16 MBytes Total Linear Address Space for Code and Data
– 1024 Bytes On-Chip Special Function Register Area
• 16-Priority-Level Interrupt System with 32 Sources, Sample-Rate down to 40 ns
• 8-Channel Interrupt-Driven Single-Cycle Data Transfer Facilities via
Peripheral Event Controller (PEC)
• Clock Generation via on-chip PLL (factors 1:1.5/2/2.5/3/4/5),
via prescaler or via direct clock input
• On-Chip Memory Modules
– 2 KBytes On-Chip Internal RAM (IRAM)
– 2 KBytes On-Chip Extension RAM (XRAM)
– up to 64 KBytes On-Chip Program Mask ROM or OTP Memory
• On-Chip Peripheral Modules
– 8-Channel 10-bit A/D Converter with Programmable Conversion Time
down to 7.8 µs
– 8-Channel General Purpose Capture/Compare Unit (CAPCOM2)
– 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 3 Timers
– Two Serial Channels (Synchronous/Asynchronous and High-Speed-Synchronous)
– On-Chip CAN Interface (Rev. 2.0B active) with 15 Message Objects
(Full CAN/Basic CAN)
– On-Chip Real Time Clock
• Up to 4 MBytes External Address Space for Code and Data
– Programmable External Bus Characteristics for Different Address Ranges
– Multiplexed or Demultiplexed External Address/Data Buses with 8-Bit or 16-Bit
Data Bus Width
– Four Optional Programmable Chip-Select Signals
• Idle, Sleep, and Power Down Modes with Flexible Power Management
• Programmable Watchdog Timer and Oscillator Watchdog
• Up to 59 General Purpose I/O Lines,
partly with Selectable Input Thresholds and Hysteresis
Data Sheet1V2.0, 2001-05
C164CI/SI
C164CL/SL
• 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 Bootstrap Loader
• 80-Pin MQFP Package, 0.65 mm pitch
This document describes several derivatives of the C164 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.
Table 1C164CI Derivative Synopsis
Derivative
1)
Program
Memory
CAPCOM6CAN Interf.Operating
Frequency
SAK-C164CI-8R[25]M
SAF-C164CI-8R[25]M
SAK-C164SI-8R[25]M
SAF-C164SI-8R[25]M
SAK-C164CL-8R[25]M
SAF-C164CL-8R[25]M
SAK-C164SL-8R[25]M
SAF-C164SL-8R[25]M
SAK-C164CL-6R[25]M
SAF-C164CL-6R[25]M
SAK-C164SL-6R[25]M
SAF-C164SL-6R[25]M
SAK-C164CI-L[25]M
SAF-C164CI-L[25]M
SAK-C164CI-8EM
64 KByte ROMFull functionCAN120 MHz,
[25 MHz]
64 KByte ROMFull function---20 MHz,
[25 MHz]
64 KByte ROMReduced fct.CAN120 MHz,
[25 MHz]
64 KByte ROMReduced fct.---20 MHz,
[25 MHz]
48 KByte ROMReduced fct.CAN120 MHz,
[25 MHz]
48 KByte ROMReduced fct.---20 MHz,
[25 MHz]
---Full functionCAN120 MHz,
[25 MHz]
64 KByte OTPFull functionCAN120 MHz
SAF-C164CI-8EM
1)
This Data Sheet is valid for ROM(less) devices starting with and including design step AB, and for OTP devices
starting with and including design step DA.
For simplicity all versions are referred to by the term C164CI throughout this document.
Data Sheet2V2.0, 2001-05
C164CI/SI
C164CL/SL
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 C164CI 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.
Introduction
The C164CI derivatives of the Infineon C166 Family of full featured single-chip CMOS
microcontrollers are especially suited for cost sensitive applications. They combine high
CPU performance (up to 12.5 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 OTP, internal RAM, and
extension RAM.
XTAL1
XTAL2
RSTIN
RSTOUT
NMI
EA
ALE
RD
WR/WRL
V
AREFVAGND
C164CI
V
DDVSS
Port 0
16 Bit
Port 1
16 Bit
Port 3
9 Bit
Port 4
6 Bit
Port 8
4 Bit
Port 5
8 Bit
MCL04869
Figure 1Logic Symbol
Data Sheet3V2.0, 2001-05
Pin Configuration
(top view)
D
N
G
A
P5.3/AN3
V
P5.0/AN0
P5.2/AN2
P5.1/AN1
/*
/*
/*
/*
C16IO
P8.1/CC17IO
P8.3/CC19IO
P8.2/CC18IO
P8.0/C
I
NM
T
P1H.7/A15/CC27IO
RSTOU
RSTIN
P1H.6/A14/CC26IO
/EX2IN
/EX1IN
S2
S1
6PO
CC
CC6PO
D
P1H.3/A11/EXIN/T7IN
P1H.5/A13/CC25IO
P1H.4/A12/CC24IO
D
P1H.2/A10/
V
P1H.1/A9/
C164CI/SI
C164CL/SL
V
P5.4/AN4/T2EUD2
P5.5/AN5/T4EUD
P5.6/AN6/T2IN
P5.7/AN7/T4IN
P3.4/T3EUD
P3.11/RxD0
P3.12/BHE/WRH
P3.13/SCLK
P3.15/CLKOUT/FOUT
P4.0/A16/CS3
P4.1/A17/CS2
P4.2/A18/CS1
AREF
V
V
P3.6/T3IN
P3.8/MRST
P3.9/MTSR
P3.10/TxD0
V
SS
DD
SS
1
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
80
21
V
797877
23
24
22
D
D
*/P4.5/A20
*/P4.6/A21
P4.3/A19/CS0
76
25
RD
75
26
RL
R/W
W
74
27
ALE
737271
C164CI
30
29
28
Vpp/EA
P0L.1/AD1
P0L.0/AD0
70
68
69
33
31
32
P0L.2/AD2
P0L.4/AD4
P0L.3/AD3
676665
34
36
35
P0L.5/AD5
P0L.7/AD7
P0L.6/AD6
646362
37
38
39
61
40
V
P0H.0/AD8
P0H.1/AD9
P0H.2/AD10
V
60
SS
P1H.0/A8/CC6POS0/EX0IN
59
58
P1L.7/A7/CTRAP
P1L.6/A6/COUT6357
V
56
SS
XTAL155
XTAL254
V
53
DD
P1L.5/A5/COUT6252
P1L.4/A4/CC6251
P1L.3/A3/COUT61
50
P1L.2/A2/CC6149
P1L.1/A1/COUT6048
P1L.0/A0/CC60
47
P0H.7/AD1546
P0H.6/AD1445
P0H.5/AD13
44
43
P0H.4/AD12
P0H.3/AD1142
V
41
SS
D
D
MCP04870
Figure 2
*) The marked pins of Port 4 and Port 8 can have CAN interface lines assigned to them.
Table 2 on the pages below lists the possible assignments.
The marked input signals are available only in devices with a full-function CAPCOM6.
They are not available in devices with a reduced-function CAPCOM6.
Data Sheet4V2.0, 2001-05
Table 2Pin Definitions and Functions
C164CI/SI
C164CL/SL
Symbol Pin
No.
P5
P5.0
P5.1
P5.2
P5.3
P5.4
P5.5
P5.6
P5.7
P3
P3.4
P3.6
P3.8
P3.9
P3.10
P3.11
P3.12
P3.13
P3.15
76
77
78
79
2
3
4
5
8
9
10
11
12
13
14
15
16
Input
Outp.
I
I
I
I
I
I
I
I
I
IO
I
I
I/O
I/O
O
I/O
O
O
I/O
O
O
Function
Port 5 is an 8-bit input-only port with Schmitt-Trigger charact.
The pins of Port 5 also serve as analog input channels for the
A/D converter, or they serve as timer inputs:
AN0
AN1
AN2
AN3
AN4,T2EUDGPT1 Timer T2 Ext. Up/Down Ctrl. Inp.
AN5,T4EUDGPT1 Timer T4 Ext. Up/Down Ctrl. Inp.
AN6,T2INGPT1 Timer T2 Input for
Count/Gate/Reload/Capture
AN7,T4INGPT1 Timer T4 Input for
Count/Gate/Reload/Capture
Port 3 is a 9-bit bidirectional I/O port. It is bit-wise
programmable for input or output via direction bits. For a pin
configured as input, the output driver is put into highimpedance state. Port 3 outputs can be configured as push/
pull or open drain drivers. The input threshold of Port 3 is
selectable (TTL or special).
The following Port 3 pins also serve for alternate functions:
T3EUDGPT1 Timer T3 External Up/Down Control Input
T3INGPT1 Timer T3 Count/Gate Input
MRSTSSC Master-Receive/Slave-Transmit Inp./Outp.
MTSRSSC Master-Transmit/Slave-Receive Outp./Inp.
TxD0ASC0 Clock/Data Output (Async./Sync.)
RxD0ASC0 Data Input (Async.) or Inp./Outp. (Sync.)
BHE
WRH
SCLKSSC Master Clock Output / Slave Clock Input.
CLKOUTSystem Clock Output (= CPU Clock),
FOUTProgrammable Frequency Output
External Memory High Byte Enable Signal,
External Memory High Byte Write Strobe
Data Sheet5V2.0, 2001-05
Table 2Pin Definitions and Functions (cont’d)
C164CI/SI
C164CL/SL
Symbol Pin
No.
P4
P4.0
P4.1
P4.2
P4.3
P4.5
P4.6
17
18
19
22
23
24
Input
Outp.
IO
O
O
O
O
O
O
O
O
O
I
O
O
Function
Port 4 is a 6-bit bidirectional I/O port. It is bit-wise
programmable for input or output via direction bits. For a pin
configured as input, the output driver is put into highimpedance state. Port 4 outputs can be configured as push/
pull or open drain drivers. The input threshold of Port 4 is
selectable (TTL or special).
Port 4 can be used to output the segment address lines, the
optional chip select lines, and for serial interface lines:
Chip Select 0 Output
A20Segment Address Line,
CAN1_RxD CAN 1 Receive Data Input
A21Most Significant Segment Address Line,
CAN1_TxD CAN 1 Transmit Data Output
RD
25OExternal Memory Read Strobe. RD is activated for every
external instruction or data read access.
WR
WRL
/
26OExternal 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.
See WRCFG in register SYSCON for mode selection.
ALE27OAddress Latch Enable Output. Can be used for latching the
address into external memory or an address latch in the
multiplexed bus modes.
Data Sheet6V2.0, 2001-05
Table 2Pin Definitions and Functions (cont’d)
C164CI/SI
C164CL/SL
Symbol Pin
No.
EA/V
28IExternal Access Enable pin.
PP
PORT0
P0L.0-7
2936
P0H.0-7
37-39,
42-46
Input
Function
Outp.
A low level at this pin during and after Reset forces the
C164CI to latch the configuration from PORT0 and pin RD
and to begin instruction execution out of external memory.
A high level forces the C164CI to latch the configuration
from pins RD
and ALE, and to begin instruction execution out
of the internal program memory.
“ROMless” versions must have this pin tied to ‘0’.
Note: This pin also accepts the programming voltage for the
OTP derivatives.
IOPORT0 consists of the two 8-bit bidirectional I/O ports P0L
and P0H. It is bit-wise programmable for input or output via
direction bits. For a pin configured as input, the output driver
is put into high-impedance state.
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. It is bit-wise programmable for input or output via
direction bits. For a pin configured as input, the output driver
is put into high-impedance state. PORT1 is used as the
16-bit address bus (A) in demultiplexed bus modes and also
after switching from a demultiplexed bus mode to a
multiplexed bus mode.
The following PORT1 pins also serve for alt. functions:
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
level on this pin switches the compare outputs of the
CAPCOM6 unit to the logic level defined by software.
CC6POS0
EX0INFast External Interrupt 0 Input
CC6POS1
EX1INFast External Interrupt 1 Input
CC6POS2
EX2INFast External Interrupt 2 Input
EX3INFast External Interrupt 3 Input,
T7INCAPCOM2: Timer T7 Count Input
CC24IOCAPCOM2: CC24 Capture Inp./Compare Outp.
CC25IOCAPCOM2: CC25 Capture Inp./Compare Outp.
CC26IOCAPCOM2: CC26 Capture Inp./Compare Outp.
CC27IOCAPCOM2: CC27 Capture Inp./Compare Outp.
CAPCOM6: Trap Input
is an input pin with an internal pullup resistor. A low
CAPCOM6: Position 0 Input, **)
CAPCOM6: Position 1 Input, **)
CAPCOM6: Position 2 Input, **)
Note: The marked (**) input signals are available only in
devices with a full function CAPCOM6.
Data Sheet8V2.0, 2001-05
Table 2Pin Definitions and Functions (cont’d)
C164CI/SI
C164CL/SL
Symbol Pin
No.
XTAL2
XTAL15455
RSTIN
69I/OReset Input with Schmitt-Trigger characteristics. A low level
Input
Outp.
O
I
Function
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.
at this pin while the oscillator is running resets the C164CI.
An internal pullup resistor permits power-on reset using only
V
a capacitor connected to
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.
In bidirectional reset mode (enabled by setting bit BDRSTEN
in register SYSCON) the RSTIN
for the duration of the internal reset sequence upon any reset
(HW, SW, WDT). See note below this table.
.
SS
line is internally pulled low
RST
OUT
NMI
70OInternal Reset Indication Output. This pin is set to a low level
when the part is executing either a hardware-, a software- or
a watchdog timer reset. RSTOUT
(end of initialization) instruction is executed.
71INon-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 C164CI to go into power
down mode. If NMI
part will continue to run in normal mode.
If not used, pin NMI
is high, when PWRDN is executed, the
should be pulled high externally.
remains low until the EINIT
Data Sheet9V2.0, 2001-05
Table 2Pin Definitions and Functions (cont’d)
C164CI/SI
C164CL/SL
Symbol Pin
No.
P8
P8.0
P8.1
P8.2
P8.3
V
AREF
72
73
74
75
1–Reference voltage for the A/D converter.
Input
Outp.
IO
I/O
I
I/O
O
I/O
I
I/O
O
Function
Port 8 is a 4-bit bidirectional I/O port. It is bit-wise
programmable for input or output via direction bits. For a pin
configured as input, the output driver is put into highimpedance state. Port 8 outputs can be configured as push/
pull or open drain drivers. The input threshold of Port 8 is
selectable (TTL or special). Port 8 pins provide inputs/
outputs for CAPCOM2 and serial interface lines.
1)
CC16IOCAPCOM2: CC16 Capture Inp./Compare Outp.,
CAN1_RxD CAN 1 Receive Data Input
CC17IOCAPCOM2: CC17 Capture Inp./Compare Outp.,
CAN1_TxD CAN 1 Transmit Data Output
CC18IOCAPCOM2: CC18 Capture Inp./Compare Outp.,
CAN1_RxD CAN 1 Receive Data Input
CC19IOCAPCOM2: CC19 Capture Inp./Compare Outp.,
CAN1_TxD CAN 1 Transmit Data Output
V
AGND
V
DD
V
SS
80–Reference ground for the A/D converter.
7, 21,
40, 53,
61
6, 20,
–Digital Supply Voltage:
+5 V during normal operation and idle mode.
≥2.5 V during power down mode.
–Digital Ground.
41, 56,
60
1)
The CAN interface lines are assigned to ports P4 and P8 under software control. Within the CAN module
several assignments can be selected.
Note: The following behavioural differences must be observed when the bidirectional
reset is active:
• Bit BDRSTEN in register SYSCON cannot be changed after EINIT and is cleared
automatically after a reset.
• The reset indication flags always indicate a long hardware reset.
• The PORT0 configuration is treated as if it were a hardware reset. In particular, the
bootstrap loader may be activated when P0L.4 is low.
• Pin RSTIN
may only be connected to external reset devices with an open drain output
driver.
• A short hardware reset is extended to the duration of the internal reset sequence.
Data Sheet10V2.0, 2001-05
C164CI/SI
C164CL/SL
Functional Description
The architecture of the C164CI combines advantages of both RISC and CISC
processors and of advanced peripheral subsystems in a very well-balanced way. In
addition the on-chip memory blocks allow the design of compact systems with maximum
performance.
The following block diagram gives an overview of the different on-chip components and
of the advanced, high bandwidth internal bus structure of the C164CI.
Note: All time specifications refer to a CPU clock of 25 MHz
(see definition in the AC Characteristics section).
6
ProgMem
ROM: 48/64
OTP: 64
KByte
XRAM
2 KByte
CAN
Rev 2.0B active
EBC
XBUS Control
rt 4
o
External Bus
P
Control
Port 0
32
Instr. / Data
16
)
x
u
m
e
it D
-B
16
6
(1
S
U
B
X
ip
h
-C
n
O
168
ADC
10-Bit
8
Channels
Port 5Port 3
External Instr. / Data
Interrupt Controller
ASC0
(USART)
BRGen
C166-Core
CPU
SSC
(SPI)
BRGen
PEC
16-Level
Priority
GPT1
T2
T3
T4
9
Interrupt Bus
Peripheral Data Bus
Data
Data
16
CCOM2
16
rt
o
l P
16
a
u
D
RTCWDT
CCOM6
T7
T8
Port 8
IRAM
Internal
RAM
2 KByte
Osc / PLL
T12
T13
4
MCB04323_4ci
rt 1
o
P
XTAL
16
Figure 3Block Diagram
The program memory, the internal RAM (IRAM) and the set of generic peripherals are
connected to the CPU via separate buses. A fourth bus, the XBUS, connects external
resources as well as additional on-chip resoures, the X-Peripherals (see Figure 3).
The XBUS resources (XRAM, CAN) of the C164CI can be enabled or disabled during
initialization by setting the general X-Peripheral enable bit XPEN (SYSCON.2). Modules
that are disabled consume neither address space nor port pins.
Data Sheet11V2.0, 2001-05
C164CI/SI
C164CL/SL
Memory Organization
The memory space of the C164CI is configured in a Von Neumann architecture which
means that code memory, data memory, registers and I/O ports are organized within the
same linear address space which includes 16 MBytes. The entire memory space can be
accessed bytewise or wordwise. Particular portions of the on-chip memory have
additionally been made directly bitaddressable.
The C164CI incorporates 64 KBytes of on-chip OTP memory or 64/48 KBytes of on-chip
mask-programmable ROM (not in the ROM-less derivative, of course) for code or
constant data. The lower 32 KBytes of the on-chip ROM/OTP can be mapped either to
segment 0 or segment 1.
The OTP memory can be programmed by the CPU itself (in system, e.g. during booting)
or directly via an external interface (e.g. before assembly). The programming time is
V
approx. 100 µs per word. An external programming voltage
supplied for this purpose (via pin EA
/VPP).
=11.5V must be
PP
2 KBytes of on-chip Internal RAM (IRAM) are provided as a storage for user defined
variables, for the system stack, general purpose register banks and even for code. A
register bank can consist of up to 16 wordwide (R0 to R15) and/or bytewide (RL0, RH0,
…, RL7, RH7) so-called General Purpose Registers (GPRs).
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 C166 Family.
2 KBytes of on-chip Extension RAM (XRAM) are provided to store user data, user
stacks, or code. The XRAM is accessed like external memory and therefore cannot be
used for the system stack or for register banks and is not bitaddressable. The XRAM
permits 16-bit accesses with maximum speed.
In order to meet the needs of designs where more memory is required than is provided
on chip, up to 4 MBytes of external RAM and/or ROM can be connected to the
microcontroller.
Data Sheet12V2.0, 2001-05
C164CI/SI
C164CL/SL
External 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, which 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.
Important timing characteristics of the external bus interface (Memory Cycle Time,
Memory Tri-State Time, Length of ALE and Read Write Delay) have been made
programmable 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 register pairs
ADDRSELx / BUSCONx) which control the access to different resources with different
bus characteristics. These address windows are arranged hierarchically where
BUSCON4 overrides BUSCON3 and BUSCON2 overrides BUSCON1. All accesses to
locations not covered by these 4 address windows are controlled by BUSCON0.
Up to 4 external CS
external glue logic. The C164CI offers the possibility to switch the CS
unlatched mode. In this mode the internal filter logic is switched off and the CS
are directly generated from the address. The unlatched CS
CSCFG (SYSCON.6).
For applications which require less than 4 MBytes of external memory space, this
address space can be restricted to 1 MByte, 256 KByte, or to 64 KByte. In this case
Port 4 outputs four, two, or no address lines at all. It outputs all 6 address lines, if an
address space of 4 MBytes is used.
Note: When the on-chip CAN Module is used with the interface lines assigned to Port 4,
the CAN lines override the segment address lines and the segment address
output on Port 4 is therefore limited to 4 bits i.e. address lines A19 … A16.
signals (3 windows plus default) can be generated in order to save
outputs to an
signals
mode is enabled by setting
Data Sheet13V2.0, 2001-05
C164CI/SI
C164CL/SL
Central Processing Unit (CPU)
The main core of the CPU consists of a 4-stage instruction pipeline, a 16-bit arithmetic
and logic unit (ALU) and dedicated SFRs. Additional hardware has been spent for a
separate multiply and divide unit, a bit-mask generator and a barrel shifter.
Based on these hardware provisions, most of the C164CI’s instructions can be executed
in just one machine cycle which requires 2 CPU clocks (4 TCL). For example, shift and
rotate instructions are always processed during one machine cycle independent of the
number of bits to be shifted. All multiple-cycle instructions have been optimized so that
they can be executed very fast as well: branches in 2 cycles, a 16 × 16 bit multiplication
in 5 cycles and a 32-/16-bit division in 10 cycles. Another pipeline optimization, the socalled ‘Jump Cache’, reduces the execution time of repeatedly performed jumps in a loop
from 2 cycles to 1 cycle.
The CPU has a register context consisting of up to 16 wordwide GPRs at its disposal.
These 16 GPRs are physically allocated within the on-chip RAM area. A Context Pointer
(CP) register determines the base address of the active 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 1024 words is provided as a storage for temporary data. The
system stack is allocated 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 C164CI instruction set which includes
the following instruction classes:
– 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 Sheet15V2.0, 2001-05
C164CI/SI
C164CL/SL
Interrupt System
With an interrupt response time within a range from just 5 to 12 CPU clocks (in case of
internal program execution), the C164CI is capable of reacting very fast to the
occurrence of non-deterministic events.
The architecture of the C164CI supports several mechanisms for fast and flexible
response to service requests that can be generated from various sources internal or
external to the microcontroller. Any of these interrupt requests can be programmed to
being serviced by the Interrupt Controller or by the Peripheral Event Controller (PEC).
In contrast to a standard interrupt service where the current program execution is
suspended and a branch to the interrupt vector table is performed, just one cycle is
‘stolen’ from the current CPU activity to perform a PEC service. A PEC service implies a
single byte or word data transfer between any two memory locations with an additional
increment of either the PEC source or the destination pointer. An individual PEC transfer
counter is implicity decremented for each PEC service except when performing in the
continuous transfer mode. When this counter reaches zero, a standard interrupt is
performed to the corresponding source related vector location. PEC services are very
well suited, for example, for supporting the transmission or reception of blocks of data.
The C164CI has 8 PEC channels each of which offers such fast interrupt-driven data
transfer capabilities.
A separate control register which contains an interrupt request flag, an interrupt enable
flag and an interrupt priority bitfield exists for each of the possible interrupt sources. Via
its related register, each source can be programmed to one of sixteen interrupt priority
levels. Once having been accepted by the CPU, an interrupt service can only be
interrupted by a higher prioritized service request. For the standard interrupt processing,
each of the possible interrupt sources has a dedicated vector location.
Fast external interrupt inputs are provided to service external interrupts with high
precision requirements. These fast interrupt inputs feature programmable edge
detection (rising edge, falling edge or both edges).
Software interrupts are supported by means of the ‘TRAP’ instruction in combination with
an individual trap (interrupt) number.
Table 3 shows all of the possible C164CI interrupt sources and the corresponding
hardware-related interrupt flags, vectors, vector locations and trap (interrupt) numbers.
Note: Interrupt nodes which are not used by associated peripherals, may be used to
generate software controlled interrupt requests by setting the respective interrupt
request bit (xIR).
Data Sheet16V2.0, 2001-05
Table 3C164CI Interrupt Nodes
C164CI/SI
C164CL/SL
Source of Interrupt or
PEC Service Request
Request
Flag
Enable
Flag
Interrupt
Vector
Vector
Location
Fast External Interrupt 0 CC8IRCC8IECC8INT00’0060
Fast External Interrupt 1 CC9IRCC9IECC9INT00’0064
Fast External Interrupt 2 CC10IRCC10IECC10INT00’0068
Fast External Interrupt 3 CC11IRCC11IECC11INT00’006C
GPT1 Timer 2T2IRT2IET2INT00’0088
GPT1 Timer 3T3IRT3IET3INT00’008C
GPT1 Timer 4T4IRT4IET4INT00’0090
A/D Conversion
ADCIRADCIEADCINT00’00A0
Complete
A/D Overrun ErrorADEIRADEIEADEINT00’00A4
ASC0 TransmitS0TIRS0TIES0TINT00’00A8
ASC0 Transmit BufferS0TBIRS0TBIES0TBINT00’011C
ASC0 ReceiveS0RIRS0RIES0RINT00’00AC
H
H
H
H
H
H
H
H
H
H
H
H
Trap
Number
18
H
19
H
1A
H
1B
H
22
H
23
H
24
H
28
H
29
H
2A
H
47
H
2B
H
ASC0 ErrorS0EIRS0EIES0EINT00’00B0
SSC TransmitSCTIRSCTIESCTINT00’00B4
SSC ReceiveSCRIRSCRIESCRINT00’00B8
SSC ErrorSCEIRSCEIESCEINT00’00BC
CAPCOM Register 16CC16IRCC16IECC16INT00’00C0
CAPCOM Register 17CC17IRCC17IECC17INT00’00C4
CAPCOM Register 18CC18IRCC18IECC18INT00’00C8
CAPCOM Register 19CC19IRCC19IECC19INT00’00CC
CAPCOM Register 24CC24IRCC24IECC24INT00’00E0
CAPCOM Register 25CC25IRCC25IECC25INT00’00E4
CAPCOM Register 26CC26IRCC26IECC26INT00’00E8
CAPCOM Register 27CC27IRCC27IECC27INT00’00EC
CAPCOM Timer 7T7IRT7IET7INT00’00F4
CAPCOM Timer 8T8IRT8IET8INT00’00F8
CAPCOM6 InterruptCC6IRCC6IECC6INT00’00FC
2C
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
2D
2E
2F
30
31
32
33
38
39
3A
3B
3D
3E
3F
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
CAN Interface 1XP0IRXP0IEXP0INT00’0100
PLL/OWD and RTCXP3IRXP3IEXP3INT00’010C
Data Sheet17V2.0, 2001-05
40
H
H
43
H
H
Table 3C164CI Interrupt Nodes (cont’d)
C164CI/SI
C164CL/SL
Source of Interrupt or
PEC Service Request
Request
Flag
Enable
Flag
Interrupt
Vector
Vector
Location
CAPCOM 6 Timer 12T12IRT12IET12INT00’0134
CAPCOM 6 Timer 13T13IRT13IET13INT00’0138
CAPCOM 6 Emergency CC6EIRCC6EIECC6EINT00’013C
H
H
H
Trap
Number
4D
H
4E
H
4F
H
Data Sheet18V2.0, 2001-05
C164CI/SI
C164CL/SL
The C164CI also provides an excellent mechanism to identify and to process exceptions
or error conditions that arise during run-time, so-called ‘Hardware Traps’. Hardware
traps cause immediate non-maskable system reaction which is similar to a standard
interrupt service (branching to a dedicated vector table location). The occurence of a
hardware trap is additionally signified by an individual bit in the trap flag register (TFR).
Except when another higher prioritized trap service is in progress, a hardware trap will
interrupt any actual program execution. In turn, hardware trap services can normally not
be interrupted by standard or PEC interrupts.
Table 4 shows all of the possible exceptions or error conditions that can arise during run-
The general purpose CAPCOM2 unit supports generation and control of timing
sequences on up to 8 channels with a maximum resolution of 16 TCL. The CAPCOM
units are typically used to handle high speed I/O tasks such as pulse and waveform
generation, pulse width modulation (PMW), Digital to Analog (D/A) conversion, software
timing, or time recording relative to external events.
Two 16-bit timers (T7/T8) with reload registers provide two independent time bases for
the capture/compare register array.
Each dual purpose capture/compare register, which may be individually allocated to
either CAPCOM timer and programmed for capture or compare function, has one port
pin associated with it which serves as an input pin for triggering the capture function, or
as an output pin to indicate the occurrence of a compare event.
When a capture/compare register has been selected for capture mode, the current
contents of the allocated timer will be latched (‘capture’d) into the capture/compare
register in response to an external event at the port pin which is associated with this
register. In addition, a specific interrupt request for this capture/compare register is
generated. Either a positive, a negative, or both a positive and a negative external signal
transition at the pin can be selected as the triggering event. The contents of all registers
which have been selected for one of the five compare modes are continuously compared
with the contents of the allocated timers. When a match occurs between the timer value
and the value in a capture/compare register, specific actions will be taken based on the
selected compare mode.
Table 5Compare Modes (CAPCOM2)
Compare ModesFunction
Mode 0Interrupt-only compare mode;
several compare interrupts per timer period are possible
Mode 1Pin toggles on each compare match;
several compare events per timer period are possible
Mode 2Interrupt-only compare mode;
only one compare interrupt per timer period is generated
Mode 3Pin set ‘1’ on match; pin reset ‘0’ on compare time overflow;
only one compare event per timer period is generated
Double
Register Mode
Two registers operate on one pin; pin toggles on each compare
match;
several compare events per timer period are possible.
Registers CC16 & CC24 ➞ pin CC16IO
Registers CC17 & CC25 ➞ pin CC17IO
Registers CC18 & CC26 ➞ pin CC18IO
Registers CC19 & CC27 ➞ pin CC19IO
Data Sheet20V2.0, 2001-05
Loading...
+ 55 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.