The information given in this document shall in no event be regarded as a guarantee of conditions or
characteristics. 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 non-infringement of intellectual property rights
of any third party.
Information
For further information on technology, delivery terms and conditions and prices, please contact the 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 the nearest Infineon Technologies Office.
Infineon Technologies components may be used in life-support devices or systems only 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.
8-Bit
XC878CLM
8-Bit Single-Chip Microcontroller
Data Sheet
V1.2 2009-11
Microcontrollers
XC878CLM
XC878
Revision History:2009-11V1.2
Previous Version:V1.1
PageSubjects (major changes since last revision)
Changes from V1.1 2009-08 to V1.2 2009-10
3Table 1 and Table 2 has been updated to include the variants for the
Automotive profile.
57Table 21 has been added to show the Flash data retention and
endurance for Automotive profile.
106Table 37 has been updated to show the Chip Identification number for the
new Automotive variants.
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:
• High-performance XC800 Core
– compatible with standard 8051 processor
– two clocks per machine cycle architecture (for memory access without wait state)
– two data pointers
• On-chip memory
– 8 Kbytes of Boot ROM
– 256 bytes of RAM
– 3 Kbytes of XRAM
– 64/52 Kbytes of Flash;
(includes memory protection strategy)
•I/O port supply at 3.3 V or 5.0 V and core logic supply at 2.5 V (generated by
embedded voltage regulator)
(more features on next page)
52K/64K x 8
Boot ROM
8K x 8
XRAM
3K x 8
RAM
256 x 8
Flash
Timer 0
16-bit
On-Chip Debug Support
XC800 Core
Timer 1
16-bit
Timer 21
16-bit
Watchdog
Timer
UART
Capture/Compare Unit
Compare Unit
Timer 2 Capture/
Compare Unit
UART1
SSC
16-bit
16-bit
16-bit
ADC
10-bit
8-channel
8-bit Analog Input
Port 0
Port 1
Port 3
Port 4
Port 5MDUCORDICMulti CAN
8-bi t D i gital I/O
8-bi t D i gital I/O
.
8-bi t D i gital I/O
8-bi t D i gital I/O
8-bi t Digi tal I/O
Figure 1XC878 Functional Units
Data Sheet1V1.2, 2009-11
XC878CLM
Summary of Features
Features: (continued)
•Power-on reset generation
•Brownout detection for core logic supply
•On-chip OSC and PLL for clock generation
– Loss-of-Clock detection
•Power saving modes
– slow-down mode
– idle mode
– power-down mode with wake-up capability via RXD or EXINT0
– clock gating control to each peripheral
•Programmable 16-bit Watchdog Timer (WDT)
•Five ports
– Up to 40 pins as digital I/O
– 8 dedicated analog inputs used as A/D converter input
•8-channel, 10-bit ADC
•Four 16-bit timers
– Timer 0 and Timer 1 (T0 and T1)
– Timer 2 and Timer 21 (T2 and T21)
•Multiplication/Division Unit for arithmetic operations (MDU)
•CORDIC Coprocessor for computation of trigonometric, hyperbolic and linear
functions
•MultiCAN with 2 nodes, 32 message objects
•Two Capture/compare units
– Capture/compare unit 6 for PWM signal generation (CCU6)
– Timer 2 Capture/compare unit for vaious digital signal generation (T2CCU)
•Two full-duplex serial interfaces (UART and UART1)
•Synchronous serial channel (SSC)
•On-chip debug support
– 1 Kbyte of monitor ROM (part of the 8-Kbyte Boot ROM)
– 64 bytes of monitor RAM
•PG-LQFP-64 pin package
•Temperature range T
– SAF (-40 to 85 °C)
– SAX (-40 to 105 °C)
:
A
Data Sheet2V1.2, 2009-11
XC878CLM
Summary of Features
XC878 Variant Devices
The XC878 product family features devices with different configurations, program
memory sizes, power supply voltage, temperature and quality profiles (Automotive or
Industrial), to offer cost-effective solutions for different application requirements.
The list of XC878 device configurations are summarized in Table 1. The type of package
available is the LQFP-64.
Table 1Device Configuration
Device NameCAN
Module
LIN BSL
Support
MDU
Module
XC878NoNoNo
XC878MNoNoYes
XC878CMYesNoYes
XC878LMNoYesYes
XC878CLM Yes Yes Yes
From these 5 different combinations of configuration, each are further made available in
many sales types, which are grouped according to device type, program memory sizes,
power supply voltage, temperature and quality profiles (Automotive or Industrial), as
shown in Table 2.
Table 2Device Profile
Sales TypeDevice
Type
Program
Memory
(Kbytes)
Power
Supply
(V)
Temperature
(°C)
Quality
Profile
SAF-XC878-13FFI 5VFlash525.0-40 to 85Industrial
SAF-XC878M-13FFI 5VFlash525.0-40 to 85Industrial
SAF-XC878CM-13FFI 5VFlash525.0-40 to 85Industrial
SAF-XC878-16FFI 5VFlash645.0-40 to 85Industrial
SAF-XC878M-16FFI 5VFlash645.0-40 to 85Industrial
SAF-XC878CM-16FFI 5VFlash645.0-40 to 85Industrial
SAF-XC878-13FFI 3V3Flash523.3-40 to 85Industrial
SAF-XC878M-13FFI 3V3Flash523.3-40 to 85Industrial
SAF-XC878CM-13FFI 3V3Flash523.3-40 to 85Industrial
SAF-XC878-16FFI 3V3Flash643.3-40 to 85Industrial
SAF-XC878M-16FFI 3V3Flash643.3-40 to 85Industrial
Data Sheet3V1.2, 2009-11
Table 2Device Profile (cont’d)
XC878CLM
Summary of Features
Sales TypeDevice
Type
Program
Memory
(Kbytes)
Power
Supply
(V)
Temperature
(°C)
Quality
Profile
SAF-XC878CM-16FFI 3V3Flash643.3-40 to 85Industrial
SAX-XC878-13FFA 5VFlash525.0-40 to 105Automotive
SAX-XC878CM-13FFA 5VFlash525.0-40 to 105Automotive
SAX-XC878LM-13FFA 5VFlash525.0-40 to 105Automotive
SAX-XC878CLM-13FFA 5VFlash525.0-40 to 105Automotive
SAX-XC878-16FFA 5VFlash645.0-40 to 105Automotive
SAX-XC878CM-16FFA 5VFlash645.0-40 to 105Automotive
SAX-XC878LM-16FFA 5VFlash645.0-40 to 105Automotive
SAX-XC878CLM-16FFA 5VFlash645.0-40 to 105Automotive
As this document refers to all the derivatives, some description may not apply to a
specific product. For simplicity, all versions are referred to by the term XC878 throughout
this document.
Ordering Information
The ordering code for Infineon Technologies 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 XC878, please refer to your responsible sales
representative or your local distributor.
Data Sheet4V1.2, 2009-11
XC878CLM
General Device Information
2General Device Information
Chapter 2 contains the block diagram, pin configurations, definitions and functions of the
XC878.
2.1Block Diagram
The block diagram of the XC878 is shown in Figure 2.
TMS
MBC
TM
RESET
V
DDP
V
SSP
V
DDC
V
SSC
XTAL1
XTAL2
XC878
8-Kbyte
Boot ROM
1)
256-byte RAM
+
64-byte monitor
RAM
3-Kbyte XRAM
52/64-Kbyte
Flash
Clock Generator
4 MHz
On-chip OSC
PLL
Internal Bus
XC800 Core
T0 & T1UART
UART1CORDIC
SSCMDU
WDT
OCDS
CCU 6
MultiCAN
Timer 2 Capture/
Compare Unit
Timer 21
P0.0 - P0.7
P1.0 - P1.7
P3.0 - P3.7
P4.0 - P4.7
Port 4Port 5
P5.0 - P5.7
AN0 – AN7
ADCPort 0Port 1Port 3
V
V
AREF
AGND
1) Includes 1-Kbyte monitor ROM
Figure 2XC878 Block Diagram
Data Sheet5V1.2, 2009-11
2.2Logic Symbol
The logic symbol of the XC878 is shown in Figure 3.
The functions and default states of the XC878 external pins are provided in Table 3.
Table 3Pin Definitions and Functions
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P0I/OPort 0
Port 0 is an 8-bit bidirectional general purpose
I/O port. It can be used as alternate functions
for the JTAG, CCU6, UART, UART1, T2CCU,
Timer
Interface.
P0.017Hi-ZTCK_0
T12HR_1
CC61_1
CLKOUT_0
RXDO_1
P0.121Hi-ZTDI_0
T13HR_1
RXD_1
RXDC1_0
COUT61_1
EXF2_1
21, MultiCAN, SSC and External
JTAG Clock Input
CCU6 Timer 12 Hardware Run
Input
Input/Output of
Capture/Compare channel 1
Clock Output
UART Transmit Data Output
JTAG Serial Data Input
CCU6 Timer 13 Hardware Run
Input
UART Receive Data Input
MultiCAN Node 1 Receiver Input
Output of Capture/Compare
channel 1
Timer 2 External Flag Output
P0.218PUCTRAP_2
TDO_0
TXD_1
CCU6 Trap Input
JTAG Serial Data Output
UART Transmit Data
Output/Clock Output
TXDC1_0
MultiCAN Node 1 Transmitter
Output
P0.363Hi-ZSCK_1
COUT63_1
SSC Clock Input/Output
Output of Capture/Compare
channel 3
RXDO1_0
A17
Data Sheet8V1.2, 2009-11
UART1 Transmit Data Output
Address Line 17 Output
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P0.464Hi-ZMTSR_1
CC62_1
TXD1_0
A18
P0.51Hi-ZMRST_1
EXINT0_0
T2EX1_1
RXD1_0
COUT62_1
A19
P0.62PUT2CC4_1
WR
SSC Master Transmit Output/
Slave Receive Input
Input/Output of
Capture/Compare channel 2
UART1 Transmit Data
Output/Clock Output
Address Line 18 Output
SSC Master Receive Input/Slave
Transmit Output
External Interrupt Input 0
Timer 21 External Trigger Input
UART1 Receive Data Input
Output of Capture/Compare
channel 2
Address Line 19 Output
Compare Output Channel 4
External Data Write Control
Output
P0.762PUCLKOUT_1
T2CC5_1
RD
Clock Output
Compare Output Channel 5
External Data Read Control
Output
Data Sheet9V1.2, 2009-11
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P1I/OPort 1
Port 1 is an 8-bit bidirectional general purpose
I/O port. It can be used as alternate functions
for the JTAG, CCU6, UART, Timer 0, Timer 1,
T2CCU, Timer 21, MultiCAN, SSC and
External Interface.
P1.034PURXD_0
T2EX_0
RXDC0_0
A8
P1.135PUEXINT3_0
T0_1
TXD_0
TXDC0_0
A9
UART Receive Data Input
Timer 2 External Trigger Input
MultiCAN Node 0 Receiver Input
Address Line 8 Output
External Interrupt Input 3
Timer 0 Input
UART Transmit Data
Output/Clock Output
MultiCAN Node 0 Transmitter
Output
Address Line 9 Output
P1.236PUSCK_0
A10
P1.337PUMTSR_0
SCK_2
TXDC1_3
A11
P1.438PUMRST_0
EXINT0_1
RXDC1_3
MTSR_2
A12
SSC Clock Input/Output
Address Line 10 Output
SSC Master Transmit
Output/Slave Receive Input
SSC Clock Input/Output
MultiCAN Node 1 Transmitter
Output
Address Line 11 Output
SSC Master Receive Input/
Slave Transmit Output
External Interrupt Input 0
MultiCAN Node 1 Receiver Input
SSC Master Transmit
Output/Slave Receive Input
Address Line 12 Output
Data Sheet10V1.2, 2009-11
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P1.539PUCCPOS0_1
EXINT5_0
T1_1
MRST_2
EXF2_0
RXDO_0
P1.610PUCCPOS1_1
T12HR_0
EXINT6_0
RXDC0_2
T21_1
P1.711PUCCPOS2_1
T13HR_0
T2_1
TXDC0_2
CCU6 Hall Input 0
External Interrupt Input 5
Timer 1 Input
SSC Master Receive Input/
Slave Transmit Output
Timer 2 External Flag Output
UART Transmit Data Output
CCU6 Hall Input 1
CCU6 Timer 12 Hardware Run
Input
External Interrupt Input 6
MultiCAN Node 0 Receiver Input
Timer 21 Input
CCU6 Hall Input 2
CCU6 Timer 13 Hardware Run
Input
Timer 2 Input
MultiCAN Node 0 Transmitter
Output
P1.5 and P1.6 can be used as a software chip
select output for the SSC.
Data Sheet11V1.2, 2009-11
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P3I/OPort 3
Port 3 is an 8-bit bidirectional general purpose
I/O port. It can be used as alternate functions
for CCU6, UART1, T2CCU, Timer 21,
MultiCAN and External Interface.
Port 4 is an 8-bit bidirectional general purpose
I/O port. It can be used as alternate functions
for CCU6, Timer 0, Timer 1, T2CCU, Timer 21,
MultiCAN and External Interface.
P4.059Hi-ZRXDC0_3
CC60_1
T2CC0_0/
EXINT3_1
D0
P4.160Hi-ZTXDC0_3
COUT60_1
T2CC1_0/
EXINT4_1
D1
MultiCAN Node 0 Receiver Input
Output of Capture/Compare
channel 0
External Interrupt Input 3/T2CCU
Capture/Compare Channel 0
Data Line 0 Input/Output
MultiCAN Node 0 Transmitter
Output
Output of Capture/Compare
channel 0
External Interrupt Input 4/T2CCU
Capture/Compare Channel 1
Data Line 1 Input/Output
P4.261PUEXINT6_1
T21_0
D2
P4.340Hi-ZT2EX_1
EXF21_1
COUT63_2
D3
P4.445Hi-ZCCPOS0_3
T0_0
CC61_4
T2CC2_0/
EXINT5_1
D4
External Interrupt Input 6
Timer 21 Input
Data Line 2 Input/Output
Timer 2 External Trigger Input
Timer 21 External Flag Output
Output of Capture/Compare
channel 3
Data Line 3 Input/Output
CCU6 Hall Input 0
Timer 0 Input
Output of Capture/Compare
channel 1
External Interrupt Input 5/T2CCU
Capture/Compare Channel 2
Data Line 4 Input/Output
Data Sheet14V1.2, 2009-11
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P4.546Hi-ZCCPOS1_3
T1_0
COUT61_2
T2CC3_0/
EXINT6_2
D5
P4.647Hi-ZCCPOS2_3
T2_0
CC62_2
T2CC4_0
D6
P4.748Hi-ZCTRAP_3
COUT62_2
T2CC5_0
D7
CCU6 Hall Input 1
Timer 1 Input
Output of Capture/Compare
channel 1
External Interrupt Input 6/T2CCU
Capture/Compare Channel 3
Data Line 5 Input/Output
CCU6 Hall Input 2
Timer 2 Input
Output of Capture/Compare
channel 2
Compare Output Channel 4
Data Line 6 Input/Output
CCU6 Trap Input
Output of Capture/Compare
channel 2
Compare Output Channel 5
Data Line 7 Input/Output
Data Sheet15V1.2, 2009-11
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P5I/OPort 5
Port 5 is an 8-bit bidirectional general purpose
I/O port. It can be used as alternate functions
for UART, UART1, T2CCU, JTAG and External
Interface.
P5.08PUEXINT1_1A0External Interrupt Input 1
Address Line 0 Output
P5.19PUEXINT2_1A1External Interrupt Input 2
Address Line 1 Output
P5.212PURXD_2
T2CC2_2/
EXINT5_3
A2
P5.313PUCCPOS0_0
EXINT1_0
T12HR_2
UART Receive Data Input
External Interrupt Input 5/T2CCU
Capture/Compare Channel 2
Address Line 2 Output
CCU6 Hall Input 0
External Interrupt Input 1
CCU6 Timer 12 Hardware Run
Input
CC61_3
Input of Capture/Compare
channel 1
TXD_2
UART Transmit Data
Output/Clock Output
T2CC5_2
A3
Compare Output Channel 5
Address Line 3 Output
P5.414PUCCPOS1_0
EXINT2_0
T13HR_2
CCU6 Hall Input 1
External Interrupt Input 2
CCU6 Timer 13 Hardware Run
Input
CC62_3
Input of Capture/Compare
channel 2
RXDO_2
T2CC4_2
A4
Data Sheet16V1.2, 2009-11
UART Transmit Data Output
Compare Output Channel 4
Address Line 4 Output
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
Type Reset
State
Function
P5.515PUCCPOS2_0
CTRAP_1
CC60_3
TDO_1
TXD1_2
T2CC0_2/
EXINT3_3
A5
P5.619PUTCK_1
RXDO1_2
T2CC1_2/
EXINT4_3
A6
P5.720PUTDI_1
RXD1_2
T2CC3_2/
EXINT6_4
A7
CCU6 Hall Input 2
CCU6 Trap Input
Input of Capture/Compare
channel 0
JTAG Serial Data Output
UART1 Transmit Data Output/
Clock Output
External Interrupt Input 3/T2CCU
Capture/Compare Channel 0
Address Line 5 Output
JTAG Clock Input
UART1 Transmit Data Output
External Interrupt Input 4/T2CCU
Capture/Compare Channel 1
Address Line 6 Output
JTAG Serial Data Input
UART1 Receive Data Input
External Interrupt Input 6/T2CCU
Capture/Compare Channel 3
Address Line 7 Output
Data Sheet17V1.2, 2009-11
Table 3Pin Definitions and Functions (cont’d)
XC878CLM
General Device Information
Symbol Pin Number
(LQFP-64)
V
DDP
7, 25, 55––I/O Port Supply (3.3 or 5.0 V)
Type Reset
State
Function
Also used by EVR and analog modules. All
pins must be connected.
V
SSP
26, 54––I/O Ground
All pins must be connected.
V
V
V
V
DDC
SSC
AREF
AGND
6––Core Supply Monitor (2.5 V)
5––Core Supply Ground
32––ADC Reference Voltage
31––ADC Reference Ground
AN022IHi-ZAnalog Input 0
AN123IHi-ZAnalog Input 1
AN224IHi-ZAnalog Input 2
AN327IHi-ZAnalog Input 3
AN428IHi-ZAnalog Input 4
AN529IHi-ZAnalog Input 5
AN630IHi-ZAnalog Input 6
AN733IHi-ZAnalog Input 7
XTAL14IHi-ZExternal Oscillator Input
(Feedback resistor required, normally NC)
XTAL23OHi-ZExternal Oscillator Output
(Feedback resistor required, normally NC)
TMS16IPDJTAG Test Mode Select
RESET53IPUReset Input
MBC58IPUMonitor & BootStrap Loader Control
TM57––Test Mode
(External pull down device required)
NC56––No Connection
Data Sheet18V1.2, 2009-11
XC878CLM
Functional Description
3Functional Description
Chapter 3 provides an overview of the XC878 functional description.
3.1Processor Architecture
The XC878 is based on a high-performance 8-bit Central Processing Unit (CPU) that is
compatible with the standard 8051 processor. While the standard 8051 processor is
designed around a 12-clock machine cycle, the XC878 CPU uses a 2-clock machine
cycle. This allows fast access to ROM or RAM memories without wait state. The
instruction set consists of 45% one-byte, 41% two-byte and 14% three-byte instructions.
The XC878 CPU provides a range of debugging features, including basic stop/start,
single-step execution, breakpoint support and read/write access to the data memory,
program memory and Special Function Registers (SFRs).
Figure 5 shows the CPU functional blocks.
External Data
Memory
Program Memory
f
CCLK
Memory Wait
Reset
Legacy External Interrupts (IEN0, IEN1)
External Interrupts
Non-Maskable Interrupt
Core SFRs
16-bit R egisters &
Memory Interface
Opcode &
Immediate
Registers
Opcode D ecoder
State Machine &
Power Saving
Interrupt
Controller
Internal Data
Memory
Register Interface
External SFRs
ALU
Multiplier / Divider
Timer 0 / Timer 1
UART
Figure 5CPU Block Diagram
Data Sheet19V1.2, 2009-11
XC878CLM
Functional Description
3.2Memory Organization
The XC878 CPU operates in the following address spaces:
•8 Kbytes of Boot ROM program memory
•256 bytes of internal RAM data memory
•3 Kbytes of XRAM memory
(XRAM can be read/written as program memory or external data memory)
•A 128-byte Special Function Register area
•64/52 Kbytes of Flash program memory (Flash devices)
Figure 6 and Figure 7 illustrate the memory address spaces of the XC878 with
64Kbytes and 52Kbytes embedded Flash respectively.
Bank F
Bank E
Bank D
Bank C
Bank B
Bank A
Bank 9
Bank 8
Bank 7
Bank 6
Bank 5
Bank 4
Bank 3
Bank 2Bank 0
Bank 1
Reserved
Reserved
External
Reserved
External
XRAM
3 KByte
Reserved
Boot ROM
8 KByte
Reserved
D-Flash
4 KByte
P-Flash
60 KByte
F' FF FF
F' 0000
E' FFFF
E' 0000
D' FFFF
D' 0000
C' FFFF
C' 0000
B' FFFF
B' 0000
A' FFFF
A' 0000
9' FFFF
9' 0000
8' FFFF
8' 0000
7' FFFF
7' 0000
6' FFFF
6' 0000
5' FFFF
5' 0000
4' FFFF
4' 0000
3' FFFF
3' 0000
2' FFFF
2' FEC0
2' FE00
2' FC00
2' F000
2' E000
2' C000
2' 0000
1' FFFF
1' 0000
0' FFFF
0' F000
0' 0000
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
External
XRAM
3 KByte
External
Reserved
Ext ernal
Reserved
External
Reserved
External
Reserved
F' FFFF
F' FC0 0
F' F000
F' 0000
E' FFFF
E' 0000
D' FFFF
D' 0000
C' FFFF
C' 0000
B' FFFF
B' 0000
A' FFFF
A' 0000
9' FFFF
9' 0000
8' FFFF
8' 0000
7' FFFF
7' 0000
6' FFFF
6' 0000
5' FFFF
5' 0000
4' FFFF
4' 0000
3' FFFF
3' 0000
2' FFFF
2' FEC0
2' FE00
2' FC00
2' F000
2' E000
2' C000
2' 0000
1' FFFF
1' 0000
0' FFFF
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
Memory Ex tension
H
Stack Pointer
H
H
H
Ext ensi on Stack R AM
H
(MEXSP)
Indirect
Address
Internal RAM
Direct
Address
Speci al Func ti on
Registers
7F
H
FF
H
80
H
Internal RAM
0' 0000
H
H
00
H
Code SpaceInternal Data Space
Data Space
Memor y Map U ser Mode
Figure 6Memory Map of XC878 with 64K Flash Memory in user mode
Data Sheet20V1.2, 2009-11
XC878CLM
Functional Description
External
Reserved
External
XRAM
2 KByte
D-Flash
4 KByte
Boot ROM
8 KByte
P-Flash
48 KByte /
Reserved
P-Flash
32 KBy te
F’FFFF
1'0000
FFFF
FEC0
FE00
FC0 0
F000
E000
C00 0
8000
0000
H
F’FFFF
H
ExternalReserved
H
H
H
H
H
H
H
External
Reserved
External
XRAM
2 KBy te
1'0000
FFFF
FEC0
FE00
FC0 0
F000
H
H
H
H
H
H
Reserved
H
C00 0
H
Reserved /
Ext ernal
H
Reserved
8000
H
Memory Extensi on
Extension Stack RAM
Stack Pointer
(MEXSP)
Indirect
Address
Internal RAM
Direct
Addres s
Special Function
Registers
7F
H
FF
H
80
H
Internal RAM
H
0000
H
00
H
Code Spac eInternal Data Space
Data Space
Figure 7Memory Map of XC878 with 52K Flash Memory in user mode
Memory Map User Mode
Data Sheet21V1.2, 2009-11
XC878CLM
Functional Description
3.2.1Memory Protection Strategy
The XC878 memory protection strategy includes:
•Basic protection: The user is able to block any external access via the boot option to
any memory
•Read-out protection: The user is able to protect the contents in the Flash
•Flash program and erase protection
These protection strategies are enabled by programming a valid password (16-bit nonone value) via Bootstrap Loader (BSL) mode 6.
3.2.1.1Flash Memory Protection
As long as a valid password is available, all external access to the device, including the
Flash, will be blocked.
For additional security, the Flash hardware protection can be enabled to implement a
second layer of read-out protection, as well as to enable program and erase protection.
Flash hardware protection is available only for Flash devices and comes in two modes:
•Mode 0: Only the P-Flash is protected; the D-Flash is unprotected
•Mode 1: Both the P-Flash and D-Flash are protected
The selection of each protection mode and the restrictions imposed are summarized in
Table 4.
Table 4Flash Protection Modes
Flash
Protection
Hardware
Protection
Mode
ActivationProgram a valid password via BSL mode 6
SelectionBit 13 of password = 0Bit 13 of password = 1
P-Flash
contents
can be read
by
Without hardware
protection
-01
Read instructions in
any program memory
With hardware protection
Bit 13 of password = 1
MSB of password = 0
Read instructions in
the P-Flash
MSB of password = 1
Read instructions in
the P-Flash or DFlash
External
access to PFlash
Data Sheet22V1.2, 2009-11
Not possibleNot possibleNot possible
Table 4Flash Protection Modes (cont’d)
XC878CLM
Functional Description
Flash
Protection
P-Flash
program
and erase
D-Flash
contents
can be read
by
External
access to DFlash
D-Flash
program
D-Flash
erase
Without hardware
With hardware protection
protection
PossiblePossible only on the
condition that MSB - 1
of password is set to 1
Read instructions in
any program memory
Read instructions in
any program memory
Possible only on the
condition that MSB - 1
of password is set to 1
Read instructions in
the P-Flash or DFlash
Not possibleNot possibleNot possible
PossiblePossiblePossible, on the
condition that MSB - 1
of password is set to 1
PossiblePossible, on these
conditions:
•MISC_CON.DFLASH
Possible, on the
condition that MSB - 1
of password is set to 1
EN bit is set to 1
prior to each erase
operation; or
•the MSB - 1 of
password is set to 1
BSL mode 6, which is used for enabling Flash protection, can also be used for disabling
Flash protection. Here, the programmed password must be provided by the user. To
disable the flash protection, a password match is required. A password match triggers
an automatic erase of the protected P-Flash and D-Flash contents, including the
programmed password. With a valid password, the Flash hardware protection is then
enabled or disabled upon next reset. For the other protection strategies, no reset is
necessary.
Although no protection scheme can be considered infallible, the XC878 memory
protection strategy provides a very high level of protection for a general purpose
microcontroller.
Note: If ROM read-out protection is enabled, only read instructions in the ROM memory
can target the ROM contents.
Data Sheet23V1.2, 2009-11
XC878CLM
Functional Description
3.2.2Special Function Register
The Special Function Registers (SFRs) occupy direct internal data memory space in the
range 80
to FFH. All registers, except the program counter, reside in the SFR area. The
H
SFRs include pointers and registers that provide an interface between the CPU and the
on-chip peripherals. As the 128-SFR range is less than the total number of registers
required, address extension mechanisms are required to increase the number of
addressable SFRs. The address extension mechanisms include:
•Mapping
•Paging
3.2.2.1Address Extension by Mapping
Address extension is performed at the system level by mapping. The SFR area is
extended into two portions: the standard (non-mapped) SFR area and the mapped SFR
area. Each portion supports the same address range 80
addressable SFRs to 256. The extended address range is not directly controlled by the
CPU instruction itself, but is derived from bit RMAP in the system control register
SYSCON0 at address 8F
. To access SFRs in the mapped area, bit RMAP in SFR
H
SYSCON0 must be set. Alternatively, the SFRs in the standard area can be accessed
by clearing bit RMAP. The SFR area can be selected as shown in Figure 8.
to FFH, bringing the number of
H
As long as bit RMAP is set, the mapped SFR area can be accessed. This bit is not
cleared automatically by hardware. Thus, before standard/mapped registers are
accessed, bit RMAP must be cleared/set, respectively, by software.
Data Sheet24V1.2, 2009-11
Functional Description
Standard Area (RMAP = 0)
Module 1 SFRs
FF
XC878CLM
H
SFR Data
(to/from CPU)
SYSCON0.RMAP
rw
Module 2 SFRs
…...
Module n SFRs
Mapped Area (RMAP = 1)
Module (n+1) SFRs
Module (n+2) SFRs
…...
80
FF
H
H
Module m SFRs
80
H
Direct
Internal Data
Memory Address
Figure 8Address Extension by Mapping
Data Sheet25V1.2, 2009-11
XC878CLM
Functional Description
SYSCON0
System Control Register 0Reset Value: 04
76543210
0IMODE010RMAP
rrwrrrrw
FieldBitsTypeDescription
RMAP0rwInterrupt Node XINTR0 Enable
0The access to the standard SFR area is
enabled
1The access to the mapped SFR area is
enabled
H
12rReserved
Returns 1 if read; should be written with 1.
0[7:5],
3,1
rReserved
Returns 0 if read; should be written with 0.
Note: The RMAP bit should be cleared/set by ANL or ORL instructions.The rest bits of
SYSCON0 should not be modified.
3.2.2.2Address Extension by Paging
Address extension is further performed at the module level by paging. With the address
extension by mapping, the XC878 has a 256-SFR address range. However, this is still
less than the total number of SFRs needed by the on-chip peripherals. To meet this
requirement, some peripherals have a built-in local address extension mechanism for
increasing the number of addressable SFRs. The extended address range is not directly
controlled by the CPU instruction itself, but is derived from bit field PAGE in the module
page register MOD_PAGE. Hence, the bit field PAGE must be programmed before
accessing the SFR of the target module. Each module may contain a different number
of pages and a different number of SFRs per page, depending on the specific
requirement. Besides setting the correct RMAP bit value to select the SFR area, the user
must also ensure that a valid PAGE is selected to target the desired SFR. A page inside
the extended address range can be selected as shown in Figure 9.
Data Sheet26V1.2, 2009-11
SFR Address
(from CPU)
XC878CLM
Functional Description
PAGE 0
SFR Data
(to/from CPU)
MOD_PAGE.PAGE
rw
SFR0
SFR1
…...
SFRx
PAGE 1
SFR0
SFR1
…...
SFRy
…...
PAGE q
SFR0
SFR1
…...
SFRz
Module
Figure 9Address Extension by Paging
In order to access a register located in a page different from the actual one, the current
page must be exited. This is done by reprogramming the bit field PAGE in the page
register. Only then can the desired access be performed.
If an interrupt routine is initiated between the page register access and the module
register access, and the interrupt needs to access a register located in another page, the
current page setting can be saved, the new one programmed and the old page setting
restored. This is possible with the storage fields STx (x = 0 - 3) for the save and restore
action of the current page setting. By indicating which storage bit field should be used in
parallel with the new page value, a single write operation can:
•Save the contents of PAGE in STx before overwriting with the new value
(this is done in the beginning of the interrupt routine to save the current page setting
and program the new page number); or
Data Sheet27V1.2, 2009-11
XC878CLM
Functional Description
•Overwrite the contents of PAGE with the contents of STx, ignoring the value written
to the bit positions of PAGE
(this is done at the end of the interrupt routine to restore the previous page setting
before the interrupt occurred)
ST3
ST2
ST1
ST0
STNR
value update
PAGE
from CPU
Figure 10Storage Elements for Paging
With this mechanism, a certain number of interrupt routines (or other routines) can
perform page changes without reading and storing the previously used page information.
The use of only write operations makes the system simpler and faster. Consequently,
this mechanism significantly improves the performance of short interrupt routines.
The XC878 supports local address extension for:
•Parallel Ports
•Analog-to-Digital Converter (ADC)
•Capture/Compare Unit 6 (CCU6)
•System Control Registers
Data Sheet28V1.2, 2009-11
XC878CLM
Functional Description
The page register has the following definition:
MOD_PAGE
Page Register for module MODReset Value: 00
76543210
OPSTNR0PAGE
wwrrw
FieldBitsTypeDescription
PAGE[2:0]rwPage Bits
When written, the value indicates the new page.
When read, the value indicates the currently active
page.
H
STNR[5:4]wStorage Number
This number indicates which storage bit field is the
target of the operation defined by bit field OP.
If OP = 10
,
B
the contents of PAGE are saved in STx before being
overwritten with the new value.
If OP = 11
,
B
the contents of PAGE are overwritten by the
contents of STx. The value written to the bit positions
of PAGE is ignored.
00ST0 is selected.
01ST1 is selected.
10ST2 is selected.
11ST3 is selected.
Data Sheet29V1.2, 2009-11
FieldBitsTypeDescription
OP[7:6]wOperation
0XManual page mode. The value of STNR is
ignored and PAGE is directly written.
10New page programming with automatic page
saving. The value written to the bit positions of
PAGE is stored. In parallel, the previous
contents of PAGE are saved in the storage bit
field STx indicated by STNR.
11Automatic restore page action. The value
written to the bit positions PAGE is ignored
and instead, PAGE is overwritten by the
contents of the storage bit field STx indicated
by STNR.
XC878CLM
Functional Description
03rReserved
Returns 0 if read; should be written with 0.
3.2.3Bit Protection Scheme
The bit protection scheme prevents direct software writing of selected bits (i.e., protected
bits) using the PASSWD register. When the bit field MODE is 11
bit field PASS opens access to writing of all protected bits, and writing 10101
field PASS closes access to writing of all protected bits. In both cases, the value of the
bit field MODE is not changed even if PASSWD register is written with 98
only be changed when bit field PASS is written with 11000
, for example, writing D0H to
B
PASSWD register disables the bit protection scheme.
Note that access is opened for maximum 32 CCLKs if the “close access” password is not
written. If “open access” password is written again before the end of 32 CCLK cycles,
there will be a recount of 32 CCLK cycles. The protected bits include the N- and KDivider bits, NDIV and KDIV; the Watchdog Timer enable bit, WDTEN; and the powerdown and slow-down enable bits, PD and SD.
, writing 10011B to the
B
to the bit
B
or A8H. It can
H
Data Sheet30V1.2, 2009-11
XC878CLM
Functional Description
3.2.3.1Password Register
PASSWD
Password Register Reset Value: 07
76543210
H
PASS
wrhrw
PROTECT
_S
FieldBitsTypeDescription
MODE[1:0]rwBit Protection Scheme Control Bits
00Scheme disabled - direct access to the
protected bits is allowed.
11Scheme enabled - the bit field PASS has to be
written with the passwords to open and close
the access to protected bits. (default)
Others:Scheme Enabled.
These two bits cannot be written directly. To change
the value between 11
must be written with 11000
and 00B, the bit field PASS
B
; only then, will the
B
MODE[1:0] be registered.
PROTECT_S2rhBit Protection Signal Status Bit
This bit shows the status of the protection.
0Software is able to write to all protected bits.
1Software is unable to write to any protected
bits.
MODE
PASS[7:3]wPassword Bits
The Bit Protection Scheme only recognizes three
patterns.
11000B Enables writing of the bit field MODE.
10011
10101
Data Sheet31V1.2, 2009-11
Opens access to writing of all protected bits.
B
Closes access to writing of all protected bits
B
XC878CLM
Functional Description
3.2.4XC878 Register Overview
The SFRs of the XC878 are organized into groups according to their functional units. The
contents (bits) of the SFRs are summarized in Chapter 3.2.4.1 to Chapter 3.2.4.15.
Note: The addresses of the bitaddressable SFRs appear in bold typeface.
3.2.4.1CPU Registers
The CPU SFRs can be accessed in both the standard and mapped memory areas
(RMAP = 0 or 1).
Table 5CPU Register Overview
Addr Register NameBit76543210
RMAP = 0 or 1
81
82
83
87
88
89
8A
8B
8C
8D
94
95
96
SPReset: 07
H
Stack Pointer Register
DPLReset: 00
H
Data Pointer Register Low
DPHReset: 00
H
Data Pointer Register High
PCONReset: 00
H
Power Control Register
TCONReset: 00
H
Timer Control Register
TMODReset: 00
H
Timer Mode Register
TL0Reset: 00
H
Timer 0 Register Low
TL1Reset: 00
H
Timer 1 Register Low
TH0Reset: 00
H
Timer 0 Register High
TH1Reset: 00
H
Timer 1 Register High
MEX1Reset: 00
H
Memory Extension Register 1
MEX2Reset: 00
H
Memory Extension Register 2
MEX3Reset: 00
H
Memory Extension Register 3
Bit Field
H
Typerw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrrwrwrrw
Bit Field
H
Typerwhrwrwhrwrwhrwrwhrw
Bit Field
H
Typerwrwrwrwrwrw
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerrw
Bit FieldMCMMCBIB
H
Typerwrwrw
Bit FieldMCB1
H
Typerwrrwrwrw
DPL7DPL6DPL5DPL4DPL3DPL2DPL1DPL0
DPH7DPH6DPH5DPH4DPH3DPH2DPH1DPH0
SMOD0GF1GF00IDLE
TF1TR1TF0TR0IE1IT1IE0IT0
GATE1T1ST1MGATE0T0ST0M
CBNB
0MXB19MXMMXB
9
SP
VAL
VAL
VAL
VAL
Data Sheet32V1.2, 2009-11
XC878CLM
Functional Description
Table 5CPU Register Overview (cont’d)
Addr Register NameBit76543210
97
98
99
A2
A8
B8
B9
D0
E0
E8
F0
F8
F9
MEXSPReset: 7F
H
Memory Extension Stack
Pointer Register
SCONReset: 00
H
Serial Channel Control Register
SBUFReset: 00
H
Serial Data Buffer Register
EOReset: 00
H
Extended Operation Register
IEN0Reset: 00
H
Interrupt Enable Register 0
IPReset: 00
H
Interrupt Priority Register
IPHReset: 00
H
Interrupt Priority High Register
PSWReset: 00
H
Program Status Word Register
ACCReset: 00
H
Accumulator Register
IEN1Reset: 00
H
Interrupt Enable Register 1
BReset: 00
H
B Register
IP1Reset: 00
H
Interrupt Priority 1 Register
IPH1Reset: 00
H
Interrupt Priority 1 High Register
Bit Field
H
Typerrwh
Bit Field
H
Typerwrwrwrwrwrwhrwhrwh
Bit Field
H
Typerwh
Bit Field
H
Typerrwrrw
Bit Field
H
Type rw r rwrwrwrwrwrw
Bit Field
H
Typerrwrwrwrwrwrw
Bit Field
H
Typerrwrwrwrwrwrw
Bit Field
H
Typerwhrwhrwrwrwrwhrwrh
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
0MXSP
SM0SM1SM2RENTB8RB8TIRI
VAL
0TRAP_
EN
EA0ET2ESET1EX1ET0EX0
0PT2PSPT1PX1PT0PX0
0PT2HPSHPT1HPX1HPT0HPX0H
CYACF0RS1RS0OVF1P
ACC7ACC6ACC5ACC4ACC3ACC2ACC1ACC0
ECCIP3ECCIP2ECCIP1ECCIP0EXMEX2ESSCEADC
B7B6B5B4B3B2B1B0
PCCIP3PCCIP2PCCIP1PCCIP0PXMPX2PSSCPADC
PCCIP3HPCCIP2HPCCIP1HPCCIP0HPXMHPX2HPSSCHPADC
0DPSE
L0
H
3.2.4.2MDU Registers
The MDU SFRs can be accessed in the mapped memory area (RMAP = 1).
Table 6MDU Register Overview
Addr Register NameBit76543210
RMAP = 1
B0
MDUSTATReset: 00
H
MDU Status Register
Bit Field
H
Typerrhrwhrwh
Data Sheet33V1.2, 2009-11
0BSYIERRIRDY
XC878CLM
Functional Description
Table 6MDU Register Overview (cont’d)
Addr Register NameBit76543210
B1
B2
B2
B3
B3
B4
B4
B5
B5
B6
B6
B7
B7
MDUCONReset: 00
H
MDU Control Register
MD0Reset: 00
H
MDU Operand Register 0
MR0Reset: 00
H
MDU Result Register 0
MD1Reset: 00
H
MDU Operand Register 1
MR1Reset: 00
H
MDU Result Register 1
MD2Reset: 00
H
MDU Operand Register 2
MR2Reset: 00
H
MDU Result Register 2
MD3Reset: 00
H
MDU Operand Register 3
MR3Reset: 00
H
MDU Result Register 3
MD4Reset: 00
H
MDU Operand Register 4
MR4Reset: 00
H
MDU Result Register 4
MD5Reset: 00
H
MDU Operand Register 5
MR5Reset: 00
H
MDU Result Register 5
Bit Field
H
Typerwrwrwrwhrw
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerw
Bit Field
H
Typerh
IEIRRSELSTAR
T
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
OPCODE
3.2.4.3CORDIC Registers
The CORDIC SFRs can be accessed in the mapped memory area (RMAP = 1).
Table 7CORDIC Register Overview
Addr Register NameBit76543210
RMAP = 1
9A
9B
CD_CORDXLReset: 00
H
CORDIC X Data Low Byte
CD_CORDXHReset: 00
H
CORDIC X Data High Byte
Data Sheet34V1.2, 2009-11
Bit Field
H
Typerw
Bit Field
H
Typerw
DATAL
DATAH
XC878CLM
Functional Description
Table 7CORDIC Register Overview (cont’d)
Addr Register NameBit76543210
9C
9D
9E
9F
A0
A1
CD_CORDYLReset: 00
H
CORDIC Y Data Low Byte
CD_CORDYHReset: 00
H
CORDIC Y Data High Byte
CD_CORDZLReset: 00
H
CORDIC Z Data Low Byte
CD_CORDZHReset: 00
H
CORDIC Z Data High Byte
CD_STATCReset: 00
H
CORDIC Status and Data
Control Register
CD_CONReset: 00
H
CORDIC Control Register
Bit Field
H
Typerw
Bit Field
H
Typerw
Bit Field
H
Typerw
Bit Field
H
Typerw
Bit Field
H
Typerwrwrwrwrwrwhrhrh
Bit Field
H
Typerwrwrwrwrwrwh
KEEPZKEEPYKEEPXDMAPINT_ENEOCERRORBSY
MPSX_USIGNST_M
ODE
DATAL
DATAH
DATAL
DATAH
ROTV
EC
MODEST
3.2.4.4System Control Registers
The system control SFRs can be accessed in the mapped memory area (RMAP = 0).
Table 8SCU Register Overview
Addr Register NameBit76543210
RMAP = 0 or 1
8F
RMAP = 0
BF
RMAP = 0, PAGE 0
B3
B4
B5
B6
SYSCON0Reset: 04
H
System Control Register 0
SCU_PAGEReset: 00
H
Page Register
MODPISELReset: 00
H
Peripheral Input Select Register
IRCON0Reset: 00
H
Interrupt Request Register 0
IRCON1Reset: 00
H
Interrupt Request Register 1
IRCON2Reset: 00
H
Interrupt Request Register 2
Bit Field
H
Typerrwrrrrw
Bit Field
H
Typewwrrwh
Bit Field
H
Type r rwrwrwrwrwrwrw
Bit Field
H
Typerrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Type rrwhrrwh
0URRISHJTAGT
0EXINT6EXINT5EXINT
0CANS
0IMOD
OPSTNR0PAGE
DIS
RC2
CANS
RC1
0CANS
E
JTAGT
CKS
4
ADCSR1ADCSR0RIRTIREIR
RC3
010RMAP
EXINT
EXINT
3
EXINT
2IS
1IS
EXINT2EXINT1EXINT
0CANS
EXINT
0IS
URRIS
0
RC0
Data Sheet35V1.2, 2009-11
XC878CLM
Functional Description
Table 8SCU Register Overview (cont’d)
Addr Register NameBit76543210
B7
BA
BB
BC
BD
BE
E9
EA
EB
RMAP = 0, PAGE 1
B3
B4
B5
B6
B7
BA
EXICON0Reset: F0
H
External Interrupt Control
Register 0
EXICON1Reset: 3F
H
External Interrupt Control
Register 1
NMICONReset: 00
H
NMI Control Register
NMISRReset: 00
H
NMI Status Register
BCONReset: 20
H
Baud Rate Control Register
BGReset: 00
H
Baud Rate Timer/Reload
Register
FDCONReset: 00
H
Fractional Divider Control
Register
FDSTEPReset: 00
H
Fractional Divider Reload
Register
FDRESReset: 00
H
Fractional Divider Result
Register
IDReset: 49
H
Identity Register
PMCON0Reset: 80
H
Power Mode Control Register 0
PMCON1Reset: 00
H
Power Mode Control Register 1
OSC_CONReset: XX
H
OSC Control Register
PLL_CONReset: 18
H
PLL Control Register
CMCONReset: 10
H
Clock Control Register
Bit Field
H
Typerwrwrwrw
Bit Field
H
Typer rwrwrw
Bit Field
H
Typerrwrwrrwrwrwrw
Bit Field
H
Typerrwhrwhrrwhrwhrwhrwh
Bit Field
H
Typerwrwrwrwrw
Bit Field
H
Typerwh
Bit Field
H
Typerwrwrwhrwhrwhrwhrwrw
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerr
Bit Field
H
Typerhrwhrwhrwrwrwhrw
Bit Field
H
Type r rwrwrwrwrwrwrw
Bit Field
H
Typerwhrwhrwrrwrwhrwhrh
Bit Field
H
Typerwrhrh
Bit Field
H
Typerwrrwrw
EXINT3EXINT2EXINT1EXINT0
0EXINT6EXINT5EXINT4
0NMI
ECC
0FNMI
ECC
BGSELNDOVENBRDISBRPRER
BGSSYNENERRSYNEOFSYNBRKNDOVFDMFDEN
VDDP
WARN
PLLRD
RES
WDT
RST
0CDC_
DIS
PLLBYPPLLPD0XPDOSCSSEORD
KDIV0FCCF
NMI
VDDP
FNMI
VDDP
PRODIDVERID
WKRSWK
CAN_
DIS
0NMI
OCDS
0FNMI
OCDS
BR_VALUE
STEP
RESULT
SEL
MDU_
DIS
NDIVPLLRPLL_L
G
SDPDWS
T2CC
U_DIS
NMI
FLASH
FNMI
FLASH
CCU_
DIS
CLKREL
NMI
PLL
FNMI
PLL
SSC_
DIS
RES
NMI
WDT
FNMI
WDT
ADC_
DIS
EXTO
SCR
OCK
Data Sheet36V1.2, 2009-11
XC878CLM
Functional Description
Table 8SCU Register Overview (cont’d)
Addr Register NameBit76543210
BB
BE
E9
EA
EB
RMAP = 0, PAGE 3
B3
B4
B5
B6
B7
BA
BB
BD
BE
EA
PASSWDReset: 07
H
Password Register
COCONReset: 00
H
Clock Output Control Register
MISC_CONReset: 00
H
Miscellaneous Control Register
PLL_CON1Reset: 20
H
PLL Control Register 1
CR_MISC Reset: 00H or 01
H
Reset Status Register
XADDRHReset: F0
H
On-chip XRAM Address Higher
Order
IRCON3Reset: 00
H
Interrupt Request Register 3
IRCON4Reset: 00
H
Interrupt Request Register 4
MODIENReset: 07
H
Peripheral Interrupt Enable
Register
MODPISEL1Reset: 00
H
Peripheral Input Select Register
1
MODPISEL2Reset: 00
H
Peripheral Input Select Register
2
PMCON2Reset: 00
H
Power Mode Control Register 2
MODSUSPReset: 01
H
Module Suspend Control
Register
MODPISEL3Reset: 00
H
Peripheral Input Select Register
3
MODPISEL4Reset: 00
H
Peripheral Input Select Register
4
Bit Field
H
Typewrhrw
Bit Field
H
Typerwrwrrw
Bit Field
H
Typerwrwrrwh
Bit Field
H
Typerwrw
Bit Field
H
Typerwrwrwrwrrwh
Bit Field
H
Typerw
Bit Field
H
Typerrwhrwhrrwhrwh
Bit Field
H
Typerrwhrwhrrwhrwh
Bit Field
H
Typerrwrwrwrwrw
Bit Field
H
Typerwrwrwr
Bit Field
H
Typerrwrwrwrwrw
Bit Field
H
Typerrwrw
Bit Field
H
Typerrwrwrwrwrwrw
Bit Field
H
Typer rwrwrw
Bit Field
H
Typer rwrwrw
COUTSTLEN0COREL
ADCE
TR0_
MUX
CCCFGMDUC
ADCE
TR1_
MUX
NDIVPDIV
CFG
0CANS
0CANS
EXINT6ISUR1RIST21EX
0CCTS
0CISSISMIS
0EXINT5ISEXINT4ISEXINT3IS
PASSPROT
CCUC
0CM5ENCM4ENRIREN TIRENEIREN
0T2EXIST21IST2IST1IST0IS
T2CCF
CFG
RC5
RC7
USP
G
ADDRH
CCU6
SR1
CCU6
SR3
0UART
T21SUSPT2SUSPT13SUSPT12SUSPWDTS
ECT_S
0DFLAS
0HDRS
0CANS
0CANS
IS
RC4
RC6
1_DIS
MODE
HEN
CCU6
SR0
CCU6
SR2
0
T21_D
USP
T
IS
Data Sheet37V1.2, 2009-11
XC878CLM
Functional Description
3.2.4.5WDT Registers
The WDT SFRs can be accessed in the mapped memory area (RMAP = 1).
Table 9WDT Register Overview
Addr Register NameBit76543210
RMAP = 1
BB
BC
BD
BE
BF
WDTCONReset: 00
H
Watchdog Timer Control
Register
WDTRELReset: 00
H
Watchdog Timer Reload
Register
WDTWINBReset: 00
H
Watchdog Window-Boundary
Count Register
WDTLReset: 00
H
Watchdog Timer Register Low
WDTHReset: 00
H
Watchdog Timer Register High
Bit Field
H
Typerrwrhrrwrwhrw
Bit Field
H
Typerw
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerh
0WINBENWDTP
R
WDTREL
WDTWINB
0WDTENWDTRSWDTI
WDT
WDT
N
3.2.4.6Port Registers
The Port SFRs can be accessed in the standard memory area (RMAP = 0).
Table 10Port Register Overview
Addr Register NameBit76543210
RMAP = 0
B2
RMAP = 0, PAGE 0
80
86
90
91
92
93
PORT_PAGEReset: 00
H
Page Register
P0_DATAReset: 00
H
P0 Data Register
P0_DIRReset: 00
H
P0 Direction Register
P1_DATAReset: 00
H
P1 Data Register
P1_DIRReset: 00
H
P1 Direction Register
P5_DATAReset: 00
H
P5 Data Register
P5_DIRReset: 00
H
P5 Direction Register
Bit Field
H
Typewwrrwh
Bit Field
H
Type rwhrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Type rwhrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Type rwhrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerwrwrwrwrwrwrwrw
OPSTNR0PAGE
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
Data Sheet38V1.2, 2009-11
XC878CLM
Functional Description
Table 10Port Register Overview (cont’d)
Addr Register NameBit76543210
B0
B1
C8
C9
RMAP = 0, PAGE 1
80
86
90
91
92
93
B0
B1
C8
C9
RMAP = 0, PAGE 2
80
86
90
P3_DATAReset: 00
H
P3 Data Register
P3_DIRReset: 00
H
P3 Direction Register
P4_DATAReset: 00
H
P4 Data Register
P4_DIRReset: 00
H
P4 Direction Register
P0_PUDSELReset: FF
H
P0 Pull-Up/Pull-Down Select
Register
P0_PUDENReset: C4
H
P0 Pull-Up/Pull-Down Enable
Register
P1_PUDSELReset: FF
H
P1 Pull-Up/Pull-Down Select
Register
P1_PUDENReset: FF
H
P1 Pull-Up/Pull-Down Enable
Register
P5_PUDSELReset: FF
H
P5 Pull-Up/Pull-Down Select
Register
P5_PUDENReset: FF
H
P5 Pull-Up/Pull-Down Enable
Register
P3_PUDSELReset: BF
H
P3 Pull-Up/Pull-Down Select
Register
P3_PUDENReset: 40
H
P3 Pull-Up/Pull-Down Enable
Register
P4_PUDSELReset: FF
H
P4 Pull-Up/Pull-Down Select
Register
P4_PUDENReset: 04
H
P4 Pull-Up/Pull-Down Enable
Register
P0_ALTSEL0Reset: 00
H
P0 Alternate Select 0 Register
P0_ALTSEL1Reset: 00
H
P0 Alternate Select 1 Register
P1_ALTSEL0Reset: 00
H
P1 Alternate Select 0 Register
Bit Field
H
Type rwhrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Type rwhrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
Data Sheet39V1.2, 2009-11
XC878CLM
Functional Description
Table 10Port Register Overview (cont’d)
Addr Register NameBit76543210
91
92
93
B0
B1
C8
C9
RMAP = 0, PAGE 3
80
86
90
91
92
93
B0
B1
C8
C9
P1_ALTSEL1Reset: 00
H
P1 Alternate Select 1 Register
P5_ALTSEL0Reset: 00
H
P5 Alternate Select 0 Register
P5_ALTSEL1Reset: 00
H
P5 Alternate Select 1 Register
P3_ALTSEL0Reset: 00
H
P3 Alternate Select 0 Register
P3_ALTSEL1Reset: 00
H
P3 Alternate Select 1 Register
P4_ALTSEL0Reset: 00
H
P4 Alternate Select 0 Register
P4_ALTSEL1Reset: 00
H
P4 Alternate Select 1 Register
P0_ODReset: 00
H
P0 Open Drain Control Register
P0_DSReset: FF
H
P0 Drive Strength Control
Register
P1_ODReset: 00
H
P1 Open Drain Control Register
P1_DSReset: FF
H
P1 Drive Strength Control
Register
P5_ODReset: 00
H
P5 Open Drain Control Register
P5_DSReset: FF
H
P5 Drive Strength Control
Register
P3_ODReset: 00
H
P3 Open Drain Control Register
P3_DSReset: FF
H
P3 Drive Strength Control
Register
P4_ODReset: 00
H
P4 Open Drain Control Register
P4_DSReset: FF
H
P4 Drive Strength Control
Register
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
P7P6P5P4P3P2P1P0
Data Sheet40V1.2, 2009-11
XC878CLM
Functional Description
3.2.4.7ADC Registers
The ADC SFRs can be accessed in the standard memory area (RMAP = 0).
Table 11ADC Register Overview
AddrRegister NameBit 76543210
RMAP = 0
D1
RMAP = 0, PAGE 0
CA
CB
CC
CD
CE
CF
RMAP = 0, PAGE 1
CA
CB
CC
CD
CE
CF
D2
D3
ADC_PAGEReset: 00
H
Page Register
ADC_GLOBCTR Reset: 30
H
Global Control Register
ADC_GLOBSTR Reset: 00
H
Global Status Register
ADC_PRARReset: 00
H
Priority and Arbitration Register
ADC_LCBRReset: B7
H
Limit Check Boundary Register
ADC_INPCR0Reset: 00
H
Input Class 0 Register
ADC_ETRCRReset: 00
H
External Trigger Control
Register
ADC_CHCTR0Reset: 00
H
Channel Control Register 0
ADC_CHCTR1Reset: 00
H
Channel Control Register 1
ADC_CHCTR2Reset: 00
H
Channel Control Register 2
ADC_CHCTR3Reset: 00
H
Channel Control Register 3
ADC_CHCTR4Reset: 00
H
Channel Control Register 4
ADC_CHCTR5Reset: 00
H
Channel Control Register 5
ADC_CHCTR6Reset: 00
H
Channel Control Register 6
ADC_CHCTR7Reset: 00
H
Channel Control Register 7
Bit Field
H
Typewwrrw
Bit Field
H
Typerwrwrwr
Bit Field
H
Typerrhrrhrh
Bit Field
H
Typerwrwrrwrwrwrwrw
Bit Field
H
Typerwrw
Bit Field
H
Typerw
Bit Field
H
Typerwrwrwrw
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrrw
OPSTNR0PAGE
ANONDWCTC0
0CHNR0SAMPLEBUSY
ASEN1ASEN
0
BOUND1BOUND0
SYNEN1SYNE
N0
0LCC0RESRSEL
0LCC0RESRSEL
0LCC0RESRSEL
0LCC0RESRSEL
0LCC0RESRSEL
0LCC0RESRSEL
0LCC0RESRSEL
0LCC0RESRSEL
0ARBMCSM1PRIO1CSM0PRIO0
STC
ETRSEL1ETRSEL0
Data Sheet41V1.2, 2009-11
XC878CLM
Functional Description
Table 11ADC Register Overview (cont’d)
AddrRegister NameBit 76543210
RMAP = 0, PAGE 2
CA
CB
CC
CD
CE
CF
D2
D3
RMAP = 0, PAGE 3
CA
CB
CC
CD
CE
CF
D2
D3
RMAP = 0, PAGE 4
CA
ADC_RESR0LReset: 00
H
Result Register 0 Low
ADC_RESR0HReset: 00
H
Result Register 0 High
ADC_RESR1LReset: 00
H
Result Register 1 Low
ADC_RESR1HReset: 00
H
Result Register 1 High
ADC_RESR2LReset: 00
H
Result Register 2 Low
ADC_RESR2HReset: 00
H
Result Register 2 High
ADC_RESR3LReset: 00
H
Result Register 3 Low
ADC_RESR3HReset: 00
H
Result Register 3 High
ADC_RESRA0L Reset: 00
H
Result Register 0, View A Low
ADC_RESRA0H Reset: 00
H
Result Register 0, View A High
ADC_RESRA1L Reset: 00
H
Result Register 1, View A Low
ADC_RESRA1H Reset: 00
H
Result Register 1, View A High
ADC_RESRA2L Reset: 00
H
Result Register 2, View A Low
ADC_RESRA2H Reset: 00
H
Result Register 2, View A High
ADC_RESRA3L Reset: 00
H
Result Register 3, View A Low
ADC_RESRA3H Reset: 00
H
Result Register 3, View A High
ADC_RCR0Reset: 00
H
Result Control Register 0
Bit Field
H
Typerhrrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerhrrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerhrrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerhrrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerhrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerhrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerhrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerhrhrhrh
Bit Field
H
Typerh
Bit Field
H
Typerwrwrrwrrw
RESULT0VFDRCCHNR
RESULT
RESULT0VFDRCCHNR
RESULT
RESULT0VFDRCCHNR
RESULT
RESULT0VFDRCCHNR
RESULT
RESULTVFDRCCHNR
RESULT
RESULTVFDRCCHNR
RESULT
RESULTVFDRCCHNR
RESULT
RESULTVFDRCCHNR
RESULT
VFCTRWFR0IEN0DRCT
R
Data Sheet42V1.2, 2009-11
XC878CLM
Functional Description
Table 11ADC Register Overview (cont’d)
AddrRegister NameBit 76543210
CB
CC
CD
CE
RMAP = 0, PAGE 5
CA
CB
CC
CD
CE
CF
D2
D3
RMAP = 0, PAGE 6
CA
CB
ADC_RCR1Reset: 00
H
Result Control Register 1
ADC_RCR2Reset: 00
H
Result Control Register 2
ADC_RCR3Reset: 00
H
Result Control Register 3
ADC_VFCRReset: 00
H
Valid Flag Clear Register
ADC_CHINFRReset: 00
H
Channel Interrupt Flag Register
ADC_CHINCRReset: 00
H
Channel Interrupt Clear Register
ADC_CHINSRReset: 00
H
Channel Interrupt Set Register
ADC_CHINPRReset: 00
H
Channel Interrupt Node Pointer
Register
ADC_EVINFRReset: 00
H
Event Interrupt Flag Register
ADC_EVINCRReset: 00
H
Event Interrupt Clear Flag
Register
ADC_EVINSRReset: 00
H
Event Interrupt Set Flag Register
ADC_EVINPRReset: 00
H
Event Interrupt Node Pointer
Register
ADC_CRCR1Reset: 00
H
Conversion Request Control
Register 1
ADC_CRPR1Reset: 00
H
Conversion Request Pending
Register 1
Bit Field
H
Typerwrwrrwrrw
Bit Field
H
Typerwrwrrwrrw
Bit Field
H
Typerwrwrrwrrw
Bit Field
H
Typerwwww
Bit Field
H
Typerhrhrhrhrhrhrhrh
Bit Field
H
Typewwwwwwww
Bit Field
H
Typewwwwwwww
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerhrhrhrhrrhrh
Bit Field
H
Typewwwwrww
Bit Field
H
Typewwwwrww
Bit Field
H
Typerwrwrwrwrrwrw
Bit Field
H
Typerwhrwhrwhrwhr
Bit Field
H
Typerwhrwhrwhrwhr
VFCTRWFR0IEN0DRCT
VFCTRWFR0IEN0DRCT
VFCTRWFR0IEN0DRCT
0VFC3VFC2VFC1VFC0
CHINF7CHINF6CHINF5CHINF4CHINF3CHINF2CHINF1CHINF
CHINC7CHINC6CHINC5CHINC4CHINC3CHINC2CHINC1CHINC
CHINS7CHINS6CHINS5CHINS4CHINS3CHINS2CHINS1CHINS
CHINP7CHINP6CHINP5CHINP4CHINP3CHINP2CHINP1CHINP
EVINF7EVINF6EVINF5EVINF
4
EVINC7EVINC6EVINC5EVINC
4
EVINS7EVINS6EVINS5EVINS
4
EVINP7EVINP6EVINP5EVINP
4
CH7CH6CH5CH40
CHP7CHP6CHP5CHP40
0EVINF1EVINF
0EVINC1EVINC
0EVINS1EVINS
0EVINP1EVINP
R
R
R
0
0
0
0
0
0
0
0
Data Sheet43V1.2, 2009-11
XC878CLM
Functional Description
Table 11ADC Register Overview (cont’d)
AddrRegister NameBit 76543210
CC
CD
CE
CF
D2
D2
ADC_CRMR1Reset: 00
H
Conversion Request Mode
Register 1
ADC_QMR0Reset: 00
H
Queue Mode Register 0
ADC_QSR0Reset: 20
H
Queue Status Register 0
ADC_Q0R0Reset: 00
H
Queue 0 Register 0
ADC_QBUR0Reset: 00
H
Queue Backup Register 0
ADC_QINR0Reset: 00
H
Queue Input Register 0
Bit Field
H
Typerwwrwrwrwrrw
Bit Field
H
Typewwww rrwrrw
Bit Field
H
Typerrrhrhrrh
Bit Field
H
Typerhrhrhrhrrh
Bit Field
H
Typerhrhrhrhrrh
Bit Field
H
Typewwwrw
RsvLDEVCLRPNDSCANENSIENTR0ENGT
CEVTREVFLUSHCLRV0ENTR0ENGT
Rsv0EMPTYEV0FILL
EXTRENSIRFV0REQCHNR
EXTRENSIRFV0REQCHNR
EXTRENSIRF0REQCHNR
Data Sheet44V1.2, 2009-11
XC878CLM
Functional Description
3.2.4.8Timer 2 Compare/Capture Unit Registers
The Timer 2 Compare/Capture Unit SFRs can be accessed in the standard memory area
(RMAP = 0).
Table 12T2CCU Register Overview
Addr Register NameBit76543210
RMAP = 0
C7
RMAP = 0, PAGE 0
C0
C1
C2
C3
C4
C5
C6
RMAP = 0, PAGE 1
C0
C1
C2
C3
C4
T2_PAGEReset: 00
H
Page Register
T2_T2CONReset: 00
H
Timer 2 Control Register
T2_T2MODReset: 00
H
Timer 2 Mode Register
T2_RC2LReset: 00
H
Timer 2 Reload/Capture
Register Low
T2_RC2HReset: 00
H
Timer 2 Reload/Capture
Register High
T2_T2LReset: 00
H
Timer 2 Register Low
T2_T2HReset: 00
H
Timer 2 Register High
T2_T2CON1Reset: 03
H
Timer 2 Control Register 1
T2CCU_CCENReset: 00
H
T2CCU Capture/Compare
Enable Register
T2CCU_CCTBSELReset: 00
H
T2CCU Capture/Compare Time
Base Select Register
T2CCU_CCTRELLReset: 00
H
T2CCU Capture/Compare
Timer Reload Register Low
T2CCU_CCTRELHReset: 00
H
T2CCU Capture/Compare
Timer Reload Register High
T2CCU_CCTLReset: 00
H
T2CCU Capture/Compare
Timer Register Low
Bit Field
H
Typewwrrwh
Bit Field
H
Typerwhrwhrrwrwhrwrw
Bit Field
H
Typerwrwrwrwrwrw
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerrwrw
Bit Field
H
Typerwrwrwrw
Bit Field
H
Type rwrwhrwrwrwrwrwrw
Bit Field
H
Typerw
Bit Field
H
Typerw
Bit Field
H
Typerwh
OPSTNR0PAGE
TF2EXF20EXEN2TR2C/T2CP/
T2REGST2RHENEDGE
SEL
CCM3CCM2CCM1CCM0
CASCCCTTOVCCTB5CCTB4CCTB3CCTB2CCTB1CCTB
PRENT2PREDCEN
RC2
RC2
THL2
THL2
0TF2EN EXF2E
CCTREL
CCTREL
CCT
RL2
N
0
Data Sheet45V1.2, 2009-11
XC878CLM
Functional Description
Table 12T2CCU Register Overview (cont’d)
Addr Register NameBit76543210
C5
C6
RMAP = 0, PAGE 2
C0
C1
C2
C3
C4
C5
C6
RMAP = 0, PAGE 3
C0
C1
C2
C3
C4
C5
C6
T2CCU_CCTHReset: 00
H
T2CCU Capture/Compare
Timer Register High
T2CCU_CCTCON Reset: 00
H
T2CCU CaptureCcompare
Timer Control Register
T2CCU_COSHDWReset: 00
H
T2CCU Capture/compare
Enable Register
T2CCU_CC0LReset: 00
H
T2CCU Capture/Compare
Register 0 Low
T2CCU_CC0HReset: 00
H
T2CCU Capture/compare
Register 0 High
T2CCU_CC1LReset: 00
H
T2CCU Capture/compare
Register 1 Low
T2CCU_CC1HReset: 00
H
T2CCU Capture/compare
Register 1 High
T2CCU_CC2LReset: 00
H
T2CCU Capture/compare
Register 2 Low
T2CCU_CC2HReset: 00
H
T2CCU Capture/compare
Register 2 High
T2CCU_COCON Reset: 00
H
T2CCU Compare Control
Register
T2CCU_CC3LReset: 00
H
T2CCU Capture/compare
Register 3 Low
T2CCU_CC3HReset: 00
H
T2CCU Capture/compare
Register 3 High
T2CCU_CC4LReset: 00
H
T2CCU Capture/compare
Register 4 Low
T2CCU_CC4HReset: 00
H
T2CCU Capture/compare
Register 4 High
T2CCU_CC5LReset: 00
H
T2CCU Capture/compare
Register 5 Low
T2CCU_CC5HReset: 00
H
T2CCU Capture/compare
Register 5 High
Bit Field
H
Typerwh
Bit Field
H
Typerwrwhrwrwrw
Bit Field
H
Typerwhrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwrwrwhrwhrwrwrw
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
ENSHDWTXOVCOOUT5COOUT4COOUT3COOUT2COOUT1COOU
CCM5CCM4CM5FCM4FPOLBPOLACOMOD
CCTPRECCTOVFCCTO
CCT
TIMSYNCCTS
VEN
CCVALL
CCVALH
CCVALL
CCVALH
CCVALL
CCVALH
CCVALL
CCVALH
CCVALL
CCVALH
CCVALL
CCVALH
T0
T
Data Sheet46V1.2, 2009-11
XC878CLM
Functional Description
Table 12T2CCU Register Overview (cont’d)
Addr Register NameBit76543210
RMAP = 0, PAGE 4
C2
C3
T2CCU_CCTDTCLReset: 00
H
T2CCU Capture/Compare
Timer Dead-Time Control
Register Low
T2CCU_CCTDTCHReset: 00
H
T2CCU Capture/Compare
Timer Dead-Time Control
Register High
Bit Field
H
Typerw
Bit Field
H
Type rwhrh rh rhrwrwrwrw
DTRESDTR2DTR1DTR0DTLEVDTE2DTE1DTE0
DTM
3.2.4.9Timer 21 Registers
The Timer 21 SFRs can be accessed in the mapped memory area (RMAP = 1).
Table 13T21 Register Overview
Addr Register NameBit76543210
RMAP = 1
C0
C1
C2
C3
C4
C5
C6
T21_T2CONReset: 00
H
Timer 2 Control Register
T21_T2MODReset: 00
H
Timer 2 Mode Register
T21_RC2LReset: 00
H
Timer 2 Reload/Capture
Register Low
T21_RC2HReset: 00
H
Timer 2 Reload/Capture
Register High
T21_T2LReset: 00
H
Timer 2 Register Low
T21_T2HReset: 00
H
Timer 2 Register High
T21_T2CON1Reset: 03
H
Timer 2 Control Register 1
Bit Field
H
Typerwhrwhrrwrwhrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerrwrw
TF2EXF20EXEN2TR2C/T2CP/
T2REGST2RHENEDGE
SEL
PRENT2PREDCEN
RC2
RC2
THL2
THL2
0TF2EN EXF2E
RL2
N
Data Sheet47V1.2, 2009-11
XC878CLM
Functional Description
3.2.4.10CCU6 Registers
The CCU6 SFRs can be accessed in the standard memory area (RMAP = 0).
Table 14CCU6 Register Overview
AddrRegister NameBit 76543210
RMAP = 0
A3
RMAP = 0, PAGE 0
9A
9B
9C
9D
9E
9F
A4
A5
A6
A7
FA
FB
CCU6_PAGEReset: 00
H
Page Register
CCU6_CC63SRLReset: 00
H
Capture/Compare Shadow Register
for Channel CC63 Low
CCU6_CC63SRHReset: 00
H
Capture/Compare Shadow Register
for Channel CC63 High
CCU6_TCTR4LReset: 00
H
Timer Control Register 4 Low
CCU6_TCTR4HReset: 00
H
Timer Control Register 4 High
CCU6_MCMOUTSLReset: 00
H
Multi-Channel Mode Output Shadow
Register Low
CCU6_MCMOUTSHReset: 00
H
Multi-Channel Mode Output Shadow
Register High
CCU6_ISRLReset: 00
H
Capture/Compare Interrupt Status
Reset Register Low
CCU6_ISRHReset: 00
H
Capture/Compare Interrupt Status
Reset Register High
CCU6_CMPMODIFLReset: 00
H
Compare State Modification Register
Low
CCU6_CMPMODIFHReset: 00
H
Compare State Modification Register
High
CCU6_CC60SRLReset: 00
H
Capture/Compare Shadow Register
for Channel CC60 Low
CCU6_CC60SRHReset: 00
H
Capture/Compare Shadow Register
for Channel CC60 High
Bit Field
H
Typewwrrwh
Bit Field
H
Typerw
Bit Field
H
Typerw
Bit Field
H
Type wwrwwww
Bit Field
H
Type wwrwww
Bit Field
H
Typewrrw
Bit Field
H
Typewrrwrw
Bit Field
H
Type wwwwwwww
Bit Field
H
Type wwww r www
Bit Field
H
Type r wrwww
Bit Field
H
Type r wrwww
Bit Field
H
Typerwh
Bit Field
H
Typerwh
OPSTNR0PAGE
CC63SL
CC63SH
T12
STD
T13
STD
STRMCM0MCMPS
STRHP0CURHSEXPHS
RT12PMRT12OMRCC62FRCC62RRCC61FRCC61RRCC60FRCC6
RSTR RIDLERWHERCHE0RTRPFRT13PMRT13
T12
STR
T13
STR
0MCC6
3S
0MCC6
3R
0DT
RES
0T13
0MCC62SMCC61SMCC6
0MCC62RMCC61RMCC6
CC60SL
CC60SH
T12
RES
RES
T12RST12R
T13RST13R
R
R
0R
CM
0S
0R
Data Sheet48V1.2, 2009-11
XC878CLM
Functional Description
Table 14CCU6 Register Overview (cont’d)
AddrRegister NameBit 76543210
FC
FD
FE
FF
RMAP = 0, PAGE 1
9A
9B
9C
9D
9E
9F
A4
A5
A6
A7
FA
FB
FC
CCU6_CC61SRLReset: 00
H
Capture/Compare Shadow Register
for Channel CC61 Low
CCU6_CC61SRHReset: 00
H
Capture/Compare Shadow Register
for Channel CC61 High
CCU6_CC62SRLReset: 00
H
Capture/Compare Shadow Register
for Channel CC62 Low
CCU6_CC62SRHReset: 00
H
Capture/Compare Shadow Register
for Channel CC62 High
Capture/Compare Interrupt Node
Pointer Register High
CCU6_ISSLReset: 00
H
Capture/Compare Interrupt Status
Set Register Low
CCU6_ISSHReset: 00
H
Capture/Compare Interrupt Status
Set Register High
CCU6_PSLRReset: 00
H
Passive State Level Register
CCU6_MCMCTRReset: 00
H
Multi-Channel Mode Control Register
CCU6_TCTR2LReset: 00
H
Timer Control Register 2 Low
CCU6_TCTR2HReset: 00
H
Timer Control Register 2 High
CCU6_MODCTRLReset: 00
H
Modulation Control Register Low
Bit Field
H
Typerh
Bit Field
H
Typerh
Bit Field
H
Typerh
Bit Field
H
Typerwrw
Bit Field
H
Typerwrwrw
Bit Field
H
Typerwrwrwrwrwrwrwrw
Bit Field
H
Typerwrwrwrwrrwrwrw
Bit Field
H
Typerwrwrwrw
Bit Field
H
Typerrwrwrw
Bit Field
H
Type wwwwwwww
Bit Field
H
Type wwwwwwww
Bit Field
H
Typerwhrrwh
Bit Field
H
Typerrwrrw
Bit Field
H
Typerrwrwrwrw
Bit Field
H
Typerrwrw
Bit Field
H
Typerwrrw
DBYPHSYNCMSEL62
ENT1
2
PM
EN
STRENIDLEENWHEENCHE
INPCHEINPCC62INPCC61INPCC60
ST12PMST12OMSCC62FSCC62RSCC61FSCC61RSCC60FSCC6
SSTRSIDLE SWHE SCHESWHCSTRPFST13PMST13
PSL630PSL
0T13TEDT13TECT13
MCM
EN
MSEL61MSEL60
ENT1
0INPT13INPT12INPERR
0SWSYN0SWSEL
ENCC
2
OM
62F
0T13RSELT12RSEL
0T12MODEN
CC61VH
CC62VL
CC62VH
ENCC
62R
ENCC
61F
0EN
ENCC
61R
TRPF
ENCC
60F
ENT1
3PM
SSC
ENCC
60R
ENT1
3CM
0R
CM
T12
SSC
Data Sheet50V1.2, 2009-11
XC878CLM
Functional Description
Table 14CCU6 Register Overview (cont’d)
AddrRegister NameBit 76543210
FD
FE
FF
RMAP = 0, PAGE 3
9A
9B
9C
9D
9E
9F
A4
FA
FB
FC
FD
FE
FF
CCU6_MODCTRHReset: 00
H
Modulation Control Register High
CCU6_TRPCTRLReset: 00
H
Trap Control Register Low
CCU6_TRPCTRHReset: 00
H
Trap Control Register High
CCU6_MCMOUTLReset: 00
H
Multi-Channel Mode Output Register
Low
CCU6_MCMOUTHReset: 00
H
Multi-Channel Mode Output Register
High
CCU6_ISLReset: 00
H
Capture/Compare Interrupt Status
Register Low
CCU6_ISHReset: 00
H
Capture/Compare Interrupt Status
Register High
CCU6_PISEL0LReset: 00
H
Port Input Select Register 0 Low
CCU6_PISEL0HReset: 00
H
Port Input Select Register 0 High
CCU6_PISEL2Reset: 00
H
Port Input Select Register 2
CCU6_T12LReset: 00
H
Timer T12 Counter Register Low
CCU6_T12HReset: 00
H
Timer T12 Counter Register High
CCU6_T13LReset: 00
H
Timer T13 Counter Register Low
CCU6_T13HReset: 00
H
Timer T13 Counter Register High
CCU6_CMPSTATLReset: 00
H
Compare State Register Low
CCU6_CMPSTATHReset: 00
H
Compare State Register High
Bit Field
H
Typerwrrw
Bit Field
H
Typerrwrwrw
Bit Field
H
Typerwrwrw
Bit Field
H
Typerrhrh
Bit Field
H
Typerrhrh
Bit Field
H
Typerhrhrhrhrhrhrhrh
Bit Field
H
Typerhrhrhrhrhrhrhrh
Bit Field
H
Typerwrwrwrw
Bit Field
H
Typerwrwrwrw
Bit Field
H
Typerrw
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Type r rhrhrhrhrhrhrh
Bit Field
H
Typerwhrwhrwhrwhrwhrwhrwhrwh
ECT13O0T13MODEN
0TRPM2TRPM1TRPM
TRPPENTRPE
T12PMT12OMICC62FICC62RICC61FICC61RICC60FICC60
STRIDLEWHECHETRPSTRPFT13PMT13
T13IM COUT
N13
0RMCMP
0CURHEXPH
ISTRPISCC62ISCC61ISCC60
IST12HRISPOS2ISPOS1ISPOS0
0IST13HR
T12CVL
T12CVH
T13CVL
T13CVH
0CC63STCC
63PS
POS2CCPOS1CCPOS0
COUT
62PS
CC62PSCOUT
61PS
TRPEN
CC62STCC61STCC60
CC61PSCOUT
60PS
0
R
CM
ST
CC60
PS
Data Sheet51V1.2, 2009-11
XC878CLM
Functional Description
3.2.4.11UART1 Registers
The UART1 SFRs can be accessed in the mapped memory area (RMAP = 1).
Table 15UART1 Register Overview
Addr Register NameBit76543210
RMAP = 1
C8
C9
CA
CB
CC
CD
CE
CF
SCONReset: 00
H
Serial Channel Control Register
SBUFReset: 00
H
Serial Data Buffer Register
BCONReset: 00
H
Baud Rate Control Register
BGReset: 00
H
Baud Rate Timer/Reload
Register
FDCONReset: 00
H
Fractional Divider Control
Register
FDSTEPReset: 00
H
Fractional Divider Reload
Register
FDRESReset: 00
H
Fractional Divider Result
Register
SCON1Reset: 07
H
Serial Channel Control Register
1
Bit Field
H
Typerwrwrwrwrwrwhrwhrwh
Bit Field
H
Typerwh
Bit Field
H
Typerrwrw
Bit Field
H
Typerwh
Bit Field
H
Typerrwhrwrw
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerrwrwrw
SM0SM1SM2RENTB8RB8TIRI
VAL
0BRPRER
BR_VALUE
0NDOVFDMFDEN
STEP
RESULT
0NDOVENTIENRIEN
3.2.4.12SSC Registers
The SSC SFRs can be accessed in the standard memory area (RMAP = 0).
Table 16SSC Register Overview
Addr Register NameBit76543210
RMAP = 0
A9
AA
AA
AB
Data Sheet52V1.2, 2009-11
SSC_PISELReset: 00
H
Port Input Select Register
SSC_CONLReset: 00
H
Control Register Low
Programming Mode
SSC_CONLReset: 00
H
Control Register Low
Operating Mode
SSC_CONHReset: 00
H
Control Register High
Programming Mode
Bit Field
H
Typerrwrwrw
Bit Field
H
Typerwrwrwrwrw
Bit Field
H
Typerrh
Bit Field
H
Typerwrwrrwrwrwrwrw
LBPOPHHBBM
ENMS0ARENBENPENRENTEN
0CISSISMIS
0BC
XC878CLM
Functional Description
Table 16SSC Register Overview (cont’d)
Addr Register NameBit76543210
AB
AC
AD
AE
AF
SSC_CONHReset: 00
H
Control Register High
Operating Mode
SSC_TBLReset: 00
H
Transmitter Buffer Register Low
SSC_RBLReset: 00
H
Receiver Buffer Register Low
SSC_BRLReset: 00
H
Baud Rate Timer Reload
Register Low
SSC_BRHReset: 00
H
Baud Rate Timer Reload
Register High
Bit Field
H
Typerwrwrrhrwhrwhrwhrwh
Bit Field
H
Typerw
Bit Field
H
Typerh
Bit Field
H
Typerw
Bit Field
H
Typerw
ENMS0BSYBEPERETE
TB_VALUE
RB_VALUE
BR_VALUE
BR_VALUE
3.2.4.13MultiCAN Registers
The MultiCAN SFRs can be accessed in the standard memory area (RMAP = 0).
Table 17CAN Register Overview
Addr Register NameBit76543210
RMAP = 0
D8
D9
DA
DB
DC
DD
DE
ADCONReset: 00
H
CAN Address/Data Control
Register
ADLReset: 00
H
CAN Address Register Low
ADHReset: 00
H
CAN Address Register High
DATA0Reset: 00
H
CAN Data Register 0
DATA1Reset: 00
H
CAN Data Register 1
DATA2Reset: 00
H
CAN Data Register 2
DATA3Reset: 00
H
CAN Data Register 3
Bit Field
H
Typerwrwrwrwrwrhrw
Bit Field
H
Typerwhrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerrwhrwhrwhrwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
Bit Field
H
Typerwh
V3V2V1V0AUADBSYRWEN
CA9CA8CA7CA6CA5CA4CA3CA2
0CA13CA12CA11CA10
CD
CD
CD
CD
3.2.4.14OCDS Registers
The OCDS SFRs can be accessed in the mapped memory area (RMAP = 1).
Data Sheet53V1.2, 2009-11
XC878CLM
Functional Description
Table 18OCDS Register Overview
Addr Register NameBit76543210
RMAP = 1
E9
EA
EB
EC
F1
F2
F3
F4
F5
F6
F7
MMCR2Reset: 8U
H
Monitor Mode Control 2
Register
MEXTCRReset: 0U
H
Memory Extension Control
Register
MMWR1Reset: 00
H
Monitor Work Register 1
MMWR2Reset: 00
H
Monitor Work Register 2
MMCRReset: 00
H
Monitor Mode Control Register
MMSRReset: 00
H
Monitor Mode Status Register
MMBPCRReset: 00
H
Breakpoints Control Register
MMICRReset: 00
H
Monitor Mode Interrupt Control
Register
MMDRReset: 00
H
Monitor Mode Data Transfer
Register
Receive
HWBPSRReset: 00
H
Hardware Breakpoints Select
Register
HWBPDRReset: 00
H
Hardware Breakpoints Data
Register
Bit Field
H
Typerwrwrwrwhrwrwhrhrh
Bit Field
H
Typerrw
Bit Field
H
Typerw
Bit Field
H
Typerw
Bit Field
H
Typewrwhrrwwrwhrhrh
Bit Field
H
Typerwrwhrwhrwhrwhrwhrwhrwh
Bit Field
H
Typerwrwrwrwrw
Bit Field
H
Typerwhrwhrwhrhwrwwrw
Bit Field
H
Typerh
Bit Field
H
Typerwrw
Bit Field
H
Typerw
STMODEEXBCDSUSPMBCONALTDIMMEP MMODEJENA
0BANKBPx
MMWR1
MMWR2
MEXIT_PMEXIT0MSTEPMRAM
S_P
MBCAMMBCINEXBFSWBFHWB3FHWB2FHWB1FHWB0
SWBCHWB3CHWB2CHWB1
DVECTDRETRCOMRSTMSTSELMMUI
E_P
MMRR
0BPSEL
_P
HWBPxx
MRAMSTRFRRF
C
MMUIERRIE_PRRIE
BPSEL
HWB0C
F
Data Sheet54V1.2, 2009-11
XC878CLM
Functional Description
3.2.4.15Flash Registers
The Flash SFRs can be accessed in the mapped memory area (RMAP = 1).
Table 19Flash Register Overview
Addr Register NameBit76543210
RMAP = 1
D1
D2
D3
D4
D5
D6
DD
FCONReset: 10
H
P-Flash Control Register
EECONReset: 10
H
D-Flash Control Register
FCSReset: 80
H
Flash Control and Status
Register
FEALReset: 00
H
Flash Error Address Register,
Low Byte
FEAHReset: 00
H
Flash Error Address Register,
High Byte
FTVALReset: 78
H
Flash Timer Value Register
FCS1Reset: 00
H
Flash Control and Status
Register 1
Bit Field
H
Typerrhrwhrrwrwrwrw
Bit Field
H
Typerrhrwhrrwrwrwrw
Bit Field
H
Typerrwrwhrrwhrwhrwhrwh
Bit Field
H
Typerh
Bit Field
H
Typerh
Bit Field
H
Typerwrw
Bit Field
H
Typerrwh
0FBSYYE1NVSTRMAS1ERASEPROG
0EEBSYYE1NVSTRMAS1ERASEPROG
1SBEIEFTEN0EEDERREESERRFDERRFSER
ECCEADDR
ECCEADDR
MODEOFVAL
0EEAB
ORT
R
Data Sheet55V1.2, 2009-11
XC878CLM
Functional Description
3.3Flash Memory
The Flash memory provides an embedded user-programmable non-volatile memory,
allowing fast and reliable storage of user code and data. It is operated from a single 2.5 V
supply from the Embedded Voltage Regulator (EVR) and does not require additional
programming or erasing voltage. The pagination of the Flash memory allows each page
to be erased independently.
Features
•In-System Programming (ISP) via UART
•In-Application Programming (IAP)
•Error Correction Code (ECC) for dynamic correction of single-bit errors
•Background program and erase operations for CPU load minimization
•Support for aborting erase operation
•Minimum program width
• of 1-byte for D-Flash and 2-bytes for P-Flash
•1-page minimum erase width
•1-byte read access
•Flash is delivered in erased state (read all ones)
•Operating supply voltage: 2.5 V ± 7.5 %
t
•Read access time: 1 ×
CCLK
=38 ns
•Program time for 1 wordline: 1.6 ms
•Page erase time: 20 ms
•Mass erase time: 200 ms
1)
2)
1) Values shown here are typical values. f
frequency range for Flash read access.
2) Values shown here are typical values.
range for Flash programming and erasing.
f
= 144 MHz ± 7.5% (f
sys
= 144 MHz ± 7.5% (f
sys
f
is used for obtaining the worst case timing.
sysmin
= 24 MHz ± 7.5 %) is the maximum
CCLK
= 24 MHz ± 7.5 %) is the typical frequency
CCLK
Data Sheet56V1.2, 2009-11
XC878CLM
Functional Description
Table 20 and Table 21 shows the Flash data retention and endurance targets for
Industrial profile and Automotive profile respectively.
Table 20Flash Data Retention and Endurance for Industrial Profile
(Operating Conditions apply)
RetentionEndurance
1)2)
Program Flash
15 years1000 cyclesup to 60 Kbytes
Data Flash
15 years1000 cycles4 Kbytes
10 years10,000 cycles4 Kbytes
5 years30,000 cycles4 Kbytes
1 year100,000 cycles4 Kbytes
1) In Program Flash, one cycle refers to the programming of all pages in the flash bank and a mass erase.
2) In Data Flash, one cycle refers to the programming of all wordlines in a page and a page erase.
SizeRemarks
Table 21Flash Data Retention and Endurance for Automotive Profile
(Operating Conditions apply)
RetentionEndurance
1)2)
SizeRemarks
Program Flash
15 years1000 cyclesup to 60 Kbytes
Data Flash
15 years1000 cycles4 Kbytes
5 years10,000 cycles1 Kbytes
2 years15,000 cycles512 Bytes
2 years30,000 cycles256 Bytes
1 year100,000 cycles128 Bytes
1) In Program Flash, one cycle refers to the programming of all pages in the flash bank and a mass erase.
2) In Data Flash, one cycle refers to the programming of all wordlines in a page and a page erase.
Data Sheet57V1.2, 2009-11
XC878CLM
Functional Description
3.3.1Flash Bank Pagination
The XC878 product family offers Flash devices with either 64 Kbytes or 52 Kbytes of
embedded Flash memory. Each Flash device consists of a Program Flash (P-Flash) and
a single Data Flash (D-Flash) bank. P-Flash has 120 pages of 8 wordlines per page with
64 bytes per wordline. D-Flash has 64 pages of 2 wordlines per page with 32 bytes per
wordline. Both types can be used for code and data storage.. The label “Data” neither
implies that the D-Flash is mapped to the data memory region, nor that it can only be
used for data storage. It is used to distinguish the different page width and wordline of
each Flash bank.
The internal structure of each Flash bank represents a page architecture for flexible
erase capability. The minimum erase width is always a complete page. The D-Flash
bank is divided into smaller size for extended erasing and reprogramming capability;
even numbers for each page size are provided to allow greater flexibility and the ability
to adapt to a wide range of application requirements.
Data Sheet58V1.2, 2009-11
XC878CLM
Functional Description
3.4Interrupt System
The XC800 Core supports one non-maskable interrupt (NMI) and 14 maskable interrupt
requests. In addition to the standard interrupt functions supported by the core, e.g.,
configurable interrupt priority and interrupt masking, the XC878 interrupt system
provides extended interrupt support capabilities such as the mapping of each interrupt
vector to several interrupt sources to increase the number of interrupt sources
supported, and additional status registers for detecting and determining the interrupt
source.
3.4.1Interrupt Source
Figure 11 to Figure 15 give a general overview of the interrupt sources and nodes, and
their corresponding control and status flags.
WDT Overflow
PLL Los s of Clock
Flash Timer Overflow
VDDP Pre-Warning
Flas h EC C Error
FNMIWDT
NMIISR.0
FNMIPLL
NMIISR.1
FNMIFLASH
NMIISR.2
FNMIVDDP
NMIISR.5
FNMIECC
NMIISR.6
NMIWDT
NMICON.0
NMIPLL
NMICON.1
NMIFLASH
NMICON.2
NMIVDDP
NMICON.5
NMIECC
NMICON.6
>=1
0073
H
Non
Maskable
Interrupt
Figure 11Non-Maskable Interrupt Request Sources
Data Sheet59V1.2, 2009-11
XC878CLM
l
Functional Description
Highest
EINT0
Timer 0
Overfl ow
Timer 1
Overflow
UART
Receive
UART
Transmit
EXINT 0
EXICON0.0/1
RI
SCON.0
TI
SCON.1
IT0
TCON.0
TF0
TCON.5
TF1
TCON.7
>=1
IE0
TCON.1
ET0
IEN0.1
ET1
IEN0.3
ES
IEN0.4
EX0
IEN0.0
000B
001B
0023
0003
Lowest
H
IP.1/
IPH.1
H
IP.3/
IPH.3
Priority Leve
P
o
l
l
i
n
g
H
IP.4/
IPH.4
S
e
q
u
e
n
c
e
H
IP.0/
IPH.0
EINT1
IT1
TCON.2
EXIN T1
EXIC ON0.2/ 3
IE1
TCON.3
EX1
IEN0.2
0013
EA
H
IP.2/
IPH.2
IEN0.7
Bit-addressable
Request flag is cleared by hardware
Figure 12Interrupt Request Sources (Part 1)
Data Sheet60V1.2, 2009-11
XC878CLM
Functional Description
T2EX
EDGES
EL
T2_ T2MOD .5
Timer 2
Overf low
EXEN2
T2_ T2 CON.3
Overf low
Normal Divider
End of
Syn Byte
Syn Byte Error
MultiCAN
Node 0
TF2
T2_T2CON.7
CCT
Overf low
TF2EN
T2_T2CON1.1
EXF2
T2_T2CON.6
T2_T2CON1.0
CCTOVF
T2CCU_CCTCON.3
NDOV
FDCON.2
EOFSYN
FDCON.4
ERRSYN
FDCON.5
EXF2EN
T2CCU_CCTCON.2
CANSRC0
IRCON2.0
>=1
CCTOVEN
NDOVEN
BCON.5
SYNEN
FDCON.6
>=1
ET2
IEN0.5
002B
Highest
Lowest
Priority Level
H
IP.5/
IPH.5
P
o
l
l
i
n
g
ADC Service
Request 0
ADC Service
Request 1
MultiCAN
Node 1
MultiCAN
Node 2
ADCSRC0
IRCON1.3
ADCSRC1
IRCON1.4
CANSRC1
IRCON1.5
CANSRC2
IRCON1.6
>=1
Bit-
addressable
Request flag is cleared by hardware
Figure 13Interrupt Request Sources (Part 2)
EADC
IEN1.0
0033
EA
IEN0.7
S
e
q
u
e
H
IP1.0/
IPH1.0
n
c
e
Data Sheet61V1.2, 2009-11
XC878CLM
Functional Description
T21EX
EDGES
EL
T21 _T 2MOD. 5
SSC Error
SSC Transmit
SSC Receive
EINT2
UART1
Timer 21
Overf low
EXEN2
T21_T2CON.3
UART1 Normal
Divider Overflow
EXINT 2
EXICON0.4/5
RI
UART1_SCON.0
TI
UART1_SCON.1
TF2
T21_ T2C ON.7
EXF2
T21_T2CON.6
EIR
IRCON1.0
TIR
IRCON1.1
RIR
IRCON1.2
RIEN
UART1_SCON1.0
TIEN
UART1_SCON1.1
TF2EN
T21_T2CON1.1
EXF2EN
T21_T2CON1.0
NDOV
UART1_FDCON.2
EIREN
MODIEN. 0
TIREN
MODIEN.1
RIREN
MODIEN. 2
EXINT2
IRCON0.2
>=1
>=1
NDOVEN
UART1_SCON1.2
>=1
>=1
ESSC
IEN1.1
EX2
IEN1.2
003B
0043
Highest
Lowest
Priority Level
H
IP1.1/
IPH1.1
P
o
l
l
i
n
g
S
e
q
u
e
n
H
IP1.2/
IPH1.2
c
e
CORDIC
MDU
Result Ready
MDU Error
EOC
CDSTATC.2
IRDY
MDUSTAT.0
IERR
MDUSTAT.1
EA
IEN0.7
Bit-
addressable
Request flag is cleared by hardware
Figure 14Interrupt Request Sources (Part 3)
Data Sheet62V1.2, 2009-11
XC878CLM
Functional Description
Highest
Lowest
Priority Level
T2CC0/
EINT3
T2CC1/
EINT4
T2CC2/
EINT5
T2CC3/
EINT6
EXINT3
EXICON0. 6/7
EXINT4
EXICON1.0/1
EXINT5
EXICON1.2/3
EXINT6
EXICON1.4/5
EXINT3
IRCON0.3
EXINT4
IRCON0.4
EXINT5
IRCON0.5
EXINT6
IRCON0.6
>=1
EXM
IEN1.3
004B
P
o
l
l
i
n
g
H
IP1.3/
IPH1.3
S
e
q
u
e
n
c
e
Compare C hannel 4
Compare C hannel 5
MultiCAN N ode 3
CM4F
T2CC U_COC ON.4
CM5F
T2CC U_COC ON.5
CM4EN
MODIEN.3
CM5EN
MODIEN.4
CANSRC3
IRCON2.4
IEN0.7
EA
Bit-
addressable
Request flag is cleared by hardware
Figure 15Interrupt Request Sources (Part 4)
Data Sheet63V1.2, 2009-11
CCU6 Interrupt node 0
Mult iCAN Node 4
CCU6 Interrupt node 1
Mult iCAN Node 5
CCU6 Interrupt node 2
Mult iCAN Node 6
CCU6S R0
IRCO N3.0
CANS RC4
IRCO N3.1
CCU6S R1
IRCO N3.4
CANSRC5
IRCO N3.5
CCU6S R2
IRCO N4.0
CANS RC6
IRCO N4.1
>=1
>=1
>=1
ECCIP0
IEN1.4
ECCIP1
IEN1.5
ECCIP2
IEN1.6
0053
005B
0063
XC878CLM
Functional Description
Highest
Lowest
Priority Level
H
IP1.4/
IPH1.4
H
IP1.5/
IPH1.5
H
IP1.6/
IPH1.6
P
o
l
l
i
n
g
S
e
q
u
e
n
c
e
CCU6 Interrupt node 3
Mult iCAN Node 7
CCU6S RC3
IRCO N4.4
CANS RC7
IRCO N4.5
>=1
ECCIP3
IEN1.7
Bit-addressable
Request flag is cleared by hardware
Figure 16Interrupt Request Sources (Part 5)
006B
H
EA
IEN0.7
IP1. 7/
IPH1.7
Data Sheet64V1.2, 2009-11
XC878CLM
Functional Description
3.4.2Interrupt Source and Vector
Each interrupt event source has an associated interrupt vector address for the interrupt
node it belongs to. This vector is accessed to service the corresponding interrupt node
request. The interrupt service of each interrupt source can be individually enabled or
disabled via an enable bit. The assignment of the XC878 interrupt sources to the
interrupt vector address and the corresponding interrupt node enable bits are
summarized in Table 22.
An interrupt that is currently being serviced can only be interrupted by a higher-priority
interrupt, but not by another interrupt of the same or lower priority. Hence, an interrupt of
the highest priority cannot be interrupted by any other interrupt request.
If two or more requests of different priority levels are received simultaneously, the
request of the highest priority is serviced first. If requests of the same priority are
received simultaneously, then an internal polling sequence determines which request is
serviced first. Thus, within each priority level, there is a second priority structure
determined by the polling sequence shown in Table 23.
The XC878 has 40 port pins organized into five parallel ports: Port 0 (P0), Port 1 (P1),
Port 3 (P3), Port 4 (P4) and Port 5 (P5). Each pin has a pair of internal pull-up and pulldown devices that can be individually enabled or disabled. These ports are bidirectional
and can be used as general purpose input/output (GPIO) or to perform alternate
input/output functions for the on-chip peripherals. When configured as an output, the
open drain mode can be selected.
Bidirectional Port Features
•Configurable pin direction
•Configurable pull-up/pull-down devices
•Configurable open drain mode
•Configurable drive strength
•Transfer of data through digital inputs and outputs (general purpose I/O)
•Alternate input/output for on-chip peripherals
Data Sheet68V1.2, 2009-11
Figure 17 shows the structure of a bidirectional port pin.
Px _ PUD SEL
Pull-up/Pull-down
Internal Bus
Select Register
Px_PUDEN
Pull-up/Pull-down
Enable Register
Px_DS
Drive Str ength
Control Register
Px_O D
Open Drain
Control Register
Pull-up /Pull-do wn
Control Logic
XC878CLM
Functional Description
Alt Dat aO ut 3
Alt Dat aO ut 2
Alt Dat aOut 1
Alt Dat aIn
Px_DI R
Direction Register
Px_AL TSEL 0
Alternate Select Register 0
Px_AL TSEL 1
Alternate Select Register 1
Px_Data
Data Register
Out
OpenDrain/Output
Control Logic
Pull
Device
11
10
01
00
0
1
In
Output
Dri ver
Pin
I nput
Dri ver
Schmit t T rigger
Pad
Figure 17General Structure of Bidirectional Port
Data Sheet69V1.2, 2009-11
XC878CLM
Functional Description
3.6Power Supply System with Embedded Voltage Regulator
The XC878 microcontroller requires two different levels of power supply:
•3.3 V or 5.0 V for the Embedded Voltage Regulator (EVR) and Ports
•2.5 V for the core, memory, on-chip oscillator, and peripherals
Figure 18 shows the XC878 power supply system. A power supply of 3.3 V or 5.0 V
must be provided from the external power supply pin. The 2.5 V power supply for the
logic is generated by the EVR. The EVR helps to reduce the power consumption of the
whole chip and the complexity of the application board design.
The EVR consists of a main voltage regulator and a low power voltage regulator. In
active mode, both voltage regulators are enabled. In power-down mode, the main
voltage regulator is switched off, while the low power voltage regulator continues to
function and provide power supply to the system with low power consumption.
CPU &
Memory
GPIO Ports
(P0-P5)
On-chip
OSC
EVR
V
DDC
Peripheral
logic
(2.5V)
Figure 18XC878 Power Supply System
V
V
DDP
SSP
ADC
FLASH
PLL
XTAL1&
XTAL2
(3.3V/5.0V)
EVR Features
V
•Input voltage (
•Output voltage (
): 3.3 V/5.0 V
DDP
V
): 2.5 V ± 7.5%
DDC
•Low power voltage regulator provided in power-down mode
V
•
•
Data Sheet70V1.2, 2009-11
prewarning detection
DDP
V
brownout detection
DDC
XC878CLM
Functional Description
3.7Reset Control
The XC878 has five types of reset: power-on reset, hardware reset, watchdog timer
reset, power-down wake-up reset, and brownout reset.
When the XC878 is first powered up, the status of certain pins (see Table 25) must be
defined to ensure proper start operation of the device. At the end of a reset sequence,
the sampled values are latched to select the desired boot option, which cannot be
modified until the next power-on reset or hardware reset. This guarantees stable
conditions during the normal operation of the device.
The second type of reset in XC878 is the hardware reset. This reset function can be used
during normal operation or when the chip is in power-down mode. A reset input pin
RESET
The Watchdog Timer (WDT) module is also capable of resetting the device if it detects
a malfunction in the system.
Another type of reset that needs to be detected is a reset while the device is in
power-down mode (wake-up reset). While the contents of the static RAM are undefined
after a power-on reset, they are well defined after a wake-up reset from power-down
mode.
is provided for the hardware reset.
3.7.1Module Reset Behavior
Table 24 lists the functions of the XC878 and the various reset types that affect these
functions. The symbol “■” signifies that the particular function is reset to its default state.
Table 24Effect of Reset on Device Functions
Module/
Function
CPU Core■■■■■
Peripherals■■■■■
On-Chip
Static RAM
Oscillator,
PLL
Port Pins■■■■■
EVRThe voltage
Wake-Up
Reset
Not affected,
Reliable
■Not affected■■■
regulator is
switched on
Watchdog
Reset
Not affected,
Reliable
Not affectedNot affected■■
Hardware
Reset
Not affected,
Reliable
Power-On
Reset
Affected, unreliable
Brownout
Reset
Affected, unreliable
FLASH■■■■■
NMIDisabledDisabled■■■
Data Sheet71V1.2, 2009-11
XC878CLM
Functional Description
3.7.2Booting Scheme
When the XC878 is reset, it must identify the type of configuration with which to start the
different modes once the reset sequence is complete. Thus, boot configuration
information that is required for activation of special modes and conditions needs to be
applied by the external world through input pins. After power-on reset or hardware reset,
the pins MBC, TMS and P0.0 collectively select the different boot options. Table 25
shows the available boot options in the XC878.
Table 25XC878 Boot Selection
1)
MBCTMSP0.0Type of ModePC Start Value
10XUser Mode
00XBSL Mode; (LIN Mode3), UART/ MultiCAN
Mode
2)
; on-chip OSC/PLL non-bypassed
4)5)
and Alternate BSL Mode6)); on-chip
0000
0000
H
H
OSC/PLL non-bypassed
010OCDS Mode; on-chip OSC/PLL non-
0000
H
bypassed
110User (JTAG) Mode7); on-chip OSC/PLL non-
0000
H
bypassed (normal)
1) In addition to the pins MBC, TMS and P0.0, TM pin also requires an external pull down for all the boot options.
2) BSL mode is automatically entered if no valid password is installed and data at memory address 0000H equals
zero.
3) If a device is programmed as LIN, LIN BSL is always used instead of UART/MultiCAN.
4) UART or MultiCAN BSL is decoded by firmware based on the protocol for product variant with MultiCAN. If no
MultiCAN and LIN variant, UART BSL is used.
5) In MultiCAN BSL mode, the clock source is switched to XTAL by firmware, bypassing the on-chip oscillator.
This avoids any frequency invariance with the on-chip oscillator and allows other frequency clock input, thus
ensuring accurate baud rate detection (especially at high bit rates).
6) Alternate BSL Mode is a user defined BSL code programmed in Flash. It is entered if the AltBSLPassword is
valid.
7) Normal user mode with standard JTAG (TCK,TDI,TDO) pins for hot-attach purpose.
Note: The boot options are valid only with the default set of UART and JTAG pins.
Data Sheet72V1.2, 2009-11
XC878CLM
Functional Description
3.8Clock Generation Unit
The Clock Generation Unit (CGU) allows great flexibility in the clock generation for the
XC878. The power consumption is indirectly proportional to the frequency, whereas the
performance of the microcontroller is directly proportional to the frequency. During user
program execution, the frequency can be programmed for an optimal ratio between
performance and power consumption. Therefore the power consumption can be
adapted to the actual application state.
Features
•Phase-Locked Loop (PLL) for multiplying clock source by different factors
•PLL Base Mode
•Prescaler Mode
•PLL Mode
•Power-down mode support
The CGU consists of an oscillator circuit and a PLL. In the XC878, the oscillator can be
from either of these two sources: the on-chip oscillator (4 MHz) or the external oscillator
(2 MHz to 20 MHz). The term “oscillator” is used to refer to both on-chip oscillator and
external oscillator, unless otherwise stated. After the reset, the on-chip oscillator will be
used by default.The external oscillator can be selected via software. In addition, the PLL
provides a fail-safe logic to perform oscillator run and loss-of-lock detection. This allows
emergency routines to be executed for system recovery or to perform system shut down.
Data Sheet73V1.2, 2009-11
PLL_LOCK
XC878CLM
Functional Description
Wrapper
PLL
OSC
fosc
OSCSS
Figure 19CGU Block Diagram
NR:1
PLLPD
lock
detect
PLL
fp
core
fn
NF:1
NDIV
fvco
OD:1
External
oscillator
watchdog
Switching
circuitry
PLLBYPKDIVPDIV
PLL
watchdog
EXTOSCR
f
SYS
PLLR
Direct Drive (PLL Bypass Operation)
During PLL bypass operation, the system clock has the same frequency as the external
clock source.
(3.1)
ff=
OSCSYS
PLL Mode
The CPU clock is derived from the oscillator clock, divided by the NR factor (PDIV),
multiplied by the NF factor (NDIV), and divided by the OD factor (KDIV). PLL output must
Data Sheet74V1.2, 2009-11
XC878CLM
Functional Description
not be bypassed for this PLL mode. The PLL mode is used during normal system
operation.
(3.2)
NF
=
System Frequency Selection
For the XC878, the value of NF, NR and OD can be selected by bits NDIV, PDIV and
KDIV respectively for different oscillator inputs inorder to obtain the required fsys. But the
combination of these factors must fulfill the following condition:
xff
OSCSYS
OD x NR
•100 MHz < f
•800 KHz < f
<175MHz
VCO
/ (2 * NR) < 8 MHz
OSC
Table 26 provides examples on how the typical system frequency of fsys = 144 MHz
and maximum frequency of 160 MHz (CPU clock = 26.67 MHz)can be obtained for the
different oscillator sources.
f
Table 26System frequency (
=144MHz)
sys
OscillatorfoscNPKfsys
On-chip4 MHz7221144 MHz
4 MHz8021160 MHz
External8 MHz7241144 MHz
6 MHz7231144 MHz
4 MHz7221144 MHz
3.8.1Recommended External Oscillator Circuits
The oscillator circuit, a Pierce oscillator, is designed to work with both, an external crystal
oscillator or an external stable clock source. It basically consists of an inverting amplifier
and a feedback element with XTAL1 as input, and XTAL2 as output.
When using a crystal, a proper external oscillator circuitry must be connected to both
pins, XTAL1 and XTAL2. The crystal frequency can be within the range of 2 MHz to
C
20 MHz. Additionally, it is necessary to have two load capacitances
R
depending on the crystal type, a series resistor
, to limit the current. A test resistor R
X2
and CX2, and
X1
may be temporarily inserted to measure the oscillation allowance (negative resistance)
R
of the oscillator circuitry.
external feedback resistor
values are typically specified by the crystal vendor. An
Q
R
is also required in the external oscillator circuitry. The exact
f
values and related operating range are dependent on the crystal frequency and have to
be determined and optimized together with the crystal vendor using the negative
Data Sheet75V1.2, 2009-11
Q
XC878CLM
Functional Description
resistance method. Oscillation measurement with the final target system is strongly
recommended to verify the input amplitude at XTAL1 and to determine the actual
oscillation allowance (margin negative resistance) for the oscillator-crystal system.
When using an external clock signal, the signal must be connected to XTAL1. XTAL2 is
left open (unconnected).
The oscillator can also be used in combination with a ceramic resonator. The final
circuitry must also be verified by the resonator vendor. Figure 20 shows the
recommended external oscillator circuitries for both operating modes, external crystal
mode and external input clock mode.
2 - 20
MHz
R
Q
C
X1
C
Fundamental
Mode Cryst al
R
R
X2
X2
f
XTAL1
OSC
f
XC878
Oscillator
XTAL2
V
SS
External Clock
Signal
XTAL1
XC878
Oscillator
XTAL2
V
SS
f
OSC
Figure 20External Oscillator Circuitry
Note: For crystal operation, it is strongly recommended to measure the negative
resistance in the final target system (layout) to determine the optimum parameters
for the oscillator operation. Please refer to the minimum and maximum values of
the negative resistance specified by the crystal supplier.
Data Sheet76V1.2, 2009-11
XC878CLM
Functional Description
3.8.2Clock Management
The CGU generates all clock signals required within the microcontroller from a single
f
clock,
modules are as follow:
•CPU clock: CCLK, SCLK = 24 MHz
•MultiCAN clock : MCANCLK = 24 or 48 MHz
•MDU clock : MDUCLK = 24 or 48 MHz
•CORDIC clock : CORDICCLK = 24 or 48 MHz
•CCU6 clock : CCU6CLK = 24 or 48 MHz
•T2CCU clock : T2CCUCLK = 24 or 48 MHz
•Peripheral clock: PCLK = 24 MHz
In addition, different clock frequencies can be output to pin CLKOUT (P0.0 or P0.7). The
clock output frequency, which is derived from the clock output divider (bit COREL), can
further be divided by 2 using toggle latch (bit TLEN is set to 1). The resulting output
frequency has a 50% duty cycle. Figure 21 shows the clock distribution of the XC878.
. During normal system operation, the typical frequencies of the different
sys
Data Sheet77V1.2, 2009-11
CCCFG
MDUCCFG
CLKREL
CORDIC
CLK
MDU
CLK
CORDIC
MDU
Functional Description
T2CCFG
CCUCCFG
FCCFG
XC878CLM
T2CCU
CLK
CCU6
CLK
MCAN
CLK
T2CCU
CCU6
MultiCAN
SD
1
Exter nal
OSC
On-chip
OSC
fosc
PLL
fsys
0
NF,NR,OD
Figure 21Clock Generation from f
/3
COREL
sys
FCLKOSCS S
TLEN
Toggle
Latch
PCLK
SCLK
/2
CCLK
COUTS
Peripherals
CORE
CLKOUT
Data Sheet78V1.2, 2009-11
XC878CLM
Functional Description
For power saving purposes, the clocks may be disabled or slowed down according to
Table 27.
Table 27System frequency (
f
=144MHz)
sys
Power Saving ModeAction
IdleClock to the CPU is disabled.
Slow-downClocks to the CPU and all the peripherals are divided by a
common programmable factor defined by bit field
CMCON.CLKREL.
Power-downOscillator and PLL are switched off.
Data Sheet79V1.2, 2009-11
XC878CLM
Functional Description
3.9Power Saving Modes
The power saving modes of the XC878 provide flexible power consumption through a
combination of techniques, including:
•Stopping the CPU clock
•Stopping the clocks of individual system components
•Reducing clock speed of some peripheral components
•Power-down of the entire system with fast restart capability
After a reset, the active mode (normal operating mode) is selected by default (see
Figure 22) and the system runs in the main system clock frequency. From active mode,
different power saving modes can be selected by software. They are:
•Idle mode
•Slow-down mode
•Power-down mode
any interrupt
& SD=0
set IDLE
bit
IDLE
set IDLE
bit
any interrupt
& SD=1
ACTIVE
set SD
bit
SLOW-DOWN
clear SD
bit
Figure 22 Transition between Power Saving Modes
EXINT0/RXD pin
& SD=0
set PD
bit
POWER- DOWN
set PD
bit
EXINT0/RXD pin
& SD=1
Data Sheet80V1.2, 2009-11
XC878CLM
Functional Description
3.10Watchdog Timer
The Watchdog Timer (WDT) provides a highly reliable and secure way to detect and
recover from software or hardware failures. The WDT is reset at a regular interval that is
predefined by the user. The CPU must service the WDT within this interval to prevent the
WDT from causing an XC878 system reset. Hence, routine service of the WDT confirms
that the system is functioning properly. This ensures that an accidental malfunction of
the XC878 will be aborted in a user-specified time period.
In debug mode, the WDT is default suspended and stops counting. Therefore, there is
no need to refresh the WDT during debugging.
Features
•16-bit Watchdog Timer
•Programmable reload value for upper 8 bits of timer
•Programmable window boundary
f
•Selectable input frequency of
PCLK
/2 or f
•Time-out detection with NMI generation and reset prewarning activation (after which
a system reset will be performed)
PCLK
/128
The WDT is a 16-bit timer incremented by a count rate of f
PCLK
/2 or f
/128. This 16-bit
PCLK
timer is realized as two concatenated 8-bit timers. The upper 8 bits of the WDT can be
preset to a user-programmable value via a watchdog service access in order to modify
the watchdog expire time period. The lower 8 bits are reset on each service access.
Figure 23 shows the block diagram of the WDT unit.
ENW DT
ENW DT_P
f
PCLK
Logic
1:2
1:128
MUX
WDTIN
WDT
Cont rol
Clear
WDT Low Byte
Overflow/Time-out Control &
Window -boundary cont rol
WDTREL
WDT High Byte
WDTWI NB
FNMIWDT
WDTRST
.
Figure 23WDT Block Diagram
Data Sheet81V1.2, 2009-11
XC878CLM
Functional Description
If the WDT is not serviced before the timer overflow, a system malfunction is assumed.
As a result, the WDT NMI is triggered (assert FNMIWDT) and the reset prewarning is
entered. The prewarning period lasts for 30
(assert WDTRST).
The WDT has a “programmable window boundary” which disallows any refresh during
the WDT’s count-up. A refresh during this window boundary constitutes an invalid
access to the WDT, causing the reset prewarning to be entered but without triggering the
WDT NMI. The system will still be reset after the prewarning period is over. The window
boundary is from 0000
.
00
H
to the value obtained from the concatenation of WDTWINB and
H
After being serviced, the WDT continues counting up from the value (<WDTREL> * 2
The time period for an overflow of the WDT is programmable in two ways:
count, after which the system is reset
H
8
).
•The input frequency to the WDT can be selected to be either
f
PCLK
/2 or f
PCLK
/128
•The reload value WDTREL for the high byte of WDT can be programmed in register
WDTREL
The period, P
, between servicing the WDT and the next overflow can be determined
If the Window-Boundary Refresh feature of the WDT is enabled, the period
P
WDT
between servicing the WDT and the next overflow is shortened if WDTWINB is greater
than WDTREL, see Figure 24. This period can be calculated using the same formula by
replacing WDTREL with WDTWINB. For this feature to be useful, WDTWINB cannot be
smaller than WDTREL.
Data Sheet82V1.2, 2009-11
Count
FFFF
H
WDTWINB
WDTREL
No refresh
allowed
Figure 24WDT Timing Diagram
XC878CLM
Functional Description
time
Refresh allowed
Table 28 lists the possible watchdog time ranges that can be achieved using a certain
module clock. Some numbers are rounded to 3 significant digits.
Table 28Watchdog Time Ranges
Reload value
In WDTREL
Prescaler for
2 (WDTIN = 0)128 (WDTIN = 1)
f
PCLK
24 MHz24 MHz
FF
7F
00
H
H
H
21.3 µs1.37 ms
2.75 ms176 ms
5.46 ms350 ms
Data Sheet83V1.2, 2009-11
XC878CLM
Functional Description
3.11Multiplication/Division Unit
The Multiplication/Division Unit (MDU) provides fast 16-bit multiplication, 16-bit and
32-bit division as well as shift and normalize features. It has been integrated to support
the XC878 Core in real-time control applications, which require fast mathematical
computations.
Features
•Fast signed/unsigned 16-bit multiplication
•Fast signed/unsigned 32-bit divide by 16-bit and 16-bit divide by 16-bit operations
•32-bit unsigned normalize operation
•32-bit arithmetic/logical shift operations
Table 29 specifies the number of clock cycles used for calculation in various operations.
Table 29MDU Operation Characteristics
OperationResultRemainderNo. of Clock Cycles
used for calculation
Signed 32-bit/16-bit32-bit16-bit33
Signed 16-bit/16bit16-bit16-bit17
Signed 16-bit x 16-bit32-bit-16
Unsigned 32-bit/16-bit32-bit16-bit32
Unsigned 16-bit/16-bit16-bit16-bit16
Unsigned 16-bit x 16-bit32-bit-16
32-bit normalize--No. of shifts + 1 (Max. 32)
32-bit shift L/R--No. of shifts + 1 (Max. 32)
Data Sheet84V1.2, 2009-11
XC878CLM
Functional Description
3.12CORDIC Coprocessor
The CORDIC Coprocessor provides CPU with hardware support for the solving of
circular (trigonometric), linear (multiply-add, divide-add) and hyperbolic functions.
Features
•Modes of operation
– Supports all CORDIC operating modes for solving circular (trigonometric), linear
(multiply-add, divide-add) and hyperbolic functions
– Integrated look-up tables (LUTs) for all operating modes
•Circular vectoring mode: Extended support for values of initial X and Y data up to full
15
range of [-2
•Circular rotation mode: Extended support for values of initial Z data up to full range
15
of [-2
,(215-1)], representing angles in the range [-π,((215-1)/215)π] for solving
trigonometry
•Implementation-dependent operational frequency of up to 80 MHz
•Gated clock input to support disabling of module
•16-bit accessible data width
– 24-bit kernel data width plus 2 overflow bits for X and Y each
– 20-bit kernel data width plus 1 overflow bit for Z
– With KEEP bit to retain the last value in the kernel register for a new calculation
•16 iterations per calculation: Approximately 41 clock-cycles or less, from set of start
(ST) bit to set of end-of-calculation flag, excluding time taken for write and read
access of data bytes.
•Twos complement data processing
– Only exception: X result data with user selectable option for unsigned result
•X and Y data generally accepted as integer or rational number; X and Y must be of
the same data form
•Entries of LUTs are 20-bit signed integers
– Entries of atan and atanh LUTs are integer representations (S19) of angles with
the scaling such that [-2
– Accessible Z result data for circular and hyperbolic functions is integer in data form
of S15
•Emulated LUT for linear function
– Data form is 1 integer bit and 15-bit fractional part (1.15)
– Accessible Z result data for linear function is rational number with fixed data form
of S4.11 (signed 4Q16)
•Truncation Error
– The result of a CORDIC calculation may return an approximation due to truncation
of LSBs
– Good accuracy of the CORDIC calculated result data, especially in circular mode
•Interrupt
– On completion of a calculation
,(215-1)] for solving angle and magnitude
15
,(215-1)] represents the range [-π,((215-1)/215)π]
Data Sheet85V1.2, 2009-11
XC878CLM
Functional Description
– Interrupt enabling and corresponding flag
3.13UART and UART1
The XC878 provides two Universal Asynchronous Receiver/Transmitter (UART and
UART1) modules for full-duplex asynchronous reception/transmission. Both are also
receive-buffered, i.e., they can commence reception of a second byte before a
previously received byte has been read from the receive register. However, if the first
byte still has not been read by the time reception of the second byte is complete, one of
the bytes will be lost.
Features
•Full-duplex asynchronous modes
– 8-bit or 9-bit data frames, LSB first
– Fixed or variable baud rate
•Receive buffered
•Multiprocessor communication
•Interrupt generation on the completion of a data transmission or reception
The UART modules can operate in the four modes shown in Table 30.
Table 30UART Modes
Operating ModeBaud Rate
f
Mode 0: 8-bit shift register
PCLK
/2
Mode 1: 8-bit shift UARTVariable
Mode 2: 9-bit shift UART
f
PCLK
/32 or f
PCLK
/64
1)
Mode 3: 9-bit shift UARTVariable
1) For UART1 module, the baud rate is fixed at f
PCLK
/64.
There are several ways to generate the baud rate clock for the serial port, depending on
the mode in which it is operating. In mode 0, the baud rate for the transfer is fixed at
f
/2. In mode 2, the baud rate is generated internally based on the UART input clock
PCLK
f
and can be configured to either
PCLK
/32 or f
/64. For UART1 module, only f
PCLK
PCLK
/64 is
available. The variable baud rate is set by the underflow rate on the dedicated baud-rate
generator. For UART module, the variable baud rate alternatively can be set by the
overflow rate on Timer 1.
3.13.1Baud-Rate Generator
Both UART modules have their own dedicated baud-rate generator, which is based on
a programmable 8-bit reload value, and includes divider stages (i.e., prescaler and
Data Sheet86V1.2, 2009-11
XC878CLM
Functional Description
fractional divider) for generating a wide range of baud rates based on its input clock f
see Figure 25.
Fract ional Divider
8-Bit Reload Value
f
8-Bit Baud Rate Ti mer
NDOV
f
PCL K
Prescaler
FDM
FDEN
FDSTEP
1
f
DIV
0
(overflow)
FDEN&F DM
00
01
11
10
11
10
01
00
0
1
R
01
Adder
FDRES
f
DIV
clk
f
MOD
‘0’
BR
PCLK
,
Figure 25Baud-rate Generator Circuitry
The baud rate timer is a count-down timer and is clocked by either the output of the
f
fractional divider (
output of the prescaler (
) if the fractional divider is enabled (FDCON.FDEN = 1), or the
MOD
f
) if the fractional divider is disabled (FDEN = 0). For baud rate
DIV
generation, the fractional divider must be configured to fractional divider mode
(FDCON.FDM = 0). This allows the baud rate control run bit BCON.R to be used to start
or stop the baud rate timer. At each timer underflow, the timer is reloaded with the 8-bit
reload value in register BG and one clock pulse is generated for the serial channel.
Enabling the fractional divider in normal divider mode (FDEN = 1 and FDM = 1) stops the
baud rate timer and nullifies the effect of bit BCON.R. See Section 3.14.
f
The baud rate (
•Input clock
•Prescaling factor (2
) value is dependent on the following parameters:
BR
f
PCLK
BRPRE
) defined by bit field BRPRE in register BCON
•Fractional divider (STEP/256) defined by register FDSTEP
(to be considered only if fractional divider is enabled and operating in fractional
divider mode)
•8-bit reload value (BR_VALUE) for the baud rate timer defined by register BG
Data Sheet87V1.2, 2009-11
XC878CLM
Functional Description
The following formulas calculate the final baud rate without and with the fractional divider
respectively:
The maximum baud rate that can be generated is limited to
/32. Hence, for a module
PCLK
clock of 24 MHz, the maximum achievable baud rate is 0.75 MBaud.
Standard LIN protocol can support a maximum baud rate of 20 kHz, the baud rate
accuracy is not critical and the fractional divider can be disabled. Only the prescaler is
used for auto baud rate calculation. For LIN fast mode, which supports the baud rate of
20 kHz to 57.6 kHz, the higher baud rates require the use of the fractional divider for
greater accuracy.
Table 31 lists the various commonly used baud rates with their corresponding parameter
settings and deviation errors. The fractional divider is disabled and a module clock of
24 MHz is used.
Table 31Typical Baud rates for UART with Fractional Divider disabled
Baud ratePrescaling Factor
(2BRPRE)
19.2 kBaud1 (BRPRE=000
9600 Baud1 (BRPRE=000
4800 Baud2 (BRPRE=001
2400 Baud4 (BRPRE=010
) 78 (4E
B
)156 (9CH)0.17%
B
)156 (9CH)0.17%
B
)156 (9CH)0.17%
B
Reload Value
(BR_VALUE + 1)
)0.17%
H
Deviation Error
The fractional divider allows baud rates of higher accuracy (lower deviation error) to be
generated. Table 32 lists the resulting deviation errors from generating a baud rate of
57.6 kHz, using different module clock frequencies. The fractional divider is enabled
(fractional divider mode) and the corresponding parameter settings are shown.
Data Sheet88V1.2, 2009-11
Functional Description
Table 32Deviation Error for UART with Fractional Divider enabled
XC878CLM
f
PCLK
24 MHz16 (6
12 MHz13 (3
8MHz12 (2
6MHz16 (6
Prescaling Factor
(2BRPRE)
Reload Value
STEPDeviation
(BR_VALUE + 1)
)59 (3BH)+0.03 %
H
)59 (3BH)+0.03 %
H
)59 (3BH)+0.03 %
H
)236 (ECH)+0.03 %
H
Error
3.13.2Baud Rate Generation using Timer 1
In UART modes 1 and 3 of UART module, Timer 1 can be used for generating the
variable baud rates. In theory, this timer could be used in any of its modes. But in
practice, it should be set into auto-reload mode (Timer 1 mode 2), with its high byte set
to the appropriate value for the required baud rate. The baud rate is determined by the
Timer 1 overflow rate and the value of SMOD as follows:
Setting bit FDM in register FDCON to 1 configures the fractional divider to normal divider
mode, while at the same time disables baud rate generation (see Figure 25). Once the
fractional divider is enabled (FDEN = 1), it functions as an 8-bit auto-reload timer (with
no relation to baud rate generation) and counts up from the reload value with each input
clock pulse. Bit field RESULT in register FDRES represents the timer value, while bit
field STEP in register FDSTEP defines the reload value. At each timer overflow, an
overflow flag (FDCON.NDOV) will be set and an interrupt request generated. This gives
an output clock f
that is 1/n of the input clock f
MOD
The output frequency in normal divider mode is derived as follows:
×=
f
MOD
f
DIV
, where n is defined by 256 - STEP.
DIV
1
----------------------------- 256STEP–
(3.7)
Data Sheet89V1.2, 2009-11
XC878CLM
Functional Description
3.15LIN Protocol
The UART module can be used to support the Local Interconnect Network (LIN) protocol
for both master and slave operations. The LIN baud rate detection feature, which
consists of the hardware logic for Break and Synch Byte detection, provides the
capability to detect the baud rate within LIN protocol using Timer 2. This allows the UART
to be synchronized to the LIN baud rate for data transmission and reception.
Note: The LIN baud rate detection feature is available for use only with UART. To use
UART1 for LIN communication, software has to be implemented to detect the
Break and Synch Byte.
LIN is a holistic communication concept for local interconnected networks in vehicles.
The communication is based on the SCI (UART) data format, a single-master/multipleslave concept, a clock synchronization for nodes without stabilized time base. An
attractive feature of LIN is self-synchronization of the slave nodes without a crystal or
ceramic resonator, which significantly reduces the cost of hardware platform. Hence, the
baud rate must be calculated and returned with every message frame.
The structure of a LIN frame is shown in Figure 26. The frame consists of the:
•Header, which comprises a Break (13-bit time low), Synch Byte (55
), and ID field
H
•Response time
•Data bytes (according to UART protocol)
•Checksum
Frame slot
Frame
Response
Header
Synch
Protected
identifier
space
Da ta 1
Response
Da ta 2Data N
Checksum
Figure 26Structure of LIN Frame
3.15.1LIN Header Transmission
LIN header transmission is only applicable in master mode. In the LIN communication,
a master task decides when and which frame is to be transferred on the bus. It also
identifies a slave task to provide the data transported by each frame. The information
Data Sheet90V1.2, 2009-11
XC878CLM
Functional Description
needed for the handshaking between the master and slave tasks is provided by the
master task through the header portion of the frame.
The header consists of a break and synch pattern followed by an identifier. Among these
three fields, only the break pattern cannot be transmitted as a normal 8-bit UART data.
The break must contain a dominant value of 13 bits or more to ensure proper
synchronization of slave nodes.
In the LIN communication, a slave task is required to be synchronized at the beginning
of the protected identifier field of frame. For this purpose, every frame starts with a
sequence consisting of a break field followed by a synch byte field. This sequence is
unique and provides enough information for any slave task to detect the beginning of a
new frame and be synchronized at the start of the identifier field.
Upon entering LIN communication, a connection is established and the transfer speed
(baud rate) of the serial communication partner (host) is automatically synchronized in
the following steps:
STEP 1: Initialize interface for reception and timer for baud rate measurement
STEP 2: Wait for an incoming LIN frame from host
STEP 3: Synchronize the baud rate to the host
STEP 4: Enter for Master Request Frame or for Slave Response Frame
Note: Re-synchronization and setup of baud rate are always done for every Master
Request Header or Slave Response Header LIN frame.
Data Sheet91V1.2, 2009-11
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.