26DEFINITIONS
27LIFE SUPPORT APPLICATIONS
28PURCHASE OF PHILIPS I2C COMPONENTS
1997 Aug 012
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
1FEATURES
• 80C51 Central Processing Unit (CPU)
• 64 kbytes ROM (only P83CE560)
• 64 kbytes EPROM (only P87CE560)
• ROM/EPROM Code protection
• 2048 bytes RAM, expandable externally to 64 kbytes
• Two standard 16-bit timers/counters
• An additional 16-bit timer/counter coupled to four
capture registers and three compare registers
• A 10-bit Analog-to-Digital Converter (ADC) with eight
multiplexed analog inputs and programmable autoscan
• Two 8-bit resolution, Pulse Width Modulation outputs
• Five 8-bit I/O ports plus one 8-bit input port shared with
analog inputs
2
C-bus serial I/O port with byte oriented master and
• I
slave functions
• Full-duplex UART compatible with the standard 80C51
• On-chip Watchdog Timer
• 15 interrupt sources with 2 priority levels (2 to 6 external
sources possible)
• Phase-Locked Loop (PLL) oscillator with 32 kHz
reference and software-selectable system clock
frequency
• Seconds timer
• Software enable/disable of ALE output pulse
• Electromagnetic compatibility improvements
• Wake-up from Power-down by external or seconds
interrupt
• Frequency range for 80C51-family standard oscillator:
3.5 to 16 MHz
• Extended temperature range: −40 to +85 C
• Supply voltage: 4.5 to 5.5 V.
2GENERAL DESCRIPTION
The 8-bit microcontrollers P80CE560, P83CE560 and
P87CE560 - hereafter referred to as P8xCE560 - are
manufactured in an advanced CMOS process and are
derivatives of the 80C51 microcontroller family.
The P8xCE560 contains a volatile 2048 bytes read/write
Data Memory, five 8-bit I/O ports, one 8-bit input port, two
16-bit timer/event counters (identical to the timers of the
80C51), an additional 16-bit timer coupled to capture and
compare latches, a 15-source, two-priority-level,
nested interrupt structure, an 8-input ADC, a dual
Digital-to-Analog Convertor (DAC), Pulse Width
Modulated interface, two serial interfaces (UART and
2
C-bus), a Watchdog Timer, an on-chip oscillator and
I
timing circuits.
The P8xCE560 is available in 3 versions:
• P80CE560: ROMless version
• P83CE560: containing a non-volatile 64 kbytes mask
The P8xCE560 is a control-oriented CPU with on-chip
Program and Data Memory; it cannot be extended with
external Program Memory. It can access up to 64 kbytes
of external Data Memory. For systems requiring extra
capability, theP8xCE560 can be expanded using standard
TTL compatible memories and peripherals.
In addition, the P8xCE560 has two software selectable
reduced power modes: Idle mode and Power-down mode.
The Idle mode freezes the CPU while allowing the RAM,
timers, serial ports, and interrupt system to continue
functioning. The Power-down mode saves the RAM
contents but freezes the oscillator, causing all other chip
functions to be inoperative.The Power-down mode can be
terminated by an external reset, by the seconds interrupt
and by any one of the two external interrupts;
see Section 15.3.
The device also functions as an arithmetic processor
having facilities for both binary and BCD arithmetic as well
as bit-handling capabilities. The instruction set of the
P8xCE560 is the same as the 80C51 and consists of over
100 instructions: 49 one-byte, 45 two-byte, and
17 three-byte. With a 16 MHz system clock, 58% of the
instructions are executed in 0.75 µs and 40% in 1.5 µs.
Multiply and divide instructions require 3 µs.
1997 Aug 013
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
2.1Electromagnetic Compatibility (EMC)
Primary attention is paid to the reduction of
electromagnetic emission of the microcontroller
P8xCE560. The following features reduce the
electromagnetic emission and additionally improve the
electromagnetic susceptibility:
• Four digital part supply voltage pins (V
four digital ground pins (V
pairs of V
DDn
and V
at two adjacent pins, at each side
SSn
SS1
to V
SS4
DD1
to V
DD4
) and
) are placed as
of the package.
• Separated V
pins for the internal logic and the port
DD
buffers.
• Internal decoupling capacitance improves the EMC
radiation behaviour and the EMC immunity.
• External capacitors should be connected across
associated V
DDn
and V
pins (i.e. V
SSn
DD1
and V
SS1
Lead length should be as short as possible. Ceramic
chip capacitors are recommended (100 nF).
3ORDERING INFORMATION
PACKAGE
TYPE NUMBER
NAMEDESCRIPTIONVERSION
P80CE560EFB
P87CE560EFB
(1)
(3)
(2)
QFP80
plastic quad flat package;
80 leads (lead length 1.95 mm);
body 14 × 20 × 2.8 mm
2.2Recommendation on ALE
For applications that require no external memory or
temporarily no external memory: the ALE output signal
(pulses at a frequency of
1
⁄6× f
) can be disabled under
OSC
software control (bit RFI; SFR: PCON.5); if disabled, no
ALE pulse will occur. ALE pin will be pulled down
internally, switching an external address latch to a quiet
state. The MOVX instruction will still toggle ALE (external
Data Memory is accessed). ALE will retain its normal HIGH
value during Idle mode and a LOW value during
Power-down mode while in the ‘RFI reduction mode’.
Additionally during internal access (
EA = 1) ALE will toggle
normally when the address exceeds the internal Program
Memory size. During external access (EA = 0) ALE will
always toggle normally, whether the flag ‘RFI’ is set or not.
).
FREQUENCY
RANGE (MHZ)
TEMPERATURE
RANGE (°C)
SOT318-23.5 to 16−40 to +85P83CE560EFB/nnn
Notes
1. ROMless type.
2. ROM coded type; ‘nnn’ denotes the ROM code number.
3. EPROM/OTP type.
1997 Aug 014
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
4BLOCK DIAGRAM
MBH074
XTAL4
XTAL3
+
PLL
'SECONDS'
OSCILLATOR
TIMER
(T3)
TIMER
WATCHDOG
RSTOUT EWCMSR0 to CMSR5
SDA SCL
ref(n)(A)
V
ref(p)(A)
V
ADC0 to ADC7
ADEXS
PWM0
PWM1
SSA
V
DDA
V
SS
V
DD
V
I/O
C-BUS
2
SERIAL
I
(6)
ADC
PWM
DUAL
+
RAM
256 bytes
DATA MEMORY
AUX-RAM
1792 bytes
(7)
P8xCE560
16
8-bit internal bus
OUTPUT
SELECTION
COMPARATOR
WITH
16-BIT
THREE
COMPARATORS
16
16-BIT
EVENT
TIMER/
FOUR
16-BIT
CAPTURE
REGISTERS
(T2)
COUNTER
LATCHES
(5)(2)(2)(4)(4)
CMT0, CMT1
RT2
T2
handbook, full pagewidth
CT0I to CT3IP4P5RXDTXDP3P2P1P0
Fig.1 Block diagram P8xCE560.
MEMORY
64 kbytes
PROGRAM
ROM/
EPROM
I/O
8-BIT
PORTS
CPU
core
(T0,T1)
XTAL2
EA
80C51
ALE
excluding
ROM/RAM
PSEN
(4)
WR
T1 INT0 INT1
T0
(4)(4)(4)(4)
SELXTAL
EVENT
TIMER/
COUNTERS
TWO 16 - BIT
RSTIN
XTAL1
1997 Aug 015
RD
(4)
UART
PORT
SERIAL
&
EXT. BUS
PARALLEL
I/O PORTS
(1)
AD0 to AD7
(3)
A8 to A15
(1) Alternative function of Port 0.
(2) Alternative function of Port 1.
(3) Alternative function of Port 2.
(4) Alternative function of Port 3.
(5) Alternative function of Port 5.
(6) Alternative function of Port 6.
(7) Not present in P80CE560.
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
5FUNCTIONAL DIAGRAM
handbook, full pagewidth
alternative function
ADC0
ADC1
ADC2
ADC3
ADC4
ADC5
ADC6
ADC7
CMSR0
CMSR1
CMSR2
CMSR3
CMSR4
CMSR5
CMT0
CMT1
XTAL1
XTAL2
EA/V
PP
PSEN
ALE/PROG
PWM0
PWM1
SDA
ADEXS
V
ref(p)(A)
V
ref(n)(A)
STADC
PORT 5
PORT 4
RSTIN
RSTOUT
SCL
EW
SELXTAL1
XTAL4
XTAL3
0
1
(1)
(1)
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
P8xCE560
MBH075
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
V
V
V
V
SSA
DDA
SS
DD
PORT 0
PORT 1
PORT 2
PORT 3
(2)
alternative function
AD0
AD1
AD2
LOW ORDER
AD3
ADDRESS
AD4
AD5
AD6
AD7
CT0I/INT2
CT1I/INT3
CT2I/INT4
CT3I/INT5
T2
RT2
A8
A9
A10
A11
A12
A13
A14
A15
RXD/DATA
TXD/CLOCK
INT0
INT1
T0
T1
WR
RD
AND
DATA BUS
HIGH ORDER
ADDRESS
BUS
(1) Only the P87CE560 with an alternative function.
(2) V
6.2Pin description
Table 1 Pin description for QFP80 (SOT318-2)
To avoid a ‘latch-up’ effect at power-on: V
SYMBOLPINDESCRIPTION
V
ref(n)(A)
V
ref(p)(A)
V
SSA1
V
DDA1
P5.7/ADC7 to
P5.0/ADC0
V
to V
V
SS1
DD1
to V
SS4
DD4
1Low-end of ADC reference resistor.
2High-end of ADC reference resistor.
3Ground, analog part. For ADC receiver and reference voltage.
4Power supply, analog part (+5 V). For ADC receiver and reference voltage.
5to12Port 5 (P5.7 to P5.0): 8-bit input port lines;
ADC7 to ADC0: 8 input channels to the ADC.
13, 29,
54, 67
14, 28,
53, 66
Ground; digital part; circuit ground potential. V
V
SS3
Power supply, digital part (+5 V). Power supply pins during normal operation and
power reduction modes. All pins must be connected.
ADEXS15Start ADC operation. Input starting ADC, triggered by a programmable edge; ADC
operation can also be started by software. This pin must not float.
PWM016Pulse Width Modulation output 0.
PWM117Pulse Width Modulation output 1.
EW18Enable Watchdog Timer (WDT): enable for T3 Watchdog Timer and disable
Power-down mode. This pin must not float.
P4.0/CMSR0 to
P4.5/CMSR5
P4.6/CMT0 to
19 to 22,
24, 25
26, 27
Port 4 (P4.0 to P4.7): 8-bit quasi-bidirectional I/O port lines;
CMSR0 to CMSR5: compare and set/reset outputs for Timer T2;
CMT0 to CMT1: compare and toggle outputs for Timer T2.
P4.7/CMT1
RSTOUT23Reset output of the P8xCE560 for resetting peripheral devices during initialization
and Watchdog Timer overflow.
RSTIN30Reset input to reset the P8xCE560.
P1.0/CT0I/INT2 to
P1.3/CT3I/INT5
P1.4/T2 to
P1.5/RT2
P1.6 to P1.737 to 38
SCL39I
SDA40I
31 to 34Port 1 (P1.0 to P1.7): 8-bit quasi-bidirectional I/O port lines;
− 0.5 V < ‘voltage at any pin at any time’ < VDD+ 0.5 V.
SS
, V
, V
SS1
SS2
must be connected,
SS4
is internally connected to digital ground, but should be connected externally.
1997 Aug 018
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
SYMBOLPINDESCRIPTION
XTAL251Crystal pin 2: output of the inverting amplifier that forms the oscillator.
Left open-circuit when an external oscillator clock is used.
XTAL152Crystal pin 1: input to the inverting amplifier that forms the oscillator, and input to the
internal clock generator. Receives the external oscillator clock signal when an external
oscillator is used. Must be connected to logic HIGH if the PLL oscillator is selected
(SELXTAL1 = LOW).
P2.0/A08 to
P2.7/A15
PSEN63Program Store Enable output: read strobe to the external Program Memory via
ALE/
PROG64Address Latch Enable output. Latches the low byte of the address during access of
EA/V
PP
P0.7/AD7 to
P0.0/AD0
V
DDA2
V
SSA2
XTAL378Crystal pin 3: output of the inverting amplifier that forms the 32 kHz oscillator.
XTAL479Crystal pin 2: input to the inverting amplifier that forms the 32 kHz oscillator. XT AL3 is
SELXTAL180SELXTAL1 = HIGH, selects the HF oscillator, using the XTAL1/XTAL2 crystal.
55 to 62Port 2 (P2.0 to P2.7): 8-bit quasi-bidirectional I/O port lines;
A08 to A15: High-order address byte for external memory.
Ports 0 and 2. Is activated twice each machine cycle during fetches from external
Program Memory . When executing out of externalProgram Memory two activations of
PSEN are skipped during each access to external Data Memory. PSEN is not
activated (remains HIGH) during no fetches from external Program Memory.PSEN
can sink/source 8 LSTTL inputs. It can drive CMOS inputs without external pull-ups.
external memory in normal operation. It is activated every six oscillator periods except
during an external Data Memory access. ALE can sink/source 8 LSTTL inputs. It can
drive CMOS inputs without an external pull-up. To prohibit the toggling of ALE pin (RFI
noise reduction) the bit RFI (SFR: PCON.5) must be set by software; see Section 2.2.
PROG: the programming pulse input; alternative function for the P87CE560.
65External Access input. If, during reset, EA is held at a TTL level HIGH the CPU
executes out of the internal Program Memory. If, during reset, EA is held at a TTL level
LOW the CPU executes out of external Program Memory via Port 0 and Port 2. EA is
not allowed to float. EA is latched during reset and don’t care after reset.
VPP: the programming supply voltage; alternative function for the P87CE560.
68 to 75Port 0 (P0.7 to P0.0): 8-bit open-drain bidirectional I/O port lines;
AD7 to AD0: Multiplexed Low-order address and Data bus for external memory.
76Power supply, analog part (+5 V). For PLL oscillator.
77Ground, analog part. For PLL oscillator.
pulled LOW if the PLL oscillator is not selected (SELXTAL1 = 1) or if reset is active.
If SELXTAL1 = LOW the PLL is selected for clocking of the controller, using the
XTAL3/XTAL4 crystal.
1997 Aug 019
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
7FUNCTIONAL DESCRIPTION
The P8xCE560 is a stand-alone high-performance
microcontroller designed for use in real time applications
such as instrumentation, industrial control, medium to
high-end consumer applications and specific automotive
control applications.
In addition to the 80C51 standard functions, the device
provides a number of dedicated hardware functions for
these applications.
The P8xCE560 is a control-oriented CPU with on-chip
program and Data Memory, but it cannot be extended with
external Program Memory. It can access up to 64 kbytes
of external Data Memory. For systems requiring extra
capability, theP8xCE560 can be expanded using standard
memories and peripherals.
The functional description of the device is described in:
The Central Processing Unit (CPU) manipulates operands
in three memory spaces; these are the 64 kbytes external
Data Memory, 2048 bytes internal Data Memory
(consisting of 256 bytes standard RAM and 1792 bytes
AUX-RAM) and the 64 kbytes internal or 64 kbytes
external Program Memory (see Fig.4).
8.1Program Memory
The Program Memory of the P8xCE560 consists of
64 kbytes ROM or 64 kbytes EPROM. If, during reset, the
EA pin was held HIGH, the P8xCE560 always executes
out of the internal Program Memory. If the EA pin was held
LOW during reset the P8xCE560 fetches all instructions
from the external Program Memory. The EA input is
latched during reset and is don’t care after reset.
The internal Program Memory content is protected by
setting a mask programmable security bit (ROM) or by the
software programmable security bits (EPROM)
respectively, i.e. it cannot be read out at any time by any
test mode or by any instruction in the external Program
Memory space. The MOVC instructions are the only ones
which have access to program code in the internal or
external Program Memory. The EA input is latched during
reset and is don’t care after reset. This implementation
prevents from reading internal program code by switching
from external Program Memory to internal Program
Memory during MOVC instruction or an instruction that
handles immediate data. Table 2 lists the access to the
internal and external Program Memory with MOVC
instructions whether the security feature has been
activated or not.
Due to the maximum size of the internal Program Memory,
the MOVC instructions can always operate either in the
internal or in the external Program Memory.
Table 2 Memory access by the MOVC instruction
For code protection of the P87CE560 see Section 23.2.
8.2Internal Data Memory
The internal Data Memory is divided into three physically
separated parts: 256 bytes of RAM, 1792 bytes of
AUX-RAM, and a 128 bytes Special Function Registers
(SFRs) area. These parts can be addressed each in a
different way as described in Sections 8.2.1 to 8.2.2 and
Table 3.
Table 3 Internal Data Memory map
MEMORYLOCATIONADDRESS MODE
RAM0 to 127Direct and indirect
128 to 255Indirect only
SFR128 to 255Direct only
AUX-RAM0 to 1791Indirect only with MOVX
8.2.1RAM
• RAM 0 to 127 can be addressed directly and indirectly
as in the 80C51. Address pointers are R0 and R1 of the
selected register bank.
• RAM 128 to 255 can only be addressed indirectly.
Address pointers are R0 and R1 of the selected register
bank.
Four register banks, each 8 registers wide, occupy
locations 0 through 31 in the lower RAM area. Only one of
these banks may be enabled at a time. The next 16 bytes,
locations 32 through 47, contain 128 directly addressable
bit locations. The stack can be located anywhere in the
internal 256 bytes RAM. The stack depth is only limited by
the available internal RAM space of 256 bytes (see Fig.6).
All registers except the Program Counter and the four
register banks reside in the Special Function Register
address space.
8.2.2S
PECIAL FUNCTION REGISTERS
The Special Function Registers can only be addressed
directly in the address range from 128 to 255 (see Fig.7).
MOVC
INSTRUCTION
MOVC in internal
PROGRAM MEMORY ACCESS
INTERNALEXTERNAL
YESNO
(1)
Program Memory
MOVC in external
NO
(1)
YES
Program Memory
Note
1. Not applicable due to 64 kbytes internal Program
Memory.
1997 Aug 0111
8.2.3AUX-RAM
• AUX-RAM 0 to 1791 is indirectly addressable via page
register (XRAMP) and MOVX-Ri instructions, unless it is
disabled by setting ARD = 1 (see Fig.5). When
executing from internal Program Memory, an access to
AUX-RAM 0 to 1791 will not affect the ports P0, P2,
P3.6 and P3.7.
• AUX-RAM 0 to 1791 is also indirectly addressable as
external Data Memory locations 0 to 1791 via MOVX-Ri
instructions, unless it is disabled by setting ARD = 1.
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
An access to external Data Memory locations higher than
1791 will be performed with the MOVX @DPTR
instructions in the same way as in the 80C51 structure, so
with P0 and P2 as data/address bus and P3.6 and P3.7 as
write and read timing signals.
Note that the external Data Memory cannot be accessed
with R0 and R1 as address pointer if the AUX-RAM is
enabled (ARD = 0, default).
Table 4 AUX-RAM Page Register (address FAH)
76543210
XRAMPxXRAMPxXRAMPxXRAMPxXRAMPxXRAMP2XRAMP1XRAMP0
Table 5 Description of XRAMP bits
BITSYMBOLFUNCTION
7 to 3XRAMPxReserved for future use. During read XRAMPx = undefined; a write
operation must write logic 0s to these locations.
2 to 0XRAMP2to XRAMP0AUX-RAM page select bits 2 to 0; see Table 6.
Table 6 Memory locations for all possible MOVX-accesses
X = don’t care.
(1)
ARD
XRAMP2 XRAMP1 XRAMP0MEMORY LOCATIONS
8.2.4AUX-RAM P
The AUX-RAM Page Register is used to select one of
seven 256-bytes pages of the internal 1792 bytes
AUX-RAM for MOVX-accesses via R0 or R1. Its reset
value is ‘XXXXX000B’.
AGE REGISTER (XRAMP)
MOVX @Ri,A and MOVX A,@Ri instructions access
0000AUX-RAM locations 0 to 255 (reset condition)
0001AUX-RAM locations 256 to 511
0010AUX-RAM locations 512 to 767
0011AUX-RAM locations 768 to 1023
0100AUX-RAM locations 1024 to 1279
0101AUX-RAM locations 1280 to 1535
0110AUX-RAM locations 1536 to 1791
0111No valid memory access; reserved for future use
1XXXExternal RAM locations 0 to 255
MOVX @DPTR,A and MOVX A,@DPTR instructions access
0XXXAUX-RAM locations 0 to 1791 (reset condition);
External RAM locations 1792 to 65535
1XXXExternal RAM locations 0 to 65535
Note
1. ARD: AUX-RAM disable, is a bit in SFR PCON (bit PCON.6); see Section 15.5.
The first three methods can be used for addressing
destination operands. Most instructions have a
‘destination/source’ field that specifies the data type,
addressing methods and operands involved.
For operations other than MOVs, the destination operand
is also a source operand.
Access to memory addresses is as follows:
• Register in one of the four register banks through
Register, Direct or Register-Indirect addressing.
• Internal RAM (2048 bytes) through Direct or
Register-Indirect addressing.
– Internal RAM: bytes 0 to 127; may be addressed
directly/indirectly.
– Internal RAM: bytes 128 to 255; share their address
location with the SFRs and so may only be addressed
indirectly as data RAM.
– AUX-RAM: bytes 0 to 1791; can only be addressed
indirectly via MOVX.
• Special Function Registers through direct addressing at
address locations 128 to 255 (see Fig.7).
• External Data Memory through Register-Indirect
addressing.
• Program Memory look-up tables through Base-Register
plus Index-Register-Indirect addressing.
The P8xCE560 has six 8-bit ports. Ports 0 to 3 are the
same as in the 80C51, with the exception of the additional
functions of Port 1. The parallel I/O function of Port 4 is
equal to that of Ports 1, 2 and 3. All ports are bidirectional
with the exception of Port 5 which is only a parallel input
port.
Ports 0, 1, 2, 3, 4 and 5 perform the following alternative
functions:
Port 0 Provides the multiplexed low-order address and
data bus used for expanding the P8xCE560 with
standard memories and peripherals.
Port 1 Is used for a number of special functions:
• 4 capture inputs (or external interrupt request
inputs if capture information is not utilized)
• external counter input
• external counter reset input.
Port 2 Provides the high-order address bus when the
P8xCE560 is expanded with external Data Memory
and / or the P8xCE560 executes from external
Program Memory.
Port 3 Pins can be configured individually to provide:
• External interrupt request inputs
• Counter inputs
• Receiver input and transmitter output of serial
port SIO 0 (UART)
• Control signals to read and write external Data
Memory.
Port 4 Can be configured to provide signals indicating a
match between timer/counter T2 and its compare
registers.
Port 5 May be used in conjunction with the ADC interface.
Unused analog inputs can be used as digital inputs.
As Port 5 lines may be used as inputs to the ADC,
these digital inputs have an inherent hysteresis to
prevent the input logic from drawing too much
current from the power lines when driven by analog
signals. Channel-to-channel crosstalk should be
taken into consideration when both digital and
analog signals are simultaneously input to Port 5
(see Chapter 21).
A pin of which the alternative function is not used may be
used as normal bidirectional I/O. The generation or use of
a Port 1, Port 3 or Port 4 pin as an alternative function is
carried out automatically by the P8xCE560 provided the
associated Special Function Register bit is set HIGH.
The SDA and SCL lines serve the serial port SI01
2
C-bus). Because the I2C-bus may be active while the
(I
device is disconnected from VDD, these pins are provided
with open-drain drivers.
Figure 8 shows the pull-up arrangements of Ports 1 to 4;
Transistor ‘p1’ is turned on for 2 oscillator periods after Q
makes a HIGH-to-LOW transition. During this time, ‘p1’
also turns on ‘p3’ through the inverter to form an additional
pull-up.
handbook, full pagewidth
from port latch
read port pin
input data
2 oscillator
periods
Q
strong pull-up
INPUT
BUFFER
Fig.8 I/O buffers in the P8xCE560 (Port 1 to Port 4).
1997 Aug 0116
V
DD
p2
p1
n
p3
I/O PIN
I1
MLC926 - 1
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
10 PULSE WIDTH MODULATED OUTPUTS
The P8xCE560 contains two Pulse Width Modulated
(PWM) output channels (see Fig.9). These channels
generate pulses of programmable length and interval.
The repetition frequency is defined by an 8-bit prescaler
PWMP, which supplies the clock for the counter.
The prescaler and counter are common to both PWM
channels. The 8-bit counter counts modulo 255, i.e., from
0 to 254 inclusive. The value of the 8-bit counter is
compared to the contents of two registers: PWM0 and
PWM1.
Provided the contents of either of these registers is greater
than the counter value, the corresponding
PWM0 or
PWM1 output is set LOW. If the contents of these registers
are equal to, or less than the counter value, the output will
be HIGH. The pulse-width-ratio is therefore defined by the
contents of the registers PWM0 and PWM1.
255
255
255
to
⁄
and
255
.
The pulse-width-ratio is in the range of0⁄
may be programmed in increments of1⁄
Buffered PWM outputs may be used to drive DC motors.
The rotation speed of the motor would be proportional to
the contents of PWMn. The PWM outputs may also be
configured as a dual DAC.
In this application, the PWM outputs must be integrated
using conventional operational amplifier circuitry. If the
resulting output voltages have to be accurate, external
buffers with their own analog supply should be used to
buffer the PWM outputs before they are integrated.
This gives a repetition frequency range of 123 Hz to
31.4 kHz (at f
= 16 MHz). By loading the PWM registers
clk
with either 00H or FFH, the PWM channels will output a
constant HIGH or LOW level, respectively. Since the 8-bit
counter counts modulo 255, it can never actually reach the
value of the PWM registers when they are loaded with
FFH.
When a compare register (PWM0 or PWM1) is loaded with
a new value, the associated output is updated
immediately. It does not have to wait until the end of the
current counter period. Both PWMn output pins are driven
by push-pull drivers. These pins are not used for any other
purpose.
handbook, full pagewidth
PWM0
I
N
T
E
R
N
A
L
B
U
S
f
clk
PRESCALER
PWMP
8-BIT COMPARATOR
8-BIT COUNTER1/2
8-BIT COMPARATOR
PWM1
Fig.9 Functional diagram of Pulse Width Modulated outputs.
OUTPUT
BUFFER
OUTPUT
BUFFER
PWM0
PWM1
MGA154
1997 Aug 0117
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
10.1Prescaler Frequency Control Register (PWMP)
Reading PWMP gives the current reload value. The actual count of the prescaler cannot be read.
Table 7 Prescaler Frequency Control Register (address FEH)
76543210
PWMP.7PWMP.6PWMP.5PWMP.4PWMP.3PWMP.2PWMP.1PWMP.0
Table 8 Description of PWMP bits
BITSYMBOLDESCRIPTION
7 to 0PWMP.7 to PWMP.0Prescaler division factor. The Prescaler division factor = (PWMP) + 1.
• Bit oriented 8-bit scan-select register to select analog
inputs
• Continuous scan or one time scan configurable from
1 to 8 analog inputs
• Start of a conversion by software or with an external
signal
• Eight 10-bit buffer registers, one register for each analog
input channel
• Interrupt request after one channel scan loop
• Programmable prescaler (dividing by 2, 4, 6, 8) to adapt
to different system clock frequencies
• Conversion time for one analog-to-digital conversion:
15 to 50 µs
• Differential non-linearity (DL
): ±1 LSB
e
• Integral non-linearity (ILe): ±2 LSB
• Offset error (OSe): ±2 LSB
• Gain error (Ge): ±4%
• Absolute voltage error (Ae): 3 LSB
• Channel-to-channel matching (M
): ±1 LSB
ctc
• Crosstalk between analog inputs (Ct): < 60 dB at
100 kHz
• Monotonic and no missing codes
• Separated analog (V
DDA,VSSA
) and digital (VDD,VSS)
supply voltages
• Reference voltage at two special pins: V
V
ref(p)(A)
.
ref(n)(A)
and
For information on the ADC characteristics, refer to
Chapter 21.
11.2 ADC functional description
The P8xCE560 has a 10-bit successive approximation
ADC with 8 multiplexed analog input channels, comprising
a high input impedance comparator, DAC (built with
1024 series resistors and analog switches), registers and
control logic. Input voltage range is from V
(typical 0 V) to V
ref(p)(A)
(typical +5 V).
ref(n)(A)
Each of the set of 8 buffer registers (10-bit wide) store the
conversion results of the proper analog input channel.
Eleven Special Function Registers (SFRs) perform the
user software interface to the ADC; see Table 14 for an
overview of the ADC SFRs. In order to have a minimum of
ADC service overhead in the microcontroller program, the
ADC is able to operate autonomously within its user
configurable autoscan function.
Figure 10 shows the functional diagram of the ADC.
11.3ADC timing
A programmable prescaler is controlled by the user
selectable bits ADPR1 and ADPR0 in SFR ADCON to
adapt the conversion time for different microcontroller
clock frequencies.
Table 13 shows conversion times (t
ADC
) for one
analog-to-digital conversion at some convenient system
clock frequencies (f
) and ADC programmable prescaler
clk
divisors: m.
Conversion time t
A conversion time t
=(6×m + 1) machine cycles.
ADC
consists of one sample time period
ADC
(which equals two bit conversion times), 10 bit conversion
time periods and one machine cycle to store the result.
After result storage an extra initializing time period follows
to select the next analog input channel (according to the
contents of SFR ADPSS), before the input signal is
sampled.Thus the time period between two adjacent
conversions within an autoscan loop is larger than the pure
time t
. This autoscan cycle time is (7 × m) machine
ADC
cycles.
At the start of an autoscan conversion the time between
writing to SFR ADCON and the first analog input signal
sampling depends on the current prescaler value (m) and
the relative time offset between this write operation and the
internal (divided) ADC clock. This gives a variation range
for the analog-to-digital conversion start time of (1⁄2× m)
machine cycles.
Table 13 Conversion time configuration examples
m
ADC
(µs) at f
CLK
:
t
6 MHz8 MHz12 MHz16 MHz
226.0019.5013.00
(1)
9.75
(1)
450.0037.5025.0018.75
674.00
898.00
(1)
(1)
55.50
73.50
(1)
(1)
37.0027.75
49.0036.75
Note
1. Prohibited t
15 µs ≤ t
ADC
values; for t
ADC
≤ 50 µs, the specified ADC
outside the limits of
ADC
characteristics are not guaranteed.
1997 Aug 0119
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
handbook, full pagewidth
COMPARATOR
ADC0
ADC7
V
ref(p)(A)
V
ref(n)(A)
V
DDA1
V
SSA1
to
ANALOG
MULTIPLEXER
DAC
SAR
10
10
10
ADEXS
SCAN LOGIC
ADPSS
8
Read ADRSH
8
INTERNAL BUS
Fig.10 Functional diagram of ADC.
11.4ADC configuration and operation
Every analog-to-digital conversion is an autoscan
conversion. The two user selectable general operation
modes are continuous scan and one-time scan mode.
The desired analog input port channel(s) for conversion
is(are) selected by programming analog-to-digital input
port scan-select bits in SFR ADPSS. An analog input
channel is included in the autoscan loop if the
corresponding bit in SFR ADPSS is logic 1, a channel is
skipped if the corresponding bit in SFR ADPSS is logic 0.
An autoscan is always started according to the lowest bit
position of SFR ADPSS that contains a logic 1.
An autoscan conversion is started by setting the flag
ADSST in register ADCON either by software or by an
external start signal at input pin ADEXS, if enabled.
8 x 10-BIT RESULT
REGISTERS
2
2 LATCHESADCON
Read ADRSLn
2
8
8
MBH080
Either no edge (external start totally disabled), a rising
edge or/and a falling edge of ADEXS is selectable for
external conversion start by the bits ADSRE and ADSFE
in register ADCON.
After completion of an analog-to-digital conversion the
10-bit result is stored in the corresponding 10-bit buffer
register. Then the next analog input is selected according
to the next higher set bit position in ADPSS, converted and
stored, and so on.
When the result of the last conversion of this autoscan loop
is stored, the ADC interrupt flag ADINT (SFR ADCON), is
set. It is not cleared by interrupt hardware - it must be
cleared by software.
1997 Aug 0120
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
In continuous scan mode (ADCSA = 1; ADCON.2) the
ADC start and status flag ADSST (ADCON.3) retains the
set state and the autoscan loop restarts from the
beginning. In one-time scan mode (ADCSA = 0)
conversions stop after the last selected analog input was
converted, ADINT (ADCON.4) is set and ADSST is
cleared automatically.
ADSST cannot be set (neither externally nor by software)
as long as ADINT = 1, i.e. as long as ADINT is set, a new
conversion start - by setting flag ADSST - is inhibited;
actually it is only delayed until ADINT is cleared. If a logic 1
is written to ADSST while ADINT = 1, this new value is
internally latched and preserved, not setting ADSST until
ADINT = 0. In this state, a read of SFR ADCON will display
ADSST = 0, because always the effective ADC status is
read.
Note that under software control the analog inputs can also
be converted in arbitrary order, when one-time scan mode
is selected and in SFR ADPSS only one bit is set at a time.
In this case ADINT is set and ADSST is cleared after every
conversion.
11.5ADC during Idle and Power-down mode
The analog-to-digital converter is active only when the
microcontroller is in normal operating mode. If the Idle or
Power-down mode is activated, then the ADC is switched
off and put into a power saving idle state - a conversion in
progress is aborted, a previously set ADSST flag is cleared
and the internal clock is halted. The conversion result
registers are not affected.
The interrupt flag ADINT will not be set by activation of Idle
or Power-down mode. A previously set flag ADINT will not
be cleared by the hardware. (Note: ADINT cannot be
cleared by hardware at all, except for a reset - it must be
cleared by the user software.)
After a wake-up from Idle or Power-down mode a set flag
ADINT indicates that at least one autoscan loop was
finished completely before the microcontroller was put into
the respective power reduction mode and it indicates that
the stored result data may be fetched now - if desired.
For further information on Idle and Power-down modes,
refer to Chapter 15.
11.6 ADC resolution and characteristics
The ADC system has its own analog supply pins V
and V
. It is referenced by two special reference
SSA1
DDA1
voltage input pins sourcing the resistance ladder of the
DAC: V
and V
ref(n)(A)
ref(p)(A)
and V
. The voltage between V
ref(n)(A)
defines the full-scale range. Due to the 10-bit
ref(p)(A)
resolution the full scale range is divided into 1024 unit
steps.
The unit step voltage is 1 LSB, which is typically 5 mV
(V
ref(p)(A)
= 5.12 V, V
ref(n)(A)
=0 V=V
SSA1
).
The DAC's resistance ladder has 1023 equally spaced
taps, separated by a unit resistance ‘R’.
The first tap is located 0.5 × R above V
is located 1.5 × R below V
. This results in a total
ref(p)(A)
ref(n)(A)
, the last tap
ladder resistance of 1024 × R. This structure ensures that
the DAC is monotonic and results in a symmetrical
quantization error. For input voltages between:
• V
ref(n)(A)
and [V
+1⁄2× LSB] the 10-bit conversion
ref(n)(A)
result code will be 0000000000B (= 000H or 0D)
• [V
−3⁄2× LSB] and V
ref(p)(A)
the 10-bit conversion
ref(p)(A)
result code will be 1111111111B (= 3FFH or 1023D).
The result code corresponding to an analog input voltage
(V
The analog input voltage should be stable when it is
sampled for conversion. At any times the input voltage
slew rate must be less than 10 V/ms (5 V conversion
range) in order to prevent an undefined result.
This maximum input voltage slew rate can be ensured by
an RC low pass filter with R = 2.2 kΩ and C = 100 nF.
The capacitor between analog input pin and analog
ground pin shall be placed close to the pins in order to
have maximum effect in minimizing input noise coupling.
11.7ADC after reset
After a reset of the microcontroller the ADCON and
ADPSS registers are initialized to zero. Registers ADRSLn
and ADRSH are not initialized by a reset.
1997 Aug 0121
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
11.8ADC Special Function Registers
Table 14 ADC Special Function Registers overview
The SFRs are not bit addressable. For more information on Special Function Registers refer to Section 8.2.
ADDRESSNAMER/W
86HADRSL0R−ADC Result Registers Low Byte: ADRSL0 to ADRSL7; The read value
96HADRSL1
A6HADRSL2
B6HADRSL3
C6HADRSL4
D6HADRSL5
E6HADRSL6
F6HADRSL7
F7HADRSHR00HADC Result Register High Bits: one common result SFR for the upper
E7HADPSSR/W00HADC Input Port Scan-Select Register. Contains control bits to select the
D7HADCONR/W00HADC Control Register. Contains control and status bits for the
C7HP5R−Digital Input Port Register; shared with analog inputs. P5 is not affected by
11.8.1ADC R
The binary result code of the analog-to-digital conversions is accessed by the ADC Result Registers:
• ADRSLn (ADRSL0 to ADRSL7); eight input channel related conversion result SFRs for the 8 result lower bytes. Each
of ADRSLn is associated with the indexed analog input channel ADCn (ADC0/P5.0 to ADC7/P5.7).
• ADRSH for the ADC; one general SFR for the 2 result upper bits (bit 9 and 8).
ESULT REGISTERS
RESET
VALUE
DESCRIPTION
after reset is indeterminate. Their data are not affected by chip reset.
2 result bits.
analog input channel(s) to be scanned for analog-to-digital conversion.
analog-to-digital converter peripheral block.
chip reset.
During read (by software) of the ADRSLn register, simultaneously the two highest bits of the 10-bit conversion result are
copied into the two latches, ADRSH.0 and ADRSH.1 (SFR ADRSH) preserving them until the next read of any ADRSLn
register. Thus to ensure that the 10-bit result of the same single analog-to-digital conversion is captured, first read the
ADRSLn register and then the ADRSH register.
Table 15 ADC Result Register Low Byte; ADRSLn; n = 0 to 7 (address see 86H to F6H)
Table 17 ADC Result Register High Bits; ADRSH (address F7H)
76543210
000000ADRSn.9ADRSn.8
Table 18 Description of ADRSH bits
BITSYMBOLDESCRIPTION
7to2−The upper 6 bits ADRSH.2 to ADRSH.7 are always read as a logic 0.
1 to 0ADRSn.9 to ADRSn.8ADC result upper 2 bits.
11.8.2ADC I
Table 19 ADC Input Port Scan-Select Register (address E7H)
76543210
ADPSS7ADPSS6ADPSS5ADPSS4ADPSS3ADPSS2ADPSS1ADPSS0
Table 20 Description of ADPSS bits
BITSYMBOLDESCRIPTION
7 to 0ADPSS7
11.8.3ADC C
Table 21 ADC Control Register (address D7H)
76543210
ADPR1ADPR0ADPOSADINTADSSTADCSAADSREADSFE
NPUT PORT SCAN-SELECT REGISTER (ADPSS)
Control bits to select the analog input channel(s) to be scanned for
to
ADPSS0
ONTROL REGISTER (ADCON)
analog-to-digital conversion. If all bits ADPSS0 to ADPSS7 = 0, then no conversion can
be started. If ADPSS is written while an analog-to-digital conversion is in progress
(ADSST = 1; ADCON.3) then the autoscan loop with the previous selected analog
inputs is completed first. The next autoscan loop is performed with the new selected
analog inputs. For each individual bit position ADPSSn (n = 0 to 7):
• If ADPSSn = 0, then the corresponding analog input is skipped in the autoscan loop
• If ADPSSn = 1, then the corresponding analog input is included in the autoscan loop.
Table 22 Description of ADCON bits
BITSYMBOLDESCRIPTION
7ADPR1These two bits determine the value of the prescaler divisor (m); see Table 23.
6ADPR0
5ADPOSADPOS is reserved for future use. Must be a logic 0 if ADCON is written.
4ADINTADC interrupt. This flag is set when all selected analog inputs are converted (both in
continuous scan and in one-time scan mode). An interrupt is invoked if this interrupt flag
is enabled. ADINT must be cleared by software. It cannot be set by software.
1997 Aug 0123
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
BITSYMBOLDESCRIPTION
3ADSSTADC start and status. Setting this bit by software or by hardware (via ADEXS input)
starts the analog-to-digital conversion of the selected analog inputs. ADSST stays a
logic 1 in continuous scan mode. In one-time scan mode, ADSST is cleared by
hardware when the last selected analog input channel has been converted. As long as
ADSST = 1, new start commands to the ADC-block are ignored. An analog-to-digital
conversion in progress is aborted if ADSST is cleared by software.
2ADCSAADCSA =1 results in a continuous scan of the selected analog inputs after a start of an
analog-to-digital conversion. ADCSA = 0 results in an one-time scan of the selected
analog inputs after a start of an analog-to-digital conversion.
1ADSREIf ADSRE = 1, then a rising edge at input ADEXS will start the analog-to-digital
conversion and generate a capture signal. If ADSRE = 0, then a rising edge at input
ADEXS has no effect.
0ADSFEIf ADSFE = 1, then a falling edge at input ADEXS will start the analog-to-digital
conversion and generate a capture signal. If ADSFE = 0, then a falling edge at input
ADEXS has no effect.
Table 23 Prescaler selection
ADPR1ADPR0PRESCALER DIVISOR (m)
002 (default by reset)
014
106
118
11.8.4D
Digital Input Port Register (P5) is shared with analog inputs. P5 is not affected by chip reset. SFR P5 always represents
the binary value of the logic level at input pins P5.0/ADC0 to P5.7/ADC7. Reading P5 does not affect analog-to-digital
conversions. But it is recommended to use the digital input port function of the hardware Port 5 only as an alternative to
analog input voltage conversions. Simultaneous mixed operation is discouraged to guarantee a reliable and accurate
ADC result. For more information on P5 refer to Chapter 9.
Table 24 Digital Input Port Register (address C7H)
Table 25 Description of P5 bits
IGITAL INPUT PORT REGISTER (P5)
76543210
P5.7P5.6P5.5P5.4P5.3P5.2P5.1P5.0
BITSYMBOLDESCRIPTION
7 to 0P5.7 to P5.0Binary value of the logic level at input pins P5.0/ADC0 to P5.7/ADC.7.
1997 Aug 0124
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
12 TIMERS/COUNTERS
The P8xCE560 contains,
• Three 16-bit timer/event counters:
Timer 0, Timer 1 and Timer T2
• One 8-bit timer, T3.
12.1Timer 0 and Timer 1
Timer 0 and Timer 1 may be programmed to carry out the
following functions:
• Measure time intervals and pulse durations
• Count events
• Generate interrupt requests.
Timers 0 and 1 each have a control bit in SFR TMOD that
selects the timer or counter function of the corresponding
timer.
In the timer function, the register is incremented every
machine cycle. Thus, one can think of it as counting
machine cycles. Since a machine cycle consists of
12 oscillator periods, the count rate is
1
⁄12× the oscillator
frequency.
In the counter function, the register is incremented in
response to a HIGH-to-LOW transition at the
corresponding external input pin, T0 or T1. In this function,
the external input is sampled during S5P2 of every
machine cycle. When the samples show a HIGH in one
cycle and a LOW in the next cycle, the counter is
incremented. Thus, it takes two machine cycles
(24 oscillator periods) to recognize a HIGH-to-LOW
transition. There are no restrictions on the duty cycle of the
external input signal. To ensure that a given level is
sampled at least once before it changes, it should be held
for at least one full machine cycle.
Timer 0 and Timer 1 can be programmed independently to
operate in one of four modes:
Mode 0 8-bit timer or 8-bit counter each with divide-by-32
prescaler.
Mode 1 16-bit time-interval or event counter.
Mode 2 8-bit time-interval or event counter with automatic
reload upon overflow.
Mode 3 Timer 0: one 8-bit time-interval or event counter
and one 8-bit time-interval counter.
Timer 1: stopped.
When Timer 0 is in Mode 3, Timer 1 can be programmed
to operate in Modes 0, 1 or 2 but cannot set an interrupt
request flag or generate an interrupt. However, the
overflow from Timer 1 can be used to pulse the serial port
baud rate generator. With a 16 MHz crystal, the counting
frequency of these timers/counters is as follows:
• In the timer function, the timer is incremented at a
frequency of 1.33 MHz (
1
⁄12× the system clock
frequency)
• When programmed for external inputs: 0 to 660 kHz
(1⁄24× the system clock frequency).
Both internal and external inputs can be gated to the
counter by a second external source for directly measuring
pulse durations. When configured as a counter, the
register is incremented on every falling edge on the
corresponding input pin T0 or T1. The earliest moment, the
incremented register value can be read is during the
second machine cycle following the machine cycle within
which the incrementing pulse occurred.
The counters are started and stopped under software
control. Each one sets its interrupt request flag when it
overflows from all HIGHs to all LOWs (or automatic reload
value), with the exception of Mode 3 as previously
described.
1997 Aug 0125
Philips SemiconductorsProduct specification
8-bit microcontrollerP8xCE560
12.1.1TIMER/COUNTER MODE CONTROL REGISTER (TMOD)
Table 26 Timer/Counter Mode Control Register (address 89H)
76543210
GATEC/TM1M0GATEC/TM1M0
Table 27 Description of TMOD bits for Timer 1 and Timer 0
Timer 0: bit TMOD.0 to TMOD.3; Timer 1: bit TMOD.4 to TMOD.7; n = 0, 1.
BITSYMBOLDESCRIPTION
7 and 3GATEGating control. When set T imer/counter ‘n’ is enabled only while
control bit TRn (TR1 or TR0) is set. When cleared Timer ‘n’ is enabled whenever TRn
control bit is set.
6 and 2C/TTimer or Counter Selector. Cleared for Timer operation; input from internal system
clock. Set for Counter operation; input from pin Tn (T1 or T0).
5 and 1M1Timer 0, Timer 1 mode select; see Table 28.
4 and 0M0
INTn pin is HIGH and
Table 28 Timer 0, Timer 1 mode select
M1M0OPERATING
00Timer TL0/TL1 serves as 5-bit prescaler.
0116-bit Timer/Counter TH0/TH1 and TL0/TL1 are cascaded; there is no prescaler.
108-bit auto-reload Timer/Counter TH0/TH1 holds a value which is to be reloaded into
TL0/TL1 each time it overflows.
11Timer 0: TL0 is an 8-bit Timer/Counter controlled by the standard Timer 0 control bits.
TH0 is an 8-bit timer only controlled by Timer 1 control bits.
11Timer 1: Timer/Counter 1 stopped.
12.1.2T
Table 29 Timer/Counter Control Register (address 88H)
Table 30 Description of TCON bits
IMER/COUNTER CONTROL REGISTER (TCON)
76543210
TF1TR1TF0TR0IE1IT1IE0IT0
BITSYMBOLDESCRIPTION
7 and 5TF1 and TF0 Timer 1 and Timer 0 overflow flag. Set by hardware on Timer/Counter overflow.
Cleared by hardware when processor vectors to interrupt routine.
6 and 4TR1 and TR0 Timer 1 and Timer 0 run control bit. Set/cleared by software to turn Timer/Counter
on/off.
3 and 1IE1 and IE0Interrupt 1 and Interrupt 0 edge flag. Set by hardware when external interrupt edge
detected. Cleared when interrupt processed.
2 and 0IT1 and IT0Interrupt 1 and Interrupt 0 type control bit. Set/cleared by software to specify falling
edge/low level triggered external interrupts.
1997 Aug 0126
Loading...
+ 58 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.