– Non-page oriented instructions
– Direct addressing
– Four 8-byte RAM register banks
– Stack depth limited only by available internal RAM
(maximum 256 bytes)
– Multiply, divide, subtract and compare instructions
• Modes of reduced activity: Power-down and Idle modes
SZF2002
• Wake-up via external interrupts at
• Frequency range: up to 16 MHz (only limited by external
memory and ADC performance)
• Supply voltage: 3.0 V
• Very low power consumption:
operational 0.65 mW/MHz; Idle 0.25 mW/MHz at 3.0 V
• Operating temperature: −40 to +85 °C.
2GENERAL DESCRIPTION
The SZF2002 low power system controller is
manufactured in an advanced 0.5 µm CMOS technology.
The instruction set of the SZF2002 is based on that of the
80C51 and consists of over 100 instructions: 49 one-byte,
46 two-byte, and 16 three-byte. The device has low power
consumption and two software selectable modes for
power reduction: Idle and Power-down.
This data sheet details the specific properties of the
SZF2002; for details of the 80C51 core and peripheral
functions such as timers, UART and I/O, see
“Data Handbook IC20”
I2C-bus and how to use it”
9398 393 40011.
3APPLICATIONS
The SZF2002 is an 8-bit general purpose microcontroller
especially suited for wireless telephone and battery
powered applications. The SZF2002 also functions as an
arithmetic processor having facilities for both binary and
BCD arithmetic plus bit-handling capabilities.
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
5BLOCK DIAGRAM
INT2 to INT8
INT0
INT1
PROGRAM
CPU
XCLK
RST
CE
OE
T0T1
TWO 16-BIT
TIMER/
EVENT
COUNTERS
(T0, T1)
V
DD
MEMORY
6-KBYTE
ROM
V
SS
33
DATA
MEMORY
6144 + 256
bytes RAM
V
PWM
PWMADC
V
DDA
SSA
SZF2002
ADC0 to ADC5
WE
RAMCE
EA
DEBUG
D0 to D7
A0 to A17
excluding
ROM/RAM
PARALLEL
I/O PORTS
AND
EXT. BUS
80C51
core
SERIAL
UART
PORT
RXDTXDP3P1
8-BIT
I/O
PORTS
P4
SZF2002
16-BIT
TIMER/
EVENT
COUNTER
T2
T2EX
I2C-BUS
INTERFACE
SDASCL
WATCHDOG
TIMER
(T3)
MGM180
(1) Address lines A0 to A5 have alternative functions during Debug; see Section 7.2.
Fig.1 Block diagram.
1998 Aug 264
Page 5
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
6FUNCTIONAL DIAGRAM
handbook, full pagewidth
XCLK
WE
OE
CE
PWM
V
SSA
V
DDA
V
V
DD
SS
3
3
0
0
PORT 1
PORT 3
T2 INT2
T2EX INT3
SCL
SDA
RXD
TXD
INT0
INT1
T0
T1
INT4
INT5
INT6
INT7
INT8
SZF2002
RAMCE
PORT 4
DEBUG
ADC0
ADC1
ADC2
ADC3
ADC4
ADC5
RST
EA
SZF2002
0
data bus
00
address bus
RD
WR
ALE
PSEN
RST
TRUE_A15
MGM181
Fig.2 Functional diagram.
1998 Aug 265
Page 6
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
7PINNING INFORMATION
7.1Pinning
handbook, full pagewidth
n.c.
A12
A7
A6
A5
A4
PWM
RST
XCLK
V
DD
V
SS
P3.7
P3.6
P3.5/T1
P3.4/T0
P3.3/INT1
P3.2/INT0
P3.1/TXD
P3.0/RXD
n.c. 20
n.c.
A15
A16
WE
A17
A14
A13
A8
80
79
78
77
76
75
74
73
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
A9
VSSVDDA11
72
71
SZF2002
SZF2002
OE
A10
CE
D7
D6
D5
D4
n.c.
70
69
68
67
66
65
64
63
62
61
60
n.c.
D3
59
D2
58
D1
57
D0
56
A0
55
A1
54
A2
53
A3
52
V
51
SS
V
50
DD
P4.0/RAMCE
49
P4.1
48
P4.2
47
P4.3
46
P4.4
45
P4.5
44
P4.6
43
P4.7
42
n.c.
41
21
22
23
24
25
26
27
28
29
30
n.c.
P1.7/SDA
P1.6/INT8/SCL
P1.5/INT7
P1.4/INT6
P1.3/INT5
P1.2/INT4
P1.1/INT3/T2EX
V
P1.0/INT2/T2
Fig.3 Pin configuration.
1998 Aug 266
DDA
31
SSA
V
32
ADC5
33
ADC4
34
ADC3
35
ADC2
36
ADC1
37
ADC0
38
EA
39
40
n.c.
DEBUG
MGM182
Page 7
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
7.2Pin description
Table 1 LQFP80 package
SYMBOLPINDESCRIPTION
Program memory interface; note 1
A055A0/
A154A1/
A253A2/ALE. Address line 2, used as ALE during Debug.
A352A3/
A46A4/RST. Address line 4, used as RST during Debug.
A55A5/TRUE_A15. Address line 5, used as A15 = P2.7 during Debug.
A64A6. Address line 6 (not needed during Debug, see D6).
A73A7. Address line 7 (not needed during Debug, see D7).
A873Address lines A8 to A14. During Debug these lines are used as P2.0 to P2.6.
A972
A1067
A1169
A122
A1374
A1475
A1579Address lines A15 to A17. Page selection; during Debug these lines are the page
A1678
A1776
D056Data bus. During Debug these line are P0.0 to P0.7.
D157
D258
D359
D462
D563
D664
D765
CE66Chip Enable. Enable strobe to external program memory.
OE68Output Enable. Output read strobe to external memory.
WE77Write Enable. Write strobe to external memory.
RD. Address line 0, used as RD during Debug.
WR. Address line 1, used as WR during Debug.
PSEN. Address line 3, used as PSEN during Debug.
register. Each bank is 32 kbytes.
1998 Aug 267
Page 8
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
SYMBOLPINDESCRIPTION
I/O Ports
INT2/T229Port 1 (P1.0 to P1.7). 8-bit bidirectional I/O port with internal pull-ups; INT2 to INT8:
P1.0/
P1.1/
INT3/T2EX28
P1.2/
INT427
P1.3/
INT526
INT625
P1.4/
P1.5/
INT724
P1.6/
INT8/SCL23
P1.7/SDA22
P3.0/RXD19Port 3 (P3.0 to P3.7). 8-bit bidirectional I/O port with internal pull-ups; RXD: serial
P3.1/TXD18
P3.2/INT017
P3.3/
Port 1 pins that have logic 1s written to them are pulled HIGH by the internal pull-ups,
and in that state can be used as inputs (note P1.6 and P1.7 are open-drain only).
As inputs, Port 1 pins that are externally pulled LOW will source current
(IIL, see Chapter 25) due to the internal pull-ups.
port receiver data input (asynchronous); TXD: serial port transmitter data output
(asynchronous);
T0: Timer 0 external input; T1: Timer 1 external input.
Port 3 pins that have logic 1s written to them are pulled HIGH by the internal pull-ups,
and in that state can be used as inputs. As inputs, Port 3 pins that are externally pulled
LOW will source current (IIL, see Chapter 25) due to the internal pull-ups.
RAM.
Port 4 pins that have logic 1s written to them are pulled HIGH by the internal pull-ups,
and in that state can be used as inputs. As inputs, Port 4 pins that are externally pulled
LOW will source current (IIL, see Chapter 25) due to the internal pull-ups.
ADC037Input channels to the ADC.
ADC136
ADC235
ADC334
ADC433
ADC532
1998 Aug 268
Page 9
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
SYMBOLPINDESCRIPTION
General
PWM7Pulse Width Modulation output.
RST8Reset. A HIGH level on this pin for at least 12 clock cycles resets the device.
XCLK9Clock input.
EA38External Access. When EA is HIGH the CPU executes out of internal program
memory (unless the program counter exceeds 7FFFH). A LOW EA forces the CPU to
execute out of external memory regardless of the value of the Program Counter. This
signal is latched at the falling edge of reset (RST pin). The EA pin has an internal
pull-down. When it is not connected the CPU executes from external memory.
DEBUG39DEBUG enable. If HIGH, forces standard 80C51 timing signals output at address and
databus. In this mode the databus is multiplexed with the lower 8 bits of the address
Power
V
DD
bus, and the A0 to A3 lines are used for the
allows a standard 80C51 in-circuit emulator to be connected. For normal operation
connect DEBUG to VSS.
10, 50,70Power supply digital core and digital I/O pads.
RD, WR, ALE and PSEN signals. This
V
SS
V
DDA
V
SSA
n.c.1, 20,
Note
1. The pin layout has been optimized for easy connection of 256 kbytes Flash ROM (e.g. ATMEL AT29LV010A,
SGS-Thomson M28V201, or AMD Am29F010).
11, 51,71Ground: circuit ground potential.
30Analog power.
31Analog ground.
Not connected.
21, 40,
41, 60,
61, 80
1998 Aug 269
Page 10
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
8FUNCTIONAL DESCRIPTION
Detailed descriptions of each function are described in:
The SZF2002 is a stand-alone high-performance CMOS
microcontroller designed for use in real-time applications
such as wireless telephone and mobile communications,
instrumentation, industrial control, intelligent computer
peripherals and consumer products.
The device provides hardware features, architectural
enhancements and new instructions to function as a
controller for applications requiring up to 256 kbytes of
program memory and/or up to 6144 + 256 bytes of on-chip
data memory.
SZF2002
The SZF2002 contains a 6-kbyte program memory; a
static 6144 + 256 byte data memory (RAM); 24 I/O lines;
three 16-bit timer/event counters; a fifteen-source two
priority-level, nested interrupt structure, a 6-channel 8-bit
ADC, a Watchdog Timer and a Pulse Width Modulation
output.
Two serial interfaces are provided on-chip:
• A standard UART serial interface
2
• A standard I
of up to 400 kbits/s (depending on clock frequency).
The I2C-bus serial interface has byte oriented master
and slave functions allowing communication with the
whole family of I2C-bus compatible devices.
The device has two software selectable modes of reduced
activity for power reduction:
• Idle mode: freezes the CPU while allowing the
derivative functions (timers, serial I/O, RAM,
ADC and PWM) and interrupt system to continue
functioning
• Power-down mode: saves the RAM contents but stops
the clock causing all other chip functions to be
inoperative.
8.2CPU timing
A machine cycle consists of a sequence of 6 states. Each
state lasts one clock period, thus a machine cycle takes
6 clock periods or 1 µs if the clock frequency (f
6 MHz.
C-bus serial interface with a transfer speed
) is
clk
1998 Aug 2610
Page 11
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
9MEMORY ORGANIZATION
The SZF2002 has 6 kbytes of program memory plus
6 kbytes + 256 bytes of data memory on chip. The device
has separate address spaces for program and data
memory (see Fig.4).
The SZF2002 can directly address up to 256 kbytes of
external data memory. The CPU generates the read
strobe (OE), the write strobe (WE) and chip select (CE) for
external program memory (Flash), and read strobe (OE)
and write strobe (WE) and chip select (RAMCE) for
external data memory.
9.1Program memory
The SZF2002 contains 6 kbytes of internal ROM and
6144 + 256 bytes of RAM. The lower 6 kbytes of program
memory can be implemented in either on-chip ROM or
external program memory. The 6 kbytes of program
memory is implemented as mask programmable ROM.
There are two modes for the program memory, depending
on the state of the
address range:
1. EA = 0. All program fetches are directed to the
external program memory. After reset the CPU begins
execution at location 8000H.
2. EA = 1. After reset the CPU begins execution at
location 0000H. Fetches from addresses
2000H to 37FFH are redirected to the Auxiliary RAM.
The processor can fill this RAM with normal write
operations to the data memory (MOVX to addresses
0000H to 17FFH). Program memory fetches from
addresses 0000H to 17FFH are directed to the
internal ROM.
Program Counter values greater than 7FFFH are
automatically addressed to external memory regardless of
the state of the EA pin.
9.2Data memory
The SZF2002 contains 6144 + 256 bytes of RAM and a
number of Special Function Registers (SFRs). All these
data spaces are addressed differently. Figure 4 shows the
internal data memory space divided into the lower
128 bytes, the upper 128 bytes, Auxiliary RAM, and the
SFRs space. Internal RAM locations 0 to 127 are directly
and indirectly addressed. Internal RAM locations
128 to 255 are only indirectly addressed.
EA pin (latched during reset) and on the
SZF2002
The Special Function Register locations 128 to 255 are
only directly addressed. Auxiliary RAM is accessible via
MOVX instructions to the lower 32-kbyte address space.
MOVX @R0/R1 instructions use SFR P2 as page
selector. The upper 32-kbyte address space is redirected
to the program memory, to accommodate flash
programming.
9.3Special Function Registers (SFRs)
The upper 128 bytes are the address locations of the
SFRs. Figures 6 and 7 show the Special Function
Registers space. The SFRs include the port latches,
timers, peripheral control, serial I/O registers, etc. These
registers are accessed by direct addressing. There are
128 directly addressed locations in the SFR address
space. Bit addressed SFRs are those that end in 000B.
9.4Addressing
The SZF2002 has five methods for addressing source
operands:
• Register
• Direct
• Indirect
• Immediate
• Base-Register plus Index-Register-Indirect.
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 addressing is as follows:
• Registers in one of the four register banks through Direct
or Indirect (see Fig.5)
• Lower 128 bytes of internal RAM through Direct or
register Indirect; upper 128 bytes of internal RAM
through Indirect
• Special Function Registers through Direct
• Program memory look-up tables through Base-Register
plus Index-Register-Indirect
• Extended data memory access through register Indirect.
1998 Aug 2611
Page 12
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
FFFFH
EXTERNAL
FLASH ROM
(BANKED)
8000H
7FFFH
37FFH
INTERNAL
AUX RAM
6-KBYTE
INTERNAL
ROM
(4)
EA = 1
0000H
EXTERNAL
ROM
BANK 0
EA = 0
2000H
17FFH
0000H
FFFFH
8000H
7FFFH
1800H
17FFH
0000H
EXTERNAL
FLASH ROM
(BANKED)
EXTERNAL
RAM
INTERNAL
AUX RAM
(MOVX)
FFH
80H
00H
INTERNAL
RAM
(1)
(2)
overlapped space
FUNCTION
(3)
REGISTERS
SZF2002
SPECIAL
INTERNAL MEMORYDATA MEMORYPROGRAM MEMORY
(1) Accessible via indirect addressing only.
(2) Accessible via direct and indirect addressing.
(3) Accessible via direct addressing.
(4) Gaps in the address map are undefined, and should not be used.
Fig.4 Memory map.
Table 2 Memory spaces; note 1
MEMORY SPACEADDRESS MODEUSED SIGNAL
Internal RAM 00H to 7FHdirect and indirect−
Internal RAM 80H to FFHindirect−
SFRs 80H to FFHdirect−
Internal AUX RAM (on-chip) 0000H to 17FFHMOVX−
External RAM (off-chip) 1800H to 7FFFHMOVX
External ROM (off-chip) 0000H to FFFFH; note 2program execution
RAMCE, OE and WE
CE, OE
Internal AUX RAM (on-chip) 2000H to 37FFHprogram execution−
External Flash ROM write (off-chip) 8000H to FFFFH; note 2MOVX
CE, OE and WE
Notes
1. Execution from internal memory is only possible when
EA = 1 during reset.
2. Page select is used to access all 8 banks in the 256-kbyte address space.
MGM183
1998 Aug 2612
Page 13
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
9.5Paging logic
The SZF2002 contains paging logic to handle the extended address range.
1. During Debug A<17-15> are used to output the bank register. The TRUE_ A15 line is output at the A5 pin.
2. During Debug ROM and RAM access is done via
BANK SFR [2 : 0]A<17-15> PINSBANKREMARK
PSEN, WR and RD.
handbook, halfpage
R7
R0
R7
R0
R7
R0
R7
R0
7FH
30H
2FH
20H
1FH
18H
17H
10H
0FH
08H
07H
4 banks of 8 registers
0
MGD675
Fig.5 The lower 128 bytes of internal RAM.
(R0 to R7)
1998 Aug 2613
Page 14
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
REGISTER
MNEMONIC
PWMP
PWM
IP1
WDTKEY
B
IX1
IEN1
BIT ADDRESS
FEFFFD FC FB FA F9 F8
F6F7F5 F4 F3 F2 F1 F0
EEEFED EC EB EA E9 E8
DIRECT
BYTE
ADDRESS (HEX)
FFHT3
FEH
FDH
FCH
F8H
F7H
F0H
EFH
EEH
EDH
ECH
EBH
EAH
E9H
E8H
SZF2002
ACC
S1ADR
S1DAT
S1STA
S1CON
PSW
TH2
TL2
RCAP2H
RCAP2L
T2MOD
T2CON
ADCH
ADCON
P4
IRQ1
E6E7E5 E4 E3 E2 E1 E0
DEDFDD DC DB DA D9 D8
D6D7D5 D4 D3 D2 D1 D0
CECFCD CC CB CA C9 C8
C6C7C5 C4 C3 C2 C1 C0
E0H
DBH
DAH
D9H
D8H
D0H
CFH
CEH
CDH
CCH
CBH
CAH
C9H
C8H
C5H
C4H
C1H
C0H
SFRs containing
directly addressable
bits
MGM184
Fig.6 Special Function Register memory map.
1998 Aug 2614
Page 15
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
REGISTER
MNEMONIC
IP0
P3
IEN0
BIT ADDRESS
BE BD BC BB BA B9 B8
B6B7B5 B4 B3 B2 B1 B0
AEAFAD AC AB AA A9 A8
DIRECT
BYTE
ADDRESS
B8H
B0H
AFH
AEH
ADH
ACH
ABH
AAH
A9H
A8H
SZF2002
(used as
address bus)
S0BUF
S0CON
ROMBANK
TMOD
TCON
PCON
(used as
address bus)
P2
P1
TH1
TH0
TL1
TL0
DPH
DPL
SP
P0
A6A7A5 A4 A3 A2 A1 A0
9E9F9D 9C 9B 9A 99 98
969795 94 93 92 9190
8E8F8D 8C 8B 8A 89 88
868785 84 83 8281 80
A0H
9AH
99H
98H
91H
90H
8DH
8CH
8BH
8AH
89H
88H
87H
83H
82H
81H
80H
SFRs containing
directly addressable
bits
MGM185
Fig.7 Special Function Register memory map (continued from Fig.6).
1998 Aug 2615
Page 16
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
10 PROGRAM STATUS WORD (PSW)
The Program Status Word contains several status bits that
reflect the current state of the CPU. The PSW, shown in
Table 4, resides in the SFR memory space. It contains the
Carry bit, the Auxiliary Carry (for BCD operations), the two
register bank select bits, the Overflow flag, a Parity bit and
two user-definable status flags.
The Carry bit, other than serving the function of a Carry bit
in arithmetic operations, also serves as the Accumulator
for a number of boolean operations.
Bits RS0 and RS1 are used to select one of the four
register banks; see Table 5. A number of instructions refer
Table 4 Program Status Word (SFR address D0H)
76543210
CYACF0RS1RS0OVUSRP
Table 5 Description of PSW bits
to these RAM locations as R0 through to R7. The selection
of which of the four register banks is being referred to is
made on the basis of the state of RS0 and RS1 at
execution time.
The Parity bit reflects the number of 1s in the Accumulator:
P = 1, if the Accumulator contains an odd number of 1s,
and P = 0, if the Accumulator contains an even number of
1s. Thus, the number of 1s in the Accumulator plus P is
always even. The bits F0 and USR are uncommitted and
may be used as general purpose status flags.
BITSYMBOLDESCRIPTION
7CYCarry flag. The Carry flag receives carry out from bit 7 of ALU operands.
6ACAuxiliary Carry flag. The Auxiliary Carry flag receives carry out from bit 3 of addition
operands.
5F0General purpose status flag.
4RS1Register Bank Select 1. This bit selects Register Bank 1.
3RS0Register Bank Select 0. This bit selects Register Bank 0.
2OVOverflow flag. This flag is set by arithmetic operations.
1USRUSR. This is a user-definable flag.
0PParity. If the Accumulator contains an odd number of 1s this bit is set to a logic 1 by
hardware. Otherwise, the state of this bit is a logic 0.
1998 Aug 2616
Page 17
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
11 I/O FACILITIES
11.1Ports
The SZF2002 has 24 I/O lines: ports P1, P3 and P4 of
which ports P1 and P3 are bit addressed (P0 and P2 are
always used as address/data bus). Ports 0 to 4 have the
following alternative functions:
Port 0 Used internally.
Port 1 Used for a number of special functions:
• Provides the inputs for the external interrupts:
INT2 to INT8
• The I2C-bus interface: SCL and SDA
• Counter inputs: T2 and T2EX.
Port 2 Used internally.
Port 3 Pins can be configured individually to provide:
• External interrupt request inputs: INT1 and INT0
• Counter input: T1 and T0
• UART input and output: RXD and TXD.
SZF2002
Port 4 Provides chip select for external data memory:
RAMCE.
To enable a port pin alternative function, the port bit latch
in its SFR must contain a logic 1.
Each port consists of a latch (SFRs P0 to P4), an output
driver and input buffer. Ports 1, 3 and 4 have internal
pull-ups (except P1.6 and P1.7). Figure 8 shows that the
strong transistor ‘p1’ is turned on for only 2 clock periods
after a LOW-to-HIGH transition in the port latch. When on,
it turns on ‘p3’ (a weak pull-up) through the inverter. This
inverter and ‘p3’ form a latch which holds the logic 1.
In Port 0 the pull-up ‘p1’ is only on when emitting logic 1s
for external memory access.
11.2Port configuration
The port pins (except for P1.6 and P1.7) are configured as
shown in Fig.8. This is a quasi-bidirectional I/O with
pull-up. The strong booster pull-up ‘p1’ is turned on for one
clock period after a LOW-to-HIGH transition in the port
latch. All port pins will be set to HIGH during reset.
handbook, full pagewidth
from port latch
read port pin
input data
2 clock
periods
Q
strong pull-up
INPUT
BUFFER
Fig.8 Port configuration.
1998 Aug 2617
V
DD
p2
p1
n
p3
I/O pin
MBK456
Page 18
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
12 TIMER/EVENT COUNTERS
The SZF2002 contains three 16-bit timer/event counter
registers; Timer 0, Timer 1 and Timer 2 which can perform
the following functions:
• Measure time intervals and pulse duration
• Count events
• Generate interrupt requests.
In the ‘Timer’ operating mode the register increments
every machine cycle. Since a machine cycle consists of
6 clock periods, the count rate is1⁄6f
In the ‘Counter’ operating mode, the register increments in
response to a HIGH-to-LOW transition. Since it takes
2 machine cycles (12 clock periods) to recognize a
HIGH-to-LOW transition, the maximum count rate is
1
⁄12f
. To ensure a given level is sampled, it should be
clk
held for at least one complete machine cycle.
12.1Timer 0 and Timer 1
Timer 0 and Timer 1 can be programmed independently to
operate in 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 establishes TL0 and TH0 as two
separate counters.
12.2Timer 2
Timer 2 is a 16-bit timer/up-down counter that can operate
(like Timer 0 and 1) either as a timer or as an event
counter. These functions are selected by the state of the
C/T2 bit in the T2CON register; see Section 12.3.
Three operating modes are available: Capture,
Auto-reload and Baud Rate Generator, which also are
selected via the T2CON register.
12.2.1C
Figure 9 shows the Capture mode. Two options in this
mode may be selected by the EXEN2 bit in T2CON:
• If EXEN2 = 0, then Timer 2 is a 16-bit timer or counter
that sets the Timer 2 overflow bit (TF2) on overflow, this
can be used to generate an interrupt.
APTURE MODE
clk
.
SZF2002
• If EXEN2 = 1, Timer 2 operates as already described
but with the additional feature that a HIGH-to-LOW
transition at external input T2EX causes the current
value in TL2 and TH2 to be captured into registers
RCAP2L and RCAP2H respectively. In addition, the
transition at T2EX causes the EXF2 bit in T2CON to be
set; this may also be used to generate an interrupt.
12.2.2A
Figure 10 shows the Auto-reload mode.
• Counting up (DCEN = 0)
In the Auto-reload mode and counting up, registers
RCAP2L/RCAP2H are used to hold a reload value for
TL2 /TH2 when Timer 2 rolls over. By setting/clearing bit
EXEN2 in T2CON the external trigger input pin T2EX
can be enabled/disabled. If EXEN2 = 0, then Timer 2 is
a 16-bit timer/counter which upon overflow sets TF2,
and reloads TL2/TH2 with the reload value held in
RCAP2L/RCP2H. If EXEN2 = 1, then Timer 2 performs
as above, but with the added feature that a
HIGH-to-LOW transition at pin T2EX causes the current
Timer 2 value (TL2/TH2 data) to be reloaded with the
value held in RCAP2L/RAP2H, and bit EXF2 in T2CON
to be set.
Timer 2 interrupt will be set if EXF2 is set or TF2 is set.
• Counting up (DCEN = 1 and T2EX = 1). In this mode
Timer 2 will count up. When the timer overflows (FFFFH
state), TF2 bit will be set. This will reload TL2 and TH2
with the contents of T2CAPL and T2CAPH, respectively.
Also bit EXF2 will be toggled. Bit EXF2 can be used as
the 17th bit if desired.
Timer 2 interrupt will be set only if TF2 is set.
• Counting down (DCEN = 1 and T2EX = 0.In this mode
Timer 2 will be counting down. Underflow will occur
when the contents of TL2/TH2 matches the contents of
RCAP2L/RCAP2H. A Timer 2 roll-over from
0000H to FFFFH is not considered as an underflow.
Upon underflow, bit TF2 will be set and registers
TL2/TH2 will be loaded with FFFFH. In addition, an
underflow will cause bit EXF2 to toggle, such that it can
be used as the 17th bit if desired.
Timer 2 interrupt will be set only if TF2 is set.
12.2.3B
The Baud Rate Generator mode is selected when
RCLK0 = 1 or TCLK0 = 1 or RCLK1 = 1 or TCLK1 = 1.
It will be described in conjunction with the serial port
(UART); see Section 17.3.2.
UTO-RELOAD MODE
AUD RATE GENERATOR MODE
1998 Aug 2618
Page 19
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
f
clk
6
T2 PIN
T2EX PIN
C/T2 = 0
C/T2 = 1
transition
detector
control
TR2
capture
control
EXEN2
TL2
(8 BITS)
RCAP2LRCAP2H
TH2
(8 BITS)
TF2
EXF2
MGM136
SZF2002
Timer 2
interrupt
handbook, full pagewidth
f
clk
T2EX PIN
T2 PIN
6
C/T2 = 0
C/T2 = 1
transition
detector
Fig.9 Timer 2 in Capture mode.
control
EXEN2
control
TR2
reload
TL2
(8 BITS)
RCAP2LRCAP2H
(8 BITS)
TH2
TF2
EXF2
MGM137
Timer 2
interrupt
Fig.10 Timer 2 in Auto-reload mode.
1998 Aug 2619
Page 20
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
12.3Timer/Counter 2 Control Register (T2CON)
Table 6 Timer/Counter 2 Control Register (SFR address C8H)
76543210
TF2EXF2RCLK0TCLK0EXEN2TR2C/
Table 7 Description of T2CON bits
BITSYMBOLDESCRIPTION
7TF2Timer 2 overflow flag. Set by a Timer 2 underflow or overflow and must be cleared by
software. TF2 will not be set when in either the Baud Rate generation mode or Clock out
mode.
6EXF2Timer 2 external flag. Set when either a capture or reload is caused by a negative
transition on T2EX and when EXEN2 = 1. In Auto-reload mode it is toggled on an
underflow or overflow. Cleared by software.
5RCLK0Receive clock 0 flag. When set, causes the UART to use Timer 2 overflow pulses.
RCLK0 = 0, causes Timer 1 overflow pulses to be used.
4TCLK0Transmit clock 0 flag. When set, causes the UART to use Timer 2 overflow pulses.
TCLK0 = 0, causes Timer 1 overflow pulses to be used.
3EXEN2Timer 2 external enable flag. When set, allows a capture or reload to occur, together
with an interrupt, as a result of a negative transition on input T2EX (if in Capture mode
or Auto-reload mode with DCEN reset). If in Auto-reload mode and DCEN is set, this bit
has no influence. In the other modes EXF2 is set and an interrupt is generated on a
HIGH-to-LOW transition on T2EX pin. In all modes EXEN2 = 0, causes Timer 2 to
ignore events at T2EX.
2TR2Timer 2 start/stop control. When TR2 = 1, Timer 2 is started.
1C/
0CP/
T2Timer or counter select for Timer 2. C/T2 = 0, selects the internal timer with a clock
frequency of1⁄6f
triggered.
RL2Capture/Reload flag. Selection of Capture or Auto-reload mode.
7−These 2 bits are reserved.
6−
5RCLK1Receive Clock 1 flag. Reserved for future UART2. When set, causes the UART to use
Timer 2 overflow pulses. RCLK1 = 0, causes Timer 1 overflow pulses to be used.
4TCLK1Transmit Clock 1 flag. Reserved for future UART2. When set, causes the UART to use
Timer 2 overflow pulses. TCLK1 = 0, causes Timer 1 overflow pulses to be used.
3−This bit is reserved.
2T2RDTimer 2 Read flag. This bit is set by hardware if following a TL2 read and before a TH2
read, TH2 is incremented. It is reset on the trailing edge of the next TL2 read.
1T2OETimer 2 Output Enable. When set, output is activated to output a clock at the T2 pin
(Clock output mode).
0DCENDown Count Enable. When set, this allows Timer 2 to be configured as an up/down
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
12.5Watchdog Timer (T3)
In addition to Timer 2 and the standard timers, a Watchdog
Timer (consisting of an 11-bit prescaler and an 8-bit timer)
is also available.
The Watchdog Timer is controlled by the Watchdog
Enable Register (WDTKEY). When WDTKEY = 55H, the
timer is disabled and the Power-down mode is enabled.
Otherwise, the timer is enabled and the Power-down mode
is disabled. In the Idle mode the Watchdog Timer and reset
circuitry remain active.
The Watchdog Timer is shown in Fig.11.
The timer frequency is derived from the clock frequency
using the formula shown below:
f
f
=
timer
------------------------------------------ -
When a timer overflow occurs, the microcontroller is reset.
To prevent a system reset the timer must be reloaded in
time by the application software.
clk
62048×()T3×
SZF2002
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. After reset the Watchdog Timer is
off. The Watchdog Timer is started by loading a value into
T3.
The time interval between the timer reloading and the
occurrence of a reset is dependent upon the reloaded
value. The time interval is derived from the clock and the
value programmed into T3 and may be calculated as
shown below:
T
reload
For example, this time period may range from 2 to 500 ms
when using a clock frequency f
256 T3–()
=
----------------------------f
timer
= 6 MHz.
clk
handbook, full pagewidth
SFR WDTKEY
INTERNAL BUS
overflow
internal
reset
LOADEN
PCON.1
MGM141
R
RST
RST
write
T3
PRESCALER
11-BIT
CLEAR
TIMER T3 (8-BIT)
LOAD
LOADEN
CLEAR
WLEPD
PCON.4
INTERNAL BUS
f
/6
clk
Fig.11 Functional diagram of the Watchdog Timer (T3).
1998 Aug 2622
Page 23
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
13 PULSE WIDTH MODULATED OUTPUT
One Pulse Width Modulated output channel PWM is
provided which outputs pulses of programmable length
and interval. The repetition frequency is defined by an 8-bit
prescaler (PWMP) that generates the clock for the
counter. The 8-bit counter counts modulo 255, i.e. from
0 to 254 inclusive. The value held in the 8-bit counter is
compared to the contents of the register PWM. If a new
prescaler value is written in register PWMP the 8-bit
counter finishes uninterrupted, and the new prescaler
value is used in the next count cycle.
Provided the contents of this register are greater than the
counter value, the PWM output is set HIGH. If the contents
of register PWMP are equal to, or less than the counter
value, the PWM output is set LOW.
The pulse-width-ratio is therefore defined by the contents
of register PWM. The pulse-width-ratio will be in the range
frequency range of 92 Hz to 23.5 kHz.
By loading the PWM register with either 00H or FFH, the
PWM output can be retained at a constant LOW or HIGH
level respectively. When loading FFH into the PWM
register, the 8-bit counter will never actually reach this
value.
The PWM output pin is not shared with any other function.
.
) at the PWM output is given
PWM
handbook, full pagewidth
I
N
T
E
R
N
A
L
B
U
S
f
clk
PWMP
+
DIVIDE-BY-2
PWM
8-BIT COMPARATOR
8-BIT COUNTER
OUTPUT
BUFFER
Fig.12 Functional diagram of Pulse Width Modulated output (PWM).
PWM
MGM140
1998 Aug 2623
Page 24
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
PWM
PWM × 2 × (PWMP + 1) × t
255 × 2 × (PWMP + 1) × t
clk
Fig.13 PWM signals.
clk
SZF2002
MGM186
13.1Prescaler Frequency Control Register (PWMP)
Table 10 Prescaler Frequency Control Register (SFR address FEH)
76543210
PWMP.7PWMP.6PWMP.5PWMP.4PWMP.3PWMP.2PWMP.1PWMP.0
Table 11 Description of PWMP bits
BITSYMBOLDESCRIPTION
7 to 0PWMP.7 to PWMP.0prescaler division factor = (PWMP) + 1
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
14 ANALOG-TO-DIGITAL CONVERTER (ADC)
The analog input circuitry consists of a 6-input analog
multiplexer and an ADC with 8-bit resolution. The analog
supply (V
separate input pins. For clock frequencies higher than
8 MHz the clock prescaler is needed (divide-by-2).
The functional diagram of the ADC is shown in Fig.14.
The ADC is controlled using the ADC Control Register
(ADCON). Input channels are selected by the analog
multiplexer via the ADCON register bits AADR0 to AADR2.
A conversion is started by setting the ADCS bit in the
ADCON register. The completion of the 8-bit ADC
conversion is flagged by ADCI in the ADCON register,
which will generate an interrupt if this is enabled (EAD).
The result is stored in the Special Function Register ADCH
(address C5H).
To save power the ADC current is switched on only during
conversion and is independent of the processor mode
(active, Idle or Power-down). If the processor goes into Idle
or Power-down mode, the ADC interrupt must be used to
wake-up the CPU again.
) and analog ground (V
DDA
) are connected via
SSA
SZF2002
While ADCS = 1 or ADCI = 1, a new ADC start will be
blocked and consequently lost, however an ADC
conversion already in progress will finish uninterrupted.
An ADC conversion already in progress is aborted when
the Power-down mode is entered. The result of a
completed conversion (ADCI = 1) remains unaffected
when entering the Idle or Power-down mode.
When no result of a completed conversion (ADCI = 0) is
available, the ADCON and ADCH registers will be reset
when entering the Power-down mode. Note that AADRx
and CKDIV have to be set explicitly to restore their
previous values for the first conversion after Power-down
mode.
Table 14 Conversion time in clock cycles
CONDITIONMAX.REMARK
≤ 8 MHz,
f
clk
CKDIV = 0
f
> 8 MHz,
clk
CKDIV = 1
288normal conversion
576prescaler used
handbook, full pagewidth
(1) For the descriptions of ADCON bits see Table 16.
ADC0
ADC1
ADC2
ADC3
ADC4
ADC5
ADCON
(1)
ANALOG INPUT
MULTIPLEXER
8-BIT ADC
(succesive approximation)
70
Power-down
INTERNAL BUS
12345670123456
Fig.14 Functional diagram of analog input.
ADCH
MGM187
V
V
DDA
SSA
1998 Aug 2625
Page 26
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
14.1ADC Control Register (ADCON)
Table 15 ADC Control Register (SFR address C4H)
76543210
−−CKDIVADCIADCSAADR2AADR1AADR0
Table 16 Description of ADCON bits
BITSYMBOLDESCRIPTION
7−These 2 bits are reserved.
6−
5CKDIVPrescaler select. When CKDIV = 1, the ADC clock prescaler is used (divide-by-2).
Prescaling is necessary with clocks over 8 MHz.
4ADCIADC interrupt flag. This flag is set when an ADC conversion result is ready to be read.
An interrupt is invoked if this is enabled (EAD). This flag must be cleared by software,
(it cannot be set by software).
3ADCSADC start and status flag. When this bit is set an ADC conversion is started. ADCS
must be set by software. The ADC logic ensures that this signal is HIGH while the ADC
is busy . On completion of the conversion ADCI is set and one clock later the ADCS flag
is reset. ADCS cannot be reset by software.
2AADR2Analog input select. These bits are used to select one of the six analog inputs;
1AADR1
0AADR0
These functions may generate an interrupt or reset; thus
ending the Idle mode.
The instruction that sets bit IDL (PCON.0) is the last
instruction executed in the normal operating mode before
the Idle mode is activated. Once in Idle mode, the CPU
status is preserved along with the Stack Pointer, Program
Counter, Program Status Word, SFRs and Accumulator.
The RAM and all other registers maintain their data during
Idle mode. The status of the external pins during Idle mode
is shown in Table 20.
15.1.1T
Activation of any enabled interrupt will cause IDL
(PCON.0) to be cleared by hardware thus terminating the
Idle mode. The interrupt is serviced, and following the
RETI instruction, the next instruction to be executed will be
the one following the instruction that put the device in the
Idle mode. The flag bits GF0 (PCON.2) and GF1 (PCON.3)
may be used to determine whether the interrupt was
received during normal execution or during the Idle mode.
For example, the instruction that writes to PCON.0 can
also set or clear one or both flag bits. When the Idle mode
is terminated by an interrupt, the service routine can
examine the status of the flag bits.
2
C-bus interface
ERMINATION OF THE IDLE MODE USING AN
ENABLED INTERRUPT
SZF2002
15.1.2T
The second way of terminating the Idle mode is with an
external hardware reset, or an internal reset caused by an
overflow of Timer 3 (Watchdog Timer). Since the clock is
still running, the hardware reset is required to be active for
two machine cycles (12 clock periods) to complete the
reset operation. Reset redefines all SFRs but does not
affect the on-chip RAM.
15.2Power-down mode
The Power-down operation freezes the SZF2002.
The Power-down mode can only be activated by setting
the PD bit in the PCON register.
The instruction that sets PD (PCON.1) is the last executed
prior to going into the Power-down mode. Once in the
Power-down mode, the internal clock is stopped.
The contents of the on-chip RAM and the SFRs are
preserved. The port pins output the value held by their
respective SFRs.
HIGH, so the external ROM will not be enabled during
power down, to save system power.
15.3Wake-up from Power-down mode
Setting the PD flag in the PCON register forces the
controller into the Power-down mode. Setting this flag
enables the controller to be woken-up from the
Power-down mode with either the external interrupts
INT0 to INT8, or a reset operation. The wake-up operation
has two basic approaches as explained in
Section 15.3.1 and 15.3.2.
15.3.1W
If any of the interrupts INT0 to INT8 is enabled, the device
can be woken-up from the Power-down mode with these
external interrupts. The user must ensure that the external
clock is stable before the controller restarts, the internal
clock will remain inactive for 18 clock periods. This is
controlled by an on-chip delay counter.
15.3.2W
To wake-up the SZF2002, the RST pin must be kept HIGH
for a minimum of 12 clock cycles. The user must ensure
that the external clock is stable before the controller
restarts (at RST falling edge), the internal clock will remain
inactive for 18 clock periods. This is controlled by an
on-chip delay counter.
ERMINATION OF THE IDLE MODE USING AN
EXTERNAL HARDWARE RESET
OE is held HIGH, but CE is switched to
AKE-UP USING INT0 TO INT8
AKE-UP USING RST
1998 Aug 2627
Page 28
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
15.4Status of external pins
The status of the external pins during Idle and Power-down mode is shown in Table 20.
Table 20 Status of external pins during Idle and Power-down modes
MODEMEMORY
Idleinternal11activeport dataPort 0 data
external11activeport datafloating
Power-downinternal11halted in last stateport dataPort 0 data
external11halted in last stateport datafloating
15.5Power Control Register (PCON)
Idle and Power-down modes are activated by software using this SFR. PCON is not bit addressed, the reset value of
PCON is 00000000B.
Table 21 Power Control Register (SFR address 87H)
76543210
SMODARDRFIWLEGF1GF0PDIDL
CEOEPWM
PORTS 1, 3
AND 4
DATA BUS
Table 22 Description of PCON bits
BITSYMBOLDESCRIPTION
7SMODDouble Baud rate. When set to a logic 1 the baud rate is doubled when the serial port
SIO0 is being used in modes 1, 2 or 3 (except when Timer 2 is used).
6ARDSetting this bit will force all MOVX instructions to access off-chip memory instead of
AUX RAM.
5RFIRFI reduction mode. Setting this bit will disable the ALE toggling during on-chip
memory access. The SZF2002 does not have this signal during operational mode, but
setting this bit will reduce the number of chip selects (
thus power).
4WLEWatchdog Load Enable. This flag must be set by software prior to loading the
Watchdog Timer (T3). It is cleared when T3 is loaded.
3GF1General purpose flag 1.
2GF0General purpose flag 0.
1PDPower-down mode selection. Setting this bit activates the Power-down mode. If a
logic 1 is written to both PD and IDL at the same time, PD takes precedence.
0IDLIdle mode selection. Setting this bit activates the Idle mode.
CE) of the external memory (and
1998 Aug 2628
Page 29
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
16 I2C-BUS SERIAL I/O
The serial port supports the twin line I2C-bus, which
consists of a data line (SDA) and a clock line (SCL). These
lines also function as the I/O port lines P1.7 and P1.6
respectively.
The system is unique because data transport, clock
generation, address recognition and bus control arbitration
are all controlled by hardware.
The I2C-bus serial I/O has complete autonomy in byte
handling and operates in 4 modes:
• Master transmitter
• Master receiver
• Slave transmitter
• Slave receiver.
SZF2002
These functions are controlled by the Serial Control
Register (S1CON). S1STA is the Status Register whose
contents may also be used as a vector to various service
routines. S1DAT is the Data Shift Register and S1ADR is
the Slave Address Register. Slave address recognition is
performed by on-chip hardware.
Figure 15 shows the block diagram of the I
serial I/O.
2
C-bus
70
SLAVE ADDRESS
S1ADR
70
SDA
ARBITRATION SYNC LOGIC
SCLBUS CLOCK GENERATOR
70
S1CON
70
S1STA
SHIFT REGISTER
S1DAT
CONTROL REGISTER
STATUS REGISTER
Fig.15 Block diagram of I2C-bus serial I/O.
GC
INTERNAL BUS
MLB199
1998 Aug 2629
Page 30
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
16.1Serial Control Register (S1CON)
Table 23 Serial Control Register (SFR address D8H)
76543210
CR2ENS1STASTOSIAACR1CR0
Table 24 Description of S1CON bits
BITSYMBOLDESCRIPTION
6ENS1Enable serial I/O. When ENS1 = 0, the serial I/O is disabled. SDA and SCL outputs are
in the high-impedance state; P1.6 and P1.7 function as open-drain ports. When
ENS1 = 1, the serial I/O is enabled. Output port latches P1.6 and P1.7 must be set to
logic 1.
5STASTART flag. When this bit is set in Slave mode, the SIO hardware checks the status of
4STOSTOP flag. With this bit set while in Master mode a STOP condition is generated. When
3SISIO interrupt flag. This flag is set and an interrupt is generated, after any of the
2AAAssert Acknowledge. When this bit is set, an acknowledge (LOW level to SDA) is
7CR2Clock Rate selection. These 3 bits determine the serial clock frequency when SIO is in
1CR1
0CR0
2
the I
C-bus and generates a ST ART condition if the bus is free or after the bus becomes
free. If ST A is set while the SIO is in Master mode, SIO will generate a repeated START
condition.
a STOP condition is detected on the I
STO may also be set in Slave mode in order to recover from an error condition. In this
case no STOP condition is transmitted to the I2C-bus. However, the SIO hardware
behaves as if a STOP condition has been received and releases the SDA and SCL
lines. The SIO then switches to the not addressed Slave receiver mode. The STOP flag
is cleared by the hardware.
following events occur:
• A START condition is generated in Master mode
• Own slave address has been received during AA = 1
• The general call address has been received while GC (S1ADR.0) = 1 and AA = 1
• A data byte has been received or transmitted in Master mode (even if arbitration is lost)
• A data byte has been received or transmitted as selected slave
• A STOP or START condition is received as selected slave receiver or transmitter.
returned during the acknowledge clock pulse on the SCL line when:
• Own slave address is received
• General call address is received; GC (S1ADR.0) = 1
• A data byte is received while the device is programmed to be a Master receiver
• A data byte is received while the device is a selected Slave receiver.
When this bit is reset, no acknowledge is returned. Consequently, no interrupt is
requested when the own slave address or general call address is received.
the Master mode. See Table 25.
2
C-bus, the SIO hardware clears the STO flag.
1998 Aug 2630
Page 31
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
Table 25 Selection of the serial clock frequency (SCL) in a Master mode of operation
S1STA is a read-only register. The contents of this register may be used as a vector to a service routine. This optimizes
the response time of the software and consequently that of the I
I2C-bus interface is given in Table 29. The register has only a valid vector to a service routine if the SI bit of the S1CON
register is set, otherwise it is invalid, usually F8H.
DIVISORBIT RATE (kHz) AT f
clk
2
C-bus. The status codes for all possible modes of the
= 1 MHz
clk
Table 26 Serial Status Register (SFR address D9H)
76543210
SC4SC3SC2SC1SC0000
Table 27 Description of S1STA bits
BITSYMBOLDESCRIPTION
3 to 7SC4 to SC05-bit status code; see Table 29.
0to2−These three bits are always zero.
Table 28 Symbols used in Table 29
SYMBOLDESCRIPTION
SLA7-bit slave address
Rread bit
Wwrite bit
ACKacknowledgement (acknowledge bit is logic 0)
ACKno acknowledgement (acknowledge bit is logic 1)
DATAdata byte to or from I
MSTmaster
SLVslave
TRXtransmitter
RECreceiver
2
C-bus
1998 Aug 2631
Page 32
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
Table 29 Status codes
S1STA VALUEDESCRIPTION
MST/TRX mode
08HA START condition has been transmitted.
10HA repeated START condition has been transmitted.
18HSLA and W have been transmitted, ACK has been received.
20HSLA and W have been transmitted,
28HDATA of S1DAT has been transmitted, ACK received.
30HDATA of S1DAT has been transmitted,
38HArbitration lost in SLA, R/W or DATA.
MST/REC mode
08HA START condition has been transmitted.
10HA repeated START condition has been transmitted.
38HArbitration lost while returning
40HSLA and R have been transmitted, ACK received.
48HSLA and R have been transmitted,
50HDATA has been received, ACK returned.
58HDATA has been received,
ACK returned.
ACK received.
ACK received.
ACK.
ACK received.
SZF2002
SLV/REC mode
60HOwn SLA and W have been received, ACK returned.
68HArbitration lost in SLA, R/W as MST. Own SLA and W have been received, ACK returned.
70HGeneral CALL has been received, ACK returned.
78HArbitration lost in SLA, R/W as MST. General CALL has been received.
80HPreviously addressed with own SLA. DATA byte received, ACK returned.
88HPreviously addressed with own SLA. DATA byte received,
90HPreviously addressed with general CALL. DATA byte has been received, ACK has been returned.
98HPreviously addressed with general CALL. DATA byte has been received,
A0HA STOP condition or repeated ST AR T condition has been received while still addressed as SLV/REC
or SLV/TRX.
SLV/TRX mode
A8HOwn SLA and R have been received, ACK returned.
B0HArbitration lost in SLA and R/W as MST. Own SLA and R have been received, ACK returned.
B8HDATA byte has been transmitted, ACK received.
C0HDATA byte has been transmitted,
C8HLast DATA byte has been transmitted (AA = 0), ACK received.
Miscellaneous
00HBus error during MST mode or selected SLV mode, due to an erroneous START or STOP condition.
F8HNo relevant state information available, SI = 0.
ACK received.
ACK returned.
ACK has been returned.
1998 Aug 2632
Page 33
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
16.3Data Shift Register (S1DAT)
S1DAT contains the serial data to be transmitted or data which has just been received. The MSB (bit 7) is transmitted or
received first; i.e. data shifted from right to left. The data received is only valid while the SI bit of the S1CON register is set.
This 8-bit register may be loaded with the 7-bit slave address to which the controller will respond when programmed as
a slave receiver/transmitter.
Table 31 Address Register (SFR address DBH)
76543210
SLA6SLA5SLA4SLA3SLA2SLA1SLA0GC
Table 32 Description of S1ADR bits
BITSYMBOLDESCRIPTION
7 to 1SLA6 to
SLA0
0GCThis bit is used to determine whether the general call address is recognized. When
Own slave address.
GC = 0, the general call address is not recognized; when GC = 1, the general call
address is recognized.
1998 Aug 2633
Page 34
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
17 STANDARD SERIAL INTERFACE SIO0: UART
This serial port is full duplex which means that it can
transmit and receive simultaneously. It is also
receive-buffered and can commence reception of a
second byte before a previously received byte has been
read from the register. (However, if the first byte has not
been read by the time the reception of the second byte is
complete, one of the bytes will be lost). The serial port
receive and transmit registers are both accessed via the
Special Function Register S0BUF. Writing to S0BUF loads
the transmit register and reading S0BUF accesses a
physically separate receive register.
The serial port can operate in 4 modes:
Mode 0 Serial data enters and exits through RXD. TXD
outputs the shift clock. 8 bits are
transmitted/received (LSB first). The baud rate is
fixed at
Mode 1 10 bits are transmitted (through TXD) or received
(through RXD): a start bit (logic 0), 8 data bits
(LSB first), and a stop bit (logic 1). On receive,
the stop bit goes into RB8 in the SFR S0CON.
The baud rate is variable. See Figs 19 and 20.
Mode 2 11 bits are transmitted (through TXD) or received
(through RXD): start bit (logic 0), 8 data bits (LSB
first), a programmable 9th data bit, and a stop bit
(logic 1). On transmit, the 9th data bit (TB8 in
S0CON) can be assigned the value of a logic 0 or
logic 1. Or, for example, the parity bit (P, in the
PSW) could be moved into TB8. On receive, the
9th data bit goes into RB8 in S0CON, while the
stop bit is ignored. The baud rate is
programmable to either1⁄16or1⁄32f
See Figs 21 and 22.
1
⁄6f
. See Figs 17 and 18.
clk
clk
.
SZF2002
In all four modes, transmission is initiated by any
instruction that uses S0BUF as a destination register.
Reception is initiated in Mode 0 by the condition RI = 0 and
REN = 1. Reception is initiated in the other modes by the
incoming start bit if REN = 1.
17.1Multiprocessor communications
Modes 2 and 3 have a special provision for multiprocessor
communications. In these modes, 9 data bits are received.
The 9th bit goes into RB8. The following bit is the stop bit.
The port can be programmed such that when the stop bit
is received, the serial port interrupt will be activated, but
only if RB8 = 1. This feature is enabled by setting bit SM2
in S0CON. One use of this feature, in multiprocessor
systems, is as follows.
When the master processor wants to transmit a block of
data to one of several slaves, it first sends out an address
byte which identifies the target slave. An address byte
differs from a data byte in that the 9th bit is HIGH in an
address byte and LOW in a data byte. With SM2 = 1, no
slave will be interrupted by a data byte. An address byte,
however, will interrupt all slaves, so that each slave can
examine the received byte and see if it is being addressed.
The addressed slave will clear its SM2 bit and prepare to
receive the data bytes that will be sent. The slaves that
were not being addressed leave their SM2 bits set and go
on about their business, ignoring the coming data bytes.
SM2 has no effect in Mode 0, and in Mode 1 can be used
to check the validity of the stop bit. In a Mode 1 reception,
if SM2 = 1, the receive interrupt will not be activated unless
a valid stop bit is received.
Mode 3 11 bits are transmitted (through TXD) or received
(through RXD): a start bit (logic 0), 8 data bits
(LSB first), a programmable 9th data bit and a
stop bit (logic 1). In fact, Mode 3 is the same as
Mode 2 in all respects except baud rate.
The baud rate in Mode 3 is variable.
See Figs 23 and 24.
1998 Aug 2634
Page 35
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
17.2Serial Port Control and Status Register (S0CON)
The Serial Port Control and Status Register is the Special Function Register S0CON. The register contains not only the
mode selection bits, but also the 9th data bit for transmit and receive (TB8 and RB8), and the serial port interrupt bits
(TI and RI).
Table 33 Serial Port Control Register (SFR address 98H)
76543210
SMOSM1SM2RENTB8RB8TIRI
Table 34 Description of S0CON bits
BITSYMBOLDESCRIPTION
7SM0Mode select. These 2 bits are used to select the serial port mode; see Table 35.
6SM1
5SM2Enables the multiprocessor communication feature in Modes 2 and 3. In these modes, if
SM2 = 1, then RI will not be activated if the received 9th data bit (RB8) is a logic 0.
In Mode 1, if SM2 = 1, then RI will not be activated unless a valid stop bit was received.
In Mode 0, SM2 should be a logic 0.
4RENEnable serial reception. REN is set by software to enable reception, and cleared by
software to disable reception.
3TB8Is the 9th data bit that will be transmitted in Modes 2 and 3. Set or cleared by software
as desired.
2RB8In Modes 2 and 3, is the 9th data bit received. In Mode 1, if SM2 = 0, then RB8 is the
stop bit that was received. In Mode 0, RB8 is not used.
1TITransmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or at
the beginning of the stop bit time in the other modes, in any serial transmission. Must be
cleared by software.
0RIReceive interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or
halfway through the stop bit time in the other modes, in any serial transmission (except
see SM2). Must be cleared by software.
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
17.3Baud rates
The baud rate in Mode 0 is fixed and may be calculated as:
f
Baud rate
The baud rate in Mode 2 depends on the value of the
SMOD bit in Special Function Register PCON and may be
calculated as:
Baud rate
• If SMOD = 0 (value on reset), the baud rate is
• If SMOD = 1, the baud rate is1⁄16f
17.3.1U
When Timer 1 is used as the Baud Rate Generator, the
baud rates in Modes 1 and 3 are determined by the
Timer 1 overflow rate and the value of the SMOD bit as
follows:
Baud rate
The Timer 1 interrupt should be disabled in this
application. The timer itself can be configured for either
‘timer’ or ‘counter’ operation in any of its 3 running modes.
In typical applications, it is configured for ‘timer’ operation,
in the Auto-reload mode (high nibble of TMOD = 0010B).
In this case the baud rate is given by:
Baud rate
By configuring Timer 1 to run as a 16-bit timer (high nibble
of TMOD = 0001B), and using the Timer 1 interrupt to do
a 16-bit software reload, very low baud rates can be
achieved.
17.3.2U
Timer 2 is selected as a Baud Rate Generator by setting
the RCLK0, TCLK0, RCLK1, or TCLK1 bit in T2CON.
The Baud Rate Generator mode is similar to the
Auto-reload mode, in that a roll-over in TH2 causes
Timer 2 registers to be reloaded with the 16-bit value held
in the registers RCAP2H and RCAP2L, which are preset
by software.
Baud rates in Modes 1 and 3 are determined by Timer 2's
overflow rate as specified below:
Baud rate
Timer 2 can be configured for either ‘timer’ or ‘counter’
operation. In the most typical applications, it is configured
for ‘timer’ operation (C/
different for Timer 2 when it is being used as a Baud Rate
Generator. Normally, as a timer it would increment every
machine cycle at a frequency of
Rate Generator it increments every state time at a
frequency of f
3 is determined as shown by the following equation:
Baud rate
Where (RCAP2H; RCAP2L) is the content of registers
RCAP2H and RCAP2L taken as a 16-bit unsigned integer.
Note that the maximum baud rate depends on clock
frequency and is determined by the following equation:
Maximum baud rate
The Baud Rate Generator mode for Timer 2 is shown in
Fig.16. This figure is only valid if RCLK0 = 1 or TCLK0 = 1
or RCLK1 = 1 or TCLK1 = 1. At roll-over TH2 does not set
the TF2 bit in T2CON and therefore, will not generate an
interrupt. Consequently, the Timer 2 interrupt does not
need to be disabled when in the Baud Rate Generator
mode. If EXEN2 is set, a HIGH-to-LOW transition on T2EX
will set the EXF2 bit, also in T2CON, but will not cause a
reload from (RCAP2H; RCAP2L) to (TH2 and TL2).
Therefore, in this mode T2EX may be used as an
additional external interrupt.
When Timer 2 is operating as a timer (TR2 = 1), in the
Baud Rate Generator mode, registers TH2 and TL2 should
not be accessed (read or write). Under these conditions
the timer increments every state time and therefore the
results of a read or write may not be accurate.
The registers RCAP2H and RCAP2L however, may be
read but not written to. A write might overlap a reload and
cause write and/or reload errors. If a write operation is
required, Timer 2 or RCAP2H/RCAP2L should first be
turned off by clearing the TR2 bit.
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
TB8
write to
SBUF
SMOD
TCLK0
Timer 1
overflow
2
0
1
0
0
Timer 2
overflow
1
1
S
D
Q
CL
16
INTERNAL BUS
S0 BUFFER
ZERO DETECTOR
START
TX CLOCKSEND
TX CONTROL
T1
SHIFT
SHIFT
DATA
SZF2002
TXD
RCLK0
RXD
serial port
interrupt
sample
HIGH-TO-LOW
TRANSITION
DETECTOR
16
RX CLOCKR1
BIT
DETECTOR
LOAD
RX CONTROLSTART
LOAD
SBUF
READ
SBUF
SBUF
SHIFT
INPUT SHIFT
REGISTER
(9-BITS)
S0 BUFFER
INTERNAL BUS
SHIFT
MGM145
Fig.19 Serial port Mode 1.
1998 Aug 2640
Page 41
This text is here in white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here in
_white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here inThis text is here in
white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader. white to force landscape pages to be ...
1998 Aug 2641
TX CLOCK
WRITE TO SBUF
SEND
DATA
SHIFT
TXD
TI
RX CLOCK
R
RXD
E
C
E
BIT DETECTOR SAMPLE TIME
I
V
E
SHIFT
S1P1
START BIT
D0
÷16 RESET
START BIT
D1
D2
D0D1D2D3D4D5
D3
D4D5
D6
D7
D6D7
STOP BIT
STOP BIT
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
T
R
A
N
S
M
I
T
RI
MLA569
SZF2002
Fig.20 Serial port Mode 1 timing.
handbook, full pagewidth
Page 42
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
TB8
write to
SBUF
f
SMOD at
PCON.7
clk
2
0
1
S
D
Q
CL
ZERO DETECTOR
STOP BITSHIFT
START
16
TX CLOCKSEND
INTERNAL BUS
S0 BUFFER
TX CONTROL
T1
SZF2002
TXD
SHIFT
DATA
RXD
serial port
interrupt
sample
HIGH-TO-LOW
TRANSITION
DETECTOR
16
START
BIT
DETECTOR
RX CLOCKR1
RX CONTROL
LOAD
SBUF
READ
SBUF
INTERNAL BUS
LOAD
SBUF
SHIFT
INPUT SHIFT
REGISTER
(9-BITS)
S0 BUFFER
SHIFT
MGM144
Fig.21 Serial port Mode 2.
1998 Aug 2642
Page 43
This text is here in white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here in
_white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here inThis text is here in
white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader. white to force landscape pages to be ...
1998 Aug 2643
TX CLOCK
WRITE TO SBUF
SEND
DATA
SHIFT
TXD
TI
STOP BIT GEN
RX CLOCK
R
E
RXD
C
E
I
BIT DETECTOR SAMPLE TIME
V
E
SHIFT
RI
S1P1
START BIT
D0D1D2
÷16 RESET
START BIT
D3D4D5D6
D0D1D2D3D4D5D6D7
D7TB8
STOP BIT
RB8
STOP BIT
MLA571
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
T
R
A
N
S
M
I
T
Fig.22 Serial port Mode 2 timing.
handbook, full pagewidth
SZF2002
Page 44
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
TB8
write to
SBUF
SMOD
TCLK0
Timer 1
overflow
2
0
1
0
0
Timer 2
overflow
1
1
S
D
Q
CL
START
16
TX CLOCKSEND
INTERNAL BUS
S0 BUFFER
ZERO DETECTOR
TX CONTROL
SZF2002
TXD
SHIFT
SHIFT
DATA
T1
RCLK0
RXD
serial port
interrupt
sample
HIGH-TO-LOW
TRANSITION
DETECTOR
16
START
BIT
DETECTOR
RX CLOCKR1
RX CONTROL
LOAD
SBUF
READ
SBUF
INTERNAL BUS
LOAD
SBUF
SHIFT
INPUT SHIFT
REGISTER
(9-BITS)
S0 BUFFER
SHIFT
MGM143
Fig.23 Serial port Mode 3.
1998 Aug 2644
Page 45
This text is here in white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here in
_white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here inThis text is here in
white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader. white to force landscape pages to be ...
1998 Aug 2645
TX CLOCK
WRITE TO SBUF
DATA
SHIFT
TXD
TI
SEND
S1P1
START BIT
D0D1D2D3D4D5D6D7
TB8
STOP BIT
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
T
R
A
N
S
M
I
T
RX CLOCK
R
RXD
E
C
E
I
BIT DETECTOR SAMPLE TIME
V
E
SHIFT
RI
÷16 RESET
START BIT
D0
D1D2D3D4D5D6D7
Fig.24 Serial port Mode 3 timing.
handbook, full pagewidth
TB8
STOP BIT
MLA573
SZF2002
Page 46
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
18 INTERRUPT SYSTEM
External events and the real-time-driven on-chip
peripherals require service by the CPU asynchronously to
the execution of any particular section of code. To tie the
asynchronous activities of these functions to normal
program execution a multiple-source, two-priority-level,
nested interrupt system is provided. The SZF2002
acknowledges interrupt requests from fifteen sources as
follows:
• INT0 to INT8
• Timer 0, Timer 1 and Timer 2
2
C-bus serial I/O
• I
• UART
• ADC.
Each interrupt vectors to a separate location in program
memory for its service routine. Each source can be
individually enabled or disabled by corresponding bits in
the Interrupt Enable Registers (IEN0 and IEN1).
The priority level is selected via the Interrupt Priority
Registers (IP0 and IP1). All enabled sources can be
globally disabled or enabled. Figure 25 shows the interrupt
system.
18.1External interrupts
Port 1 lines serve an alternative purpose as seven
additional interrupts INT2 to INT8. When enabled, each of
these lines (as well as INT0 and INT1) may wake-up the
device from the Power-down mode. Using the Interrupt
Polarity Register (IX1), each pin may be initialized to be
either active HIGH or active LOW. IRQ1 is the Interrupt
Request Flag Register. If the interrupt is enabled, each flag
will be set on an interrupt request but must be cleared by
software, i.e. via the interrupt software or when the
interrupt is disabled.
A low priority interrupt can be interrupted by a high priority
interrupt but not by another low priority interrupt. A high
priority interrupt routine can not be interrupted by any other
interrupt. If two interrupt requests of different priority levels
are received simultaneously, the request having the
highest priority level will be serviced. If interrupt requests
of the same priority level are received simultaneously an
internal polling sequence determines which request is
serviced. Thus within each priority level there is a second
priority structure determined by the polling sequence (see
Fig.25).
INT2 to INT8
SZF2002
Port 1 interrupts are level sensitive. A Port 1 interrupt will
be recognized when a level (longer than 2 machine cycles,
HIGH or LOW, depending on the Interrupt Polarity
Register) on P1.n is made. The interrupt request is not
serviced until the next machine cycle. Figure 26 shows the
external interrupt system.
18.2Interrupt priority
Each interrupt source can be set to either a high priority or
to a low priority. If interrupts of the same priority are
requested simultaneously, the processor will branch to the
interrupt polled first, according to Table 36.
A low priority interrupt routine can only be interrupted by a
high priority interrupt. A high priority interrupt routine can
not be interrupted.
Table 36 shows the interrupt vectors in order of priority.
The vector indicates the ROM location where the
appropriate interrupt service routine starts.
18.3.5INTERRUPT POLARITY REGISTER (IX1)
Writing either a logic 1 or logic 0 to any Interrupt Polarity Register bit sets the polarity level of the corresponding external
interrupt to an active HIGH or active LOW respectively.
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
19 CLOCK CIRCUITRY
The SZF2002 is clocked with an external digital clock.
The input must be driven with a digital square wave.
Note that the duty cycle influences the timing to the
external components, since both the positive and negative
clock edges are used.
20 RESET
To initialize the SZF2002 a reset is performed by either of
two methods:
• Applying an external signal to the RST pin
• Watchdog Timer overflow.
20.1External reset using the RST pin
The reset input for the SZF2002 is RST. A reset is
accomplished by holding the RST pin HIGH for at least two
machine cycles (12 clock periods) while the clock is
running. The CPU responds by executing an internal reset.
Port pins adopt their reset state immediately after the RST
goes HIGH. During reset,
HIGH.
WE and OE, and CE are held
SZF2002
The external reset is asynchronous to the internal clock.
The RST pin is sampled during state 5, phase 2 of every
machine cycle. After a HIGH is detected at the RST pin, an
internal reset is repeated until RST goes LOW. The reset
circuitry is also affected by the Watchdog Timer as
described in Section 12.5. The internal RAM is not
affected by reset. When VDD is turned on, the RAM
contents are indeterminate.
20.2Power-on-reset
The device contains on-chip circuitry which switches the
port pins to HIGH as soon as RST goes HIGH. The user
must ensure that the RST pin is held HIGH until the
external clock has stabilised. When RST goes LOW a
further 3 cycles elapse before execution starts.
1998 Aug 2652
Page 53
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
21 SPECIAL FUNCTION REGISTERS OVERVIEW
ADDRESS
(HEX)
NAME
FFT30000 0000Watchdog Timer
FEPWMP
FCPWM
F8IP1
(1)
(1)
(1)(2)
F7WDTKEY
F0B
E9IX1
E8IEN1
E0ACC
DBS1ADR
DAS1DAT
D9S1STA
D8S1CON
D0PSW
CDTH2
CCTL2
CBRCAP2H
CARCAP2L
C9T2MOD
C8T2CON
C5ADCH
C4ADCON
C1P4
C0IRQ1
B8IP0
B0P3
A8IEN0
A0P2
(2)
(1)
(1)(2)
(2)
(1)
(1)
(1)
(1)(2)
(2)
(1)
(1)
(1)
(1)
(1)
(1)(2)
(1)
(1)
(1)
(1)(2)
(2)
(2)
(2)
(2)
(1)
RESET VALUE
(B)
0000 0000Prescaler Frequency Control Register
0000 0000Pulse Width Register
0000 0000Interrupt Priority Register 1 (INT2 to INT8 and ADC)
0000 0000Watchdog Timer enable
0000 0000B Register
X000 0000Interrupt Polarity Register 1
0000 0000Interrupt Enable Register 1
0000 0000Accumulator
0000 0000I2C-bus Slave Address Register
0000 0000I2C-bus Data Shift Register
1111 1000I2C-bus Serial Status Register
0000 0000I2C-bus Serial Control Register
0000 0000Program Status Word
0000 0000Timer 2 High byte
0000 0000Timer 2 Low byte
0000 0000Timer 2 Reload/Capture Register High byte
0000 0000Timer 2 Reload/Capture Register Low byte
XX00 X000Timer/Counter 2 mode control
0000 0000Timer/Counter 2 Control Register
1111 1111ADC Result Register
X000 0000ADC Control Register
1111 1111Digital I/O Port Register 4
X000 0000Interrupt Request Flag Register
X000 0000Interrupt Priority Register 0
1111 1111Digital I/O Port Register 3
0000 0000Interrupt Enable Register 0
1111 1111Digital I/O Port Register 2
SZF2002
FUNCTION
1998 Aug 2653
Page 54
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
ADDRESS
(HEX)
99S0BUFXXXX XXXXSerial Data Buffer Register 0
98S0CON
91ROMBANK
90P1
8DTH10000 0000Timer 1 High byte
8CTH00000 0000Timer 0 High byte
8BTL10000 0000Timer 1 Low byte
8ATL00000 0000Timer 0 Low byte
89TMOD0000 0000Timer 0 and 1 Mode Control Register
88TCON
87PCON0000 0000Power Control Register
83DPH0000 0000Data Pointer High byte
82DPL0000 0000Data Pointer Low byte
81SP0000 0111Stack Pointer
80P0
NAME
(2)
(2)
(2)
(2)
RESET VALUE
0000 0000Serial Port Control Register 0
(1)
XXXX X000ROM bank Selection Register
1111 1111Digital I/O Port Register 1
0000 0000Timer 0 and 1 Control/External Interrupt Control Register
1111 1111Digital I/O Port Register 0
(B)
SZF2002
FUNCTION
Notes
1. SZF2002 specific SFRs.
2. Bit addressed register.
1998 Aug 2654
Page 55
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
22 DEBUGGING SUPPORT
For software development the SZF2002 is made
compatible with the Nohau 80C51 In-Circuit Emulator
(ICE).
3. Nohau EMUL51-PC/POD-C32HF-42, external
memory mode pod for a.o. 80C51/80C32.
22.2Connecting the pod
The Nohau In-Circuit Emulator requires the following
80C51 pins: P0.0 to P0.7, P2.0 to P2.7, ALE,
WR, EA and RST.
When setting the SZF2002 in Debug mode (force DEBUG
HIGH), these signals become available on the pins as
described in Section 7.2
The connection between the SZF2002 and the emulator is
shown in Fig.27.
For emulation the Target board must be configured with
the SZF2002 mounted, but without external Flash and
RAM, or disabled by disconnecting the OE.
On the Target board a 40-pin connector is required that
has all the necessary 80C51 signals (Port 0, Port 2,
PSEN, ALE, EA, RST, VDD and VSS). The 16 port pins are
optional. The three banking bits are not standard 80C51
signals and are not available at the DIL40
80C51-connector of the pod. These three bits must be
connected via three separate wires to the signals BS0
(LSB), BS1 and BS2 (MSB) on the pod.
The emulator pod has a DIL40 socket for the 80C51
processor (on the upper side). By connecting the 40-pin
connector to this socket the emulator will approach the
SZF2002 as if it were a 80C51. The connector on the lower
side of the pod is not used. The emulator acts as a memory
emulator.
22.3Powering the pod
Because the SZF2002 is a 3 V circuit, the ICE pod must be
powered by the target (supply from PC is not possible, see
documentation for EMUL51-PC/POD-C32HF-42).
Therefore, V
The clock signal is not required on the pod.
and VSS for the SZF2002 are also required.
DD
PSEN, RD,
SZF2002
The digital power V
The ground of the pod must be connected to the ground of
the target board via the black gnd-wire soldered to the pod
Because the target supplies the pod the following
power-up/power-down sequence is required:
1. Switch on target.
2. Switch on PC.
3. Switch off target.
When using 3 V power from the target, note that the pod
will drive the inputs up to 3.5 V. Some current will also flow
through the VDD connection to the target. If the emulator is
used together with an I2C-bus interface to a PC or together
with an RS232-connection, use 3.3 V power for the target.
This will reduce noise and disturbance on all input and
output signals. In practice, it is seen that this will result in a
more robust communication between the SZF2002 and
Nohau.
Both I2C-bus pins (SDA and SCL) need an external pull-up
resistor.
22.4Bank switching support
If bank switching is required, the in-circuit emulator also
needs the TRUE_A15 and the three banking bits
A15 to A17.
16 port pins (selection of Ports 3 and 4) can also be
connected to the emulator pod, however this is not
necessary. When connected, the state of these ports can
be traced.
To set up the banking configuration the BM jumpers on the
emulator board have to be set. The following set-up is
recommended:
1. Jumper BM3 is out.
2. Jumper BM2 is out.
3. Jumper BM1is don’t care.
4. Jumper BM0 is in.
22.5Software recommendations
The Keil/Franklin assembler and banked linker is well
suited for use with the Nohau ICE (especially for banking
configurations).
The Nohau ICE communicates with the SZF2002 using
MOVX instructions. Therefore, all MOVX instructions must
be forced to access off-chip memory instead of internal
AUX RAM by setting the ARD bit of the SFR PCON.
has to be connected to the pod.
DD
1998 Aug 2655
Page 56
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
SZF2002
connector
SZF2002
SZF2002
Flash
adapter PCB
target PCB
(Flash is disabled,
doesn't need to
be mounted)
socket for
target
processor
type 31A POD
NOHAU emulator
this socket not used
Fig.27 In-circuit emulation.
flat cable to PC
PC with emulator cards
MBK834
1998 Aug 2656
Page 57
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
23 INSTRUCTION SET
The SZF2002 uses a powerful instruction set which optimizes byte efficiency and execution speed. Assigned opcodes
add new high-power operation and permit new addressing modes. The instruction set consists of 49 single-byte,
46 two-byte and 16 three-byte instructions. When using a 12 MHz clock, 64 instructions execute in 0.5 µs and
45 instructions execute in 1 µs. Multiply and divide instructions execute in 2 µs.
For the description of the Data Addressing modes and Hexadecimal opcode cross-reference see Table 54.
Table 50 Instruction set description: Arithmetic operations
MNEMONICDESCRIPTIONBYTESCYCLES
Arithmetic operations
ADDA,Rradd register to A112*
ADDA,directadd direct byte to A2125
ADDA,@Riadd indirect RAM to A1126 and 27
ADDA,#dataadd immediate data to A2124
ADDCA,Rradd register to A with carry flag113*
ADDCA,directadd direct byte to A with carry flag2135
ADDCA,@Riadd indirect RAM to A with carry flag1136 and 37
ADDCA,#dataadd immediate data to A with carry flag2134
SUBBA,Rrsubtract register from A with borrow119*
SUBBA,directsubtract direct byte from A with borrow2195
SUBBA,@Risubtract indirect RAM from A with borrow1196 and 97
SUBBA,#datasubtract immediate data from A with borrow2194
INCAincrement A1104
INCRrincrement register110*
INCdirectincrement direct byte2105
INC@Riincrement indirect RAM1106 and 07
DECAdecrement A1114
DECRrdecrement register111*
DECdirectdecrement direct byte2115
DEC@Ridecrement indirect RAM1116 and 17
INCDPTRincrement data pointer12A3
MULABmultiply A and B14A4
DIVABdivide A by B1484
DAAdecimal adjust A11D4
OPCODE
(HEX)
1998 Aug 2657
Page 58
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
Table 51 Instruction set description: Logic operations
MNEMONICDESCRIPTIONBYTESCYCLES
Logic operations
ANLA,RrAND register to A115*
ANLA,directAND direct byte to A2155
ANLA,@RiAND indirect RAM to A1156 and 57
ANLA,#dataAND immediate data to A2154
ANLdirect,AAND A to direct byte2152
ANLdirect,#dataAND immediate data to direct byte3253
ORLA,RrOR register to A114*
ORLA,directOR direct byte to A2145
ORLA,@RiOR indirect RAM to A1146 and 47
ORLA,#dataOR immediate data to A2144
ORLdirect,AOR A to direct byte2142
ORLdirect,#dataOR immediate data to direct byte3243
XRLA,Rrexclusive-OR register to A116*
XRLA,directexclusive-OR direct byte to A2165
XRLA,@Riexclusive-OR indirect RAM to A1166 and 67
XRLA,#dataexclusive-OR immediate data to A2164
XRLdirect,Aexclusive-OR A to direct byte2162
XRLdirect,#dataexclusive-OR immediate data to direct byte3263
CLRAclear A11E4
CPLAcomplement A11F4
RLArotate A left1123
RLCArotate A left through the carry flag1133
RRArotate A right1103
RRCArotate A right through the carry flag1113
SWAPAswap nibbles within A11C4
OPCODE
(HEX)
1998 Aug 2658
Page 59
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
Table 52 Instruction set description: Data transfer
MNEMONICDESCRIPTIONBYTESCYCLES
Data transfer
MOVA,Rrmove register to A11E*
MOVA,direct (note 1) move direct byte to A21E5
MOVA,@Rimove indirect RAM to A11E6 and E7
MOVA,#datamove immediate data to A2174
MOVRr,Amove A to register11F*
MOVRr,directmove direct byte to register22A*
MOVRr,#datamove immediate data to register217*
MOVdirect,Amove A to direct byte21F5
MOVdirect,Rrmove register to direct byte228*
MOVdirect,directmove direct byte to direct3285
MOVdirect,@Rimove indirect RAM to direct byte2286 and 87
MOVdirect,#datamove immediate data to direct byte3275
MOV@Ri,Amove A to indirect RAM11F6 and F7
MOV@Ri,directmove direct byte to indirect RAM22A6 and A7
MOV@Ri,#datamove immediate data to indirect RAM2176 and 77
MOVDPTR,#data 16 load data pointer with a 16-bit constant3290
MOVCA,@A+DPTRmove code byte relative to DPTR to A1293
MOVCA,@A+PCmove code byte relative to PC to A1283
MOVXA,@Rimove external RAM (8-bit address) to A12E2 and E3
MOVXA,@DPTRmove external RAM (16-bit address) to A12E0
MOVX@Ri,Amove A to external RAM (8-bit address)12F2 and F3
MOVX@DPTR,Amove A to external RAM (16-bit address)12F0
PUSHdirectpush direct byte onto stack22C0
POPdirectpop direct byte from stack22D0
XCHA,Rrexchange register with A11C*
XCHA,directexchange direct byte with A21C5
XCHA,@Riexchange indirect RAM with A11C6 and C7
XCHDA,@Riexchange LOW-order digit indirect RAM with A11D6 and D7
OPCODE
(HEX)
Note
1. MOV A,ACC is not permitted.
1998 Aug 2659
Page 60
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
Table 53 Instruction set description: Boolean variable manipulation and Program and machine control
MNEMONICDESCRIPTIONBYTESCYCLES
Boolean variable manipulation
CLRCclear carry flag11C3
CLRbitclear direct bit21C2
SETBCset carry flag11D3
SETBbitset direct bit21D2
CPLCcomplement carry flag11B3
CPLbitcomplement direct bit21B2
ANLC,bitAND direct bit to carry flag2282
ANLC,/bitAND complement of direct bit to carry flag22B0
ORLC,bitOR direct bit to carry flag2272
ORLC,/bitOR complement of direct bit to carry flag22A0
MOVC,bitmove direct bit to carry flag21A2
MOVbit,Cmove carry flag to direct bit2292
OPCODE
(HEX)
Program and machine control
ACALLaddr11absolute subroutine call22•1
LCALLaddr16long subroutine call3212
RETreturn from subroutine1222
RETIreturn from interrupt1232
AJMPaddr11absolute jump22♦1
LJMPaddr16long jump3202
SJMPrelshort jump (relative address)2280
JMP@A+DPTRjump indirect relative to the DPTR1273
JZreljump if A is zero2260
JNZreljump if A is not zero2270
JCreljump if carry flag is set2240
JNCreljump if carry flag is not set2250
JBbit,reljump if direct bit is set3220
JNBbit,reljump if direct bit is not set3230
JBCbit,reljump if direct bit is set and clear bit3210
CJNEA,direct,relcompare direct to A and jump if not equal32B5
CJNEA,#data,relcompare immediate to A and jump if not equal32B4
CJNERr,#data,relcompare immediate to register and jump if not equal32B*
CJNE@Ri,#data,rel compare immediate to indirect and jump if not equal32B6 and B7
DJNZRr,reldecrement register and jump if not zero22D*
DJNZdirect,reldecrement direct and jump if not zero32D5
NOPno operation1100
1998 Aug 2660
Page 61
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
Table 54 Description of the mnemonics in the Instruction set
MNEMONICDESCRIPTION
Data addressing modes
RrWorking registers R0 to R7.
direct128 internal RAM locations and any special function register (SFR).
@RiIndirect internal RAM location addressed by register R0 or R1 of the actual register bank.
#data8-bit constant included in instruction.
#data 1616-bit constant included as bytes 2 and 3 of instruction.
bitDirect addressed bit in internal RAM or SFR.
addr1616-bit destination address. Used by LCALL and LJMP. The branch will be anywhere within the
64 kbytes program memory address space.
addr11111-bit destination address. Used by ACALL and AJMP. The branch will be within the same 2 kbytes
page of program memory as the first byte of the following instruction.
relSigned (two's complement) 8-bit offset byte. Used by SJMP and all conditional jumps. Range is
−128 to + 127 bytes relative to first byte of the following instruction.
Hexadecimal opcode cross-reference
*8, 9, A, B, C, D, E and F.
•1, 3, 5, 7, 9, B, D and F.
♦0, 2, 4, 6, 8, A, C and E.
1998 Aug 2661
Page 62
This text is here in white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here in
_white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader.This text is here inThis text is here in
white to force landscape pages to be rotated correctly when browsing through the pdf in the Acrobat reader. white to force landscape pages to be ...
1998 Aug 2662
Table 55 Instruction map
First hexadecimal character of opcode← Second hexadecimal character of opcode →
↓0123 456789ABCDEF
0NOP
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
JBC
bit,rel
JB
bit,rel
JNB
bit,rel
JC
rel
JNC
rel
JZ
rel
JNZ
rel
SJMP
rel
MOV
DTPR,#data16
ORL
C,/bit
ANL
C,/bit
PUSH
direct
POP
direct
MOVX
A,@DTPR
MOVX
@DTPR,A
AJMP
addr11
ACALL
addr11
AJMP
addr11
ACALL
addr11
AJMP
addr11
ACALL
addr11
AJMP
addr11
ACALL
addr11
AJMP
addr11
ACALL
addr11
AJMP
addr11
ACALL
addr11
AJMP
addr11
ACALL
addr11
AJMP
addr11
ACALL
addr11
LJMP
addr16
LCALL
addr16
RET
RETI
ORL
direct,A
ANL
direct,A
XRL
direct,A
ORL
C,bit
ANL
C,bit
MOV
bit,C
MOV
bit,C
CPL
bit
CLR
bit
SETB
bit
MOVX A,@Ri
010101234567
MOVX @Ri,A
010101234567
RR
A
RRC
A
RL
A
RLC
A
ORL
direct,#data
ANL
direct,#data
XRL
direct,#data
JMP
@A+DPTR
MOVC
A,@A+PC
MOVC
A,@A+DPTR
INC
DPTR
CPL
C
CLR
C
SETB
C
INC
A
DEC
A
ADD
A,#data
ADDC
A,#data
ORL
A,#data
ANL
A,#data
XRL
A,#data
MOV
A,#data
DIV
AB
SUBB
A,#data
MUL
AB
CJNE
A,#data,rel
SWAP
A
DA
A
CLR
A
CPL
A
INC
direct
DEC
direct
ADD
A,direct
ADDC
A,direct
ORL
A,direct
ANL
A,direct
XRL
A,direct
MOV
direct,#data
MOV
direct,direct
SUBB
A,direct
CJNE
A,direct,rel
XCH
A,direct
DJNZ
direct,rel
MOV
A,direct
(1)
MOV
direct,A
INC @RiINC Rr
0101234567
DEC @RiDEC Rr
0101234567
ADD A,@RiADD A,Rr
0101234567
ADDC A,@RiADDC A,Rr
0101234567
ORL A,@RiORL A,Rr
0101234567
ANL A,@RiANL A,Rr
0101234567
XRL A,@RiXRL A,Rr
0101234567
MOV @Ri,#dataMOV Rr,#data
0101234567
MOV direct,@RiMOV direct,Rr
0101234567
SUBB A,@RiSUB A,Rr
0101234567
MOV @Ri,directMOV Rr,direct
0101234567
CJNE @Ri,#data,relCJNE Rr,#data,rel
0101234567
XCH A,@RiXCH A,Rr
0101234567
XCHD A,@RiDJNZ Rr,rel
0101234567
MOV A,@RiMOV A,Rr
MOV @Ri,AMOV Rr,A
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
SZF2002
Note
1. MOV A, ACC is not a valid instruction.
Page 63
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
24 LIMITING VALUES
In accordance with the Absolute Maximum Rating System (IEC 134).
SYMBOLPARAMETERMIN.MAX.UNIT
V
DD
V
I
I
and I
I
P
tot
T
stg
T
amb
T
j
25 DC CHARACTERISTICS
V
= 2.7 to 3.3 V; VSS= 0 V; T
DD
specified.
SYMBOLPARAMETERCONDITIONSMIN.TYP.MAX.UNIT
Supply
V
DD
I
DD
I
DD(idle)
I
DD(pd)
Inputs (note 5)
V
IL
V
IH
I
LI
I
IL
Outputs
V
OL
V
OH
I
OL
I
OH
R
RST
Analog inputs
V
DDA
I
DDA
supply voltage−0.5+5V
input voltage on any pin with respect to ground (VSS)−0.5VDD+ 0.5V
DC current on any input or output−tbfmA
O
total power dissipation−500mW
storage temperature−65+150°C
operating ambient temperature−40+85°C
operating junction temperature−40+125°C
= −40 to +85 °C; see note 1; all voltages are with respect to VSS; unless otherwise
amb
operating supply voltage2.7−3.3V
operating supply currentVDD= 3.0 V; f
analog supply voltageVDD− 0.5 −VDD+ 0.5 V
supply current operatingV
DDA
= 3.0 V; f
= 8 MHz; note 2−−0.5mA
CLK
V
V
Notes to the DC characteristics
1. Loading ports and busses may cause spurious noise pulses to be superimposed on the output voltage.
1998 Aug 2663
Page 64
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
2. The operating supply current is measured with all output pins disconnected; CLK driven with tr=tf=10ns;
VIL=VSS;VIH=VDD; EA = RST = Port 0 = VDD.
3. The Idle mode supply current is measured with all output pins disconnected; CLK driven with tr=tf= 10 ns; VIL=VSS;
VIH=VDD; EA = Port 0 = VDD.
4. The power-down current is measured with all output pins disconnected; CLK connected to VSS; EA = Port 0 = VDD;
RST=VSS.
5. The input threshold voltage of P1.6/SCL and P1.7/SDA meet the I2C-bus specification. Therefore, an input voltage
below 0.3VDD will be recognized as a logic 0 and an input voltage above 0.7VDD will be recognized as a logic 1.
26 ADC CHARACTERISTICS
SYMBOLPARAMETERCONDITIONSMIN.TYP.MAX.UNIT
V
IN(ADC)
V
DDA
I
DDA
C
AIN
R
AIN
G
e
OS
e
ADC input voltagenote 1V
SSA
analog supply voltageVDD− 0.5−VDD+ 0.5V
supply current operatingV
DDA
= 3.0 V; f
= 8 MHz−−0.5mA
clk
analog on-chip input capacitance−−2pF
analog on-chip input impedance10−−MΩ
Gain error; note 2−1−+1%
1. All ADC inputs require an external divide-by-2 voltage divider.
2. Gain error: the maximum difference between actual and ideal slope.
3. Zero-offset error: the difference between the actual and ideal input voltage corresponding to the first actual code
transition.
4. Differential non-linearity: the difference between the actual and ideal code widths.
5. Integral non-linearity: maximum deviation from straight line.
6. Channel-to-channel matching: the difference between corresponding code transitions of actual characteristics taken
from different channels under the same temperature, voltage and frequency conditions. Not tested, but verified on
sampling basis.
1998 Aug 2664
Page 65
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
code
out
255
254
253
252
251
250
5
4
3
2
1
0
1 LSB (ideal)
1234567250 251 252 253 254 255
zero offset
error
(5)
(3)
1LSB =
V
DDA
(4)
− V
255
SSA
(1)(2)
V
(LSB
IN(A)
ideal
SZF2002
)
MGM135
(1) The ideal transfer curve.
(2) The actual transfer curve.
(3) Differential non-linearity (DNL).
(4) Integral non-linearity (INL).
(5) Gain error (Ge).
27 AC CHARACTERISTICS
Table 56 Timing with respect to
SYMBOLPARAMETERMIN.TYPMAX.UNIT
General (see Fig.29)
t
XCLKH
t
XCLKL
T
cy(XCLK)
XCLK HIGH time31.25−−ns
XCLK LOW time31.25−−ns
XCLK cycle time62.5−−ns
Memory Access (Figs 29 and 30)
t
(CEL-OEL)1
t
(OEL)1
t
(CEH-OEH)1
t
(CEL)1
t
(CEL-WEL)1
t
(WEL)1
t
(CEH-WEH)1
t
su(OE-D)2
t
su(CEL-D)2
t
su(D-WEL)3
t
(CEL-DV)3
t
su(D-SM)2
t
h(SM-D)2
t
h(WEH-D)3
t
h(CEH-D)3
t
su(A-CEL)1
t
h(CEH-A)1
t
(CEL-OEL)4
t
(OEL)4
t
(CEH-OEH)4
CE LOW to OE LOW (data cycle)−−
OE LOW time (data cycle)−−
CE HIGH to OE HIGH (data cycle)0−12ns
CE LOW time (data cycle)−−4t
CE LOW to WE LOW (data cycle)−−
WE LOW time (data cycle)−−
CE HIGH to WE HIGH (data cycle)0−13ns
Data set-up time from OE (data read cycle)−−3t
Data set-up time from CE LOW (data read cycle)−−
Data set-up time to WE LOW (data write cycle)−−
Data valid time from CE LOW (data write cycle)−−3ns
Data set-up time to sample moment (data read cycle); note 1−−8ns
Data hold time from sample moment (data read cycle); note 1 0−−ns
Data hold time from WE HIGH (data write cycle)−−t
Data hold time from CE HIGH (data write cycle)−−t
Address set-up time to CE LOW (data cycle)−−
Address hold time from CE HIGH (data cycle)−−t
CE LOW to OE LOW (code fetch cycle)−−
OE LOW time (code fetch cycle)−−
CE HIGH to OE HIGH (code fetch cycle)0−2ns
CE, OE and WE
1
⁄
t
+3ns
2
CLK
7
⁄
t
+7ns
2
CLK
CLK
1
⁄
t
+5ns
2
CLK
7
⁄
t
+8ns
2
CLK
− 18ns
CLK
7
⁄
t
− 18 ns
2
CLK
1
⁄
t
− 3ns
2
CLK
− 20ns
CLK
− 10ns
CLK
1
⁄
t
− 5ns
2
CLK
CLK
1
⁄
t
2
CLK
3
⁄
t
2
CLK
ns
ns
ns
ns
1998 Aug 2666
Page 67
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
SYMBOLPARAMETERMIN.TYPMAX.UNIT
t
(CEL)4
t
su(OE-D)4
t
su(CEL-D)4
t
su(D-SM)4
t
h(SM-D)4
t
su(DZ-OEL)
t
h(DZ-OEH)
t
su(A-CEL)4
t
h(CEH-A)4
Notes
1. Sample moment for data read cycles is on negative clock edge in state S3, the internal clock skew must be taken
into account also. This results in 3t
2. Sample moment for code fetch cycles is on negative clock edge in state S2 or S4, the internal clock skew must be
taken into account also. This results in3⁄2t
CE LOW time (code fetch cycle)−−2t
Data set-up time from OE (code fetch cycle)−−
Data set-up time from CE LOW (code fetch cycle)−−2t
CLK
3
⁄
t
2
CLK
− 18ns
CLK
ns
− 18 ns
Data set-up time to sample moment (code fetch cycle), note 2 −−8ns
Data hold time from sample moment (code fetch cycle)0−−ns
Data bus high-impedance set-up time to OE LOW
1
⁄2t
+12 −−ns
CLK
(data read cycle); (Code Fetch cycle)
Data bus high-impedance hold time from OE HIGH
(data read cycle); (code fetch cycle)
Address set-up time to CE LOW (code fetch cycle)−−
Address hold time from CE HIGH (code fetch cycle)−−
− 10 ns from OE LOW (or7⁄2t
CLK
− 10 ns from OE LOW (or 2t
CLK
1
⁄2t
− 2;
CLK
t
− 11
CLK
− 10 ns from CE LOW) maximum.
CLK
− 10 ns from CE LOW) maximum.
CLK
−−ns
1
1
⁄
t
− 4ns
2
CLK
⁄
t
2
CLK
ns
1998 Aug 2667
Page 68
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
XCLK
(1)
A2/ALE
(1)
A3/PSEN
(1)
A0/RD
(1)
A1/WR
OE
t
XCLKH
t
(CEL-OEL)1
S6S2S3S4S5S6S2S3S4S1S1S5S4
t
XCLKL
T
CY(XCLK)
S1 to S6: one machine cycle
(2)
t
(CEH-OEH)1
t
(OEL)1
t
(CEL-OEL)4
t
(CEH-OEH)4
SZF2002
t
(CEL)1
CE
t
t
(CEL-WEL)1
WE
t
su(DZ-OEL)
D0 to D7
A0 to A17
(1) A0 to A3 alternative functions (PSEN, ALE, WR andRD) show Debug mode timing; data bus carries low address on falling ALE edge.
(2) Skipped ALE pulse because of MOVX instruction.
(3) (Last) data sample moment.
code in
t
su(A-CEL)1
CODE FETCH
t
(CEL-DV)3
WRITE( )/READ( )
t
(WEL)1
t
su(OE-D)2
t
su(CEL-D)2
t
su(D-SM)2
data outdata in
t
su(D-WEL)3
Data sample moment
t
h(CEH-A)1
(CEH-WEH)1
t
h(DZ-OEH)
t
h(WEH-D)3
t
h(SM-D)2
(3)
t
su(CEL-D)4
t
su(OE-D)4
code in
Code sample moment
t
su(A-CEL)4
CODE FETCH
t
su(D-SM)4
t
h(SM-D)4
(3)
t
code in
h(CEH-A)4
CODE FETCH
MGM354
Fig.29 External program memory access, w.r.t. CE, OE, and WE.
1998 Aug 2668
Page 69
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
Table 57 Timing figures with respect to RAMCE, OE and WEL
SYMBOLPARAMETERMIN.TYP.MAX.UNIT
General (see Fig.29)
t
XCLKH
t
XCLKL
T
cy(XCLK)
Memory Access (Figs 29 and 30)
t
(RCEL-OEL)
t
(OEL)
t
(RCEH-OEH)
t
(RCEL)
t
(RCEL-WEL)
t
(WEL)
t
(RCEH-WEH)
t
su(OEL-D)
t
su(RCEL-D)
t
su(D-WEL)
t
(RCEL-DV)
t
su(D-SM)
t
h(SM-D)
t
h(WEH-D)
t
h(RCEH-D)
t
su(A-RCEL)
t
h(RCEH-A)
t
su(DZ-OEL)
t
h(OEH-DZ)
XCLK HIGH time31.25−−ns
XCLK LOW time31.25−−ns
XCLK cycle time62.5−−ns
RAMCE LOW to OE LOW−−
OE LOW time−−
1
⁄
t
− 3ns
2
CLK
7
⁄
t
+8ns
2
CLK
RAMCE HIGH to OE HIGH0−6ns
RAMCE LOW time−−4t
RAMCE LOW to WE LOW−−
WE LOW time−−
− 1ns
CLK
1
⁄
t
− 2ns
2
CLK
7
⁄
t
+7ns
2
CLK
RAMCE HIGH to WE HIGH0−7ns
Data set-up time from OE LOW−−3t
Data set-up time from RAMCE LOW−−
Data set-up time to WE LOW−−
− 18ns
CLK
7
⁄
t
− 20ns
2
CLK
1
⁄
t
+3ns
2
CLK
Data valid time from RAMCE LOW−−4ns
Data set-up time to sample moment, note 1−−8ns
Data hold time from sample moment; note 10−−ns
Data hold time from WE HIGH−−t
Data hold time from RAMCE HIGH−−t
Address set-up time to RAMCE LOW−−
Address hold time from RAMCE HIGH−−t
Data bus high-impedance set-up time to OE LOW
Data bus high-impedance hold time from OE HIGH
1
⁄2t
+1−−ns
CLK
1
⁄2t
− 10−−ns
CLK
− 7ns
CLK
− 14ns
CLK
1
⁄
t
2
CLK
− 7ns
CLK
ns
Notes
1. Sample moment for data read cycles is on negative clock edge in state S3, the internal clock skew must be taken
into account also. This results in 3t
− 10 ns from OE LOW (or7⁄2t
CLK
− 10 ns from RAMCE LOW) maximum.
CLK
1998 Aug 2669
Page 70
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
handbook, full pagewidth
XCLK
(1)
A2/ALE
(1)
A3/PSEN
(1)
A0/RD
(1)
A1/WR
t
XCLKH
t
(RCEL-OEL)
S6S2S3S4S5S6S2S3S4S1S1S5S4
t
XCLKL
S1 to S6: one machine cycle
(2)
t
(OEL)
t
(RCEH-OEH)
SZF2002
OE
RAMCE
WE
D0 to D7
A0 to A17
CODE FETCH
t
t
code in
su(DZ-OEL)
t
(CEL)
(RCEL-WEL)
t
t
(RCEL-DV)
t
su(A-RCEL)
(4)
WRITE( )/READ( )
t
(WEL)
su(RCEL-D)
t
su(OEL-D)
t
su(D-SM)
data outdata in
t
su(D-WEL)
Data sample moment
t
(RCEH-WEH)
t
h(SM-D)
(3)
t
h(OEH-DZ)
t
h(WEH-D)
Code sample moment
t
h(RCEH-A)
CODE FETCH
code in
(4)
(3)
CODE FETCH
code in
(4)
MGM355
(1) A0 to A3 alternative functions (PSEN, ALE, WR and RD) show Debug mode timing (Data bus carries low address on falling ALE edge.
(2) Skipped ALE pulse because of MOVX instruction.
(3) (Last) data sample moment.
(4) Code fetch only if CE is active (not shown). CE and RAMCE are never active at the same time.
Fig.30 External RAM access w.r.t. RAMCE, OE and WE.
1998 Aug 2670
Page 71
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
28 PACKAGE OUTLINE
LQFP80: plastic low profile quad flat package; 80 leads; body 12 x 12 x 1.4 mm
c
y
X
A
6041
61
Z
40
E
SZF2002
SOT315-1
e
w M
b
p
80
1
DIMENSIONS (mm are the original dimensions)
mm
A
max.
1.6
0.16
0.04
UNIT
Note
1. Plastic or metal protrusions of 0.25 mm maximum per side are not included.
pin 1 index
e
A1A2A3bpcE
1.5
0.25
1.3
w M
b
p
D
H
D
0.27
0.18
0.13
0.12
21
20
Z
D
B
v M
0510 mm
(1)
(1)(1)(1)
D
12.1
11.9
eH
12.1
0.5
11.9
v M
scale
B
H
D
14.15
13.85
E
A
14.15
13.85
H
E
E
A
2
A
LL
p
0.75
0.30
(A )
A
1
L
detail X
Z
D
0.150.10.21.0
1.45
1.05
3
L
p
Zywvθ
E
1.45
1.05
o
7
o
0
θ
OUTLINE
VERSION
SOT315-1
IEC JEDEC EIAJ
REFERENCES
1998 Aug 2671
EUROPEAN
PROJECTION
ISSUE DATE
95-12-19
97-07-15
Page 72
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
29 SOLDERING
29.1Introduction
There is no soldering method that is ideal for all IC
packages. Wave soldering is often preferred when
through-hole and surface mounted components are mixed
on one printed-circuit board. However, wave soldering is
not always suitable for surface mounted ICs, or for
printed-circuits with high population densities. In these
situations reflow soldering is often used.
This text gives a very brief insight to a complex technology.
A more in-depth account of soldering ICs can be found in
our
“Data Handbook IC26; Integrated Circuit Packages”
(order code 9398 652 90011).
29.2Reflow soldering
Reflow soldering techniques are suitable for all LQFP
packages.
Reflow soldering requires solder paste (a suspension of
fine solder particles, flux and binding agent) to be applied
to the printed-circuit board by screen printing, stencilling or
pressure-syringe dispensing before package placement.
Several methods exist for reflowing; for example,
infrared/convection heating in a conveyor type oven.
Throughput times (preheating, soldering and cooling) vary
between 50 and 300 seconds depending on heating
method. Typical reflow peak temperatures range from
215 to 250 °C.
29.3Wave soldering
SZF2002
If wave soldering cannot be avoided, for LQFP
packages with a pitch (e) larger than 0.5 mm, the
following conditions must be observed:
• A double-wave (a turbulent wave with high upward
pressure followed by a smooth laminar wave)
soldering technique should be used.
• The footprint must be at an angle of 45° to the board
direction and must incorporate solder thieves
downstream and at the side corners.
During placement and before soldering, the package must
be fixed with a droplet of adhesive. The adhesive can be
applied by screen printing, pin transfer or syringe
dispensing. The package can be soldered after the
adhesive is cured.
Maximum permissible solder temperature is 260 °C, and
maximum duration of package immersion in solder is
10 seconds, if cooled to less than 150 °C within
6 seconds. Typical dwell time is 4 seconds at 250 °C.
A mildly-activated flux will eliminate the need for removal
of corrosive residues in most applications.
29.4Repairing soldered joints
Fix the component by first soldering two diagonallyopposite end leads. Use only a low voltage soldering iron
(less than 24 V) applied to the flat part of the lead. Contact
time must be limited to 10 seconds at up to 300 °C. When
using a dedicated tool, all other leads can be soldered in
one operation within 2 to 5 seconds between
270 and 320 °C.
Wave soldering is not recommended for LQFP packages.
This is because of the likelihood of solder bridging due to
closely-spaced leads and the possibility of incomplete
solder penetration in multi-lead devices.
CAUTION
Wave soldering is NOT applicable for all LQFP
packages with a pitch (e) equal or less than 0.5 mm.
1998 Aug 2672
Page 73
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
SZF2002
6-kbyte embedded RAM
30 DEFINITIONS
Data sheet status
Objective specificationThis data sheet contains target or goal specifications for product development.
Preliminary specificationThis data sheet contains preliminary data; supplementary data may be published later.
Product specificationThis data sheet contains final product specifications.
Limiting values
Limiting values given are in accordance with the Absolute Maximum Rating System (IEC 134). Stress above one or
more of the limiting values may cause permanent damage to the device. These are stress ratings only and operation
of the device at these or at any other conditions above those given in the Characteristics sections of the specification
is not implied. Exposure to limiting values for extended periods may affect device reliability.
Application information
Where application information is given, it is advisory and does not form part of the specification.
31 LIFE SUPPORT APPLICATIONS
These products are not designed for use in life support appliances, devices, or systems where malfunction of these
products can reasonably be expected to result in personal injury. Philips customers using or selling these products for
use in such applications do so at their own risk and agree to fully indemnify Philips for any damages resulting from such
improper use or sale.
32 PURCHASE OF PHILIPS I
Purchase of Philips I
components in the I2C system provided the system conforms to the I2C specification defined by
Philips. This specification can be ordered using the code 9398 393 40011.
2
C COMPONENTS
2
C components conveys a license under the Philips’ I2C patent to use the
1998 Aug 2673
Page 74
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
NOTES
SZF2002
1998 Aug 2674
Page 75
Philips SemiconductorsProduct specification
Low voltage 8-bit microcontroller with
6-kbyte embedded RAM
NOTES
SZF2002
1998 Aug 2675
Page 76
Philips Semiconductors – a worldwide company
Argentina: see South America
Australia: 34 Waterloo Road, NORTH RYDE, NSW 2113,
United States: 811 East Arques Avenue, SUNNYVALE, CA 94088-3409,
Tel. +1 800 234 7381
Uruguay: see South America
Vietnam: see Singapore
Yugoslavia: PHILIPS, Trg N. Pasica 5/v, 11000 BEOGRAD,
Tel. +381 11 625 344, Fax.+381 11 635 777
For all other countries apply to: Philips Semiconductors,
International Marketing & Sales Communications, Building BE-p, P.O. Box 218,
5600 MD EINDHOVEN, The Netherlands, Fax. +31 40 27 24825
The information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed
without notice. No liability will be accepted by the publisher for any consequence of its use. Publication thereof does not convey nor imply any license
under patent- or other industrial or intellectual property rights.
Internet: http://www.semiconductors.philips.com
Printed in The Netherlands455104/100/01/pp76 Date of release: 1998 Aug 26Document order number: 9397 750 02944
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.