• One additional 16-bit timer/counter coupled to four
capture and three compare registers
• 10-bit ADC with 8 multiplexed analog inputs
• Two 8-bit resolution Pulse Width Modulated outputs
• 15 interrupt sources with 2 priority levels
(2 to 6 external interrupt sources possible)
• Five 8-bit I/O ports, plus one 8-bit input port shared with
analog inputs
• CAN-controller (CAN = Controller Area Network)
with DMA data transfer facility to internal RAM
• 1 Mbit/s CAN-controller with bus failure management
facility
•1⁄2AVDD reference voltage
• Full-duplex UART compatible with the standard 80C51
• On-chip Watchdog Timer (WDT)
• 1.2 to 16 MHz clock frequency
• Improved Electromagnetic Compatibility (EMC).
2GENERAL DESCRIPTION
The P8xCE598 is a single-chip 8-bit high-performance
microcontroller with on-chip CAN-controller, derived from
the 80C51 microcontroller family.
It uses the powerful 80C51 instruction set.
Figure 1 shows a block diagram of the P8xCE598.
The P8xCE598 is manufactured in an advanced CMOS
process, and is designed for use in automotive and
general industrial applications. In addition to the 80C51
standard features, the device provides a number of
dedicated hardware functions for these applications.
Two versions of the P8xCE598 will be offered:
• P80CE598 (without ROM)
• P83CE598 (with ROM)
Hereafter these versions will be referred to as P8xCE598.
The temperature range includes (max. f
= 16 MHz):
CLK
•−40 to +85 °C version, for general applications
•−40 to +125 °C version for automotive applications.
The P8xCE598 combines the functions of P8XC552
(microcontroller) and the PCA82C200 (Philips
CAN-controller) with the following enhanced features:
• 32 kbytes Program Memory
• 2 × 256 bytes Data Memory
• DMA between CAN Transmit/Receive Buffer and
internal RAM.
The main differences to the P8xC552 microcontroller are:
• 32 kbytes programmable ROM (P8xC552 has 8 kbytes)
• Additional 256 bytes RAM
• A CAN-controller instead of the I2C-serial interface.
2.1Electromagnetic Compatibility (EMC)
Primary attention is paid to the reduction of
electromagnetic emission of the microcontroller
P8xCE598. The following features reduce the
electromagnetic emission and additionally improve the
electromagnetic susceptibility:
• One analog part power supply pin (AV
) and one
DD
analog part ground pin (AVSS), placed as a pair of pins
on one side of the package (see Fig.3), providing power
supply (+5V) and ground for ADC, CAN receiver and
reference voltage.
• Four digital part supply voltage pins (V
four digital part ground pins (V
SS1
to V
to V
DD1
SS4
DD4
) are provided
) and
on the package. These pins, one VDD and one VSS as a
pair of pins are placed on each of the four sides of the
package to provide:
–V
DD1/VSS1
for internal logic (CPU, Timers/counters,
Memory, CAN, UART, ADC)
–V
DD2/VSS2
for Port 1, Port 3 and Port 4, and PWM0
and PWM1 outputs
–V
–V
DD3/VSS3
DD4/VSS4
for the on-chip oscillator
for the Port 0, Port 2, ALE output and
PSEN output.
• External capacitors should be connected across
associated V
DDx
and V
pins (i.e. V
SSx
DD1
and V
SS1
).
Lead length should be as short as possible. Ceramic
chip capacitors are recommended (100 nF).
• One CAN supply voltage pin (CVDD) and one CAN
ground pin (CVSS) as a pair of pins placed on one side
of the package providing (digital part) power supply
(+5V) and ground for the CAN transmitter outputs.
• Internal decoupling capacitance improves the EMC
radiation behaviour and the EMC immunity.
1996 Jun 273
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
2.2Recommendation on ALE
For application that require no external memory or
temporarily no external memory: the ALE output signal
(pulses at a frequency of1⁄6f
software control (bit 5 in PCON SFR: ‘RFI’); 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 as a
normal MOVX.
3ORDERING INFORMATION
TYPE
NUMBER
Without ROM
P80CE598FFB
P80CE598FHB
With ROM
P83CE598FFB
P83CE598FHB
NAMEDESCRIPTIONVERSION
QFP80
QFP80
) can be disabled under
OSC
PACKAGE
plastic quad flat package; 80 leads (lead
length 1.95 mm); body 14 × 20 × 2.7 mm;
high stand-off height
plastic quad flat package; 80 leads (lead
length 1.95 mm); body 14 × 20 × 2.7 mm;
high stand-off height
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 (
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.
Table 1 Pin description for single function pins (SOT318-1 and SOT351-1; see note 1)
SYMBOL PINDESCRIPTION
V
DD1
V
DD2
V
DD3
V
DD4
STADC15 Start ADC operation. Input starting analog-to-digital conversion (note 2). This pin must not float.
PWM016 Pulse width modulation output 0.
PMW117 Pulse width modulation output 1.
EW18Enable Watchdog Timer (WDT): enable for T3 Watchdog Timer and disable Power-down mode.
RST30 Reset: input to reset the P8xCE598 (note 3).
CV
SS
CV
DD
XTAL251 Crystal pin 2: output of the inverting amplifier that forms the oscillator.
XTAL152 Crystal pin 1: input to the inverting amplifier that forms the oscillator, and input to the internal clock
V
SS1
V
SS2
V
SS3
V
SS4
PSEN63 Program Store Enable: Read strobe to external Program Memory (active LOW).
ALE64Address Latch Enable: latches the Low-byte of the address during accesses to external memory
EA65 External Access input. See note 5.
REF78
CRX179 Inputs from the CAN-bus line to the differential input comparator of the on-chip CAN-controller
CRX080
AV
REF−
AV
REF+
AV
SS
AV
DD
n.c.23,
14 Power supply, digital part: for internal logic (CPU, Timers/counters, Memory, CAN, UART, ADC).
28 Power supply, digital part: for Port 1, Port 3, Port 4, PWM0 and PWM1 outputs.
53 Power supply, digital part: for the on-chip oscillator.
76 Power supply, digital part: for Port 0, Port 2, ALE output and PSEN output.
This pin must not float.
37 Ground potential for the CAN transmitter outputs.
40 Power supply (+5V) for the CAN transmitter outputs.
When an external clock oscillator is used this pin is left open-circuit.
generator. Receives the external clock oscillator signal, when an external oscillator is used.
13 Ground, digital part: for internal logic (CPU, Timers/Counters, Memory, CAN, UART, ADC).
29 Ground, digital part: for Port 1, Port 3 and Port 4, and PWM0 and PWM1 outputs.
54 Ground, digital part: for the on-chip oscillator.
77 Ground, digital part: for the Port 0, Port 2, ALE output and PSEN output.
Drive: 8 × LSTTL inputs.
(note 4). Drive: 8 × LSTTL inputs; handles CMOS inputs without an external pull-up.
1
⁄2AVDD reference voltage output respectively input (note 6).
(note 7).
1Low-end of ADC (analog-to-digital conversion) reference resistor.
2High-end of ADC (analog-to-digital conversion) reference resistor (note 8).
3Ground, analog part. For ADC, CAN receiver and reference voltage.
4Power supply, analog part (+5 V). For ADC, CAN receiver and reference voltage.
No connection.
49,
50,
66,
67
Notes
1. To avoid a ‘latch up’ effect at power-on: VSS− 0.5 V < ‘voltage on any pin at any time’ < VDD+ 0.5 V.
2. Triggered by a rising edge. ADC operation can also be started by software.
3. RST also provides a reset pulse as output when timer T3 overflows or after a CAN wake-up from Power-down.
1996 Jun 278
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
4. ALE is activated every six oscillator periods. During an external data memory access one ALE pulse is skipped.
5. See Section 7.1, Table 3 for EA operation. For P83CE598 microcontrollers specified with the option ‘ROM-code
protection’, the EA pin is latched during reset and is ‘don't care’ after reset, regardless of whether the ROM-code
protection is selected or not.
6. Pin 78, REF:
a) Selection of input respectively output dependent of CAN Control Register bit 5 (CR.5; see Section 13.5.3
Table 32).
b) If the internal reference is used, then REF should be connected to AVSS via a capacitor with a value of ≥ 10 nF.
c) After an external reset (RST = HIGH) the internal1⁄2AVDD source is activated and, REF is a reference output.
d) If the CAN-controller is in the reset state, e.g. after an external reset, then the1⁄2AVDD source is switched off
during Power-down mode.
7. CAN Bus line:
a) CRX0 level > CRX1 level is interpreted as a logic 1 (recessive).
b) CRX0 level < CRX1 level is interpreted as a logic 0 (dominant).
8. The level of AV
must be higher than that of AV
REF+
REF−
.
Table 2 Pin description for pins with alternative functions (SOT318-2 and SOT351-1; see note 1)
SYMBOL
DEFAULTALTERNATIVE
Port 4
P4.0 to P4.719 to 22, 24 to 27 8-bit quasi-bidirectional I/O port.
CMSR019Compare and Set/Reset outputs for TimerT2.
CMSR120
CMSR221
CMSR322
CMSR424
CMSR525
CMT026Compare and toggle outputs for TimerT2.
CMT127
Port 1
P1.0 to P1.731 to 36, 38 to 39 8-bit quasi-bidirectional I/O port.
P2.0 to P2.755 to 628-bit quasi-bidirectional I/O port.
A08 to A15High-order address byte for external memory.
Port 0 (Sink/source: 8 × LSTTL inputs)
P0.7 to P0.068 to 758-bit open drain bidirectional I/O port.
AD7 to AD0Multiplexed Low-order address and Data bus for
PINDESCRIPTION
external memory.
Port 5
P5.7 to P5.05 to 128-bit input port.
ADC7 to ADC08 input channels to ADC.
Notes
1. To avoid a ‘latch up’ effect at power-on: VSS− 0.5 V < ‘voltage on any pin at any time’ < VDD+ 0.5 V.
2. If the CAN-controller is in the reset state (e.g. after a power-up reset; CAN Control Register bit CR.0; see
Section 13.5.3 Table 32, the CAN transmitter outputs are floating and the pins P1.6 and P1.7 can be used as
open-drain port pins. After a power-up reset the port data is HIGH, leaving the pins P1.6 and P1.7 floating.
1996 Jun 2710
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
6FUNCTIONAL DESCRIPTION
The P8xCE598 functions will be described as shown in the
following overview:
• Memory organization
• I/O Port structure
• Pulse Width Modulated outputs
• Analog-to-Digital Converter
• Timers/Counters
• Serial I/O Ports
• Interrupt system
• Power reduction modes
• Oscillator circuitry
• Reset circuitry
• Instruction Set
• EMC (see Section 2.1).
handbook, full pagewidth
64K
7MEMORY ORGANIZATION
The Central Processing Unit (CPU) manipulates operands
in three memory spaces (see Fig.4) as follows:
• 32 kbytes internal, resp. 64 kbytes external Program
Memory
• 512 bytes internal Data Memory MAIN- and AUXILIARY
RAM.
• Up to 64 kbytes external Data Memory
(with 256 bytes residing in the internal AUXILIARY
RAM).
64K
32767
0
EXTERNAL
32768
INTERNAL
(EA = 1)
PROGRAM MEMORY
EXTERNAL
(EA = 0)
OVERLAPPED SPACE
255
INDIRECT ONLY
127
DIRECT AND
INDIRECT
0
MAIN RAM
INTERNAL DATA MEMORY
Fig.4 Memory map.
SFRs
AUXILIARY
RAM
MLB230
256
EXTERNAL
DATA MEMORY
1996 Jun 2711
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
7.1Program Memory
The Program Memory of the P8xCE598 consists of 32 kbytes ROM on-chip, externally expandible up to 64 kbytes.
Table 3 Instruction fetch controlled by
EA (note 1)
PIN
DURING RESET
LATCHED TO:
H−internal Program Memory (note 2)0000H → 7FFFH
H−external Program Memory8000H → FFFFH
L−0000H → FFFFH
−‘don’t care’−−
Notes
1. This implementation prevents reading of the internal program code by switching from external Program Memory
during a MOVC instruction.
2. By setting a security bit the internal Program Memory content is protected, which means it cannot be read out.
If the security bit has been set to LOW there are no restrictions for the MOVC instruction.
7.2Internal Data Memory
The internal Data Memory is physically built-up and accessible as shown in Table 4 (see Fig.5).
Table 4 Internal Data Memory size and address mode
INTERNAL
DATA MEMORY
MAIN RAM
(note 1)
AUXILIARY RAM
(note 2)
SFRs (note 3)128 bytes128 to 255X−−
AFTER RESET
SIZELOCATION
256 bytes0 to 127XXAddress pointers are R0 and R1 of the
256 bytes0 to 255−XAddress pointers are R0 and R1 of the
EA
INSTRUCTIONS FETCHED FROM:
ADDRESS MODE
DIRECT INDIRECT
128 to 255−X
ADDRESS
LOCATION
POINTERS
selected register bank.
selected register bank and the DPTR.
Notes
1. MAIN RAM can be addressed directly and indirectly as in the 80C51.
2. AUXILIARY RAM (0 to 255):
a) Is indirectly addressable in the same way as the external Data Memory with MOVX instructions.
b) Access will not affect the ports P0, P2, P3.6 and P3.7 during internal program execution.
3. SFRs = Special Function Registers.
1996 Jun 2712
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
7.2.1MAIN RAM
Four 8-bit register banks occupy the lower RAM area,
• BANK 0: location 0 to 7
• BANK 1: location 8 to 15
• BANK 2: location 16 to 23
• BANK 4: location 24 to 31.
Only one of these banks may be enabled at the same time.
The next 16 bytes, locations 32 through 45, contains
128 directly addressable bit locations.
The stack can be located anywhere in the internal Main
RAM address space. The stack depth is only limited by the
internal RAM space available. All registers except the
program counter and the four 8-bit register banks reside in
the SFR address space.
7.3External Data Memory
An access to external Data Memory locations higher than
255 will be performed with the MOVX @DPTR instructions
in the same way as in the 80C51 structure,
i.e.with P0 and P2 as data/address bus and P3.6 and P3.7
as Write and Read strobe signals.
Note that these external Data Memory locations cannot be
accessed with R0 or R1 as address pointer.
The P8xCE598 has six 8-bit parallel ports: Port 0 to Port 5. In addition to the standard 8-bit parallel ports, the I/O facilities
also include a number of special I/O lines. The use of a Port 1, Port 3 or Port 4 pins as an alternative function is carried
out automatically provided the associated SFR bit is set HIGH.
Table 5 Default Port functions
PORT TYPEFUNCTIONREMARKS
Port 0I/OThe same as in the 80C51Except for the additional functions of P1.6 and
Port 1I/O
Port 2I/O
Port 3I/O
Port 4I/OParallel I/O portParallel I/O function is identical to Port1, 2 and 3.
Port 5IParallel input port with an input function onlyMay be used as normal inputs if the ADC function
Table 6 Alternative Port functions
P1.7.
is inoperative.
PORT TYPEFUNCTIONREMARKS
Port 0I/OMultiplexed Low-order address and
Data bus for external memory (AD7 to AD0)
Port 1I/OCapture timer inputs for Timer T2
(CT0I to CT3I), or
External interrupt request inputs
(INT2 to INT5)
T2 event input (T2)External counter input.
T2 timer reset input (RT2)External counter reset input.
CAN transmitter output 0 (CTX0)CTX0 and CTX1 outputs of the CAN interface
CAN transmitter output 1 (CTX1)
Port 2I/OHigh-order address byte for external memory
(A08 to A15)
Port 3I/OSerial Input Port (RXD)Receiver input of serial port SIO0 (UART).
Serial Output Port (TXD)Transmitter output of serial port SIO0 (UART).
External interrupt (
External interrupt (
Timer 0 external input (T0)Counter inputs.
Timer 1 external input (T1)
External data memory Write strobe (
External data memory Read strobe (
Port 4I/OCompare and Set/Reset outputs
(CMSR0 to CMSR5)
Compare and toggle outputs (CMT0, CMT1)
Port 5IInput channels to ADC (ADC7 to ADC0)Port 5 may be used in conjunction with the ADC
INT0)External interrupt request inputs.
INT1)
WR)Control signal to write to external Data Memory.
RD)Control signal to read from external Data Memory.
Provides the multiplexed Low-order address and
data bus used for expanding the P8xCE598 with
standard memories and peripherals.
External interrupt request inputs, if capture
information is not utilized.
(note 1).
Port 2 provides the High-order address bus when
the P8xCE598 is expanded with external Program
Memory and/or external Data Memory.
Can be configured to provide signals indicating a
match between Timer counter T2 and its compare
registers.
interface (note 2).
1996 Jun 2716
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
Notes to the Alternative Port functions
1. Port lines P1.6 and P1.7 may be selected as CTX0 and CTX1 outputs of the serial port SIO1 (CAN).
After reset P1.6 and P1.7 may be used as normal I/O ports, if the CAN interface is not used.
2. 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 20).
handbook, full pagewidth
from port latch
input data
read port pin
2 oscillator
periods
Q
strong pull-up
INPUT
BUFFER
Fig.8 I/O buffers in the P8xCE598 (P1.0 to P1.5, Ports 2, 3, and 4).
9PULSE WIDTH MODULATED OUTPUTS (PWM)
Two Pulse Width Modulated (PWM) output channels are
available with the P8xCE598. These channels provide
output pulses of programmable length and interval.
The repetition frequency is defined by an 8-bit prescaler
PWMP which generates the clock for the counter.
Both 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 output of PWM0 or PWM1 is
set LOW. If the contents of these register 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 register PWM0 and PWM1. The pulse-width-ratio is in
When using an oscillator frequency of 16 MHz, for
example, the above formula would give a repetition
frequency range of 123 Hz to 31.4 kHz.
By loading the PWM registers with either 00H or FFH, the
PWM outputs can be retained at a constant HIGH or LOW
level respectively. When loading FFH to the PWM
registers, the 8-bit counter will never actually reach this
(FFH) value.
Both output pins
PWMn are driven by push-pull drivers,
and are not shared with any other function.
1996 Jun 2717
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
9.1Prescaler frequency control register (PWMP)
Table 7 Prescaler frequency control register (address FEH)
Fig.9 Functional diagram of Pulse Width Modulated outputs.
10 ANALOG-TO-DIGITAL CONVERTER (ADC)
The analog input circuitry consists of an 8-input analog
multiplexer and an ADC with 10-bit resolution. The analog
reference voltage and analog power supplies are
connected via separate input pins. The conversion takes
50 machine cycles i.e. 37.5 µs at 16 MHz oscillator
frequency. The input voltage swing is from 0 V to AVDD.
The ADC is controlled using the ADCON control register.
Register bits ADCON.0 to ADCON.2 select the input
channels of the analog multiplexer (see Fig.10).
The completion of the 10-bit analog-to-digital conversion is
flagged by ADCI in the ADCON register and the result is
stored in the SFR ADCH (upper 8-bits) and the 2 lower bits
(ADC.1 and ADC.0) in register ADCON.
An analog-to-digital conversion in progress is unaffected
by an external or software ADC start. The result of a
completed conversion remains unchanged provided
ADCI = HIGH. While ADCI or ADCS are HIGH, a new ADC
START will be blocked and consequently lost. An
analog-to-digital conversion already in progress is aborted
when the Idle or Power-down mode is entered.
8-BIT COMPARATOR
8-BIT COUNTER1/2
8-BIT COMPARATOR
PWM1
OUTPUT
BUFFER
OUTPUT
BUFFER
PWM0
PWM1
MGA154
The result of a completed conversion (ADCI = HIGH)
remains unaffected during the Idle mode.
The LOW-to-HIGH transition of STADC is recognized at
the end of a machine cycle and the conversion
commences at the beginning of the next cycle. When a
conversion is initiated by software, the conversion starts at
the beginning of the machine cycle following the
instruction that sets ADCS.
The next two machine cycles are used to initiate the
converter. At the end of this first cycle, the ADCS status
flag is set to HIGH while the conversion is in progress.
Sampling of the analog input commences at the end of the
second cycle.
During the next eight machine cycles, the voltage at the
previously selected pin of Port 5 is sampled and this input
voltage should be stable in order to obtain a useful sample.
In any case, the input voltage slew rate must be less than
10 V/ms (5 V conversion range) in order to prevent an
undefined result. The conversion takes four machine
cycles per bit.
1996 Jun 2719
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
10.1ADC Control register (ADCON)
Table 13 ADC Control register (address C5H)
76543210
ADC.1ADC.0ADEXADCIADCSAADR2AADR1AADR0
Table 14 Description of the ADCON bits
BITSYMBOLFUNCTION
7ADC.1Bit 1 of ADC converted value.
6ADC.0Bit 0 of ADC converted value.
5ADEXEnable external start of conversion by STADC. If ADEX is:
LOW, then conversion cannot be started externally by STADC (only by software by
setting ADCS)
HIGH, then conversion can be started externally by a rising edge on STADC or
externally.
4ADCIADC interrupt flag. This flag is set when an analog-to-digital conversion result is ready
to be read.
If enabled, an interrupt is invoked. The flag must be cleared by software.
It cannot be set by software (see Table 15).
3ADCSADC start and status. Setting this bit starts an analog-to-digital conversion. It may be
set by software or by the external signal STADC. The ADC logic ensures that this signal
is HIGH while the ADC is busy. On completion of the conversion, ADCS is reset at the
same time the interrupt flag ADCI is set. ADCS can not be reset by software (see
Table 15).
2AADR2Analog input select. This binary coded address selects one of the eight analog port
1AADR1
0AADR0
pins of P5 to be input to the converter. It can only be changed when ADCI and ADCS
are both LOW. AADR2 is the MSB (e.g. 100B selects the analog input channel ADC4).
Table 15 ADCI and ADCS operating modes
If ADCI is cleared by software while ADCS is set at the same time a new analog-to-digital conversion with the same
channel-number may be started. It is recommended to reset ADCI before ADCS is set.
ADCIADCSOPERATION
00ADC not busy, a conversion can be started.
01ADC busy, start of a new conversion is blocked.
1X (don’t care)Conversion completed (note 1).
Note
1. Start of a new conversion requires ADCI = 0.
1996 Jun 2720
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
andbook, full pagewidth
ADC0
ADC1
ADC2
ADC3
ADC4
ADC5
ADC6
ADC7
ANALOG INPUT
MULTIPLEXER
ADCON
10-BIT A/D
CONVERTER
1234567012345670
INTERNAL BUS
Fig.10 Functional diagram of analog input.
STADC
analog reference
supply (analog part)
ground (analog part)
ADCH
MGA155
1996 Jun 2721
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
11 TIMERS/COUNTERS
The P8xCE598 contains:
• Three 16-bit timer/event counters:
Timer 0, Timer 1 and Timer 2
• One 8-bit timer, T3 (Watchdog WDT).
11.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.
Timer 0 and Timer 1 can be programmed independently to
operate in 3 modes:
Mode 0 8-bit timer or 8-bit counter each with divide-by-32
prescaler.
Mode 1 16-bit timer-interval or event counter.
Mode 2 8-bit timer-interval or event counter with
automatic reload upon overflow.
Timer 0 can be programmed to operate in an additional
mode as follows:
Mode 3 one 8-bit time-interval or event counter and one
8-bit timer-interval counter.
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
flag or generate an interrupt. However, the overflow from
Timer 1 can be used to pulse the Serial Port baud-rate
generator.
The frequency handling range of these counters with a
16 MHz crystal is as follows:
• In the timer function, the timer is incremented at a
frequency of 1.33 MHz (
1
⁄12 of the oscillator frequency)
• 0 Hz to an upper limit of 0.66 MHz (1⁄24 of the oscillator
frequency) when programmed for external inputs.
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, when 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.
11.2Timer T2 Capture and Compare Logic
Timer T2 is a 16-bit timer/counter which has capture and
compare facilities (see Fig.11).
The 16-bit timer/counter is clocked via a prescaler with a
programmable division factor of 1, 2, 4 or 8. The input of
1
the prescaler is clocked with
⁄12 of the oscillator
frequency, or by an external source connected to the T2
input, or it is switched off. The maximum repetition rate of
the external clock source is1⁄12f
, twice that of Timer 0
CLK
and Timer 1. The prescaler is incremented on a rising
edge. It is cleared if its division factor or its input source is
changed, or if the timer/counter is reset.
T2 is readable ‘on the fly’, without any extra read latches;
this means that software precautions have to be taken
against misinterpretation at overflow from least to most
significant byte while T2 is being read. T2 is not loadable
and is reset by the RST signal or at the positive edge of the
input signal RT2, if enabled. In the Idle mode the
timer/counter and prescaler are reset and halted.
T2 is connected to four 16-bit Capture Registers: CT0,
CT1, CT2 and CT3. A rising or falling edge on the inputs
CT0I, CT1I, CT2I or CT3I (alternative function of Port 1)
results in loading the contents of T2 into the respective
Capture Registers and an interrupt request.
Using the Capture Register CTCON, these inputs may
invoke capture and interrupt request on a positive edge, a
negative edge or on both edges. If neither a positive nor a
negative edge is selected for capture input, no capture or
interrupt request can be generated by this input.
The contents of the Compare Registers CM0, CM1 and
CM2 are continually compared with the counter value of
Timer T2. When a match occurs, an interrupt may be
invoked. A match of CM0 sets the bits 0 to 5 of Port 4, a
CM1 match resets these bits and a CM2 match toggles bits
6 and 7 of Port 4, provided these functions are enabled by
the STE/RTE registers. A match of CM0 and CM1 at the
same time results in resetting bits 0 to 5 of Port 4. CM0,
CM1 and CM2 are reset by the RST signal.
Port 4 can be read and written by software without
affecting the toggle, set and reset signals. At a byte
overflow of the least significant byte, or at a 16-bit overflow
of the timer/counter, an interrupt sharing the same
interrupt vector is requested. Either one or both of these
overflows can be programmed to request an interrupt.
All interrupt flags must be reset by software.
1. Interrupt Enable IEN1 is used to enable/disable Timer 2 interrupts (see Section 14.1.2).
2. Interrupt Priority Register IP1 is used to determine the Timer 2 interrupt priority (see Section 14.1.4).
11.2.4S
Table 24 Set Enable register (address EEH)
Table 25 Description of the STE bits (see notes 1 and 2)
ET ENABLE REGISTER (STE)
76543210
TG47TG46SP45SP44SP43SP42SP41SP40
BITSYMBOLFUNCTION
7TG47if HIGH then P4.7 is reset on the next toggle, if LOW P4.7 is set on the next toggle.
6TG46if HIGH then P4.6 is reset on the next toggle, if LOW P4.6 is set on the next toggle.
5SP45if HIGH then P4.5 is set on a match of CM0 and T2.
4SP44if HIGH then P4.4 is set on a match of CM0 and T2.
3SP43if HIGH then P4.3 is set on a match of CM0 and T2.
2SP42if HIGH then P4.2 is set on a match of CM0 and T2.
1SP41if HIGH then P4.1 is set on a match of CM0 and T2.
0SP40if HIGH then P4.0 is set on a match of CM0 and T2.
Notes
1. If STE.n is LOW then P4.n is not affected by a match of CM0 and T2 (n = 0, 1, 2, 3, 4, 5).
7TP47if HIGH then P4.7 toggles on a match of CM2 and T2.
6TP46if HIGH then P4.6 toggles on a match of CM2 and T2.
5RP45if HIGH then P4.5 is reset on a match of CM1 and T2.
4RP44if HIGH then P4.4 is reset on a match of CM1 and T2.
3RP43if HIGH then P4.3 is reset on a match of CM1 and T2.
2RP42if HIGH then P4.2 is reset on a match of CM1 and T2.
1RP41if HIGH then P4.1 is reset on a match of CM1 and T2.
0RP40if HIGH then P4.0 is reset on a match of CM1 and T2.
Note
1. If RTE.n is LOW then P4.n is not affected by a match of CM1 and T2 or CM2 and T2.
For more information, refer to the 8051-based
“8-bit Microcontrollers Data Handbook IC20”
.
1996 Jun 2726
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
11.3Watchdog Timer (T3)
In addition to Timer T2 and the standard timers (Timer 0
and Timer 1), a Watchdog Timer (WDT) comprising an
11-bit prescaler and an 8-bit timer (T3) is also provided
(see Fig.12).
The timer T3 is incremented every 1.5 ms, derived from
the oscillator frequency of 16 MHz by the following
f
formula:
f
timer
=
------------------------- 12 2048×
CLK
When a timer T3 overflow occurs, the microcontroller is
reset and a reset-output-pulse is generated at pin RST.
This short output pulse (3 machine cycles) may be
suppressed if the RST pin is connected to a capacitor.
To prevent a system reset (by an overflow of the WDT), the
user program has to reload T3 within periods that are
shorter than the programmed Watchdog time interval.
If the processor suffers a hardware/software malfunction,
the software will fail to reload the timer. This failure will
produce a reset upon overflow thus preventing the
processor running out of control.
The Watchdog Timer can only be reloaded if the condition
flag WLE = PCON.4 has been previously set by software.
At the moment the counter is loaded the condition flag is
automatically cleared.
The timer interval between the timer's reloading and the
occurrence of a reset depends on the reloaded value. For
example, this may range from 1.5 ms to 0.375 s when
using an oscillator frequency of 16 MHz.
In the Idle state the Watchdog Timer and reset circuitry
remain active.
The Watchdog Timer (WDT) is controlled by the Enable
Watchdog pin (
Table 28
EW); see Table 28.
EW controlling WDT and Power-down mode
PIN EWWDTPOWER-DOWN MODE
LOWenableddisabled
HIGHdisabledenabled
handbook, full pagewidth
1/12 f
CLK
EW
INTERNAL BUS
PRESCALER
11-BIT
write
T3
TIMER T3 (8-BIT)
LOADCLEAR
LOADEN
CLEAR
WLEPD
PCON.4
INTERNAL BUS
Fig.12 Functional diagram of T3 Watchdog Timer.
overflow
internal
reset
LOADEN
PCON.1
V
DD
P
RST
R
RST
MGA157
1996 Jun 2727
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
12 SERIAL I/O PORT: SIO0 (UART)
The Serial Port SIO0 is a full duplex (UART) serial I/O port
i.e. it can transmit and receive simultaneously. This Serial
Port is also receive-buffered. It can commence reception
of a second byte before the previously received byte has
been read from the receive register. However, if the first
byte has still not been read by the time reception of the
second byte is complete, one of these (first or second)
bytes will be lost. The SIO0 receive and transmit registers
are both accessed via the S0BUF SFR. Writing to S0BUF
loads the transmit register, and reading S0BUF accesses
to a physically separate receive register. SIO0 can operate
in 4 modes:
Mode 0 Serial data is transmitted and received through
RXD. TXD outputs the shift clock. 8 data bits are
transmitted/received (LSB first). The baud rate is
fixed at1⁄12 of the oscillator frequency.
Mode 1 10 bits are transmitted via TXD or received
through RXD: a start bit (0), 8 data bits (LSB first),
and a stop bit (1). On receive, the stop bit is put
into RB8 of the S0CON SFR. The baud rate is
variable.
Mode 2 11 bits are transmitted through TXD or received
through RXD: a start bit (0), 8 data bits (LSB first),
a programmable 9th data bit, and a stop bit (1).
On transmit, the 9th data bit (TB8 in S0CON) can
be assigned the value of 0 or 1. With nominal
software, TB8 can be the parity bit (P in PSW).
During a receive, the 9th data bit is stored in RB8
(S0CON), and the stop bit is ignored. The baud
rate is programmable to either1⁄32 or1⁄64 of the
oscillator frequency.
Mode 3 11 bits are transmitted through TXD or received
through RXD: a start bit (0), 8 data bits (LSB first),
a programmable 9th data bit, and a stop bit (1).
Mode 3 is the same as Mode 2 except for the
baud rate which is variable in Mode 3.
In all four modes, transmission is initiated by any
instruction that writes to the S0BUF SFR.
Reception is initiated in Mode 0 when RI = 0 and REN = 1.
In the other three modes, reception is initiated by the
incoming start bit provided that REN = 1.
Modes 2 and 3 are provided for multiprocessor
communications. In these modes, 9 data bits are received
with the 9th bit written to RB8 (S0CON). The 9th bit is
followed by the stop bit. The port can be programmed so
that with receiving the stop bit, the Serial Port interrupt will
be activated if, and only if RB8 = 1.
This feature is enabled by setting bit SM2 in S0CON. This
feature may be used in multiprocessor systems.
For more information about how to use the UART in
combination with the registers S0CON, PCON, IE, SBUF
and the Timer register, refer to the 8051-based
“8-bit Microcontrollers Data Handbook IC20”
13 SERIAL I/O PORT: SIO1 (CAN)
SIO1 (CAN) provides the CAN (Controller Area Network)
serial-bus data communication interface. SIO1 (CAN)
replaces the SIO1 (I
microcontroller derivative P8xC552.
13.1On-chip CAN-controller
CAN is the definition of a high performance
communication protocol for serial data communication.
The P8xCE598 on-chip CAN-controller is a full
implementation of the CAN 2.0A protocol. With the
P8xCE598 powerful local networks can be built, both for
automotive and general industrial environments. This
results in a much reduced wiring harness and enhanced
diagnostic and supervisory capabilities.
13.2CAN Features
• Multi-master architecture
• Bus access priority determined by the message
identifier
• 2032 message identifier (2
• Guaranteed latency time for high priority messages
• Powerful error handling capability
• Data length from 0 up to 8 bytes
• Multicast and broadcast message facility
• Non destructive bit-wise arbitration
• Non-return-to-zero (NRZ) coding/decoding with
bit-stuffing
• Programmable transfer rate (up to 1 Mbit/s)
• Programmable output driver configuration
• Suitable for use in a wide range of networks including
the SAE's network classes A, B and C
• DMA providing high-speed on-chip data exchange
• Bus failure management facility
•1⁄2AVDD reference voltage.
2
C) serial interface as provided in the
11
standard frame CAN 2.0A)
.
1996 Jun 2728
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
13.3Interface between CPU and CAN
The internal interface between the P8xCE598's CPU and
on-chip CAN-controller is achieved via the following four
SFRs (see Fig.13):
• CANADR, to point to a register of the CAN-controller
• CANDAT, to read or write data
• CANCON, to read interrupt flags and to write commands
• CANSTA, to read status information and to write DMA
pointer.
Additionally, the DMA-logic allows a high-speed data
exchange between the CAN-controller and the CPU's
on-chip Main RAM. For more information, see
Section 13.5.15 “Handling of the CPU-CAN interface”.
13.4Hardware blocks of the CAN-controller
The P8xCE598 CAN-controller contains all necessary
hardware for high performance serial network
communications (see Fig.14 and Table 29).
It controls the communication flow through the area
network using the CAN-protocol. The CAN-controller
meets the following requirements:
• Short message length
• Bus access priority, determined by the message
identifier
• Powerful error handling capability
• Configuration flexibility to allow area network expansion
• Guaranteed latency time for urgent messages;
– The latency time defines the period between the
initiation (Transmission Request) and the start of the
transmission on the bus. The latency time strongly
depends on a large variety of bus-related conditions.
In the case of a message being transmitted on the
bus and one distortion, the latency time can be up to
149 bit times (worst case). For more information see
Chapter 22, “CAN application information”.
handbook, full pagewidth
CPU
MAIN
RAM
internal
bus
4 special function
registers
CANADR
CANDAT
CANCON
CANSTA
DMA bus
DBH
DAH
D9H
D8H
DMA
LOGIC
ADDRESS
DATA
CAN
CONTROLLER
MGA158
Fig.13 Interface between CPU and CAN-controller.
1996 Jun 2729
Philips SemiconductorsProduct specification
8-bit microcontroller with on-chip CANP8xCE598
handbook, full pagewidth
address
data
INTERFACE
MANAGEMENT
LOGIC
TRANSMIT
BUFFER
ON - CHIP
RECEIVE
BUFFER 0
RECEIVE
BUFFER 1
BIT TIMING
LOGIC
TRANSCEIVER
LOGIC
CAN
CONTROLLER
ERROR
MANAGEMENT
LOGIC
BIT STREAM
PROCESSOR
2
2
MGA159
CRX0
and
CRX1
CTX0
and
CTX1
Fig.14 Block diagram of the P8xCE598 on-chip CAN-controller.
Table 29 Hardware blocks of the CAN-controller (see Fig.14)
NAMEBLOCKDESCRIPTION
Interface Management Logic IMLInterprets commands from the CPU, allocates the message buffers
(TBF, RBF0 and RBF1) and provides interrupts and status information to the
microcontroller.
Transmit BufferTBF10 bytes memory into which the CPU writes messages which are to be
transmitted over the CAN network.
Receive Buffers (0 and 1)RBF0RBF0 and RBF1 are each 10 bytes memories which are alternatively used to
RBF1
store messages received from the CAN network.
The CPU can process one message while another is being received.
Bit Stream ProcessorBSPIs a sequencer, controlling the data stream between the Transmit Buffer,
Receive Buffers (parallel data) and the CAN-bus (serial data).
Bit Timing LogicBTLSynchronizes the CAN-controller to the bitstream on the CAN-bus.
Transceiver Control LogicTCLControls the output driver.
Error Management LogicEMLPerforms the error confinement according to the CAN-protocol.
1996 Jun 2730
Loading...
+ 78 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.