Signetics: Microcontroller Users' Guide
Signetics: Microcontroller Users' Guide
Signetics: Microcontroller Users' Guide
Signetics
Microcontroller
Users'
Guide
PHILIPS
SCN8031 AH/SCN8051 AH SC80C31B/SC80C51B SC87C51 S83C751
~ INDEX
"""tj
Pl.D 1 40 Vee 40 Vee P3A 1 24 Vee
39 PO.O/ADO 23 P3.5
P1.1~ 39 PO. alA DO 7 0 39 P3.3~
P3.2~ 22 P3.6
:::!~
38 PO.t/ADt
Lec 21 P3.7
:~:~+
~ PO.2/AD2
20 P1.7/TO
PtA 5 ~ PO.3/AD3
17 29 PO.2 6 DIP ~ P1.6/INTl
P1.5 6 35 POA/AD4
Pl.B 7 34 PO.5/AD5 18 28 PO.l/SDA 7 18 P1.S/INTO
Pt.? 8 33 PO.S/AD6 TOP VIEW PO.O/SCL 8 17 P1A
15 P1.3
RST~ 32 PO.l/AD? Pin Function Pin Function RST , ;
DIP 15 P1.2
~~ ~
RxD/P3.0~ DIP 31 EA 1 NC 23 NC
2 PloD 24 P2.0/A8 14 Pl.1
,~~~;:~:: ~
30 ALE 3 P1.1 P2.lIA9
25
29 PSEN 4 Pl.2 26 P2.2/Al0 Vss 12 13 P1.0
M1/P3.313 ~ P2.7/A15
5
6
P1.3
Pl.4
27
28
P2.3/Al1
P2.4/A12
28 P2.7IA1S -
TOP VIEW
TO/P3.4 14
Tl/P3.515
27 P2.S/A14
26 P2.5JA13
,
7 Pl.5
P1.6
29
30
P2.5/A13
P2.6/A14 Tl/P3.5 15
27 P2.6/A14
26 P2.5/A13 INDEX
~/P3.6~ 25 P2.4/A12
9
10
Pl.?
RST
31
32
P2.7/A15
PSEN
WR/P3.6 16 25 P2.4/A12 CORNER 4 ~ 2. 25
11 RxD/P3.0 33 ALE RD/P3.7 17 24 P2.3/A11
R~~~:*
24 P2.3/Al1 G5
12 NC 34 NC XTAL2 18 23 P2.2/Al0
23 P2.2/Al0 13 TxD/P3.1 EA
35 PLCC
XTAl119 14 mT6/P3.2 PO.7/AD? XTAL1 19 22 P2.1/A9
22 P2.1/A9 36
Vss 20 15 iiii'i"i/P3.3 37 PO.6/ADe Vss 20 21 P2.0/A8
21 P2.0/A8 11 19
16 TOJP3.4 38 PO.5/AD5
"ToPViEW 17 T1/P3.S 39 POAIAD4 TOP VIEW
:r
18 WR/P3.6 40 PO.3/AD3 12 18
INDEX INDEX
19 1m!?3.? 41 PD.2/AD2 TOP VIEW
CORNER 6 1 40 XTAL2
20 42 PO.l/AD'
r~J 00"") ,:
21 XTALl 43 PO.C/ADO PI" Function Pin Function
Vee
'cr
22 V" 44 1 P3.4 15 Pl.0
2 P3.3 1. Pl.l
6 1 40
PLee 3 P3.2 17 Pl.2
4 P3.1 18 Pl.3
17 29 17 29 5 N.C. 19 P1.4_
,•
P3.0 20 Pl.S/INTO
18 28 QF? 18 28 7 PO.2 21 N.C.
PO.1/SDA 22 N.C.
TOP VIEW TOP VIEW 9 PO.O/SCL 23 Pl.6/INTl
PI" Function PI" Function 17 0 29 Pin FUnction Pin Function 10 N.C.
RST
24
25
P1.7/TO
P3.7
1
2
NC
P1.0
23
24
NC
P2.0/A8 18 28
1
2
3
NC
Pl.0
Pl.l
23
24
NC
P2.0/A8 "
12
13
X2
Xl
26
27
P3.6
P3.5
3 Plot 25 P2.t/A9 TOP VIEW 25 P2.1/A9
4 P1.2 P2.2/Al0 4 P1.2 26 P2.2/A10 14 V" 28 Vee
26 Pin Function Pin Function
5 Pl.3 27 P2.3/Al1 5 Pl.3 27 P2.3/Al1
6 Pl.4 P2A/A12 1 NC 23 V" 6 P1A 28 P2A/Al2
28
7 P1.S 29 P2.5/A13 2
3
PloD
Pl.1
24
25
P2.D/A8
P2.1/A9
7 Pl.5 29 P2.5/A13 S87C752
8 P1.6 30 P2.6/A14 8 Pl.6 30 P2.6/A14
4 P1.2 26 P2.2/Al0 9 Pl.? 31 P2.7IA15
9 Pt.? 31 P2.7/A15 P2.3/Al1
RST PSEN
5 Pl.3 27 10 RST 32 ~
10 32 P2.4/A12
6 Pl.4 28 11 RxD/P3.0 33 ALE/i'i1WG
11
12
13
RxD/P3.0
NC
IxD/P3.1
33
34
35
ALE
NC
EA
,
7
9
P1.5
Pl.6
Pl.?
29
30
P2.5/A13
P2.6/A14
P2.7/A15
12
13
NC
TxD/P3.1
34
35
NC
~lVpp
31 14 iNIo/P3.2 36 PO.7/AD7
14 mro/P3.2 36 PO.l/AD?
10 RST 32 ~ 15 mfi/P3.3 37 PO.6/AD6
15 INTt IP3.3 37 PO.B/ADS 11 RxD/P3.0 ALE
33 1S TO/P3A 38 PO.5/ADS
16 TO/P3.4 38 PO.S/ADS NC
12 NC 34 17 T1/P3.S 39 POAfAD4
17 Tl/P3.5 39 POA/AD4 13 TxD/P3.1 ~
35 18 WF'l/P3.6 40 PO.3/AD3
18 WR/P3.6 40 PO.3/AD3 14 ilimi/P3.2 PO.7/AD?
36 19 1'IT5/P3.7 41 PO.2/AD2
19 AD/P3.? 41 PO.2IAD2 15 INn/P3.3 37 PO.s/ADe
20 XTAL2 42 PO.t/ADt 20 XTAL2 42 PO.lIADl
16 TO/P3.4 38 PO.5/AD5 21 XTAL1
21 XTAL1 43 PO.D/ADO 43 PO.O/ADO
17 T1/P3.S 39 PO.4/AD4 22 Vss 44 Vee
22 V" 44 Vee 18 WR/P3.6 40 PO.3/AD3
19 M/P3.? 41 PO.2/AD2
20 XTAL2 42 PO.l/ADl S87C751
21 XTALl 43 PO.a/ADO
22 V" 44 Vee
P3AIA4 1
SC80C31B/SC80C51B P3.3/A3 2
P3.2/;~b 3
P1.0 1 40 Vee
P3.1/A~~ 4
Pl,' 2 ~ PO.a/ADO
Pl.2 3 38 PO.l/ADl P3.0/A~£ S
Pl.3 4 37 PO.2/AD2
PO.21Vpp 6 TOP VIEW
P1.4 5 36 PO.3/AD3
PO.l/SDAI
OE-PGM 7 INDEX
P1.5 6 35 POA/AD4
P1.6 7 ~ PO.5/AD5 Po.O/!~~L 8 eORNER
1 G26
4 25
Pl.7 8 33 PO.6/ADS
RST 9 32 PO.71AD7
PLCC
RxD/P3.0 10 DIP 31 EA
TxD/P3.1 11
~~~~N
11 19
INTO/P3.2 12
12 18
iNTI/P3.3 13 28 P2.7/A1S
TOP VIEW
TO/P3.4 14 27 P2.6/A14 TOP VIEW
Tl/P3.S 1S 26 P2.S/A13 INDEX Pin Function Pin Function
1 P3.4/A4 15 Pl.2/ADC2/D2
WR/P3.6 16 2S P2A/A12 CORNE,R 4 : 2. 25 2 P3.3/A3 16 Pl.3/ ADC3/o3
M/P3.7 17 24 P2.3/Al1 3 P3.2/A2fAl0 17 Pl.4/ADC4/D4
G5 4 P3.1/Al/AS 18 AVss
XTAL2 18 23 P2.2/Al0 19 AVee_
PLCC 5 P3.0/AO/A8
20 Pl.5/INTO/D5
XT:~: t¥o
22 P2.1/A9 6 PO.21Vpp
7 PO.1/SDA/ 21 Pl.6/INT1/D6
21 P2.0/A8 11 19 22 Pl.7/TO/D7
OE-PGM
TOP VIEW 8 po.o/seLl 23 PO.3
12 18 ASEL 24 PO.4/PWM
9 RST OUT
TOP VIEW
10 X2 25 P3.7/A7
Pin Function Pin Function 11 Xl 26 P3.6/A6
1 P3.4/A4 15 Pl.D/oO 12 Vss 27 P3.5/AS
2 P3.3/A3 16 P1.1/Dl 13 P1.0/ADCO/DO 28 Vee
3 P3.2/A2/A10 17 Pl.2/D2 14 P1.1/ADC1!D1
See inside of back cover for additional pins. 4 P3.1/Al/A9 18 Pl.3/D3
NOTE:
5 N.C. 19 Pl.4/D4
6 P3.0/AO/A8 20 Pl.siiNf'O/DS AO-A10 and 00-07 available for EPROM
7 PO.21Vpp 21 N.C. verify only.
8 PO.l/SDAI 22 N.C.
DE-PGM 23 P1.6/INT1/D6
PO.O/SCLI 24 Pl.7/TO/D7
ASEL 25 P3.7/A7
10 N.C. 26 P3.6/A6
11 RST 27 P3.S/AS
12 X2 28 Vee
13 Xl
14 Vss
Signefics Microcontroller
Users' Guide
Microprocessor Products
Signetics reserves the right to make changes, without notice, in the products, including
circuits, standard cells, and/orsoftware, described or contained herein in order to improve
design andlor performance. Signetics assumes no responsibility or liability for the use of
any of these products, conveys no license or title under any patent, copyright, or mask
work right to these products, and makes no representations or warranties that these prod-
ucts are free from patent, copyright, or mask work right infringement, unless otherwise
specified. Applications that are described herein for any of these products are for illustra-
tive purposes only. Signetics makes no representation or warranty that such applications
will be suitable for the specified use without further testing or modification. Portions of this
users' guide are printed under a license from Intel Corporation.
LIFE SUPPORT APPLICATIONS
Signetics Products are not designed for use in life support appliances, devices, or systems
where malfunction of a Signetics Productcan reasonably be expected to result in a person-
al injury. Signetics customers using or selling Signetics' Products for use in such applica-
tions do so at their own risk and agree to fully indemnify Signetics for any damages result-
ing from such improper use or sale.
Microprocessor Products
April 1989 v
Signetics Section 1
8051 Family
Microprocessor Products
INDEX
Family Overview .......................................... 1-1
8051 .................................................. 1-1
8051AH ................................................ 1-1
80C51 BH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-1
8052AH ................................................ 1-1
83C451 ................................................ 1-1
~C~ ............................................... 1~
83C652 ................................................ 1-3
83C751 ................................................ 1-3
83C752 ................................................ 1-3
Architecture . . . . . . . . . . . . ...................... 1-4
Members of the Family .................................... 1-4
8051 ................................................ 1-4
8051AH .............................................. 1-4
80C51 BH ............................................ 1-4
8051 Family Devices Memory Organization .................... 1-4
Program Memory ........................................ 1-4
Data Memory ............................................ 1-6
8051 Family Instruction Set ................................. 1-8
Program Status Word ..................................... 1-8
Addressing Modes ....................................... 1-8
Direct Addressing ........................................ 1-8
Indirect Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-8
Register Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-8
Register-Specific Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-8
Immediate Constants ..................................... 1-9
Indexed Addressing ...................................... 1-9
Arithmetic Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-9
Logical Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-10
Data Transfers ......................................... 1-11
Internal RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-11
External RAM . ....................................... 1-12
LookupTables ........................................ 1-12
Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-13
Relative Offset ....................................... 1-14
Jump Instructions ..................................... 1-14
CPU Timing ............................................ 1-15
Machine Cycles ......................................... 1-15
Interrupt Structure ....................................... 1-16
Interrupt Enables ..................................... 1-16
Interrupt Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-16
Simulating a 3rd Priority Level in Software .................. 1-18
Hardware Description
Special Function Registers ................................ 1-21
Accumulator ......................................... 1-21
B Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-21
Program Status Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-21
Stack Pointer ........................................ 1-21
Data Pointer ......................................... 1-21
Ports 0 to 3 .......................................... 1-21
Serial Data Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1-22
Timer Registers Basic to 8051 ........................... 1-22
Control Registers for the 8051 ........................... 1-22
Microcontroller Users' Guide
INDEX (Continued)
The 8051AH is identical to the 8051, but is fabricated All other aspects of the 83C451 are identical to the
with HMOS II technology. It is pin-for-pin compatible 80C5l. The 87C451 is the EPROM version of this de-
with the 805l. The ROMless version of the 8051AH is vice.
the 8031AH.
-<
~
, 1
~
o
!a
i%
CD
(l)
CD
r -TiiiER2 .....
CAPTURE/ :J s::
0"
1 1 COMPARE 1_ -L o
ARRAY u
1_
~
EXTERNAL 1 (~C5E)-,
8K ROM TlMER~ _
INTERRUPTS
1 IN 8052
83C652
1- (83C552) I COUNTER
en
83C552 1 256 RAM ri'ii1En-_ INPUTS Q
\l
IN 8052 (8052)
8OC652
I
o
C.
128
80C552 c:
2K ROM
84 RAM ~
"II IN 83C751
~. IN 83C751
c 83C752 I > < II
83C752
iil
~
(l)
o
...
01
-:
~.
~
J
I\)
~
ED I/O SCL 12 C
g 4 I/O PORTS
PORT 1
SDA
SERIAL
PORT
]"
~
S!
~
i ~ I
-= WATCHDOG
TXD RXD
TIMER co
(63C552)
o
,PO P2, P1 P3 P~P5-P8
01
-L
FIXED RATEj •
ADDRESS/DATA
TIMER ~
(83C751/2) NOTES:
Po-P3 FOR 8051. 8052. 83C852
3
Po-P5 FOR 83C552 '<
PO-P6 FOR 83C451
PART OF PO. AND Pl. P3 FOR 83C75l AND 83C752
2
CD
c
~en-
<
~.
G)
c:
a:CD
Signetics Microprocessor Products User's Guide
The 83C552 is 100% code compatible with the 80C5l. The EPROM version of the 83C751 is the 87C75l.
The ROMless version of the 83C552 is the 80C552 and
the EPROM version is the 87C552. 83C752
• 8-bit CPU optimized for control applications Program memory can only be read, not written to.
• Extensive Boolean processing (single-bit logic) There can be up to 64K bytes of program memory. In
capabilities the 8051, 8051AH, 80C51BH, and their EPROM ver-
• 32 bi-directional and individually addressable I/O lines sions, the lowest 4K bytes of program memory are on-
• 128 bytes of on-chip data RAM chip. In the ROMless versions (8031, 8031AH,
• Two 16-bit timer/counters 80C31BH) all program memory is external. The read
• Full duplex UART strobe for external program memory is the !'SEN (pro-
• 5 source interrupt structure with 2 priority levels gram store enable).
• On-chip clock oscillator
• 4K bytes of on-chip program memory Data Memory occupies a separate address space from
• 64K program memory address space Program Memory. Up to 64K bytes of external RAM can
• 64K data memory address space be addressed in the external Data Memory space.. The
CPU generates read and write signals, RD and WR, as
The 8031 differs from the 8051 in not having the on-chip needed during external Data Memory accesses.
program ROM. Instead, the 8031 fetches all instructions
from external memory. External Program Memory and external Data Memory
may be combined if desired by applying the RD and
8051AH PSEN signals to the inputs of an AND gate and using
the output of the gate as the read strobe to the external
The 8051AH is identical to the 8051, but is fabricated Program/Data memory.
with HMOS II technology. It is pin-for-pin compatible
with the 8051. The ROMless version of the 8051AH is PROGRAM MEMORY
the 8031AH.
Figure 4 shows a map of the lower part of the Program
8OC51BH Memory. After reset, the CPU begins execution from
location OOOOH. As shown in Figure 4, each interrupt is
The 80C5IBH is the CHMOS version of the 8051. assigned a fixed location in Program Memory. The inter-
Functionally, it is fully compatible with the 8051, but rupt causes the CPU to jump to that location, where it
being CMOS it draws less current than the HMOS commences execution of the service routine. External
counterpart. To further exploit the power savings avail- Interrupt 0, for example, is assigned to location 0003H.
able in CMOS circuitry, two reduced power modes are If External Interrupt 0 is going to be used, its service
added: routine must begin at location 0003H. If the interrupt is
not going to be used, its service location is available as
1. Software-invoked idle mode, during which the CPU general purpose Program Memory.
is turned off while the RAM and other on-chip pe-
ripherals continue operating. In this mode, current The interrupt service locations are spaced at 8-byte
draw is reduced to about 15% of the current drawn intervals: 0003H for External Interrupt 0, OOOBH for
when the device is fully active. Timer 0, 0013H for External Interrupt 1, 00IBH for
2. Software-invoked power down mode, during which all Timer 1, etc. If an interrupt service routine is short
on-chip activities are suspended. The on-chip RAM enough (as is often the case in control applications), it
continues to hold its data. In this mode the device can reside entirely within that 8-byte interval. Longer
typically draws less than 1O~. service routines can use a jump instruction to skip over
subsequent interrupt locations, if other interrupts are in
Although the 80C51BH is functionally compatible with its use.
HMOS counterpart, specific differences between the two
types of devices must be considered in the design of an The lowest 4K bytes of Program Memory can either be
application circuit if one wishes to ensure complete in the on-chip ROM or in an external ROM. This
interchangeability between the HMOS and CHMOS de- selection is made by strapping the EA (External Access)
vices. The ROMless version of the 80C51BH is the pin to either Vee, or Vss.
80C3IBH. The EPROM version is the 87C51.
EXTERNAL
INTERRUPTS
128 COUNTER
RAM INPUTS
TXD RXD
,!O
.
ADDRESS/DATA
P2, PI P3
PROGRAM MEMORY
(READ ONLY)
_________ DATA MEMORY
J!~2~~~~~ ________ _
.------------------------
• FFFFH: , . . - - -... FFFFH: r----,
EXTERNAL
INTERNAL
FFH:~------I""'"'';;'''--'
••
EA=O
EXTERNAL
EA=!
INTERNAL
••
00 _ _ __
....."'T'.....I~OOOO -+11-.._.....1 OOOO""~-r"
._-------------------
o and 2) are dedicated to bus functions during external Figure 4. 8051 Program Memory
Program Memory fetches. Port 0 (PO in Figure 5) serves
as a multiplexed address/data bus. It emits the low byte
of the Program Counter (PCL) as an address, and then
goes into a float state awaiting the arrival of the code
byte from the Program Memory. During the time that
the low byte of the Program Counter is valid on Port 0,
the signal ALE (Address Latch Enable) clocks this byte 8051 EPROM
into an address latch. Meanwhile, Port 2 (P2 in Figure
5) emits the high byte of the Program Counter (PCH).
Then PSEN strobes the EPROM and the code byte is
read into the microcontroller.
LATCH
Program Memory addresses are always 16 bits wide,
even though the actual amount of Program Memory used
may be less than 64K bytes. External program execution P21======~
sacrifices two of the8-bit ports, PO and P2, to the
function of addressing the Program Memory.
Internal Data Memory is mapped in Figure 7. The Figure 6. Accessing External Data Memory.
memory space is shown divided into three blocks, which If the Program Memory is Internal, the other
are generally referred to as the Lower 128, the Upper
Bits of P2 are Available as 110
128, and SFR space.
7rH
~
LOWER BY DIRECT " ' - SPECIAL } PORTS { 18H
11
12B AND INDIRECT rUNCTION STATUS AND
17H
ADDRESSING REGISTERS CONTROL BITS 10 { BANKS or
0'--_ _--' 10H
TIMER REGISTERS
OrH
REGISTERS 01 { O-R7
STACK POINTER OBH
ACCUMULATOR 07H RESET VALUE or
(ETC.)
00 {0 STACK POINTER
Figure 7. Internal Data Memory Figure 8. Lower 128 Bytes of Internal RAM
EOH ACC
by these instructions. The bit addresses in this area are ADDRESSES THAT END IN
OOH through 7FH.
The Program Status Word (PSW) contains several status In indirect addressing the instruction specifies a register
bits that reflect the current state of the CPU. The PSW, which contains the address of the operand. Both internal
shown in Figure 11, resides in SFR space. It contains and external RAM can be indirectly addressed.
the Carry bit, the Auxiliary Carry (for BCD operations),
the two register bank select bits, the Overflow flag, a The address register for 8-bit addresses can be RO or
Parity bit, and two user-definable status flags. R1 of the selected bank, or the Stack Pointer. The
address register for 16-bit addresses can only be the 16-
The Carry bit, other than serving the function of a Carry bit "data pointer" register, DPTR.
bit in arithmetic operations, also serves as the "Accumu-
lator" for a number of Boolean operations. REGISTER INSTRUCTIONS
The bits RSO and RS1 are used to select one of the four The register ·banks, containing registers RO through R7,
register banks shown in Figure 8. A number of instruc- can be accessed by certain instructions which carry a 3-
tions refer to these RAM locations as RO through R7. bit register specification within the opcode of the in-
The selection of which of the four is being referred to is struction. Instructions that access the registers this way
made on the basis of the RSO and RS1 at execution are code efficient, since this mode eliminates an address
time. byte. When the instruction is executed, one of the eight
registers in the selected bank is accessed. One of four
The Parity bit reflects the number of 1s in the Accumu- banks is selected at execution time by the two bank
lator: P = 1 if the Accumulator contains an odd number select bits in the PSW.
of 1s, and P = 0 if the Accumulator contains an even
number of 1s. Thus the number of 1s in the Accumulator REGISTER-SPECIFIC INSTRUCTIONS
plus P is always even. Two bits in the PSW are un-
committed and may be used as general purpose status Some instructions are specific to a certain register. For
flags. example, some instructions always operate on the Accu-
mulator, or Data Pointer, etc., so no address byte is
needed to point to it. The opcode itself does that.
Instructions that refer to the Accumulator as A assemble
as accumulator specific opcodes.
I CY I AC I fO I RS,j Rsol OV I I P I
PSW 7 J L PSW 0
CARRY fLAG RECEIVES CARRY OUT PARITY Of ACCUWULATOR SET
fROW BIT 7 Of AlU OPERANDS BY HARDWARE TO 1 If IT CONTAINS
AN ODD NUWBER Of 1S. OTHERWISE
IT IS RESET TO 0
.-
PSW 6
AUXilIARY CARRY fLAG RECEIVES
' - - - PSW 1
USER DEfiNABLE fLAG
CARRY OUT fROW BIT 3 Of
ADDITION OPERANOS
PSW 5 PSW 2
GENERAL PURPOSE STATUS fLAG OVERflOW fLAG SET BY
ARITHWETIC OPERATIONS
PSW 4 PSW 3
REGISTER BANK SELECT BIT 1 REGISTER BANK SELECT BIT 0
The DIV AB instruction divides the Accumulator by the The addressing modes that can be used to access the
data in the B register and leaves the 8-bit quotient in the <byte> operand are listed in Table 4.
Accumulator, and the 8-bit remainder in the B register.
The ANL A, <byte> instruction may take any of the
Oddly enough, DIV AB finds less use in arithmetic forms:
"divide" routines than in radix conversions and program-
mable shift operations. An example of the use of DIV ANL A,7FH (direct addressing)
AB in a radix conversion will be given later. In shift ANL A,@Rl (indirect addressing)
operations, dividing a number by 2n shifts its n bits to ANL A,R6 (register addressing)
the right. Using DIV AB to perform the division com- ANL A,#53H (immediate constant)
pletes the shift in 4j.1S and leaves the B register holding
the bits that were shifted out. The DA A instruction is All of the logical instructions that are Accumulator-
for BCD arithmetic operations. In BCD arithmetic, specific execute in lj.lS (using a 12MHz clock). The
ADD and ADDC instructions should always be followed others take 2j.1S.
by a DA A operation, to ensure that the result is also in
BCD. Note that DA A will not convert a binary number Note that Boolean operations can be performed on any
to BCD. The DA A operation produces a meaningful byte in the internal Data Memory space without going
result only as the second step in the addition of two BCD through the Accumulator. The XRL <byte>, #data in-
bytes. struction, for example, offers a quick and easy way to
invert port bits, as in XRL PI, #OFFH.
LOGICAL INSTRUCTIONS
If the operation is in response to an interrupt, not using
Table 4 shows the list of 8051 logical instructions. The the Accumulator saves the time and effort to stack it in
instructions that perform Boolean operations (AND, OR, the service routine.
Exclusive OR, NOT) on bytes perform the operation on a
bit-by-bit basis. That is, if the Accumulator contains The Rotate instructions (RL A, RLC A, etc.) shift the
OOllOlOlB and byte contains OlO]OOl1B, then: Accumulator 1 bit to the left or right. For a left
rotation, the MSB rolls into the LSB position. For a
right rotation, the LSB rolls into the MSB position.
The SWAP A instruction interchanges the high and low TIle Upper 128 are not implemented in the 8051,
nibbles within the Accumulator. This is a useful opera- 8051AH, or 80C51BH, nor in their ROMless or EPROM
tion in BCD manipulations. For example, if the Accu- counterparts. With these devices, if the SP points to the
mulator contains a binary number which is known to be Upper 128, PUSHed bytes are lost, and POPed bytes
less than 100, it can be quickly converted to BCD by the are indeterminate.
following code:
The Data Transfer instructions include a 16-bit MOV
MOV B,#lO that can be used to initialize the Data Pointer (DPTR)
DIV AB for look-up tables in Program Memory, or for 16-bit
SWAP A external Data Memory accesses.
ADD A,B
The XCH A, <byte> instruction causes the Accumula-
Dividing the number by 10 leaves the tens digit in the tor and addressed byte to exchange data. The XCHD A,
low nibble of the Accumulator, and the ones digit in the @Ri instruction is similar, but only the low nibbles are
B register. TIle SWAP and ADD instructions move the involved in the exchange.
tens digit to the high nibble of the Accumulator, and the
ones digit to the low nibble. To see how XCH and XCHD can be used to facilitate
data manipulations, consider first the problem of shifting
DATA TRANSFERS an 8-digit BCD number two digits to the right. Figure
12 shows how this can be done using direct MOVs, and
INTERNAL RAM for comparison how it can be done using XCH instruc-
tions. To aid in understanding how the code works, the
Table 5 shows the menn of instructions that are avail- contents of the registers that are holding the BCD
able for moving data around within the internal memory number and the content of the Accumulator are shown
spaces, and the addressing modes that can be used with alongside each instruction to indicate their status after
each one. With a 12MHz clock, all of these instructions the instruction has been executed.
execute in either 1 or 2)lS.
After the routine has been executed, the Accumulator
The MOV <dest>, <src> instruction allows data to be contains the two digits that were shifted out on the right.
transferred between any two internal RAM or SFR loca- Doing the routine ,vith direct MOVs uses 14 code bytes
tions without going through the Accumulator. Remember and 9)lS of execution time (assuming a 12MHz clock).
the Upper 128 byes of data RAM can be accessed only The same operation with XCHs uses less code and exe-
by indirect addressing, and SFR space only by direct cutes almost twice as fast.
addressing.
To right-shift by an odd number of digits, a one-digit
Note that in all 8051 devices, the stack resides in on- shift must be executed.
chip RAM, and grows upwards. The PUSH instruction
first increments the Stack Pointer (SP), then copies the Figure 13 shows a sample of code that will right-shift a
byte into the stack. PUSH and POP use only direct ad- BCD number one digit, using the XCHD instruction.
dressing to identify the byte being saved or restored, but Again, the contents of the registers holding the number
the stack itself is accessed by indirect addressing using and of the Accumulator are shown alongside each in-
the SP register. TIlis means the stack can go into the struction.
Upper 128, if they are implemented, but not into SFR
space.
Table 5. Data Transfer Instructions that Access Internal Data Memory Space
EXTERNAL RAM
MOV Rl,#2EH Note that in all external Data RAM accesses, the Ac-
MOV RO,#2DH
cumulator is always either the destination or source of
loop for R1 = 2EH: the data.
LOOP: MOV A,@Rl 00 12 34 56 78 78
XCHD A,@RO 00 12 34 58 78 76 The read and write strobes to external RAM are acti-
SWAP A 00 12 34 58 78 67 vated only during the execution of a MOVX instruction.
MOV @R1,A 00 12 34 58 67 67 Normally these signals are inactive, and in fact if
DEC R1 00 12 34 58 67 67 they're not going to be used at all, their pins are avail-
DEC RO 00 12 34 58 67 67 able as extra I/O lines. More about that later.
CJNE R1,#2AH,LOOP
:~~~:~~=~ : 2BH:
loop for R1
~g~;
=
Iggl ~~I~~I:~I~~I ~~
08 01 23 45 67 01
LOOKUP TABLES
TIle mnemonic is MOVC for "move constant". 11,e first Table 8. 8051 Boolean Instructions
MOVC instruction in Table 7 can accommodate a table
of up to 256 entries numbered 0 through 255. 11,e Execution
Mnemonic Operation
Time (f£8)
number of the desired entry is loaded into the Accumu-
lator, and the Data Pointer is set up to point to begin- ANL C,bit C = C .AND. bit 2
ning of the table. Then: ANL C,Ibit C = C .AND .. NOT. bit 2
ORL C,bit C = C.OR.bit 2
MOVC A,@A+DPTR
ORL C,Ibit C = C .OR. .NOT. bit 2
copies the desired table entry into the Accumulator. MOV C,bit C = bit 1
MOV bit,C bit = C 2
The other MOVC instruction works the same way, ex-
CLR C C=O 1
cept the Program Counter (PC) is used as the table
base, and the table is accessed through a subroutine. CLR bit bit =0 1
First the number of the desired entry is loaded into the SETB C C-l 1
Accumnlator, and the subroutine is called: SETB bit bit = 1 1
MOV A, ENTRY NUMBER CPL C C = .NOT.C 1
CALL TABLE CPL bit bit = .NOT. bit 1
JC rei Jump if C = 1 2
The subroutine "TABLE" would look like this:
JNC rei JumpifC = 0 2
TABLE: MOVC A,@A+PC JB bit,rel Jump if bit =1 2
RET JNB bit, rei Jump if bit =0 2
Bit addresses OOH throngh 7FH are in the Lower 128, First, bill is moved to the Carry. If bit2 = 0, then C
and bit addresses 80H throngh FFH are in SFR space. now contains the correct result. That is, bill .XRL. bit2
= bill if bit2 = O. On the other hand, if bit2 = 1, C now
Note how easily an internal flag can be moved to a port contains the complement of the correct result. It need
pin: only be inverted (CPL C) to complete the operation.
MOV C,FLAG This code uses the JNB instruction, one of a series of
MOV Pl.O,C bit-test instructions which execute a jump if the ad-
dressed bit is set (JC, ID, mC) or if the addressed bit
In this example, FLAG is the name of any addressable is not set (JNC, JNB). In the above case, bit2 is being
bit in the Lower 128 or SFR space. An I/O line (the tested, and if bit2 = 0 the CPL C instruction is jumped
LSB of Port 1, in this case) is set or cleared depending over.
on whether the flag bit is 1 or O.
mc executes the jump if the addressed bit is set, and an 11-bit constant. The instruction is 2 bytes long, con-
also clears the bit. Thus a flag can be tested and sisting of the opcode, which itself contains 3 of the 11
cleared in one operation. address bits, followed by another byte containing the low
8 bits of the destination address. When the instruction is
All the PSW bits are directly addressable, so the Parity executed, these 11 bits are simply substituted for the low
bit, or the general purpose flags, for example, are also 11 bits in the Pc. The high 5 bits stay the same. Hence
available to the bit-test instructions. the destination has to be within the same 2K block as
the instruction following the NMP.
RELATIVE OFFSET
In all cases the programmer specifies the destination
The destination address for these jumps is specified to address to the assembler in the same way: as a label or
the assembler by a label or by an actual address in Pro- as a 16-bit constant. The assembler will put the destina-
gram memory. However, the destination address as- tion address into the correct format for the given instruc-
sembles to a relative offset byte. This is a signed (two's tion. If the format required by the instruction will not
complement) offset byte which is added to the PC in support the distance to the specified destination address,
two's complement arithmetic if the jump is executed. a "Destination out of range" message is written into the
List file.
The range of the jump is therefore -128 to + 127 Pro-
gram Memory bytes relative to the first byte following The JMP @A+DPTR instruction supports case jumps.
the instruction. The destination address is computed at execution time as
the sum of the 16-bit DPTR register and the Accumula-
JUMP INSTRUCTIONS tor. Typically, DPTR is set up with the address of a
jump table, and the Accumulator is given an index to the
Table 9 shows the list of unconditional jumps with execu- table. In a 5-way branch, for example, an integer 0
tion time for a 12MHz clock. through 4 is loaded into the Accumulator. The code to
be executed might be as follows:
Table 9. Unconditional Jumps in 8051 Devices
Execution
MOV DPTR,#JUMP TABLE
Mnemonic Operation MOV A,INDEx..NUMBER
Time (I£S)
RL A
JMP addr Jump to addr 2 JMP @A+DPTR
JMP @A+DPTR Jump to A + DPTR 2
CALL addr Call subroutine at addr 2 The RL A instruction converts the index number (0
through 4) to an even number on the range 0 through 8,
RET Return from subroutine 2 because each entry in the jump table is 2 bytes long:
RETI Return from interrupt 2
NOP No operation
JUMP TABLE:
1
NMP CASE 0
AJMP CASE 1
AJMP CASE 2
AJMP CASE 3
AJMP CASE 4
The Table lists a single "JMP addr" instruction, but in
Table 9 shows a single "CALL addr" instruction, but
fact there are three SJMP, LJMP and NMP, which dif-
there are two of them, LCALL and ACALL, which differ
fer in the format of the destination address. JMP is a
in the format in which the subroutine address is given to
generic mnemonic which can be used if the programmer
the CPU. CALL is a generic mnemonic which can be
does not care which way the jump is encoded.
used if the programmer does not care which way the ad-
The SJMP instruction encodes the destination address as dress is encoded.
a relative offset, as described above. The instruction is 2
The LCALL instruction uses the 16-bit address format,
bytes long, consisting of the opcode and the relative off-
and the subroutine can be anywhere in the 64K Program
set byte. The jump distance is limited to a range of -128
Memory space. The ACALL instruction uses the ll-bit
to +127 bytes relative to the instruction following the
SJMP. format, and the subroutine must be in the same 2K block
as the instruction following the ACALL.
The LJMP instruction encodes the destination address as
In any case the programmer specifies the subroutine ad-
a 16-bit constant. The instruction is 3 bytes long, con-
dress to the assembler in the same way: as a label or as
sisting of the opcode and two address bytes. The destina-
a 16-bit constant. The assembler will put the address in-
tion address can be anywhere in the 64K Program Mem-
ory space. to the correct format for the given instructions.
txTtRN4L
When the CPU is executing from internal Program
CLOCK XTAl.l Memory, PSEN is not activated, and program addresses
SIGHAL
vss are not emitted. However, ALE continues to he activated
twice per machine cycle and so it is available as a clock
output signal. Note, however, that one ALE is skipped
A. HMOS or CHMOS during the execution of the MOVX instruction.
HIrotOS
ontRMAL
ONLY INTERRUPT STRUCTURE
CLOCK
SIGN..L
The 8051, 8051AH, 80C5IBH, 83C451, and their
ROMless and EPROM versions, provide 5 interrupt
)O'4LI
sources: 2 external interrupts, 2 timer interrupts, and the
vss
serial port interrupt.
='"----
B. HMOS Only What follows is an overview of the interrupt structure for
these devices. More detailed information for specific
CHWO$
ONL'I' members of the 8051 family is provided in later chapters
(JoIC) XTALl of this handbook.
05C.
(XTAL2)
I 51 I 52 1 53 I
~~~~~~~~~~~~~~~~~~~~~~~~~~
54 I 55 1 III 1 51 I 52 I 53 I 54 I 55 1 56 1 51 I
ALE
------~~--_r--~Lo--_r~
I
(All.byte, l-cycle I n l _ , •.g., INC A.
I
I READ OPCODE.
I
: _ f _ R : NEXT OPCODE.
- - - - - - - - r-''--T---'-:-:-T-:':-t-=:-r-::-1
DATA
(01 MOVX (l-by1e, 2-cyc1e)
I ACCESS EXTERNAL MEMORY
ditions can block an interrupt, among them that an in- the stack, not the PSW or any other register. Having
terrupt of equal or higher priority level is already in only the PC be automatically saved allows the program-
progress. mer to decide how much time to spend saving which
other registers. This enhances the interrupt response
The hardware-generated LCAlL causes the contents of time, albeit at the expense of increasing the program-
the Program Counter to be pushed into the stack, and mer's burden of responsibility. As a result, many inter-
reloads the PC with the beginning address of the service rupt functions that are typical in control applications
routine. As previously noted (Figure 4), the service rou- toggling a port pin for example, or reloading a timer, or
tine for each interrupt begins at a fixed location. unloading a serial buffer can often be completed in less
time than it takes other architectures to complete.
Only the Program Counter is automatically pushed onto
1~1~1"1~1"IUI~~~I"I~I"IUI
ALE
PsEN
(A)
AD --------+-----------~-----------+------------T_----------~:----- WITHOUT A
I
I MOVX.
P2 p~......-P..:.C-'H-O-U-T~X'-+_'PC..:....H:...;O:...;U-T--JX PCH OUT X'-~-PC-H-O-U-T~~
PO
, I I
I I
ALE
PSEN
liD --,---;-----~'---- (B)
WITH A
MOVX.
lADDIIOUT t.PCLOUT
VALID VALID
Figure 17. Bus Cycles iu 8051 Family Devices Executing from External Program Memory
SIMULATING A THIRD PRIORITY LEVEL As soon as any priority interrupt is acknowledged, the
IN SOFTWARE Interrupt Enable (IE) register is redefined so as to dis-
able all but "priority 2" interrupts. Then a CALL to LA-
Some applications require more than two priority levels BEL executes the RETI instruction, which clears the
that are provided by on-chip hardware in 8051 devices. priority 1 interrupt-in-progress flip-flop. At this point
In these cases, relatively simple software can be written any priority 1 interrupt that is enabled can be serviced,
to produce the same effect as a third priority level. First but only "priority 2" interrupts are enabled.
interrupts that are to have higher priority than 1 are as-
signed to priority 1 in the Interrupt Priority (IP) regis- POPing IE restores the original enable byte. Then a
ter. The service routines for priority 1 interrupts that normal RET (rather than another RETI) is used to ter-
are supposed to be interruptable by "priority 2" inter- minate the service routine. The additional software adds
rupts are written to include the following code: 1OJ.lS (at 12MHz) to priority 1 interrupts.
PUSH IE
MOV IE,#MASK
CALL LABEL
**********
(execute service routine)
**********
POP IE
RET
LABEL: RETI
(MSB) (LSB)
I EA Ix I x IES IET1 IEXI IETO I EXO I (MSB) (LSB)
Figure 18. Interrupt Enable (IE) Register Figure 19. Interrupt Priority (lP) Register
HIGH PRIORITY
IE REGISTER IP REGISTER INTERRUPT
~~--~~~--~~~~
I
I
I
I
I
I
. ./
TF1----------------~~~~(>-t---~r<~~-l-----J~
I
I
I
r----~~~~_t~~_4~
RI
TI
TF2
EXF2 (8052 ONLY)
HARDWARE DESCRIPTION • The port drivers and how they function both as ports
and, for Ports 0 and 2, in bus operations
This chapter provides a detailed description of the 8051 • The Timers/Counters
microcontrollers (see Figure 21). Included in this de- • The Serial Interface
scription are: • The Interrupt System
• Reset
• The Reduced Power Modes in CHMOS devices
• The EPROM version of the 80C51BH
r
I
::EI'
I
Li~-----------
A Map of the on-chip memory area called Special Func- The PSW register contains program status information as
tion Register (SFR) space is shown in Figure 22. detailed in Figure 23.
Note that in the SFRs not all of the addresses are occu- STACK POINTER
pied. Unoccupied addresses are not implemented on the
chip. Read accesses to these addresses will in general The Stack Pointer register is 8 bits wide. It is incre-
return random data, and write accesses will have no ef- mented before data is stored during PUSH and CALL
fect. executions. While the stack may reside anywhere in on-
chip RAM, the Stack Pointer is initialized to 07H after
User software should not write Is to these unimple- a reset. This causes the stack to begin at locations 08H.
mented locations, since they may be used in other 8051
Family products to invoke new features. The function of DATA POINTER
the SFRs are described in the text that follows.
The Data Pointer (DPTR) consists of a high byte (DPH)
ACCUMULATOR and a low byte (DPL). Its intended function is to hold a
16-bit address. It may be manipulated as a 16-bit regis-
ACC is the Accumulator register. The mnemonics for ter or as two independent 8-bit registers.
Accumulator-Specific instructions, however, refer to the
Accumulator simply as A. PORTS 0 TO 3
8 BYTES
F'8 F'F'
F'O a F'7
E8 EF'
EO ACC E7
08 OF'
DO PSW 07
C8 CF'
CO C7
B8 IP BF'
BO P3 B7
A8 IE AF
AO P2 A7
98 SCON SBUF 9F
90 P1 97
B8 TCON TMOD TLO TL1 THO TH1 8F
eo PO SP DPL DPH PCON 87
-
alT
ADDRESSABLE
Figure 22. 80S1 SFR Memory Map
(MSB) (LSB)
AC FO RSl RSO OV P
Symbol PoeIllon Name and Slgnlflcllnca Symbol Poeltlon Name and SlpnlflCance
CY PSW.7 Carry flag. OV PSW.2 Overflow Ilag.
AC PSW.S Auxiliary Carry flag. PSW.l User definable flag.
(For BCD operations.) P PSW.O Parilyflag.
FO PSW.S Flag 0 Set/cleared by hardware each
(Available to the user for general ins1ruction cycle to Indicate an oddl
purposes.) even number Of "one" bits in the
RSl PSW.4 Register bank select control bits 1 & Accumulator. i.e•• even parity.
RSO PSW.3 O. Set/cl_ed by software to NOTE:
determine working register benk (_ The contents Of (RS1. RSO) aneble the working register banks as
follows:
Note). (O.O)-Bank 0 (OOH-07H)
(O.l)-Bank 1 (OBH-OFH)
(1.0)-8ank 2 (10H-17H)
(l.l)-Bank 3 (18H-1FH)
SERIAL DATA BUFFER All the Port 3 pins are multifunctional. They are not only
port pins, but also serve the functions of various special
The Serial Buffer is actually two separate registers, a features as listed below:
transmit buffer and a receive buffer register. When data
is moved to SBUF, it goes to the transmit buffer is held Port
for serial transmission. (Moving a byte to SBUF is what Pin Alternate Function
initiates the transmission.) When data is moved from P3.0 RxD (serial input port)
SBUF, it comes from the receive buffer. P3.1 TxD (serial output port)
P3.2 INTO (external interrupt)
TIMER REGISTERS BASIC TO 8051 P3.3 INTI (external interrupt)
P3.4 TO (Timer/Counter 0 external input)
Register pairs (TIm, TID), and (ml, 11..1) are the P3.5 Tl (Timer/Counter 1 external input)
16-bit Counting registers for Timer/Counters 0, and 1 P3.6 WR (external Data Memory write strobe)
respectively. P3.7 RD (external Data Memory read strobe)
CONTROL REGISTERS FOR THE 8051 The alternate functions can only be activated if the cor-
responding bit latch in the port SFR contains a 1. Oth-
Special Function Registers IP, IE, TMOO, TCON, erwise the port pin remains at O.
SCON, and PCON contain control and status bits for the
interrupt system, the Timer/Counters, and the serial I/O CONFIGURATIONS
port. They are described in later sections.
Figure 24 shows a functional diagram ofa typical bit
PORT STRUCTURES AND latch and I/O buffer in each of the four ports. The bit
OPERATION latch (one bit in the port's SFR) is represented as a
Type D flip-flop, which will clock in a value from the in-
All four ports in the 8051 are bidirectional. Each con- ternal bus in response to a "write to latch" signal from
sists of a latch (Special Function Registers PO through the CPU. The Q output of the flip-flop is placed on the
P3), an output driver, and an input buffer. internal bus in response to a "read latch" signal from the
CPU. The level of the port pin itself is placed on the in-
The output drivers of Ports 0 and 2, and the input buffers ternal bus in response to a "read pin" signal from the
of Port 0, are used in accesses to external memory. In CPU. Some instructions that read a port activate the
this application, Port 0 outputs the low byte of the exter- "read latch" signal, and others activate the "read pin"
nal memory address, time-multiplexed with the byte signal.
being written or read.
As shown in Figure 24, the output drivers of Port 0 and
Port 2 outputs the high byte of the external memory ad- 2 are switchable to an internal ADDR and ADDRI DA-
dress when the address is 16 bits wide. Otherwise, the TA bus by an internal CONTROL signal for use in exter-
Port 2 pins continue to emit the P2 SFR content.
REAO
Vcc LATCH
WRITE
TO
WRITE LATCH
TO
LATCH
READ
PIN
B. Port·1 Bit
A. PortO Bit ALTERNATE
OUTPUT
FUNCTION
AOOR
VCC READ
READ LATCH
LATCH
tNT. BUS
ALTERNATE
INPUT
FUNCTION
VCC
6D......... . . - - - - - - - -
a
FROM PORT
LATCH
READ
PORT PIN
Figure 25. Ports 1 and 3 HMOS and CHMOS Internal Pullup Configurations
Port 2 is similar except that it holds the strong pullup on while emitting
is that are address bits. (See Accessing External Memory).
If the change requires a 0-to-1 transition in Port 1, 2, In the CHMOS versions, the pullup consists of three
or 3, an additional pullup is turned on during SlP1 and pFETs. It should be noted that an n-channel FET
SlP2 of the cycle in which the transition occurs. This is (nFET) is turned on when a logical 1 is applied to its
done to increase the transition speed. The extra pullup gate, and is turned off when a logical 0 is applied to its
can source about 100 times the current that the normal gate. A p-channel FET (PFET is the opposite: it is on
pullup can. It should be noted that the internal pullups when its gate sees a 0, and off when its gate sees a 1.
pFET1 in Figure 25 is the transistor that is turned on It is not obvious that the last three instructions in this
for 2 oscillator periods after a 0-to-1 transition in the list are read-modifY-write instructions, but they are.
port latch. While it's on, it turns on pFET3 (a weak They read the port byte, all 8 bits, modify the addressed
pullup), through the inverter. TIlis inverter and pPET bit, then write the new byte back to the latch.
form a latch which hold the 1.
The reason that read-modifY-write instructions are di-
Note that if the pin is emitting a 1, a negative glitch on rected to the latch rather than the pin is to avoid a pos-
the pin from some external source can turn off pFET3, sible misinterpretation of the voltage level at the pin.
causing the pin to go into a float state. pFET is a very For example, a port bit might be used to drive the base
weak pullup which is on whenever the nFET is off, in of a transistor. Vllhen a 1 is written to the bit, the tran-
traditional CMOS style. It's only about 1/10 the strength sistor is turned on. If the CPU then reads the same port
of pFET3. Its function is to restore a 1 to the pin in the bit at the pin rather than the latch, it will read the base
event the pin had a 1 and lost it to a glitch. voltage of the transistor and interpret it as a O. Reading
the latch rather than the pin will return the correct val-
PORT LOADING AND INTERFACING ue of 1.
TIle output buffers of Ports 1, 2, and 3 can each drive 4 ACCESSING EXTERNAL
LS 1TL inputs. These ports on HMOS versions can be MEMORY
driven in a normal malller by any TTL or NMOS cir-
cuit. Both HMOS and CHMOS pins can be driven by Accesses to external memory are of two types: accesses
open-collector and open-drain outputs, but note that 0- to external Program Memory and accesses to external
to-1 transitions will not be fast. Data Memory. Accesses to external Program Memory
use signal PSEN (program store enable) as the read
In the HMOS device, if the pin is driven by an open- strobe. Accesses to external Data Memory use RD or
collector output, a 0-to-1 transition will have to be driv- WR (alternate functions of P3.7 and P3.6) to strobe the
en by the relatively weak depletion mode FET in Figure memory. Fetches from external Program Memory always
25(A). In the CHMOS device, an input 0 turns off use a 16-bit address. Accesses to external Data Memory
pullup pFET3, leaving only the very weak pullup pFET2 can use either a 16-bit address (MOVX @ DPTR) or an
to drive the transition. 8-bit address (MOVX @Ri).
Port 0 output buffers can each drive 8 LS TTL inputs. Whenever a 16-bit address is used, the high byte of the
TI,ey do, however, require external pullups to drive address comes out on Port 2, where it is held for the
NMOS inputs, except when being used as the AD- duration of the read or write cycle. Note that the Port 2
DRESS/DATA bus.
drivers use the strong pull ups during the entire time that
they are emitting address bits that are 1s. This is during
READ-MODIFY-WRITE FEATURE
the execution of a MOVX @DPTR instruction. During
Some instructions that read a port read the latch and this time the Port 2 latch (the Special Function Regis-
others read the pin. Which ones do which? The instruc- ter) does not have to contain 1s, and the contents of the
tions that read the latch rather than the pin are the ones Port 2 SFR are not modified. If the external memory
cycle is not immediately followed by another external
that read a value, possibly change it, and then rewrite it
to the latch. These are called "read-modify-write" in- memory cycle, the undisturbed contents of the Port 2
structions. The instructions listed below are read-modify- SFR will reappear in the next cycle.
'Write instructions. \\Thon the destination operand is a
If an 8-bit address is being used (MOVX @Ri), the con-
port, or a port bit, these instructions read the latch
tents of the Port 2 SFR remain at the Port 2 pins
rather than the pin:
throughout the external memory cycle. This will facili-
ANL tate paging.
(logical AND, e.g. ANL P1,A)
ORL (logical OR, e.g. ORL P2,A)
In any case, the low byte of the address is time-
XRL (logical EX-OR, e.g. XRL
multiplexed with the data byte on Port O. The ADDRI
P3,A)
JBC DATA signals drives both FETs in the Port 0 output
(jump if bit = 1 and clear
buffers. Thus, in this application the Port 0 pins are not
bit, e.g. JBC P1.1,LABEL)
open-drain outputs, and do not require external pull ups.
CPL (complement bit, e.g.
ALE (Address Latch Enable) should be used to capture
CPL P3.0)
the address byte into an external latch. The address byte
INC (increment, e.g. INC P2)
is valid at the negative transition of ALE. Then, in a
DEC (decrement, e.g. DEC P2)
write cycle, the data byte to be written appears on Port
DJNZ (decrement and jump if not
zero, e.g. DJNZ P3,LABEL)
o just before WR is activated, and remains there until
after WR is deactivated. In a read cycle, the incoming
MOV,PX.Y,C (move carry bit to bit Y of
byte is accepted at Port 0 just before the read strobe is
Port X)
deactivated.
CLR PX.Y (clear bit Y of Port X)
SET PX.Y (set bit Y of Port X)
During any access to external memory, the CPU writes In the "Counter" function, the register is incremented in
OFFH to the Port 0 latch (the Special Function Regis- response to a I-to-O transition at its corresponding ex-
ter), thus obliterating whatever information the Port 0 ternal input pin, TO or Tl. In this function, the external
SFR may have been holding. input is sampled during SSP2 of every machine cycle.
External Program Memory is accessed under two condi- When the samples show a high in one cycle and a low in
tions: Whenever signal EA is active; or whenever the the next cycle, the count is incremented. The new count
program counter (PC) contains a number that is larger value appears in the register during S3Pl of the cycle
than OFFFH (in the 8051). following the one in which the transition was detected.
Since it takes 2 machine cycles (24 oscillator periods)
This requires that the ROMless versions have EA wired to recognize a I-to-O transition, the maximum count rate
low to enable the lower 4K program bytes to be fetched is 1124 of the oscillator frequency. There are no restric-
from external memory. tions on the duty cycle of the external input signal, but
to ensure that a given level is sampled at least once be-
When the CPU is executing out of external Program fore it changes, it should be held for at least one full
Memory, all 8 bits of Port 2 are dedicated to an output cycle. In addition to the "Timer" or "Counter" selection,
function and may not be used for general purpose I/O. Timer 0 and Timer 1 have four operating modes from
During external program fetches they output the high which to select.
byte of the Pc. During this time the Port 2 drivers use
the strong pullups to emit PC bits that are Is. TIMER 0 AND TIMER 1
(MSB)
l GATE CIT Ml MO 1 GATE CIT J Ml
(lSB)
MO J
Timer 1
•
Timer 0
GATE Gating control when set. Timer/Counter "x" is enabled Ml MO Operating Mode
only while "INTx" pin is high and "TAx" control pin is o o 8048 Timer "TLx" se,:,ves as 5--blt prescaler.
set. When cleared Timer 'Ix" is enabled whenever o 16-bit Timer/Counter "THx" and "Tlx" are
"TAx" control bit is set.
cascaded; there is no prescaler.
CIT Timer or Counter Selector cleared for Timer operation
(input from internal system clock). Set for Counter
o 8-bit auto-reload Timer/Counter "THx" holds a
value which is to be reloaded into "Tlx" each
operation (input from "Tx" input pin).
time it overflows.
(Timer 0) TlO is an 8-bit TImer/Counter
controlled by the standard TImer 0 control bits.
THO is an 8-bit timer only controlled by Timer 1
control bits.
(Timer 1) Timer/Counter 1 stopped.
In this mode, the Timer register is configured as a 13- Timer 0 in Mode 3 establishes 1LO and 11f0 as two
bit register. As the count rolls over from all Is to all separate counters. The logic for Mode 3 on Timer 0 is
Os, it sets the Timer interrupt flag TF1. The counted in- shown in Figure 30. 1LO uses the Timer 0 control bits:
put is enabled to the Timer when IR1 = 1 and either CIT, GATE, IRO, INTO, and TFO. 11f0 is locked into a
GATE = 0 or INfl = 1. (Setting GATE = 1 allows the timer function (counting machine cycles) and takes over
Timer to be controlled by external input INf1, to facili- the use of IR1 and TF1 from Timer 1. Thus, 11f0 now
tate pulse width measurements). IR1 is a control bit in controls the "Timer 1" interrupt.
the Special Function Register TCON (Figure 28).
GATE is in TMOD. Mode 3 is provided for applications reqUlrmg an extra
8-bit timer on the counte~. With Timer 0 in Mode 3, an
The 13-Bit register consists of all 8 bits of 11f1 and the 8051 can look like it has three Timer/Counters. When
lower 5 bits of 1L1. The upper 3 bits of 1L1 are inde- Timer 0 is in Mode 3, Timer 1 can be turned on and off
terminate and should be ignored. Setting the run flag by switching it out of and into its own Mode 3, or can
(IR1) does not clear the registers. still be used by the serial port as a baud rate generator,
or in fact, in any application not requiring an interrupt.
Mode 0 operation is the same for the Timer 0 as for
Timer 1. Substitute IRO, TFO and INfO for the corre- STANDARD SERIAL INTERFACE
sponding Timer 1 signals in Figure 27. There are two
different GATE bits, one for Timer 1 (TMOD.7) and The serial port is full duplex, meaning it can transmit
one for Timer 0 (TMOD.3). and receive simultaneously. It is also receive-buffered,
meaning it can commence reception of a second byte
MODE 1 before a previously received byte has been read from the
register. (However, if the first byte still hasn't been read
Mode 1 is the same as Mode 0, except that the Timer by the time reception of the second byte is complete,
register is being run with all 16 bits. one of the bytes will be lost). The serial port receive
and transmit registers are both accessed at Special
MODE 2 Function Register SBUF. Writing to SBUF loads the
transmit register, and reading SBUF accesses a physi-
Mode 2 configures the Timer register as an 8-bit cally separate receive register.
Counter (1L1) with automatic reload, as shown in Fig-
ure 29. Overflow from 1L1 not only sets TF1, but also The serial port can operate in 4 modes:
reloads 1L1 with the contents of 11f1, which is preset by
software. The reload leaves 11f1 unchanged.
CIT. 0
INTERRUPT
T1 PIN
______-'1 elf·
-
1
(MSB) (LSB)
TFI TAl TFO TFjO lEI ITI lEO ITO
Symbol Poallton Name and SignifICance Symbol PoaIlion Name and Slgnlllcance
TFI TCON.7 Timer I overflow Flag. Set by lEI TCON.3 Interrupt I Edge flag. Set by hardware
hardware on Timer/Counter overflow. when external Interrupt edge
Cleared by hardware when processor detected. Cleansd when Interrupt
vectors to interrupt routine. processed.
TRI TCON.6 Timer I Run control bit. Set/cleared In TCON.2 Interrupt I Type control bH. Set!
by software to turn Timer/Counter on/ cleared by software to specify failing
011. edge/low level triggensd external
Interrupts.
TFO TCON.5 Timer 0 overflow Flag. Set by
hardware on Timer/Counter overflow. lEO TCON.I Interrupt 0 Edga flag. Set by hardware
Cleared by hardware when processor when external interrupt edge
vectors to interrupt routine. detected. Cleared when interrupt
processed.
TRO TCON.4 Timer 0 Run control bH. Set/cleared
by software to turn Timer/Counter on/ ITO TCON.O Interrupt 0 Type control bit. Set/
011. cleared by software to specify falling
edge/low level triggered external
Interrupts.
INTERRUPT
B--B-
1112 lose -------,
1' 1210SC
INTERRUPT
TO PIN------~
CONTROL
GATE
1'1210SC-----------1~f-! .~INTERRUPT
TR1 ____________ ~TROL
~
Figure 30. Timer/Counter 0 Mode 3: Two 8-Bit Counters
Mode 0: Serial data enters and exits through RxD. MULTIPROCESSOR COMMUNICATIONS
TxD outputs the shift clock. 8 bits are transmitted/re-
ceived (LSB first). The baud is fixed at 1112 the oscilla- Modes 2 and 3 have a special provision for multiproces-
tor frequency. sor communications. In these modes, 9 data bits are re-
ceived. The 9th one goes into RB8. Then comes a stop
Mode 1: 10 bits are transmitted (through TxD) or re- bit. The port can be programmed such that when the
ceived (through Rx D): a start bit (0), 8 data bits (LSB stop bit is received, the serial port interrupt will be ac-
first), and a stop bit (1). On receive, the stop bit goes tivated only if REB = 1. This feature is enabled by set-
into RB8 in Special Function Register SCaN. The baud ting bit SM2 in SCaN. A way to use this feature in
rate is variable. multiprocessor systems is as follows:
Mode 2: 11 bits are transmitted (through TxD) or re- When the master processor wants to transmit a block of
ceived (through RxD): start bit (0), 8 data bits (LSB data to one of several slaves, it first sends out an ad-
first), a programmable 9th data bit, and a stop bit (1). dress byte which identifies the target slave. An address
On Transmit, the 9th data bit (TB8 in SCaN) can be byte differs from a data byte in that the 9th bit is 1 in
assigned the value of 0 or 1. Or, for example, the parity an address byte and 0 in a data byte. With SM2 = 1, no
bit (P, in the PSW) could be moved into TB8. On re- slave will be interrupted by a data byte. An address byte,
ceive, the 9th data bit goes into RB8 in Special Func- however, will interrupt all slaves, so that each slave can
tion Register SCaN, while the stop bit is ignored. The examine the received byte and see if it is being ad-
baud rate is programmable to either 1/32 or 1/62 the dressed. The addressed slave will clear its SM2 bit and
oscillator frequency. prepare to receive the data bytes that will be coming.
The slaves that weren't being addressed leave their
Mode 3: 11 bits are transmitted (through TxD) or re- SM2s set and go on about their business, ignoring the
ceived (through RxD): a start bit (0), 8 data bits (LSB coming data bytes.
first), a programmable 9th data bit and a stop bit (1).
In fact, Mode 3 is the same as Mode 2 in all respects SM2 has no effect in Mode 0, and in Mode 1 can be
except baud rate. The baud ·rate in Mode 3 is variable. used to check the validity of the stop bit. In a Mode 1
reception, if SM2 = 1, the receive interrupt will not be
In all four modes, transmission is initiated by any in- activated unless a valid stop bit is received.
struction that uses SBUF as a destination register. Re-
ception is initiated in Mode 0 by the condition RI = 0 SERIAL PORT CONTROL REGISTER
and REN = 1. Reception is initiated in the other modes
by the incoming start bit if REN = 1. The serial port control and statu~ register is the Special
Function Register SCaN, shown in Figure 31. This reg-
ister contains not only the mode selection bits, but also
the 9th data bit for transmit and receive (TBB and RBS),
and the serial port interrupt bits (Tl and Rl).
(MSB) (LSB)
SMO SM' SM2 AEN TB8 AB8 TI AI
Where SMO, SM' specify the serial port mode, as follows: • TB8 is the 9th data bit that will be
transmitted in Modes 2 and 3. Set or
SMO
0
0
SMI
0
1
0
Mode
0
1
2
Description
shift register
II-bitUART
9-bitUAAT
Baud Rat.
losc/ 12
variable
lose/54
. RBe
clear by software as desired.
in Modes 2 and 3, is the 9th data bit
that was received. In Mode I, if SM2
= 0, AB8 is the stop bij that was
.
or
fosc/32 received. In Mode 0, RB8 is not used.
3 9-bit UAAT variable TI is transm~ interrupt flag. Set by
• SM2 enables the multiprocessor hardware at the end of the 8th M time
communication feature in Modes in Mode 0, or at the beginning of the
2 and 3. In Mode 2 or 3, if SM2 is stop bit in the other modes, in any
set to 1 then RI will not be serial transmission. Must be cleared
activated if the received 9th data by software.
M (AB8) is O. In Mode I, if SM2
= 1 then RI will not be activated • AI is receive interrupt flag. Set by
if a valid stop bit was not hardware at the end of the 8th bit time
received. In Mode 0, SM2 should in Mode 0, or halfway through tha stop
beO. bit time in the other modes, in any
• REN enables serial reception. Set by serial reception (except see SM2).
software to enable reception. Must be cleared by software.
Clear by software to disable
reception.
Timer 1
Baud Rate fose SMOD
CIT Mode Reload
Value
Mode 0 Max: 1 MHZ 12 MHZ X X X X
Mode 2 Max: 375K 12MHZ 1 X X X
Modes 1, 3: 62.5K 12MHZ 1 0 2 FFH
19.2K 11.059 MHZ 1 0 2 FDH
9.6K 11.059 MHZ 0 0 2 FDH
4.8K 11.059 MHZ 0 0 2 FAH
2.4K 11.059 MHZ 0 0 2 F4H
1.2K 11.059 MHZ 0 0 2 E8H
137.5 11.986 MHZ 0 0 2 1DH-
110 6MHZ 0 0 2 72H
110 12MHZ 0 0 1 FEEBH
Transmission is initiated by any instruction that uses the right is the value that was sampled at the P3.0 pin
SBUF as a destination register. The "write to SBUF" at S5P2 of the same machine cycle.
signal at S6P2 also loads a 1 into the 9th position of the
transmit shift register and tells the TX Control block to As data bits come in from the right, Is shift out to the
commence a transmission. The internal timing is such left. When the 0 that was initially loaded into the right-
that one full machine cycle will elapse between "write to most position arrives at the leftmost position in the shift
SBUF", and activation of SEND. register, it flags the RX Control block to do one last
shift and load SBUF. At SlP1 of the 10th machine cycle
SEND enables the output of the shift register to the al- after the write to SCaN that cleared RI, RECEIVE is
ternate output function line of P3.0 and also enables cleared as RI is set.
SHIFT CLOCK to the alternate output function line of
P3.I. SHIFT CLOCK is low during S3, S4, and S5 of MORE ABOUT MODE 1
every machine cycle, and high during S6, Sl and S2. At
S6P2 of every machine cycle in which SEND is active, Ten bits are transmitted (through TxD), or received
the contents of the transmit shift are shifted to the right (through RxD): a start bit (0), 8 data bits (LSB first),
one position. and a stop bit (1). On receive, the stop bit goes into
RE8 in SCaN. In the 8051 the baud rate is determined
As data bits shift out to the right, zeros come in from by the Timer 1 overflow rate.
the left. When the MSB of the data byte is at the output
position of the shift register, then the 1 that was initially Figure 34 shows a simplified functional diagram of the
loaded into the 9th position, is just to the left of the serial port in Mode 1, and associated timings for trans-
MSB, and all positions to the left of that contain zeros. mit receive.
This condition flags the TX Control block to do one last
shift and then deactivate SEND and set TL Both of Transmission is initiated by any instruction that uses
these actions occur at SlP1 of the 10th machine cycle SBUF as a destination register. The "write to SBUF"
after "write to SBUF". signal also loads a 1 into the 9th bit position of the
transmit shift register and flags the TX Control unit that
Reception is initiated by the condition REN = 1 and R1 a transmission is requested. Transmission actually com-
= O. At S6P2 of the next machine cycle, the RX Control mences at S1P1 of the machine cycle following the next
unit writes the bits 11111110 to the receive shift regis- rollover in the divide-by-16 counter. (Thus, the bit times
ter, and in the next clock phase activates RECEIVE. are synchronized to the divide-by-16 counter, not to the
"write to SBUF" signal).
RECEIVE enables SHIFT CLOCK to the alternate out-
put function line of P3.L SHIFT CLOCK makes transi- The transmission begins with activation of SEND which
tions at S3P1 and S6P1 of every machine cycle. At puts the start bit at TxD. One bit time later, DATA is
S6P2 of every machine cycle in which RECEIVE is ac- activated, which enables the output bit of the transmit
tive, the contents of the receive shift register are shifted shift register to TxD. The first shift pulse occurs one bit
to the left one position. The value that comes in from time after that.
WRITE
TO
SBUF ---li-:~t;i:j=~--jJ~--~~------~r-'\ Rxe
P3.0ALT
OUTPUT
FUNCTION
sa --..-------~
Txe
P3.1 ALT
OUTPUT
FUNCTION
' - - - - - . I RX CLOCK
RX CONTROL SHIFT
REON
I----~ START
Ai Rxe
r.L-IU-...L..L-IU-I-..1____ P3.0 ALT
INPUT
FUNCTION
REAO
SBUF
ALE
---JtWRITE TO saUF
SEND S8P2 I
SHIFT
~AII~~====Jr====================================================~r----
~CEIVE
SHIFT
L--
RECEIVE
TIMER1
OVERFLOW
WRITE
SBUF
TO --~r--:==:{~~~--~~:----'----~~ ~r-... __ TXD
As data bits shift out to the right, zeros are clocked iu Reception is initiated by a detected I-to-O transition at
from the left. When the MSB of the data byte is at the RxD. For this purpose RxD is sampled at a rate of 16
output position of the shift register, then the 1 that was times whatever baud rate has been established. When a
initially loaded into the 9th position is just to the left of transition is detected, the divide-by-16 counter is imme-
the MSB, and all positions to the left of that contain ze- diately reset, and IFFH is written into the input shift
ros. This condition flags the TX Control unit to do one register. Resetting the divide·by-16 counter aligns its
last shift and then deactivate SEND and set TI. This rollovers with the boundaries of the incoming bit times.
occurs at the 10th divide-by-16 rollover after "write to
SBUF".
The 16 states of the counter divide each bit time into into the 9th bit position of the shift register. Thereafter,
16ths. At the 7th, 8th, and 9th counter states of each bit only zeros are clocked in. Thus, as data bits shift out to
time, the bit detector samples the value of RxD. The the right, zeros are clocked in from the left. When TB8
value accepted is the value that was seen in at least 2 of is at the output position of the shift register, then the
the 3 samples. This is done for noise rejection. If the stop bit is just to the left of TB8, and all positions to the
value accepted during the first bit time is not 0, the re- left of that contain zeros. This condition flags the TX
ceive circuits are reset and the uD.itgoes back to looking Control unit to do one last shift and then deactivate
for another 1-to-O transition. This is to provide rejection SEND and set TI. This occurs at the 11th divide-by-16
of false start bits. If the start bit proves valid, it is shift- rollover after "write to SUBF".
ed into the input shift register, and reception of the rest
of the frame will proceed. Reception is initiated by a detected 1-to-0 transition at
RxD. For this purpose RxD is sampled at a rate of 16
As data bits come in from the right, 1s shift out to the times whatever baud rate has been established. When a
left. When the start bit arrives at the leftmost position in transition is detected, the divide-by-16 counter is imme-
the shift register, (which in mode 1 is a 9-bit register), diately reset, and 1FFH is written to the input shift reg-
it flags the RX Control block to do one last shift, load ister.
SBUF and RB8, and set RI. The signal to load SBUF
and RB8, and to set RI, will generated if, and only if, At the 7th, 8th and 9th counter states of each bit time,
the following conditions are met at the time the final the bit detector samples the value of R-D. The value ac-
shift pulse is generated. cepted is the value that was seen in at least 2 of the 3
samples. If the value accepted during the first bit time is
1. R1 = 0, and not 0, the receive circuits are reset and the unit goes
2. Either SM2 = 0, or the received stop bit = 1 back to looking for another 1-to-O transition. If the start
bit proves valid, it is shifted into the input shift register,
If either of these two conditions is not met, the received and reception of the rest of the frame will proceed.
frame is irretrievably lost. If both conditions are met,
the stop bit goes into RB8, the 8 data bits go into SBUF, As data bits come in from the right, 1s shift out to the
and RI is activated. At this time, whether the above con- left. When the start bit arrives at the leftmost position in
ditions are met or not, the unit goes back to looking for the shift register (which in Modes 2 and 3 is a 9-bit reg-
a 1-to-0 transition in RxD. ister), it flags the RX Control block to do one last shift,
load SBUF and RB8, and set RI.
MORE ABOUT MODES 2 AND 3
The signal to load SBUF and RB8, and to set RI, will be
Eleven bits are transmitted (through TxD), or received generated if, and only if, the following conditions are
(through RxD): a start bit (0), 8 data bits (LSB first), a met at the time the final shift pulse is generated.
programmable 9th data bit, and a stop bit (1). On
transmit, the 9th data bit (TB8) can be assigned the val- 1. RI = 0, and
ue of ° or 1. On receive, the 9th data bit goes into RB8
in SCON. The baud rate is programmable to either 1132
2. Either SM2 = ° or the received 9th data bit =
or 1/64 the oscillator frequency in Mode 2. Mode 3 may If either of these conditions is not met, the received
have a variable baud rate generated from Timer 1. frame is irretrievably lost, and RI is not set. If both
conditions are met, the received 9th data bit goes into
Figures 35 and 36 show a functional diagram of the se- RB8, and the first 8 data bits go into SBUF. One bit
rial port in Modes 2 and 3. The receive portion is ex- time later, whether the above conditions were met or
actly the same as in Mode 1. The transmit portion dif- not, the unit goes back to looking for a 1-to-O transition
fers from Mode 1 only in the 9th bit of the transmit shift at the RxD input.
register.
INTERRUPTS
Transmission is initiated by any instruction that uses
SBUF as a destination register. The "write to SBUF" The 8051 provides 5 interrupt sources. These are shown
signal also loads TB8 into the 9th bit position of the in Figure 37. The External Interrupts INTO and INT1
transmit shift register and flags the TX Control unit that can each be either level-activated or transition-activated,
a transmission is requested. Transmission commences depending on bits ITO and ITl in Register TCON. The
at SlP1 of the machine cycle following the next roll-over flags that actually generate. these interrupts are bits lEO
in the divide-by-16 counter (thus, the bit times are syn- and IE1 in TCON. When an external interrupt is gener-
chronized to the divide-by-16 counter, not to the "write ated, the flag that generated it is cleared by the hard-
toSBUF" signal). ware when the service routine is vectored to only if the
interrupt was transition-activated. If the interrupt was
The transmission begins with activation of SEND, which level activated, then the external requesting source is
puts the start bit at TxD. One bit time later, DATA is what controls the request flag, rather than the on-chip
activated, which enables the output bit of the transmit hardware.
shift register to TxD. The first shift pulse occurs one bit
time after that. The first shift clocks a 1 (the stop bit)
WRITE
TO
SBUF ---~--~~~~~~--~~~--~--~r-~___~~~ TXD
PHASE 2 CLOCK
(lh fosc)
MODE2
LOAD
SBUF
RXD
TRANSMIT
~--------------------------------------------~,---
TIMER1
OVERFLOW
..~
WRITE
SBUF
TO --~---:==:Tr~~~~--~=----'~--~~l_ TXD
BIT
DETECTOR
RXD
TX
~
---t WRIT;:;E"T;:;O_S:.B..U"F;--.......-....JL----"L--..JL--Jl--JL--.JL--IL-..JL--.JIL---
-----. miiD
L SIPl I
TRANSMIT
STOP BIT
I
~
RXD BIT DETECTORl sr•• T.OT I I D6 L~STOP
RECEIVE SAMPLE TIMES BIT
SHIFT ~ __~L-_ _"l_ _~~_ _JL_ _'L_~l___~L_ _JL_ _L__ _ _
~RI~_________________________________________________________1r____
(MSS) (LSS)
I EA Ix I x IES IET1 IEX' IETa I EXO I
Symbol Position Function
EA IE.? disables all interrupts. If EA = 0, no
interrupt will be acknowledged. If EA = 1,
~o--------------------~. each interrupt source is individually
enabled or disabled by setting or clearing
its enable bit.
1E.6 reserved
INTERRUPT
1E.5 reserved
SOURCES
ES IE.4 enables or disables the Serial Port
interrupt. If ES = 0, the Serial Port
interrupt is disabled.
~,------------------~. ETI IE.3 enables or disables the Timer 1 Overflow
interrupt. If ETI = 0, the Timer 1 interrupt
is disabled.
EXI IE.2 enables or disables External Interrupt 1. If
EXI = 0, External Interrupt 1 is disabled.
ETO IE.l enables or disables the Timer 0 Overflow
interrupt. If ETO = 0, the Timer 0 interrupt
is disabled.
~2~ enables or disables External Interrupt O. If
EXF2~ --(805~
EXO IE.O
EXO = 0, External Interrupt 0 is disabled.
Figure 37, 8051 Family Interrupt Sources Figure 38, Interrupt Enable Register (IE)
All of the bits that generate interrupts can be set or PTI IP.3 defines the Timer 1 Interrupt priority
level. PT1-1 programs It to the higher
cleared by software, with the same result as though it priority level.
had been set or cleared by hardware. That is, interrupts
can be generated or pending interrupts can be canceled PXl IP.2 defines the External Interrupt 1 priority
level. PX1-1 programs It to the higher
in software. priority level.
PTO IP.l defines the Timer 0 Interrupt priority
Each of these interrupt sources can be individually en- level. PTO-l programs It to the higher
abled or disabled by setting or clearing a bit in Special priority level.
Function Register IE (Figure 38). IE also contains a PXO IP.O defines the External Interrupt 0 priority
global disable bit, EA, which disables all interrupts at level. PXO-l programs It to the higher
once. priority level.
Each interrupt source can also be individually pro- If two requests of different priority levels are received
grammed to one of two priority levels by setting or simultaneously, the request of higher priority level is
clearing a bit in Special Function Register IP (Figure serviced. If requests of the same priority level are re-
39). A low-priority interrupt can itself be interrupted by ceived simultaneously, an internal polling sequence de-
a high-priority interrupt, but not by another low-priority termines which request is serviced. Thus within each pri-
interrupt. A high-priority interrupt can't be interrupted ority level there is a second priority structure determined
by any other interrupt source. by the polling sequence as follows:
Source Priority Within Level Thus the processor acknowledges an interrupt request by
1. IEO (highest) executing a hardware generated LCALL to the appropri-
2. TFO ate servicing routine. In some cases it also clears the
3. IEI flag that generated the interrupt, and in other cases it
4. TFI doesn't. It never clears the Serial Port or Timer 2 flags.
5. RI+TI (lowest) This has to be done in the user's software. It clears an
external interrupt flag (lEO or lEI) only if it was transi-
Note that the "priority within level" structure is only used tion-activated. The hardware-generated LCALL pushes
to resolve simultaneous requests of the same priority lev- the contents of the Program Counter on to the stack (but
el. it does not save the PSW) and reloads the PC with an
address that depends on the source of the interrupt being
The IP register contains a number of unimplemented vectored to, as shown below:
bits. IP.?, IP.6 and IP.S are reserved in the 80S1s. User
software should not write Is to these positions, since they Source Vector Address
may be used in other 8051 Family products. IEO 0003H
TFO OOOBH
HOW INTERRUPTS ARE HANDLED IEI 0013H
TFI OOlEH
The interrupt flags are sampled at SSP2 of every ma- RI+TI 0023H
chine cycle. The samples are polled during the following
machine cycle. If one of the flags was in a set condition Execution proceeds from that location until the RETI in-
at S5P2 of the preceding cycle, the polling cycle will struction is encountered. The RETI instruction informs
find it and the interrupt system will generate an LCALL the processor that this interrupt routine is no longer in
to the appropriate service routine, provided this progress, then pops the top two bytes from the stack and
hardware-generated LCALL is not blocked by any of the reloads the Program Counter. Execution of the inter-
following conditions: rupted program continues from where it left off.
1. An interrupt of equal or higher priority level is al- Note that a simple RET instruction would also have re-
ready in progress. turned execution to the interrupted program, but it would
2. The current (polling) cycle is not the final cycle in have left the interrupt control system thinking an inter-
the execution of the instruction in progress. rupt was still in progress.
3. The instruction in progress is RETI or any write to
the IE or IP registers. EXTERNAL INTERRUPTS
Any of these three conditions will block the generation of The external sources can be programmed to be level-
the LCALL to the interrupt service routine. Condition 2 activated or transition-activated by setting or clearing bit
ensures that the instruction in progress will be completed ITI or ITO in Register TCON. If ITx = 0, external in-
before vectoring to any service routine. Condition 3 en- terrupt x is triggered by a detected low at the INTx pin.
sures that if the instruction in progress is RETI or any If ITx = 1, external interrupt x is edge triggered. In this
access to IE or IP, then at least one more instruction mode if successive samples of the INTx pin show a high
will be executed before any interrupt is vectored to. in one cycle and a low in the next cycle, interrupt re-
quest flag lEx in TCON is set. Flag bit lEx then re-
The polling cycle is repeated with each machine cycle, quests the interrupt.
and the values polled are the values that were present at
SSP2 of the previous machine cycle. Note than that if an Since the external interrupt pins are sampled once each
interrupt flag is active but not being responded to for machine cycle, an input high or low should hold for at
one of the above conditions, if the flag is not still active least 12 oscillator periods to ensure sampling. If the ex-
when the blocking condition is removed, the denied in- ternal interrupt is transition-activated, the external
terrupt will not be serviced. In other words, the fact that source has to hold the request pin high for at least one
the interrupt flag was once active but not serviced is not cycle, and then hold it low for at least one cycle. This is
remembered. Every polling cycle is new. done to ensure that the transition is seen so that inter-
rupt request flag lEx will be set. lEx will be auto-
The polling cycle/LCALL sequence is illustrated in Fig- matically cleared by the CPU when the service routine is
ure 40. called.
Note that if an interrupt of higher priority level goes ac- If the external interrupt is level-activated, the external
tive prior to SSP2 of the machine cycle labeled C3 in source has to hold the request active until the requested
Figure 40, then in accordance with the above rules it interrupt is actually generated. Then it has to deactivate
will be vectored to during CS and C6, without any in- the request before the interrupt service routine is com-
struction of the lower priority routine having been exe- pleted, or else another interrupt will be generated.
cuted.
·······lJL_n..fL_-\,~_-'-___''\u,_---''--_''\l~_---'-_ __
fYt
INTERRUPT INTERRUPT
INTERRUPTS
ARE POLLED
LONG CALL TO
INTERRUPT
VECTOR ADDRESS
INTERRUPT ROUTINE
GOES LATCHED
ACTIVE
This is the fastest possible response when C2 is the final cycle of an instruction other than RETI or an access to IE or IP.
RESPONSE TIME cuted. One way to use this feature for single-step opera-
tion is to program one of the external interrupts (e.g.
The INfO and INT1 levels are inverted and latched into INfO) to be level-activated. The service routine for the
lEO and IE1 at S5P2 of every machine cycle. The values interrupt will terminate with the following code:
are not actually polled by the circuitry until the next
machine cycle. If a request is active and conditions are JNB P3.2,$ ;Wait Till INfO Goes High
right for it to be acknowledged, a hardware subroutine m P3.2,$ ;Wait Till INfO Goes Low
call to the requested service routine will be the next in- RETI ;Go Back and Execute One Instruction
struction to be executed. The call itself takes two cycles.
Thus, a minimum of three complete machine cycles Now if the INfO pin, which is also the P3.2 pin, is held
elapse between activation of an external interrupt request normally low, the CPU will go right into the External
and .the beginning of execution of the first instruction of Interrupt 0 routine and stay there until INTO is pulsed
the service routine. Figure 40 shows interrupt response (from low to high to low). Then it will execute RETI, go
timings. back to the task program, execute one instruction, and
immediately re-enter the External Interrupt 0 routine to
A longer response time. would result if the request is await the next pulsing of P3.2. One step of the task pro-
blocked by one of the 3 previously listed conditions. If an gram is executed each time P3.2 is pulsed. .
interrupt of equal or higher priority level is already in
progress, the additional wait time obviously depends on RESET
the nature of the other interrupt's service routine. If the
instruction in progress is not in its final cycle, the addi- The reset input is the RST pin, which is the input to a
tional wait time cannot be more the 3 cycles, since the Schmitt Trigger. A reset is accomplished by holding the
longest instructions (MUL and DIY) are only 4 cycles RST pin high for at least two machine cycles (24 oscilla-
long, and if the instruction in progress is RETI or an tor periods), while the oscillator is running. The CPU
access to IE or IP, the additional wait time cannot be responds by generating an internal reset, with the timing
more than 5 cycles (a maximum of one more cycle to shown in Figure 41.
complete the instruction in progress, plus 4 cycles to
complete the next instruction if the instruction is MUL The external reset signal is asynchronous to the internal
or DIV). clock. The RST pin is sampled during State 5 Phase 2
of every machine cycle. The port pins will maintain their
Thus, in a single-interrupt system, the response time is current activities for 19 oscillator periods after a logic 1
always more than 3 cycles and less than 9 cycles. has been sampled at the RST pin; that is, for 19 to 31
oscillator periods after the external reset signal has been
SINGLE-STEP OPERATION applied to the RST pin.
The 8051 interrupt structure allows single-step execution The internal reset algorithm writes Os to all the SFRs
with very little software overhead. As previously noted, an except the port latches, the Stack Pointer, and SBUF.
interrupt request will not be responded to while an inter- The port latches are initialized to FFH, the Stack Point-
rupt of equal priority level is still in progress, nor will it er to 07H, and SBUF is indeterminate. Table 11 lists the
be responded to after RETI until at least one other in- SFR reset values. The internal RAM is not affected by
struction has been executed. Thus, once an interrupt rou- reset. On power up the RAM content is indeterminate.
tine has been entered, it cannot be re-entered until at
least one instruction of the interrupted program is exe-
ALE:
PSEN:
po:
I
- 1 1 OSC. PERIODS -'"',,>--------19 OSC. PERIODS - - - - - -
(MSB) (lSB)
1
10u'_r-
vee t--
Symbol
SMOD
POlltlon
PCON.7
PCON.S
Name and Function
Double Baud rata bit. When set to a 1
and Timer 1 is used to generate baud
rate, and the Serial Port is used in
modes 1, 2, or 3.
(Reserved)
PCON.S (Reserved)
8051
PCON.4 (Reserved)
GFl PCON.3 General-purpose flag bit.
RST GFO PCON.2 General-purpose flag bit.
8.2K!! PO PCON.l Power Down bit. Setting this bit
activates power down operation.
IDL PCON.O Idle mode bit. Setting this bit activates
idle mode operation.
VSS
If 1 s are written to PO and IDL at the same time, PO takes
-l=- precedence. The reset value of PCON Is (OXXXOOOO).
In the H MaS devices the PCON register only contains
SMOD. The other four bits are Implemented only in the
CHMOS devices. User software should never write 1s to
Figure 42. Power On Reset Circuit unimplemented bits, since they may be used in future
products.
~~
that put the device into Idle.
The flag bits GFO and GF1 can be used to give an indi-
cation if an interrupt occurred during normal operation
XTAl 2 -= XTAL 1
or during an Idle. For example, an instruction that acti-
vates Idle can also set one or both flag bits. When Idle
is terminated by an interrupt, the interrupt service rou-
INTERRUPT.
f-......-<>SERIAL PORT,
tine can examine the flag bits. The other way of termi-
TIMER BLOCKS nating the Idle mode is with a hardware reset. Since the
clock oscillator is still running, the hardware reset needs
CPU to be held active for only two machine cycles (24 oscilla-
tor periods) to complete the reset.
The signal at the RST pin clears the IDL bit directly
and asynchronously. At this time the CPU resumes pro-
gram execution from where it left off; that is, at the in-
struction following the one that invoked the Idle Mode.
Figure 43. Idle and Power Down Hardware A, shown in Figure 41, two or three machine cycles of
program execution may take place before the internal
IDLE MODE reset algorithm takes control. On-chip hardware inhibits
access to the internal RAM during this time, but access
An instruction that sets PCON.O causes that to be the to the port pins is not inhibited. To eliminate the possi-
last instruction executed before going into the Idle bility of unexpected outputs at the port pins, the instruc-
mode, the internal clock signal is gated off to the CPU tion following the one that invokes Idle should not be one
but not to the Interrupt, Timer and Serial Port functions. that writes to a port pin or to external Data RAM.
The CPU status is preserved in its entirety; the Stack
Pointer, Program Counter, Program Status Word, Accu- POWER DOWN MODE
mulator, and all other registers maintain their data dur-
ing Idle. The port pins hold the logical states they had at An instruction that sets PCON.1 causes that to be the
the time Idle was activated. ALE and PSEN hold at log- last instruction executed before going into the Power
ic high levels. Down mode. In the Power Down mode, the on-chip os-
cillator is stopped. With the clock frozen, all functions
are stopped, the contents of the on-chip RAM and Spe- Vee is restored to its normal operating level, and must
cial Function Registers are maintained. The port pins be held active long enough to allow the oscillator to re-
output the values held by their respective SFRs. The start and stabilize (normally less than lOmsec).
ALE and PSEN output are held low.
THE ON-CHIP OSCILLATORS
The only exit from Power Down is a hardware reset.
Reset redefines all the SFRs, but does not change the HMOS Versions
on-chip RAM.
The on-chip oscillator circuitry for the HMOS (-I and
In the Power Down mode of operation, Vee can be re- -II) members of the 8051 family is a single stage linear
duced to as low as 2V. Care must be taken, however, to inverter (Figure 45), intended for use as a crystal-
ensure that Vee is not reduced before the Power Down controlled, positive reactance oscillator (Figure 46). In
mode is invoked, and that Vee is restored to its normal this application the crystal is operated in its fundamental
operating level, before the Power Down mode is termi- response mode as an inductive reactance in parallel
nated. The reset that terminates Power Down also frees resonance with capacitance external to the crystal.
the oscillator. The reset should not be activated before
Vee
TO INTERNAL
nMlNGCKTS
XTAL2
XTAL1
?
SUBST.
Figure 45. On-Chip Oscillator In the HMOS Version of the 8051 Family
TO INTERNAL
nMINGCKTS
Vu
Il0l1
XTAU------
_ _-r---QUARTZ CRYSTAL
OR CERAMIC RESONATOR
C1 Cz
The crystal specifications and capacitance values (C1 when a ceramic resonator is used.
and C2 in Figure 46) are not critical. 30pF can be used
in these positions at any frequency with good quality crys- To drive the CHMOS parts with an external clock '"
tals. A ceramic resonator can be used in place of the source, apply the external clock signal to XTAL1, and
crystal in cost-sensitive applications. When a ceramic leave XTAL2 float, as shown in Figure 50.
resonator is used, C1 and C2 are normally selected to
be of somewhat higher values, typically, 47pF. The manu- The reason for this change from the way the HMOS part
facturer of the ceramic resonator should be consulted for is driven can be seen by comparing Figures 46 and 48.
recommendation on the values of these capacitors. In the HMOS devices the internal timing circuits are
driven by the signal at XTZL2. In the CHMOS devices
To drive the HMOS parts with an external clock source, the internal timing circuits are driven by the signal at
apply the external clock signal to XTAL2, and ground XTALL
XTAL1, as shown in Figure 47. A pullup resistor may be
used (to increase noise margin), but is optional if VOH INTERNAL TIMING
of the driving gate exceeds the VIH minimum specifica-
tion of XTAL. Figures 51 through 54 show when the various strobe and
port signals are clocked internally. The figures do not
show rise and fall times of the signals, nor do they show
propagation delays between the XTAL2 signal and events
at other pins.
TO INTERNAL VCC
nMING CKTS
Figure 48. On-Chip Oscillator Circuitry in the CHMOS Versions of the 8051 Family
VCC
TO INTERNAL
nMINGCKTS
Vss
XTAL2·-----
1OC51
_..-,..--QUARTZ CRYSTAL
OR CERAMIC
RESONATOR
Port 0: Port 0 is an 8-bit open drain bidirectional port. Port 3: Port 3 is an 8-bit bidirectional 110 port with in-
As an open drain output port, it can sink eight LS TIL ternal pultups. It also serves the functions of various
loads. Port 0 pins that have 1s written to them float, and special features of the 8051 Family as follows:
in that state will function as high impedance inputs. Port
o is also the multiplexed low-order address and data bus Port Pin Alternate Function
during accesses to external memory. In this application P3.0 RxD (serial input port)
it uses strong internal pullups when emitting 1s. Port 0 P3.1 TxD (serial output port)
also emits code bytes during program verification. In P3.2 INTO (external interrupt 0)
that application, external pullups are required. P3.3 INT1 (external interrupt 1)
P3.4 TO (timer 0 external input)
Port 1: Port 1 is an 8-bit bi-directional 110 port with in- P3.5 Tl (timer 1 external input)
ternal pullups. Port 1 pins that have Is written to them P3.6 WR (external data memory write strobe)
are pulled high by the internal pullups, and in that state P3.7 RD (external data memory read strobe)
can be used as inputs. As inputs, port 1 pins that are
externally being pulled low will source current because V cc: Supply voltage
of the internal pultups.
V ss: Circuit ground potential
Port 2: Port 2 is an 8-bit bidirectional 1/0 port with in-
ternal pullups. Port 2 emits the high-order address byte
during accesses to external memory that use 16-bit ad-
dresses. In this application, it uses the strong internal
pullups when emitting 1s.
I I
STATE 1 STATE
~I~ ~I~
21 STATE
~I~
'I I
41 STATE 'ISTATE 'ISTATE 1 STATE
STATE
~I~ ~I~ ~I~ ~I~ ~I~
21
XTAU:
ALI:
ISTATt:
~1P2
41 STATt: 51 STATt: 61 STATt:
~1P2 ~1P2 ~1P2
'I STATE
~1P2
21 STATE 31 STATE 41 STATE 51
~1P2 ~1P2 ~1P2
XTAL2:
ALE:
iii:
PO:
PCHOR PCH OR
P2: P2SFR
DPH OR P2 SFR OUT
P2SFR
XTAL2:
ALE:
WA:
F-
PCL OUT IF
IS EXTERNAL
Out ~
PO: DPL OR AI
OUT DATA OUT
P2 PCH OR
OPH OR P2 SFR OUT PCH OR
P2SFR P2SFR
I~1P2
STATE 41STATE SI STATE II/STATE 1 ISTATE 2/STATE 3/STATE 41 STATE 51
~1P2 ~1P2 ~1P2 ~1P2 ~1P2 ~1P2 ~1P2
XTALI:
~
'P1 PO,P1~
INPUTS SAMPLeD:
P2, P3, RST P2, P3, R8T=::rl.-
MaY PORT, IRC: OLD DATA NEW DATA
81I11ALPORT
IHIFTCLOCK
(MODE 0)
~ ~ RXD PIN SAMPLED RXD SAMPLED --l f--
~r-----------------, FFFFr-------------------~
&OK
BYTES
EXTERNAL
14K
---OR---~~ BYTES
EXTERNAL
1~~ __________________~
AND
~ooooFl________
_ INTERNAL
4K__
BYTES
__________ ~
oooo~------ ____________ ~
~~----------------~
INTERNAL
FF,..-----------------, 14K
SFR. BYTES
DIRECT EXTERNAL
ADDRESSING
ONLY
10
7Fr-----------------~ ---AND--'"
DIRECT.
INDIRECT
ADORESBING
~~-------~ ~L-----------------J
1, .......
.-------- ellyln ------I~~II
7F
..
70 77
IF
..
10 IT
SCRATCH
IF
PAD
10 17
AREA
•
40 47
28 3F
30 37
••• 7F 2F BIT
ADDRESBABLE
20 0 ... 27 BEGMENT
1. 3 IF
10 2 17 REGISTER
oe 1 OF IANIC8
0 07
Table 12. 8051, 80CSI Special Funcdon Registers Table 13. Contents of SFRs Arter a Reset
I BY1U
F8 FF
FO B F7
E8 EF
EO ACC E7
DB DF
DO PSW D7
CB CF
CO C7
88 IP BF
BO P3 B7
A8 IE AF
AO P2 A7
98 SCON SBUF 9F
90 P1 97
88 TCON TMOD TLo TL1 THO TH1 8F
80 PO SIt DPL DPH POON 87
T
m..ABLE
Figure 58. 8051 SFR Memory Map
Those SFRs that have their bits assigned for various functions are listed in this section. A brief description of each bit
is provided for quick reference. For more detailed information refer to the Architecture Chapter of this book.
SMOD Double baud rate bit. If Timer I is used to generate baud rate and SMOD = I, the baud rate is doubled
when the Serial Port is used in modes I, 2, or 3.
Not implemented, reserved for future use.'
Not implemented, reserved for future use.'
Not implemented, reserved for future use.'
GF I General purpose flag bit.
GFa General purpose flag bit.
PD Power Down bit. Setting this bit activates Power Down operation in the 8aC5IBH. (Available only in
CHMOS).
IDL Idle Mode bit. Setting this bit activates Idle Mode operation in the 8aC51BH. (Available only in CHMOS).
INTERRUPTS:
In order to use any of the interrupts in the 8051 Family, the following three steps must be taken.
Interrupt Vector
Source Address
lEO 0OO3H
TFO OOOSH
IE1 0013H
TF1 001SH
RI & TI 0023H
In addition, for external interrupts, pins INTO and INTI (P3.2 and P3.3) must be set to I, and depending on whether
the interrupt is to be level or transition activated, bits ITO or ITI in the TCON register may need to be set to 1.
.User software should not write Is to reserved bits. These bits may be used in future 8051 products
to invoke new features.
In order to assign higher priority to an interrupt the corresponding bit in the IP register must be set to L I··,
Remember that while an interrupt service is in progress, it cannot be interrupted by a lower or same level interrupt.
lEO
TFO
lEI
TFI
RI or TI
TFI TCON. 7 Timer 1 overflow flag. Set by hardware when the Timer/Counter 1 overflows. Cleared by hard-
ware as processor vectors to the interrupt service routine.
TRI TCON. 6 Timer 1 run control bit. Set/cleared by software to turn Timer/Counter ION/OFF.
TFO TCON. 5 Timer 0 overflow flag. Set by hardware when the Timer/Counter 0 overflows. Cleared by hard-
ware as processor vectors to the service routine.
TRO TCON. 4 Timer 0 run control bit. Set/cleared by software to tum Timer/Counter 0 ON/OFF.
lEI TCON.3 External Interrupt 1 edge flag. Set by hardware when External Interrupt edge is detected.
Cleared by hardware when interrupt is processed.
ITt TCON. 2 Interrupt 1 type control bit. Set/cleared by software to specify falling edge/low level triggered
External Interrupt.
lEO TCON. 1 External Interrupt 0 edge flag. Set by hardware when External Interrupt edge detected. Cleared
by hardware when interrupt is processed.
ITO TCON. 0 Interrupt 0 type control bit. Set/cleared by software to specify falling edge/low level triggered
External Interrupt.
TIMER 1 TIMER 0
GATE When TRx (in TCON) is set and GATE = 1, TIMER/COUNTERx will run only while INTx pin is high
(hardware control). When GATE = 0, TIMER/COUNTERx will run only while TRx = 1 (software
control).
CIT Timer or Counter selector. Cleared for Timer operation (input from internal system clock). Set for Coun-
ter operation (input from Tx input pin).
Ml Mode selector bit. (NOTE 1)
MO Mode selector bit. (NOTE 1)
NOTE 1:
M1 MO Operating Mode
o o o 13-bit Timer (8048 compatible)
o 1 1 16-bit Timer/Counter
1 o 2 8-bit Auto-Reload Timer/Counter
1 1 3 (Timer 0) TLO is an 8-bit Timer/Counter controlled by the standard Timer 0
control bits, THO is an 8-bit Timer and is controlled by Timer 1 control bits.
3 (Timer 1) Timer/Counter 1 stopped.
TIMER SET-UP
Tables 14 through 17 give some values for TMOD which can be used to set up Timer 0 in different modes. ,-i
!
It is assumed that only one timer is being used at a time. If it is desired to run Timers 0 and I simultaneously, in any
mode, the value in TMOD for Timer 0 must be ORed with the value shown for Timer 1 (Table 16 and 17).
For example, if it is desired to run Timer 0 in mode I GATE (external control), and Timer I in mode 2 COUNTER,
then the value that must be loaded into TMOD is 69H (09H from Table 14 ORed with 60H from Table 17).
Moreover, it is assumed that the user, at this point, is not ready to tum the timers on and will do that at a different
point in the program by setting bit TRx (in TCON) to 1.
TIMER/COUNTER 0
AsaTlmer:
Table 14
TMOD
TIMER 0 INTERNAL EXTERNAL
MODE
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-bit Timer OOH 08H
1 1S-bitTimer . 01H 09H
2 8-bit Auto-Reload 02H OAH
3 two 8-bit Timers 03H OSH
As a Counter:
Table 15
TMOD
COUNTER 0 INTERNAL EXTERNAL
MODE
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-bit Timer 04H OCH
1 1S-bit Timer 05H OOH
2 8-bit Auto-Reload OSH OEH
3 one 8-bit Counter 07H OFH
NOTES:
1. The Timer is turned ON/OFF by setting/clearing bit TAO in the software.
2. The Timer is turned ON/OFF by the 1 to 0 transition on iN'i'O (P3.2) when TAO = 1
(hardware control).
TIMER/COUNTER 1
As a Timer:
Table 16
TMOD
TIMER 1 INTERNAL EXTERNAL
MODE
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-blt Timer OOH 80H
1 16-bit Timer 10H 90H
2 8-bit Auto-Reload 20H AOH
3 does not run 30H BOH
As a Counter:
Table 17
TMOD
COUNTER 1 INTERNAL EXTERNAL
MODE
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-bit Timer 40H COH
1 16-bitTimer 50H DOH
2 8-bit Auto-Reload 60H EOH
3 not available - -
NOTES:
1. The Timer Is tumed ON/OFF by setting/clearing bit TR1 In the software.
2. The Timer Is tumed ON/OFF by the 1 to 0 transition on INTI (p3.3) when TRI = 1
(herdware control).
SCON: (SOCON IN THE 83C652 AND 83C552) SERIAL PORT CONTROL REGISTER.
BIT ADDRESSABLE
I.
SMO SM1 SM2 REN TB8 RB8 TI RI
SMO SCON.7 Serial Port mode specifier. (NOTE 1).
SMI SCON.6 Serial Port mode specifier. (NOTE 1).
SM2 SCON.5 Enables the multiprocessor communication feature in modes 2 & 3. In mode 2 or 3, ifSM2 is set
to 1 then RI will not be activated if the received 9th data bit (RB8) is O. In mode I, if SM2 = 1
then RI will not be activated if a valid stop bit was not received. In mode 0, SM2 should be O.
(See Table 18).
REN SCON. 4 Set/Cleared by software to EnablelDisable reception.
TB8 SCON.3 The 9th bit that will be transmitted in modes 2 & 3. Set/Cleared by software.
RB8 SCON. 2 In modes 2 & 3, is the 9th data bit that was received. In mode I, if SM2 = 0, RB8 is the stop bit
that was received. In mode 0, RB8 is not used.
TI SCON. I Transmit interrupt flag. Set by hardware at the end of the 8th bit time in mode 0, or at the
beginning of the stop bit in the other modes. Mnst be cleared by software.
RI SCON.O Receive 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 (except see SM2). Must be cleared by software.
NOTE 1:
B R K x Oscillator Freq.
aud ate = 32 x 12 x [256 - (TH1))
If SMOD = 0, then K = 1.
If SMOD = I, then K = 2. (SMOD is the PCON register).
Most of the time the user knows the baud rate and needs to know the reload value for TH 1.
Therefore, the equation to calculate THI can be written as:
KxOsc Freq.
TH1 = 256
384 x baud rate
TH 1 must be an integer value. Rounding off TH 1 to the nearest integer may not produce the desired baud rate. In
this case, the user may have to choose another crystal frequency.
Since the PCON register is not bit addressable, one way to set the bit is logical ORing the PCON register. (ie, ORL
PCON,#80H). The address of PCON is 87H.
In this mode none of the TimerS are used and the clock comes from the internal phase 2 clock.
Oscillator Oscillator
Mnemonic Description Byte Mnemonic Description Byte
Period Period
1-
DATA TRANSFER (Continued) BOOLEAN VARIABLE MANIPULATION
MOV @Ri,direct Move direct 2 24 CLR C Clear Carry 1 12
byte to CLR bit Clear direct bit 2 12
indirect RAM SETB C Set Carry 12
MOV @Ri,#data Move 2 12 SETB bit Set direct bit 2 12
immediate CPL C Complement 12
data to Carry
indirect RAM CPL bit Complement 2 "12
MOV DPTR, #datal6 Load Data 3 24 direct bit
Pointer with a ANL C,bit AND direct bit 2 24
16-bit constant to CARRY
MOVC A,@A+DPTR Move Code 24 ANL C,/bit AND complement 2 24
byte relative to of direct bit
DPTRto Acc to Carry
MOVC A,@A+PC Move Code 24 ORL C,bit OR direct bit 2 24
byte relative to to Carry
PC to Acc ORL C,/bit OR complement 2 24
MOVX A,@Ri Move 24 of direct bit
External to Carry
RAM (B-bit MOV C,bit Move direct bit 2 12
addr) to Acc to Carry
MOVX A,@DPTR Move 24 MOV bit,C Move Carry to 2 24
External direct bit
RAM (16-bit JC rei Jump if Carry 2 24
addr) to Acc is set
MOVX @Ri,A Move Acc to 24 JNC rei Jump if Carry 2 24
External RAM not set
(B-bit addr) JB bit,rel Jump if direct 3 24
MOVX @DPTR,A Move Acc to 24 Bit is set
External RAM JNB bit,rel Jump if direct 3 24
(16-bit addr) Bit is Not set
PUSH direct Push direct 2 24 JBC bit,rel Jump if direct 3 24
byte onto Bit is set &
stack clear bit
POP direct Pop direct 2 24 PROGRAM BRANCHING
byte from ACALL addrll Absolute 2 24
stack Subroutine
XCH A,Rn Exchange 12 Call
register with LCALL addr16 Long 3 24
Accumulator Subroutine
XCH A,direct Exchange 2 12 Call
direct byte RET Return from 24
with Subroutine
Accumulator RETI Return from 24
XCH A,@Ri Exchange 12 interrupt
indirect RAM AJMP addrll Absolute 2 24
with Jump
Accumulator WMP addr16 Long Jump 3 24
XCHD A,@Ri Exchange low- 12 SJMP rei Short Jump 2 24
order Digit (relative addr)
indirect RAM All mnemonics copyrighted © Intel Corporation 19BO
with Acc
INSTRUCTION DEFINITIONS
ACALL addr11
Description: ACALL unconditionally calls a subroutine located at the indicated address. The instruction
increments the PC twice to obtain the address of the following instruction, then pushes the
16-bit result onto the stack (low-order byte first) and increments the Stack Pointer twice. The
destination address is obtained by successively concatenating the five high-order bits of the
incremented PC, opcode bits 7-5, and the second byte of the instruction. The subroutine called
must therefore start within the same 2K block of the program memory as the first byte of the
instruction following ACALL. No flags are affected.
Example: Initially SP equals 07H. The label "SUBRTN" is at program memory location 0345 H. After
executing the instruction,
ACALL SUBRTN
at location Ol23H, SP will contain 09H, internal RAM locations OSH and 09H will contain
25H and OIH, respectively, and the PC will contain 0345H.
Bytes: 2
Cycles: 2
Encoding: I a10 a9 a8 1 0 0 0 1 I a7 a6 a5 a4 a3 a2 a1 aO
Operation: ACALL
(PC) +- (PC) + 2
(SP) +- (SP) + 1
«SP» +- (PC7-O)
(SP) +- (SP) + I
«SP) +- (PCIS-S)
(PCIO-O) +- page address
Function: Add
De.crlptlon: ADD adds the byte variable indicated to the Accumulator, leaving the result in the Accumula-
tor. The carry and auxiliary-carry flags are set, respectively, if there is a carry-out from bit 7 or
bit 3, and cleared otherwise. When adding unsigned integers, the carry flag indicates an
overflow occured.
OV is set if there is a carry-out of bit 6 but not out of bit 7, or a carry-out of bit 7 but not bit 6;
otherwise OV is cleared. When adding signed integers, OV indicates a negative number pro-
duced as the sum of two positive operands, or a positive sum from two negative operands.
Four source operand addressing modes are allowed: register, direct, register-indirect, or imme-
diate.
Example: The Accumulator holds OC3H (llOOOOllB) and register 0 holds OAAH (10 10 10 lOB). The
instruction,
ADD A,RO
will leave 6DH (01 101 IOIB) in the Accumulator with the AC flag cleared and both the carry
flag and OV set to 1.
ADD A,Rn
Byte.:
Cycle.:
Encoding: I 0 0 1 0 1 r r r
Operation: ADD
(A) ..- (A) + (Rn)
ADD A,dlrect
Byte.: 2
Cycle.:
Operation: ADD
(A) ..- (A) + (direct)
ADD A,@Ri
Bytes:
Cycles:
Encoding:
1 00 1 0 011
Operation: ADD
(A) - (A) + «Rj))
ADD A, # data
Bytes: 2
Cycles:
Operation: ADD
(A) -(A) + # data
OV is set if there is a carry-out of bit 6 but not out of bit 7, or a carry-out of bit 7 but not out of
bit 6; otherwise OV is cleared. When adding signed integers, OV indicates a negative number
produced as the sum of two positive operands or a positive sum from two negative operands.
Four source operand addressing modes are allowed: register, direct, register-indirect, or imme-
diate.
Example: The Accumulator holds OC3H (llOOOOllB) and register 0 holds OAAH (lOlOJOlOB) with the
carry flag set. The instruction,
ADDC A,RO
will leave 6EH (01 1011 lOB) in the Accumulator with AC cleared and both the Carry flag and
OV set to I.
ADDC A,Rn
Bytes:
Cycles:
Operation: ADDC
(A) - (A) + (C) + (R,J
ADDC A,dlrect
Bytes: 2
Cycles:
Operation: ADDC
(A) - (A) + (C) + (direct)
ADDC A,@RI
Bytes:
Cycles:
Operation: ADDC
(A) - (A) + (C) + «Rv)
ADDC A,#data
Bytes: 2
Cycles:
AJMP addr11
AJMP JMPADR
Encoding: I a10 a9 a8 0 0 0 0 1 a7 a6 a5 a4 a3 a2 a1 aO
Operation: AJMP
(PC) +- (PC) + 2
(PCw.o) +- page address
ANL <dest-byte>,<src-byte>
The two operands allow six addressing mode combinations. When the destination is the Accu-
mulator, the source can use register, direct, register-indirect, or immediate addressing; when
the destination is a direct address, the source can be the Accumulator or immediate data.
Note: When this instruction is used to modify an output port, the value used as the original
port data will be read from the output data latch, not the input pins.
Example: If the Accumulator holds OC3H (1IOOOOIIB) and register 0 holds 55H (OlOI010IB) then the
instruction,
ANL A,RO
When the destination is a directly addressed byte, this instruction will clear combinations of
bits in any RAM location or hardware register. The mask byte determining the pattemofbits
to be cleared would either be a constant contained in the instruction or a value computed in
the Accumulator at run-time. The instruction,
ANL A,Rn
Bytes:
Cycl..:
Encoding: 1 0 1 01 1 1 r r r I
Operation: ANL
(A) - (A) A (Rn)
ANL A,dlrect
Byte.: 2
Cycles:
Operation: ANL
ANL A,@RI
Byte.:
Cycle.:
Operation: ANL
(A) - (A) A #data
ANL dlrect,A
Bytes: 2
Cycle.:
Operation: ANL
(direct) +- (direct) /\ # data
ANL C,<src-blt>
ANL C,blt
Bytes: 2
Cycles: 2
Operation: ANL
(C) +- (C) /\ (bit)
ANL C,/blt
Bytes: 2
Cycles: 2
Operation: ANL
(C) +- (C) /\ --, (bit)
sets the carry. flag and branches to the instruction at label NOT_EQ. By testing the carry flag,
this instruction determines whether R 7 is greater or less than 60H.
If the data being presented to Port I is also 34H, then the instruction,
clears the carry flag and continues with the next instruction in sequence, since the Accumula-
tor does equal the data read from PI. (If some other value was being input on PI, the program
will loop at this point until the PI data changes to 34H.)
CJNE A,direct,rel
Bytes: 3
Cycles: 2
CJNE A, # data,rel
Bytes: 3
Cycles: 2
CJNE Rn,#data,rel
Bytes: 3
Cycles: 2
CJNE @RI,#data,rel
Bytes: 3
Cycles: 2
CLR A
CLR A
Encoding: I1 1 1 0 1 0 0
Operation: CLR
(A)-O
CLR bit
CLR PI.2
CLR C
Bytes:
Cycles:
Encoding: I1 0 0 0 0 1 1
Operation: CLR
(C)-O
CLR bit
Bytes: 2
Cycles:
Operation: CLR
(bit) - 0
CPL A
CPL A
Encoding: 11110100
Operation: CPL
(A) - - , (A)
CPL bit
Note: When this instruction is used to modify an output pin, the value used as the original data
will be read from the output data latch, not the input pin.
Example: Port I has previously been written with 5BH (OlOlllOlB). The instruction sequence,
CPL Pl.l
CPL P1.2
CPL C
Bytes:
Cycles:
Encoding: 1_1_0_1_....>-_0_0_1_1-1
....
Operation: CPL
(C) - - , (C)
CPL bit
Bytes: 2
Cycles:
Operation: CPL
(bit) +- -, (bit)
DA A
If Accumulator bits 3-0 are·greater than nine (xxxxlOlO-xxxxllll), or if the AC flag is one,
six is added to the Accumulator producing the proper BCD digit in the low-order nibble. TIlls
internal addition would set the carry flag if a carry-out of the low-order four-bit field propagat-
ed through all high-order bits, but it would not clear the carry flag otherwise.
If the carry flag is now set, or if the four high-order bits now exceed nine (1010xxxx-lllxxxx),
these high-order bits are incremented by six, producing the proper BCD digit in the high-order
nibble. Again, this would set the carry flag if there was a carry-out of the high-order bits, but
wouldn't clear the carry. The carry flag thus indicates if the sum of the original two BCD
variables is greater than 100, allowing multiple precision decimal addition. OV is not affected.
All of this occurs during the one instruction cycle. Essentially, this instruction performs the
decimal conversion by adding OOH, 06H, 6OH, or 66H to the Accumulator, depending on
initial Accumulator and PSW conditions.
Note: DA A cannot simply convert a hexadecimal number in the Accumulator to BCD nota-
tion, nor does DA A apply to decimal subtraction.
Example: The Accumulator holds the value 56H (01010110B) representing the packed BCD digits of the
decimal number 56. Register 3 contains the value 67H (OII00IIIB) representing the packed
BCD digits of the decimal number 67. The carry flag is set. The instruction sequence.
ADDC A,R3
DA A
will first perform a standard twos-complement binary addition, resulting in the value OBEH
(10111110) in the Accumulator. The carry and auxiliary carry flags will be cleared.
The Decimal Adjust instruction will then alter the Accumulator to the value 24H
(OOI00I00B), indicating the packed BCD digits of the decimal number 24, the low-order two
digits ofthe decimal sum of 56, 67, and the carry-in. The carry flag will be set by the Decimal
Adjust instruction, indicating that a decimal overflow occurred. The true sum 56, 67, and 1 is
124.
BCD variables can be incremented or decremented by adding 01H or 99H. If the Accumulator
initially holds 30H (representing the digits of 30 decimal), then the instruction sequence,
ADD A,#99H
DA A
will leave the carry set and 29H in the Accumulator, since 30 + 99 = 129. The low-order
byte of the sum can be interpreted to mean 30 - 1 = 29.
Bytes:
Cycles:
EnCOding: I1 1 0 1 0 1 0 0
Operation: DA
-contents of Accumulator are BCD
IF [[(A3-O) > 9) V [(AC) = 111
THEN(A3-O) +- (A3-O) + 6
AND
DEC byte
Function: Decrement
Description: The variable indicated is decremented by I. An original value of OOH will underflow to OFFH.
No flags are affected. Four operand addressing modes are allowed: accumulator, register,
direct, or register-indirect.
Note: When this instruction is used to modify an output port, the value used as the original
port data will be read from the output data latch, not the input pins.
£xample: Register 0 contains 7FH (OlllllllB). Internal RAM locations 7EH and 7FH contain OOH
and 4OH, respectively. The instruction sequence,
DEC @RO
DEC RO
DEC @RO
will leave register 0 set to 7EH and internal RAM locations 7EH and 7FH set to OFFH and
3FH.
DEC A
Bytes:
Cycles:
Encoding: 100010100
Operation: DEC
(A) - (A) - 1
DEC Rn
Bytes:
Cycles:
Operation: DEC
(Rn) - (Rn) - 1
DEC direct
Bytes: 2
Cycles:
Operation: DEC
(direct) +- (direct) -
DEC @RI
Bytes:
Cycles:
Encoding: 1 °°° ° 1 1
Operation: DEC
«Ri» +- «Ri» - I
DIV AB
Function: Divide
Description: DIV AB divides the unsigned eight-bit integer in the Accumulator by the unsigned eight-bit
integer in register B. The Accumulator receives the integer part of the quotient; register B
receives the integer remainder. The carry and OV flags will be cleared.
Exception: if B had originally contained OOH, the values returned in the Accumulator and B-
register will be undefined and the overflow flag will be set. The carry flag is cleared in any
case.
Example: The Accumulator contains 251 (OFBH or lIIIIOIIB) and B contains 18 (12H or 000100 lOB).
The instruction,
DIV AB
will leave 13 in the Accumulator (ODH or OOOOllOIB) and the value 17 (llH or OOOIOOOIB)
in B, since 251 = (13 X 18) + 17. Carry and OV will both be cleared.
Bytes:
Cycles: 4
Encoding: 1 1 °°° ° °° 1
Operation: DIV
(A)15-8 +- (A)/(B)
(Bh-o
Note: When this instruction is used to modify an output port, the value used as the original
port data will be read from the output data latch, not the input pins.
Example: Internal RAM locations 40H, 50H, and 60H contain the values OIH, ?OH, and 15H, respec-
tively. The instruction sequence,
DJNZ 40H,LABEL_l
DJNZ 50H,LABEL_2
DJNZ 60H,LABEL_3
will cause a jump to the instruction at label LABEL_2 with the values OOH, 6FH, and 15H in
the three RAM locations. The first jump was not taken because the result was zero.
This instruction provides a simple way of executing a program loop a given number of times,
or for adding a moderate time delay (from 2 to 512 machine cycles) with a single instruction.
The instruction sequence,
MOV R2,#8
TOGGLE: CPL Pl.?
DJNZ R2,TOGGLE
will toggle Pl.? eight times, causing four output pulses to appear at bit 7 of output Port I.
Each pulse will last three machine cycles; two for DJNZ and one to alter the pin.
DJNZ Rn,rel
Bytes: 2
Cycles: 2
Operation: DJNZ
(PC) - (PC) + 2
(Rn) - (Rn) - I
IF (Rn) > 0 or (Rn) < 0
THEN
(PC) - (PC) + rel
DJNZ dlrect,rel
Bytes: 3
Cycles: 2
Operation: DJNZ
(PC) +- (PC) + 2
(direct) +- (direct) -
IF (direct) > 0 or (direct) < 0
THEN
(PC) +- (PC) + reI
INC <byte>
Function: Increment
Description: INC increments the indicated variable by I. An original value of OFFH will overflow to OOH.
No flags are affected. Three addressing modes are allowed: register, direct, or register-indirect.
Note: When this instruction is used to modify an output port, the value used as the original
port data will be read from the output data latch, not the input pins.
Example: Register 0 contains 7EH (011 II II lOB). Internal RAM locations 7EH and 7FH contain OFFH
and 4OH, respectively. The instruction sequence,
INC @RO
INC RO
INC @RO
will leave register 0 set to 7FH and internal RAM locations 7EH and 7FH holding (respective-
ly) OOH and 4tH.
INC A
Bytes:
Cycles:
Encoding: 10000 I0 1 0 0
Operation: INC
(A) +- (A) +
INC Rn
Bytes:
Cycles:
Encoding: I 0000 I 1 r r r
Operation: INC
(Rn)- (Rn) +
INC direct
Bytes: 2
Cycles:
Operation: INC
(direct) - (direct) +
INC @RI
Bytes:
Cycles:
INC DPTR
INC DPTR
INC DPTR
INC DPTR
Encoding: I1 0 1 0 0 0 1 1
Operation: INC
(DPTR) - (DPTR) + I
JB blt,rel
JB P1.2,LABELl
JB ACC.2,LABEL2
Operation: JB
(PC) +- (PC) + 3
IF (bit) = I
THEN
(PC) +- (PC) + rei
JBC bit,rel
Note: When this instruction is used to test an output pin, the value used as the original data
will be read from the output data latch, not the input pin.
Example: The Accumulator holds 56H (01010ll0B). The instruction sequence,
JBC ACC.3,LABELl
JBC ACC.2,LABEL2
will cause program execution to continue at the instruction identified by the label LABEL2,
with the Accumulator modified to 52H (0 101 00 lOB).
Bytes: 3
Cycles: 2
Operation: JBC
(PC) +- (PC) + 3
IF (bit) = 1
THEN
(bit) +- 0
(PC) +- (PC) + rei
JC rei
JC LABELl
CPL C
JC LABEL 2
will set the carry and cause program execution to continue at the instruction identified by the
label LABEL2.
Bytes: 2
Cycles: 2
Operation: JC
(PC) +- (PC) + 2
IF (C) = 1
THEN
(PC) +- (PC) + reI
JMP @A+DPTR
MOV DPTR,#JMP_TBL
JMP @A+DPTR
AJMP LABELO
AJMP LABELl
AJMP LABEL2
AJMP LABEL3
If the Accumulator equals 04H when starting this sequence, execution will jump to label
LABEL2. Remember that AJMP is a two-byte instruction, so the jump instructions start at
every other address.
Bytes:
Cycles: 2
Encoding: 101110011
Operation: JMP
(PC) - (A) + (DPTR)
JNB blt,rel
JNB P1.3,LABELl
JNB ACC.3,LABEL2
Operation: JNB
(PC) +- (PC) + 3
IF (bit) = 0
THEN (PC) +- (PC) + reI.
JNC rei
INC LABELl
CPL C
JNC LABEL2
will clear the carry and cause program execution to continue at the instruction identified by
the label LABEL2.
Bytes: 2
Cycles: 2
Operation: JNC
(PC) +- (PC) + 2
IF (C) = 0
THEN (PC) +- (PC) + reI
JNZ rei
JNZ LABELl
INC A
JNZ LABEL2
Operation: JNZ
(PC) - (PC) + 2
IF (A) =F °
THEN (PC) - (PC) + rei
JZ rei
JZ LABELl
DEC A
JZ LABEL2
will change the Accumulator to DOH and cause program execution to continue at the instruc-
tion identified by the label LABEL2.
Bytes: 2
Cycles: 2
Operation: JZ
(PC) - (PC) + 2
IF (A) = °
THEN (PC) - (PC) + rei
LCALL SUBRTN
at location 0123H, the Stack Pointer will contain 09H, internal RAM locations OSH and 09H
will contain 26H and 01H, and the PC will contain 1235H.
Bytes: 3
Cycles: 2
Operation: LCALL
(PC) +- (PC) + 3
(SP) +- (SP) + 1
«SP» +- (PC7-O)
(SP) +- (SP) + I
«SP» +- (PCIS-S)
(PC) +- addf!5.0
LJMP addr16 (Implemented in 87C751 and 87C752, for use in in-circuit emulation).
UMP JMPADR
Operation: UMP
(PC) +- addrl5-O
This is by far the most flexible operation. Fifteen combinations of source and destination
addressing modes are allowed.
Example: Internal RAM location 30H holds 4OH. The value of RAM location 40H is 10H. The data
present at input port I is llOOlOlOB (OCAH).
leaves the value 30H in register 0, 40H in both the Accumulator and register 1, IOH in register
B, and OCAH (11001010B) both in RAM location 40H and output on port 2.
MOV A,Rn
Bytes:
Cycles:
Encoding: 11 1 1 0 1r r r
Operation: MOV
(A) -(Rn)
"MOV A,dlrect
Bytes: 2
Cycles:
Operation: MOV
(A) - (direct)
MOV A,@RI
Bytes:
Cycles:
Encoding: 11 1 1 0 o1
Operation: MOV
(A) - «Ri»
MOV A,#data
Bytes: 2
Cycles:
Operation: MOV
(A)- #data
MOV Rn,A
Bytes:
Cycles:
Encoding: I1 11 1 1 r r r
Operation: MOV
(Rn) - (A)
MOV Rn,dlrect
Bytes: 2
Cycles: 2
Operation: MOV
(Rn) - (direct)
MOV Rn,#data
Bytes: 2
Cycles:
Operation: MOV
(Rn) - #data
MOV dlrect,A
Bytes: 2
Cycles:
Operation: MOY
(direct) - (A)
MOV dlrect,Rn
Bytes: 2
Cycles: 2
Operation: MOY
(direct) - (Rn)
MOV dlrect,dlrect
Bytes: 3
Cycles: 2
Operation: MOY
(direct) - (direct)
MOV dlrect,@RI
Bytes: 2
Cycles: 2
Operation: MOY
(direct) - «Ri»
MOV direct, # data
Bytes: 3
Cycles: 2
Operation: MOY
(direct) - #data
MOV @RI,A
Bytes:
Cycles:
Encoding: 1 1 1 1 1 o1
Operation: MOV
«Ri» - (A)
MOV @RI,dlrect
Bytes: 2
Cycles: 2
Operation: MOV
«Ri» - (direct)
MOV @RI,#data
Bytes: 2
Cycles:
MOV P1.3,C
MOV C,P3.3
MOV P1.2,C
will leave the carry cleared and change Port 1 to 39H (OOlllOOlB).
MOY C,blt
Bytes: 2
Cycles:
Operation: MOY
(C) +- (bit)
MOY blt,C
Bytes: 2
Cycles: 2
Operation: MOY
(bit) +- (C)
MOY DPTR,#data16
MOY DPTR,#1234H
will load the value 1234H into the Data Pointer: DPH will hold 12H and DPL will hold 34H.
Bytes: 3
Cycles: 2
OperatIon: MOY
(DPTR) +- #datalS"()
DPH 0 DPL +- #datalS_S 0 #data7"()
RELJC: INC A
MOVC A,@A+PC
RET
DB 66H
DB 77H
DB 88H
DB 99H
If the subroutine is called with the Accumulator equal to OIH, it will return with 77H in the
Accumulator. The INC A before the MOVC instruction is needed to "get around" the RET
instruction above the table. If several bytes of code separated the MOVC from the table, the
corresponding number would be added to the Accumulator instead.
MOVC A,@A+DPTR
Bytes: I
Cycles: 2
Encoding: 11 0 0 1 0 0 1 1
Operation: MOVC
(A) +- «A) + (DPTR))
MOVC A,@A + PC
Bytes:
Cycles: 2
Operation: MOVC
(PC) +- (PC) + I
(A) +- «A) + (PC))
In the first type, the contents of RO or R I in the current register bank provide an eight-bit
address multiplexed with data on PO. Eight bits are sufficient for external I/O expansion
decoding or for a relatively small RAM array. For somewhat larger arrays, any output port
pins can be used to output higher-order address bits. These pins would be controlled by an
output instruction preceding the MOVX.
In the second type of MOVX instruction, the Data Pointer generates a sixteen-bit address. P2
outputs the high-order eight address bits (the contents of DPH) while PO multiplexes the low-
order eight bits (DPL) with data. The P2 Special Function Register retains its previous con-
tents while the P2 output buffers are emitting the contents of DPH. This form is faster and
more efficient when accessing very large data arrays (up to 64K bytes), since no additional
instructions are needed to set up -.!he output ports.
It is possible in some situations to mix the two MOVX types. A large RAM array with its
high-order address lines driven by P2 can be addressed via the Data Pointer, or with code to
output high-order address bits to P2 followed by a MOVX instruction using RO or R I.
Example: An external 256 byte RAM using multiplexed addressldata lines is connected to
the 8051 Port O. Port 3 provides control lines for the external RAM. Ports 1
and 2 are used for normal 1/0. Registers 0 and 1 contain 12H and 34H. Loca-
tion 34H of the external RAM holds the value 56H. The instruction sequence,
MOVX A,@RI
MOVX @RO,A
copies the value 56H into both the Accumulator and external RAM location 12H.
MOVX A,@Ri
Bytes:
Cycles: 2
Encoding: 11 1 1 0 o0 1 i
Operation: MOVX
(A) - «Ri»
MOVX A,@DPTR
Bytes:
Cycles: 2
Encoding: 11 1 1 0 0000
Operation: MOVX
(A) - «DPTR»
MOVX @RI,A
Bytes:
Cycles: 2
Encoding: 11 1 1 1 001
Operation: MOVX
«Ri» - (A)
MOVX @DPTR,A
Bytes:
Cycles: 2
Encoding: 11 1 1 1 0 0 0 0
Operation: MOVX
(DPTR)-(A)
NOP
Function: No Operation
Description: Execution continues at the following instruction. Other than the PC, no registers or flags are
affected.
Example: It is desired to produce a low-going output pulse on bit 7 of Port 2 lasting exactly 5 cycles. A
simple SETB/CLR sequence would generate a one-cycle pulse, so four additional cycles must
be inserted. This may be done (assuming no interrupts are enabled) with the instruction
sequence,
CLR P2.7
NOP
NOP
NOP
NOP
SETB P2.7
Bytes:
Cycles:
Encoding: I0 0 0 0 I 0 0 0 0
Operation: NOP
(PC) +- (PC) +
MUL AB
Function: Multiply
Description: MUL AB multiplies the unsigned eight-bit integers in the Accumulator and register B. The
low-order byte of the sixteen-bit product is left in the Accumulator, and the high-order byte in
B. If the product is greater than 255 (OFFH) the overflow flag is set; otehrwise it is cleared.
The carry flag is always cleared.
Example: Originally the Accumulator holds the value 80 (SOH). Register B holds the value 160 (OAOH).
The instruction,
MUL AB
will give the product 12,800 (32ooH), so B is changed to 32H (oollooIOB) and the Accumula-
tor is cleared. The overflow flag is set, carry is cleared.
Bytes:
Cycles: 4
Encoding: I 1 0 1 0 0 1 0 0
Operation: MUL
(Ah_o +- (A) X (B)
(Bhs.8
The two operands allow six addressing mode combinations. When the destination is the Accu-
mulator, the source can use register, direct, register-indirect, or immediate addressing; when
the destination is a direct address, the source can be the Accumulator or immediate data.
Note: When this instruction is used to modify an output port, the value used as the original
port data will be read from the output data latch, not the input pins.
Example: If the Accumulator holds OC3H (! lOOOOIIB) and RO holds 55H (OIOIOIOIB) then the in-
struction,
ORL A,RO
When the destination is a directly addressed byte, the instruction can set combinations of bits
in any RAM location or hardware register. The pattern of bits to be set is determined by a
mask byte, which may be either a constant data value in the instruction or a variable computed
in the Accumulator at run-time. The instruction,
ORL Pl,#OOIlOOIOB
ORL A,Rn
Bytes:
Cycles:
Encoding: I0 1 0 0 1 r r r
Operation: ORL
(A) - (A) V (Rn)
ORL A,direct
Bytes: 2
Cycles:
Operation: ORL
(A) +- (A) V (direct)
ORL A,@Ri
Bytes:
Cycles:
Encoding: 101 00 o1 1
Operation: ORL
(A) +- (A) V «Ri))
ORL A,#data
Bytes: 2
Cycles:
Operation: ORL
(A) +- (A) V # data
ORL direct,A
Bytes: 2
Cycles:
Operation: ORL
(direct) +- (direct) V (A)
immediate data
Encoding: 101 00 001 1 direct addr.
Operation: ORL
(direct) +- (direct) V # data
ORL C,blt
Bytes: 2
Cycles: 2
ORL C,/blt
Bytes: 2
Cycles: 2
POP direct
POP DPH
POP DPL
will leave the Stack Pointer equal to the value 30H and the Data Pointer set to 0123H. At this
point the instruction,
POP SP
will leave the Stack Pointer set to 20H. Note that in this special case the Stack Pointer was
decremented to 2FH before being loaded with the value popped (20H).
Bytes: 2
Cycles: 2
Operation: POP
(direct) - «SP))
(SP) - (SP) - I
PUSH direct
PUSH DPL
PUSH DPH
will leave the Stack Pointer set to OBH and store 23H and OIH in internal RAM locations
OAH and OBH, respectively.
Bytes: 2
Cycles: 2
Encoding: 1 1 1 ° ° ° °°
0 1 1
direct address
Operation: PUSH
(SP) - (SP) + I
«SP)) - (direct)
RET
RET
will leave the Stack Pointer equal to the value 09H. Program execution will continue at
location 0123H.
Bytes:
Cycles: 2
Encoding: 100100010
Operation: RET
(PCIS-S) +- «SP»
(SP) +- (SP) - 1
(PC7-O) +- «SP»
(SP) +- (SP) - 1
RETI
RETI
will leave the Stack Pointer equal to 09H and return program execution to location 0123H.
Bytes:
Cycles: 2
Operation: RETI
(PCIS-S) +- «SP»
(SP)- (SP) - 1
(PC7-O) +- «SP»
(SP) +- (SP) - 1
RL A
RL A
leaves the Accumulator holding the value 8BH (lOOOIOIIB) with the carry unaffected.
Bytes:
Cycles:
Encoding: 1 0 0 1 0 0 0 1 1
Operation: RL
CAn+l)_CAn). n = 0 - 6
CAO)-CA7)
RLC A
RLC A
leaves the Accumulator holding the value 8BH (IOOOIOIOB) with the carry set.
Bytes:
Cycles:
Operation: RLC
CAn+l)~(An). n - 0 - 6
CAO)-CC)
CC)-CA7)
RR A
RR A
leaves the Accumulator holding the value OE2H (llIOOOIOB) with the carry unaffected.
Bytes:
Cycles:
Encoding: 1000010011
Operation: RR
(An) _(An+l). n = 0 - 6
(A7)-(AO)
RRC A
RRC A
leaves the Accumulator holding the value 62 (0 llOOO lOB) with the carry set.
Bytes:
Cycles:
Encoding: 100010011
Operation: RRC
(An) - (An+l). n - 0 - 6
(A7) - (C)
(C)- (AO)
SETB <bit>
SETB C
SETB Pl.O
will leave the carry flag set to 1 and change the data output on Port 1 to 35H (001lO101B).
SETB C
Bytes:
Cycles:
Encoding: I1 10 1 001 1
Operation: SETB
(C)-l
SETB bit
Bytes: 2
Cycles:
Operation: SETB
(bit) - 1
SJMP rei
SJMP RELADR
will assemble into location OIOOH. After the instruction is executed, the PC will contain the
value 0123H.
(Note: Under the above conditions the instruction following SJMP will be at 102H. Therefore,
the displacement byte of the instruction will be the relative offset (0123H-0102H) = 21H. Put
another way, an SJMP with a displacement of OFEH would be a one-instruction infinite loop.)
Bytes: 2
Cycles: 2
SUBB A,<src-byte>
When subtracting signed integers OV indicates a negative number produced when a negative
value is subtracted from a positive value, or a positive result when a positive number is
subtracted from a negative number.
The source operand allows four addressing modes: register, direct, register-indirect, or imme-
diate.
Example: The Accumulator holds OC9H (llOOIOOlB), register 2 holds 54H (OIOlOlOOB), and the carry
flag is set. The instruction,
SUBB A.R2
will leave the value 74H (01 110100B) in the accumulator, with the carry flag and AC cleared
but OV set.
Notice that OC9H minus 54H is 75H. The difference between this and the above result is due
to the carry (borrow) flag being set before the operation. If the state of the carry is not known
before starting a single or multiple-precision subtraction, it should be explicitly cleared by a'
CLR C instruction. .
SUBB A,Rn
Bytes:
Cycles:
Encoding: 1 r r r
Operation: SUBB
(A) -- (A) - (C) - (Rn)
SUBB A,dlrect
Bytes: 2
C'ycles:
Operation: SUBB
(A) . - (A) - (C) - (direct)
SUBB A,@RI
Bytes:
Cycles:
Encoding: I1 0 0 1 0 1 1
Operation: SUBB
(A) . - (A) - (C) - «Ri»
SUBB A,#data
Bytes: 2
Cycles:
Operation: SUBB
(A) . - (A) - (C) - #data
SWAP A
SWAP A
Encoding: I1 10 0 0 1 0 0
Operation: SWAP
(A3-0) -;:: (A7-4)
XCH A,<byte>
XCH A,@RO
will leave RAM location 20H holding the values 3FH (OOI11111B) and 75H (0111010lB) in
the accumulator.
XCH A,Rn
Byte.:
Cycle.:
Encoding: 11 100 r r r I
Operation: XCH
(A) ~ (Rn)
XCH A,dlrect
Byte.: 2
Cycle.:
Operation: XCH
(A) ~ (direct)
XCH A,@RI
Byte.:
Cycle.:
Encoding: 11 100 o1 1 i
Operation: XCH
(A) ~ «Ri»
XCHD A,@RI
XCHD A,@RO
will leave RAM location 20H holding the value 76H (011101 lOB) and 35H (00110101B) in the
Accumulator.
Bytes:
Cycles:
EncodIng: 11101011
OperatIon: XCHD
(A3-O) -;. «Ri3-O»
XRL < dest-byte >, <src-byte >
The two operands allow six addressing mode combinations. When the destination is the Accu-
mulator, the source can use register, direct, register-indirect, or immediate addressing; when
the destination is a direct address, the source can be the Accumulator or immediate data.
(Note: When this instruction is used to modify an output port, the value used as the original
port data will be read from the output data latch, not the input pins.)
Example: If the Accumulator holds OC3H (11000011B) and register 0 holds OAAH (10101OIOB) then
the instruction,
XRL A,RO
When the destination is a directly addressed byte, this instruction can complement combina-
tions of bits in any RAM location or hardware register. The pattern of bits to be complement-
ed is then determined by a mask byte, either a constant contained in the instruction or a
variable computed in the Accumulator at run-time. The instruction,
XRL Pl,#00110001B
XRL A,Rn
Bytes:
Cycles:
Encoding: I0 1 1 0 1 r r r
Operation: XRL
(A) +- (A) ¥ (Rn)
XRL A,direct
Bytes: 2
Cycles:
Operation: XRL
(A) +- (A) ¥ (direct)
XRL A,@RI
Bytes:
Cycles:
Encoding: 1 01 1 0 o1 1 i
Operation: XRL
(A) +- (A) ¥ «Ri»
XRL A,#data
Bytes: 2
Cycles:
Encoding:
1 01 1 0 o10 0 immediate data
Operation: XRL
(A) +- (A) ¥ #data
XRL dlrect,A
Bytes: 2
Cycles:
Operation: XRL
(direct) +- (direct) ¥ (A)
XRL dlrect,#dMa
Bytes: 3
Cycles: 2
PROGRAMMING THE 87C51, 87C451 AND 87C552 After the Encryption table has been programmed the us-
er has to know its contents in order to correctly decode
The setup for programming the microcontroller is shown the program code data. The encryption table itself can-
in Figure 59. Note that the part is running with a 4 to 6 not be read out.
MHz oscillator. The clock must be running because the
device is executing internal address and program data The encryption table is programmed in the same manner
transfers during the programming. as the program memory, but using the "Pgm Encryption
Table" levels specified in Table 20. After the encryption
table is programmed verification cycles will produce only
encrypted information.
+5V
Vee
IA
A 0-A7 P1 PO PGM DATA
25 100us PULSES
1 P3.6 ALE/P"ROO TO GROUND
P3.7 SC87C51
1 PsEN
XTAL2 P2.7
4-6MHz ~ =~
~
P2.6
T T XTAL1
P2.0
IA
-P2.3 I ~
A8-A11
~ Vss
- ,--
There are two lock bits on the SC87C51 that, when set, If lock bit 2 has not been programmed the on-chip pro-
prevent the program data memory from being read out gram memory can be read out for program verification.
or programmed further. To program the lock bits repeat To verify the contents of the program memory, the ad-
the programming sequence using the "Pgm Lock Bit" dress of the location to be read is applied to ports 1 and
levels specified in Table 20. 2 as shown in Figure 60. The other pins are held at the
"Verify Code Data" levels indicated in Table 20. The
After the first lock bit is programmed, further program- contents of the addressed location will appear on port O.
ming of the code memory or the encryption table is dis- For this operation external pull-ups are required on port
abled. The other lock bit can of course still be pro- o as shown in figure 60. Note that if the encryption table
grammed. With only lock bit one programmed, the has been programmed the data presented at port 0 will
memory can still be read out for program verification. be the exclusive NOR of the program byte with a byte
After the second lock bit is programmed, it is no longer from the encryption table.
possible to read out (verify) the program memory.
+5V
Vee
P2.6 I t - - - - 0
SIGNATURE BYTES The Xl pin is the oscillator input and receives the mas-
ter system clock. This clock should be between 1.2 and
The SC87C51 contains two signature bytes that can be 6MHz.
read and used by an EPROM programming system to
identifY the device. The signature bytes identifY the de- The RESET pin is used to accept the serial data stream
vice as an SC87C51 manufactured by Signetics . that places the 87C75l into various programming modes.
This pattern consists of a 10-bit code with the LSB sent
The signature bytes are read by the same procedure as a first. Each bit is synchronized to the clock input Xl.
normal verification of locations 030H and 031H, except
that P3.6 and P3.7 need to be pulled to a logic low. The To program the 87C7Sl the part must be put into the
values are: programming mode by presenting the proper serial code
(see Table 21) to the RESET pin. To do this RESET
(030H) = ISH indicates the part made by Signetics should be held high for at least two machine cycles. Port
(031H) = 90H 87C451 94H 87C552 pins PO.l and PO.2 will be at VOH as a result of this,
9lH 87C751 95H 87C752 but they must be driven high prior to sending the serial
92H 87C51 96H 87C550 data stream on the RESET pin. The serial data bits can
93H 87C652 97H 87C52 now be transmitted over the RESET pin placing the
87C75l into one of the programming modes. Following
EPROM ERASURE the transmission of the last data bit the reset pin should
be held low.
Erasure of the EPROM occurs when the chip is exposed
to light with wavelengths shorter than 4000 angstroms. Next the address information for the location to be pro-
Sunlight and fluorescent lighting have wavelengths in this grammed is placed on Port 3 and ASEL is used to per-
range, so exposure to these light sources over an ex- form the address mUltiplexing. ASEL should be driven
tended period of time (about I week in sunlight, or 3 high and then Port 3 driven with the high order address
years in room level fluorescent lighting) could cause in- bits. ASEL is then driven low latching the high order
advertent erasure. It is recommended, for this reason, bits internally. Port 3 can now be driven with the low 8
that an opaque label be placed over the window. If the bits of the address, completing the addressing of the lo-
part is Subject to elevated temperatures or an environment cation to be programmed.
where solvents are used, Kapton tape (Fluorglas part number
2345-5 or its equivalent) can be used. A high voltage Vpp level is now applied to the Vpp in-
put. This sets Port 1 as an input port. The data to be
The recommended erasure procedure is to expose the programmed to the EPROM array should be placed on
chip to ultraviolet light (at 2537 angstroms) to an inte- Port 1. A series of 25 programming pulses is now ap-
grated dose of at least 15W-sec/cm2. Exposing the plied to the PGM pin (PO.l) to program the addressed
EPROM to an ultraviolet lamp of 12,OOOJ.LW/cm2 rating EPROM location.
for 20 to 40 minutes, at a distance of I inch, is ade-
quate. PROGRAM VERIFICATION
PROGRAMMING THE 87C751 AND 87C752 The EPROM array can be verified by placing the part in
the programming mode as described above and forcing
The 87C751 and 87C752 are programmed using a Quick- the Vpp pin to the VOH level. Four machine cycles after
pulse programming algorithm that is similar to that used addressing a location the contents of the addressed loca-
for the 87C51. It differs from the 87CSl in that a serial tion will appear on Port 1.
data stream is used to place the 87C751 in the pro-
gramming mode. 87C751 AND 87C752 SIGNATURE BYTES
Figure 61 shows a block diagram of the programming The signature bytes for the 87C75l and 87C752 are read
configuration for the 87C751. Port pin PO.2 is used for differently and are in different locations than those on
the programming voltage supply input (Vpp signal). Port the 87C51. Due to its reduced pin count, the part has to
pin PO.I is used for the program (PGM) signal. be put into "Signature Byte Read Mode" by placing a 10-
bit serial data stream on the Reset pin. The proper code
Port 3 accepts the address input for the EPROM loca- and the conditions of PO.l and PO.2, for this mode, are
tion to be programmed. Both the high and low compo- shown in Table 21.
nents of the eleven bit address are presented to the part
through port 3. Multiplexing of the address components Once the part has been placed into the Signature Byte
is performed using ASEL (PO.O). Read Mode, the signature bytes can be read by the same
procedure as a normal verification of locations OlEH
Port 1 is used as a bidirectional data bus during pro- and OlFH. The values are:
gramming and verifY operations. During the program-
ming mode, it accepts the byte to be programmed. In OlEH = ISH indicates the part was made by Signetics
the verifY mode, it returns the contents of the specified OlFH = 9lH - 87C751
address location. 01FH = 95H - 87C752
PROGRAMMING FEATURES
ERASURE CHARACTERISTICS
87C751
Vee _ + l I V
AO-A7/AB-AIO PJ.O-PJ.7
Vss
~
ADDRESS S11IOBE PO.O/ASEL
PROGRAMMING
PULSES PO.I
Vpp/VIH ~~ PO.2
Y RESET
CONTROL
LOGIC
I
I
RESET
Product Specification
Microprocessor Division
8
The SCN8051AH microcontroller, like its
SCN8048 predecessor, is efficient both
as a controller and as an arithmetic PLCC
processor. It has extensive facilities for
binary and BCD arithmetic and excels in 17 29
bit-handling capabilities. Efficient use of
program memory results from an instruc- 18 28
tion set consisting of 44% one-byte, TOP VIEW
41 % two-byte, and 15% three-byte in- Pin FunctionPin Function
structions. With a 12MHz crystal, 58% 1 NC 23 NC
of the instructions execute in 1JIS, 40% 2 P1.0 24 P2.0/A8
3 P1.1 25 P2.1/A9
in 2j1S and multiply and divide require on- 4 P1.2 26 P2.2/A10
ly 4j1S. 5 P1.3 27 P2.3/A11
6 P1.4 28 P2.4/A12
7 P1.5 29 P2.5/A13
8 P1.6 30 P2.6/A14
9 P1.7 31 P2.7/A15
10 RST 32 i>sEN
11 RxD/P3.033 ALE
12 NC 34 NC
13 TxD/P3.135 EA
14 1m'ii/P3.2
36 PO.7/AD7
15 iiili'i/P3.3
37 PO.6/AD6
16 TO/P3.4 38 PO.5/AD5
17 T1/P3.5 39 PO.4/AD4
18 WR/P3.6 40 PO.3/AD3
19 RD/P3.7 41 PO.2/AD2
20 XTAL2 42 PO.1/AD1
21 XTAL1 43 PO.O/ADO
22 Vss 44 Vee
ORDERING INFORMATION
PART NUMBER SELECTION
Temperature and
ROMless ROM Frequency
ROM~R:~]e:)HCJCJCJCJ1CJ :I:X:
Package
SCN8031 HACN40 SCNS051 HACN40 -40 to +S5°C plastic DIP 3.5 to 12MHz
ROM Pattern No.
31 - Extl12S Applies to masked ROM versions SCNS031 HCCN40 SCN8051 HCCN40 o to +70°C plastic DIP 3.5 to 12MHz
51 - 4K/12S only. Number will be assigned by
Signetics. Contact Signetics sales SCNS031 HCFN40 SCNS051 HCFN40 o to +70 0 C plastic DIP 3.5 to 15MHz
Power office for ROM pattern submission SCN8031 HAFN40 SCNS051 HAFN40 3.5 to 15MHz
-40 to +S5°C plastic DIP
Consumption requirements.
H -P~~~~c:~ Pins
SCNS031 HCCA44 SCNS051 HCCA44 o to + 70°C plastic PLCC 3.5 to 12MHz
40 = 40-pin SCNS031 HACA44 SCN8051 HACA44 -40 to +S5°C plastic PLCC 3.5 to 12MHz
44 - 44-pin
SCNS031 HCFA44 SCNS051 HCFA44 o to + 70°C plastic PLCC 3.5 to 15MHz
Package
A - Plastic LCC SCNS031 HAFA44 SCN8051 HAFA44 -40 to +S5°C plastic PLCC 3.5 to 15MHz
I - Ceramic DIP
N - Plastic DIP
Speed
C - 3.5 to 12MHz
F - 3.5 to 15MHz
Operating Temperature Range
A - -40°C to +S5°C
C = OOC to +70 0 C
BLOCK DIAGRAM
PO.o-PO.7 P2.D-P2.7
- - - - - - - - - - ~:-S':l"" --------1
PsEN
ALE
EA
RST
I
I
)
Pl.0-Pl.7 P3.o-PJ.7
PIN DESCRIPTION
PIN NO.
MNEMONIC f--~---1 TYPE NAME AND FUNCTION
DIP LCC
Vss 20 22 I Ground: OV reference.
40 44 I Power Supply: This is the power supply voltage for normal, idle, and power-down op-
Vee
eration.
PO.O-PO'? 39-32 43-36 I/O Port 0: Port 0 is an open-drain, bidirectional I/O port. Port 0 pins that have Is written
to them float and can be used as high-impedance inputs. Port 0 is also the multiplexed
low-order address and data bus during accesses to external program and data mem-
ory. In this application, it uses strong internal pullups when emitting Is.
Pl.0-Pl.? 1-8 2-9 I/O Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. Port 1 pins that
have Is written to them are pulled high by the internal pull ups and can be used as
inputs. As inputs, port 1 pins that are externally pulled low will source current because
of the internal pUll-Ups. (See DC Electrical Characteristics: lid·
P2.0-P2.? 21-28 24-31 I/O Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pUll-Ups. Port 2 pins that
have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 2 pins that are externally being pulled low will source current
because of the internal pullups. (See DC Electrical Characteristics: lid. Port 2 emits the
high-order address byte during fetches from external program memory and during
accesses to external data memory that use 16-bit addresses (MOVX @DPTR). In this
application, it uses strong internal pull-ups when emitting Is. During accesses to
exter- nal data memory that use 8-bit addresses (MOVX @Ri), port 2 emits the
contents of the P2 special function register.
P3.0-P3.7 10-17 11, I/O Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups. Port 3 pins that
13-19 have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 3 pins that are externally being pulled low will source current
because of the pUll-Ups. (See DC Electrical Characteristics: lid. Port 3 is also used for
the special features listed below:
10 11 I RxD (P3.0): Serial input port
11 13 o TxD (P3.1): Serial output port
12 14 I INTO (P3.2): External interrupt
13 15 I INT1 (P3.3): External interrupt
14 16 I TO (P3.4): Timer 0 external input
15 17 I I!JP3.5): Timer 1 external input
16 18 o WR (P3.6): External data memory write strobe
17 19 o RD (P3. 7): External data memory read strobe
RST 9 10 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets
the device. An internal diffused resistor to Vss permits a power-on reset using only an
external capacitor to Vee.
ALE 30 33 I/O Address Latch Enable: Output pulse for latching the low byte of the address during an
access to external memory. In normal operation, ALE is emitted at a constant rate of
1/6 the oscillator frequency, and can be used for external timing or clocking. Note that
one ALE pulse is skipped_during each access to external data memory.
29 32 o Program Store Enable: The read strobe to external program memory. When the device
is executing code from externl!L..!2!2gram memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to
external data memory. PSEN is not activated during fetches from internal program
memory.
31 35 I External Access Enable: EA must be externally held low to enable the device to fetch
code from external program memory locations OOOOH and OFFFH. If EA is held high, the
device executes from internal program memory unless the program counter contains an
address greater than OFFFH.
XTALI 19 21 I Crystal 1: Input to the inverting oscillator amplifier.
XTAL2 18 20 o Crystal 2: Output from the inverting oscillator amplifier and input to the internal clock
generator circuits.
VIHl Input high voltage to RST for reset, XTAL2 XTAL1 to Vss 2.5 Vcc+0.5 V
VOL Output low voltage, ports 1, 2, 36 IOL - 1.6mA 0.45 V
VOLl Output low voltage, port 0, ALE, PSEN6 IOL - 3.2mA 0.45 V
ALE
PSEiii _ _ _J
PORTO _ _ _J
PORT 2 _ _ _ _J
ALE
1 0 - - - - - tllDV - - - . - I
--~~---tRlRH-----.-I
~----------tAVDV-----~
--~
PORT 2 P2.0-P2.? OR A8-A15 FROM DPH A8-A15 FROM PCH
ALE
----~-----tWlWHI------~
1o--l---tOVWH-----ooI
1.----.;""'...---.1.
PORT 0 DATA OUT AO-A? FROM PCl
INSTRUCTION o 2 3 4 5 6 7 8
ALE
tOVXH H r- t XHOX
OUTPUT DATA
\\-_---1 '--_--' \-_---1 " - _ - ' \-_---1 '--_--' \-_---1 1...-_-'
T
WRITE TO SBUF
f
CLEAR RI t
SET RI
O.45V
t o - - - - - - t cLCL -----of
Vcc-O.5
O.45V
=x O.2Vcc+O.9
_,-O;";';;,2V,;.;c;.,;c,;.;-.;;.O;.,;.1_ __
>C Timing
Reference
Points
<
AC inputs during testing are driven at Vcc-0.5
For timing purposes, a port is no longer floating
for a logic "1" and 0.45V for a logic "0".
when a 100mV change from load voltage occurs,
Timing measurements are made at VIH min for
and begins to float when a 100mV change from
a logic "1" and V IL max for a logic "0".
the 10adedVOHIVOL level occurs.IOHIlOL~±20mA.
Vee
. -_ _ _ _....lcC
VCC
!
Vce Vee
PO
RST Ei':
(NC) XTALl
CLOCK XTAL2
SIGNAL Vss
0.45V
~------tCLCL-----~
Figure 9. Clock Signal Waveform for Icc Tests in Active and Idle Modes
tClCH tCHCL = 5ns =
Product Specification
Microprocessor Division
oo·"tJ
The Signetics SC80C31 B/SC80C51 B is a • SCN8031/SCN80S1/SC80CS1
high-performance microcontroller fabri- compatible INDEX
cated with Signetics high-density CMOS - 4K x 8 ROM
technology. The CMOS SC80C31B/ 7 0 39
- 128 x 8 RAM
SC80C51 B is functionally compatible
with the NMOS SCN8031/SCN8051 mi-
- Two 16-bit counter/timers
Lee
crocontrollers. The Signetics CMOS - Full duplex serial channel
technology combines the high speed and - Boolean processor 17 29
density characteristics of HMOS with • Memory addressing capability
the low power attributes of CMOS. - 64K ROM and 64K RAM 18 28
Signetics' epitaxial substrate minimizes • Power control modes: TOP VIEW
latch-up sensitivity. - Idle mode Pin Function Pin Function
- Power-down mode 1 NC 23 NC
The SC80C31 B/SC80C51 B contains a 2 P1.0 24 P2.0/A8
4K x 8 ROM, a 128 x 8 RAM, 32 I/O • CMOS and TTL compatible 3 P1.1 25 P2.1/A9
lines, two 16-bit counter/timers, a five- • Three speed ranges at Vee = 4 P1.2 26 P2.2/A10
5 P1.3 27 P2.3/A11
source, two priority level nested interrupt SV ±20% 6 P1.4 28 P2.4/A12
structure, a serial I/O port for either - 3.S to 12MHz 7 P1.5 29 P2.5/A13
multi-processor communications, I/O ex- - 3.S to 16MHz 8 P1.6 30 P2.6/A14
pansion or full duplex UART, and on-chip 9 P1.7 31 P2.7/A15
- O.S to 12MHz 10 RST 32 PSrN
oscillator and clock circuits. • Three package styles 11 RxD/P3.0 33 ALE
12 NC 34 NC
In addition, the SC80C31 B/SC80C51 B 13 TxD/P3.1 35 D(
has two software selectable modes of PIN CONFIGURATION 14 1l\JTO/P3.2 36 PO.7/AD7
power reduction - idle mode and power- 15 I1\i'I'i/P3.3 37 PO.6/AD6
16 TO/P3.4 38 PO.5/AD5
down mode. The idle mode freezes the 17 T1/P3.5 39 PO.4/AD4
CPU while allowing the RAM, timers, se- P1.0 :::;: I:ro Vee 18 iNrl/P3.6 40 PO.3/AD3
rial port, and interrupt system to con- P1.1 ~ ~ PO.O/ADO 19
20
lTI)/P3.7
XTAL2
41 PO.2/AD2
tinue functioning. The power-down mode 42 PO.1/AD1
P1.2.l ~ PO.1/AD1 21 XTAL1 PO.O/ADO
43
saves the RAM contents but freezes the
P1.3~ ~ PO.2/AD2 22 Vss 44 Vee
oscillator, causing all other chip func-
P1.4~ ~ PO.3/AD3 6 1 40
'8'"
tions to be inoperative.
P1.514 ~ PO.4/AD4
~:~;:::~ ~ DIP 31 EA
to ALE 17 0 29
INTO/P3.2 ~ tePSEN 18 28
INT1/P3.3g ~ P2.7/A15 TOP VIEW
TO/P3.4 14
Pin Function Pin Function
~ P2.6/A14
1 NC 23 Vss
..:!2!P3.5 ~ ~ P2.5/A13 2 P1.0 24 P2.0/A8
WR/P3.6 ~ ~ P2.4/A12 3 P1.1 25 P2.1/A9
4 P1.2 26 P2.2/A10
RD/P3.7 ~ ~ P2.3/A11 5 P1.3 27 P2.3/A11
XTAL2 ~ ~ P2.2/A10 6 P1.4 28 P2.4/A12
7 P1.5 29 P2.5/A13
XTAL1 ~ ~ P2.1/A9 P1.6 P2.6/A14
8 30
Vss &Q t£1. P2.01 A8 9 P1.7 31 P2.7/A15
10 RST 32 J5SrFJ
TOP VIEW 11 RxD/P3.0 33 ALE
12 NC 34 NC
13 TxD/P3.1 35 l:A
14 TmQ/P3.2 36 PO.7/AD7
15 iNTi IP3.3 37 PO.6/AD6
16 TO/P3,4 38 PO.5/AD5
17 T1/P3.5 39 PO,4/AD4
18 WR/P3.6 40 PO.3/AD3
19 RD/P3.7 41 PO.2/AD2
20 XTAL2 42 PO.1/AD1
21 XTAL1 43 PO.O/ADO
22 Vss 44 Vee
ROM
ROM~:;;r~BcCCC1C
Temperature and Frequency
less ROM
Package
:uIX: ROM Pattern No. 8C80C31 BCCN40 8C80C51 BCCN40 3.5 to 12MHz
o to +70°C plastic DIP
3 - ROMless Applies to masked ROM versions
5 _ ROM only. Number will be assigned by 8C80C31 BCGN40 8C80C51 BCGN40 o to +70°C plastic DIP 3.5 to 16MHz
Signetics. Contact Signetics sales 8C80C31 BCBN40 8C80C51 BCBN40 0.5 to 12MHz
o to + 70°C plastic DIP
office for ROM pattern submission
requirements. 8C80C31 BCCA44 8C80C51 BCCA44 o to + 70°C plastic LCC 3.5 to 12MHz
Pins 8C80C31 BCGA44 8C80C51 BCGA44 o to + 70°C plastic Lee 3.5 to 16MHz
40 - 40-pin
44 - 44-pin 8C80C31 BCBA44 8C80C51 BCBA44 o to +70 0 C plastic LCC 0.5 to 12MHz
Package 8C80C31 BACN40 8C80C51 BACN40 -40 to +85°C plastic DIP 3.5 to 12MHz
A - Plastic LCC
N - Plastic DIP 8C80C31 BAGN40 8C80C51 BAGN40 -40 to +85 0 C plastic DIP 3.5 to 16MHz
B - Plastic OFP
8C80C31 BACA44 8C80C51 BACA44 -40 to +85°C plastic LCC 3.5 to 12MHz
Speed
B - 0.5 to 12MHz 8C80C31 BAGA44 8C80C51 BAGA44 -40 to +85°C plastic LCC 3.5 to 16MHz
C - 3.5 to 12MHz 8C80C31 BCCB44 8C80C51 BCCB44 o to +70°C plastic OFP 3.5 to 12MHz
G - 3.5 to 16MHz
Operating Temperature Range 8C80C31 BCGB44 8C80C51 BCGB44 o to + 70°C plastic OFP 3.5 to 16MHz
A - -40°C to +85°C
C - OOC to +70 0 C
BLOCK DIAGRAM
PO.D-PIl.7 P2.O-P2.7
- - - - - - - - - - P--!~"" --------l
SBUF IE IP
PSDi ~_.r--_r_::1
ALE
EA
RST
PJ.o-PJ.7
PIN DESCRIPTION
PIN NO.
MNEMONIC LCC! TYPE NAME AND FUNCTION
DIP
QFP
Vss 20 22 I Ground: OV reference.
23 I Ground: OV reference. (QFP only)
Vee 40 44 I Power Supply: This is the power supply voltage for normal, idle, and power-down op-
eration.
PO.O-PO.? 39-32 43-36 I/O Port 0: Port 0 is an open-drain, bidirectional I/O port. Port 0 pins that have 1s written
to them float and can be used as high-impedance inputs. Port 0 is also the multiplexed
low-order address and data bus during accesses to external program and data mem-
ory. In this application, it uses strong internal pullups when emitting 1s. Port 0 also
outputs the code bytes during program verification in the SC80C31 B/SC80C51 B. Ex-
ternal pull-ups are required during program verification.
P1.0-P1.7 1-8 2-9 I/O Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pullups. Port 1 pins that
have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 1 pins that are externally pulled low will source current because
of the internal pullups. (See DC Electrical Characteristics: IILl. Port 1 also receives the
low-order address byte during program memory verification.
P2.0-P2.7 21-28 24-31 I/O Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pullups. Port 2 pins that
have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 2 pins that are externally being pulled low will source current
because of the internal pullups. (See DC Electrical Characteristics: IILl. Port 2 emits the
high-order address byte during fetches from external program memory and during
accesses to external data memory that use 16-bit addresses (MOVX @DPTR). In this
application, it uses strong internal pullups when emitting 1s. During accesses to exter-
nal data memory that use 8-bit addresses (MOVX @Ri), port 2 emits the contents of the
P2 special function register.
P3.0-P3.7 10-17 11, I/O Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups. Port 3 pins that
13-19 have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 3 pins that are externally being pulled low will source current
because of the pUll-Ups. (See DC Electrical Characteristics: IILl. Port 3 also serves the
special features of the SC80C51 family, as listed below:
10 11 I RxD (P3.0): Serial input port
11 13 0 TxD (P3.1): Serial output port
12 14 I INTO (P3.2): External interrupt
13 15 I INn (P3.3): External interrupt
14 16 I TO (P3.4): Timer 0 external input
15 17 I I1JP3.5): Timer 1 external input
16 18 0 WR (P3.5): External data memory write strobe
17 19 0 RD (P3.7): External data memory read strobe
RST 9 10 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets
the device. An internal diffused resistor to Vss permits a power-on reset using only an
external capacitor to Vee.
ALE 30 33 I/O Address Latch Enable: Output pulse for latching the low byte of the address during an
access to external memory. In normal operation, ALE is emitted at a constant rate of
1/6 the oscillator frequency, and can be used for external timing or clocking. Note that
one ALE pulse is skipped during each access to external data memory.
- -
PSEN 29 32 0 Program Store Enable: The read strobe to external program memory. When the SC80-
C31 B/SC80C51 B is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory. PSEN is not activated during fetches from internal
program memory.
EA 31 35 I External Access Enable: EA must be externally held low to enable.!b..e device to fetch
code from external program memory locations OOOOH and OFFFH. If EA is held high, the
device executes from internal program memory unless the program counter contains an
address greater than OFFFH.
XTAL1 19 21 I Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock gen-
erator circuits.
XTAL2 18 20 0 Crystal 2: Output from the inverting oscillator amplifier.
VOL1 Output low voltage, port 0, ALE, PSEN IOL - 3.2mA2 0.45 V
AC ELECTRICAL CHARACTERISTICS TA - O°C to +70°C or TA - -40°C to +B5°C, VCC - 5V ±20%, VSS - OV1, 2
12MHz CLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER UNIT
Min Max Min Max
Program Memory
l/tClCl 1 Oscillator frequency: Speed Versions
SCBOC31B/SCBOC51B B 0.5 12 MHz
SCBOC31B/SCBOC51B C 3.5 12 MHz
SCBOC31B/SCBOC51B G 3.5 16 MHz
tlHll 1 ALE pulse width 127 2tClCl -40 ns
tAVlL 1 Address valid to ALE low 2B t0101-55 ns
tllAX 1 Address hold after ALE low 4B tClCl -35 ns
tlLIV 1 ALE low to valid instruction in 234 4tClCL -100 ns
tllPl 1 ALE low to PSEN low 43 tClCl -40 ns
tp PH 1 PSEN pulse width 205 3tClCl -45 ns
tpLiV 1 PSEN low to valid instruction in 145 3tclCl -105 ns
tpXIX 1 Input instruction hold after PSEN 0 0 ns
tpXIZ 1 Input instruction float after PSEN 59 tClCl -25 ns
tAVIV 1 Address to valid instruction in 312 5tClCl -105 ns
tplAZ 1 PSEN low to address float 10 10 ns
Data Memory
tRlRH 2, 3 RD pulse width 400 6tClCl -100 ns
tWlWH 2, 3 WR pulse width 400 6tClCl -100 ns
tRIDV 2, 3 RD low to valid data in 252 5tcLCL -165 ns
tRHDX 2, 3 Data hold after RD 0 0 ns
tRHDZ 2, 3 Data float after RD 97 2tClCL -70 ns
tllDV 2, 3 ALE low to valid data in 517 BtClCl -150 ns
tAVDV 2, 3 Address to valid data in 5B5 9tCLCl -165 ns
tllWl 2,3 ALE low to RD or WR low 200 300 3tClCl -50 3tClCl +50 ns
tAVWL 2, 3 Address valid to WR low or RD low 203 4tOLCI -130 ns
tQVWX 2, 3 Data valid to WR transition 23 tCLCl-60 ns
tWHOX 2, 3 Data hold after WR 33 tCLCL-50 ns
IRlAZ 2,3 RD low 10 address float 0 0 ns
tWHlH 2, 3 RD or WR high to ALE high 43 123 tClCL -40 tClCl+40 ns
External Clock
tCHCX 5 High time 20 20 ns
tClCX 5 Low time 20 20 ns
tClCH 5 Rise time 20 20 ns
tCHCl 5 Fall time 20 20 ns
Shift Re ister
IXlXl 4 Serial port clock cycle time 1.0 12tClCl f1S
tOVXH 4 Output data setup to clock rising edge 700 10tClCl-133 ns
tXHOX 4 Output data hold after clock rising edge 50 2tClCl -117 ns
tXHDX 4 Input data hold after clock rising edge 0 0 ns
tXHDV 4 Clock rising edge to input data valid 700 1OtClCl -133 ns
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port O. ALE, and PSEN ~ 100pF. load capacitance for all other outputs ~ 80pF.
ALE
PSEN _ _ _J
PORTO _ _ _J
1o-----tAVIV----oI
ALE
10------- tllDV - - - - o j
ALE
- - - - - - - WlWHI-----I
INSTRUCTION o 2 3 4 5 8 7 8
ALE
tOVXH HI t XHOX
OUTPUT DATA
\,-_~ , " - _ - J ' - _ - - ' ' - - _....... ' - _ - - ' ' - - _ - J ' - _ - - ' '--_..J
f
WRITE TO SBUF
f
CLEAR RI t
SET RI
O.45V
t CHCL
~---------tCLCL--------~
Vcc-O.5
0.45V
=x O.2Vcc+O.9
_:..;O::;.;;.2V;,;c;;;;c;,..-.;:.O.;.:.1_ __
>C Timing
Reference
Points
<
AC inputs during testing are driven at Vcc-O.S
For timing purposes, a port is no longer floating
for a logic "1" and O.4SV for a logic "0".
when a 100mV change from load voltage occurs,
Timing measurements are made at VIH min for
and begins to float when a 100mV change from
a logic "1" and V IL max for a logic "0".
the loaded VOHIVOL level occurs.IOH/1oL ~± 20mA.
30
MAX
ACTIVE MODE
25
20
«
f
E 15
0
~
10
5 ~---+~~+----4----4MAX
IDLE MODE
TVP(1)
~~:±====:t::==1:==~IDLEMODE
4MHz BMHz 12MHz 16MHz
FREQ AT XTAL1
Vee Vee
. -_ _ _ _-il,ee
Vee
l
Vee
Vee
RST
RST
0.45V
1-----tcLcL------.I
Figure 11. Clock Signal Waveform for Icc Tests in Active and Idle Modes
tCLCH =
tCHCL =
5ns
Vee
,-____-ilee
Vee
l
Vee
RST
(NC) XTAL2
XTAL1
Vss
Product Specification
Microprocessor Division
EJ
ing all other chip functions to be inop-
erative.
LCC
17 29
18 28
TOP VIEW
Pin Function Pin Function
1 NC 23 NC
2 P1.0 24 P2.0/A8
3 P1.1 25 P2.1/A9
4 P1.2 26 P2.2/A10
5 P1.3 27 P2.3/A11
6 P1.4 28 P2.4/A12
7 P1.5 29 P2.5/A13
8 P1.6 30 P2.6/A14
9 P1.7 31 P2.7/A15
10 RST 32 PSE"N
11 RxD/P3.0 33 ALE/PROG
12 NC 34 NC
13 TxD/P3.1 35 bli/Vpp
14 1N'f5/P3.2 36 PO.7/AD7
15 j'lfi"1'/P3.3 37 PO.6/AD6
16 TO/P3.4 38 PO.S/ADS
17 T1/P3.S 39 PO.4/AD4
18 Wli/P3.6 40 PO.3/AD3
19 Fill/P3.7 41 PO.2/AD2
C1, C2 ~ JOpF ±1OpF for cryaI:a. 20 XTAL2 42 PO.1/AD1
C1, C2 = 40pF ±1OpF for ceramic 21 XTAL1 43 PO.O/ADO
I'lIIIOnatorw 22 Vss 44 Vee
February 1989
1-133
Signetics Microprocessor Products Product Specification
BLOCK DIAGRAM
PO.o-PO,7
-------l
Pl.cH'I.7
PIN DESCRIPTION
PIN NO.
MNEMONIC 1----.---1 TYPE NAME AND FUNCTION
DIP LCC
Vss 20 22 I Ground: OV reference.
Vee 40 44 I Power Supply: This is the power supply voltage for normal, idle, and power-down op-
eration.
PO.0-PO.7 39-32 43-36 1/0 Port 0: Port 0 is an open-drain, bidirectional 1/0 port. Port 0 pins that have ls written
to them float and can be used as high-impedance inputs. Port 0 is also the multiplexed
low-order address and data bus during accesses to external program and data mem-
ory. In this application, it uses strong internal pullups when emitting ls. Port 0 also
outputs the code bytes during program verification in the SC87C51. External pull-ups
are required during program verification.
Pl.0-Pl.7 1-8 2-9 1/0 Port 1: Port 1 is an 8-bit bidirectional 1/0 port with internal pUll-ups. Port 1 pins that
have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 1 pins that are externally pulled low will source current because
of the internal pull-ups. (See DC Electrical Characteristics: IILl. Port 1 also receives the
low-order address byte during program memory verification.
P2.0-P2.7 21-28 24-31 110 Port 2: Port 2 is an 8-bit bidirectional 110 port with internal pUll-ups. Port 2 pins that
have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 2 pins that are externally being pulled low will source current
because of the internal pullups. (See DC Electrical Characteristics: IILl. Port 2 emits the
high-order address byte during fetches from external program memory and during
accesses to external data memory that use 16-bit addresses (MOVX @DPTR). In this
application, it uses strong internal pull-ups when emitting ls. During accesses to
external data memory that use 8-bit addresses (MOVX @Ri), port 2 emits the contents
of the P2 special function register.
P3.0-P3.7 10-17 11, 110 Port 3: Port 3 is an 8-bit bidirectional 110 port with internal pullups. Port 3 pins that
13-19 have 1s written to them are pulled high by the internal pullups and can be used as
inputs. As inputs, port 3 pins that are externally being pulled low will source current
because of the pUll-ups. (See DC Electrical Characteristics: IILl. Port 3 also serves the
special features of the SC80C51 family, as listed below:
10 11 I RxD (P3.0): Serial input port
11 13 o TxD (P3.1): Serial output port
12 14 I INTO (P3.2): External interrupt
13 15 I INT1 (P3.3): External interrupt
14 16 I TO (P3.4): Timer 0 external input
15 17 I !!JP3.5): Timer 1 external input
16 18 o WR (P3.B): External data memory write strobe
17 19 o RD (P3.7): External data memory read strobe
RST 9 10 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets
the device. An internal diffused resistor to Vss permits a power-on reset using only an
external capacitor to Vee.
ALE/PROG 30 33 110 Address Latch Enable/Program Pulse: Output pulse for latching the low byte of the
address during an access to external memory. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency, and can be used for external timing or
clocking. Note that one ALE pulse is skipped during each access to external data
memory. This pin is also the progam pulse input (PROG) during EPROM programming.
PSEN 29 32 o Program Store Enable: The read strobe to external progU!!!!..J!1emory. When the
SC87C51 is executing code from external program memory, PSEN is activated twice
each machine cycle, exceRt that two PSEN activations are skipped during each access
to external data memory. PSEN is not activated during fetches from internal program
memory.
EAlVpp 31 35 I External Access Enable/Programming Supply Voltage: EA must be externally held low
to enable the device to fetch code from external program memory locations OOOOH
through OFFFH. If EA is held high, the device executes from internal program memory
unless the program counter contains an address greater than OFFFH. This pin also
receives the 12.75V programming supply voltage (Vpp) during EPROM programming.
XTAL1 19 21 I Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock gen-
erator circuits.
XTAL2 18 20 o Crystal 2: Output from the inverting oscillator amplifier.
OSCILLATOR CHARACTERISTICS in the normal operating mode before the DESIGN CONSIDERATIONS
XTAL1 and XTAL2 are the input and out- idle mode is activated. The CPU con- At power-on, the voltage on Vee and
put, respectively, of an inverting ampli- tents, the on-chip RAM, and all of the RST must come up at the same time for
fier. The pins can be configured for use special function registers remain intact a proper start-up.
as an on-chip oscillator, as shown in the during this mode. The idle mode can be
logic symbol, page 1. terminated either by any enabled inter- When the idle mode is terminated by a
rupt (at which time the process is picked hardware reset, the device normally
To drive the device from an external up at the interrupt service routine and resumes program execution, from where
clock source, XTAL1 should be driven continued), or by a hardware reset it left off, up to two machine cycles be-
while XTAL2 is left unconnected. There which starts the processor in the same fore the internal reset algorithm takes
are no requirements on the duty cycle of manner as a power-on reset. control. On-chip hardware inhibits ac-
the external clock signal, because the cess to internal RAM in this event, but
input to the internal clock circuitry is POWER-DOWN MODE access to the port pins is not inhibited.
through a divide-by-two flip-flop. How- In the power.<Jown mode, the oscillator To eliminate the possibility of an un-
ever, minimum and maximum high and is stopped and the instruction to invoke expected write when idle is terminated
low times specified in the data sheet power.<Jown is the last instruction exe- by reset, the instruction following the
must be observed. cuted. Only the contents of the on-chip one that invokes idle should not be one
RAM are preserved. A hardware reset is that writes to a port pin or to external
IDLE MODE the only way to terminate the power- memory.
In the idle mode, the CPU puts itself to down mode. The control bits for the re-
sleep while all of the on-chip peripherals duced power modes are in the special Table 1 shows the state of liD ports
stay active. The instruction to invoke the function register PCON. during low current operating modes.
idle mode is the last instruction executed
VOl1 Output low voltage, port 0, ALE, PSEN IOL - 3.2mA2 0.45 V
VOH Output high voltage, ports 1, 2, 3, ALE, PSEN3 IOH ~ -60j.lA 2.4 V
IOH - -25j.lA 0. 75Vcc V
IOH - -10j.lA 0. 9Vcc V
VOH1 Output high voltage (port 0 in external bus IOH - -800j.lA 2.4 V
mode) IOH - -300 j.lA 0.75Vcc V
IOH - -80j.lA O. 9Vcc V
4. Pins of ports 1, 2, and 3 source a transition current when they are being externally driven from 1 to 0.. The transition current reaches its
maximum value when VIN is approximately 2V.
5. ICCMAX at other frequencies is given by:
Active mode: ICCMAX - 0,94 X FREO + 13.71
Idle mode: ICC MAX - 0,14 X FREQ + 2,31
where FREQ is the external oscillator frequency in MHz. ICCMAX is given in mA. See Figure 8.
6. See Figures 9 through 12 for ICC test conditions.
7. These values apply only to TA -= OOC to +70 o C. For TA ""' -40°C to +85°C, see table on page 4.
AC ELECTRICAL CHARACTERISTICS TA - O°C to +70°C or -40°C to +85°C, VCC - 5V ±10%, Vss - OV1, 2
12MHz CLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER UNIT
Min Max Min Max
Program Memory
1/tClCl 1 Oscillator frequency: Speed Versions
SC87C51 B 0,5 12 MHz
SC87C51 C 3,5 12 MHz
SC87C51 G 3,5 16 MHz
tlHll 1 ALE pulse width 127 2tClCl -40 ns
tAVL 1 Address valid to ALE low 28 tClCl-55 ns
tllAX 1 Address hold after ALE low 48 tClCl-35 ns
tLLJV 1 ALE low to valid instruction in 234 4tclcl -100 ns
tllPl 1 ALE low to PSEN low 43 tClCl -40 ns
tpLPH 1 PSEN pulse width 205 3tClCl -45 ns
tpLiV 1 PSEN low to valid instruction in 145 3tClCl-105 ns
tPXIX 1 Input instruction hold after PSEN 0 0 ns
tpXIZ 1 Input instruction float after PSEN 59 tClCl-25 ns
tAYIV 1 Address to valid instruction in 312 5tClCL -105 ns
tplAZ 1 PSEN low to address float 10 10 ns
Data Memory_
tRlRH 2, 3 RD pulse width 400 6tCccL -100 ns
tWlWH 2, 3 WR pulse width 400 6tClCl-100 ns
tRlDV 2, 3 RD low to valid data in 252 5tco[-165 ns
tRHDX 2, 3 Data hold after RD 0 0 ns
tRH[)7 2, 3 Data float after RD 97 2tClCl -70 ns
'llDV 2, 3 ALE low to valid data in 517 8tClCl -150 ns
tAVD\i 2, 3 Address to valid data in 585 9tcLCL -165 ns
tllWl 2, 3 ALE low to RD or WR low 200 300 3tClCl-50 3tClCl+50 ns
tAVWL 2, 3 Address valid to WR low or RD low 203 4tol 01 -130 ns
tOVWX 2, 3 Data valid to WR transition 23 tClCl -60 ns
tWHOX 2, 3 Data hold after WR 33 t0101-50 ns
tRlAZ 2, 3 RD low to address float 0 0 ns
tWHLH 2, 3 RD or WR high to ALE high 43 123 tCLCL-40 tCLCL+40 ns
External Clock
tCHCX 5 High time 20 20 ns
tClCX 5 Low time 20 20 ns
tClCH 5 Rise time 20 20 ns
tCHCl 5 Fall time 20 20 ns
Shift Re ister
tXlXl 4 Serial port clock cycle time 1.0 12tClCl J.lS
tOVXH 4 Output data setup to clock rising edge 700 1OtClCl -133 ns
tXHOX 4 Output data hold after clock rising edge 50 2tClCl -117 ns
tXHDX 4 Input data hold after clock rising edge 0 0 ns
tXHDV 4 Clock rising edge to input data valid 700 1OtClCl -133 ns
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port 0, ALE, and PSEN - 100pF, load capacitance for all other outputs - 80pF.
ALE
PORTO
----'
PORT 2
-----'
Figure 1. External Program Memory Read Cycle
ALE
Je----- tLLDV - - - - I
t LLWL --1---- tRLRH ------I
tRLDV
tRHDX
PORTO
ALE "- /
"
I-- tWHLH
r-. /
t AVLL I-----<
i-tLLAX-o I- tOVWX
...... t WHOX
PORT 0
~ • Hl()MAg;~~
t
np, ~ DATA OUT K AO-A? FROM PCL INSTR IN
AVWL
INSTRUCTION o 2 3 4 5 6 7 8
ALE
tOVXH HI t XHOX
OUTPUT DATA
' ' -_ _-' '-_ _-' '-_ _-' '-_ _-' '-_ _-' '-_ _oJ '-_ _oJ 1..._--'
T
WRITE TO SBUF
f
CLEAR RI
SET RI
0.45V
~----------tCLCL--------~
VCC-O.5=>C O.2Vcc+O.9
0.45V _-.::;O.;,:;2..:.V,:;.cc:;.-..,;O:,;..;.1_ __
C Timing
Reference
Points
<
AC inputs during testing are driven at Vcc-0.5
For timing purposes, a port is no longer floating
for a logic "1" and 0.45V for a logic "0".
when a 100mV change from load voltage occurs,
Timing measurements are made at VIH min for
and begins to float when a 100mV change from
a logic" 1" and V IL max for a logic "0".
the loaded VOHIVOL level occurs.IOH /1 0L2± 20mA.
EPROM CHARACTERISTICS applied to port O. RST, PSEN and pins shown in Figure 15. The other pins are
The SC87C51 is programmed by using a of ports 2 and 3 specified in Table 2 are held at the "Verify Code Data" levels in-
modified Quick-Pulse Programming" al- held at the "Program Code Data" levels dicated in Table 2. The contents of the
gorithm. It differs from older methods in indicated in Table 2. The ALE/PROG is address location will be emitted on port
the value used for Vpp (programming pulsed low 25 times as shown in Figure O. External pull-ups are required on port
supply voltage) and in the width and 14. a for this operation.
number of the ALE/PROG pulses.
To program the encryption table, repeat If the encryption table has been pro-
The SC87C51 contains two signature the 25 pulse programming sequence for grammed, the data presented at port a
bytes that can be read and used by an addresses a through 1 FH, using the will be the exclusive NOR of the gram
EPROM programming system to identify "Pgm Encryption Table" levels. Do not byte with one of the encryption bytes.
the device. The signature bytes identify forget that after the encryption table is The user will have to know the encryp-
the device as an SC87C51 manufactured programmed, verification cycles will pro- tion table contents in order to correctly
by Signetics Corporation. duce only encrypted data. decode the verification data. The en-
cryption table itself cannot be read out.
Table 2 shows the logic levels for To program the lock bits, repeat the 25
reading the signature byte, and for pro- pulse programming sequence using the Reading the Signature Bytes
gramming the program memory, the en- "Pgm Lock Bit" levels. After one lock bit The signature bytes are read by the
cryption table, and the lock bits. The is programmed, further programming of same procedure as a normal verification
circuit configuration and waveforms for the code memory and encryption table is of locations 030H and 031 H, except that
quick-pulse programming are shown in disabled. However, the other lock bit P3.6 and P3.7 need to be pulled to a
Figures 13 and 14. Figure 15 shows the can still be programmed. logic low. The values are:
circuit configuration for normal program
memory verification. Note that the EA/vpp pin must not be al- (030H) - 15H indicates manufactured by
lowed to go above the maximum speci- Signetics
QUICK-PULSE PROGRAMMING fied Vpp level for any amount of time. (031 H) - 92H indicates SC87C51
The setup for microcontroller quick-pulse Even a narrow glitch above that voltage
programming is shown in Figure 13. Note can cause permanent damage to the de- ProgramNerify Algorithms
that the SC87C51 is running with a 4 to vice. The Vpp source should be well reg- Any algorithm in agreement with the
6MHz oscillator. The reason the oscilla- ulated and free of glitches and over- conditions listed in Table 2, and which
tor needs to be running is that the de- shoot. satisfies the timing specifications, is suit-
vice is executing internal address and able.
program data transfers. Program Verification
If lock bit 2 has not been programmed,
The address of the EPROM location to the on-chip program memory can be
be programmed is applied to ports 1 and read out for program verification. The
2, as shown in Figure 13. The code byte address of the program memory locations
to be programmed into that location is to be read is applied to ports 1 and 2 as '"Trademark phrase of Intel Corp.
30
MAX
ACTIVE MODE
25
20
t
..: TYP(1)
E 15
ACTIVE MODE
0
2
10
5 f--++-I--+--I MAX
IDLE MODE
TYP(1)
~~==b::::J:::::1====~IDLEMODE
4MHz 8MHz 12MHz 16MHz
FREQ AT XTAL1
Vee Vee
r-____-;Iee
Vee
~
Vee
Vee
RST
RST
O.45V
t CHCl
tClCX t ClCH
~-----tClCl--------~
Figure 11. Clock Signal Waveform for Icc Tests in Active and Idle Modes
tCLCH =tCHCL 5ns=
Vee
r-____-;Iee
Vee
!
Vee
RST
(NC) XTAl2
XTAl1
Vss
+5V
P2.61O----
1110.---------25 PULSES.----------o!
i-----
ALE/PROG: ~------------
, I
I
----.:....,
1"-. 10).lSMIN --I1---100).lS±10~
ALE/PROG: OL-I________~n n~ ___
+5V
10K
Vee xS
AO-A7 _ _-,/1 P1 PO 1-_"':"''; PGM DATA
_ _ _-ojRST EA/Vpp i t - - - -
----tlP3.6 ALE/PROG i t - - - -
SC87C51
- - - - t l P3 .7 PSENIo----
P2.6it----
Vss
EPROM PROGRAMMING AND VERIFICATION CHARACTERISTICS TA - 21°C to +27°C, VCC - 5V±1 0%, VSS - OV (see Figure 16)
PROGRAMMING" VERIFICATIOW
Pl.0-Pl.7 ADDRESS ADDRESS
\.
P2.0-P2.3 /
-4 I-- I AVOV
I AVGL I GHAX
I-- , 25 PULSES "
ALE/PROG
IGLGH-t
I SHGL
Q:-:' 10- I GHGL
f----t I GHSL
V
EAlVpp ~
- - -- - - - - - - - - - - -
I EHSH
""
LOGIC 0
LOGIC 1 LOGIC 1
- - - - - - - - -
I EHOZ
P2.7
IELOr I-
EANBLE -./ I
Microprocessor Products
INDEX
8032/8052 Overview. . • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-1
Differences from the 8051 .................................. 2-1
Program Memory ........................................ 2-1
Special Function Registers '" . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-1
Timer/Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-1
Serial Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-2
Special Function Registers Table ............................ 2-5
Timer/Counter 2 Set-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-8
Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-8
Port Structures .......................................... 2-9
SCN8032AH/SCN8052AH Data Sheet ........................ 2-11
8XC451 Overview ........................................ 2-1 8
Differences from the 8051 ................................. 2-18
Special Function Registers . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . .. 2-18
I/O Port Structure ....................................... 2-18
Processor Bus Interface .................................. 2-19
Standard Quasi-BidirectionalliO Port ....................... 2-19
Parallel Printer Port. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-19
Special Function Registers Table ........................... 2-20
SC80C451/SC83C451 Data Sheet ............................ 2-21
SC87C451 Data Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-35
8XC552 Overview ........................................ 2-53
Differences from the 8051 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-53
Program Memory ....................................... 2-53
Data Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-53
Special Function Registers ........ . . . . . . . . . . . . . . . . . . . . . . .. 2-53
Timer T2 .............................................. 2-53
Special Function Registers Table ........................... 2-55
Timer T3. the Watchdog Timer ... . . . . . . . . . . . . . . . . . . . . . . . . .. 2-59
Serial I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .............. 2-61
Reset Circuitry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-95
Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-96
1/0 Port Structure ....................................... 2-98
Port 1 Operation ........................................ 2-99
Port 5 Operation ....................................... 2-100
Pulse Width Modulated Outputs .. " ....................... 2-100
Analog-to-Digital Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-101
Power Reduction Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-105
Memory Organization ................................... 2-106
S83C552/S80C552 Data Sheet ............................. 2-112
8XC652 Overview ....................................... 2-123
Differences from the 80C51 .............................. 2-123
Special Function Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-123
Special Function Registers Table ...... " .................. 2-124
12C Serial Communications - SI01 ......................... 2-124
Idle and Power-Down Operation .......................... 2-124
Interrupt System ....................................... 2-125
Microcontroller Users' Guide
INDEX (Continued)
FFFF , . . . . - - - - - - - - - - FFFF , . . - - - - - - - - - - .
11K
BYTES
EXTERNAL
14K
--OR-_.... BYTES
EXTERNAL
.. ~-------~
AND
:::1~_______~__ 8YTE8_NA
__L______ ~ GOOD ~_ _ _ _ _ _ _.....J
INTERNAL
FFFF r-----------,
INDIRECT
f
ADDRESSING ONLY
8OHTOFFH
FF/
FFr-~--------~
14K
SFRa BYTES
DIRECT
ADDRESSING
ONLY
-- EXTERNAL
--AND~
80
7F~------------------~
DIRECT ..
INDIRECT
ADDRESSING
oo~------------~ oooo~---------------~
flowing sets bit TF2, the Timer 2 overflow bit, which can Figure 3). Note that the baud rate for transmit and re-
be used to generate an interrupt. If EXEN2 = 1, then ceive can be simultaneously different. Setting RCLK
Timer 2 still does the above, but with the added feature and/or TCLK puts Timer 2 into its baud rate generator
that a 1-to-O transition at external input TIEX causes mode, as shown in Figure 6.
the current value iu the Timer 2 registers, 1L2 and TH2
to be captured into registers RCAP2L and RCAP2H, re- The baud rate generator mode is similar to the auto-
spectively. (RCAP2L and RCAP2H are new Special reload mode, in that a rollover in TH2 causes the Timer
Function Registers in the 8052.) In addition, the transi- 2 registers to be reloaded with the 16-bit value in regis-
tion at TIEX causes bit EXF2 in TICON to be set, and ters RCAP2H and RCAP2L, which are preset by soft-
EXF2 like TF2, can generate an interrupt. The Capture ware.
Mode is illustrated in Figure 4.
Now, the baud rates in Modes 1 and 3 are determined by
In the auto-reload mode there are again two options, Timer 2's overflow rate as follows:
which are selected by bit EXEN2 in TICON. If EXEN2
= 0, then when Timer 2 rolls over it not only sets TF2 Timer 2 Overflow Rate
but also causes the Timer 2 registers to be reloaded with Modes 1, 3 Baud Rate = ---------
the 16-bit value in registers RCAP2L and RCAP2H, 16
which are preset by software. If EXEN2 = 1, then Timer The Timer can be configured for either "timer" or
2 still does the above, but with the added feature that a "counter" operation. In the most typical applications, it
1-to-0 transition at external input TIEX will also trigger is configured for "timer" operation (C/TI = 0). "Timer"
the 16-bit reload and set EXF2. The auto-reload mode operation is a little different for Timer 2 when it's being
is illustrated in Figure 5. used as a baud rate generator. Normally, as a timer it
would increment every machine cycle (thus at 1112 the
The baud rate generation mode is selected by RCLK = 1 oscillator frequency). As a baud rate generator, however,
and/or TCLK = 1. It will be described in conjunction it increments every state time (thus at 112 the oscillator
with the serial port. frequency). In that case the baud rate is given by the
formula
SERIAL PORT
The serial port of the 8052/8032 is identical to that of Modes 1,3 Oscillator Frequency
the 8051 except that counter/timer 2 can be used to Baud Rate = -------------
generate baud rates. 32x [65536 - (RCAP2H, RCA2L)]
In the 8052, Timer 2 is selected as the baud rate gen- where (RCAP2H, RCAP2L) is the content of RCAP2H
erator by setting TCLK and/or RCLK in TICON (see and RCAP2L taken as a 16-bit unsigned integer.
(MSB) (LSB)
TF2 EXF2 RCLK TCLK EXEN2 TR2 c/f2 cMu:2 !-
Symbol Poalllon Name and SlgnllfC8nce
TF2 T2CON.7 TImer 2 overflow flag set by a TImer 2 overflow and must be cleared by software.
TF2 will not be set when efther RCLK = 1 or TCLK = 1.
EXF2 T2CON.6 TImer 2 external flag set when either a capture or reload is caused by a negative
transition on T2EX and EXEN2 = 1. When TImer 2 interrupt is enabled. EXF2 = 1
will cause the CPU to vector to the TImer 2 Interrupt routine. EXF2 must be
cleared by software.
RCLK T2CON.5 Receive clock flag. When set, causes the serial port to use Timer 2 overflow
pulses for Its receive clock in Modes 1 and 3. RCLK = 0 causes Timer 1 overflow
to be used for the receive clock.
TCLK T2CON.4 Transm" clock flag. When set, causes the serial port to use Timer 2 overflow
pulses for its transmit clock in modes 1 and 3. TCLK = 0 causes Timer 1
overflows to be used for the transmit clock.
EXEN2 T2CON.3 Timer 2 external enable flag. When set, allows a capture or reload to occur as a
result of a negative transition on T2EX if TImer 2 Is not being used to clock the
serial port. EXEN2 = 0 causes Timer 2 to ignore events at T2EX.
TR2 T2CON.2 Startlstop control for TImer 2. A logic 1 starts the timer.
c/f2 T2CON.l Timer or counter select. (Timer 2)
o = Internal timer (OSC/12)
1 = External event counter (faUing edge triggered).
CP/m T2CON.O Capture/Reload flag. When set, captures will occur on negative transitions at
T2EX if EXEN2 = 1. When cleared, auto-reloads will occur either with Timer 2
overflows or negative transitions at T2EX when EXEN2 = 1. When either RCLK
= 1 or TCLK = I, this bit is Ignored and the timer is forced to auto-reload on
Timer 2 overflow.
nMER2
INTERRUPT
EXEN2
TIMER 2
INTERRUPT
EXEN2
nMER1
OVEIIFUlW
RX CLOCK
TX CLOCK
.x....
L NOTa AYAUlUUTY OF ADDI110NAL IX11!RNAL INTEARUPT
Figure 6. Timer 2 in Baud Rate Generator MOde
87 86 85 84 83 82 81 80
PO' Port 0 80H AD7 I AD6 I AD5 LAD4 J AD3 J AD2 1 AD1 LADO FFH
97 96 95 94 93 92 91 90
Pl' Port 1 90H -
I -
I -
I -
I -
I - IT2EXI T2 FFH
A7 A6 A5 A4 A3 A2 Al AO
P2' Port 2 AOH A15 I A14 I A13 I A12 I All I AlO I A9 I A8 FFH
B7 B6 B5 B4 B3 B2 B1 BO
P3' Port 3 BOH FFH
RD IWR ITO I Tl I INTil INTO I TxD I RxD
PC ON Power control 87H SMODI - I - I - I GF1 I GFO I PD I IDL OxxxxxxxB
D7 D6 D5 D4 D3 D2 D1 DO
PSW* Program status word DOH CY I AC I FO I RS1 I RSO I OV I - I P OOH
RCAP2H# Capture high CBH OOH
RCAP2L# Capture low CAR OOH
SBUF Serial data buffer 99H xxxxxxxxB
9F 9E 9D 9C 9B 9A 99 98
SCON' Serial controller 98H SMO I SM1 I SM2 I REN I TB8 I RB8 I TI I RI OOH
SP Stack pointer 81H 07H
8F 8E 8D 8C 8B 8A 89 88
TCON* Timer control 88H TF1 I TR1 I TFO I TRO I lEI I ITl I lEO I ITO OOH
CF CE CD CC CB CA C9 C8
T2CON*# Timer 2 control C8H TF2 I EXF21RCLK ITCLK I E)CEN2 1 TR2 I C/T21 CP/RL2 OOH
THO Timer high 0 8CH OOH
TH1 Timer high 1 8DH OOH
TH2# Timer high 2 CDH OOH
TLO Timer low 0 8AH OOH
TLl Timer low 1 8BH OOH
TL2# Timer low 2 CCH OOH
TMOD Timer mode 89H GATE I CIT I M1 I MO IGATE I CIT I M1 I MO OOH
* ~ BIt addressable
# ~ SFRs are modified from or added to the 80C51 Timer 2 as a baud rate generator is shown in Figure 6.
SFRs. This Figure is valid only if RCLK + TCLK ~ 1 in
TICON. Note that a rollover in TH2 does not set TF2,
Table 2. Timer 2 Operating Modes and will not generate an interrupt. Therefore, the Timer
2 interrupt does not have to be disabled when Timer 2 is
RCLK + TCLK CP/RL2 TR2 Mode in the baud rate generator mode. Note too, that if
0 0 1 16-bit Auto-reload EXEN2 is set, a 1-to-0 transition in TIEX will set EXF2
0 1 1 16-bit Capture but will not cause a reload from (RCAP2H, RCAP2L) to
1 X 1 Baud rate generator (TH2, TL2). Thus when Timer 2 is in use as a baud rate
X X 0 (off) generator, TIEX can be used as an extra external inter-
rupt, if desired.
TIMER2
OVERFLOW
WRITE
SBUF
TO --~r--=~~~~~~--~~~--~----r-~ ~r-~ __ Txe
Rxe
TRANSMIT
I
716 RESET
RECEIVE
R;~ux: !l!TAAT IITI
TIMER 1 TIMER 2
OVERFLOW OVERFLOW
__
WRITE
TO
SBUF ~-,~-::::£~~;r~--~=-----~---r~L- ~~ TXO
TCLK-
TI
TX
FLOCK! R
• WRITE TO SBUF L--JIL--__-"-__- - '____A-__...Jl.__.-.JL-__-'-___
- - - - , ftiiI!j I
DATA C S1P1 I I
SHIFT R D L-L-J L-n TRANSMIT
fij)\STA.T .tTi 00' Ll!i::X::Q.L1 D3 ~~ru;;;;::;,:::S:T:::O:::P:::B;IT;==
TI I
Except for the baud rate generator mode, the values giv-
en for 1'2CON do not include the setting of the TR2 bit.
Therefore, bit TR2 must be set, separately, to turn the
Timer on. See table 3 for set-up of timer 2 as a timer.
See table 4 for set-up of timer 2 as a counter.
USING TIMER/COUNTER 2
TO GENERATE BAUD RATES
For this purpose, Timer 2 must be used in the baud rate Figure 9. 805218032 Interrupt Sources
generating mode. If Timer 2 is being clocked through
pin 1'2 (P1.0) the baud rate is: The Interrupt Enable Register and the Interrupt Priority
Register are modified to include the additional 8052 in-
Timer 2 Overflow Rate terrupt sources. The operation of these registers is iden-
Baud Rate = --------- tical to the 8051. The registers are detailed in Figures
16 10, 11 and 12.
And if it is being clocked internally the baud rate is: In the 8052, the Timer 2 Interrupt is generated by the
logical OR of TF2 and EXF2. Neither of these flags is
Osc Freq cleared by hardware when the service routine is vectored
Baud Rate = to. In fact, the service routine may have to determine
32 x [65536 - (RCAP2H, RCAP2L)] whether it was TF2 or EXF2 that generated the inter-
rupt, and the bit will have to be cleared in software.
To obtain the reload value for RCAP2H and RCAP2L All of the bits that generate interrupts can be set or
the above equation can be rewritten as: cleared by software, with the same result as though it
had been set or cleared by hardware. That is, interrupts
Osc Freq can be generated or pending interrupts can be canceled
RCAP2H, RCAP2L = 65536 - - - - - - in software.
32 x Baud Rate
The interrupt vector addresses and the interrupt priority
INTERRUPTS for requests in the same priority level are given in the
The 8052 has 6 interrupt sources as shown in Figure 9. following:
All except TF2 and EXF2 are identical sources to those
in the 8051.
Section 2 8032/8052
HIGH PRIORITY
IP REGISTER INTERRUPT
~~--~~4---~
I
I
I
~c>f~~---I....j
TFO,-------~~~
INTERRUPT
POLLING
I SEQUENCE
I
I
~
II >J~H---++I
I
I
TFl-------+t--o' ~I ~-ro-~-4+I
I
I
I
>----...--<Y ~e>j---r-~....J---I-~
RI
TI
TF2
EXF2
PORT STRUCTURES
Figure 11. 8052 Interrupt Enable (IE) Register Figure 12. 8052 Interrupt Priority (IP) Register
Product Specification
Microprocessor Division
8'"
Because of its extensive BCD/binary
~
rr-
arithmetic and bit-handling facilities, the
~
SCNB032AH/SCNB052AH microcontrol- PLCC
ler is efficient at both computational and -~
~= ~
control-oriented tasks. Efficient use of 17 29
program memory is also achieved by us-
ing the familiar compact instruction set ~-l:! 18 28
t~.
the instructions are one-byte, 41 % two- Pin
byte, and 15% three-byte instructions. 1 NC 23 NC
2 T2/P1.0 24 P2.0/AS
With a 12MHz crystal, the majority of EA 3 T2EX/P1.1 25 P2.1/A9
the instructions execute in just 1.0j.lS. PSEN 4 P1.2 26 P2.2/A10
The longest instructions, multiply and di- ALE 5 P1.3 27 P2.3/A11
~t~-
-T2 6 P1.4 28 P2.4/A12
vide, require only 4j.1S at 12MHz. P1.5 P2.5/A13
7 29
]~li
~ '~-~ 8 P1.6 30 P2.6/A14
::>mrn- .., 9 P1.7 31 P2.7/A15
u..1RI'l-t;;: 10 RST 32 !5Srn
~ TO-~ 11 RxD/P3.0 33 ALE
<~- 12 NC 34 NC
!! - 13 TxD/P3.1 35 ~
8R!l-
....
en
14
15
iFlTO/P3.2
mTT/P3.3
36
37
PO.7/AD7
PO.6/AD6
16 TO/P3.4 38 PO.5/AD5
17 T1/P3.5 39 PO.4/AD4
18 WI1/P3.6 40 PO.3/AD3
19 R[)/P3.7 41 PO.2/AD2
20 XTAL2 42 PO.1/AD1
21 XTAL1 43 PO.O/ADO
22 Vss 44 Vee
ROM~R:a==5ce:)HCCCICC ::L::
Temperature and Frequency
ROM less ROM Package
ROM Pattern No,
32 - Extl256 Applies to masked ROM versions
SCN8032HCCN40 SCN8052HCCN40 o to +70·C, plastiC DIP 3.5 to 12MHz
52 - 8K/256 only. Number will be assigned by SCNS032HCCA44 SCN8052HCCA44 o to + 70·C, plastic LCC 3.5 to 12MHz
Signetics. Contact Signetics sales
Power office for ROM pattern submission SCNS032HACN40 SCN8052HACN40 -40 to +85·C, plastic DIP 3.5 to 12MHz
Consumption requirements.
SCNS032HACA44 SCNS052HACA44 -40 to +S5·C, plastiC LCC 3.5 to 12MHz
H -P~:~~c:~ Pins
40 - 40-pin SCN8032HCFN40 SCNS052HCFN40 o to +70·C, plastic DIP 3.5 to 15MHz
44 - 44-pin SCNS032HCFA44 SCN8052HCFA44 o to + 70·C, plastic PLCC 3.5 to 15MHz
Package
A - Plastic LCC SCNS032HAFN40 SCNS052HAFN40 -40 to +85·C, plastic DIP 3.5 to 15MHz
I - Ceramic DIP
N - Plastic DIP SCN8032HAFA44 SCN8052HAFA44 -40 to +85·C, plastic PLCC 3.5 to 15MHz
Speed
C - 3.5 to 12MHz
F - 3.5 to 15MHz
Operating Temperature Range
A - -40·C to +85·C
C - O·C to +70·C
BLOCK DIAGRAM
--------l
iiSEN ~_.r--"""-::;"I
ALE
EA
RST
PUH".7
VIH1 Input high voltage to RST for reset, XTAL2 XTAL1 to Vss 2.5 Vee+0.5 V
VOLl Output low voltage, port 0, ALE, PSEN6 IOL - 3.2mA 0.45 V
ALE
~ _ _ _J
PORTO _ _ _ _~
1o---tAVIV-----.I
ALE "- /
J.-- WHLH
PsE"N
tLLDV
RD "- /
t AVLL
I---t foo- tLLAX-o
II--
io--tRLDv--o
tRLAZ
tRHDX ..... IF tRHDZ
PORTO ~ . _''')"
AO-A?
'" n" np, 1'1
tAVWL
DATA IN
»>K AO-A? FROM PCL INSTR IN
t AvDV
ALE "- /
0-----0 tWHLH
ffiN
WR
tAVLL
i----<
I--tLLAX ""
"'
I-- tOVWX
/
Io--t t WHOX
tOVWH
PORTO~ . Fom ~g~~~ no, I> DATA OUT ~ AO-A? FROM PCL INSTR IN
tAVWL -
INSTRUCTION o 2 3 4 5 8 7 8
ALE
tOVXH HI t XHOX
OUTPUT DATA
f
WRITE TO SBUF
,'----,J '---".J '-_---J ' - - - - ' '-_---J ' - - _ - ' '-_---J ~_.J
Vee-O.5·-------- O.7Vce
0.45V
~---------tcLCL-----~
Vee-O.5
O.45V
=x O.2Vcc+O.9 >C
_..O_.2_V;.;;e.;;.e-...:O;,;.;.1~_ _
Timing
Reference
Points
<
AC inputs during testing are driven at Vcc-O.S
for a logic H1 Hand O.4SV for a logic HOH. For timing purposes, a port Is no longer floating
when a 100mV change from load voltage occurs,
Timing measurements are made at VIH min for
and begins to float when a 100mV change from
a logic H1 H and V IL max for a logic ·0·.
the 10adedVOHlVOL level occurs.IOH/IOL~±20mA.
6 Control Status Register (CSR). Port 6 and 111e CSR STANDARD QUASI-BIDIRECTIONAL 110 PORT
are addressed at 111e Special Function Addresses shown
in Table 6. Port 6 can be used as a standard I/O port, To use port 6 as a common I/O port, all of 111e control
or in strobed modes of operation in conjunction wi111 111e pins should be tied to ground. On hardware reset, bits
four port 6 control lines listed below: 2-7 of 111e CSR are set to one. Wi111 111e control pins
grounded, 111e Port's operation and electrical characteris-
tics will be identical to port 1 on 111e 80C51. No fur111er
ODS Output data strobe (active low) software initialization is required.
IDS Input data strobe (active low)
BF1.AG Bidirectional I/O pin. Can be programmed PARALLEL PRINTER PORT
to output 111e Input Buffer Full flag (IBF),
input an active low Port Enable (PE) sig- The 83C451 has 111e capacity to permit all of 111e intelli-
nal, or output a high or low logic level. gent features of a common printer to be handled by a
AF1.AG Bidirectional I/O pin. Can be programmed single chip. The features of Port 6 allow a parallel port
to output 111e Output Buffer Full (OBF) to be designed wi111 only line driving and receiving chips
flag, input a register select signal (SEL), required as additional hardware. The onboard UART al-
or output a high or low logic level. lows RS232 interfacing wi111 only level shifting chips add-
ed. The 8-bit parallel ports 0 to 6 are ample to drive
Port 6 can be used in a number of different ways to fa- onboard control functions, even when ports are used for
cilitate data communication. It can be used as a proces- external memory access, interrupts, and o111er functions.
sor bus interface, as a standard quasi -bidirectional I/O The RAM addressing ability of ports 0 to 2 can be used
port, or as a parallel printer port (ei111er polled or in- to address up to 64K bytes of a hardware buffer/spooler.
terrupt driven).
In addition, ei111er end of a parallel interface can be im-
PROCESSOR BUS INTERFACE plemented using port 6, and 111e interfaces can be inter-
rupt driven or polled in ei111er case. For more detailed
Port 6 allows 111e use of an 83C451 as an element on a information on port 6 usage, refer to 111e application
microprocessor type bus. The host processor could be a notes contained in Section 3, entitled "80C451 Operation
general purpose MPU or 111e data bus of a microcon- of Port 6" and "256K Centronics Printer Buffer Using
troller like 111e 83C451 itself. Setting up 111e 83C451 as a 111e SC87C451 Microcontroller".
processor bus interface allows single or multiple
microcontrollers to be used on a bus as flexible periph-
eral processing elements. Applications can include:
keyboard scanners, serial I/O controllers, servo control-
lers, etc.
AF AE AD AC AB AA A9 A8
IE* Interrupt enable A8H EA I - I - I ES I ETl I EX1 I ETO I EXO OxxOOOOOB
PO· Port 0 80H 87 B6 85 84 83 82 81 80 FFH
P1* Port 1 90H 97 96 95 94 93 92 91 90 FFH
P2* Port 2 AOH A7 A6 AS A4 A3 A2 A1 AO FFH
P3* Port 3 BOH B7 B6 B5 B4 B3 B2 B1 BO FFH
P4*# Port 4 COH C7 C6 C5 C4 C3 C2 C1 CO FFH
P5*# Port 5 C8H CF CE CD CC CB CA C9 C8 FFH
P6*# Port 6 D8H DF DE DD DC DB DA D9 D8 FFH
D7 D6 D5 D4 D3 D2 D1 DO
PSW* Program status word DOH CY I AC I FO I RS1 I RSO I OV I - I P OOH
SBUF Serial data buffer 99H xxxxxxxxB
9F 9E 9D 9C 9B 9A 99 98
SCON* Serial port control 98H SMO I SM1 I SM2 I REN I TB8 I RB8 I TI I RI OOH
SP Stack pointer 81H 07H
8F 8E 8D 8C 8B 8A 89 88
TCON* Timer/counter control 88H TF1 I TRI I TFO I TRO I lEI I ITl I lEO I ITO OOH
Product Specification
Microprocessor Division
TOP VIEW
INDEX
'"""~M
26CJ44
27 43
TOP VIEW
o-
1
ROM::.:r:: CCCC C
ROMless
3 - ROM
::c
1 ROM Pattern No.
Applies to masked ROM versions
only. Number will be assigned by
Sig netics. Contact Sig netics sales
ROMlesa
SC80C451CCN64
SC80C451CGN64
SC80C451CBN64
PART NUMBER SELECTION
ROM
SC83C451CCN64
SC83C451CGN64
SC83C451CBN64
Temp8rature and Package
o to +7000 plastic DIP
o to +7000 plastic DIP
o to +7000 plastic DIP
office for ROM pattern submission
requirements.
SC80C451 CCA68 SC83C451 CCA68 o to +70°C plastic LGC
Pins
SC80C451 CGA68 SC83C451 CGA68 o to +70°C plastic LCC
64 - 64-pin DIP SC80C451 CBA68 SC83C451CBA68 o to +7000 plastic LCC
68 - 68-pln PLCC
SC80C451 ACN64 SC83C451ACN64 -40 to +85°C plastic DIP
Package
A - Plastic PLCC SC80C451AGN64 SC83C451AGN64 -40 to +8500 plastic DIP
N - Plastic DIP SC80C451 ACA68 SC83C451 ACA68 -40 to +85°C plastic LCC
Speed SC80C451 AGA68 SC83C451 AGA68 -40 to +8500 plastic LCC
B - 0.5 to 12MHz
C - 3.5 to 12MHz
G - 3.5 to 16MHz
Operating Temperature Range
A - _40°C to +85 0 C
C - OOC to +70 0 C
INDEX
~tj 10
LCC
60
26 44
27 43
TOP VIEW
Pin Function Pin Function Pin Function
1 EA 24 P4.2 47 P5.3
2 P2.0/A8 25 P4.1 48 P5.4
3 P2.1/A9 26 P4.0 49 P5.5
4 P2.2/Al0 27 Pl.0 50 P5.6
5 P2.3/All 28 Pl.l 51 P5.7
6 P2.4/A12 29 Pl.2 52 XTAL2
7 P2.5/A13 30 Pl.3 53 XTALI
8 P2.6/A14 31 Pl.4 54
9
10
11
12
P2.7/A15
PO.7/AD7
PO.6/AD6
PO.5/AD5
32
33
34
35
Pl.5
Pl.6
Pl.7
55
56
57
I
BFLAG
RST 58 AFLAG
13 PO.4/AD4 36 P3.0/RxD 59 P6.0
14 PO.3/AD3 37 P3.1/TxD 60 P6.1
15 PO.2/AD2 38 P3.2/iFffii 61 P6.2
16 PO.l/ADl 39 P3.3/iNi'i 62 P6.3
17 PO.O/ADO 40 P3.4/TO 63 P6.4
18 Vcc 41 P3.5/Tl 64 P6.5
19 P4.7 42 P3.6/iNIi 65 P6.6
20 P4.6 43 P3.7/im 66 P6.7
21 P4.5 44 P5.0 67 PSEN
22 P4.4 45 P5.1 68 ALE
23 P4.3 46 P5.2
11
co
i: "0
i------Ttf[-F-'ieTiF------.~--:
c:
"0
00
.
!l
I
III
;::+
~
o·
a
(")
o
::J
~ II 11:-".:,.. ':
SBUF IE IP
I~=~I I I~
~:i:::1
RST~
n= li~~II!f
CONIROL 1t
U 11 if
~
~
1T
IT if
I~....-----.
~ DPTR ~ en
I o00
I o
oJ::o.
_____ J
l
-
....
01
en !l8.c:
o00
w
"0
w
""5l
o
oJ::o. =
0"
~
....
01 0"
:::l
Signetics Microprocessor Products Product Specification
PORTS 4 AND 5 ODS - Output data strobe input for port control, or to output the state of the
Ports 4 and 5 are bidirectional 1/0 ports 6. ODS can be programmed to control output buffer full flag. AFLAG can also
with internal pullups. Port 4 is an 8-bit the port 6 output drivers and the output be programmed to be an input which se-
port (LCC version) or a 4-bit port (01 P buffer full flag (OBF), or to clear only lects whether the contents of the output
version). Port 4 and port 5 pins with the OBF flag bit in the CSR (output- buffer, or the contents of the port 6 con-
ones written to them, are pulled high by always mode). ODS is active low for trol status register will be output on port
the internal pullups, and in that state can output driver control. The OBF flag can 6. This feature grants complete port 6
be used as inputs. Port 4 and 5 are ad- be programmed to be cleared on the status to external devices.
dressed at the special function register negative or positive edge of ODS.
addresses shown in Table 1. BFLAG - BFLAG is a bidirectional 1/0
IDS- Input data strobe for port 6. IDS is pin which can be programmed to be an
PORT 6 used to control the port 6 input latch and output, set high or low under program
Port 6 is a special 8-bit bidirectional 1/0 input buffer full flag (IBF) bit in the CSR. control, or to output the state of the in-
port with internal pullups (see Figure 1). The input data latch can be programmed put buffer full flag. BFLAG can also be
This port can be used as a standard 1/0 to be transparent when IDS is low and programmed to input an enable signal for
port, or in strobed modes of operation in latched on the positive transition of IDS, port 6. When BFLAG is used as an en-
conjunction with four special control or to latch only on the positive transition able input, port 6 output drivers are in
lines: ODS, IDS, AFLAG, and BFLAG. of IDS. Correspondingly, the IBF flag is the high-impedance state, and the input
Port 6 operating modes are controlled by set on the negative or positive transition latch does not respond to the IDS strobe
the port 6 control status register (CSR). of IDS. when BFLAG is high. Both features are
Port 6 and the CSR are addressed at the enabled when BFLAG is low. This fea-
special function register addresses AFLAG - AFLAG is a bidirectional 1/0 ture facilitates the use of the SC80C451 1
shown in Table 1. The following four pin which can be programmed to be an SC83C451 in bused multiprocessor
control pins are used in conjunction with output set high or low under program systems.
port 6:
AFLAG
I
-rI
Bit 7 Bit 6 Bit 0 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
MB1 I MBO MA1 MAO OBFC IDSM OBF IBF
Output Buffer
Input Data Output Buffer Input Buffer
BFLAG Mode Select AFLAG Mode Select Flag Clear
Strobe Mode Full Flag Full Flag
Mode
0/0 - Logic 0 output"
0/1 - Logic 1 output"
0/0
0/1
- Logic 0 output
- Logic 1 output
0 -N~veO -
edge of ODS
Positive
edge of IDS
0- Output
data buffer
0- Input
data buffer
110 - IBF output 110 - OBF output" empty empty
111 - PE Input 111 - SEL Input 1 - Positive 1 - Low level
(0 - Select) (0 - Data) edge of ODS of IDS 1 - Output 1 - Input
(1 - Disable 1/0) (1 - Control/status) data buffer full data buffer full
NOTE.
"Output-always mode: MB1 - 0, MA1 - 1, and MAO - O. In this mode, port 6 is always enabled for output. ODS only clears
the OBF flag.
VOL1 Output low voltage, port 0, ALE, PSEN IOL - 3.2mA2 0.45 V
VOH Output high voltage, ports 1, 2, 3 IOH - -601JA 2.4 V
IOH - -251JA 0. 75Vcc V
0. 9Vcc V
IOH - -1 01JA
VOH1 Output high voltage (port 0 in external bus IOH - -8001JA 2.4 V
mode, ALE, PSEN)3 IOH - -3001JA 0. 75Vcc V
IOH - -801JA 0. 9Vcc V
AC ELECTRICAL CHARACTERISTICS TA - O°C to +70°C or TA - -40°C to +85°C, VCC - 5V ±20%, Vss - OV1, 2
tLLWL 3,4 ALE low to RD or WR low 200 300 3tCLCL -50 3tCLCL+50 ns
tXHOX 5 Output data hold after clock rising edge 50 2tCLCL -117 ns
tXHDX 5 Input data hold after clock rising edge 0 0 ns
tXHDV 5 Clock rising edge to input data valid 700 1OtCLCL -133 ns
NOTES.
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port 0, ALE, and PSEN - 100pF, load capacitance for all other outputs - 80pF.
A - Address
C - Clock
0- Input data
F - PE, SEL, or IBF
H - Logic level high
I - Instruction (program memory contents), or input data strobe
L - Logic level low, or ALE
o- Output data strobe
P- PSEN
Q - Output data
R - RD signal
t - Time
V - Valid
W - WR signal
X - No longer a valid logic level
Z - Float
ALE
PORTO _ _ _ _/
PORT 2 _ _ _ _J A8-A15
ALE
'RHDX
PORTO AO-A? FROM PCl
Io----------'AVDV~----~
PORT 2
--- P2.0-P2.? OR AS-A15 FROM DPH A8-A15 FROM PCH
ALE
- ....---WLWH----01
tOVWX
INSTRUCTION o 2 3 4 5 8 7 8
ALE
tOVXH HI t XHOX
OUTPUT DATA
' ' - _ - J "--_-' ' - _ - J ' - - _ . . J ' - _ - J ' - - _ - ' ' - _ - J '--_....J
f
WRITE TO SBUF
f
CLEAR RI
SET RI
~ -' I.-
OBF (AFLAG) k::
1----0 tOVFV ~ tOVFV
~ ...., t<-
PE(BFlAG) ~
t OLOH
~ Ir- -: £.
PORT 6
10-- tFLDV -
...., ~
I------ tOHFH
:; I'- ~
~ I'-
"to--
SEL (AFLAG)
I
tFLFH
PE (BFLAG) ~ ~~
I
tlllH
"{ 7 I'-
t Dv1H
tlHDX
PORTS
0.45V
~----------tCLCL----------~
Vcc-o.s
°.45V
=x O.2Vcc+O.9 >C
_,-O.;.;..;;.2V.;,.C;,.;c.;..-,.;;.O;,.;., _ _.....
Timing
Reference
Points
<
AC inputs during testing are driven at Vcc-o.s
For timing purposes, a port is no longer floating
for a logic "1" and O.4SV for a logic "0".
when a 100mV change from load voltage occurs,
Timing measurements are made at VIH min for
and begins to float when a 100mV change from
a logic "1" and V IL max for a logic "0".
the loaded VOHIVOL level occurs.IOH/lOL~± 20mA.
30
MAX
ACTIVE MODE
25
20
f
<.
E 15
()
!:!
10
5 ~---+~~+----4----~MAX
IDLE MODE
TYP(1)
L:::d=:::::±==:t:==:J IDLE MODE
4MHz 8MHz 12MHz 16MHz
FREQ AT XTAL1
Vee
Vee
RST
RST
(NC) XTAL2
(NC) XTAL2 CLOCK XTAL1 Vee
CLOCK XTAL1 SIGNAL Vss
SIGNAL Vss
Figure 14. Icc Test Condition, Active Mode Figure 15. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
0.45V
~--------tCLCL----------~
Figure 16. Clock Signal Waveform for Icc Tests in Active and Idle Modes
tCLCH = tCHCL 5ns=
RST
(NC) XTAL2
XTAL1 Vee
Vss
Product Specification
Microprocessor Division
INDEX
CORNE1~9
: 61 so
LCC
26 44
27 43
TOP VIEW
ORDERING INFORMATION
INDEX
~"n
10 0 60
LCC
26 44
27 43
TOP VIEW
Pin Function Pin Function Pin Function
1 EAIVPP 24 P4.2 47 P5.3
2 P2.0/A8 25 P4.1 48 P5.4
3 P2.1/A9 26 P4.0 49 P5.5
4 P2.2/Al0 27 Pl.0 50 P5.6
5 P2.3/All 28 Pl.l 51 P5.7
6 P2.4/A12 29 Pl.2 52 XTAL2
7 P2.5/A13 30 Pl.3 53 XTALl
8 P2.6/A14 31 Pl.4 54 Vss
9 P2.7/A15 32 Pl.5 55 ODS
10 PO.7IAD7 33 Pl.6 56 ~
11 PO.6/AD6 34 Pl.7 57 BFLAG
12 PO.5/AD5 35 RST 58 AFLAG
13 PO.4/AD4 36 P3.0/RxD 59 P6.0
14 PO.3/AD3 37 P3.1/TxD 60 P6.1
15 PO.2/AD2 38 P3.2/iliiTli 61 P6.2
16 PO.l/ADl 39 P3.3/iN'i'i 62 P6.3
17 PO.O/ADO 40 P3.4/TO 63 P6.4
18 Vee 41 P3.5/Tl 64 P6.5
19 P4.7 42 P3.6/ioWi 65 P6.6
20 P4.6 43 P3.7/RD 66
21 P4.5 44 P5.0 67 ~~'~N
22 P4.4 45 P5.1 68 ALE/PROO
23 P4.3 46 P5.2
'"
00
"i>c 0 n·
(j)
CJ) s::
'" PO.D-PO.7 P2.CI-P2.7 P4.o-P4.7 P5.o-P5.7
G)
1I
CJ)
n·
(3
> -a
3:
( ---------1 ::::l
<C
(3
()
CD
F. 0
CD
I
::r
"0
III
Q
""0
(3
Q.
c
()
en
CXl
I
-
OJ
m
-0
JJ
0
s::
'" s::
I
TL1 0
SBUFI IE I IP 0
-
0
::::l
~
0
ffiN CD
AL~G
T~~~ ~m~ ~; ~ ~
~
EA/V"" J DPTR
RST ~
CONTROL - 1f ,q.,q.
if ; ;
1"f
l XTALl XTAL2
-----) ""0
lI! CJ) a
c
0 ~
(f)
CXl -a
~ CD
()
0 ~
.j:>.
01
....0. o·~
::J
Signetics Microprocessor Products Product Specification
PIN DESCRIPTION
PIN NO.
MNEMONIC TYPE NAME AND FUNCTION
DIP LCC
Vss 50 54 I Ground: OV reference.
Vee 18 18 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.0-PO.7 17-10 17-10 I/O Port 0: Port 0 is an 8-bit open-drain, bidirectional I/O port. Port 0 is also the multiplexed data
and low-<lrder address bus during accesses to external memory. External pullups are required
during program verification. Port 0 can sink/source eight LS TTL inputs.
Pl.0-Pl.7 23-3027-34 I/O Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull ups. Port 1 receives the low-
order address bytes during program memory verification. Port 1 can sink/source three LS TTL
inputs, and drive CMOS inputs without external pullups.
P2.0-P2.7 2-9 2-9 I/O Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pullups. Port 2 emits the
high-order address bytes during access to external memory and receives the high-<lrder
address bits and control signals during program verification. Port 2 can sink/source three LS
TTL inputs and drive CMOS inputs without external pullups.
P3.0-P3.7 32-39 36-43 I/O Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups. Port 2 can sink/source
three LS TTL inputs and drive CMOS inputs without external pullups. Port 3 also serves the
special functions listed below:
32 36 I RxO (P3.0): Serial input port
33 37 0 TxO (P3.1): Serial output port
34 38 I INTO (P3.2): External interrupt 0
35 39 I INT1 (P3.3): External interrupt 1
36 40 I TO (P3.4): Timer 0 external input
37 41 I lliP3.5): Timer 1 external input
38 42 0 WR (P3.6): External data memory write strobe
39 43 0 RO (P3.7): External data memory read strobe
P4.0-P4.3 22-19 I/O Port 4: Port 4 is a 4/8-bit (DIP/LCG) bidirectional I/O port with internal pull ups. Port 4 can
P4.0-P4.7 26-19 I/O sink/source three LS TTL inputs and drive CMOS inputs without external pullups.
P5.0-P5.7 40-47 44-51 I/O Port 5: Port 5 is an 8-bit bidirectional I/O port with internal pullups. Port 5 can sink/source
three LS TTL inputs and drive CMOS inputs without external pullups.
P6.0-P6.7 55-62 59-66 I/O Port 6: Port 6 is a specialized 8-bit bidirectional I/O port with internal pull ups. This special
port can sink/source three LS TTL inputs and drive CMOS inputs without external pull ups.
Port 6 can be used in a strobed or non-strobed mode of operation. Port 6 works in conjunc-
tion with four control pins that serve the functions listed below:
Port 6 Control Lines:
51 55 ODS: Output data strobe
52 56 IDS: Input data strobe
53 57 BFLAG: Bidirectional I/O pin with internal pullups
54 58 AFLAG: Bidirectional I/O pin with internal pull ups
RST 31 35 I Reset: A high on this pin, for two machine cycles while the oscillator is running, resets the
device. An internal pull-down resistor permits a power-<ln reset using only a capacitor connect-
ed to Vee.
ALE/PROG 64 68 I/O Address Latch Enable/Program Pulse: Output pulse for latching the low byte of the address
during accesses to external memory. ALE is activated at a constant rate of 1/6 the oscillator
frequency except during an external data memory access, at which time one ALE is skipped.
ALE can sink/source eight LS TTL inputs and drive CMOS inputs without an external pullup.
This pin is also the program pulse during EPROM programming.
PSEN 63 67 I/O Program Store Enable: The read strobe to external program memory. PSEN is activated twice
each machine cycle during fetches from external program memory. However, when executing
out of external program.1!!!ill!.0ry, two activations of PSEN are skipped during each access to
~al data memory. PSEN is not activated during fetches from internal program memory.
PSEN can sink/source eight LS TIL inputs and drive CMOS inputs without an external pull up.
This pin should be tied low during programming.
EA/vpp 1 1 I Instruction Execution Control/Programming Supply Voltage: When EA is held high, the CPU
~ecutes out of internal program memory, unless the program count.N..exceeds OFFFH. When
EA is held low, the CPU executes out of external program memory. EA must never be allowed
to float. This pin also receives the 12.75V programming supply voltage (Vpp) during EPROM
programming.
XTAL1 49 53 I Crystal 1: Input to the inverting amplifier that forms the oscillator. This input receives the ex-
ternal oscillator when an external oscillator is used.
XTAL2 48 52 0 Crystal 2: An output of the inverting amplifier that forms the oscillator. This pin should be
floated when an external oscillator is used.
PORTS 4AND5 ODS - 0 utput data strobe input for port control, or to output the state of the
Ports 4 and 5 are bidirectional 1/0 ports 6. O~S can be programmed to control output buffer full flag. AFLAG can also
with internal pullups. Port 4 is an 8.oit the port 6 output drivers and the output be programmed to be an input which se-
port (LCC version) or a 4.oit port (01 P buffer full flag (OBF), or to clear only lects whether the contents of the output
version). Port 4 and port 5 pins with the OBF flag bit in the CSR (output- buffer, or the contents of the port 6 con-
ones written to them, are pulled high by always mode). ODS is active low for trol status register will be output on port
the internal pullups, and in that state can output driver control. The OBF flag can 6. This feature grants complete port 6
be used as inputs. Port 4 and S are ad- be programmed to be cleared on the status to external devices.
dressed at the special function register negative edge of ODS.
addresses shown in Table 1. BFLAG - BFLAG is a bidirectional I/O
IDS- Input data strobe for port 6. IDS is pin which can be programmed to be an
PORTe used to control the port 6 input latch and output, set high or low under program
Port 6 is a special 8.oit bidirectional 1/0 input buffer full flag (IBF) bit in the CSR. control, or to output the state of the in-
port with internal pullups (see Figure 1). The input data latch can be programmed put buffer full flag. BFLAG can also be
This port can be used as a standard 1/0 to be transparent when IDS is low and programmed to input an enable signal for
port, or in strobed modes of operation in latched on the positive transition of i"DS, port 6. When BFLAG is used as an en-
conjunction with four special control or to latch only on the positive transition able input, port 6 output drivers are in
lines: ODS, IDS, AFLAG, and BFLAG. of IDS. Correspondingly, the IBF flag is the high-impedance state, and the input
Port 6 operating modes are controlled by set on the negative or positive transition latch does not respond to the IDS strobe
the port 6 control status register (CSR). of IDS. when BFLAG is high. Both features are
Port 6 and the CSR are addressed at the enabled when BFLAG is low. This fea-
special function register addresses AFLAG - AFLAG is a bidirectional I/O ture facilitates the use of the SC87C4S1
shown in Table 1. The following four pin which can be programmed to be an in bused multiprocessor systems.
control pins are used in conjunction with output set high or low under program
port 6:
Table 1. Special Function Register Addresses
AFLAG
CONTROL STATUS REGISTER Input buffer is loaded on the IDS positive source of port 6 output data. A 'logic 0
The control status register (CSR) estab- edge. When CSR.2 - 1, a high-to-low on AFLAG input selects the port 6 data
lishes the mode of operation for port 6 transition on the ii5S pin sets the I BF register, and a logic 1 on AFLAG input
and indicates the current status of port 6 flag. When port 6 input buffer is trans- selects the control status register.
I/O registers. All control status register parent when IDS is low, and latched
bits can be read and written by the CPU, when ii5S is high. CSR.6, CSR.7 BFLAG Mode Select (MBO,
except bits 0 and 1, which are read on- MB1) - Bits 6 and 7 select the mode
ly. Reset writes ones to bits 2 through 7, CSR.3 Output Buffer Full Flag Clear operation as follows:
and writes zeros to bits 0 and 1 (see Ta- Mode (OBFe) - When CSR.3 - 1, the
positive edge of the ~ input clears MA1 MAO AFLAG Function
ble 2). o 0 Logic 0 output
the OBF flag. When CSR.3 - 0, the
CSR.O Input Buffer Full Flag (IBF) (Read negative edge of the ODS input clears o 1 Logic 1 output
Only) ~ The IBF bit Is set to a logic 1 the OBF flag. 1 0 IBF flag output (CSR.O)
when port 6 data Is loaded into the input 1 1 Port enable (PE)
buffer under control of ii5S. This can oc- CSR.4, CSR.5 AFLAG Mode Select (MAO,
cur on the negative or positive edge of MA1) - Bits 4 and 5 select the mode of In the port enable mode, IDS and ODS
IDS, as determined by CSR.2. IBF is operation for the AFLAG pin, as follows: inputs are disabled when BFLAG input is
cleared when the CPU reads the input high. When the BFLAG input Is low, the
MA1 MAO AFLAG Function port is enabled for I/O.
buffer register.
o 0 Logic 0 output
CSR.1 Output Buffer Full Flag (OBF) o 1 Logic 1 output SPECIAL FUNCTION REGISTER
(Read Only) - The OBF flag is set to a 1 0 OBF flag output (CSR.1) ADDRESSES
1 1 Select (SEL) input mode Special function register addresses for
logic 1 when the CPU writes to the port
the SC87C451 are identical to those of
6 output data buffer. OBF is cleared by
The select (SEL) input mode is used to the SC80C51, except for the additional
the positive or negative edge of ODS, as
determine whether the port 6 data regis- registers listed in Table 1.
determined by CSR.3.
ter or the control status register is output
CSR.2 IDS Mode Select (IDSM) - When on port 6. When the select feature is
CSR.2 - 0, a low-to-high transition on enabled, the AFLAG input controls the
the IDS pin sets the IBF flag. The port 6
Test Limits
Symbol Parameter Unit
Conditions Min Typical 1 Max
VIL Input low voltage, except EA -0.5 0. 2Vcc-0.1 V
VIL1 Input low voltage to EA 0 0.2Vcc-0.3 V
VIH Input high voltage, except XT AU, RST 0.2Vcc+·9 Vcc+0.5 V
VIH1 Input high voltage, XTAL 1, RST 0.7Vcc Vcc+O.5 V
VOL Output low voltage, ports 1, 2, 3, 4, 5, 6 IOL - 1.6mA2 0.45 V
VOL1 Output low voltage, port 0, ALE, PSEN IOL - 3.2mA2 0.45 V
VOH Output high voltage, ports 1, 2, 3, 4, 5, 6 IOH - -60jJA 2.4 V
IOH - -25jJA O.75VcC V
IOH - -10jJA 0.9Vcc V
VOH1 Output high voltage (port 0 in external bus IOH - -800jJA 2.4 V
mode, ALE, PSEN)3 IOH - -300jJA 0.75Vcc V
IOH - -80jJA 0. 9Vcc V
AC ELECTRICAL CHARACTERISTICS TA - DoC to +70°C or TA - -40°C to +85°C, VCC - 5V ±10%, Vss - OV1, 2
Program Memory
l/tCLCL 2 Oscillator frequency: Speed Versions
SC87C451 8 0.5 12 MHz
SC87C451 C 3.5 12 MHz
SC87C451 G 3.5 16 MHz
Port 6 Output
tOLOH 6 ODS width 270 3tCLCL +20 ns
A - Address
C - Clock
o - I nput data
F - PE, SEL, or IBF
H - LogiC level high
I - I nstruction (program memory contents), or input data strobe
L - Logic level low, or ALE
a- Output data strobe
P- PSEN
Q - Output data
R - RD signal
t - Time
V - Valid
W - WR signal
X - No longer a valid logic level
Z - Float
ALE
~ _ _ _J
PORTO _ _ _J
PORT 2 _ _ _ _J
ALE
---M.------IRlRH------~
ALE "- /
I-- tWHLH
1\
t AVLL
- ..-tLLAX .....
- tOVWX
/
..... t wHoX
PORT 0
~ . ",,,,,.A~ I ~~ nDI ~ DATA OUT K AD-A7 FROM PCL INSTR I N
tAVWL
INSTRUCTION o 2 3 4 5 6 7 B
ALE
tOVXH H I ' X H Q X
OUTPUT DATA
\ ...._ - - ' '--_...J \.._--' I - - _ . . J ...._ - - ' '--_..J ...._----1 \..o-_..J
T
WRITE TO SBUF
f
CLEAR RI t
SET RI
~~ -'
OBF (AFLAG)
..J
"7 IL
"
PE(BFLAG)
..::~
t OLOH
.., IL
tOLDV I--t tOHDZ
PORTe
"7 l£-
I-- tOHFH
-~
SEL (AFLAG) "7 IL "7 l£-
I
tFLFH
PE (BFLAG) ~ -:: IL
~
tlLlH
.., F-
t DV1H
tlHDX
PORTe
IBF (BFLAG)
IDS
-
~
_
;,~ iJ_ 1VFV
0.45V
~---------tCLCL--------~
Vcc-O.5
O.45V
=x O.2Vcc+O.9
_...O;;,;.,:;;2V.:.,c,;;.c,;;.-..,;O.:...,:......___
>C Timing
Reference
Points
<
AC inputs during testing are driven at Vcc-0.5
For timing purposes, a port is no longer floating
for a logic "1" and 0.45V for a logic "0".
when a 100mV change from load voltage occurs,
Timing measurements are made at VIH min for
and begins to float when a 100mV change from
a logic" 1" and V IL max for a logic "0".
the loaded VOHIVOL level occurs.IOH/lOL~± 20mA.
EPROM CHARACTERISTICS applied to port O. RST, PSEN and pins shown in Figure 20. The other pins are
The SC87C451 is programmed by using a of ports 2 and 3 specified in Table 2 are held at the "Verify Code Data" levels in-
modified Quick-Pulse Programming" al- held at the "Program Code Data" levels dicated in Table 3. The contents of the
gorithm. It differs from older methods in indicated in Table 3. The ALE/PROG is address location will be emitted on port
the value used for Vpp (programming pulsed low 25 times as shown in Figure O. External pull-ups are required on port
supply voltage) and in the width and 19. o for this operation.
number of the ALE/PROG pulses.
To program the encryption table, repeat If the encryption table has been pro-
The SC87C451 contains two signature the 25 pulse programming sequence for grammed, the data presented at port 0
bytes that can be read and used by an addresses 0 through 1 FH, using the will be the exclusive NOR of the pro-
EPROM programming system to identify "Pgm Encryption Table" levels. Do not gram byte with one of the encryption
the device. The signature bytes identify forget that after the encryption table is bytes. The user will have to know the
the device as an SC87C451 manufac- programmed, verification cycles will pro- encryption table contents in order to cor-
tured by Signetics Corporation. duce only encrypted data. rectly decode the verification data. The
encryption table itself cannot be read
Table 3 shows the logic levels for read- To program the lock bits, repeat the 25 out.
ing the signature byte, and for program- pulse programming sequence using the
ming the program memory, the encryp- "Pgm Lock Bit" levels. After one lock bit Reading the Signature Bytes
tion table, and the lock bits. The circuit is programmed, further programming of The signature bytes are read by the
configuration and waveforms for quick- the code memory and encryption table is same procedure as a normal verification
pulse programming are shown in Figures disabled. However, the other lock bit of locations 030H and 031 H, except that
18 and 19. Figure 20 shows the circuit can still be programmed. P3.6 and P3.7 need to be pulled to a
configuration for normal program memory logic low. The values are:
verification. Note that the EAIVpp pin must not be al-
lowed to go above the maximum speci- (030H) - 15H indicates manufactured by
QUICK-PULSE PROGRAMMING fied Vpp level for any amount of time. Signetics
The setup for microcontroller quick-pulse Even a narrow glitch above that voltage (031 H) - 90H indicates SC87C451
programming is shown in Figure 18. Note can cause permanent damage to the de-
that the SC87C451 is running with a 4 to vice. The Vpp source should be well reg- ProgramlVerify Algorithms
6MHz oscillator. The reason the oscilla- ulated and free of glitches and over- Any algorithm in agreement with the
tor needs to be (unning is that the de- shoot. conditions listed in Table 3, and which
vice is executing internal address and satisfies the timing specifications, is suit-
program data transfers. Program Verification able.
If lock bit 2 has not been programmed,
The address of the EPROM location to the on-chip program memory can be
be programmed is applied to ports 1 and read out for program verification. The
2, as shown in Figure 18. The code byte address of the program memory locations
to be programmed into that location is to be read is applied to ports 1 and 2 as "Trademark phrase of Intel Corp.
30
MAX
ACTIVE MODE
t
1 15
~
10
5 f---+r---,f---+---:f MAX
IDLE MODE
TYP(1)
L:::'d:=::±==t:=:J IDLE MODE
Vee
Vee
Vee
RST
RST
(NC) XTAL2
(NC) XTAL2 CLOCK XTAL1 Vee
CLOCK XTAL1 SIGNAL Voo
SIGNAL Voo
Figure 14. Icc Test Condition, Active Mode Figure 15. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
0.45V
1-----tcLcL------"I
Figure 16. Clock Signal Waveform for IcC Tests in Active and Idle Modes
tCLCH =tCHCL =
5ns
Vee
RST
(NC) XTAL2
XTAL1 Vee
Voo
+5V
Vee
L =i=
XTAL1
P2.0
-P2.3 •
A
A8-A11
.-- Vss
- L-
J,....--------:25 PULSES----------01
i-----
ALE/PROG: -:LJLJlJUl.:::.------------
L-...,--J
+5V
Vee
P2.6 10---- 0
Voo
EPROM PROGRAMMING AND VERIFICATION CHARACTERISTICS TA - 21°C to +27°C, VCC - 5V±10%, VSS - OV (see Figure 21)
PROGRAMMING' VERIFICATION'
P1.0-P1.7 '\.
ADDRESS ADDRESS
P2.0-P2.3 /
-0 io- tAVOV
1--0 t GHSL
~
V
- - -- - - - - - - - - - - -
LOGIC 0
- -- - - - - --
t EHSH
t EHOZ
P2.7
tELOr I-
EANBlE ---./
'FOR PROGRAMMING VERIFICATION SEE FIGURE 18.
FOR VERIFICATION CONDITIONS SEE FIGURE 20.
(FF FFHI 64 K
EXTERNAL
(1 FFFHI
(20 OOHI 8192
8191
(
t
,
INTERNAL EXTERNAL (FFHI 255 ...-----<,
(EA. 11 (EA·OI
(7FHI 127
INTERNAL
DATA RAM (OOOOHI 0 '--_ _ _.....
(OOOOHI 0 (OOH) 0
~------~y~--------~ ~'--------~y~--------~ ~
PROGRAM MEMORY INTERNAL EXTERNAL
DATA MEMORY DATA MEMORY
When the least significant byte of the timer overflows or BIT Symbol Function
\\hen a 16-bit overflow occurs, an interrupt request may
be generated. Either or both of these overflows can be lEN 1.7 ET2 Enable Timer T2 overflow interrupt( s)
programmed to request an interrupt. In both cases, the lENl.6 ECM2 Enable T2 Comparator 2 interrupt
IENl.5 ECMI Enable T2 Comparator I interrupt
interrupt vector will be the same. When the lower byte
IENl.4 ECMO Enable T2 Comparator 0 interrupt
(TML2) overflows, flag 1'2BO (TM2CON) is set and flag
lEN 1.3 ECf3 Enable T2 Capture register 3 interrupt
1'20V (TM2IR) is set when TMH2 overflows. These flags
IENl.2 ECT2 Enable T2 Capture register 2 interrupt
are set one cycle after an overflow occurs. Note that
IENl.l ECfI Enable T2 Capture register I interrupt
\\hen T20V is set, T2BO will also be set. To enable the
byte overflow interrupt, bits ET2 (IENl. 7, enable over-
IENl.O Ecro Enable T2 Capture register 0 interrupt
flow interrupt, see Figure 14) and 1'2lS0 (TM2CON.6,
byte overflow interrupt select) must be set. Bit T2BO
(TM2CON.4) is the Timer T2 byte overflow flag. Figure 14. Timer T2 Interrupt Enable Register (lEN1)
To enable the 16-bit overflow interrupt, bits ET2 (IE1.7, OVINT: PUSH ACC ;save accumulator
enable overflow interrupt) and T2ISI (TM2CON.7, 16-bit PUSH PSW ;save status
overflow interrupt select) must be set. Bit T20V INC TIMEXI ;increment first
(TM2IR.7) is the Timer T2 16-bit overflow flag. All in- ; byte (low order)
terrupt flags must be reset by software. To enable both
;of extended timer
byte and 16-bit overflow, T2ISO and T2ISI must be set
and two interrupt service routines are required. A test on MOV A,TIMEXI
the overflow flags indicates which routine must be exe- JNZ INTEX ; jump to INTEX if
cuted. For each routine, only the corresponding overflow ;there is no
flag must be cleared. ; overflow
INC TIMEX2 ; increment second
Timer T2 may be reset by a nsmg edge on RT2 (Pl.5) ; byte
if the Timer T2 external reset enable bit (T2ER) in MOV A,TIMEX2
T2CON is set. This reset also clears the prescaler. In JNZ INTEX ; jump to INTEX i f
the Idle mode, the timer/counter and prescaler are reset ; there is no
and halted. Timer T2 is controlled by the TM2CON spe-
; overflow
cial function register (see Figure 15).
INC TIMEX3 ;increment third
Timer T2 Extension ; byte (high order)
INTEX: CLR T20V ;reset interrupt
When a 12MHz oscillator is used, a 16-bit overflow on ; flag
Timer T2 occurs every 65.5, 131, 262 or 524ms de- POP PSW ; restore status
pending on the prescaler division ratio i.e. the maximum POP ACC ;restore accumulator
cycle time is approximately 0.5 seconds. In applications RETI ; return from
where cycle times are greater than 0.5 seconds, it is
; interrupt
necessary to extend Timer T2. This is achieved by se-
lecting foscl12 as the clock source (set T2MSO, reset
Timer T2, Capture and Compare Logic
T2MSl), setting the prescaler division ratio to 118 (set
T2PO, set T2Pl), disabling the byte overflow interrupt Timer T2 is connected to four 16-bit capture registers
(reset T2ISO) and enabling the 16-bit overflow interrupt and three 16-bit compare registers. A capture register
(set T2ISl). The following software routine is written for may be used to capture the contents of Timer T2 when a
a three-byte extension which gives a maximum cycle transition occurs on its corresponding input pin. A com-
time of approximately 2400 hours. pare register may be used to set, reset or toggle Port 4
output pins at certain pre-programmable time intervals.
~r I~ I eTO
IT 1+11 eTl
IT eT2
I~:I ~r I~'I eT3
off
8 - bit overflow
interrupt
fose
I&-bit overflow
T2 .. interrupt
RT2
T2ER
external reset
enable
S R P4.0
S R P4.1
S R P4.2 INT
I/O port 4
S R P4.3~
S R P4.4 '\r--V
S R P4.S
TG T P4.&
TG T P4.7 5 • SIll T2 SFR address, TML2· lower 8 bits
R • reset TMH2· higher 8 bits
STE RTE
T • toggle
TG • toggle status
7 6 4 2 o 7643210
PRESCALER
11- BIT TIMER TJIB·BIT!
LOAD LOADEN
,.....
internal
writ~
T3 -~t----l -----c;:]
EWI
I -......- - - - - - - - " ' -_ _ _ _ _ _ _.. _-_-~~~_-_-_-__I -- '~f::'''
.....
INTERNAL BUS
If the 8-bit timer overflows, a short internal reset pulse watchdog interval and thus it becomes more difficult to
is generated which will reset the 83CSS2. A short output implement watchdog operation.
reset pulse is also generated at the RST pin. This short
output pulse (3 machine cycles) may be destroyed if the The programmer must now partition the software in such
RST pin is connected to a capacitor. This would not, a way that reloading of the watchdog is carried out in
however, affect the internal reset operation. accordance with the above requirements. The program-
mer must determine the execution times of all software
Watchdog operation is activated when external pin EW is modules. The effect of possible conditional branches,
tied low. When EW is tied low, it is impossible to dis- subroutines, external and internal interrupts must all be
able watchdog operation by software. taken into account. Since it may be very difficult to
evaluate the execution times of some sections of code,
How to Operate the Watchdog Timer the programmer should use worst case estimations. In
any event, the programmer must make sure that the
The watchdog timer has to be reloaded within periods watchdog is not activated during normal operation.
that are shorter than the programmed watchdog interval;
otherwise the watchdog timer will overflow and a system The watchdog timer is reloaded in two stages in order to
reset will be generated. The user program must there- prevent erroneous software from reloading the watchdog.
fore continually execute sections of code which reload First, PCON.4 (WLE) must be set. Then T3 may be
the watchdog timer. The period of time elapsed between loaded. When T3 is loaded, PCON.4 (WLE) is auto-
execution of these sections of code must never exceed matically reset. T3 can not be loaded if PCON.4 (WLE)
the watchdog interval. When using a 12MHz oscillator, is reset. Reload code may be put in a subroutine as it is
the watchdog interval is programmable between 2ms and called frequently. Since Timer T3 is an up-counter, a
S1Oms. reload value of OOH gives the maximum watchdog inter-
val (S1Oms with a 12MHz oscillator) and a reload value
In order to prepare software for watchdog operation, a of OFFH gives the minimum watchdog interval (2ms with
programmer should first determine how long his system a 12MHz oscillator).
can sustain an erroneous processor state. The result will
be the maximum watchdog interval. As the maximum In the Idle mode, the watchdog circuitry remains active.
watchdog interval becomes shorter, it becomes more dif- When watchdog operation is implemented, the Power-
ficult for the programmer to ensure that the user pro- down mode cannot be used since both states are contra-
gram always reloads the watchdog timer within the dictory. Thus, when watchdog operation is enabled by ty-
ing external pin EW low, it is impossible to enter the - Multimaster bus (no central master)
Power-down mode and an attempt to set the Power-down - Arbitration between simultaneously transmitting masters
bit (PCON.l) will have no effect. PCON.l will remain at without corruption of serial data on the bus
logic O. - Serial clock synchronization allows devices with differ-
ent bit rates to communicate via one serial bus
During the early stages of software development/debug- - Serial clock synchronization can be used as a hand-
ging, the watchdog may be disabled by tying the EW pin shake mechanism to suspend and resume serial trans-
high. At a later stage, EW may be tied low to complete fer
the debugging process. - The 12C bus may be used for test and diagnostic pur-
poses
Watchdog Software Example
The output latches of P1.6 and Pl.7 must be set to logic
The following example shows how watchdog operation 1 in order to enable SIal.
might be handled in a user program.
The 83C552 on-chip 12C logic provides a serial interface
;at the program start: that meets the 12C bus specification and supports all
transfer modes (other than the low speed mode) from
T3 EQU OFFH ;address of and to the I2C bus. The SIal logic handles bytes trans-
;watchdog timer T3 fer autonomously. It also keeps track of serial transfers,
PCON EQU 087H ;address of PCON SFR and a status register SlSTA) reflects the status of SIal
WATCH-INTV EQU 156 ;watchdog interval and the 12C bus.
;(e.g.2xlOOms)
ito be inserted at each watchdog reload The CPU interfaces to the I2C logic via the following
;location within the user program: four special function registers: SlCON (SIal control
register), SlSTA (SIOI status register), SlDAT (SIOI
LCALL WATCHDOG data register) and SlADR (SIal slave address register).
The Sial logic interfaces to the external 12C bus via
;watchdog service routine: two Port 1 pins: P1.6/SCL (serial clock line) and Pl.71
SDA (serial data line).
WATCHDOG: ORL PCON,tlOH;set condition A typic al 12C bus configuration is shown in Figure 22
; flag (PCON. 4) and Figure 23 shows how a data transfer is accomplished
MOV T3,WATCH-INV ;load T3 with on the bus. Depending on the state of the direction bit
; watchdog (R/W), two types of data transfers are possible on the
; interval 12C bus:
RET 1. Data transfer from a master transmitter to a slave
receiver. The first byte transmitted by the master is
If it is possible for this subroutine to be called in an er- the slave address. Next follows a number of data
roneous state, then the condition flag WLE should be set bytes. The slave returns an acknowledge bit after each
at different parts of the main program. received byte.
2. Data transfer from a slave transmitter to a master
SERIAL 110 receiver. The first byte (the slave address) is transmit-
ted by the master. The slave then returns an acknowl-
The 83C552 is equipped with two independent serial edge bit. Next follows a number of data bytes trans-
ports: SIOO and SIal. SIOO is a full duplex UART port mitted by the slave to the master. The master returns
and is identical to the 80C5l serial port. SIal accom- an acknowledge bit after all received bytes other than
modates the l2C bus. the last byte. At the end of the last received byte, a
'not acknowledge' is returned.
SIOO
The master device generates all of the serial clock puls-
SIOO is a full duplex serial I/O port identical to that on es and the START and STOP conditions. A transfer is
the 80C51. Its operation is identical including the use of ended with a STOP condition or with a repeated START
timer 1 as a baud rate generator.
condition. Since a repeated START condition is also the
beginning of the next serial transfer, the I2C bus will not
S101, Pc Serial 1/0 be released.
The 12C bus uses two wires (SDA and SCL) to transfer Modes of Operation
information between devices connected to the bus. The
main features of the bus are: The on-chip SIal logic may operate in the following
four modes:
- Bidirectional data transfer between masters and slaves
VOD
) Rp ] Rp
SDA
SCL
Pl.7/SDA Pl.6/SCL
r-l
SOA~_-
STOP COndition
I __ J~-J~~_ _~
I I MSB
I I .,... odd,. .
I I
I I
I I
I I
I I
SCl~ r\ r\
i i \.J t \.J 2 L __
L..!.J
START
CONDiTION
Serial data output through P1.7/SDA while P1.6/SCL The first byte transmitted contains the slave address of
outputs the serial clock. The first byte transmitted con- the transmitting device (7 bits) and the data direction
tains the slave address of the receiving device (7 bits) bit. In this case the data direction bit (RJW) will be log-
and the data direction bit. In this case the data direction ic 1 and we say that an 'R' is transmitted. Thus the first
bit (RJW) will be logic 0 and we say that a 'W' is byte transmitted is SLA+R. Serial data is received via
transmitted. Thus the first byte transmitted is SLA+W. P1.7/SDA while P1.6/SCL outputs the serial clock. Se-
Serial data is transmitted 8 bits at a time. After each rial data is received eight bits at a time. After each byte
byte is transmitted, an acknowledge bit is received. is received, an acknowledge bit is transmitted. START
START and STOP conditions are output to indicate the and STOP conditions are output to indicate the beginning
beginning and the end of a serial transfer. and end of a serial transfer.
Serial data and the serial clock are received through The comparator compares the received 7-bit slave ad-
P1.7/SDA and P1.6/SCL. After each byte is received, an dress with its own slave address (7 most significant bits
acknowledge bit is transmitted. START and STOP condi- in SlADR). It also compares the first received 8-bit
tions are recognized as the beginning and end of a serial byte with the general call address (OOH). If an equality
transfer. Address recognition is performed by hardware is found, the appropriate status bits are set and an inter-
after reception of the slave address and direction bit. rupt is requested.
The first byte is received and handled as in the slave re- This 8-bit special function register contains a byte of se-
ceiver mode. However, in this mode, the direction bit rial data to be transmitted or a byte which has just been
will indicate that the transfer direction is reversed. Se- received. Data in SlDAT is always shifted from right to
rial data is transmitted via P1.7/SDA while the serial left; the first bit to be transmitted is the MSB (bit 7)
clock is input through P1.6/SCL. START and STOP and, after a byte has been received, the first bit of re-
conditions are recognized as the beginning and end of a ceived data is located at the MSB of SlDAT. While data
serial transfer. is being shifted out, data on the bus is simultaneously
being shifted in; SlDAT always contains the last byte
In a given application, SIal may operate as a master present on the bus. Thus, in the event of lost arbitration,
and as a slave. In the slave mode, the SIal hardware the transition from master transmitter to slave receiver
looks for its own slave address and the general call ad- is made with the correct data in SlDAT.
dress. If one of these addresses is detected, an interrupt
is requested. When the microcontroller wishes to become Arbitration and Synchronization Logic
the bus master, the hardware waits until the bus is free
before the master mode is entered so that a possible In the master transmitter mode, the arbitration logic
slave action is not interrupted. If bus arbitration is lost checks that every transmitted logic 1 actually appears as
in the master mode, SIal switches to the slave mode a logic 1 on the 12C bus. If another device on the bus
immediately and can detect its own slave address in the overrules a logic 1 and pulls the SDA line low, arbitra-
same serial transfer. tion is lost and SIal immediately changes from master
transmitter to slave receiver. SIal will continue to out-
SI01 Implementation and Operation put clock pulses (on SCL) until transmission of the cur-
rent serial byte is complete.
Figure 24 shows how the on-chip 12C bus interface is
implemented and the following text describes the individ- Arbitration may also be lost in the master receiver
ual blocks. mode. Loss of arbitration in this mode can only occur
while SIal is returning a 'not acknowledge' (logic 1) to
Input Filters and Output Stages the bus. Arbitration is lost when another device on the
bus pulls this signal LOW. Since this can occur only at
The input filters have 12C compatible input levels. If the the end of a serial byte, SIal generates no further clock
input voltage is less than 1.5V, the input logic level is pulses. Figure 25 shows the arbitration procedure.
interpreted as 0; if the input voltage is greater than 3.0
V, the input logic level is interpreted as 1. Input signals The synchronization logic will synchronize the serial
are synchronized with the internal clock (fosc/4) and clock generator with the clock pulses on the SCL line
spikes shorter than three oscillator periods are filtered from another device. If two or more master devices gen-
out. erate clock pulses, the 'mark' duration is determined by
the device that generates the shortest 'marks' and the
The output stages consist of open drain transistors that 'space' duration is determined by the device that gener-
can sink 3mA at VOUT < O.4V. These open drain out- ates the longest 'spaces'. Figure 26 shows the synchroni-
puts do not have clamping diodes to VDD. Thus, if the zation procedure.
device is connected to the 12C bus and VDD is switched
off, the 12C bus is not affected. A slave may stretch the space duration to slow down the
bus master. The space duration may also be stretched
Address Register, SlADR for handshaking purposes. This can be done after each
bit or after a complete byte transfer. SIal will stretch
This 8-bit special function register may be loaded with the SCL space duration after a byte has been transmitted
the 7-bit slave address (7 most significant bits) to which or received and the acknowledge bit has been trans-
SIal will respond when programmed as a slave transmit- ferred. The serial interrupt flag (SI) is set and the
ter or receiver. The LSB (aC) is used to enable general stretching continues until the serial interrupt flag is
call address (DOH) recognition. cleared.
r---,
r
I
--I'- ___
PI.7 :
....
I
I
I
P1.8/SCL
OUTPUT
STAGE
3
INPUT
'"...
-<
z
P1.1/SDA
I
FILTER
OUTPUT
.
a::
w
!:
STAGE
I
I
I r---, TIMER 1
OVERFLOW
L -+IL.. _Pl.8 I
_ _ ..J
STATUS {
BITS
SlSTA
I" ·1
,--_!_ll_1.....JrL-.-_-_l_'~_-=I====='f..== _ ____JX\___C
(3)
SCL
--~ ACK
SDA ________~x~___________x==
SCL
I. Another sevice pulls the the SCL line low before the SIOI 'mark' duration is complete. The serial clock generator
is immediately reset and commences with the 'space' duration by pulling SCL LOW.
2. Another device stills pulls the SCL line LOW after SID I releases SCL. The serial clock generator is forced into the
wait state until the SCL line is released. ~
3. The SCL line is released and the serial clock generator commences with the mark duration.
MT
SUCCESSFUL TRANSMISSION
TO A SLAVE RECEIVER
TO MST/REC MODE
ENTRY. MR
TO CORRESPONDING STATES
IN SLAVE MODE
MR
SUCCESSFUL RECEPTION
FROM A SLAve
TRANSMITTER
TO CORRESPONDING STATES
IN SLAVE MODE
~~
ANY NUMBER OF DATA BYTES
AND THEIR ASSOCIATED ACKNOWLEDGE BITS
D FROMSLAVETOMASTER
LAST DATA BYTE TRANSMIITEO.
SWITCHED TO NOT ADDRESSED
SLAVE (AA BIT IN SICON 0'0'1
~~ ANY NUMBER OF DATA BYTES
~~ AND THEIR ASSOCIATED ACKNOWLEDGE BITS
When the slave address and the direction bit have been logic 1). The appropriate action to be taken for each of
transmitted and an acknowledgment bit has been re- these status codes is detailed in Table 10. ENS1, CR1
ceived, the serial interrupt flag (SI) is set again and a and CRO are not affected by the serial transfer and are
number of status codes in SlSTA are possible. There not referred to in Table 10. After a repeated start condi-
are 18H, 20H or 38H for the master mode and also tion (state 10H), SIal may switch to the master trans-
68H, 78H, or BOH if the slave mode was enabled (AA = mitter mode by loading SlDAT with SLA+W.
logic 1). The appropriate action to be taken for each of
these status codes is detailed in Table 9. ENS1, CR1 Slave Receiver Mode
and CRO are not affected by the serial transfer and are
not referred to in Table 9. After a repeated start condi- In the slave receiver mode, a number of data bytes are
tion (state lOH). SIal may switch to the master receiver received from a master transmitter (see Figure 29). To
mode by loading SlDAT with SLA+R. initiate the slave receiver mode. SlADR and SlCON
must be loaded as follows:
Master Receiver Mode
CRO and CR1 do not affect SI01 in the slave mode. However, the I2C bus is still monitored and address rec-
ENS1 must be set to logic 1 to enable SIOl. The AA bit ognition may be resumed at any time by setting AA. This
must be set to enable SI01 to acknowledge its own slave means that the AA bit may be used to temporarily iso-
address or the general call address. STA, sm and SI late SI01 from the I2C bus.
must be reset.
Slave Transmitter Mode
When SlADR anq SlCON have been initialized, SI01
waits until it is addressed by its own slave address fol- In the slave transmitter mode, a number of data bytes
lowed by the data direction bit which must be '0' (W) for are transmitted to a master receiver (see Figure 30).
SI01 to operate in the slave receiver 'mode. After its Data transfer is initialized as in the slave receiver mode.
own slave address and the W bit have been received, the When SlADR and SlCON have been initialized, SI01
serial interrupt flag (I) is set and a valid status code can waits until it is addressed by its own slave address fol-
be read fromS1STA. This status code is used to vector lowed by the data direction bit which must be '1' (R) for
to an interrupt service routine and the appropriate action SI01 to operate in the slave transmitter mode. After its
to be taken for each of these status codes is detailed in own slave address and the R bit have been received, the
Table 11. The slave, receiver mode may also be entered serial interrupt flag (SI) is set and a valid status code
if arbitration is lost while SI01 is in the master mode can be read from SlSTA. This status code is used to
(see status 68H and 78H); vector to an interrupt service routine and the appropriate
action to be taken for each of these status codes is de-
If the AA bit is reset during a transfer ,SI01 will return tailed in Table 12. The slave transmitter mode may also
a not acknowledge (logic 1) to SDA after the next re- be entered if arbitration is lost while SI01 is in the mas-
ceived data byte. While AA is reset, SI01 does not re- ter mode (see state BOH).
spond to its own slave address or a general call address.
If the AA bit is reset during a transfer, SIal will trans- set. To recover from a bus error, the STO flag must be
mit the last byte of the transfer and enter state COH or set and SI must be cleared. This causes SIal to enter
C8H. SIal is switched to the not addressed slave mode the 'not addressed' slave mode (a defined state) and to
and will ignore the master receiver if it continues the clear the STO flag (no other bits in SlCON are af-
transfer. Thus the master receiver receives all 1s as se- fected). The SDA and SCL lines are released (a STOP
rial data. While AA is reset, SIal does not respond to condition is not transmitted).
its own slave address or a general call address. How-
ever, the 12C bus is still monitored and address recogni- The Four SI01 Special Function Registers
tion may be resumed at any time by setting AA. This
means that the AA bit may be used to temporarily iso- The microcontroller interfaces to SIal via four special
late SIal from the I2C bus. function registers. These four SFR's (SlADR, SlDAT,
SlCON and SlSTA) are described individually in the fol-
Miscellaneous States lowing sections.
There are two SlSTA codes that do not correspond to a The Address Register, S1ADR
defined SIal hardware state (see Table 13). These are
discussed below. The CPU can read from and write to this 8-bit, directly
addressable SFR. SlADR is not affected by the SIal
SlSTA - F8H: hardware. The contents of this register are irrelevant
\Wen SIal is in a master mode. In the slave modes, the
This status code indicates that no relevant information is seven most significant bits must be loaded with the
available because the serial interrupt flag, SI is not yet microcontroller's own slave address and, if the least sig-
set. This occurs between other states and when SIal is nificant bit is set, the general call address (OOH) is rec-
not involved in a serial transfer. ognized; otherwise it is ignored.
The Data RegIster, SIDAT Serial data is shifted out from SlDAT via a buffer
(BSD7) on the falling edges of clock pulses on the SCL
SIDAT contains a byte of serial data to be transmitted line.
or a byte which has just been received. The CPU can
read from and write to this 8-bit, directly addressable When the CPU writes to SlDAT, BSD7 is loaded with
SFR while it is not in the process of shifting a byte. This the content of SlDAT.7 which is the first bit to be
occurs when SIOI is in a defined state and the serial in- transmitted to the SDA line (see Figure 32). After nine
terrupt flag is set. Data in SlDAT remains stable as serial clock pulses, the eight bits in SlDAT will have
long as SI is set. Data in SlDAT is always shifted from been transmitted to the SDA line and the acknowledge
right to left: the first bit to be transmitted is the MSB bit will be present in ACK. Note that the eight transmit-
(bit 7) and, after a byte has been received, the first bit ted bits are shifted back into SlDAT.
of received data is located at the MSB of SlDAT. While
data is being shifted out, data on the bus is simultane- The Control RegIster, SICON
ously being shifted in; SlDAT always contains the last
data byte present on the bus. Thus, in the event of lost The CPU can read from and write to this 8-bit, directly
arbitration, the transition from master transmitter to addressable SFR. The most significant bit is not used
slave receiver is made with the correct data in SlDAT. and a logic 1 will be returned if SlCON.7 is read. Two
bits are affected by the SIOI hardware: the SI bit is set
\<hen a serial interrupt is requested and the STO bit is
7 654 3 210 cleared \<hen a STOP condition is present on the I2C
SlDAT (DAH) ISD7ISD6ISD5ISD4ISDJISDZISDlISDOI bus. The STO bit is also cleared when ENSI = '0'.
~--- shift direction - - - - - 76543210
SlCON (D8H) I - @NSllsTAlsTOI SI I AA ICRllCROI
SD7 - SDO:
8-bits to be transmitted or just received. A logic 1 in ENS1, the SIOI Enable Bit
SlDAT corresponds to a high level on the I2C bus and a
ENSI = '0': \<hen ENSI is '0', the SDA and SCI.. out-
logic 0 corresponds to a low level on the bus. Serial da-
puts are in a high impedance state. SDA and SCI.. input
ta shifts through SlDAT from right to left. Figure 31
signals are ignored, SIOl is in the 'not addressed' slave
shows how data in SlDAT is serially transferred to and
state and the STO bit in SlCON is forced to '0'. No
from the SDA line.
other bits are affected. P1.6 and P1.7 may be used as
SlDAT and the ACK flag form a 9-bit shift register open drain 1/0 ports.
\<hich shifts in or shifts out an 8-bit byte, followed by an
acknowledge bit. The ACK flag is controlled by the SIOI ENSI - '1': \<hen ENSI is '1', SIOI is enabled. The
P1.6 and PI. 7 port latches must be set to logic 1.
hardware and cannot be accessed by the CPU. Serial
data is shifted through the ACK flag into SlDAT on the
ENS!. should not be used to temporarily release SIOI
rising edges of serial clock pulses on the SCL line.
from the I2C bus since, when ENS1 is reset, the I2C bus
When a byte has been shifted into SlDAT, the serial da-
status is lost. The AA flag should be used instead (see
ta is available in SlDAT and the acknowledge bit is re-
description of the AA flag in the following text).
turned by the control logic during the ninth clock pulse.
In the following text, it is assumed that ENSI = '1'.
SOA
SCl
SHIFT PULSES
SOA 07 De 05 04 03 02 01 DO
SCc
BS01 07 06 05 04 03 02 01 DO III
STA, the START Flag ter mode (in a slave mode, SIal generates an internal
STOP condition which is not transmitted). SIal then
STA = '1': when the STA bit is set to enter a master transmits a START condition.
mode the SIal hardware checks the status of the 12C
bus and generates a START condition if the bus is free. STO = '0': when the STO bit is reset, no STOP condi-
If the bus is not free, then SIal waits for a STOP condi- tion will be generated.
tion (which will free the bus) and generates a START
condition after a delay of a half clock period of the in- SI, the Serial Interrupt Flag
ternal serial clock generator.
SI = '1': when the SI flag is set, then, if the EA and
If STA is set while SIal is already in a master mode ES1 (interrupt enable register) bits are also set, a serial
and one or more bytes are transmitted or received, SIal interrupt is requested. SI is set by hardware when one of
transmits a repeated START condition. STA may be set 25 of the 26 possible SIal states is entered. The only
at any time. STA may also be set when SIal is an ad- state that does not cause SI to be set is state F8H which
dressed slave. indicates that no relevant state information is available.
STA = '0': when the STA bit is reset, no START condi- While SI is set, the low period of the serial clock on the
tion or repeated START condition will be geuerated. SCL line is stretched and the serial transfer is sus-
pended. A high level on the SCL line is unaffected by
STO, the STOP Flag the serial interrupt flag. SI must be reset by software.
STO = '1': when the STO bit is set while SIal is in a SI = '0': when the SI flag is reset, no serial interrupt is
master mode, a STOP condition is transmitted to the 12C requested and there is no stretching of the serial clock
bus. When the STOP condition is detected on the bus, on the SCL line.
the SIal hardware clears the STO flag. In a slave
mode, the STO flag may be set to recover from an error AA, the Assert Acknowledge Flag
condition. In this case, no STOP condition is transmitted
to the 12C bus. However, the. SIal hardware behaves as AA = '1': if the AA flag is set, an acknowledge (low
if a STOP condition has been received and switches to level to SDA) will be returned during the acknowledge
the defined 'not addressed' slave receiver mode. The clock pulse on the SCL line when:
STO flag is automatically cleared by hardware. -the 'own slave address' has been received
-the general call address has been received while the
If the STA and STO bits are both set, then a STOP con- general call bit (GC) in SlADR is set
dition is transmitted to the 12C bus if SIal is in a mas-
-a data byte has been received while SIal is in the The Status Register, SISTA
master receiver mode
-a data byte has been received while SIal is in the ad- SlSTA is an 8-bit read-only special function register.
dressed slave receiver mode The three least significant bits are always zero. The five
most significant bits contain the status code. There are
AA = '0': if the AA flag is reset, a not acknowledge 26 possible status codes. When SlSTA contains FSH, no
(high level to SDA) will be returned during the acknowl- relevant state information is available and no serial in-
edge clock pulse on SCL when: terrupt is requested. All other SlSTA values correspond
-a data has been received while SIal is in the master to defined SIal states. When each of these states is en-
receiver mode tered, a serial interrupt is requested (SI = '1'). A valid
-a data byte has been received while SIal is in the status code is present in SlSTA one machine cycle after
addressed slave receiver mode SI is set by hardware and is still present one machine
cycle after SI has been reset by software.
When SIal is in the addressed slave transmitter mode,
state C8H will be entered after the last serial is trans- Some Special Cases
mitted (see Figure 30). When SI is cleared, SIal leaves
state C8H, enters the not addressed slave receiver mode The SIal hardware has facilities to handle the following
and the SDA line remains at a high level. In state C8H, special cases that may occur during a serial transfer:
the AA flag can be set again for future address
recognition. Simultaneous Repeated START Conditions
from 2 Masters
When SIal is in the not addressed slave mode, its own
slave address and the general call address are ignored. A repeated START condition may be generated in the
Consequently, no acknowledge is returned and a serial master transmitter or master receiver modes. A special
interrupt is not requested. Thus, SIal can be temporar- case occurs if another master simultaneously generates a
ily released from the I2C bus while the bus status is repeated START condition (see Figure 33). Until this
monitored. While SIal is released from the bus, START occurs, arbitration is not lost by either master since they
and STOP conditions are detected and serial data is were both transmitting the same data.
shifted in. Address recognition can be resumed at any
time by setting the AA flag. If the AA flag is set when If the SIal hardware detects a repeated START condi-
the part's own slave address or the general call address tion on the I2C bus before generating a repeated START
has been partly received, the address will be recognized condition itself, it will release the bus and no interrupt
at the end of the byte transmission. request is generated. If another master frees the bus by
generating a STOP condition, SI01 will transmit a nor-
CRO and CR1, the Clock Rate Bits mal START condition (state OSH) and a retry of the to-
tal serial data transfer can commence.
These two bits determine the serial clock frequency when
SIal is in a master mode. The various serial rates are Data Transfer After Loss of Arbitration
shown in Table 14.
Arbitration may be lost in the master transmitter and
A 12.5kHz bit rate may be used by devices that interface master receiver modes (see Figure 25). Loss of arbitra-
to the 12C bus via standard I/O port lines which are tion is indicated by the following states in SlSTA: 3SH,
software driven and slow. 100kHz is usually the maxi- 6SH, 78H and BOH (see Figures 27 and 2S).
mum bit rate and can be derived from a 12MHz oscilla-
tor or a 6MHz oscillator. A variable bit rate (0.5kHz to If the STA flag in SlCON is set by the routines which
62.5kHz) may also be used if Timer 1 is not required for service these states, then, if the bus is free again, a
any other purpose while SIal is in a master mode. START condition (state OSH) is transmitted without in-
tervention by the CPU and a retry of the total serial
The frequencies shown in Table 14 are unimportant when transfer can commence.
SIal is in a slave mode. In the slave modes, SIal will
automatically synchronize with any clock frequency up to
100kHz.
Forced Access to the I2C bus 12C Bus Obstructed by a Low Level on SCL or SDA
In some applications, it may be possible for an un- An 12C bus hang-up occurs if SDA or SCL is pulled
controlled source to cause a bus hang-up. In such situ- LOW by an uncontrolled source. If the SCL line is ob-
ations, tl,e problem may be caused by interference, tem- structed (pulled LOW) by a device on the bus, no further
porary interruption of the bus or a temporary short- serial transfer is possible and the SIal hardware cannot
circuit between SDA and SCL. resolve this type of problem. When this occurs, tllC prob-
lem must be resolved by tlw device that is pulling the
If an uncontrolled source generates a superfluous SCL bus line LOW.
START or masks a STOP condition, then tl,e I2C bus
stays busy indefinitely. If the STA flag is set and bus ac- If the SDA line is obstructed by another device on the
cess is not obtained within a reasonable amount of time, bus (e.g. a slave device out of bit synchronization), the
then a forced access to the 12C bus is possible. 11,is is problem can be solved by transmitting additional clock
achieved by setting the STO flag while the STA flag is pulses on the SCL line (see Figure 35). The SIal hard-
still set. No STOP condition is transmitted. The SIal ware transmits additional clock pulses when he STA flag
hardware behaves as if a STOP condition was received is set but no START condition can be generated because
and is able to transmit a START condition. The STO tl,e SDA line is pulled LOW while the 12C bus is con-
flag is cleared by hardware (see Figure 34). sidered free. The SIal hardware attempts to generate a
STAflag
I time limit
~---------l.-------------------
"I
STA flag
-.J !(21 ! (31
START condition
Figure 35. Recovering from a Bus Obstruction Caused by a Low Level on SDA
START condition after every two additional clock pulses -The 26 state service routines for the
on the SCL line. When the SDA line is eventually re- -master transmitter mode
leased, a normal START condition is transmitted, state -master receiver mode
08H is entered and the serial transfer continues. -slave receiver mode
-slave transmitter mode
If a forced bus access occurs or a repeated START
condition is transmitted while SDA is obstructed (pulled Initialization
LOW), the SI01 hardware performs the same action as
described above. In each case, state 08H is entered af- In initialization routine, SI01 is enabled for both master
ter a successful START condition is transmitted and and slave modes. For each mode, a number of bytes of
normal serial transfer continues. Note that the CPU is internal data RAM are allocated to the SIO to act as ei-
not involved in solving these bus hang-up problems. ther a transmission or reception buffer. In this example
8 bytes of internal data RAM are reserved for different
Bus Error purposes. The data memory map is shown in Figure 36.
The initialization routine performs the following func-
A bus error occurs when a START or STOP condition is tions:
present at an illegal position in the format frame. Ex-
amples of illegal positions are during the serial transfer -SlADR is loaded with the part's own slave address and
of an address byte, a data or an acknowledge bit. the general call bit (GC)
-Pl.6 and Pl.7 bit latches are loaded with logic Is
The SIOI hardware only reacts to a bus error when it is -Ram location HADD is loaded with the high order
involved in a serial transfer either as a master or an ad- address byte of the service routines
dressed slave. When a bus error is detected, SIOI im- -The SIOI interrupt enable and interrupt priority bits
mediately switches to the not addressed slave mode, re- are set
leases the SDA and SCL lines, sets the interrupt flag -The slave mode is enabled by simultaneously setting
and loads the status register with OOH. This status code the ENSI and AA bits in SlCON and the serial clock
may be used to vector to a service routine which either frequency (for master modes) is defined by loading
attempts the aborted serial transfer again or simply re- CRO and CRI in SlCON. The master routines must be
covers form the error condition as shown in Table 13. started in the main program.
Software Examples of SIOl Service Routines The SIOI hardware now begins checking the 12C bus for
its own slave address and general call. If the general
This section consists of a software example for: call or the own slave address is detected, an interrupt is
requested and SlSTA is loaded with the appropriate
- Initialization of SIOI after a RESET state information. The following text describes a fast
-Entering the SIOI interrupt routine method of branching to the appropriate service routine.
1 1
SlADR I GC DB
SlOAT DA
SlSTA I 0 I 0 I 0 09
SlCON X 1 ENSl I STA I STO I SI I AA I CRl I CRO 08
1
BACKUP ORIGINAL VALUE OF NUMBYTMST 53
NUMBYTMST NUM8ER OF BYTES AS MASTER 52
SLA SLA+R/W TO BE TRANSMITTED TO SLA 51
HADD HIGHER ADDRESS BYTE INTERRUPT ROUTINE 50
1
4F
SLAVE TRANSMITTER OATA RAM
STD r_________________________________ ~T4B
1
MRD _
MASTER RECEIVER DATA RAM 1
T 38
IT : [:
_________________________~Too
~
SI01 Interrupt Routine 28. In the example below, 4 bytes are transferred. There
is no repeated START condition. In the event of lost ar-
When the SI01 interrupt is entered, the PSW is first bitration, the transfer is restarted when the bus becomes
pushed on the stack. Then SlSTA and HADD (loaded free. If a bus error occurs, the I2C bus is released and
with the high order address byte of the 26 service rou- SI01 enters the not selected slave receiver mode. If a
tines by the initialization routine) are pushed on to the slave device returns a not acknowledge, a STOP condi-
stack. SlSTA contains a status code which is the lower tion is generated.
byte of one of the 26 service routines. The next instruc-
tion is RET which is the return from subroutine instruc- A repeated START condition can be included in the se-
tion. When this instruction is executed, the high and low rial transfer if the STA flag is set instead of the STO
order address bytes are popped from stack and loaded flag in the state service routines vectored to by status
into the program counter. codes 28H and 58H. Additional software must be written
to determine which data is transferred after a repeated
The next instruction to be executed is the first instruc- START condition.
tion of the state service routine. Seven bytes of program
code (which execute in eight machine cycles) are re- Slave Transmitter and Slave Receiver Modes
quired to branch to one of the 26 state service routines.
After initialization, SI01 continually tests the 12C bus
SI PUSH PSW Save PSW and branches to one of the slave state service routines if
PUSH SISTA Push status code it detects its own slave address or the general call ad-
(low order address byte) dress (see Table 11, Table 12, Figure 29, and Figure
PUSH HADD Push high order address 30). If arbitration was lost while in the master mode, the
master mode is restarted after the current transfer. If a
byte
bus error occurs, the 12C bus is released and SI01 en-
RET Jump to state service ters the not selected slave receiver mode.
routine
In the slave receiver mode, a maximum of 8 received
The state service routines are located in a 256-byte page data bytes can be stored in the internal data RAM. A
of program memory. The location of this page is defined maximum of 8 bytes ensures that other RAM locations
in the initialization routine. The page can be located any- are not overwritten if a master sends more bytes. If
where in program memory by loading data RAM register more than 8 bytes are transmitted, a not acknowledge is
HADD with the page number. Page 01 is chosen in this returned and SI01 enters the not addressed slave re-
example and the service routines are located between ceiver mode. A maximum of one received data byte can
addresses OlOOH and 01FFH. be stored in the internal data RAM after a general call
address is detected. If more than one byte is transmitted,
The State Service Routines
a not acknowledge is returned and SI01 enters the not
addressed slave receiver mode.
The state service routines are located 8 bytes from each
other. 8 bytes of code are sufficient for most of the serv-
In the slave transmitter mode, data to be transmitted is
ice routines. A few of the routines require more than 8
obtained from the same locations in the internal data
bytes and have to jump to other locations to obtain more
RAM that were previously loaded by the main program.
bytes of code. Each state routine is a part of the SI01
After a not acknowledge has been returned by a master
interrupt routine and handles one of the 26 states. It
receiver device, SI01 enters the not addressed slave
ends with a RETI instruction which causes a return to
mode.
the main program.
Adapting the Software for Different Applications
Master Transmitter and Master Receiver Modes
The following software example shows the typical struc-
The master mode is entered in the main program. To
ture of the interrupt routine including the 26 state serv-
enter the master transmitter mode, the main program
ice routines and may be used as a base for user applica-
must first load the internal data RAM with the slave ad-
tions. If one or more of the four modes are not used, the
dress, data bytes and the number of data bytes to be
associated state service routines may be removed but
transmitted. To enter the master receiver mode, the
care should be taken that a deleted routine can never be
main program must first load the internal data RAM
invoked.
with the slave address and the number of data bytes to
be received. The RlW bit determines whether SI01 op- This example does not include any time-out routines. In
erates in the master transmitter or master receiver the slave modes, time-out routines are not very useful
mode.
since, in these modes, SI01 behaves essentially as a
passive device. In the master modes, an internal timer
Master mode operation commences when the STA bit in
may be used to cause a time-out if a serial transfer is
SlCION is set by the SETB instruction and data transfer
not complete after a defined period of time. This time
is controlled by the master state service routines in ac-
period is defined by the system connected to the 12C bus.
cordance with Table 9, Table 10, Figure 27 and Figure
!***********************************************************
1 SIOl EQUATE LIST
1***********************************************************
!***********************************************************
1 LOCATIONS OF THE SIOl SPECIAL FUNCTION REGISTERS
1***********************************************************
0008 SlCON -oxd8
0009 SlSTA -Oxd9
OOOA SlDAT -Oxda
000& SlADR -Oxdb
00A8 IENO -axa8
00&8 IPO -Oxb8
1***********************************************************
I&IT LOCATIONS
1***********************************************************
OODD STA -Oxdd ISTA bit in SlCON
OO&D SIOIHP -oxbd IIPO, SIOl Priority bit
1***********************************************************
!IMMEDIATE DATA TO YRITE INTO REGISTER SICON
1***********************************************************
00D5 ENSI NOTSTA STO NOTSI AA CRO -Oxd5 !Genearates STOP
- - - - - ! (CRa-lOO Khz)
00C5 ENSl_NOTSTA_NOTSTO_NOTSI_AA_CRO -Oxe5 !Releases SUS and
!ACK
OOCl !Releases SUS and
!NOT ACK
00E5 -Oxe5 IRelease SUS and
Iset STA
1***********************************************************
IGENERAL IMMEDIATE DATA
1***********************************************************
0031 OWNSLA -Ox31 IOwn SLA+Cenerall Call
Imust be written into SlADR
OOAO ENSIOI -OxaO !EA+ESl, enable SIOl interrupt
lmust be written into IENO
0001 PAGI -ax01 Iseleet PAGI as HADD
OOCO SLAW -oxeO ISLA+W to be transmitted
OOCl SLAR -oxel ISLA+R to be transmitted
0018 SElJtB3 -ox18 ISeleet Register Rank 3
1***********************************************************
ILOCATIONS IN DATA RAM
!***********************************************************
0030 HTD -Ox30 !KST/TRX/DATA base address
0038 KRD -Ox38 IKST/REC/DATA base address
0040 SRD -Ox40 ISLV/REC/DATA bas. address
0048 STD -Ox48 ISLV/TRX/DATA bas. address
0053 MCKUP -Ox53 I&aekup from NUHBYTHST.
!To restore NUKBYTHST in case
!of an Arbitration Lost.
0052 NUHBYTHST-Ox52 !Number of bytes to transmit
lor receive as KST.
0051 SLA -Ox5l IContains SLA+R/W to be
I transmitted.
0050 HADD -Ox50 IHigh Address byte for STATE 0
!till STATE 25.
1******************************·········********************
IINITIALISATION ROUTINE
IExample to initialize IIC Interface as slave receiver or
Islave transmitter and start a KASTER TRANSMIT or a KASTER
IRECEIVE function. 4 bytes will be transmitted or received.
I*********************************~*********************
.sect strt
.base OXOO
0000 4100 ajmp INIT I RESET
.sect initial
.base Ox200
0200 75DB31 INIT: mov SlADR,tI'OWNSLA I Load own SLA + enable
Igeneral call recognition
0203 D296 setb pl(6) IPl.6 High level.
0205 D297 setb pl(7) IPl.7 High level.
0207 755001 mov HADD,.PAGI
020A 43A8AO orl IENO,.ENSIOI !Enable 5101 interrupt
020D C2BD clr SIOIHP 15101 interrupt low
Ipriority
020F 75D8C5 mov SlCON,"'ENSl NOTSTA NOTSTO NOTSI AA CRO
- - IInitlalize-SLV funct.
1************************************************************
! •••....••.•.•.•.•••••••••••••••.•••••••.•...••••••.••••.•...
!START KASTER TRANSMIT FUNCTION
I· .......................................................... .
!~""""*************************************************
! SIOl INTERRUPT ROUTINE
!***********************************************************
.sect intvec
.base Ox2b !SIOl interrupt vector
!SlSTA and HADD are pushed onto the stacK. They serve as
!return address for the RET instruction.
!The RET instruction sets the Program Counter to address
!HADD,SlSTA and jumps to the rigth subroutine.
!-----------------------------------------------------------
! STATE: 00, Bus error.
! ACTION: Enter not adressed SLV aode and release bus.
! STO reset.
!-----------------------------------------------------------
.sect stO
.base OxlOO
1***********************************************************
1*********************········******************************
IKASTER STATE SERVICE ROUTINES
1***********************************************************
IState 08 and State 10 are both for KST/TRX and KSTjREC.
IThe R/W bit decides whether the next state 1s within
IKST/TRX mode or within KSTjREC mode.
1********········*******************************************
I ..................•..•.•.........•....•....................
I STATE: 08, A START condition ha. been transmitted.
I ACTION: SLA+R/W are transmitted, ACK bit is received.
I·····················································".'"
.• ect at.8
.bue Oxl08
t····················································· ..... .
I STATE: 10, A repe.ted START condition has been
I transmitted.
I ACTION: SLA+R/W are transmitted, ACK bit 1s received.
! ....... - .................................................. ,
.• ect mUlO
.base Ox110
.• ect ibase1
.base OxaO
OOAO 750018 INITBASE1: mov psw,_SEUU!3
00A3 7930 mov rl,_KTD
00A5 7838 aov rO,_KRO
00A7 855253 mov BACKUP, NUKBYTHST ISave initial value
OOAA DODO pop psw
OOAC 32 ret!
1················································_···· ..... .
I STATE: 28. DATA of SlDAT have been transmitted
I ACK received.
ACTION: If Transmitted DATA i. last DATA then
transmit a STOP condition, else transmit
I next DATA.
I····················································· ..••..
. sect mt.28
.base Ox128
0128 D55285 djnz NUMBYTMST.NOTLDATl IJMP if NOT last DATA
0128 75D8D5 mov SlCON._ENSl NOTSTA STO NOTSI AA CRO
- - -Iclr SI.-set AA
012E 0189 ajmp RETmt
.sect mts28sb
.base OxObO
0080 75D018 NOTLDATl: mov psw._SELRB3
0083 87DA 1I0V SlDAT.@rl
0085 75D8C5 CON: mov SlCON._ENSl NOTSTA NOTSTO NOTSI AA CRO
- - !clr SI.-elr AA
0088 09 inc rl
0089 DODO RETmt pop psw
0088 32 retl
1-----------------------------------------------------------
STATE: 38, Arbitration lost in SLA+W or OATA.
ACTION: Bus is released, not adressed SLV mode is
entered. A new START condition is transmitted
when the lIC bus is free again. .
1-----------------------------------------------------------
.sect mta38
.base Ox138
1***********************************************************
!***********************************************************
!MASTER RECEIVER STATE SERVICE ROUTINES
1***********************************************************
!***********************************************************
1-----------------------------------------------------------
STATE : 40, Previoua state was STATE 08 or STATE 10,
SLA+R have been transmitted, ACK received.
I ACTION: OATA will be received, ACK returned.
1-----------------------------------------------------------
.sect mrs40
.base Ox140
••ect an501
.ba.e OxcO
OOCO 055205 REC1: djnz NUKBYTKST,NOTLDAT2
00C3 7508Cl aov SlCON,.ENSl NOT5TA NOTSTO NOTSI NOTAA CRO
- - !clr 5I,M -
00C6 8003 Ijap RETllr
00C8 7508CS NOTLDAT2: aov SlCON,IJEN51 NOTSTA NOT5TO NOTSI AA CRO
- - !crr SI,-set AA
OOCB 08 RETIIr: inc rO
OOCC DODO pop paw
OOCE 32 reti
I····················································· ..•.••
I STATE: 68, Abitratlon lost in SLA and R/W as MST
Own SLA+W have been received, ACK returned
ACTION: DATA will be received and ACK returned.
STA 1s set to restart MST mode after the
I bus is free again.
I···············~-············--------·---···-···--··- ..... .
. aect srs68
.baae Ox168
0168 7508E5 mov SlCON ,ilIENSl STA NOTSTO ROTSI AA eRO
016B 750018 mov psw,ilISElJt.B3- - - --
016E 0100 ajmp INITSRD
! ......•...•......•...•..•••••••.• __ ... _.........••...•.....
STATE : 70, General call has been received, ACK
returned.
ACTION: DATA will be received and ACK returned.
! .............................. _---_ .•...............•......
. sect sra70
.base Ox170
0170 7508C5 mov SlCON,ilIENSl NOTSTA NOTSTO NOTSI AA CRO
- - Iclr SI, iet-AA
0173 750018 mov psw,ilISElJt.B3 IInitialize SRD counter
0176 0100 ajmp INITSRD
I································---·--··-····~······· ..... .
STATE: 78, Arbitration lost in SLA+R/W as MST.
eeneral call has been received, ACK returned ..
ACTION: DATA will be received and ACK returned.
STA is set to restart KST mode after the
I bus is free again.
1·································_·······_··········· ..... .
• sect sra78
.base Oxl78
0178 7508E5 mov SlCON,ilIENSl_STA_NOTSTO_NOTSI_AA_CRO
017B 750018 mov psw,ilISElJt.B3 IInitialize SRD counter
017E 0100 ajmp INITSRO
February 1989 2-90
Signetics Microprocessor Products User's Guide
1-----------------------------------------------------------
ISTATE : SS, Previously .dr••••d with own SLA.
I DATA r.c.iv.d NOT ACK r.turned.
ACTION: No ••v. of DATA, Enter NOT .dr••••d SLV
aode. R.cognition of own SLA. G.ner.l c.ll
I r.cogniz.d, if SlADR.G-l.
1-----------------------------------------------_··----.--..
.••ct .r.SS
.b••e OX18S
1·_··································-···············-.-.".
I STATE : AD, A STOP condition or r.p•• t.d START has
I b•• n r.ceiv.d, while still .dr••••d as
I SLV/llEC or SLV/TRX.
, ACTION: No ••ve of DATA, Enter lOT .drea.ed SLV
I .od•. Recognition of own SLA. a.nera1 call
I recoanized, if SlADR.G-l.
1-··············· __ ·················-··_··········_··· ..... .
••• ct .rsAO
.base Ox1aO
OlAO 75D8C5 aov SlCON, _ERSI NOTSTA NOTSTO NOTSI AA eRO
- - IClr SI: .et M
OlA3 DODO pop psw
OlA5 32 ret!
... ct ib.. e2
.base Oxe8
00E8 75D018 INITBASE2: IDOV psv,_SELR.B3
OOEll 7948 IDOV rl, _STD
OOED 09 inc rl
OOEE DODO pop psv
OOFO 32 retl
1-----------------------------------------------------------
STATE: BO, Arbitration lost in SlA and RfW as KST.
Own SlA+R received, ACK returned.
ACTION: DATA viII be transmitted, A bit received.
STA is set to restart KST mode after the
I bus is free again.
1-----------------------------------------------------------
.sect stsbO
.ba.e OxlbO
OlIO 8548DA IDOVSlDAT,STD !load DATA in SlOAT
OlB3 7SD8E5 IDOVSICON,_ENSl STA NOTSTO NOTSl AA CRO
OlB6 01E8 ajmp INITBASE2 - - - --
1-----------------------------------------------------------
I STATE: B8, DATA ha. been tran.aitted,ACK received.
I ACTION: DATA viII be tran.mitted. ACK bit is received.
1-- -- - - - - -- -- -- - - - - - -- - - -- - -- -- -- - -- - - - - - - - - - - -- - - - - - - - - - - --
.• ect stsb8
.base Oxlb8
.sect sen
.base Oxf8
00F8 75D8C5 SCON: mov SlCON •• ENSl NOTSTA NOTSTO NOTSI AA CRO
- - - Iclr SI, set AA
OOFB 09 inc rl
OOFC DODO pop psv
OOFE 32 retl
I···········~········································· ..... .
I STATE: ca. La.t DATA b •• b ••n tr.naaltt.d (AA-o).
I ACK r.c.lv.d.
I ACTION: Ent.r not .dr•••• d SLV mode.
I.· .... ·· .. ·· ... · .•• • .••• ·.· .. ··· ...... ··•· ... ····.··· ..... .
.•• ct .ue8
.b••• OxleS
OlC8 7508C5 aov SlCON ,«lENS 1 NOTSTA NOTSTO NOTSI AA CRO
- - - I elr 51, •• t AA
OlC! 0000 pop p.w
OICO 32 uti
1**************···*·*·**···**······*·**··***·*···***********
lEND OF 5101 INTERRUPT ROUTINE
1***··*··*·*·*·***·**·*·***····****·************************
1************"*******************************'*************
--
sources source enable global enable registers
-
polling hardware
r--
INTO EXTERNAL ~r- ,I ,I
INTERRUPT
REQUEST 0 "- I' "0- r- ,2 bl
r-
12C ~ r- bl
cl
SERIAL dl
PORT
f-- " I'
~ r- b2 01
AOC
- 0- cl
11
f--
"" I'
~- c2
91
TIMER 0
..... ,... - 0- dl hI
OVERFLOW
r-- -=::
-
-
d2 ;]
high
pnoritv
interrupt
TIMER 2
...... ,... 0- 01 jl request
~-
CAPTURE 0 02 k1
f-- 11
TIMER 2
,... - 0- 11
ml
~ --
COMPARE 0
"' 12
- f-- n1
INT1 EXTERNAL
INTERRUPT ...... ,... 0- 91 01
---- vector
REOUEST 1
r-- ~ -- 0-
92
hI
SOURCE
IDENTIFICATION
TIMER 2
CAPTURE 1
-- ,... 1 "0- - h2
r-- ,2
TIMER 2
,... -0- ;1
b2
~ --
COMPARE 1
:---
" ,2 c2
TIMER 1 0- jl d2
1 "0- -
OVERFLOW
"'
r--
I" j2 02
TIMER 2 0-
- kl
12
92
CAPTURE 2
"- 1"0- i-- k2
TIMER 2
COMPARE 2
r-
...... ,... 0-
-- 11
h2
;2 low
priority
-
12
I-- 1"0- j2 interrupt
UART I T request
t'-.. ,... 0- ml k2
SERIAL 1--
V ......
~ r- n 1
PORT I R i-- m2 12
r-- m2
TIMER 2
CAPTURE 3 ...... ,... 1
0-
"0- r- n2
n2
r-- 02
TIMER T2 t'....
......
0- r - 01 ----SOURCE
vector
OVERFLOW V
-" -
Figure 39. The Interrupt System
----"o-r- 02 IDENTIFICATION
The SI01 (12C) interrupt is generated by the SI flag in Bit Symbol Functioa
the SIOI control register (SlCON). This flag is set when
SlSTA is loaded with a valid status code.
lEN 1.7 En Enable n overllow intelTUpt(s)
lEN 1.6 ECM2 Enable n comparator 2 interrupt
lEN 1.5 ECMI Enable n comparator I interrupt
The ADCI flag may be reset by' software. It cannot be lEN 1.4 ECMO Enable n comparator 0 interrupt
set by software. All other flags that generate interrupts IENl.3 ECT3 Enable n capture register 3 intelTUpt
may be set or cleared by software and the effect is the lEN 1.2 ECT2 Enable n capture register 2 interrupt
same as setting or resetting the flags by hardware. Thus, IENl.l ECTI Enable n capture register I interrupt
interrupts may be generated by software and pending in- lEN 1.0 ECTO Enable n capture register 0 interrupt
terrupts can be cancelled by software.
In all cases, if the enable bit is '0', then the interrupt is disabled and
Interrupt Enable Registers if the enable bit is 'I', then the interrupt is enabled.
Each interrupt source can be individually enabled or dis- Figure 41. Interrupt Enable Register (lENt)
abled by setting or clearing a bit in the interrupt enable
special function registers IENO and IEN1. All interrupt 7 6 4 o
sources can also be globally enabled or disabled by set-
ting or clearing bit EA in IENO. The interrupt enable
registers are described in Figures 40 and 41.
MSB LSB
Interrupt Priority Structure
Bit Symbol Function
Each interrupt source can be assigned one of two prior-
ity levels. Interrupt priority levels are defined by the in- IP.7 Unused
terrupt priority special function registers IPO and IP1. IP.6 PAD AOC intelTUpt priority level
IPO and IP1 are described in Figure 42 and 43. IP.5 PS I SIO I (lle) intelTUpt priority level
IP.4 PSO Sioo (UART) interrupt priority level
Interrupt priority levels are as follows: 1P.3 PTI Timer I interrupt priority level
'0' - low priority IP.2 PX I External interrupt I priority level
'1' - high priority IP.I PTO Timer 0 interrupt priority level
IP.O PXO External interrupt 0 priority level
6 4 o
IENO (ASH) I I IESI I IETI IEXI I I I
EA EAD ESO ETC EXO
Figure 42. Interrupt Priority Register (lPO)
MSB LSB
A low priority interrupt may be interrupted by a high blocking condition is removed, then the blocked interrupt
priority interrupt. A high priority interrupt cannot be in- will not be serviced. Thus, the fact that the interrupt flag
terrupted by any other interrupt source. If two requests was once active but not serviced is not remembered.
of different priority occur simultaneously, the high prior- Every polling cycle is new.
ity level request is serviced. If requests of the same pri-
ority are received simultaneously, an internal polling se- The processor acknowledges an interrupt request by exe-
quence determines which request is serviced. Thus, with- cuting a hardware-generated LCALL to the appropriate
in each priority level, there is a second priority structure service routine. In some cases it also clears the flag
determined by the polling sequence. This second priority which generated the interrupt, and in others it does not.
structure is shown in Table 15. It clears the Timer 0, Timer 1 and external interrupt
flags. An external interrupt flag (lEO or lEI) is cleared
Table IS. Interrupt Priority Structure only if it was transition-activated. All other interrupt
flags are not cleared by hardware and must be cleared
Source Name Priority Within Level by the software. The LCALL pushes the contents of the
External interrupt 0 XO (highest) program counter on to the stack (but it does not save the
SIOl (I2C) Sl PSW) and reloads the PC with an address that depends
ADC completion ADC on the source of the interrupt being vectored to as shown
Timer 0 overflow TO in Table 16.
1'2 capture 0 em Table 16. Interrupt Vector Addresses
1'2 compare 0 CMO
External interrupt I XI Source Name Vector Address
1'2 capture I CTI
1'2 compare I CMI External interrupt 0 XO 0003H
Timer I overflow TI Timer 0 overflow TO OOOBH
1'2 capture 2 CT2 External interrupt I Xl OOI3H
1'2 compare 2 CM2 Timer I overflow TI OOIBH
SIOO{UART) SO SIOO(UART) SO 0023H
1'2 capture 3 CT3 SIDI (l2C) SI 002BH
Timer 1'2 overflow T2 (lowest) 1'2 capture 0 cro 0033H
The above Priority Within Level structure is only used 1'2 capture I cn 003BH
when there are simultaneous requests of the same prior- 1'2 capture 2 CT2 0043H
ity level. 1'2 capture 3 cn 004BH
ADC completion ADC 0053H
Interrupt Handling 1'2 compare 0 CMO 005BH
1'2 compare I CMl 0063H
The interrupt sources are sampled at S5P2 of every ma- 1'2 compare 2 CM2 006BH
chine cycle. The samples are polled during the following 1'2 overflow 1'2 0073H
machine cycle. If one of the flags was in a set condition
at S5P2 of the previous machine cycle, the polling cycle
will find it and the interrupt system will generate an
LCALL to the appropriate service routine, provided this
hardware generated LCALL is not blocked by any of the
following conditions:
Execution proceeds from the vector address until the
l.An interrupt of higher Or equal priority level is already RET! instruction is encountered. The RETI instruction
in progress. clears the 'priority level active' flip-flop that was set
2. The current machine cycle is not the final cycle in the when this interrupt was acknowledged. It then pops the
execution of the instruction in progress. (no interrupt top two bytes from the stack and reloads the program
request will be serviced until the instruction in counter. Execution of the interrupted program continues
progress is completed). from where it was interrupted.
3. The instruction in progress is RETI or any access to
the interrupt priority or interrupt enable registers. (No 110 PORT STRUCTURE
interrupt will be serviced after RETI or after a read
or write to IPO, IP1, lEO, or lEI until at least one The 83C552 has six 8-bit ports. Each port consists of a
other instruction has been subsequently executed). latch (special function registers PO to P5), an input buff-
er and an output driver (Port 0 to 4 only). Ports 0-3 are
The polling cycle is repeated with every machine cycle, the same as in the 80C51, with the exception of the ad-
and the values polled are the values present at S5P2 of ditional functions of Port l. The parallel I/O function of
the previous machine cycle. Note that if an interrupt flag Port 4 is equal to that of Ports 1, 2 and 3. Port 5 may
is active but is not being responded to because of one of be used as an input port only.
the above conditions, and if the flag is inactive when the
Figure 44 shows the bit latch and liD buffer functional PORT 1 OPERATION
diagrams of the unique 83C552 ports. A bit latch corre-
sponds to one bit in a port's SFR and is represented as Port 1 operates the same as it does in the 8051 with the
a D Type flip-flop. A 'write to latch' signal from the exception of port lines Pl.6 and Pl.7 which may be se-
CPU latches a bit from the internal bus and a 'read lected as the SCL and SDA lines of serial port SI01
latch' signal from the CPU places the Q output of the (I2C). Because the I2C bus may be active while the de-
flip-flop on the internal bus. A 'read pin' signal from vice is disconnected from VDD, these pins are provided
the CPU places the actual port pin level on the internal with open drain drivers. Therefore pins P1.6 and Pl.7 do
bus. Some instructions that read a port read the actual not have internal pull-ups.
port pin levels and other instructions read the latch
(SFR) contents.
READ ALTERNATE
LATCH DUTPUT
READ FUNCTION
LATCH
INTIUS
'NT BUS
WRITETD
LATCH
WA,TE TO
LATCH
READ"N
ALTERNATE
INPUT REAO"N
FUNCTION ALTERNATE
(a) INPUT
FUNCTION
NOlE:
Pull-up not present on P1.6 and P1.7. (b)
'Two period active pull-up as in the 8OC51.
SET FROM
ALTERNATE
READ FUNCTION
LATCH
~
INTIUS P5.X
INT. IUS . PIN
READ"N
WRITE TO
LATCH TOADC
(d)
READ PIN
(c)
...z
,.'"....z'"
~
When a compare register (PWMO or PWMl) is loaded alog power supplies are connected via separate input
with a new value, the associated output is updated imme- pins. The conversion takes 50 machine cycles i.e. SOIlS
diately. It does not have to wait until the end of the cur- at an oscillator frequency of 12MHz. Input voltage swing
rent counter period. Both PWMn output pins are driven is from OV to + 5V. Because the internal DAC employs
by push-pull drivers. These pins are not used for any a ratiometric potentiometer, there are no discontinuities
other purpose. in the converter characteristic. Figure 46 shows a func-
tional diagram of the analog input circuitry.
Prescaler frequency control register PWMP
Analog-to-Digital Conversion
PWMP(FEH) 171615141312110 Figure 47 shows the elements of a successive approxima-
MSB LSB tion (SA) ADC. The ADC contains a DAC which con-
PWMP.O-7 Prescaler division factor - PWMP + 1. verts the contents of a successive approximation register
to a voltage (VDAC) which is compared to the analog
Reading PWMP gives the current reload value. The ac- input voltage (Vin). The output of the comparator is fed
tual count of the prescaler cannot be read. to the successive approximation control logic which con-
trols the successive approximation register. A conversion
is initiated by setting ADCS in the ADCON register.
PWMO (FCH)
PWMI (FDH) 7I I I I I I
MSB
6 5 4 3 2 1 0
LSB
I ADCS can be set by software only or by either hardware
or software
PWMO/1.0-7} Low/high ratio of PWMn = The software only start mode is selected when control bit
ADCON.5 (ADEX) = O. A conversion is then started by
(PWMn) setting control bit ADCON.3 (ADCS). The hardware or
software start mode is selected when ADCON.5 - 1 and
255 - (PWMn) a conversion may be started by setting ADCON.3 as
above or by applying a rising edge to external pin
ANALOG-TO-DIGITAL CONVERTER
STADC. When a conversion is started by applying a ris-
The analog input circuitry consists of an 8-input analog ing edge, a low level must be applied to STADC for at
multiplexer and a lO-bit, straight binary, successive ap- least one machine cycle followed by a high level for at
proximation ADC. The analog reference voltage and an- least one machine cycle.
, - - - STADC
ADCO +
ADCl
ADC2 ....Iogu. ref.
ADca ANALOGUE INPUT lO-BIT AID
ADC4 MULTIPLEXER CONVERTER
ADC5 IfIIlogua supplV
ADC6
ADC7 analogue ground
ADCON ADCH
INTERNAL BUS
7 6 5 4 3 2 I 0
0 0 0 ADCO(PS.O)
0 0 I ADCI (PS.l)
0 I 0 ADC2(PS.2)
0 I I ADC3 (PS.3)
I 0 0 ADC4 (P5.4)
I 0 I ADC5(PS.S)
I I 0 ADC6(PS.6)
I I 1 ADC7 (PS.7)
R/2
I.
MSB
1023
R
R start
1022
R
1021
SUCCESSIVE
tota I resistance SUCCESSIVE
APPROXIMATION
= 1023 R + 2 x R/2 DECODER APPROXIMATION
CONTROL
= 1024 R REGISTER
LOGIC
,-- - 3
2
ready
R
R
o LSB
R/2
code
101
out
[7
I 100
/
V
/
all
V
010 /
V
001 /
V
000 /
a q 2q 3q 4q 5q
Quantization Error - V in
q = LSB =5 mV
lTV lTV V
-q/2 -Vin
In the Power-down mode, VDD and AVDD can be re- Power Control Register PCON
duced to minimize power consumption. VDD and AVDD
must not be reduced before the Power-down mode is en- The Idle and Power-down modes are entered by writing
tered and must be restored to the normal operating volt- to bits in PCON. PCON is not bit addressable. See Fig-
age before the Power-down mode is terminated. The re- ure 52.
set that terminates the Power-down mode also freezes
the oscillator. The reset should not be activated before MEMORY ORGANIZATION
VDD and AVDD are restored to their normal operating
level, and must be held active long enough to allow the The memory organization of the 83C552 is the same as
oscillator to restart and stabilize (normally less than in the 80C51, with the exception that the 83C552 has 8K
10ms). ROM, 256 bytes RAM and additional SFR's. Addressing
modes are the same in the 83C552 and the 80C5!. De-
The status of the external pins during' Power-down is tails of the differences are given in the following
shown in Table 18. If the Power-down mode is entered par agr a phs.
while the 83C552 is executing out of external program
memory, the port data that is held in the P2 special In the 83C552, the lower 8K of the 64K program mem-
function register is restored to Port 2. If a port latch ory address space is filled by internal ROM. By tying the
contains a '1', the port pin is held HIGH during the EA pin high, the processor fetches instructions from in-
Power-down mode by the strong pull-up transistor.
Table 18. External Pin Status During Idle and Power-Down Modes
mode memory ALE PSEN Port 0 Port 1 Port 2 Port 3 Port 4 PWMO/PWMl
Idle (1) internal 1 port data port data port data port data port data HIGH
Idle (1) external 1 1 floating port data address port data port data HIGH
Power-down internal 0 0 port data port data port data port data port data HIGH
Power-down external 0 0 floating port data port data port data port data HIGH
12 7
!!
ADORESSABlE { 127 12.
IITS IN RAM
Figure 52. Power Control Register (pCON) 112BSITSI 32 7
.7
• DIRECTOR
INDIRECT
lANK 3
REGISTERS 1! ••
gram memory from 8K upwards is automatic since ex- .7
The internal data RAM address space is 0 to 255. Four The SFR address space is 128 to 255. All registers ex-
8-bit register banks occupy locations 0 to 31. 128 bit lo- cept the program counter and the four 8-bit register
cations of the internal data RAM are accessible through banks reside in this address space. Memory mapping the
direct addressing. These bits reside in 16 bytes of inter- SFRs allows them to be accessed as easily as internal
nal data RAM at locations 20H to 2FH. The stack can RAM and as such, they can be operated on by most in-
be located anywhere in the internal data RAM address structions. The 56 SFRs are listed in Figure 54 and their
space by loading the 8-bit stack pointer. The stack depth mapping in the SFR address space is shown in Figures
may be 256 bytes maximum. 55 and 56. RAM bit addresses are the same as in the
80C51 and are summarized in Figure 57. The special
function bit addresses are summarized in Figure 58.
i
~rl-----------J~--------~,rA. ~, ,r-"'--,
I I
I I
*
:::
T31
PWMO _
FFH
:~:
_ FCH
IPO I 8F I 8E I BO 18c I 881 8A 1 88 188 I88H -
~
lEN' I EF I EE I EO I EC I EB.I fA I E9 I E8 I
EAH
E6H -
P2 I
't.
A7 I A6 I A51 A41 A31 A21 ", I AO I AOH -
1
SFAs containing
0:::= ~ directly edd,....ble
bits
~~R ~H P' 9 7 1 86 185184 183 18218, 1901 80H -
SFRs containing
SWAT f----------------J OAH directly IKkIreaable
bits
.. 51STA 09H THl 80H
THO r-----------------J
S,CON OF / DE I 00 I DC I oa I OA 109/ 08 oaH- 8CH
TL1 8B H
PSW 07 Ille 105 /04 / 03/ 02/ 0' /00 OOH_ TLO 8AH
* CTH3 CfH TMOO 89H
II CTH2 CEH TCON 8F 18E I 80 I 8C 1 8B laA I a9.188 BeH-
#~, COH peON 87H
#CTHO CCH
r-----------------~
CMH2 CBH DPH 83H
CMHl CAH DPl 82H
CMHO C9H SP 81 H
"""1p.l
ADeON
# P5
COH -
I I
I I
SPECIAL
FUNCTION
REGISTERS
r----"--...,
-255
241
240
232
224
216
201
255 244
-@
FOH
EIH
Eok
OIH
DOH
200 CIM
DIRECT
112 COH
ADDIIESS-
II. IIH ING
176 BOH (BITSI
lSI AIM
110 AOH
:3
152 IIH
144
136
127 -
128 135 121
41
DIRECT 127 120
ADDRESSING
(BITSI
.E. 7 0
A7
BANK 3
~ AO
R7 BANK 2
REGISTER .!! AO
ADDRESSING A7
BANK 1
I AO
R7
BANKO
0 RO
'----;---y-----
~ DIRECT ADDRESSING
STACK·PDINTER REGISTER·INDIRECT AND
REGISTER.INDIRECT ADDRESSING
!'
2DH
77
IF
., •
.. . . . ..
71
10
7.
Ie
73 72
IA
70
Fa H F7 I F6 I F5 I FO I F3 I F2 I Fl I FO
2CH
2BH SF
.,
51 50 5C . ..
13
SA
., ..••
51 51
E8H
ET2 ECM2 ECMl ECMO ECT3 Ecn ECn ECTO
EF I EE I ED I EC I EB I oA I E9 I EB IEN1
-- . ..... . ..•• .. .. .. .,
OAH 51 55 51 53 so EOH E7 I E6 I E5 I E4 I E3 I E2 lEI I EO ACC
., .. . -
'F 4E IC .A
ENSI STA STO SI AA CRI CRO
'7
.. .. .. D8H OF I DE I DO I DC I 08 I DA I 09 I 08 SICON
- .
, 7H .F 3E 3D 3C SA CV AC FO RSI RSO OV Fl P
DOH I I I I I I 01 I DO PSW
.. ....
07 08 05 04 03 02
37 :II os 53 53 31 3D :II
T20V CMI2 CMII CMIO CTI3 eTt2 CTII CTIO
,OH
.F
27 ..,. .. .. ,. .
2E 2D 2C I 2B
23
,A
"
37
:II
C8H CF I CE I CD I CC I CB I CA I C9 I C8 TM2IR
-
C3 C2 Cl P4
" "
I
PAD PSI PSO PTI
I BD I BC I BI I BA I B9 I BB
PXl PTO PXO
-
21H OF 00 oc OA Of 33 B8H 8F 8E IPO
07 GO O' 01 32
l FH
..... 31
••
BOH B7
EA
I B6
EAD
I 85
ESI
I
I
B4
ESO
I B3 I
ETI
B2
EXI
I AI I AA I A9 I A8
I Bl I BO
ETO EXO
P3
''''
.....
A8H AF 1 AE-l AD AC lEND
17H .3
IOH 1
AOH A 71 A6l AS I A4 I A3 I A2 I A 1 I AD P2
--
OFH 1 SMO SMl 5M2 REN Tea R8B TI RI
'Mlk 1 98H 9F 1 9E1 90 I 9C I 98 I 9A I 99 I 98 SOCON
07H
..... 0 90H 97 I 96 I 95 94 I 93 I 92 I 91 I 90 PI
BaH 87 I 86 I 85 84 I 83 I 82 I 81 I 80 PO
Figure 57. RAM Bit Addresses Figure 58. Special Function Register Bit Address
Goo
vanced CMOS process and is a deriva- • 8K x 8 ROM (83C552), expand- INDEX
CORNER 9 1 61
tive of the SC80C51 microcontroller fam- able externally to 64K bytes
ily. The S83C552/S80C552 has the same .256 x 8 RAM, expandable
instruction set as the 80C51. Two ver- externally to 64K bytes
sions of the derivative exist: • Two standard 16-bit timer! PLCC
counters
o S83C552 - 8K bytes mask program- • An additional 16-bit timer! 26 44
mable ROM counter coupled to four
o S80C552 - ROMless version of the 27 43
capture registers and three
S83C552 compare registers TOP VIEW
• Capable of producing 8 synch- Pin Function Pin Function
The S83C552 contains a non-volatile 8K
ronized, timed outputs 1 P5.0/ADCO 35 XTALI
x 8 read-<lnly program memory, a volatile 2 VDD 36 Vss
• A 10-bit ADC with 8 multi-
256 x 8 read/write data memory, six 8- 3 STADC 37 Vss
plexed analog inputs 4 PWMO 38 NC
bit I/O ports, two 16-bit timer/event
• Two 8-bit resolution, pulse 5 PWMI 39 P2.0/A08
counters (identical to the timers of the
width modulation outputs 6 EW 40 P2.1/A09
SC80C51), an additional 16-bit timer 7 P4.0/CMSRO 41 P2.2/Al0
• Five 8-bit I/O ports plus one
coupled to capture and compare latches, 8 P4.1/CMSRI 42 P2.3/All
8-bit input port shared with 9 P4.2/CMSR2 43 P2.4/AI2
a 15-source, two-priority-Ievel, nested in-
analog inputs 10 P4.3/CMSR3 44 P2.5/A13
terrupt structure, an 8-input ADC, a dual
• 12C-bus serial I/O port with byte 11 P4.4/CMSR4 45 P2.6/A14
DAC pulse width modulated interface, 12 P4.5/CMSR5 46 P2.7/A15
oriented master and slave
two serial interfaces (UART and 12C-bus), functions
13 P4.6/CMTO 47 PSEN
a 'watchdog' timer and on-chip oscillator 14 P4.7/CMTI 48 ALE
• Full-duplex UART compatible 15 RST 49 EA
and timing circuits. For systems that re- with the standard 80C51 16 P1.0/CTOI 50 POJ/AD7
quire extra capability, the S83C552 can • On-chip watchdog timer 17 P1.1/CT11 51 PO.6/AD6
be expanded using standard TTL compat- 18 P1.2/CT21 52 PO.5/AD5
ible memories and logic. 19 P1.3/CT31 53 PO.4/AD4
20 P1.4/T2 54 PO.3/AD3
LOGIC SYMBOL 21 P1.5/RT2 55 PO.2/AD2
The device also functions as an arith- 22 P1.6/SCL 56 PO.1/AD1
metic processor having facilities for both 23 P1.7/SDA 57 PO.O/ADO
binary and BCD arithmetic plus bit-hand- 24 P3.0/RXD 58 AVref-
I-I-
ling capabilities. The instruction set con- 25 P3.1/TXD 59 AVref+
0::: LOW ORDER 26 P3.2/INTO 60 AVSS
sists of over 100 instructions: 49 one- EA ~_ A~ESS
27
I5l!m P3.3/1NT1 61 AVDD
byte, 45 two-byte and 17 three-byte. ALE ::: DATA BUS 28 P3.4/TO 62 P5.7/ADC7
With a 12MHz crystal, 58% of the in- AVss 29 P3.5/T1 63 P5.6/ADC6
AVCO 30 P3.6/WR 64 P5.5/ADC5
structions are executed in 1!1S and 40%
r~
AVRu+
AVRu- 4-- er11 31 P3.7/RD 65 P5.4/ADC4
in 2!1S. Multiply and divide instructions -+- CT21 32 NC 66 P5.3/ADC3
require 4!1S. ~+-CT31 33 NC 67 P5.2/ADC2
PW5 -rz
--
_RT2 34 XTAL2 68 P5.1/ADC1
--I li::I---
Piiiii _SCI.
ADC1-+ Ill!
ADC2--11o ~
--
ADCl_ ...... ADDRESS
ADC4-__.
AOCS-... - BUS
--( 1--"
ADC8_
ADC7---
~
RST
£W
ORDERING INFORMATION
S8
Cl
1
C552_ClCl ClCl ::r:x: ROM Pattern No.
BLOCK DIAGRAM
ADCO-7
-+
TO Tl iNTo INTI PiiMii PWiii AVDD STADe SDA SCL
"DD 'Iss
®® ®
,
~
- - - - ;:... ®
- _1- - ~ - - - f..-- - I- - - f..-@L -CD - CD.,
XTALI
, TO. T1
r-''---'
®
XTAL2 TWO 1S-BIT PROGRAM DATA
I SERIAL
TIMER/ CPU MEMORY MEMORY DUAL
ADC
EVENT 8Kx6 258x6 PWM 1'<: PORT
COUNTERS ROM RAM
I
ALE
, :......, 0-
,
8OC51
CORE
EXCLUDING
ROII/RAII
8-BIT
INTERNAL BUS
®'
I
®,
18
J --= '--
A00-7
® , PARALLEL
I/O PORTS
ANO
SERIAL
UART
8-BIT
I/O
PORT
fOUR
III-BIT
CAPTURE
T2
18-BIT
TIMER/
~
TtflEE
til-BIT
COMPARA-
COMPARA-
TOR
OUlPUT
TJ
WATCH-
DOG
PORT EVENT TORS WITH
I EXT BUS LATCHES
COUNTER REGISTERS
SELECTION TIMER
A8-15
®,
L _
-- ® 1®- - - l- I-- 1 - - I-
<D<D
- - - - - -
<D
I-
@
-
- I- - -
PO PI P2 P3 TxD RxD P5 P4 T2 RT2 CMSRG-CMSR5 RST -EW
CIITO. CMTI
PIN DESCRIPTION
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
Vee 2 I Digital Power Supply: +5V power supply pin during normal operation, idle and power down
mode.
STADC 3 I Start ADC Operation: Input starting analog to digital conversion (ADC operation can also be
started by software).
PWMO 4 0 Pulse Width Modulation: Output O.
PWM1 5 0 Pulse Width Modulation: Output 1.
EW 6 I Enable Watchdog Timer: Enable for T3 watchdog timer and disable power-down mode.
PO.0-PO.7 57-50 1/0 Port 0: Port 0 is an 8-bit open-drain bidirectional 1/0 port. Port 0 pins that have 1s written to
them float and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order
address and data bus during accesses to external program and data memory. In this application
it uses strong internal pull-ups when emitting 1s.
P1.0-P1.7 16-23 1/0 Port 1: 8-bit 1/0 port. Alternate functions include:
16-21 1/0 (P1.0-P1.5): Quasi-bidirectional port pins.
22-23 1/0 (P1.6, P1.7): Open drain port pins
16-19 I CTOI -CT31 (P1.0-P1.3): Capture timer input signals for timer T2
20 I T2 (P1.4): T2 event input
21 I RT2 (P1.5): T2 timer reset signal. Rising edge triggered
22 1/0 SCL (P1.6): Serial port clock line 12C-bus
23 1/0 SDA (P1.7): Serial port data line 12C-bus
P2.0-P2.7 39-46 1/0 Port 2: 8-bit quasi-bidirectional 1/0 port.
Alternate Function: High-order address byte for external memory (A08-A15).
P3.0-P3.7 24-31 110 Port 3: 8-bit quasi-bidirectional 1/0 port. Alternate functions include:
24 I RxD (P3.0): Serial input port
25 0 TxD (P3.1): Serial output port
26 I INTO (P3.2): External interrupt
27 I INT1 (P3.3): External interrupt
28 I TO (P3.4): Timer 0 external input
29 I !1jP3.5): Timer 1 external input
30 0 WR (P3.6): External data memory write strobe
31 0 RD (P3.7): External data memory read strobe
P4.0-P4.7 7-14 1/0 Port 4: 8-bit quasi-bidirectional 110 port. Alternate Functions include:
7-12 0 CMSRO-CMSR5 (P4.0-P4.5): Timer T2 compare and setlreset outputs on a match with timer T2.
13, 14 0 CMTO, CMT1 (P4.6, P4.7): Timer T2 compare and toggle outputs on a match with timer T2.
P5.0-P5.7 68-62, I Port 5: 8-bit input port.
1 ADCO-ADC7 (P5.0-P5.7): Alternate Function: Eight input channels to ADC.
RST 15 1/0 Reset: Input to reset the S83C552. It also provides a reset pulse as output when timer T3 over-
flows.
XTAL1 35 I Crystal Input 1: Input to the inverting amplifier that forms the OSCillator, and input to the internal
clock generator. Receives the external clock signal when an external oscillator is used.
XTAL2 34 0 Crystal Input 2: Output of the inverting amplifier that forms the oscillator. Left open-circuit when
an external clock is used.
Vss 36, 37 I Digital Ground
PSEN 47 0 Program Store Enable: Active-low read strobe to external program memory.
ALE 48 0 Address Latch Enable: Latches the low byte of the address during accesses to external memory.
It is activated every six oscillator periods. During an external data memory access, one ALE
pulse is skipped. ALE can drive up to eight LS TTL inputs and handles CMOS inputs without an
external pull-up.
EA 49 External Access: When EA is held at TTL level high, the CPU executes out of the internal pro-
gram ROM provided the program counter is less than 8192. When EA is held at TTL low level,
the CPU executes out of external program memory. EA is not allowed to float.
AVREF- 58 Analog to Digital Conversion Reference Resistor: Low-end.
AVREF+ 59 Analog to Digital Conversion Reference Resistor: High-end.
AVss 60 Analog Ground
AVee 61 Analog Power Supply
NOTE.
To avoid 'latch-up' effect at power-on, the voltage on any pin at any time must not be higher or lower than Vee + 0.5V or
VSS - 0.5V respectively.
TEST LIMITS
SYMBOL PARAMETER UNIT
CONDITIONS Min Typical1 Max
Vee Supply voltage 4.5 5.5 V
Power supply current:
Active mode @ 12MHz 11.5 30 mA
Icc See note 5
Idle mode @ 12MHz 1.3 7 mA
Power down mode 3 50 /lA
Inputs
Input low voltage, except EA, Pl.6/SCL,
V,L -0.5 0. 2Vee-0. 1 V
P1.7/SDA
V,L1 Input low voltage to EA -0.5 0. 2Vee-0.3 V
TEST LIMITS
SYMBOL PARAMETER UNIT
CONDITIONS Min Typical 1 Max
Outputs (Continued)
-IOH - 3501lA 2.4
VOH2 High level output voltage (RST) V
-IOH - 601lA 0.75Vcc
RRST Internal reset pulldown resistor 50 150 kQ
Test freq - 1 MHz,
CIO Pin capacitance 10 pF
TA - 25°C
Analog Inputs
AVcc Analog supply voltage7 AVcc - Vcc±JJ·2V 4.5 5.5 V
Analog supply current Port 5 - 1.4V
Alcc 1.0 rnA
Operating
AIID 50
AlpD
Idle mode IlA
Power-down AVcc - 2-5.5V 50 IlA
AVIN Analog input voltage AVss-0.2 AVcc+0.2 V
Reference voltage:
V
AVref AVREF- AVss-0.2
AVcc+0.2 V
AVREF+
RREF Resistance between AVREF+ and AVREF- 10 50 kQ
CIA Analog input capacitance 15 pF
tADS Sampling time 8tCY f1S
tADC Conversion time (including sampling time) 50tCY f1S
DLe Differential non-linearity8 -1 +2 LSB
ILe Integral non-linearity8 ±2 LSB
OSe Offset error8 ±10 mV
Ge Gain error8 0.4 %
MCTC Channel to channel matching ±1 LSB
Ct Crosstalk9 0-100kHz -60 dB
NOTES:
1. Typical ratings are based on a limited number of samples taken from early manufacturing lots and are not guaranteed. The values listed are
at room temperature, 5V.
2. Capacitive loading on ports 0 and 2 may cause spurious noise to be superimposed on the VOLs of ALE and ports 1 and 3. The noise is due
to external bus capacitance discharging into the port 0 and port 2 pins when these pins make 1-to-0 transitions during bus operations.
In the worst cases (capacitive loading> 100pF). the noise pulse on the ALE pin may exceed o.av. In such cases, it may be desirable to
qualify ALE with a Schmitt Trigger. or use an address latch with a Schmitt Trigger STROBE input.
3. Capacitive loading on ports 0 and 2 may cause the VOH on ALE and PSEN to momentarily fall below the O.9VCC specification when the
address bits are stabilizing.
4. Pins of ports 1 (except P1.6, P1.7), 2,3 and 4 source a transition current when they are being externally driven from 1 to O. The transition
current reaches its maximum value when VIN is approximately 2V.
5. See Figures 8 throug h 11 for ICC test conditions.
6. The input threshold voltage of P1.6 and P1.7 (SI01) meets the 12C specification. so an input voltage below 1.5V will be recognized as a log-
ic 0 while an input voltage above 3.0V will be recognized as a logic 1.
7. The following condition must not be exceeded: VCC - 0.2V < AVcc < VCC + 0.2V.
8. Conditions: AVREF- - OV; AVCC - 5.0V. AVREF+ - 5.12V. ADC is monotonic with no missing codes.
9 This should be considered when both analog and digital sig nals are simultaneously input to port 5.
ALE
PORTO
PORT 2 _ _ _ _oJ'
ALE
PORTO IN
ALE
--~~-----IWlWH'------~
'OVWX
INSTRUCTION o 2 3 4 5 6 7 8
ALE
'OVXH HI 'XHOX
OUTPUT DATA
\'--_~ '-_~ '--_~ '-_---' '--_..J ' - _ - - I '--_..J '-_--.J
f
WRITE TO SBUF
I INPUT DATAl _ _ _ _ _ _ _J
f t
CLEAR RI
SET RI
O.45V
~---------tCLCL--------~
Vcc-O.5
0.45V
=x O.2Vcc+O.9
_,-O",.",2V.;.,c",c,--..;.O",.1_ __
>C Timing
Reference
Points
40
MAX ACTIVE MODE
35
/
30 V
25
/
f V
~ 20
()
Q
15 / TYP ACTIVE MODE
/ ./
V
10
5
I
VV V MAX IDLE MODE
:::::::. ~ I---I - -
TYP IDLE MODE
FREQ AT XTAL1
Vee Vee
...-_ _ _ _-;Iee
Vee
!
Vee
Vee
RST
RST
0.45V
~--------tCLCL----------~
Figure 11. Clock Signal Waveform for Icc Tests in Active and Idle Modes
tCLCH =
tCHCL =
5ns
Vee
...-_ _ _ _-;Iee
Vee
1
Vee
RST
(NC) XTAL2
XTAL1
Vss
64K
64K .....- - - - ,
EXTERNAL
8192
t
819 1
r 8191
1
SISTA# Serial 1 status D9H SC4l SC3 I SC2 I SCI I SCO I 0 I 0 I 0 F8H
DF DE DD DC DB DA D9 D8
SICON*# Serial 1 control D8H - lENSll STA I STO I SI I AA I CRI I CRO xOOOOOOOB
8F 8E 8D 8C 8B 8A 89 88
TCON* Timer control 88H TFI I TRI I TFO I TRO I IEl I ITl I IEO I ITO OOH
THI Timer high 1 8DH OOH
THO Timer high 0 8CH OOH
TLl Timer low 1 8BH OOH
TLO Timer low 0 8AH OOH
TMOD Timer mode 89H GATEJ CIT I Ml I MO IGATE I CIT I Ml I MO OOH
* = SFRs are bit addressable
# = SFRs are modified from or added to the 80CSI SFRs.
I2C Serial Communication - SIOI and timer blocks to continue to function while the CPU
is halted. The following functions remain active during
The I2C Serial port is identical to the I2C serial port on idle mode. These functions may generate an interrupt or
the 83C552. The operation of this subsystem is described reset and thus end the idle mode:
in detail in the 83C5S2 section of this manual.
- Timer O. Timer 1
Note that in both the 8XC6S2 and the 83CS52 the I2C - SIoO. SIOl
pins are alternate functions to port pins PI.6 and PI.7. - External interrupt
Because of this PI.6 and PI. 7 on these parts do not have
a pull-up structure as found on the 80CSI. Therefore In idle mode. port pins PI.6 and PI.7 function as SCL
PI.6 and PI.7 have open drain outputs on the 8XC652. and SDA respectively if the I2C serial port is enabled.
The power-down operation freezes the oscillator. TIle
Idle and Power-down Operation power-down mode can only be activated by setting the
PD bit in the PCON register. The power-down mode in
Idle mode operation permits the interrupt, serial ports, the 8XC6S2 operates exactly the same as in the 80CSl.
See Figure 60 for a function diagram of the 8XC652 in- I - INTO external interrupt 0
terrupt structure. Each interrupt vectors to a separate 2 - 12C serial I/O interrupt
location in program memory for its service program. 3 - Timer 0 overflow
Each source can be individually enabled or disabled by a 4 - INTI external interrupt I
corresponding bit in the IE register, moreover each in- 5 - Timer I overflow
terrupt may be programmed to a high or low priority 6 - UART serial 1/0 interrupt
level using a corresponding bit in the IP register. Also
all enabled sources can be globally disabled or enabled.
EXTERNAL
~ INTERRUPT
......n.
0- f--
REQUEST 0 ;- """'0- f--
5101 12C 0- f--
INT SERIAL PORT " ;- """'0- f--
INTERNAL
TIMER
0
EXTERNAL
....... . 0-
""0- t--
r--
~ INTERRUPT
.......
~o- r-
REQUEST 1 i' ""'0- r-
INTERNAL
TIMER
.......
0- r--
1 ;- ""'0- t--
5100 INTERNAL iT
SERIAL >- 0- t--
iNT PORT
....... ....... ..........
:R
Product Specification
Microprocessor Division
)0:::~~-)e~~
Pin Function Pin Function
require 4J.1S. 1 NC 23 NC
24 P2.0/AS
~~ 2
3
P1.0
P1.1 25 P2.1/A9
4 P1.2 26 P2.2/A10
5 P1.3 27 P2.3/A11
6 P1.4 28 P2.4/A12
7 P1.5 29 P2.5/A13
8 SCL/P1.6 30 P2.6/A14
I~
9 SDA/P1.7 31 P2.7/A15
10 RST 32 ~
11 RxD/DAT AlP3.0 33 ALE
12 NC 34 NC
_SCL 13 TxDIICLOCK/P3.1 35 D:
_SDA 14 rnTO/P3.2 36 PO.7/AD7
15 iNTi/P3.3 37 PO.B/AD6
RXD/DATA PO.5/AD5
16 TO/P3.4 38
m
D/CLOCK
TO
17
18
19
T1/P3.5
Wl\/P3.6
lm/P3.7
39
40
41
PO.4/AD4
PO.3/AD3
PO.2/AD2
i
RD
20
21
XTAL2
XTAL1
42
43
PO.1/AD1
PO.O/ADO
Vee
22 Vss 44
S8 C852-
1
C CC
T
Custom ROM Pattern No.
Applies to masked ROM versions
only. Number will be assigned by
Signetics. Contact Signetics
sales office for ROM pattern sub-
mission requirements.
Package and Pins
ROMle.s
S80C652-1 N40
S80C652-1 A44
S80C652-2N40
S80C652-2A44
PART NUMBER SELECTION
ROM Version
S83C652-1 N40
S83C652-1A44
S83C652-2N40
S83C652-2A44
Temperature and Package
o to +70 0 C plastic DIP
o to +70 0 C plastic LCC
-40 to +85 0 C plastic DIP
1.2 to 12MHz
1.2 to 12MHz
1.2 to 12MHz
A44 - 44-Pin Plastic LCC
N40 - 40-Pin Plastic DIP S80C652-4N40 S83C652-4N40 o to +70°C plastic DIP' 1.2 to 16MHz
S80C652-4A44 S83C652-4A44 o to +70°C plastic LCC' 1.2 to 16MHz
Speed and Temperature Range S80C652-5N40 S83C652-5N40 -40 to +85°C plastic DIP' 1.2 to 16MHz
1 - 0 to +70 0 C, 1.2 to 12MHz
2 - -40 to +85 0 C, 1.2 to 12MHz S80C652-5A44 S83C652-5A44 -40 to +85 0 C plastic LCC' 1.2 to 16MHz
4 - 0 to +70 0 C, 1.2 to 16MHz
5 - -40 to +85°C, 1.2 to 16MHz S80C652-6N40 S83C652-6N40 -40 to +11 OOC plastic DIP 1.2 to 12MHz
6 - -40 to +110 0 C, 1.2 to 12MHz S80C652-6A44 S83C652-6A44 -40 to +110 0 C plastic LCC 1.2 to 12MHz
ROMlesa/ROM ·Preliminary specification
0- ROMless
3 - ROM
BLOCK DIAGRAM
FREQUENCY
REFERENCE COUNTERS
I
XTAL2 XTAL1
• I
TO T1
i
PROGRAM DATA
MEMORY MEMORY
(8K x 8 ROM) (258 x 8 RAM)
SDA} SHARED
WITH
SCL PORT 1
INTERNAL
INTERRUPTS
L J
TEST LIMITS
SYMBOL PARAMETER UNIT
CONDITIONS Min Typical 1 Max
Vee Supply voltage 4.5 5.5 V
Power supply current:
Active mode @ 16MHz 11.5 30 rnA
Icc See note 5
Idle mode @ 16MHz 1.3 6.5 rnA
Power down mode 3 50 /lA
Inputs
Input low voltage, except EA, P1,6/SCL,
VIL -0.5 0. 2Vee-0.1 V
P1.7/SDA
VIL1 Input low voltage to EA -0.5 0. 2Vee-0.3 V
VIL2 Input low voltage to P1.6/SCL, P1. 7/SDA7 -0.5 1,5 V
Input high VOltage, except XTAL1, RST,
VIH 0, 2Vee+0 .9 Vee+0.5 V
P1.6/SCL, P1.7/SDA
VIH1 Input high voltage, XTAL 1, RST O· 7Vee Vee+0 .5 V
VIH2 Input high voltage, P1.6/SCL, P1. 7/SDA6 3.0 6.0 V
Logical 0 input current, ports 1, 2, 3, except
-IlL VIN - 0.45V 50 /lA
P1.6/SCL, P1.7/SDA
Logical 1 to 0 transition current, ports 1, 2, 3,
-ITL See note 4 -650 /lA
except P1,6/SCL, P1. 7/SDA
±IIL1 Input leakage current, port 0, EA 0.45V<VI< Vee 10 /lA
OV<VI<6V
±IIL2 Input leakage current, P1.6/SCL, P1. 7/SDA 10 /lA
OV<Vee<5.5V
Outputs
Output low voltage, ports 1, 2, 3, except
VOL IOL - 1.6mA2 0.45 V
P1.6/SCL, P1.7/SDA
VOL1 Output low voltage, port 0, ALE, PSEN IOL - 3,2mA2 0.45 V
VOL2 Output low voltage, P1,6/SCL, P1, 7/SDA IOL - 3.0mA2 0.4 V
VOH Output high voltage, ports 1, 2, 3 -IOH - 60/lA 2.4 V
-IOH - 25/lA 0. 75Vee V
-IOH - 10/lA 0. 9Vee V
VOH1 Output high voltage (port 0 in external bus -IOH - 400/lA 2,4 V
mode, ALE, PSEN)3 -IOH - 150/lA 0. 75Vee V
-IOH - 40/lA 0. 9Vee V
Outputs (Continued)
PARAMETER
I CONDITIONS
I Min I Typical 1 I Max I
RRST I
Internal reset pulldown resistor I I 50 I I 150 I kQ
AC ELECTRICAL CHARACTERISTICS TA - O°C to +70°C, or TA - -40°C to +85°C/l10°C, VCC - 5V ±10%, VSS - OV1, 2
12MHz CLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER UNIT
Min Max Min Max
Program Memory
l/tCLCL 1 Oscillator frequency 1.2 16 MHz
tLHLL 1 ALE pulse width 127 2tCLCL -40 ns
tAVLL 1 Address valid to ALE low 28 tCLCL-55 ns
tLLAX 1 Address hold after ALE low 43 tCLCL-35 ns
tLLlV 1 ALE low to valid instruction in 234 4tCLCL -100 ns
tLLPL 1 ALE low to PSEN low 43 tCLCL -40 ns
tpLPH 1 PSEN pulse width 205 3tCLCL -45 ns
tPLIV 1 PSEN low to valid instruction in 145 3tCLCL -105 ns
tPXIX 1 Input instruction hold after PSEN 0 0 ns
tpXIZ 1 Input instruction float after PSEN 59 tCLCL-25 ns
tAVIV 1 Address to valid instruction in 312 5tCLCL -105 ns
tpLAZ 1 PSEN low to address float 10 10 ns
Data Memory
tAVLL 2, 3 Address valid to ALE low 43 tCLCL-40 ns
tRLRH 2, 3 RD pulse width 400 6tCLCL -100 ns
tWLWH 2,3 WR pulse width 400 6tCLCL -100 ns
tRLDV 2, 3 RD low to valid data in 252 5tCLCL -165 ns
tRHDX 2, 3 Data hold after RD 0 0 ns
tRHDZ 2, 3 Data float after R D 97 2tCLCL -70 ns
tLLDV 2, 3 ALE low to valid data in 517 8tCLCL -150 ns
tAVDV 2, 3 Address to valid data in 585 9tCLCL -165 ns
tLLWL 2, 3 ALE low to RD or WR low 200 300 3tCLCL -50 3tCLCL+50 ns
tAVWL 2, 3 Address valid to WR low or RD low 203 4tCLCL -130 ns
tOVWX 2, 3 Data valid to WR transition 23 tCLCL -60 ns
tWHOX 2, 3 Data hold after WR 33 tCLCL-50 ns
tRLAZ 2, 3 RD low to address float 12 12 ns
tWHLH 2, 3 RD or WR high to ALE high 43 123 tCLCL -40 tCLCL+40 ns
ALE
I"SE'N
---"
PORTO _ _ _J
PORT 2
ALE
t-----tLLDV ---.....,
---*~-----tRLRH------.....,
PORTO
~----------~VDV-----~
ALE
---to----WLWH----o!
Vee-O,S .-------,,-- - - -
O.4SV
~---------tCLCL-----~
INSTRUCTION o 2 3 4 5 8 7 8
ALE
tOVXH HI t XHOX
OUTPUT DATA
\ X X~--JX~--JX~--JX'-_...JX'-_...JX'-_...J
f
WRITE TO SBUF
Vee-O.S
O.4SV
=x O.2Vee+O.9 >C
_,-,O""2""V""e,,,e-...;O;;,;','-'-_.....
Timing
Reference
Points
<
AC inputs during testing are driven at Vcc-O.S
For timing purposes, a port is no longer floating
for a logic "1" and 0.4SV for a logic '0'.
when a 100mV change from load voltage occurs,
Timing measurements are made at VIH min for
and begins to float when a 100mV change from
a logic '1' and V IL max for a logic '0'.
the loaded VOHIVOL level occurs.IOH/lOL~± 20mA.
Vee
....._ _ _--ilee
Vee
l Vee
Vee
RST
RST
XTAL2 XTAL2
CLOCK (NC) CLOCK (NC) XTALI
XTALl
SIGNAL Vss SIGNAL Vss
0.45V
~---------tCLCL----------~
Figure 10. Clock Signal Waveform for Icc Tests in Active and Idle Modes
tCLCH = tCHCL = 5ns
Vee
....._ _ _--il,ee
Vee
l
Vee
RST
(NC) XTAL2
XTALI
Vss
8XC751 OVERVIEW This part is well suited for logic replacement in con-
sumer and industrial applications.
The Signetics 83C751/87C751 offers the advantages of
DIFFERENCES FROM THE 80C5l
the SC80C51 architecture in a small package and at a
low cost. This microcontroller is fabricated with
Memory Organization
Signetics high-density CMOS technology. Signetic~. e.ri-
taxial substrate minimizes CMOS lach-up senSItiVIty. The central processing unit (CPU) manipulates operands
The 83C751187C751 (hereafter referred to collectively as in 2 address spaces as shown in Figure 61. The part's
the 83C751) contains a 2K x 8 ROM/EPROM, a 64 x 8 internal memory space consists of 2K bytes of program
RAM 19 I/O lines a 16-bit auto-reload counter/timer, memory, and 64 bytes of data RAM overlapped with the
a fix~d rate timer,' a five source fixed priority interrupt
128 byte special function register area. The differences
structure, a bidirectional Inter-Integrated Circuit (12C) from the 80C5l are in RAM size (64 bytes vs 128 bytes),
serial bus interface, and an on-chip oscillator. The on- in external RAM access (not available on the 83C751),
board inter-integrated circuit (12C) bus interface allows in internal ROM size (2K bytes vs 4k bytes), and in ex-
the 83C751 to operate as a master or slave device on ternal program memory expansion (not available on the
the 12C small area network. This capability facilitates
83C751). The 128 byte special function register (SFR)
I/O and RAM expansion, access to EPROM, processor space is accessed as on the 80C51 with some of the reg-
to processor communication, and efficient interface to a isters having been changed to reflect changes in the
wide variety of dedicated 12C peripherals. The 83C751
83C751 peripheral functions. The stack may be located
has the following features:
anywhere in internal RAM by loading the 8-bit stack
pointer (SP). It should be noted that stack depth is lim-
• SC80C51 based architecture
ited to 64 bytes, the amount of available RAM. A reset
• Boolean processor
loads the stack pointer with 07F (which is pre-incre-
• Inter-integrated Circuit (12C) serial bus interface
mented on a PUSH instruction).
• Fixed-rate timer
• 16-bit auto reload able counterltimer Special Fnnction Registers
• Small package sizes
- 24 pin DIP (300 mil "skinny DIP") The 83C751 contains many of the Special Function Reg-
- 28 pin PLCC isters (SFR) that are found on the 80C51. Due to the
• 2K x 8 ROM/EPROM different peripheral features on the 83C751, there are
• Available in erasable quartz lid (87C751), one-time several additional SFRs and several that have been
programmable (87C751), or mask programmable changed. There is no port 2 on the 83C751 so the P2
versions (83C751) SFR isn't used. The standard UART found on the 80C51
• Wide oscillator frequency range has been replaced by the 12C serial interface, so the
• Low power consumption: UART SFRs, SCON and SBUF, have been replaced by
- Normal operation: less than llmA @ 5V, 12MHz 12CON and 12DAT, and two additional 12C registers
• Idle mode have been added (12STA and 12CFG).
• Power-down mode
• CMOS and TIL compatible
(FFH) 255
SPECIAL
FUNCTION
REGISTERS
(80H) 128
(3FH) 63
INTERNAL
DATA RAM
(OOH) 0
Because the interrupt structure is single level on the 110 Port Structure
83C751 there is no need for the IP SFR, so it is not
used. The counter/timer has only one mode of operation The 8XC751 has 2 eight-bit ports (ports I and 3) and I
so the TMOD SFR is not used. There is also only one three-bit port (port 0). All three ports on the 8XC751
counter/timer so there is no need for the TLI and THI are bi-directional. Each consists of a latch (special func-
SFRs found on the 80C51. These have been replaced on tion register PO, PI, P3), an output driver, and an input
the 83C751 by RTL and RTH the counter/timer reload buffer. Three Port 1 pins and two Port 0 pins are multi-
registers. Table 20 shows the special function registers, functional. In addition to' being port pins, these pins
their locations, and reset values. serve the function of special features' as follows:
B 112
~
·1
TL TH TF INT
C/T=1
TO PIN r
TR
GATE
INTO PIN
RTL RTH
9F 9E 9D 9C 9B 9A 99 98
I2CON*# I2C control
-
98H/RD RDA'"Q ATN lDRDYI ARL I STR I STP IMASTER! 8lH
WR CXAl IDLE~ CDR ICARLI CSTR I CSTP I XSTR I XSTP
FF FE FD FC FB FA F9 F8
I2STA*# I2C control F8H 1 IDLE lXDATAIXACTVIMAKSTRIMAKSTPI XSTR I XSTP xOl00000B
AF AE AD AC AB AA A9 A8
IE*# Interrupt enable A8H EAJ 1 I EI2 I ETI I EX1 ETO EXO DOH
PO*# Port 0 80H - - - - - 82 81 80 xxxxxl1lB
PI * Port 1 90H 97 96 95 94 93 92 91 90 FFH
P3* Port 3 BOH B7 B6 B5 B4 B3 B2 Bl BO FFH
PC ON Power control 87H 1 - 1 I - I PD IDL xxxxxxDOB
D7 D6 D5 D4 D3 D2 Dl DO
PSW* Program status word DOH CY 1 AC 1 FO I RSI I RSO I ov I I P DOH
SP Stack pointer 81H 07H
8F 8E 8D 8C 8B 8A 89 88
TCON*# Timer/counter control 88H GATEl CIT 1 TF I TR I lEO I ITO lEI ITl DOH
TL# Timer low byte 8AH DOH
TH# Timer high byte 8CH DOH
RTL# Timer low reload 8BH DOH
RTH# Timer high reload 8DH DOH
* = SFRs are bit addressable.
# = SFRs are modified from or added to the 80C51 SFRs.
ITO - INTO is edge triggered. The MINIMUM SDA LOW TO SCL LOW time in a
o- INTO is level sensitive. start condition.
lEI 1 - Edge detected on INTI. The MAXIMUM SCL CHANGE time while an 12C
IT1 1 - INTI is edge triggered. frame is in progress. A frame is in progress between
o - INTI is level sensitive. a Start condition and the following Stop condition.
This time span serves to detect a lack of software re-
These flags are functionally identical to the corre- sponse on this 8XC751 as well as external l2C prob-
sponding 80C51 flags, except that there is only one tim- lems. SCL "stuck low" indicates a faulty Master or
er on the 83C751 and the flags are therefore combined Slave. SCL "stuck high" may mean a faulty device, or
into one register. that noise induced onto the 12C caused all Masters to
withdraw from 12C arbitration.
The 12C watchdog timer, timer I, is also available as a
general purpose fixed rate timer when the 12C interface The first 5 of these times are 4.7jlS (see 12C specifica-
is not being used. A clock rate of 1/12 the oscillator tion) and are covered by the low order 3 bits of Timer 1.
frequency forms the input to a prescaler. This prescaler Timer I is clocked by the 8XC751 oscillator which can
c an be programmed for 1 of 4 values to give a range of vary in frequency from 0.5 to 16MHz. A prescaler with
timeout periods (see more discussion in 12C section). one of 4 divisor values allows Timer I values to be opti-
Timer I has a timeout interval of 1024 machine cycles. mized for different oscillator frequencies. At lower fre-
An external reset on this timer is initiated by a transi- quencies, software response time is increased and will
tion on the SCL(PO.O) pin. degrade maximum performance of the 12C bus. For
100Khz bus performance, the oscillator rate should be
12C Serial Interface limited to the 8-16MHz range which is the range that
the Timer I prescaler was designed for. See special
The 12C bus uses two wires (SDA and SCL) to transfer function register 12CFG description for prescale values
information between devices connected to the bus. The (CTO, CTl).
main technical features of the bus are:
The MAXIMUM SCL CHANGE time is important but
- Bidirectional data transfer between masters and slaves its exact span is not critical. The complete 10 bits of
- Serial addressing of slaves Timer I are used to count out the maximum time. When
- Acknowledgment after each transferred byte 12C operation is enabled, this counter is cleared by tran-
- Multimaster bus sitions on the SCL pin. The timer does not run between
- Arbitration between simultaneously transmitting mas- 12C frames (i.e. whenever Reset or Stop occurred more
ters without corruption of serial data on bus recently than the last Start). When this counter is run-
ning, it will carry out after 1024 machine cycles have
A large family of 12C compatible ICs is available. See elapsed since a change on SCL. A carry out causes a
the 12C section of this manual for more details on the hardware reset of the 83C751 12C interface and gener-
bus and available ICs.
ates an interrupt if the Timer I interrupt is enabled. In
cases where the bus hangup is due to a lack of software
The 83C751 12C subsystem includes hardware to simplify
response by this 83C751, the reset releases SCL and al-
the software required to drive the 12C bus. The hardware
lows 12C operation among other devices to continue.
is a single bit interface which in addition to including
the necessary arbitration and framing error checks, in-
I2C Register 12CON
cludes clock stretching and a bus timeout timer. The in-
terface is synchronized to software either through polled 7 6 5 4 3 2 o
loops or interrupts. Six time spans are important in 12C Read
operation and are insured by Timer I:
Write
- The MINIMUM HIGH time for SCL when this de-
vice is the master. Reading 12CON
- The MINIMUM LOW time for SCL when this device
is a master. This is not very important for a single-bit RDAT The data from SDA is captured into "Receive
hardware interface like this one, because the SCL DATa" whenever a rising edge occurs on
low time is stretched until the software responds to SCL. RDAT is also available (with 7 low-
the 12C flags. The software response time normally order zeros) in the 12DAT register. The dif-
meets or exceeds the MIN La time. In cases where ference between reading it here and there is
the software responds within (MIN HI + MIN La) that reading 12DAT clears DRDY, allowing
time, Timer I will insure that the minimum time is the 12C to proceed on to another bit. Typi-
met. cally, the first 7 bits of a received byte are
- The MINIMUM SCL HIGH TO SDA HIGH time in read from 12DAT, while the 8th is read here.
a stop condition. Then, 12DAT can be written to send the Ack
- The MINIMUM SDA HIGH TO SDA LOW time be- bit and clear DRDY.
tween 12C stop and start conditions. (4.7jlS see spec.)
Am "ATteNtion" is 1 when one or more of DRDY, MASTER "MASTER" is 1 if this 83C751 is cur-
ARL, STR, or STP is 1. Thus, Am com- rently a Master on the nc. MASTER
prises a single bit that can be tested to re- is set when MASTRQ is 1 and the bus
lease the I2C service routine from a "wait is not busy (i.e., if a start bit hasn't
loop". been received since Reset or a "Timer
DRDY "Data ReaDY" (and thus Am) is set when a I" time-out, or if a Stop has been re-
rising edge occurs on SCL, except at idle ceived since the last Start). MASTER
Slave. DRDY is cleared by writing CDR ~ 1, is cleared when ARL is set, or after the
or by writing or reading the 12DAT register. software writes MASTRQ ~ 0 and then
The following low period on SCL is stretched XSTP ~ 1.
until the program responds by clearing
DRDY. Writing I2CON
Checking Am and DRDY Typically, for each bit in an I2C message, a service rou-
tine waits for Am ~ 1. Based on DRDY, ARL, STR,
When a program detects Am ~ 1, it should next check and STP, and on the current bit position in the message,
DRDY. If DRDY ~ 1, then if it receives the last bit it it may then write I2CON with one or more of the follow-
should capture the data from RDAT (in 12DAT or ing bits, or it may read or write the I2DAT register.
I2CON). Next, if the next bit is to be sent it should be
written to I2DAT. One way or another it should clear CXA Writing a 1 to "Clear Xmit Active" clears the
DRDY and then return to monitoring Am. Note that if Transmit Active state. (Reading the I2DAT
any of ARL, STR, or STP is set, clearing DRDY will register also does this.)
not release SCL to high, so that the 12C will not go on
to the next bit. If a program detects Am ~ 1, and Regarding Transmit Active
DRDY ~ 0, it should go on to examine ARL, STR, and
STP. Transmit Active is an internal state in the I2C interface
and is not directly testable. Transmit Active is set by
ARL "Arbitration Loss" is 1 when transmit Active writing the I2DAT register, or by writing I2CON with
was set, but this 83C751 lost arbitration to XSTR ~ 1 or XSTP ~ 1. The I2C interface will only
another transmitter. Transmit Active is drive the SDA line low when Transmit Active is set, and
cleared when ARL is 1. There are 4 separate the ARL bit will only be set to 1 when Transmit Active
cases in which ARL is set. is set. Transmit Active is cleared by reading the I2DAT
1. If the program sent a 1 or repeated start, register, or by writing I2CON with CXA ~ 1. Transmit
but another device sent a 0, or a stop, so that Active is automatically cleared when ARL is 1.
SDA is 0 at the rising edge of SCL. (If the
other device sent a Stop, the setting of ARL IDLE Writing 1 to "IDLE" causes a Slave's I2C hard-
will be followed shortly by STP being sent.) ware to ignore the I2C until the next Start
2. If the program sent a 1, but another device condition (but if MASTRQ is 1 then a Stop
sent a repeated start, and it drove SDA low condition will make the 83C751 into a Master).
before the 83C751 could drive SCL low. (This CDR Writing a 1 to "Clear Data Ready" clears
type of ARL is always accompanied by STR ~ DRDY. (Reading or writing the I2DAT regis-
1.) ter also does this.)
3. In Master mode, if the program sent a re- CARL Writing a 1 to "Clear Arbitration Loss" clears
peated Start, but another device sent a 1, and the ARL bit.
it drove SCL low before this 83C751 could CSTR Writing a 1 to "Clear STaRt" clears the STR
drive SDA low. bit.
4. In Master mode, if the program sent Stop, CSTP Writing a to "Clear SToP" clears the STP
but it could not be sent because another de- bit. Note that if one or more of DRDY, ARL,
vice sent a O. STR, or STP is 1, the low time of SCL is
STR "STaRt" is set to a 1 when an I2C Start condi- stretched until the service routine responds by
tion is detected at a non-idle Slave or at a clearing them.
Master. (STR is not set when an idle Slave
becomes active due to a Start bit; the Slave
has nothing useful to do until the rising edge
of SCL sets DRDY.)
STP "SToP" is set to 1 when an I2C Stop condi-
tion is detected at a non-idle Slave or at a
Master. (STP is not set for a Stop condition
at an idle Slave.)
I:~~ ~ I IIIIII
Read 0 0 0 0 0 0 zero stops and clears it. Together with
Write X X X X X X SLAVEN, MASTRQ, and MASTER, this
bit determines operational modes as shown
RDAT "Receive DATa" is captured from SDA every in Table 21.
rising edge of SCL. Reading I2DAT also en,o These two bits are programmed as a func-
clears DRDY and the Transmit Active state. tion of the OSC rate, to optimize the MIN
XDAT "Xmit Data" sets the data for the next bit. HI and LO time of SCL when this 83C751
Writing I2DAT also clears DRDY and sets is a master on the I2C. The time value de-
the Transmit Active state. termined by these bits controls both of
these parameters, and also the timing for
Regarding Software Response Time Stop and Start conditions. These bits are
cleared to 00 by reset.
Because the 83C751 can run at 16MHz, and because the
I2C interface is optimized for high-speed operation, it is The value that should be programmed in these bits is
quite likely that an I2C service routine will sometimes given in Table 22, for integer-MHz crystal values. For
respond to DRDY (which is set at a rising edge of SCL) other values, the controlling factor is that the MIN
and write I2DAT before SCL has gone low again. If TIME must be greater than or equal to 4.7I1Sec. (MIN
XDAT were applied directly to SDA, this situation would TIME is a range because 12C events are not synchro-
produce an I2C protocol violation. The programmer need nized to osc/12.)
not worry about this possibility because XDAT is applied
to SDA only when SCL is low. The maximum oscillator frequency (MHz) for a given
en, 0 value is given by:
Conversely, a program that includes an I2C service rou-
tine may take a long time to respond to DRDY. Typi- (oscl12 count - 0.42) *12
cally, an I2C routine operates on a flag-polling basis fosc max =
during a message, with interrupts from other peripheral 4.7
functions enabled. If an interrupt occurs it will delay the The 4.7 in the denominator is the minimum LOW time
response of the 12C service routine. The programmer for 12C in microseconds.
need not worry about this very much either, because the
12C hardware stretches the SCL low time until the serv-
ice routine responds. The only constraint on the response
is that it must not exceed the Timer I time-out, which is
at least 768 microseconds.
Product Specification
Microprocessor Division
ORDERING INFORMATION
S83C751- ee (CVxxxx) PART NUMBER SELECTION
--r-
Custom ROM Pattern No.
Part Number
S83C751-1 N24
Speed
3.5 to 12MHz
Temperature and Package
o to +70°C, Plastic DIP
Applies to masked ROM versions S83C751-2N24 3.5 to 12MHz -40 to +85°C, Plastic DIP
only. Number will be assigned by
Signetics. Contact Signetics S83C751-3N24 0.5 to 12MHz o to +70°C, Plastic DIP
sales office for ROM pattern sub-
mission requirements.
S83C751-4N24 3.5 to 16MHz o to +70°C, Plastic DIP
S83C751-5N24 3.5 to 16MHz -40 to +85°C, Plastic DIP
Package Codes:
N24 - Plastic DIP S83C751-1A28 3.5 to 12MHz o to +70°C, Plastic LCC
A28 - Plastic PLCC
S83C751-2A28 3.5 to 12MHz -40 to +85°C, Plastic LCC
Speed and Temperature Range:
1- 3.5 to 12MHz. OoC to +70 0 C S83C751-3A28 0.5 to 12MHz o to + 70°C, Plastic LCC
2- 3.5 to 12MHz. -40°C to +85 °c
3- 0.5 to 12MHz. OOC to +70° C S83C751-4A28 3.5 to 16MHz o to +70°C, Plastic LCC
4- 3.5 to 16MHz. OOC to +70 0 C S83C751-5A28 3.5 to 16MHz -40 to +85°C, Plastic LCC
5- 3.5 to 16MHz. -40°C to +85 °c
BLOCK DIAGRAM
~------------l
lIlT
I
L
P1.o-P1.7
PIN DESCRIPTION
PIN NO.
MNEMONIC I - - - , - - - i TYPE NAME AND FUNCTION
DIP PlCC
Vss 12 14 I Circuit ground potential.
Vee 24 28 I Supply voltage during normal, idle, and power-down operation.
PO.0-PO.2 8-6 9-7 I/O Port 0: Port 0 is a 3-bit open-drain bidirectional port. Port 0 pins that have ones written to
them float, and in that state can be used as high-impedance inputs. Port 0 also serves as
the serial 12C interface as shown in the pinout diagram. When this feature is activated by
software, SCL and SDA are driven low in accordance with the 12C protocol. These pins are
driven low if the port register bit is written with a 0 or if the 12C subsystem presents a O.
The state of the pin can always be read from the port register by the program.
To comply with the 12C specification, PO.O and PO.l are open-drain bidirectional I/O pins
with the electrical characteristics listed in the tables that follow. While these differ from
'standard TTL' characteristics, they are close enough for the pins to still be used as
general-purpose 1/0 in non-12C applications.
7 8 I/O SDA (PO.l) 12C data.
8 9 110 SCl (PO.O) 12C clock.
Pl.0-Pl.7 13-20 15-20, 1/0 Port 1: Port 1 is an 8-bit bidirectional 110 port with internal pullups. Port 1 pins that have
23, 24 ones written to them are pulled high by the internal pullups and can be used as inputs. As
inputs, port 1 pins that are externally pulled low will source current because of the internal
pullups. (See DC electrical characteristics: IILl. Port 1 also serves the special function
features of the SCBOC51 family as listed below:
18 20 INTO CP1.5): External interrupt
19 23 INT1 CP1.6): External interrupt
20 24 TO CP1.7): Timer 0 external input
P3.0-P3.7 5-1 4-1, I/O Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull ups. Port 3 pins that have
23-21 6, ones written to them are pulled high by the internal pullups and can be used as inputs. As
27-25 inputs, port 3 pins that are externally being pulled low will source current because of the
pullups (See DC electrical characteristics: IILl.
RST 9 11 Reset: A high on this pin for two machine cycles while the oscillator is running, resets the
device. An internal diffused resistor to Vss permits a power-on RESET using only an
external capacitor to Vee.
Xl 11 13 Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock generator
circuits.
X2 10 12 o Crystal 2: Output from the inverting oscillator amplifier.
OSCilLATOR CHARACTERISTICS high long. enough to allow the oscillator POWER-DOWN MODE
Xl and X2 are the input and output, re- time to start up (normally a few millisec- In the power-<1own mode, the oscillator
spectively, of an inverting amplifier onds) plus two machine cycles. At is stopped and the instruction to invoke
which can be configured for use as an power-on, the voltage on Vee and RST power-<1own is the last instruction exe-
on-<:hip oscillator, as shown in the logic must come up at the same time for a cuted. Only the contents of the on-<:hip
symbol. proper start-up. RAM are preserved. A hardware reset is
the only way to terminate the power-
To drive the device from an external IDLE MODE down mode. The control bits for the re-
clock source, Xl should be driven while In the idle mode, the CPU puts itself to duced power modes are in the special
X2 is left unconnected. There are no re- sleep while all of the on-<:hip peripherals function register PCON.
quirements on the duty cycle of the ex- stay active. The instruction to invoke the
terna clock signal, because the input to idle mode is the last instruction executed
the internal clock circuitry is through a in the normal operating mode before the
divide-by-two flip-flop. However, mini- idle mode is activated. The CPU con- Table 1. External Pin Status During
mum and maximum high and low times tents, the on-<:hip RAM, and all of the Idle and Power-Down Modes
specified in the data sheet must be special ·function registers remain intact
observed. Mode Port 0 Port1 Port 2
during this mode. The idle mode can be
terminated either by any enabled inter- Idle Data Data Data
RESET rupt (at which time the process is picked
A reset is accomplished by holding the Power-down Data Data Data
up at the interrupt service routine and
RST pin high for at least two machine continued), or by a hardware reset
cycles (24 oscillator periods), while the
which starts the processor in the same
oscillator is running. To insure a good manner as a power-on reset.
power-on reset, the RST pin must be
DIFFERENCES BETWEEN THE A watchdog timer, called Timer I, is for Special Function Register Addresses
S83C751 AND THE SC80C51 use with the 12C subsystem. In 12C appli- Special function register addresses for
cations, this timer is dedicated to time- the S83C751 are identical to those of
Program Memory the SC80C51, except for the changes
generation and bus monitoring of the
On the S83C751, program memory is listed below:
2048 bytes long and is not externally 12C. In non-12C applications, it is avail-
expandable. Program memory can con- able for use as a fixed timebase.
SC80C51 special function registers not
tain S83C751 instructions and constant present in the S83C751 are TMOO (89),
Interrupt Subsystem - Fixed Priority
data. The only fixed allocations in pro- The I P register and the 2-level interrupt P2 (AO) and IP (B8). The SC80C51 regis-
gram memory are the addresses at which system of the SC80C51 are eliminated. ters TH1, TL1, SCON, and SBUF are
execution is taken up in response to re- Simultaneous interrupt conditions are re- replaced with the S83C751 registers
set and to interrupts, which are as solved by a single-level, fixed priority as RTH, RTL, 12CON, and 120AT, respec-
follows: follows: tively. Additional special function regis-
Program Memory ters are 12CFG (08) and 12STA (F8).
Event Address Highest priority: Pin INTO
Reset 000 Counter/timer flag 0
External INTO 003 Pin INT1
Counter/timer 0 OOB Timer I
External I NT1 013
Lowest priority: Serial1 2C
Timer I 01B
12C serial 023 Serial Communications
The S83C751 contains an 12C serial com-
Counter/Timer Subsystem munications port instead of the SC80C51
The S83C751 has one counter/timer
called timer/counter o. Its operation is UART. The 12C serial port is a single bit
similar to mode 2 operation on the hardware interface with all of the hard-
SC80C51, but is extended to 16 bits with ware necessary to support multimaster
16 bits of autoload. The controls for this and slave operations. Also included are
counter are centralized in a single regis- receiver digital filters and timer (timer I)
ter called TCON. for communication watch-<log purposes.
The 12C serial port is controlled through
four special function registers; 12C con-
trol, 12C data, 12C status, and 12C config-
uration.
DC ELECTRICAL CHARACTERISTICS TA - O°C to +70°C or TA - -45°C to +85°C. Vee - 4.0V to 6.0V. Vss - 0V3
LIMITS
SYMBOL PARAMETER TEST CONDITIONS UNIT
Min Max
VIL Input low voltage. except SDA. SCL -0.5 . 0. 2Vee-0.1 V
VIH Input high voltage. except XI. RST 0.2Vee+0.9 Vee+0.5 V
VIH1 Input high voltage. XI. RST 0. 7Vee Vee+0.5 V
SDA. SCL:
VIl1 Input low voltage -0.5 0.3Vee V
VIH2 Input high voltage O.7Vee Vee+0.5 V
VOL Output low voltage. ports 1 and 3 10L - 1.6mA 0.45 V
VOl1 Output low voltage. port 0.2 10L - 3.2mA 0.45 V
VOH Output high voltage. ports 1 and 3 10H - -601lA 2.4 V
10H - -251lA 0. 75Vee V
10H - -101lA 0. 9Vee V
AC ELECTRICAL CHARACTERISTICS TA - DoC to +70°C or TA - -45°C to +85°C , VCC - 5V±20%, Vss - OV3, 7
3.5 12
1/tCLCL Oscillator frequency 3.5 16 MHz
0.5 12
~O.2'1Cc+o.&
0.2 'ICc -0.1
OA6V
O.45V
~0.2 'ICc +0.&
_ _ _ _ _ _...,,~O.2 'ICc ~.1 x'--___
Figure 2. AC Testing Input/Output Waveform
20
/
/
18
16 /
14
/
t
< 12 V TYP ACTIVE lee5
E
~ 10
/ ./'
8
./
/' '"
--
8
,,/
4
,,/
-
MAX IDLE lee 8
2 TYP IDLE lee 8
I-"
4 8 12 18
FREQ - MHz
Product Specification
Microprocessor Division
LOGIC SYMBOL 11 19
12 18
TOP VIEW
Pin Function Pin Function
1 P3.4/A4 15 P1.0/DO
2 P3.3/A3 16 P1.1/D1
3 P3.21 A21 A10 17 P1.2/D2
4 P3.1/A1/A9 18 P1.3/D3
5 N.C. 19 P1.4/D4
6 P3.0/AO/A8 20 P1.5!mTbID5
7 PO.2/vpp 21 N.C.
8 PO.1/SDAI 22 N.C.
OE-PGM 23 P1.6!11ilTl ID6
9 PO.O/SCll 24 P1.7/TO/D7
ASEL 25 P3.7/A7
10 N.C. 26 P3.6/AS
11 RST 27 P3.5/A5
12 X2 28 Vee
13 X1
14 Vss
L~ou~~~.
Part Number Speed Temperature and Package
S87C751-1F24 3.5 to 12MHz o to +70·C. Ceramic DIP
S87C751-3F24 0.5 to 12MHz o to +70·C. Ceramic DIP
S87C751 4F24 3.5 to 16MHz o to +70°C. Ceramic DIP
S87C751-1N24 3.5 to 12MHz o to +70·C. Plastic DIP
S87C751 2N24 3.5 to 12MHz -40 to +85·C. Plastic DIP
S87C751-3N24 0.5 to 12MHz o to +70·C. Plastic DIP
F24 - Ceramic DIP
N24 - Plastic DIP (OTP) S87C751-4N24 3.5 to 16MHz o to +70·C. Plastic DIP
A28 - Plastic PLCC (OTP) S87C751 5N24 3.5 to 16MHz -40 to +85·C. Plastic DIP'
Speed and Temperature Range: S87C751-1A28 3.5 to 12MHz o to +70·C. Plastic LCC'
1 - 3.5 to 12MHz. O·C to +70·C S87C751-2A28 3.5 to 12MHz -40 to +85·C. Plastic LCC'
2 - 3.5 to 12MHz. -40·C to +85 ·C
3 - 0.5 to 12MHz. O·C to +70· C S87C751-3A28 0.5 to 12MHz o to +70·C. Plastic LCC'
4 - 3.5 to 16MHz. O·C to +70· C S87C751 4A28 3.5 to 16MHz o to +70·C. Plastic LCC'
5 - 3.5 to 16MHz. -40·C to +85 ·C S87C751-5A28 3.5 to 16MHz -40 to +85·C. Plastic LCC'
..
'Prellmmary Speclflcallon
BLOCK DIAGRAM
"I
I
RST
I
L J
PIN CONFIGURATION
PIN NO.
MNEMONIC r----.---l TYPE NAME AND FUNCTION
DIP PLCC
Vss 12 14 I Circuit ground potential.
Vee 24 28 I Supply voltage during normal, idle, and power-down operation.
PO.0-PO.2 8-6 9-7 I/O Port 0: Port 0 is a 3-bit open-drain bidirectional port. Port 0 pins that have ones written to
them float, and in that state can be used as high-impedance inputs. Port 0 also serves as
the serial 12C interface as shown in the pinout diagram. When this feature is activated by
software, SCL and SDA are driven low in accordance with the 12C protocol. These pins are
driven low if the port register bit is written with a 0 or if the 12C subsystem presents a O.
The state of the pin can always be read from the port register by the program.
To comply with the 12C specification, PO.O and PO.l are open drain bidirectional I/O pins
with the electrical characteristics listed in the tables that follow. While these differ from
'standard TIL' characteristics, they are close enough for the pins to still be used as
general-purpose I/O in non-12C applications.
Port 0 also provides alternate functions for programming the EPROM memory as follows:
6 7 N/A Vpp (PO.2) - Programming voltage input.
7 8 I OE/PGM (PO.1) - input, OE/PGM, which specifies verify mode (output enable) or the pro-
gram mode.
OE/PGM - 1 output enabled (verify mode)
OE/PGM - 0 program mode.
8 9 ASEL (PO.O) - input which indicates which bits of the EPROM address are applied to port 3.
ASEL - 0 low address byte available on port 3.
ASEL - 1 high address byte is available on port 3 (only the three least significant bits are
used).
7 8 I/O SDA (PO.l) 12C data.
8 9 I/O SCL (PO.O) 12C clock.
Pl.0-Pl.7 13-20 15-20, I/O Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pullups. Port 1 pins that have
23, 24 ones written to them are pulled high by the internal pull ups and can be used as inputs. As
inputs, port 1 pins that are externally pulled low will source current because of the internal
pullups. (See DC electrical characteristics: ilL). Port 1 serves to output the addressed
EPROM contents in the verify mode and accepts as inputs the value to program into the
selected address during the program mode.
Port 1 also serves the special function features of the SC80C51 family as listed below:
18 20 INTO (P1.5): External interrupt
19 23 INT1 (P1.6): External interrupt
20 24 TO (P1.7): Timer 0 external input
P3.0-P3.7 5-1 4-1, I/O Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups. Port 3 pins that have
23-21 6, ones written to them are pulled high by the internal pullups and can be used as inputs. As
27-25 inputs, port 3 pins that are externally being pulled low will source current because of the
pullups (See DC electrical characteristics: IlL). Port 3 also functions as the address input
for the EPROM memory location to be programmed (or verified). The ll-bit address is
multiplexed into this port as specified by PO.O/ASEL.
RST 9 11 Reset: A high on this pin for two machine cycles while the oscillator is running resets the
device. An internal diffused resistor to VSS permits a power-on RESET using only an
external capacitor to Vee. After the device is reset, a 10-bit serial sequence, sent LSB first,
applied to RESET, places the device in the programming state allowing programming ad-
dress, data and Vpp to be applied for programming or verification purposes. The RESET
serial sequence must be synchronized with the Xl input.
Xl 11 13 Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock generator
circuits. Xl also serves as the clock to strobe in a serial bit stream into RESET to place the
device in the programming state.
X2 10 12 o Crystal 2: Output from the inverting oscillator amplifier.
DC ELECTRICAL CHARACTERISTICS TA - O°C to +70°C or TA - -40°C to +85°C, Vee - 4.5V to 5.5V, Vss - OV3
LIMITS
SYMBOL PARAMETER TEST CONDITIONS UNIT
Min Max
VIL Input low voltage, except SDA, SCl -0.5 0. 2Vee-0 .1 V
VIH Input high voltage, except X1, RST 0. 2Vee+0 .9 Vee+0.5 V
VIH1 Input high voltage, X1, RST 0. 7Vee Vee+0.5 V
SDA, SCl:
VIL1 Input low voltage -0.5 0. 3Vee V
VIH2 Input high voltage 0. 7Vee Vee+0.5 V
VOL Output low voltage, ports 1 and 3 IOL - 1.6mA 0.45 V
VOl1 Output low voltage, port 0.2 IOL - 3.2mA 0.45 V
VOH Output high voltage, ports 1 and 3 IOH - -60j.iA 2.4 V
IOH - -25j.iA 0. 75Vee V
IOH - -10j.iA 0.9Vee V
AC ELECTRICAL CHARACTERISTICS TA - O°C to +70°C or TA - -40°C to +BSoC, VCC - SV±10%, Vss - OV3, 7
3.S 12
1/tCLCL Oscillator frequency 3.S 16 MHz
O.S 12
Vee -o.s
~O.2 IQ:+o,g
OMiV
0.2 IQ: ~.1
Vee -o.s
V0.2 \o\::c -H),g X
_ _ _ _ _....~I"'._""O.2;::.,,;:\o\::c""--(),..;;.;.I-------...... "._ _ _ _ __
OAIIV
20
/
V
16
16
/
14
/
f
c( 12 V TYP ACTIVE lee 5
E
~ 10
/ /
8
/
//
--
6
Y"
4
--
Y" MAX IDLE lee 6
2
4 8 12
- TYP IDLE lee 6
16
FREQ - MHz
PROGRAMMING CONSIDERATIONS these pins function as normal quasi- Encryption Key Table "
bidirectional I/O ports and the program- The 87C751 includes a 16 byte EPROM
EPROM Characteristics ming equipment may pull these lines low. array that is programmable by the end
The 87C751 is programmed by using a However, prior to sending the 10 bit user. The contents of this array can then
modified Quick-Pulse Programming algo- code on the reset pin, the programming be used to encrypt the program memory
rithm similar to that used for devices equipment should drive these pins high contents during a program memory verify
such as the 87C451 and 87C51. It differs (VIH). The RESET pin may now be used operation. When a program memory ver-
from these devices in that a serial data as the serial data input lor the data ify operation is performed, the contents
stream is used to place the 87C751 in stream which places the 87C751 in the of the program memory location is
the programming mode. programming mode. Data bits are XNOR'ed with one of the bytes in the 16
sampled during the clock high time and byte encryption table. The resulting data
Figure 4 shows a block diagram of the pattern is then provided to port 1 as the
thus should only change during the time
programming configuration for the
that the clock is low. Following transmis- verify data. The encryption mechanism
87C751. Port pin PO.2 is used as the
sion of the last data bit, the RES ET pin can be disabled, in essence, by leaving
programming voltage supply input (Vpp
should be held low. the bytes in. the encryption table in their
signal). Port pin PO.l is used as the pro-
erased state (FFH) since the XNOR
gram (PGM/) signal. This pin is used for Next the address information for the lo- product of a bit with a logical one wiU
the 25 programming pulses. cation to be programmed is placed on result in the original bit. The encryption
port 3 and ASEL used to pertorm the bytes are mapped with the code memory
Port 3 is used as the address input for
address multiplexing, as previously de- in 16 byte groups. The first byte in code
the byte to be programmed and accepts
scribed. At this time, port 1 functions as memory will be encrypted with the first
both the high and low components of the
an output. byte in the encryption table; the second
eleven bit address. Multiplexing of these
address components is pertormed using byte in code memory will be encrypted
A high voltage Vpp level is then applied with the second byte in the encryption
the ASEL input. The user should drive to the Vpp input (PO.2). (This sets Port 1
the ASEL input high and then drive port table and so forth up to and including
as an input port.). The data to be pro- the sixteenth byte. The encryption re-
3 with the high order bits of the address. grammed into the EPROM array is then
ASEL should remain high for at least 13 peats in 16 byte groups; the seventeenth
placed on Port 1. This is followed by a byte in the code memory will be en-
clock cycles. ASEL may then be driven series of programming pulses applied to
low which latches the high order bits of crypted with the first byte in the encryp-
the PGM/ pin (PO.f). These pulses are tion table, and so forth.
the address internally. The high address created by driving PO.l low and then
should remain on port 3 for at least two high. This pulse is repeated until a total Security Bits
clock cycles after ASEL is driven low. of twenty-five programming pulses have Two security bits, security bit 1 and se-
Port 3 may then be driven with the low occurred. At the conclusion of the last curity bit 2, are provided to limit access
byte of the address. The low address wiU pulse, the PG MI signal should remain to the USER EPROM and encryption
be internally stable 13 clock cycles later. high. key arrays. Security bit 1 is the program
The address will remain stable provided inhibit bit, and once programmed per-
that the low byte placed on port 3 is The Vpp signal may now be driven to the forms the following functions:
held stable and ASEL is kept low. Note: VOH level, placing the 87C751 in the 1. Additional programming of the US-
AS EL needs to be pulsed high only to verify mode. (Port 1 is now used as an ER EPROM is inhibited.
change the high byte of the address. output port.). After 4 machine cycles (48 2. Additional programming of the en-
clock periods) the contents of the ad- cryption key is inhibited.
Port 1 is used as a bidirectional data bus dressed location in the EPROM array will
during programming and verify opera- 3. Verification of the encryption key is
appear on Port 1. inhibited.
tions. During the programming mode, it
accepts the byte to be programmed. 4. Verification of the USER EPROM and
The next programming cycle may now
During the verify mode, it provides the the security bit levels may still be
be initiated by placing the address infor-
contents of the EPROM location speci- performed.
mation at the inputs of the multiplexed
fied by the address which has been sup- buffers, driving the Vpp pin to the Vpp (If the encryption key array is being
plied to Port 3. voltage level, providing the byte to be used, this security bit should be pro-
programmed to Port 1 and issuing the 25 grammed by the user to prevent un-
The XTALl pin is the oscillator input and programming pulses on the PGMI pin,
receives the master system clock. This authorized parties from reprogramming
bringing Vpp back down to the Vee level the encryption key to all logical zero
clock should be between 1.2 and 6 and verifying the byte.
MHz. bits. Such programming would provide
data during a verify cycle that is the
Programming Modes
The RESET pin is used to accept the logical compliment of the USER EPROM
The 87C751 has lour programming fea-
serial data stream that places the contents.)
tures incorporated within its EPROM ar-
87C751 into various programming modes. ray. These include the USER EPROM for
This pattern consists of a 10-bit code Security bit 2, the verify inhibit bit, pre-
storage of the application's code, a six- vents verification of both the USER
with the LSB sent first. Each bit is syn- teen byte encryption KEY array and two
chronized to the clock input, Xl. EPROM array and the encryption key
security bits. Programming and verifica- arrays. The security bit levels may still
tion of these four elements are selected be verified.
Programming Operation
by a combination of the serial data
Figures 5 and 6 show the timing dia-
stream applied to the RES ET pin and the
grams for the program/verify cycle.
voltage levels applied to port pins PO.1
RES ET should initially be held high for at
and PO.2. The various combinations are
least two machine cycles. PO.l (pGM/)
shown in Table 3.
and PO.2 (Vpp) will be al VOH as a result
of the RESET operation. At this point,
Programming and Verifying Port 1.7 contains the security bit 1 data tent erasure. For this and secondary ef-
Security Bits and is a logical one if programmed and a fects, it is recommended that an
Security bits are programmed employing logical zero if erased. Likewise, Pl.6 opaque label be placed over the win-
the same techniques used to program contains the security bit 2 data and is a dow. For elevated temperature or sol-
the USER EPROM and KEY arrays using logical one if programmed and a logical vent environments, use Kapton tape
serial data streams and logic levels on zero if erased. Fluorglas part number 2345-5 or equiv-
port pins indicated in Table 3. When pro- alent.
gramming either security bit, it is not Erasure Characteristics
necessary to provide address or data in- Erasure of the EPROM begins to occur The recommended erasure procedure is
formation to the 87C751 on ports 1 and when the chip is exposed to light with exposure to ultraviolet light (at 2537
3. wavelengths shorter than approximately angstroms) to an integrated dose of at
4,000 angstroms. Since sunlight and least 15W-sec/cm2. Exposing the
Verification occurs in a similar manner fluorescent lighting have wavelengths in EPROM to an ultraviolet lamp of
using the RES ET serial stream shown in this range, exposure to these light 12,OOO).LW/cm2 rating for 20 to 39 min-
Table 3. Port 3 is not required to be sources over an extended time (about 1 utes, at a distance of about 1 inch,
driven and the results of the verify op- week in sunlight, or 3 years in room level should be sufficient.
eration will appear on ports 1.6 and 1.7. fluorescent lighting) could cause inadver-
Erasure leaves the array in an all ls
state.
EPROM PROGRAMMING AND VERIFICATION CHARACTERISTICS TA - 21°C to +27°C, VCC - 5V±10%, VSS - OV
117C7II!
PROGRAMIIING
PULSES PD.!
vpp /VIH VOLTAGE P0.2
501J1CE
cue
q
50URCE XTALI
RESET
COHIROL I RESET
LOGIC I
lCTAL 1
~ 2 MACHINE
...---CYClES _I_ TEN BIT SERIAL CODE -I
RESET~ , ~1~B~rr~O~~B~rr~I~~B~IT~2~~B~IT~3~I~B~IT~4~I~B~IT~5~1~B~rr_8~~B~IT_7~~B~IT~8~-2BI~T~9~1______
PO.2 UNDEFINED I
PO.! UNDEFINED I
s::
:::l
2 Q)
I»
-< g-
~
co
O III
1:
(J)
~ o·
(J) :g
::J a
(>
co Q)
!Z
CD Q
I
'tI
() aa.
12.75V ::::r c:
(>
P~LSES
CX)
I
H tSHGL 25 H tGHSL
OJ
;::;:
I I
L ___ JLJL~=rur------- s::
."
ii
PO.1 (PGM)
o·
~
!; 0
It
H tGLGH H tGHGL (")
!" r-tMASELl 0
'tI 98u5 MIN 1Qus MIN
I\)
~
I
.8ill
3
Po.o (ASEL) :::7 ,'-______________________________ ::J
.-+
~
0
0)
~
~
fJn PORT 3 ;>C HIGHADDRESS:><:~ ____~L~O~W~A~D~D~R~ES~S~_______________________________________________________________
CD
HtADSTA H t DVGL tGHDxj' 'I' t AvaV ---.I
PORT 1
INVALID DATA
... ,
VALID
...
DAT~
Ir--------------.:-....:.
DATA TO BE PROGRAMMED
... I
INVALID DATA
I VALID DATA
.. , , - - - - -
'tI
ac:
(J) ~
CX) (/)
-...I "i(>
() ::;;
-...I o·
01 e
-L g"
Signetics Microprocessor Products User's Guide
If the alternate functions INTO, INTI, or TO are not The 8-bit counter counts from 0 to 254 inclusive. The
being used, these pins may be used as standard I/O value of the 8-bit counter is compared to the contents of
ports. If the ND converter is not enabled, pins the compare register, PWM. When the content's value
Pl.O- Pl.4 can be used as standard I/O pins. matches that of the PWM register, the PWM output is
set high. When the counter reaches zero, the PWM out-
Port 3 put is set low. The pulse width ratio (duty cycle) is de-
fined by the contents of the compare register and is in
Port 3 is an 8-bit bi-directional I/O port whose structure the range of 0 to I programmed in increments of 11255.
is identical to the 80C5l. Note that the alternate func-
tions associated with port 3 of the 80C51 have been The PWM output can be set continuously high by loading
moved to port I of the 83C752 (as applicable). See Fig- the compare register with OOH and continuously low by
ure 63 for port bit configurations. loading the compare register with FFH. The PWM out-
put is enabled by setting the PWE bit in the PWM en-
PWM Outputs able register, PWENA. When enabled, the output is
driven with a fully active strong pullup. When disabled,
The single PWM output is an alternate function assigned the pin behaves as a normal bi-directional I/O pin.
to PO.4, and can be used to output pulses of program- When disabled, the counter remains active. The PWM
mable length and interval. The repetition frequency is function is disabled by a reset condition. The PWM out-
defined by an 8-bit prescaler which generates the clock put is high during power-down and idle modes and the
for the counter. This prescaler is contained in the counter is disabled.
PWMP register.
AID Converter
ALTERNATE
OUTPUT
The 83C752 contains a 5-channel multiplexed 8-bit ND
READ converter. The conversion requires 40 machine cycles
LATCH VDD (40).lS at 12MHz oscillator frequency).
INTERNAL
-I PULL·UP
The ND converter is controlled by the ND control reg-
INT BUS ister, AD CON. Input channels are selected by the analog
multiplexer by bits ADCON.O through ADCON.2. TI,e
ADCON register is not bit addressable.
WRITE TO
LATCH ADCON Register
MSB Lsn
READ PIN
x I x
ALTERNATE ADCI ADCS Operation
INPUT
a a ADC not busy, a conversion can be started.
FUNCTION a I ADC busy, start of a new conversion is
blocked.
o Conversion completed, start of a new conver-
ALTERNATE sion is blocked.
OUTPUT Not possible.
READ FUNCTION
Input Channel Selection
LATCH
ADDR2 ADDRI ADDRa Input Pin
0 0 0 PI.O
0 0 I Pl.l
INT BUS 0 I 0 PI.2
0 I I PI.3
1 0 a PI.4
WRITE TO
LATCH Position Symbol Function
ADCON.5 ENADC Enable AID function when ENADC - L
Disable AID function when ENADC - a.
Reset forces ENADC - O.
READ PIN ADCON.4 ADCI ADC interrupt flag. This flag is set when
ALTERNATE
an ADC conversion is complete. If IE.6 >=
INPUT 1, an interrupt is requested when ADCI -
FUNCTION
1. The ADCI flag is cleared when con-
version data is read. This nag is read only.
ADCON.3 ADCS ADC start and status. Setting this bit starts
an ND conversion. Once set, ADCS
Figure 63. Port Bit Latches and 1/0 Buffers remains high throughout the conversion
cycle. On completion of the conversion, it
is reset at the same time the ADCI
The repetition frequency is given by: interrupt flag is set. ADCS cannot be reset
by software.
ADCON.2 AADR2 Analog input select.
fose ADCON.l AADRI Analog input select.
fpWM ~ -------- ADCON.O AADRO Analog input select. This binary coded
2 x (1 + PWMP) 255 address selects one of the five analog
input port pins of PI to be input to the
An oscillator frequency of 12MHz results in a repetition converter. It can only be changed when
ADCI and ADCS are both low. AADR2 is
range of 92Hz to 23.5KHz. the most significant bit.
conversion in progress is aborted when the Idle or timer/counter is enabled. Register pair TH and TL are
Power-down mode is entered. The result of a completed incremented by the clock source. When the register pair
conversion (ADCI ~ logic 1) remains unaffected when overflows, the register pair is reloaded with the values in
entering the Idle mode. See Figure 64 for an ND input registers RTH and RTL. The value in the reload regis-
equivalent circuit. ters is left unchanged. The TF bit in special function
register TCON is set on counter overflow and, if the in-
The analog input pins ADCO-ADC4 may be used as dig- terrupt is enabled, will generate an interrupt (see Figure
ital inputs and outputs when the A/D converter is dis- 65).
abled by a 0 in the ENADC bit in ADCON. When the
ND is enabled, the analog input channel that is selected 12C Serial 110
by the ADDR2-ADDRO bits in ADCON cannot be used
as a digital input. Reading the selected ND channel as The I2C bus uses two wires (SDA and SCL) to transfer
a digital input will always return a 1. The unselected information between devices connected to the bus. The
ND inputs may always be used as digital inputs. main technical features of the bus are:
.-- ·-----·----~-------·1
•
••
I~,
S;~, R~~,
~
II
-j---1"- --U'V\,'\r"-~-t
Sm. Rm.
I. TO COMPARATOR
WV\r-+--I--------------
+ MULTIPLEXER
c.
~NAlOGINPUT
Rm - O.S-3Kohms
Cs + Cc - 1SpF maximum
Rs - Recommended < 9.6Kohms for 1 LSB @ 12MHz
NOTE:
Because the analog to digital converter has a sampled-data comparator, the input looks capacitive to a source. When a
conversion is initiated, switch Sm closes for 8tcy (8JlS @ 12MHz crystal frequency) during which time capacitance Cs + Cc
is charged. It should be noted that the sampling causes the analog input to present a varying load to an analog source.
Interrupt Enable Register ing Timer I, the counter portion of the PWM, and the
interrupts. Upon powering-up the circuit, or exitiug from
MSB LSB
idle mode, sufficient time must be allowed for stabiliza-
I EA IEAD I ETI I ES IEPWM I EXI I ETO I EXO I tion of the internal analog reference voltages before an
ND conversion is started.
Position Symbol Function
1E.7 EA Global interrupt disable when EA = 0 Instruction Set
1E.6 EAD ND conversion complete
IE.S ETI Timer I The instruction set of the 83C7S2 is identical to the
1E.4 ES 12C serial port 80CSI except that:
1E.3 EPWM PWM counter overflow
1E2 EXI External interrupt I MOVX, LCALL and UUMP are not implemented.
IE.I ETO Timer 0 overflow
IE.O If these instructions are executed, the appropriate
EXO External interrupt 0
number of instruction cycles will take place along with
Power-Down and Idle Modes external fetches, however, no operation will take place.
The UMP may not respond to all program address bits.
The 8XC752 includes the 80C51 power-down and idle
mode features. The functions that continue to run while
in the idle mode are Timer 0, the 12C interface includ-
osc 112
TF INT
TO PIN - - - - - - - - - - - '
TR
GATE
INTO PIN
RTL RTH
Data Pointer
The Data Pointer DPTR) consists of a high byte (DPH)
and a low byte (D PL). In the 80C51, this register allows
the access of external data memory using the MOVX
instruction.
Ports 0, 1, 2
Preliminary Specification
Microprocessor Division
lOGIC SYMBOL
,om! ,,~ ~['"
11 19
12 18
TOP VIEW
NOTE:
AO-Al0 and 00-07 available for EPROM
verify only.
L,~.".~."
S87C752 1F28 3.5 to 12MHz o to +70°C, Ceramic DIP
S87C752-3F28 0.5 to 12MHz o to +70°C, Ceramic DIP
S87C752-4F28 3.5 to 16MHz o to +70°C, Ceramic DIP
A28 - Plastic PLCC (OTP)
S87C752-1 N28 3.5 to 12MHz o to +70°C, Plastic DIP
F28 - Ceramic DIP S87C752-2N28 3.5 to 12MHz . -40 to +85°C, Plastic DIP
N28 - Plastic DIP (OTP)
Speed and Temperature Range:
S87C752-3N28 0.5 to 12MHz o to +70°C, Plastic DIP
1- 3.5 to 12MHz, OoC to +70°C S87C752-4N28 3.5 to 16MHz o to +70°C, Plastic DIP
2- 3.5 to 12MHz, _40°C to +85 °c S87C752-5N28 3.5 to 16MHz -40 to +85°C, Plastic DIP
3- 0.5 to 12MHz, OOC to +70° C
4- 3.5 to 16MHz, OOC to +70° C S87C752 1A28 3.5 to 12MHz o to +70°C, Plastic LCC
5- 3.5 to 16MHz, -40°C to +85 °c
S87C752-2A28 3.5 to 12MHz -40 to +85°C, Plastic LCC
S87C752-3A28 0.5 to 12MHz o to +70°C, Plastic LCC
S87C752-4A28 3.5 to 16MHz o to +70°C, Plastic LCC
S87C752 5A28 3.5 to 16MHz -40 to +85°C, Plastic LCC
BLOCK DIAGRAM
----------~~ ----------l
L _____ J
Special Function Register Addresses SCSOC51 special function registers not RTH, RTL, 12CON, and 120AT, respec-
Special function register addresses for present in the SS7C752 are TMOO (S9), tively. Additional special function regis-
the SS7C752 are identical to those of P2 (AO) and IP (B8). The SCSOC51 regis- ters are 12CFG (OS), 12STA (FB),
the SC80C51, except for the changes ters TH1, TL1, SCON, and SBUF are AOCON (AO) , AOAT (S4), PWM (SE),
listed below: replaced with the SS7C752 registers PWMP (SF), and PWENA (FE).
DC ELECTRICAL CHARACTERISTICS TA = O°C to +70°C or TA - -40°C to +S5°C, AVec - 5V ±10%, AVss - OV3
LIMITS
SYMBOL PARAMETER TEST CONDITIONS UNIT
Min Max
Icc Supply current (see Figure 3) TBO
Inputs
VIL Input low voltage, except.SOA, SCL -0.5 0.2Vee-0.1 V
VIH Input high voltage, except Xl, RST 0.2Vee+0.9 Vee+0.5 V
VIHI Input high voltage, X1, RST 0. 7Vee Vee+0 .5 V
SOA, SCl:
VIL1 Input low voltage -0.5 0. 3Vee V
VIH2 I nput high voltage O· 7Vee Vee+0.5 V
OutDuts
VOL Output low voltage, ports 1, 3, 0.3, and 0.4 (PWM disabled) IOL - 1.6mA 0.45 V
VOLl Output low voltage, port 0.2 IOL - 3.2mA 0.45 V
VOH Output high voltage,ports 1, 3, 0.3, and 0.4 (PWM disabled) IOH - -60)lA 2.4 V
IOH - -25)lA 0.75Vee V
IOH = -10)lA 0. 9Vee V
VOH2 Output high voltage, PO.4 (PWM enabled) IOH - -400)lA 2.4 V
IOH - -40)lA 0.9Vee V
Port 0.0 and 0.1 (12C) - Orivers
VOL2 Output low voltage 0.4 V
IOL - 3mA
(over Vee range)
Driver, receiver combined:
C Capacitance 10 pF
IlL logical 0 input current, ports 1, 3, 0.3, and 0.4 (PWM disabled) VIN - 0.45V -50 )lA
ITL logical 1 to 0 transition current, ports 1, 3, 0.3 and 0.4 VIN - 2V -650 )lA
III Input leakage current, port 0.0, 0.1 and 0.2 0.45 < VIN < Vee ±10 )lA
RRST Reset pull-down resistor 25 175 kohm
CIO Pin capacitance Test freq - 1 MHz, 10 pF
TA - 25°C
Ipo Power-down current6 Vee - 2 to 5.5V 50 )lA
Vpp Vpp program voltage VSS - OV 12.5 13.0 V
Vee - 5V±10%
TA - 21°C-27°C
Ipp Program current Vpp - 13.0V 10 rnA
TEST LIMITS
SYMBOL PARAMETER UNIT
CONDITIONS Min Typical Max
Analog Inputs (AID guaranteed only with quartz window covered.)
AVcc Analog supply voltage 9 AVcc - Vcc±O·2 4.5 5.5 V
Analog supply current
Aicc Operating TBD mA
AIID AVcc - 5.12V
Idle modeS TBD mA
AI PO TBD mA
Power-downS
AVIN Analog input voltage AVss-O.2 AVcc+O.2 V
CIA Analog input capacitance TBD pF
tAOS Sampling time StCY s
tADC Conversion time 40tCY s
R Resolution S bits
ERA Relative accuracyS ±1 LSB
OSe Zero scale offsetS TBD LSB
Ge Full scale gain errorS TBD %
MCTC Channel to channel matching TBD LSB
Ct Crosstalk 0- 100kHz TBD dB
NOTES:
1. Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the device. This is a stress rating only and
functional operation of the device at these or any other conditions than those described in the AC and DC Electrical Characteristics
section of this specification is not implied.
2. This product includes circuitry specifically designed for the protection of its internal devices from damaging effects of excessive static
charge. Nonetheless, it is suggested that conventional precautions be taken to avoid applying voltages greater than the rated maxima.
3. Parameters are valid over operating temperature range unless otherwise specified. All voltages with respect to Vss unless otherwise noted.
4. Power-down ICC is measured with all output pins disconnected; port 0 - Vee; X2, X1 n.c.; RST - Vss.
5. Icc is measured with all output pins disconnected; Xl driven with tClCH, tCHCl - 5ns, Vil - Vss + O.5V, VIH = Vcc - O.5V; X2 n.c.; RST -
port 0 - Vcc. ICC will be slightly higher il a crystal oscillator is used.
6. Idle Icc is measured with all output pins disconnected; Xl driven with tClCH, tCHCl - 5ns. Vil - VSS + O.5V, VIH - Vcc - O.5V; X2 n.c.;
port 0 - VCC; RST - VSS.
7. load capacitance lor ports - SOpF.
8. The resistor ladder network is not disconnected in the power down or idle modes. Thus, to conserve power, the user may remove AVec.
9. II the AID lunction is not required, or il the AID lunction is only needed periodically. AVCC may be removed without affecting the
operation 01 the digital circuitry. Contents 01 ADCON and ADAT are not guaranteed to be valid. Digital inputs on P1.0-P1.4 will not
lunction normally.
AC ELECTRICAL CHARACTERISTICS TA - DoC to +70°C or TA - -40°C to +85°C, VCC - 5V±10%, Vss - OV3, 7
3.5 12
l/tCLCL Oscillator frequency 3.5 16 MHz
0.5 12
AC SYMBOL DESIGNATIONS
Each timing symbol has five characters. The first character is H - Logic level high
always 't' (- time). The other characters, depending on their L - Logic level low
positions, indicate the name of a signal or the logical status of Q - Output data
that Signal. The designations are: T - Time
C - Clock V - Valid
D - I nput data X - No longer a valid logic level
Z - Float
vcc~.I1
~CI.2\t:c+Q.8
CI.2 \t:c _0.1
IIAIIV
DMV
V
D.2 \t:c +D.8
__________-J~~._~Q.:2~\t:c~-O'~I----------------.
X ,.__~---------
20
/
V
18
16
/
14
/
t
..: 12
/ TYP ACTIVE lee 5
E
.2 10
/ /"
8
/'
/'
6 /'
V
4
2
/'
4
-- 8
FREQ - MHz
12
l---- MAX IDLE lee 6
TYP IDLE lee 6
16
PROGRAMMING CONSIDERATIONS these pins function as normal quasi- Encryption Key Table
bidirectional I/O ports and the program- The 87C752 includes a 16 byte EPROM
EPROM Characteristics ming equipment may pull these lines low. array that is programmable by the end
The 87C752 is programmed by using a However, prior to sending the 10 bit user. The contents of this array can then
modified Quick-Pulse Programming algo- code on the reset pin, the programming be used to encrypt the program memory
rithm similar to that used for devices equipment should drive these pins high contents during a program memory verify
such as the 87C451 and 87C51. It differs (V,H). The RESET pin may now be used operation. When a program memory ver-
from these devices in that a serial data as the serial data input for the data ify operation is performed, the contents
stream is used to place the 87C752 in stream which places the 87C752 in the of the program memory location is
the programming mode. programming mode. Data bits are XNOR'ed with one of the bytes in the 16
sampled during the clock high time and byte encryption table. The resulting data
Figure 4 shows a block diagram of the
thus should only change during the time pattern is then provided to port 1 as the
programming configuration for the
that the clock is low. Following transmis- verify data. The encryption mechanism
87C752. Port pin PO.2 is used as the
sion of the last data bit, the RES ET pin can be disabled, in essence, by leaving
programming voltage supply input (Vpp
should be held low. the bytes in the encryption table in their
signal). Port pin PO.1 is used as the pro-
erased state (FFH) since the XNOR
gram (PGM!) signal. This pin is used for Next the address information for the lo- product of a bit with a logical one will
the 25 programming pulses. cation to be programmed is placed on result in the original bit. The encryption
port 3 and ASEL used to perform the bytes are mapped with the code memory
Port 3 is used as the address input for
address multiplexing, as previously de- in 16 byte groups. The first byte in code
the byte to be programmed and accepts
scribed. At this time, port 1 functions as memory will be encrypted with the first
both the high and low components of the
an output. byte in the encryption table; the second
eleven bit address. Multiplexing of these
address components is performed using byte in code memory will be encrypted
A high voltage Vpp level is then applied with the second byte in the encryption
the AS EL input. The user should drive to the Vpp input (PO.2). (This sets Port 1
the ASEL input high and then drive port table and so forth up to and including
as an input port.). The data to be pro- the sixteenth byte. The encryption re-
3 with the high order bits of the address. grammed into the EPROM array is then
ASEL should remain high for at least 13 peats in 16 byte groups; the seventeenth
placed on Port 1. This is followed by a byte in the code memory will be en-
clock cycles. AS EL may then be driven series of programming pulses applied to
low which latches the high order bits of crypted with the first byte in the encryp-
the PGM/ pin (PO.l). These pulses are tion table, and so forth.
the address internally. The high address created by driving PO. 1 low and then
should remain on port 3 for at least two high. This pulse is repeated until a total Security Bits
clock cycles after ASEL is driven low. of twenty-five programming pulses have Two security bits, security bit 1 and se-
Port 3 may then be driven with the low occurred. At the conclusion of the last curity bit 2, are provided to limit access
byte of the address. The low address will pulse, the PGM/ signal should remain to the US ER EPROM and encryption
be internally stable 13 clock cycles later. high. key arrays. Security bit 1 is the program
The address will remain stable provided
inhibit bit, and once programmed per-
that the low byte placed on port 3 is The Vpp signal may now be driven to the forms the following functions:
held stable and ASEL is kept low. Note: VOH level, placing the 87C752 in the 1. Additional programming of the US-
ASEL needs to be pulsed high only to verify mode. (Port 1 is now used as an ER EPROM is inhibited.
change the high byte of the address. output port.). After 4 machine cycles (48 2. Additional programming of the en-
clock periods) the contents of the ad- cryption key is inhibited.
Port 1 is used as a bidirectional data bus dressed location in the EPROM array will
during programming and verify opera- 3. Verification of the encryption key is
appear on Port 1. inhibited.
tions. During the programming mode, it
accepts the byte to be programmed. 4. Verification of the USER EPROM and
The next programming cycle may now
During the verify mode, it provides the the security bit levels may still be
be initiated by placing the address infor-
contents of the EPROM location specI- performed.
mation at the inputs of the multiplexed
fied by the address which has been sup- buffers, driving the Vpp pin to the Vpp (If the encryption key array is being
plied to Port 3. voltage level, providing the byte to be used, this security bit should be pro-
programmed to Port 1 and issuing the 25 grammed by the user to prevent un-
The XTAl1 pin is the oscillator input and programming pulses on the PGM/ pin,
receives the master system clock. This authorized parties from reprogramming
bringing Vpp back down to the Vee level the encryption key to all logical zero
clock should be between 1.2 and 6 and verifying the byte.
MHz. bits. Such programming would provide
data during a verify cycle that is the
Programming Modes
The RESET pin is used to accept the logical compliment of the USER EPROM
The 87C752 has four programming fea-
serial data stream that places the contents.)
tures incorporated within its EPROM ar-
87C752 into various programming modes. ray. These include the USER EPROM for
This pattern consists of a 1O-bit code Security bit 2, the verify inhibit bit, pre-
storage of the application's code, a six- vents verification of both the USER
with the LSB sent first. Each bit is syn- teen byte encryption KEY array and two
chronized to the clock input, X1 . EPROM array and the encryption key
security bits. Programming and verifica- arrays. The security bit levels may still
tion of these four elements are selected be verified.
Programming Operation
Figures 5 and 6 show the timing dia- by a combination of the serial data
stream applied to the RESET pin and the
grams for the program/verify cycle.
RESET should initially be held high for at voltage levels applied to port pins PO. 1
least two machine cycles. PO.1 (PGM!) and PO.2. The various combinations are
shown in Table 3.
and PO.2 (Vpp) will be at VOH as a result
of the RESET operation. At this point,
Programming and Verifying Port 1.7 contains the security bit 1 data fects, it is recommended that an
Security Bits and is a logical one if programmed and a opaque label be placed over the win-
Security bits are programmed employing logical zero if erased. Likewise, P1.6 dow. For elevated temperature or sol-
the same techniques used to program contains the security bit 2 data and is a vent environments, use Kapton tape
the USER EPROM and KEY arrays using logical one if programmed and a logical Fluorglas part number 2345-5 or equiv-
serial data streams and logic levels on zero if erased. alent. A/D performance is not guaran-
port pins indicated in Table 3. When pro- teed unless window is covered.
gramming either security bit, it is not E rasure Characteristics
necessary to provide address or data in- Erasure of the EPROM begins to occur The recommended erasure procedure is
formation to the 87C752 on ports 1 and when the chip is exposed to light with exposure to ultraviolet light (at 2537
3. wavelengths shorter than approximately angstroms) to an integrated dose of at
4,000 angstroms. Since sunlight and least 15W-sec/cm2. Exposing the
Verification occurs in a similar manner fluorescent lighting have wavelengths in EPROM to an ultraviolet lamp of
using the RES ET serial stream shown in this range, exposure to these light 12,000)1W/cm2 rating for 20 to 39 min-
Table 3. Port 3 is not required to be sources over an extended time (about 1 utes, at a distance of about 1 inch,
driven and the results of the verify op- week in sunlight, or 3 years in room level should be sufficient.
eration will appear on ports 1.6 and 1.7. fluorescent lighting) could cause inadver-
tent erasure. For this and secondary ef- Erasure leaves the array in an all 1s
state.
EPROM PROGRAMMING AND VERIFICATION CHARACTERISTICS TA - 21°C to +27"C, VCC - 5V:±:10%, VSS - OV
87C752
VCC i - - + 5 V
1.0-1.10 PJ.Il-f>J.7
Vss
~
ADDRESS STROBE PO.O/ASEL
PROCRAMMING
PULSES PO.l
Y RESET
CONTROL
LOGIC
1
I
RESET
XTALI
MIN 2 MACHINE
jo--CYCLES .1. TEN BIT SERIAL COOE -I
RESET~ N ~1~B~IT~0~~B~IT~1-L~B~IT~2-L~B~IT~J~I~B~IT~4~I~B~rr~5~I~B~IT~8~~B~IT_7~~B~IT~8~~BI~T~9~1______
PO.2 UNDEFINED I
PO. 1 UNDEFINED I
-<'" 0 en
<0
(j) s:
(;'
0> (3
<0 (j) '0
(3
::J ()
(Q \I)
(l)
I
~
'U
0
12.75V :::r 8.c:
()
PO.2 (Vpp) 5V
/ \ 5V
"0
CO
en
I
H tSHGL 25 PULSES H t GHSL CD
;::::;:
I
I I
~
'T1
iD:
PO,l (PGM) L ___ .5L.JL~TI..J o·
,
!;
co
!"
H t GLGH H t GHGL
0
(')
..
"'C
0
rtMASELl
98us MIN 1Qus MIN 0
::J
,.....
~~~7
~
~
(")
X X
.
PORT 3 HIGH ADDRESS LOW ADDRESS
'<
n
HtADSTA H t DVGL
tGHDXI_
'I' tAVQV-j
I- +
VERIFY MODE PROGRAM MODE VERIFY MODE
'I' 'I
"0
~
3'
5'
0>
(j) ~
CO en
'0
-....,J \I)
o-...,J ()
:::;;
(;'
<.T1
I\.)
o·~
"
Signetics Section 3
Application Notes
Microprocessor Products
INDEX
AN408 SC80C451 Operation of Port 6 ..................... 3-1
AN417 256K Centronics Printer Buffer-
Using the SC87C451 Microcontroller . . . . . . . . . . . . . . .. 3-12
AN418 CounterfTimer 2 of the 83C552 . . . . . . . . . . . . . . . . . . .. 3-26
AN420 Using up to 5 External Interrupts on 8051 Family
Microcontrollers .............................. " 3-33
Signetics AN408
SC80C451 Operation of
Port 6
Application Note
Microprocessor Division
HOST
PROCESSOR
• ..
Ill!
WI!
r--
r--- I
-~
WI! Ill!
,
DO-D7
,, I
sa IIlIIIlIIIPI
(AFLAII)
~
i"-
f--
-- -
74HCT373
LA1tlH ill!
r-- 811. e0C451
ADDRESS
~
II!
ADDRESS (BF1.AO) IIIT6
,A- ~
ADO-AlJ7
ALE
,
D!
NJ
iliL -'" - t __ Jt
AI-/IA
o...._
II j,.
" "'"---
SOFTWARE EXAMPLES Input buffer luliliag (CSR bit 0). lIthe flag is Conversely tha 80C451 polls the ISF flag and
To write to port 6 on the bus shown in Figure clear the host writes a byte to address reads a byte from port 6 when ~ finds the flag
I, the host processor first reads the CSR 8000H. This loads the input buffer latch of set. The flag is automatically reset when this
contents at address 8001 H, and tests the port 6 and sets the input buffer full flag. internal read 0CCUfS.
1 1 1 1 1 1
USING PORT 6 AS A
STANDARD QUASI·
BIDIRECTIONAL 1/0 PORT
To use port 6 as a common II 0 port, all 01 the
control pins are tied to ground (see Figure 3).
On hardware reset, bits 2 - 7 in the CSR are
set to one. Port operation and electrical
characteristics become identical to port 1 on
the aOCSl and the 80C451 ports I, 4, and 5.
No software initialization is required.
" desired, AFLAG and BFLAG can be used Figure 3_ Standard I/O Port on Reset Figure 4. Standard 110 Port on Reset
as outputs while port 6 is operating as a with AFLAG and BFLAG as Outputs
standard quasi-bidirectional 110 port (see Fig-
ure 4). In this case, only iDS and ODS are tied common printer to be handled by a single
chip: 4. The RAM addressing ability 01 ports 0
to ground and the CSR is initialized to allow and 2 can be used to address up to 64K
operation 01 AFLAG and BFLAG as simple 1. The features 01 port 6 allow a parallel
bytes 01 a hardware buffer/spooler. AF-
outputs (see Figure 5). printer port to be designed with only line
LAG and BFLAG as simple outputs (see
driving and receiving chips required as
Figure 5).
additional hardware.
5. The 64K byte ROM addressing capability
IMPLEMENTATION OF 2. The onboard UART allows RS232 inter-
allows space for the most sophisticated
PARALLEL PRINTER PORTS facing with only level shifting chips add-
software.
USING PORT 6 ed.
The 80C451 is an excellent choice lor a 3. The B-bit parallel ports 0 to 6 are ample In addition, either end 01 a parallel interface
printer controller. The 80C451 has the lacili- to drive onboard control functions, even can be implemented using port 6, and the
ties to permit all 01 the intelligent leatures 01 a when ports are used for external memory interfaces can be interrupt driven or polled in
access, interrupts and other functions. either case.
Figure 5_ CSR Programmed to Allow AFLAG and BFLAG to Operate as Outputs and Port 6 as a Standard 110 Port
7 25 DATA 6 32 ~
a 26 DATA 7 33 GROUND RETURN
9 27 DATA a 36 ~
10 2B ACKNLG
11 29 BUSY
DATA_
STROBE _ _ P~~t~~=V-,,::O;::;;'I~-l-+------------
>r_
RECEIVER GeNERATED SIGNALS
HANDSHAKE TYPE 1
: -----J/----------t-,..--~-f-=-y-
HANDSHAKE TYPE 2
THE INTERFACE printers using generic parallel interfaces. This Type 2 - Another style of handshake gener-
Data transfer on a parallel printer interface fact influences the design of both port hard- ates a busy signal only when the printer will
occurs across eleven signal lines. The other ware and software. A good transmitter should not be aple to accept more data for a
conductors on the standard plug are used as be able to drive devices with all three styles relatively long time. Acknowledge pulses are
ground returns or for auxiliary functions (see of handshakes and a good receiver should created after every byte received. When the
Figure 6). Only the data transfer signals will generate the handshake most likely compati- busy signal is generated after a byte is
be considered. ble with any transmitter. received, the associated acknowledge pulse
does. not occur until after the busy signal
The Data Transfer Format The Variations returns to logic zero. (see Figure 7).
The parallel printer interfaces are far more Type 1 - Figure 7 shows a common style of
standardized in features than their serial handshake and is the style that will be imple- Type 3 - A third handshake style does not
counterpart. However at least three signifi- mented in the receiver examples. A busy generate acknowledge pulses. but a busy
eant variations exist in handshake style in signal and an acknowledge strobe pulse are signal is produced after every byte is re-
generated for every byte received. ceived.
PARALLEL PRINTER The GSR is programmed to the output only 3. The OBF is cleared on the positive edge
mode. In this mode the ODS pin does not of the ODS input.
INTERFACES USING POLLING
control the output drivers but only the output 4. The IBF flag is cleared on the negative
Transmitter Operation buffer full flag. The flag serves to record the edge of the lOS strobe.
This application illustrates the flexibility of the positive transition of the acknowledge signal.
port 6 logic in solving an applications prob- The input latch is not used, but the IDS pin is NOTE:
lem. We need to be able to handle all types of used to set the input buffer full flag. This is With this combination of modes set, port 6 is
acknowledge signals that might be received used to record the negative transition at the in the output only mode.
by the transmitter. We will use the ODS pin end of the busy signal. Dummy reads by the Receiver Operation
and output buffer full flag logic to record the 80C451 of port 6 will be used to clear the flag. In receiver operation, the IDS input is used to
receipt of the acknowledge pulse (see Figure In this example, the AFLAG mode is set only latch in the data transmitted on receipt of the
8), but not all parallel receivers generate to place the port in the output only mode. The strobe pulse. The receiver's GSR is pro-
acknowledge pulses. We could poll the busy AFLAG pin is not actually used (see Figure grammed to allow the following:
signal line, but not all receivers generate busy 10). 1. The input buffer full flag is output through
signals for each byte received; so lack of a
The transmitter's GSR (control status regis- the BFLAG pin and is used as the busy
busy signal does not imply that we can send
ter) is programmed to the following mode signal to the transmitter.
another byte. We can, however, expect an
(see Figure 9): 2. The IBF flag is set and data is latched on
acknowledge pulse very shortly after the end
of a busy signal if one is going to arrive at all. 1. GSR bit 6 controls the BFLAG output and the positive edge of IDS.
So we can send a new data byte after having therefore the strobe line. 3. Writing to the GSR bit 4 controls the
received either a positive transition on the 2. The OBF (output buffer full) flag controls AFLAG output and therefore the ac-
acknowledge line, or shortly after receiving a the AFLAG output. knowledge line.
negative edge on the busy line.
BUS BUS
DRIVER RECEIVER
AFLAG
TRANSMITTER RECEIVER
SOFTWARE EXAMPLES
This polled parallel transmit routine outputs one byte passed to it in the accumulator.
MOV CSR,#OS4H ;INITIALIZE PORT S OPERATING MODE
JB P5.0 ;WAIT IF BUSY SIGNAL IS HIGH
MOV PS,ACC ;OUTPUT DATA
MOV R1,PS ;DUMMY READ TO CLEAR IBF FLAG
MOV R1,#02H ;INITIALIZE DELAY COUNTER
CLEAR CSR.S ;START STROBE PULSE
DJNZ R1,$ ;TIME S MICROSECOND STROBE PULSE
SETB CSR.S ;END STROBE PULSE
WAIT: JNB CSR.1.0UT ;EXIT IF ACKNOWLEDGE RCV'D
JNB CSR.O.WAIT ;EXIT IF NEGATIVE BUSY EDGE RCV'D
RET
This polled parallel receive routine places one byte in the accumulator each time it is called.
P INIT: MOV CSR,#09CH ;INITIALIZE PORT S OPERATING MODE
MOV R7,PS ;DUMMY READ TO CLEAR IBF FLAG
PIN: JNB CSR.O ;INPUT BUFFER LATCH FULL?
CLR CSR.4 ;BEGIN ACKNOWLEDGE PULSE
MOV R7,#02H ;INITIALIZE DELAY COUNTER
DJNZ R7,$ ;TIME ACKNOWLEDGE PULSE
MOV A,PS ;READ BYTE - CLEAR BUSY SIGNAL
MOV R7,#02H ;INITIALIZE DELAY COUNTER
DJNZ R7,$ ;TIME ACKNOWLEDGE PULSE
SETB CSR.4 ;END ACKNOWLEDGE PULSE
RET
INTERRUPT DRIVEN PARALLEL transmitter that another byte may be transmit- 1. The input buffer full flag is output through
ted. The transmitting 83C451 is free to do the BFLAG pin and is used as the busy
PRINTER INTERFACE
other tasks prior to this interrupt. signal to the transmitter. The IBF flag is
Transmitter Operation set and data is latched on the positive
In this routine, Figure 15, the main program
The transmitter's CSR (control status regis- edge of IDS.
establishes a buffer in data memory ended by
ter) is programmed to the following mode 2. Writing to the eSR bit 4 controls the
an ASCII end of text character. To begin
(see Figure t4): AFLAG output and therefore the ac·
outputting the buffer the routine PSEND is
1. CSR bit 6 controls the BFLAG output and called. The rest of the buffer is emptied by the knowledge line.
therefore the strobe line. interrupt vectors to PSENDI. The receiver is interrupted on the negative
2. The OBF (output buffer full) flag controls edge of the data strobe. Data is latched in on
the AFLAG output. For printers which generate acknowledge
pulses, output rates of 25k transfers per the positive edge of the strobe pulse (see
3. The OBF is cleared on the positive edge Figure 17). Since the strobe pulse is normally
second are achieved. Timer generated inter·
of the ODS (output data strobe) input. very short there is little time lost between
rupts are used to periodically return program
4. Tha IBF flag is set on the negative edge execution to the routine to service non-ac- receiving the interrupt and having valid data in
of the IDS (input data strobe) pin. knowledging printers and to provide a timeout the input latch. The receiver is free to do
feature. Non acknowledging printers are ser- other tasks prior to receiving the INTO inter·
NOTE:
viced at a rate of about 2.5k transfers per rupt.
With this combination of AFLAG and BFLAG
modes set, port 6 is in the output only mode. second. This maximum rate may be varied by
The output drivers are always enabled and adjusting the timer reload value. As written,
the time out procedure attempts to retransmit SOFTWARE EXAMPLES
the 008 input is only used to clear the OBF
a byte when the printer has not acknowl- The software for the interrupt driven parallel
flag.
edged for an excessively long time. receiver is similar to the polled receiver exam-
INTO is programmed to be negative edge ple. However, after an interrupt is received,
sensitive and is connected to the OBF flag Receiver Operation this routine checks to confirm that data has
through the AFLAG pin. The OBF is cleared In receiver operation, the iDS input is used to been latched by the positive edge of the
on the positive edge of 008. The net result is latch in the data transmitted on receipt of the strobe pulse before proceeding with the rou-
that INTO is triggered on the end of the ACK strobe pulse. The receiver's CSR is pro- tine.
pulse (a positive edge). This signals the grammed to allow the following (see Figure
16):
lm 1.-<l-f-"':'::;;':"+-<3---I AFLAG
P6 P6
BOC451 BOC451
BUS BUS
DRIVER RECEIVER
TRANSMmER RECEIVER
Figure 14. CSR Programming for Use as an Interrupt Driven Parallel Transmitter
SET DPTR TO
START OF RAM
BUFFER
DISABLE
INTERRUPTS
STOP AND
RESET TIMER
ENABLE INTO,
START STROBE
DISABLE INTO
INCREMENT DPTR
END STROBE
START TIMER.
ENABLE
INTERRUPTS
RETURN TO
INTERRUPTED
PROGRAM
Figure 16. C5R Programming for Use as an Interrupt Driven Parallel Receiver
SOFTWARE EXAMPLES
The software for the interrupt driven parallel receiver is similar to the polled receiver example. However, after an interrupt is received, this routine
checks to confirm that data has been latched by the positive edge of the strobe pulse before proceeding with the routine.
This is the software for the interrupt driven parallel transmitter example.
; XMIT ROUTINE DRIVEN BY ACK PULSE GENERATED INTERRUPTS, OR TIMER GENERATED INTERRUPTS
; FOR NON ACKNOWLEDGING PRINTERS. READS DATA BUFFER IN EXTERNAL RAM STARTING AT 100H
; AND READING UNTIL 04H IS FOUND.
ORG RESET
JMP 26H
ORG TIMERO
JMP PSEND1
ORG EXTIO
JMP PSEND1
ORG 26H
MOV CSR,#064H ;PORT 6 MODE
MOV TMOD,#002H ;CONFIGURE TIMER 0 TO 16 BITS
SETB TOO ;INTO IS EDGE TRIGGERED
SETB EA ;ENABLE INTERRUPTS
PSEND: MOV DPTR,#0100H ;SET DPTR TO START OF TEXT
;BUFFER
PSEND1: CLR EA ;DISABLE INTERRUPTS AND STOP
;TIMER
CLR TRO ;IF ENABLED
CLR ETO
MOV R7,00H ;CLEAR TIMEOUT COUNTER
MOV R6,00H
MOV THO,#-4 ;SET TIMER INTERRUPT PERIOD
MOV TLO,#OOH
JB OCBH,BB ;BUS BUSY
MOV ACC,#OOH ;CLEAR ACCUMULATOR
MOVX A,@DPTR ;RETRIEVE FIRST BYTE
MOV P6,ACC ;OUTPUT FIRST BYTE
CJNE A.#004H, CONT1 ;LOOK FOR END OF TEXT
JMP EOTB
CONT1: SETB EXO ;ENABLE INTO
CLR OEEH ;START STROBE PULSE
INC DPTR
MOV ACC,DPH ;LOOK FOR PHYSICAL END OF
JB ACC.2,EOTB ;TEXT BUFFER
SETB OEEH ;END STROBE PULSE
JMP CONT
EOTB: CLR EXO ;END OF TEXT FOUND, DISABLE
;INTO
SETB OEEH
SETB EA
RETI
BB: INC R7 ;COUNT TIMER TIMEOUTS ON
;BUS BUSY
CJNE R7,#00H, CONT ;LOOK FOR OVERFLOW
INC R6 ;COUNT OVERFLOWS
CJNE R6,#10H, CONT ;TIMEOUT APPROX 5 SEC
JMP TO
CONT: SETB TRO ;ENABLE TIMER INTERRUPT
SETB ETO ;START TIMER
SETB EA
RETI
TO: CLR OC9H ;SEND NEW STROBE PULSE IN
;RESPONSE TO TIMEOUT
NOP
NOP
MOV R6,#OOH ;RESET TO COUNTER
MOV R7.#OOH
SETB OC9H ;END OF STROBE PULSE
JMP PSEND1
DESCRIPTION In this note, port 6 is used in the 1/0 using a dummy MOVX @RO,A (move to
This application note describes a stand mode as a Centronics compatible printer external data memory) instruction. This
alone Centronics type parallel printer output port. Additionally, the liDS and allows DRAM refresh to be done much
buffer using the Signetics SC87C451 ex- BFLAG pins normally associated with more quickly than would otherwise be
panded 1/0 microcontroller. This type of port 6 are used as part of the input port possible.
unit would typically be placed between a logic. For a complete discussion of port
personal computer and its printer. It cap- 6 operating modes and programming, Port 1 and one bit from port 4 form the
tures the data to be printed at high see the Signetics application note AN- 9-bit address required when addressing
speed, freeing the personal computer to 408 titled "SC83C451 Microcontroller- the DRAM array. The data inputs to the
go on to other tasks, and sends data to Operation of Port 6". array come from the parallel input data
the printer as required. As described lines which are latched by U4. The RAM
here, 256K dynamic RAMs are used, Circuit Description data outputs are fed to port 5. By mak-
providing over one quarter million char- Figure 1 is a schematic diagram of the ing the data outputs available to the
acters of storage. If desired the design is printer buffer circuit. Other than the processor, it is possible to add some ad-
easily modified to work with 1 megabit 87C451 (U1), and the eight 256K DRAMs ditional features to the firmware, such as
DRAMs. Although written with the 87C- (U5-U12). only two 74LS244 buffers control codes for printing multiple copies
451 in mind, this design is applicable to (U2, U3) and a 74HCT374 (U4) octal flip of a document, data compression, data
the 80C451 and 83C451. flop are needed. The U2 and U3 buffers conversion, etc. which are not imple-
are included to provide full drive capabil- mented in this design.
Design Objectives ity for the output port and some of the
The objectives kept in mind during the handshake signals on the input port, as Port 6 Operation
design of this device were: provide a the output buffers on the 87C451 can The liDS (input Data Strobe) and
substantial size of buffer, keep the parts only drive 3 LSTIL loads. U4 has 8-bit BFLAG pins are normally used in con-
count and the power consumption to a data strobed into it by the ISTB pulse of junction with the port 6 bidirectional
minimum, and use readily available com- the input port. mode. In this mode, the liDS pin is used
ponents. to strobe data into the port 6 input
As the code size for this application is latches, and BFLAG is used as flag out-
A buffer size of 256k bytes was chosen quite small (less than 1 K bytes). the on put. In this application however, these
because, although a 64K byte buffer is chip instruction memory is quite suffi- two bits are used to good effect as part
very easily implemented using the 8051 cient for program storage. For a produc- of the (separate) input port logic. When
family's 64K external data storage capa- tion version, the 87C451 could be re- a byte of data is strobed into U4 by the
bilities, it is a little too small for today's placed with the Signetics 83C451 with a printer port of the host computer, the
printing applications that print a page of 4K X 8 masked ROM on chip. Note that ISTB signal connected to liDS sets the
text in graphics mode, using up twenty Port 0 and Port 1 are not used in the input buffer full flag (IBF). BFLAG is
times as many bytes as standard printing present design, thus the 80C451 may be programmed to mirror the contents of
mode. Presenting a method for control- used in this application with the addition I BF, and therefore becomes asserted.
ling 256K DRAMs shows off the 1/0 ca- of an external address latch and E- This makes it ideal to be used as the
pabilities of the 87C451, and it is very PROM. BUSY output for the input port. After the
easy to add the extra address line for input port data has been read and stored
one megabit devices if a larger buffer is The IRAS, ICAS, and IWR signals for in the RAM buffer, BFLAG is de-asserted
needed. the DRAM array are provided by port 3 by performing a dummy read of port 6,
bits IWR, IRD, and n. Note that as in which clears IBF. To complete the input
The SC8XC451 Microcontroller the 80C51 , all port 3 signals are mlti- port logic, one of the port 3 pins, P3.4 is
The 8XC451 is an 8-bit microcontroller functional. That is, each can be treated used as the acknowledge signal, and is
based on the familiar 8051 family of de- a regular quasi-bidirectional port bit, or assertedl de-asserted by software. The
vices. In fact, it is an 80C51 with three as having the special function indicated 10DS pin is tied to ground to permanent-
added ports: P4, P5 and P6. Ports 4 and by its name. This feature is an advan- ly enable the port 6 output drivers. This
5 give 12 (16 in PLCC) additional quasi- tage when using IWR and IRD as IRAS does not cause difficulty as no data is
bidirectional 1/0 lines. Port 6 provides and ICAS control signals for a DRAM being inp"t into the port.
another 8 bits of 1/0, plus 4 handshake array. Treated as a normal port bit, the
lines that can be programmed to operate IWR pin is cleared and set by individual Note that programming port 6 to operate
in several useful modes for interfacing. CLR and SETB instructions for a normal in the bidirectional mode as described
The 8XC451 comes in three versions; length RAM read or write cycle. How- above means the loss of laDS as an
ROM-less 80C451, 83C451 with 4K x 8 ever, when performing a refresh cycle, acknowledge input. The acknowledge
ROM, and 87C451 with 4K x 8 EPROM. IRAS (port 3 /WR) can be pulsed low input is normally used to clear the OBF
og~
08
05 PRINTER
OUTPUT
PORT
:
:
::J
0
(J)
~
'0
a
c
P6.1 741.S244 02 "U 0
PS.o 55 OEa OEb 0 01 :::::!, en
IODS~ 4...he %s ::J
AFLAG 58 8 J
,I),
-
- -
-
I 1 0
1.-----------------'
0 0
.-+
CD
.....
1. 12L14
~ rn
c
-+>
." -+>
eli' CD
e:: .....
;
~
(f)
n !L !L 14
v.> ::r !L !L !L 14Q 8X
Q
....
I ~
3
Q Q Q Q Q
-:}:
51C258 OR 4125S
.I> 2l.
n' Voo
0
iii'
'!lIl>
US U7 U8 us U10 U11
U12 kT..L EACH
0.11£
Vss 18 DRAM
3
INPUT
PORT
(J)
~ ()
ex> ~ri'
-....j
~
() 0'
:::l
~
(]l Z
...... ;
o
Signetics Microprocessor Products Application Note
REPEATED
64 TIMES
j*******************************************************i
SIGNETICS CORPORATION
October, 1988
i*******************************************************i
$Mod451
$Title(8XC451 Printer Buffer)
$Date(lO/28/88)
PORT USAGE:
; Miscellaneous Equates:
i***************************************************** ***********************
ORG 18h
START: MOV SP,#40h Initialize stack pointer.
MOV A,#OO
MOV REFCNT,A Initialize refresh counter.
MOV INLOW, A Initialize FIFO pointers.
MOV INMID,A
MOV INHI,A
MOV OUTLOW,A
MOV OUTMID,A
MOV OUTHI,A
i***************************************************** ***********************
Main Routine:
Executes while not performing DRAM refresh or servicing
input port interrupt.
Check if input port busy flag was left asserted, indicating that
the buffer was full after last input. If so, acknowledge input
port and de-assert input busy signal.
NOP
NOP
MOV A,P6 Dummy read of P6 clears IBF (IBUSY).
NOP Wait 5 microseconds.
NOP
NOP
NOP
NOP
SETB lACK De-assert IIACK.
SETB EA Re-enable interrupts.
AJMP MAINLP Return to main loop.
;****************************************************************************
i***************************************************** ***********************
MOVX @Ro,A 12
INC PI
MOVX @RO,A 13
INC PI
MOVX @RO,A 14
INC PI
MOVX @RO,A 15
INC PI
MOVX @RO,A 16
INC PI
MOVX @RO,A 17
INC PI
MOVX @RO,A 18
INC PI
MOVX @RO,A 19
INC PI
MOVX @RO,A 20
INC PI
MOVX @RO,A 21
INC PI
MOVX @RO,A 22
INC PI
MOVX @RO,A 23
INC PI
MOVX @RO,A 24
INC PI
MOVX @RO,A 25
INC PI
MOVX @RO,A 26
INC PI
MOVX @RO,A 27
INC PI
MOVX @RO,A 28
INC PI
MOVX @RO,A 29
INC PI
MOVX @RO,A 30
INC PI
MOVX @RO,A 31
INC PI
MOVX @RO,A 32
INC PI
MOVX @RO,A 33
INC PI
MOVX @RO,A 34
INC PI
MOVX @RO,A 35
INC PI
MOVX @RO,A 36
INC PI
MOVX @RO,A 37
INC PI
MOVX @RO,A 38
INC PI
MOVX @RO,A 39
INC PI
MOVX @RO,A 40
INC PI
MOVX @RO,A 41
INC PI
MOVX @Ro,A 42
INC Pl
MOVX @RO,A 43
INC Pl
MOVX @RO,A 44
INC Pl
MOVX @RO,A 45
INC Pl
MOVX @RO,A 46
INC Pl
MOVX @RO,A 47
INC Pl
MOVX @RO,A 48
INC Pl
MOVX @RO,A 49
INC Pl
MOVX @RO,A 50
INC Pl
MOVX @RO,A 5l
INC Pl
MOVX @RO,A 52
INC Pl
MOVX @RO,A 53
INC Pl
MOVX @RO,A 54
INC Pl
MOVX @RO,A 55
INC Pl
MOVX @R0,A 56
INC Pl
MOVX @RO,A 57
INC Pl
MOVX @RO,A 58
INC PI
MOVX @R0,A 59
INC Pl
MOVX @RO,A 60
INC PI
MOVX @RO,A 6l
INC Pl
MOVX @RO,A 62
INC Pl
MOVX @RO,A 63
i***************************************************** ***********************
SJMP INDONE
END
Microprocessor Division
Introduction to the 83C552 16-Bit Counter Timer high transition and the prescaler is in-
The 83C552 is an 80C51 derivative with The description of Counter Timer 2 in the cremented. The prescaler is incremented
several extended features: 8k RO M, 256 following paragraphs is intended to be a in the second cycle after the cycle in
bytes RAM, 10-bit A/D converter, two general overview. Details on archi- which the transition was detected. If the
PWM channels, two serial I/O channels, tecture, address locations, interrupt transition is detected before S2P1 is fin-
six 8-bit I/O ports, and four counter tim- structure and timer operation are given ished, the prescalar is incremented in the
ers. The architecture of the 83C552 is in the 83C552 Users Manual. This users next cycle. This timing is shown in Fig-
identical to that of the 80C51 making the manual may be useful to complement the ure 2. Note that this sampling rate is
two devices fully code compatible. The material presented in this application twice that of the normal 80C51 timers,
additional peripheral functions are added note. References to registers, bits, I/O TO and T1, therefore T2 has twice the
to the 80C51 Special Function Register ports and on-chip hardware will relate maximum external counting rate as com-
space and the interrupt structure is modi- directly to 83C552 Users Manual nomen- pared to the standard timers.
fied accordingly. This information is de- clature. This application note will focus
tailed in other references on the 83C552. on the use of Counter Timer 2 as a pow- Any programming of the clock source or
The focus of this application note is on erful input capture and high speed out- the prescalar divide ratio results in a
one of the timers of the 83C552, Counter put facilitator through some specific ex- reset of the prescaler. This allows the
TImer 2. amples and not on the detailed coding. state of the timer subsystem to be in a
known state upon programming. The
This counter timer includes capture, The counter timer consists of a 16-bit main 16-bit timer can not be reset by
compare and high speed output capabili- counter which is readable by software software but it is reset by activating the
ties which facilitate many control orient- through special function registers TM2L reset pin or using the external reset,
ed tasks. The objective of this note is to and TM2H. The timer itself has two RT2. The external reset, RT2 can be en-
make users of the 83C552 aware of this overflow flags, one after the entire 16-bit abled or disabled by bit T2ER in
counter timer subsystem and assist the counter and one attached to the eighth TM2CON. These resets reset the pre-
use of this subsystem by a detailed ex- stage. This latter flag reflects an over- scalar as well as the 16-bit counter.
planation of its operation supported by flow from the first byte of the counter.
actual application examples. These two flags are present in register Only one interrupt is available from the
TM21R and are labeled T2BO for the 16-bit counter timer. Two bits in
Timer 2 of the 83C552 overflow from the first byte and T20V for TM2CON control whether TM2L, TM2H,
Timer 2 of the 83C552 is in fact a timing the overflow from the entire 16-bits. or both flags will be used to generate the
controller and has an associated pro- These flags may be used to generate an interrupt. A selection for no interrupt is
grammable array. The Timer 2 subsystem interrupt. also possible.
consists of three parts:
The counter timer is controlled directly Capture System
1. the time base consists of a 16-bit through the special function register The capture system is a powerful tool to
timer with a 3-bit prescalar. The TM2CON, the timer 2 control register. measure the width of pulses or repeti-
master clock for the subsystem can This register also contains certain status tion rates. There are four independent
be derived from the on-chip oscillator flags. inputs for the signals to be analyzed,
(fose) or an external input, T2. It has CTIO through CTI3. These inputs are al-
an external reset, RT2, by which a The prescaler divides the input clock by ternate functions to Port 1. Each input is
signal applied to this input can reset a progammable ratio. The prescaler di- connected to a dedicated capture regis-
the timer if the external reset is vide value is progammable to divide by ter. A transition at any of these inputs
enabled. 1, 2, 4, or 8 as controlled by T2PO and will cause the content of the 16-bit
2. a capture system consisting of four T2P1 in TM2CON. counter timer to be loaded into the re-
capture registers and four capture spective capture register. The capture
inputs which can be used for a wide The input clock to the prescalar is either can occur upon various conditions of the
variety of time measurements on ex- fosc / 12 or the external input, T2. The input signal as specified by certain bits in
ternal signals. clock input to the prescaler may also be the capture control register, CTCON.
3. a compare system consisting of three shut off. This clock input selection is Each input can be set to cause a cap-
compare registers and eight associ- controlled by bits T2MSO and T2MS1 in ture on a low to high tranSition, a high to
ated high-speed outputs which can TM2CON. low transition, or on both transitions. Up-
be activated upon a match between on a capture taking place, each input
the 16-blt timer and one of the com- If T2 is used as the input clock to the causes an interrupt flag to be set in the
pare registers. timer 2 subsystem, the hardware logic Timer 2 Interrupt Flag Register, TM21R.
samples this input and looks for a low to If enabled an interrupt will be genera-
For reference a complete block diagram high transition. If the logic detects a log-
ted.
of the 83C552 Counter Timer 2 subsys- ic 0 at the T2 input in state S2P1 of the
tem is shown in Figure 1. microcontroller and a logic 1 in state
S5P1, then this is recognized as a low to
off
6 8~bit
f---
overflow
~I PRESCALER T2 COUNTER
interrupt
I
16-bit overflow
interrupt
T2
.? J
RT2
T2ER
------<Of
external reset
enable
S R P4.0
S R P4.1
INT
S R P4.2
I/O port 4
S R P4.3~
S R P4.4 "r-Y
S R P4.5
TG T P4.6
TG T P4.7
STE RTE
One of the capture inputs is shown in end of this machine cycle. The interrupt which shows the compare system for
more detail in Figure 3. All of the other flag CTIO is also set. P4.S (a set - reset high speed output)
capture inputs are similar to this one. and P4.6 (a toggle high speed output).
The capture input is gated with the cap- Compare System
ture enable bits CTNO and CTPO which The compare system of Timer 2 can be There are two compare registers associ-
are located in CTCON. According to the used to generate a set of outputs whose ated with the set - reset outputs.
status of these bits, the desired edges transitions are controlled directly by the These registers are CMO and CMt. In
are selected to generate the capture en- time defined by the 16-bit counter timer. addition there are two enable registers:
able pulse. The input pulse transient de- There are eight of these high speed out- one to enable setting of an output and
tection is at the input of the enable pulse puts which are directly controlled from the other to enable resetting of an out-
generator. The input signal is sampled at Counter Timer 2. These outputs are al- put. These registers are STE and RTE
SI PI of the machine cycle. If a logic 1 ternate functions to Port 4. Six of these respectively. The content of CMO and
is detected when a logic 0 was detected outputs are set - reset controlled CM 1 are continuously compared to the
at the same time in the previous cycle, (CMSRO through CMSRS) and two are content of the 16-bit counter. Whenever
then the event is taken as a transition. toggle controlled (CMTO and CMT1). To there is a match between the 16-bit
An enable pulse is sent to the capture clarify the operation, these two types counter and the contents of CMO, a SET
register and the contents of timer 2 is will be discussed separately. I n the fol- pulse is generated. Similarly, whenever
copied into the capture register at the lowing discussions, refer to Figure 4 there is a match between the timer and
1 machine cycle
by transition 1 by transition 2
Counter
incremented
TM2 CTa
TM2H
TM2L
internal
bus
TM21R
~JlJ enable
CTOI pulse I
I
it
CTCON
S1P1J-LJL ________..J
I 1M i
Figure 3. Capture Subsystem for CTOI
TM21R
eMI
2
to
eMI Interrupt
t }
system
eMI
o
I- - - - 'i
Port P4
r---I
! !
P4.S
P4.6
P4.7
control
Toggle FF
: STE
!
STE.6
STE.7
Reference
I J J
T-stop
<:----------------------->
T-start
Cyl 1
<----->1 . . . . Jnj.~9:H?n•.•
Cyl 2
Cyl 3
Cyl 4
STE.1 is programmed to a 1 and STE. 0 As an example consider the interrupt Application Example -
is programmed to a O. Similarly, the next service routine for CMO. Upon entering Timed Ignition
interrupt for CM1 is treated in the same the routine, all interrupts are disabled. In electronic ignition systems, multiple
way and the sequence of events rotates Then the following actions are ignition coils may be used and each coil
around through all cylinders in turn. The performed: is fired by electronic means rather than
flag bits associated with this operation with the old stile mechanical breakers.
keep track of the injector sequencing. - set bit in STE to start next injector In a four cylinder engine, there may be
- clear bit in STE for injector just started two ingnition coils, one coil providing
While this example shows the injection - load CMO with start time for next spark for a pair of cylinders. Both plugs
stop time of one cylinder overlapping in- injector fire at the same time. For one cylinder,
to the injector on time of the subsequent - clear CMIO interrupt flag in TM21R the spark occurs at the appropriate time
cylinder, close examination of the opera- while for the other cylinder, the spark
tions described above reveal that the Now that the essential set up is made for
occurs at the end of the exhaust stroke
start and stop events are independent the next interrupt, all interrupts are now and has no effect. With timing referenc-
and can overlap or not as required. In enabled. However the return to the main
es to crankshaft top dead center provid-
this way all injectors may be driven in- program is not invoked until the following ed by an external sensor, the ignition
dependently and have overlapping on ancillary processing is completed:
timing for the engine may be generated
times. in the 83C552 and applied to the elec-
- calculate the next absolute start time tronic drivers for the ignition coils.
Given that this is an example applicable
to general usage, it is possible that in- for the next injector (the next load
value for CMO) To illustrate the toggle high speed out-
terrupt service routine could be relatively puts of the 83C552 Counter Timer 2
long as it would be in an actual injector subsystem, the following example will
- increment the flag so that the next
application. Since the service routine discuss the ignition timing in a four cylin-
entry to this interrupt service routine
has other interrupts disabled, the length der engine employing the two coil ap-
will be able to identify the next injec-
may cause real time conflicts. To elimi- proach with one coil for a pair of cylin-
tor to start.
nate this potential problem, the interrupt ders. The coil timing is illustrated in Fig-
service routines are divided into two The process performing these calcula- ure 6. A reference time is used which is
parts. I n the first part, all other interrupts tions can be interrupted to service real a given interval prior to top dead center
are disabled and the essential register time functions. so that the times used in the illustration
loading is done to prepare for the next can be always after the reference.
interrupt. After this is completed, all in- There are two times of interest for each
terrupts are enabled and the ancillary coil: the load time and the ignition point.
service routine functions are performed
prior to a return to the main routine.
Reference TDC
I II
Coil 1
-----~.-
Coil 2
The Serial Port I nterrupt is then used as Note that the response time for this input
a general purpose interrupt. The con- will be slower than for the Counter/Timer
tents of receive buffer should be ig- inputs. This is due to the fact that the RI
nored, and will subsequently be overwrit- is generated after the eighth serial data
ten during the next interrupt. bit time after the falling edge on RxD.
INDEX
12C Bus Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 4-1
12C Peripheral Selection Guide ............................... 4-13
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
Signetics 12C Bus
Specification
Linear Products
INTRODUCTION a receiver, while a memory can both receive - microcomputer A (master) addresses
For 8-bit applications, such as those requiring and transmit data. In addition to transmitters microcomputer B (slave)
single-chip microcomputers, certain design and receivers, devices can also be consid- - microcomputer A (master receiver)
criteria can be established: ered as masters or slaves when performing receives data from microcomputer B
• A complete system usually consists data transfers (see Table 1). A master is the (slave transmitter)
of at least one microcomputer and device which initiates a data transfer on the - microcomputer A terminates the
other peripheral devices, such as bus and generates the clock signals to permit transfer.
memories and 1/0 expanders. that transfer. At that time, any device ad-
dressed is considered a slave. Even in this case, the master (microcomputer
• The cost of connecting the various
A) generates the timing and terminates the
devices within the system must be The 12 C bus is a multi-master bus. This means
transfer.
kept to a minimum, that more than one device capable of control-
• Such a system usually performs a ling the bus can be connected to it. As The possibility of more than one microcompu-
control function and does not require masters are usually microcomputers, let's ter being connected to the 12 C bus means
high-speed data transfer. consider the case of a data transfer between that more than one master could try to initiate
• Overall efficiency depends on the two microcomputers connected to the 12C a data transfer at the same time. To avoid the
bus (Figure 1). This highlights the master- chaos that might ensue from such an event,
devices chosen and the
slave and receiver-transmitter relationships to an arbitration procedure has been developed.
interconnecting bus structure.
be found on the 12 C bus. It should be noted This procedure relies on the wired-AND con-
In order to produce a system to satisfy these that these relationships are not permanent, nection of all devices to the 12C bus.
criteria, a serial bus structure is needed. but only depend on the direction of data If two or more masters try to put information
Although serial buses don't have the through- transfer at that time. The transfer of data
put capability of parallel buses, they do re- on to the bus, the first to produce a one when
would follow in this way: the other produces a zero will lose the
quire less wiring and fewer connecting pins.
1) Suppose microcomputer A wants to send arbitration. The clock signals during arbitra-
However, a bus is not merely an interconnect-
information to microcomputer B tion are a synchronized combination of the
ing wire, it embodies all the formats and
- microcomputer A (master) addresses clocks generated by the masters using the
procedures for communication within the sys-
microcomputer B (slave) wired-AND connection to the SCL line (for
tem.
more detailed information concerning arbitra-
- microcomputer A (master transmitter)
Devices communicating with each other on a tion see Arbitration and Clock Generation).
serial bus must have some form of protocol sends data to microcomputer B (slave
receiver) Generation of clock Signals on the 12C bus is
which avoids all possibilities of confusion,
data loss and blockage of information. Fast - microcomputer A terminates the always the responsibility of master devices;
devices must be able to communicate with transfer. each master generates its own clock signals
when transferring data on the bus. Bus clock
slow devices. The system must not be depen- 2) If microcomputer A wants to receive infor- signals from a master can only be altered
dent on the devices connected to it, other- mation from microcomputer B when they are stretched by a slow slave
wise modifications or improvements would be
impossible. A procedure has also to be re-
solved to decide which device will be in
control of the bus and when. And if different
devices with different clock speeds are con-
nected to the bus, the bus clock source must
be defined.
All these criteria are involved in the specifica-
tion of the 12C bus.
Table 1. Definition of 12C Bus Terminology device holding down the clock line or by
another master when arbitration takes place.
TERM DESCRIPTION
Transmitter The device which sends data to the bus
Receiver The device which receives data from the bus
GENERAL CHARACTERISTICS
Both SDA and SCL are bidirectional lines,
Master The device which initiates a transfer, generates clock connected to a positive supply voltage via a
signals and terminates a transfer pull·up resistor (see Figure 2). When the bus
Slave The device addressed by a master is free, both lines are High. The output stages
of devices connected to the bus must have
Multi·master More than one master can attempt to control the an open-drain or open·collector in order to
bus at the same time without corrupting the message perform the wired-AND function. Data on the
Arbitration Procedure to ensure that if more than one master 12C bus can be transferred at a rate up to
simultaneously tries to control the bus, only one is 1OOkbitls.The number of devices connected
allowed to do so and the message is not corrupted to the bus is solely dependent on the limiting
Synchronization Procedure to synchronize the clock signals of two or bus capacitance of 400pF.
more devices
BIT TRANSFER
Due to the variety of different technology
-.,....-1~--- +VDD devices (CMOS, NMOS, 12L) which can be
connected to the 12C bus, the levels of the
logical 0 (Low) and 1 (High) are not fixed and
SOA (SERIAL DATA LINE) depend on the appropriate levi'll of VDD (see'
(SERIAL CLDCK LINE) Electrical Specifications). One clock pulse is
~L~---~~----i---+----~----;--- generated for each data bit transferred.
r------ I j------ -I Data Validity
I I I I The data on the SDA line must be stable
: ~LK1_l : : SCLK2-.J : during the High period of the clock. The High
lOUT I lOUT I or Low state of the data line can only change
I I I I
I I I I when the clock signal on the SCL line is Low
: ~LK DATA : : SCLK DATA :
(Figure 3).
I IN
1________________ ...J
IN I IL _______________ ...JI
IN IN
Start and Stop Conditions
Within the procedure of the 12 C bus, unique
DEVICE 1 DEVICE 2
situations arise which are defined as start and
stop conditions (see Figure 4).
Figure 2. Connection of Devices to the 12C Bus
A High·to-Low transition of the SDA line while
SCL is High is one such unique case. This
situation indicates a start condition.
A Low·to·High transition of the SDA line while
SCL is High defines a stop condition.
Start and stop conditions are always generat·
ed by the master. The bus is considered to be
busy after the start condition. The bus is
considered to be free again a certain time
after the stop condition. This bus free situa·
tion will be described later in detail.
Detection of start and stop conditions by
Figure 3. Bit Transfer on thel 2 C Bus
devices connected to the bus is easy if they
possess the necessary interfacing hardware.
However, microcomputers with no such inter·
SDA f\l
I I
C~ ill
I I
SDA
face have to sample the SDA line at least
twice per clock period in order to sense the
transition.
~L -t:1'-
L~J '--I
rt~ rr-t- ~L
'--I L~J TRANSFERRING DATA
START CONDITION STOP CONDITION Byte Format
Every byte put on the SDA line must be 8 bits
Figure 4. Start and Stop Conditions long. The number of bytes that can be
transmitted per transfer is unrestricted. Each
byte must be followed by an acknowledge bit.
December 1988 4-2
Signetics Linear Products
r--,
~
ACKNOWLEDGEMENT I I
SIGNAL FROM RECEIVER I I
I I
I I
I I
CLOCK UNE HELDLQWWHILE
I I
INTERRUPTS ARE SERVICED I I
1 -8
'i' rt-t
~V~K'\..../ I I P
L_...l
SlOP
CONDITION
DATA OUTPUT
BYTRANSMrlTER
f\
II \j1_
I
I ........
I
/ ___J X "'_ _ _.....
>C~ " -_ __
/
sc~~~ I I
Is I
L..::J
srART
CONDlnoN
Data is transferred with the most significant The receiving device has to pull down the slave leaves the data line High and the
bit (MSB) first (Figure 5). " a receiving device SDA line during the acknowledge clock pulse master generates the STOP condition.
cannot receive another complete byte of data so that the SDA line is stable Low during the
In the case of a master receiver involved in a
until it has performed some other function, for high period of this clock pulse (Figure 6). Of
transfer, it must signal an end of data to the
example, to service an internal interrupt, it course, setup and hold times must also be
slave transmitter by not generating an ac-
can hold the clock line SCL Low to force the taken into account and these will be de-
knowledge on the last byte that was clocked
transmitter into a wait state. Data transfer scribed in the Timing section.
out of the slave. The slave transmitter must
then continues when the receiver is ready for
Usually, a receiver which has been addressed release the data line to allow the master to
another byte of data and releases the clock
is obliged to generate an acknowledge after generate the STOP condition.
line SCL.
each byte has been received (except when
In some cases, it is permitted to use a the message starts with a CBUS address.
different format from the 12C bus format, such
When a slave receiver does not acknowledge
ARBITRATION AND CLOCK
as CBUS compatible devices. A message GENERATION
on the slave address, for example, because it
which starts with such an address can be
is unable to receive while it is performing Synchronization
terminated by the generation of a stop condi-
some real-time function, the data line must be All masters generate their own clock on the
tion, even during the transmission of a byte.
left High by the slave. The master can then SCL line to transfer messages on the 12C bus.
In this case, no acknowledge is generated.
generate a STOP condition to abort the Data is only valid during the clock High period
Acknowledge transfer. on the SCL line; therefore, a defined clock is
Data transfer with acknowledge is obligatory. needed if the bit-by-bit arbitration procedure
If a slave receiver does acknowledge the
The acknowledge-related clock pulse is gen- is to take place.
slave address, but some time later in the
erated by the master. The transmitting device
transfer cannot receive any more data bytes, Clock synchronization is performed using the
releases the SDA line (High) during the ac-
the master must again abort the transfer. This wired-AND connection of devices to the SCL
knowledge clock pulse.
is indicated by the slave not generating the LINE. This means that a High-to-Low transi-
acknowledge on the first byte following. The
December 1988 4-3
Signetics Linear Products
FORMATS master still wishes to communicate on the er and the slave receiver becomes a slave r"
Data transfers follow the format shown in bus, it can generate another start condition, transmitter. This acknowledge is still generat-
Figure 9. After the start condition, a slave and address another slave without first gener- ed by the slave.
address is sent. This address is 7 bits long; ating a stop condition. Various combinations
The stop condition is generated by the mas-
the eighth bit is a data direction bit (R/W). A of read/write formats are then possible within
ter.
zero indicates a transmission (WRITE); a one such a transfer.
indicates a request for data (READ). A data During a change of direction within a transfer,
At the moment of the first acknowledge, the
transfer is always terminated by a stop condi- the start condition and the slave address are
master transmitter becomes a master receiv-
tion generated by the master. However, if a both repeated, but with the R/W bit reversed.
ri ri
SDAl'\L.r~~OOCAV!
I I I I
SCLW~~-vvvtt
L jL L - - - J L-.-J L---.J ! ! L---.J I ! L-.-J --l
START ADDRESS R/W ACK DATA ACK DATA ACK SlOP
CONDITION CONDITION
II
~'(READ) DATA TRANSFERRED
(n BYTES + ACKNOWLEDGE)
c) Combined formats.
I s I SLAVEADDRESS I R/W I A I DATA I A I s I SLAVE ADDRESS I RtW I A I DATA I A I P I
J Lr~ (n BYTES
+ ACKNOWLEDGE) J lL.r~ (n BYTES
+ ACKNOWLEDGE)
NOTES:
1. Combined formats can be used, for example, to control a serial memory. During the first data byte, the internal memory location has to be written. After the start condition is repeated,
data can then be transferred.
2. All decisions on auto-increment or decrement of previously accessed memory locations, etc., are taken by the deSigner of the device.
3. Each byte is followed by an acknowledge as indicated by the A blocks in the sequence.
4. 12C devices have to reset their bus logiC on receipt of a start condition so that they all antiCipate the sending of a slave address.
12 C Bus Specification
ADDRESSING
The first byte after the start condition deter-
mines which slave will be selected by the LSB
I
master. Usually, this first byte follows that o I o OIAxxxxlx x x B
start procedure. The exception is the general
call address which can address all devices. RRSTBYTE SECOND BYTE
When this address is used, all devices (GENERAl. CALL ADDRESS)
should, in theory, respond with an acknowl-
edge, although devices can be made to
ignore this address. The second byte of the Figure 11. General Call Address Format
general call address then defines the action
to be taken.
Definition of Bits in the First H'06'
Byte Is I H'OO' I AI H'02' I AI ABCDOOO I X I A I ABCDOQ1 I X I AI ABCD010 I X I A I p I
The first seven bits of this byte make up the
slave address (Figure 10). The eighth bit Figure 12. Sequence of a Programming Master
(LSB - least significant bit) determines the
direction of the message. A zero on the least
bilities in group 1111 will also only be used for edge this address and behave as a slave
significant position of the first byte means that
extension purposes but are not yet allocated. receiver. The second and following bytes will
the master will write information to a selected
be acknowledged by every slave receiver
slave; a one in this position means that the The combination OOOOXXX has been defined
capable of handling this data. A slave which
master will read information from the slave. as a special group. The following addresses
cannot process one of these bytes must
have been allocated:
ignore it by not acknowledging.
LSB FIRST BYTE The meaning of the general call address is
always specified in the second byte (Figure
-SLAYEADDRESS- Slave
Address R/W 11).
0000 000 a General call address There are two cases to consider:
Figure 10. The First Byte After the
Start Procedure 0000 000 1 Start byte 1. When the least significant bit B is a zero.
2. When the least significant bit B is a one.
When an address is sent, each device in a 0000 001 X CBUS apdress When B is a zero, the second byte has the
system compares the first 7 bits after the start 0000 010 X Address reserved for
following definition:
different bus format
condition with its own address. If there is a
00000110 (H'06') Reset and write the pro-
match, the device will consider itself ad-
0000 all X grammable part of slave
dressed by the master as a slave receiver or
slave transmitter, depending on the R/W bit.
The slave address can be made up of a fixed
and a programmable part. Since it is expected
0000
0000
0000
0000
100
101
110
111
X
X
X
X
}o", "'moO
address by software and
hardware. On receiving this
two-byte sequence, all de-
vices (designed to respond
that identical ICs will be used more than once to the general call address)
in a system, the programmable part of the No device is allowed to acknowledge at the will reset and take in the
slave address enables the maximum possible reception of the start byte. programmable part of their
number of such devices to be connected to The CBUS address has been reserved to address.
the 12 C bus. The number of programmable enable the intermixing of CBUS and 12C Precautions must be taken
address bits of a device depends on the devices in one system. 12C bus devices are to ensure that a device is
number of pins available. For example, if a not allowed to respond at the reception of this not pulling down the SDA
device has 4 fixed and 3 programmable address. or SCL line after applying
address bits, a total of eight identical devices the supply voltage, since
can be connected to the same bus. The address reserved for a different bus these low levels would
format is included to enable the mixing of 12 C block the bus.
The 12C bus committee is available to coordi- and other protocols. Only 12C devices that are
nate allocation of 12C addresses. able to work with such formats and protocols 00000010 (H'02') Write slave address by
are allowed to respond to this address. software only. All devices
The bit combination llllXXX of the slave
which obtain the program-
address is reserved for future extension pur- General Call Address mable part of their address
poses. The general call address should be used to by software (and which
The address 1111111 is reserved as the address every device connected to the 12C have been designed to re-
extension address. This means that the ad- bus. However, if a device does not need any spond to the general call
dressing procedure will be continued in the of the data supplied within the general call address) will enter a mode
next byte(s). Devices that do not use the structure, it can ignore this address by not in which they can be pro-
extended addressing do not react at the acknowledging. " a device does require data grammed. The device will
reception of this byte. The seven other possi- from a general call address, it will acknowl- not reset.
r-,
I
SDA "I___________J
SCL
DLEN /
~----------------~
'---_ _ _ _ _ _ _ _-'IL.JL.J L -_ _ _ _ _ _ _ _ _ _ _ _--'I L-J
CO~~I~ON Ag~~:ss ~ I
n DATA BITS
ACK
RELATED
CLOCK PULSE
CBUS Compatibility
Existing CBLiS receivers can be connected to V 0D1 _4 =5V:t:10%
the 12 C bus. In this case, a third line called
DLEN has to be connected and the acknowl-
edge bit omitted. Normally, 12 C transmissions
are multiples of 8-bit bytes; however, CBLiS
devices have different formats.
In a mixed bus structure, 12C devices are not
allowed to respond on the CBLiS message. SM--~-t--~~~--~-+----~~----~+
For this reason, a special CBLiS address SCL----~~----~------4_------4_------+_
TIMING SOA
The clock on the 12C bus has a minimum Low SCL
period of 4.711S and a minimum High period of LD05650S
411S. Masters in this mode can generate a bus Figure 20. Serial Resistors (Rs) for Protection Against High Voltage
clock with a frequency from 0 to 100kHz.
All devices connected to the bus must be LOW-SPEED MODE Data Format and Timing
able to follow transfers with frequencies up to As explained previously, there is a difference The bus clock in this mode has a Low period
100kHz, either by being able to transmit or in speed on the 12 C bus between fast hard- of 130l1s ± 2511S and a High period of
receive at that speed or by applying the clock ware devices and the relatively slow micro- 390l1s ± 2511S, resulting in a clock frequency
synchronization procedure which will force computer which relies on software polling. of approx. 2kHz. The duty cycle of the clock
the master into a wait state and stretch the For this reason a low speed mode is available has this Low-to-High ratio to allow for more
Low periods. In the latter case the frequency on the 12C bus to allow these microcomputers efficient use of microcomputers without an
is reduced. to poll the bus less often. on-chip hardware 12C bus interface. In this
mode also, data transfer with acknowledge is
Figure 21 shows the timing requirements in Start and Stop Conditions obligatory. The maximum number of bytes
detail. A description of the abbreviations used In the low-speed mode, data transfer is pre-
is shown in Table 2. All timing references are transferred is not limited (Figure 22).
ceded by the start procedure.
at V1Lmax and VILmln.
SDA
SCL
LIMITS
SYMBOL PARAMETER UNIT
Min Max
fscL SCL clock frequency 0 100 kHz
tsuF Time the bus must be free before a new transmission can start 4.7 I1s
tHO; STA Hold time start condition. After this period the first clock pulse is generated 4 I1s
tLOW The Low period of the clock 4.7 I1s
tHIGH The High period of the clock 4 I1s
tsu; STA Setup time for start condition (Only relevant for a repeated start condition) 4.7 I1s
tHO; OAT Hold time DATA
for CBUS compatible masters 5 I1s
for 12 C devices O· I1S
tsu; OAT Setup time DATA 250 ns
C~~
~...,
SDA "1\:
I \jol----~(.(_J
I
I I I I I I
SCL~~~-~
I s I I I I I Sr p
1....---' ! IL---..J L.....J I IL---JI IL---J L-......J
CO~~ON START BYTE ACK~~~~~DGE R~e::rED ADDRESS ACK DATA n BYTES ACK I CO~:'DN
(HIGH) CONDITIDN
SDA
SCL
l----tHIGH----~1
LIMITS
SYMBOL PARAMETER UNIT
Min Max
tBUF Time the bus must be free before a new transmission can start 105 I's
tHO; STA Hold time start condition. After this period the first clock pulse is generated 365 p.s
tHO; STA Hold time (repeated start condition only) 210 p.s
tsu; STO Setup time for stop condition 105 155 p.s
NOTES:
All values referenced to V 1H and V 1L levels .
• Note that a transmitter must internally provide a hold time to bridge the undefined region (300ns max.) of the falling edge of seL.
APPENDIX A In Graph 2, RSmax against Rp is shown. In Graph 3, the bus capacitance - RPmax
Maximum and minimum values of the pull-up 2) The bus capacitance is the total ca- relationship is shown.
resistors Rp and series resistors Rs (See pacitance of wire, connections, and 3) The maximum high-level input current
Figure 20). pins. This capacitance limits the maxi- of each input! output connection has a
mum value of Rp because of the specified value of 10j.iA max. Due to
In a 12C bus system these values depend on specified rise time of 1MS. the desired noise margin of 0.2 VDD
the following parameters: for the high level, this input current
- Supply voltage limits the maximum value of Rp. This
- Bus capacitance limit is dependent on VDD.
- Number of devices (input current + leak-
age current) In Graph 4 the total high-level input cur-
1) The supply voltage limits the min- rent - RPmax relationship is shown.
imum value of the Rp resistor due
to the specified 3mA as minimum 20
sink current of the output stages,
at O.4V as maximum low voltage. 18
In Graph 1, VDD against Rpmin is Si
shown.
<;.
0:
w 12
__-L____L-__- L__
3
~
O~ ~
,
o 40 80 120 180 200
TOTAL HIGH LEVEL INPUT CURRENT (jA)
,
20
18 Graph 4
lii"
O~
o
__-L____L-__-L__
12
~
16
os.
.t
w
3
12
\\ 12C LICENSE
Purchase of Signetics or Philips 12C compo-
~ /Rs=O
::Ii nents conveys a license under the Philips 12C
:::>
patent rights to use these components in an
MAX.R~~
::Ii
Graph 1
~ ~
12C system, provided that the system con-
Graph 3
INDEX
Development Support Tools .................................. 5-1
In-Circu~ Emulator for 8051 or 8052 Microcontroller ............... 5-2
In-Circuit Emulator for 80C451 Microcontroller. . . . . . . . . . . . . . . . . . .. 5-4
In-Circuit Emulator for 83C451 Microcontroller. . . . . . . . . . . . . . . . . . .. 5-6
In-Circu~ Emulator for 80C552 Microcontroller . . . . . . . . . . . . . . . . . . .. 5-8
In-Circuit Emulatorfor 80C652 Microcontroller ................... 5-10
In-Circuit Emulatorfor 83C751 Microcontroller. . . . . . . . . . . . . . . . . .. 5-12
ASM51 8051 Macro Cross Assembler ......................... 5-14
SPGM-100 EPROM Microcontroller and Standard EPROM
Programmer ............................................. 5-16
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
lator hardware, host emulation software, cross-assembler,
DEVELOPMENT SUPPORT TOOLS user's manuals, cables, and power supply. Note that these
Signetics stocks development support tools to help simplify emulators do not include provisions for programming
your design activities. These include: ('burning') the EPROM in EPROM-based micro-
controllers.
c In-circuit emulation development systems
c Cross-assemblers CROSS-ASSEMBLER
C Low-cost EPROM programming equipment The cross-assembler provided with the development system
package is also available separately. This assembler sup-
In addition, Signetics works closely with many 'third-party' ports macros and conditional assembly operations and is
vendors who provide support tools for our wide variety of designed to run on an IBM-PC or compatible processor.
80C51-based microcontroller derivatives. This assembler uses an external text file to define the
architecture of specific microcontrollers. Support for new
DEVELOPMENT SYSTEMS microcontroller types can be added by creating a simple
In most cases, our development systems are available in text file to define the new micro-controller, thereby allow-
two versions for ROM and ROMless applications. The ing the assembler to support a variety of prodact deriva-
ROM emulation products are capable of supporting all tives now and in future applications.
versions of a given device type including EPROM, ROM,
and ROMless devices. For example, the SMI-83C451 em- EPROM PROGRAMMING SUPPORT
ulator can support designs based on either the 87C451, Signetics works closely with. major suppliers of EPROM
83C451, or 8OC451. In contrast, a ROMless emulator can programming equipment to support our family of EPROM
only support applications designed for a ROMless micro- micro-controllers. As a result, EPROM programming sup-
controller. For example, the SMI-80C451 emulator can port is available within the programming facilities of many
only support applications using the 8OC451. major distributors and customers.
These development systems are designed to connect to the Your local Signetics sales office or representative can
serial port of an IBM-PC or compatible personal com- provide a list of manufacturers of EPROM programming
puter. The development system package includes the emu- equipment that offer programming support products for
Signetics EPROM microcontrollers.
SIGNETICS MICROCONTROLLER DEVELOPMENT SYSTEMS
The emulator package includes emulator hardware, power supplies, Interface cables, host software and cross-assembler.
This package requires the use of an IBM-PC or 100% compatibles with 640k RAM, PC DOS version 2.0 or later and an
RS232 port.
EPROM MICROCONTROLLER PROGRAMMING SYSTEM
• Serially linked to IBM PC or 100% • Over 128,000 Break Triggers and 64,000
compatible hosts Trace Triggers
• Advanced menu driven human interface • Emulation Memory:
• Real time and transparent emulation up to Standard Optional
~ Program 16K 64K
16 MHz
~ External Data 16K 64K
• Disassembler and Single Line Assembler
• Full Symbolic Debug Capability
• Examine/Modify Memory capabilities
• High Level Language Support
• 16 Break and Trace Trigger Conditions
• Up to 64K Pass Counts
• Supports both modes:
Microcontroller • Separate Program and Data Memory Mapping
Microprocessor in 16 byte blocks
• Experiment Editor/Compiler
• 9 Probe Clips
7 External Events • Trace with 2K frames
1 External Trigger Input • Opcode Class Editor
1 External Trigger Output
PHILIPS 98-8270-010
5-2 1029-OOO/688IIM
Functional Description Support
The Signetics-8052 is an in-circuit emulator which is designed for use in The Signetics-8052 emulator not only assists the designer in developing, testing
developing, testing and debugging designs based on 8051 or 8052 single and debugging 8051 or 8052 microcontroller designs, but is also backed by
chip microcontrollers. The Signetics-8052 allows the development of Signetics with an extensive service and support policy that includes:
hardware and software designs to occur simultaneously. • Updates to the Signetics User's Manual and Signetics host Operating System
The Signetics-8052 emulator assists in the following design phases: software that are provided at no charge for a ninety (90) day period.
• Software Development • Toll free phone number (l-800-A-HLP-4-51) to resolve system hardware
• Manufacturing and/or software concerns.
• Integration of target software and system hardware • A 72-hour repair on disabled systems under warranty.
• Field Service
Features Description
Emulator Functions Experiment High Level Language
• Microcontrollers supported: • Used to specify complex break and trace • 'C' and PLM support
S031 SOC31 S032 triggers • Variables and Line number break/trace triggers
SOSI SOCSI S052 • Uses the if-then construct • Variables Accessible
S7C51 • Allowable trigger conditions are: • Step - Proceed and Step - Trace of Line
• Perfonnance PC address numbers
Real-time 3.5 to 16 MHz PC address range
• Transparency: Opcode value
Operational and electrical apcode class
SymbOlic Debug
• Examine and modify: Special function registers
Program Direct byte address • User and Pre-Defined Symbols
Internal data Direct byte address range • Supports MetaLink., Enertec, lAR, Archimedes,
External data Direct bit address Signetics, Microtec Research or Intel aMF files
Direct bit address range • Use a name not address to alter content of:
Immediate operand value bits, bytes, code
User Interface Read/write to bit or direct addresses
External data address
• Advanced menu driven operating system External data address range Electrical Specification
• 11 functional capabilities: Logical AND or OR of any of the above
Load OS-Escape Pass count overflow Input Power (typical):
Upload Help External input 1.5 amps @ + 5 volts DC +/ - 5%
Download Configure • Over; 12S,OOO break triggers
Store Restore 64,000 trace triggers
Interrogate Exit • Experiment Editor allows user to create or Mechanical Specification
Macro modify experiments by:
Emulator dimensions:
Edit Delete 1.0" x 7.0" x 5.5"
Compile Store 2.5cm x 17.Scm x 14.0cm
Mode Load Specify Opcode Class
Target system cable length:
• apcode class is collection of various 8051 14.0"
• Allows user to emulate all the operating modes instructions that make up a set.
of; 35.6cm
Set is user defined Emulator and target system cable weight:
Full operation with external address/data bus Opcode class editor allows user to create,
Single-chip operation with NO external 2.01bs.
delete or edit ape ode classes
address/data bus 0.9 kg
Emulator probe head:
Compatible with 600 mil wide 40 pin DIP on
Examine/Modify Memory 100 mil centers
Interrogation
• Program memory operations:
• Allows the user to: Disassemble
Run experiments Single line assemble Host Specification
Examine the system status Examine/modify raw data
Set break and trace triggers An IBM PC, PC XT, PC AT or 100%
Mapping
Examine/modify data compatible system with 640K bytes of RAM.
• Microcontroller internal and external data PC-DOS 2.0 or later.
• 16 functional capabilities: memory operations:
Run Two (2) floppy disk drives.
Dump One (I) RS232C interface card for the PC and
Single-step Scan and modify
Reset cable.
Fill
OS-Escape Move
Set pass count Search
Set simple break and trace triggers warranty
Compare
Set repetition counter Mapping
Set phantom break and trace triggers Ninety (90) days limited warranty, parts and
Examine/modify addressable bits labor.
Set trace triggers (start, end & center)
Tum trace trigger ON/OFF
View up to 2K of trace buffer
Examine/modify:
Special Function Registers
Internal data memory
External data memory
Program memory
Macro
• Repetitive routine
• User created, edited and
callable at any time
Signetics
a division 01 North American Philips Corporation
Emulator experiments
MetaLink is a Irademark of MetaLink. Corporation. Signellcs Company
pc-OOS, PC. PC XT and PC AT are trademarks of IBM. 811 E. Arques Avenue
IBM is a registered trademark of IBM Corporation. P.O. Box 3409
Intel is a registered trademark of Intel Corporation.
©METALINK CORPORATION 1988
Sunnyvale, California 94088-3409
Telephone 408/991-2000
System Overview
Signetics-80C451
In-Circuit Emulator for
80C451 Microcontroller
e PHILIPS
PHILIPS
98-8270-070
1034-0001988/IM
Functional Description Support
The Signetics-80C451 is an in-circuit emulator which is designed for The Signetics-80C451 emulator not only assists the designer in devel-
use in developing, testing and debugging designs based on an 80C451 oping, testing and debugging 80C451 microcontroller designs, but is
single chip microcontroller. The Signetics-80C451 allows the devel- also backed by Signetics with an extensive service and support policy
opment of hardware and software designs to occur simultaneously. that includes:
The Signetics-80C451 emulator assists in the following design phases: • Updates to the Signetics User's Manual and Signetics host Oper-
• Software Development _ Integration of target software and ating System software that are provided at no charge for a ninety
• Manufacturing system hardware (90) day period .
• Field Service • Toll free phone number (l-800-A-HLP-4-51) to resolve system
hardware and software concerns.
• A 72-hour repair on disabled systems under warranty.
Features Description
Emulator Functions Experiment Macro
• Microcontrollers supported: • Used to specify break and trace triggers • Repetitive routine
80C45 I • Uses the if-then construct • User created, edited and callable at any time
• Performance • Allowable trigger conditions are:
Real-time .5 MHz to 12 MHz PC address Symbolic Debug
• Transparency: PC address range
• User and Pre-Defined Symbols
Operational and electrical Ope ode value
• Supports MetaLink, Enertec, I AR, Archimedes,
• Examine and modify: Ope ode class Signetics, Microtec Research or Intel OMF files
Program Special function registers
• Use a name not address to alter content of:
Internal data Direct byte address bits, bytes, code
External data Direct byte address range
Direct bit address Optional Products
User Interface Direct bit address range
Immediate operand value • MetaWARE Converter compatible with 900
TN
• Advanced menu driven operating system mil wide 64 pin DIP on 100 mil centers.
• 11 functional capabilities: Read/write to bit or direct addresses
Load OS-Escape External data address
External data address range Electrical Specification
Upload Help
Download Configure Logical AND or OR of any of the above Input Power (typical):
Store Restore Pass count overflow 1 amp @ +25 volts DC +/ -5%
Interrogate Exit External input
Macro • Over 128,000 break and trace triggers Mechanical Specification
• Experiment Editor allows user to create or Emulator dimensions:
Interrogation modify experiments by: 2.0" X 11.0" X 7.62"
Edit Delete 5.1 em X 27.9 cm X 19.3 em
• Allows the user to: Compile Store
Run experiments Target system cable length:
Load Specify Opcode Class 14.0"
Examine the system status • Opcode class is collection of 80C45 1
Set break and trace triggers 35.6 em
instructions that make up a set. Emulator and target system cable weight:
Examine/modify data Set is user defined
• 15 functional capabilities: 5.01bs.
Opcade class editor allows user to create, 2.2 kg
Run delete or edit Opcode classes
Single-step Emulator probe head:
Reset Compatible with 68 lead PLCC (J-Bend) on
Examine/Modify Memory 50 mil centers
OS-Escape
Set pass count • Program memory operations:
Set simple break and trace triggers Disassemble Host Specification
Set repetition counter Single line assemble An [BM PC, PC XT, PC AT or 100%
Set phantom break and trace triggers Examine/modify raw data compatible system with 640K bytes of RAM.
Set trace triggers (start, end & center) Mapping PC-DOS 2.0 or later.
View up to 4K of trace buffer • Microcontroller internal and external data Two (2) floppy disk drives.
Examine/modify: memory operations: One (I) RS232C interface card for the PC and
Special Function Registers Dump cable
Internal data memory Scan and modify
External data memory Fill Warranty
Program memory Move
Search Ninety (90) days limited warranty, parts and
Emulator experiments labor.
Compare
Mapping
Examine/modify addressable bits
PHILIPS 98-8270-030
5--6 1027-OOO/6SSIIM
Functional Description Support
The Signetics-83C451 is an in-circuit emulator which is designed for The Signetics-83C45I emulator not only assists the designer in developing, testing
use in developing, testing and debugging designs based on an 83C451 and debugging 83C45 I microcontroller designs. but is also backed by Signetics
single chip microcontroller. The Signetics-83C45I allows the with an extensive service and support policy that includes:
development of hardware and software designs to occur simultaneously. • Updates to the Signetics User's Manual and Signetics host Operating System
The Signetics-83C451 emulator assists in the following design phases: software that are provided at no charge for a ninety (90) day period.
• Software Development • Toll free phone number (l-800-A-HLP-4-51) to resolve system hardware and
• Manufacturing software concerns.
• Integration of target software and system hardware • A 72-hour repair on disabled systems under warranty.
• Field Service
Features Description
Emulator Functions Experiment Symbolic Debug
• Microcontrollers supported; • Used to specify break and trace triggers • User and Pre-Defined Symbols
83C45 1 80C45 1 87C45 1 • Uses the if-then construct • Supports MetaLink, Enertec, JAR, Signetics,
• Perfonnance • Allowable trigger conditions are: Archimedes, Microtec Research or Intel OMF
Real-time .5 MHz to 12 MHz PC address files
• Transparency; PC address range • Use a name not address to alter content of:
Operational and electrical Opcode value bits, bytes, code
• Examine and modify: Opcode class
Program Special function registers
Internal data Direct byte address Optional Products
External data Direct byte address range
Direct bit address • Converter compatible with 900 mil wide 64 pin
Direct bit address range DIP on 100 mil centers.
User Interface Immediate operand value
Read/write to bit or direct addresses
• Advanced menu driven operating system External data address Electrical Specification
• 11 functional capabilities: External data address range
Load OS-Escape Input Power (typical):
Logical AND or OR of any of the above
Upload Help 1 amp @ + 23 volts DC +/- 5%
Pass count overflow
Download Configure External input
Store Restore • Over 128,000 break and trace triggers
Interrogate Exit • Experiment Editor allows user to create or Mechanical Specification
Macro modify experiments by: Emulator dimensions:
Edit Delete 2.0" x 11.0"x 7.62"
Compile Store 5.1cm x 27,9cm x 19.3cm
Mode Load Specify Opcode Class Target system cable length:
• Opcode class is collection of 83C45 I 14.0"
• Allows user to emulate all the operating modes instructions that make up a set.
of the 83C45 1: 35.6cm
Set is user defined Emulator and target system cable weight:
Full 8OC451 operation with external address bus
Opcode class editor allows user to create, 5.0Ibs.
Single-chip 83C451 with NO external address
delete or edit Opcode classes 2.2 kg
bus and 4K of on-chip code memory
Emulator probe head:
Compatible with 68 lead plastic leaded chip
Examine/Modify Memory carrier (J-bend) on 50 mil centers
Interrogation
• Program memory operations:
• Allows the user to: Disassemble
Run experiments Host Specification
Single line assemble
Examine the system status
Examine/modify raw data An IBM PC, PC XT, PC AT or 100%
Set break and trace triggers
Mapping compatible system with 640K bytes of RAM.
Examine/modify data
• Microcontroller internal and external data PC-DOS 2.0 or later.
• 15 functional capabilities: memory operations:
Run Two (2) floppy disk drives.
Dump One (I) RS232C interface card for the PC
Single-step
Scan and modify and cable.
Reset Fill
OS-Escape
Move
Set pass count
Search
Set simple break and trace triggers
Compare Warranty
Set repetition counter
Mapping Ninety (90) days limited warranty, parts and
Set phantom break and trace triggers
Examine/modify addressable bits labor.
Set trace triggers (start, end & center)
View up to 4K of trace buffer
Examine/modify:
Special Function Registers Macro
Internal data memory
Signetics
• Repetitive routine
External data memory • User created, edited and callable
Program memory at any time
Emulator experiments
PHILIPS
98-8270-060
5--8 103Q{lOO!688IIM
Functional Description Support
The Signetics-80C552 is an in-circuit emulator which is designed for The Signetics-80CSS2 emulator not only assists the designer in developing, testing
use in developing, testing and debugging designs based on an 80C552 and debugging 80C552 microcontroller designs, but is also backed by Signetics
single chip microcontroller. The Signetics-80C552 allows the with an extensive service and support policy that includes:
development of hardware and software designs to occur simultaneously. • Updates to the Signetics User's Manual and Signetics host Operating System
The Signetics-80C552 emulator assists in the following design phases: software that arc provided at no charge fur a ninety (90) day period.
• Software Development • Toll free phone number (l-800-A-HLP-4-51) to resolve :'!ystem hardware and
• Manufacturing software concerns.
• Integration of target software and system hardware • A 72-hour repair on disabled systemr, under warranty.
• Field Service
Features Description
Emulator Functions Experiment Symbolic Debug
• Microcontrollers supported: • Used to specify break and trace triggers • User and Pre-Defined Symbols
8OC552 • Uses the if-then construct • Supports MetaLink, Enertec, IAR, Signetics,
• Perfonnance • Allowable trigger conditions are: Archimedes, Microtec Research or Intel OMF
Real-time 3.5 MHz to 12 MHz PC address files
• Transparency: PC address range • Use a name not address to alter content of:
Operational and electrical Opcode value bits, bytes, code
• Examine and modify: Opcode class
Program Special function registers
Internal data Direct byte address Optional Products
External data Direct byte address range
Direct bit address • Converter
Direct bit address range
User Interface Immediate operand value
Read/write to bit or direct addresses Electrical Specification
• Advanced menu driven operating system External data address
• 11 functional capabilities: External data address range Input Power (typical);
Load OS-Escape Logical AND or OR of any of the above I amp @ + 23 volts DC +/- 5%
Upload Help Pass count overflow
Download Configure External input
Store Restore • Over 128,000 break and trace triggers Mechanical Specification
Interrogate Exit • Experiment Editor allows user to create or
Macro Emulator dimensions:
modify experiments by: 2.0" x 11.0" x 7.62"
Edit Delete 5.lcm x 27.9cm x 19.3cm
Compile Store Target system cable length:
Interrogation Load Specify Opcode CIass 14.0"
• Opcode class is collection of 80C552 35.6cm
• Allows the user to: instructions that make up a set.
Run experiments Emulator and target system cable weight:
Set is user defined 5.0Ibs.
Examine the system status
Opcode class editor allows user to create, 2.2 kg
Set break and trace triggers
delete or edit Opcode classes Emulator probe head:
Examine/modify data
• 16 functional capabilities: Compatible with 68 lead plastic leaded chip
Run carrier (J-bend) on 50 mil centers
Single-step Examine/Modify Memory
Reset • Program memory operations:
OS-Escape Disassemble Host Specification
Set pass count Single line assemble
Set simple break and trace triggers An IBM PC, PC XT, PC AT or 100%
Examine/modify raw data compatible system with 640K bytes of RAM.
Set repetition counter Mapping
Set phantom break and trace triggers PC-DOS 2.0 or later.
• Microcontroller internal and external data Two (2) floppy disk drives.
Set trace triggers (start, end & center) memory operations:
View up to 4K of trace buffer One (I) RS232C interface card for the PC
Dump and cable.
Examine ND data Scan and modify
Examine/modify: Fill
Special Function Registers Move
Internal data memory Search warranty
External data memory Compare Ninety (90) days limited warranty, parts and
Program memory Mapping labor.
Emulator experiments Examine/modify addressable bits
Macro
• Repetitive routine
• User created, edited and
callable at any time
Signefics
a division of North Americon Philips Corporotion
Signetics Company
MetaLink is a trademark of MetaLink Corporation.
PC-OOS, PC, PC XT and PC AT are trademarks of IBM, 811 E. Arques Avenue
IBM is a registered trademark of IBM Corporation. P.O. Box 3409
Intel is a registered trademark of Intel Corporation. Sunnyvale, California 94088-3409
cMETALINK CORPORATION 1988 5-9 Telephone 408/991-2000
System Overview
Signetics-80C652
In-Circuit Emulator for
80C652 Microcontroller
PHILIPS 98-8270-020
5-10 1031-o00I688/IM
Functional Description Support
The Signetics-80C652 is an in-circuit emulator which is designed for The Signetics-80C652 emulator not only assists the designer in developing, testing
use in developing. testirig and debugging designs based on an 8OC652 and debugging 80C652 microcontroller designs, but is also backed by Signetics
single chip microcontroller. The Signetlcs-80C652 allows the with an ex.tensive service and support policy that includes:
development of hardware and software designs to occur simultaneously. • Updates to the Signetics User's Manual and Signetics host Operating System
The Signetics-8OC652 emulator assists in the following design phases: software that are provided at no charge for a ninety (90) day period.
• Software Development • Toll free phone number (1-8oo-A-HLP-4-51) to resolve system hardware and
• Manufacturing software concerns,
• Integration of target software and system hardware • A 72-hour repair on disabled systems under warranty.
• Field Service
Features Description
Emulator Functions Experiment Macro
• Microcontrollers supported: • Used to specify break and trace triggers • Repetitive routine
80C652 • Uses the if-then construct • User created, edited and callable at any time
• Perfonnance • Allowable trigger conditions are:
Real-time 3.5 MHz to 12 MHz PC address
• Transparency: PC address range Symbolic Debug
Operational and electrical Opcode value
• Examine and modify: Opcode class • User and Pre-Defined Symbols
Program Special function registers • SuPPOrts MeiaLink, Enertec, JAR, Signetics,
Internal data Direct byte address Archimedes, Microtec Research or Intel OMF
External data Direct byte address range files
Direct bit address • Use a name not address to alter content of:
Direct bit address range bits, bytes, code
User Interface Immediate operand value
Read/write to ·bit or direct addresses
• Advanced menu driven operating system External data address Electrical Specification
• II functional capabilities: Externlll data address range
Load OS-Escape Input Power (typical):
Logical AND or OR of 'my of the above
Upload Help I amp@ + 23 volts DC +/- 5%
Pass coUnt overflow
Download Configure External input
Store Restore • Over 128,000 break and trace triggers
Interrogate Exit • Experiment Editor allows user to create or Mechanical Specification
Macro modify experiments by: Emulator dimensions:
Edit Delete 2.0" X 11.0" X 7.62"
Compile Store S.lcm x 27.9cm x 19.3cm
Interrogation Load Specify Opcode Class Target system cable length:
• Opcode class is collection of SOC6S2 14.0"
• Allows the user to: instructions that make up a set.
Run experiments 35.6cm
Set is user defined Emulator and target system cable weight:
Examine the system status Opcode class editor allows user to create,
Set break and trace triggers 5.0lbs.
delete or edit Opcode classes 2.2 kg
Examine/modify data
• 15 functional capabilities: Emulator probe head:
Run Compatible with 40 lead DIP on 100 mil
Single-step Examine/Modify Memory centers
Reset • Program memory operations:
OS-Escape Disassemble
Set pass count Single line assemble Host Specification
Set simple break and trace triggers Examine/modify raw data An IBM pc, PC XT, pc AT or 100%
Set repetition counter Mapping compatible system with 640K bytes of RAM.
Set phantom break and trace triggers • Microcontroller internal and external data PC-DOS 2.0 or later.
Set trace triggers (start, end & center) memory operations: Two (2) floppy disk drives.
View up to 4K of trace buffer Dump One (1) RS232C interface card for the PC
Examine/modify: Scan and modify and cable.
Special Function Registers Fill
Internal data memory Move
External data memory Search
Program memory Compare Warranty
Emulator experiments Mapping Ninety (90) days limited warranty, parts and
Examine/modify addressable bits labor.
Signetics
a division of North American Philips Corporation
Signeties Company
MetaLink is a trademark of MetaLink Corporation. 811 E. Arques Avenue
PC-DOS, PC, PC XT and pC AT are trademarks of IBM.
mM is a registered trademark of IBM Corporation.
P.O. Box 3409
Intel is a registered trademark of Intel Corporation. Sunnyvale, California 94088-3409
oMETALINK CORPORATION 1988 5-11 Telephone 408/991-2000
System Overview
Signetics-83C751
In-Circuit Emulator for
83C751 Microcontroller
PHILIPS98-8270-040
5-12 1028-000J688/1M
Functional Description Support
The Signetics-83C751 is an in-circuit emulator which is designed for The Signetics-83C751 emulator not only assists the designer in developing, testing
use in developing, testing and debugging designs based on an 83C751 and debugging 83C751 microcontroller designs, but is also backed by Signetics
single chip microcontroller. The Signetics-83C75I allows the with an extensive service and support policy that includes:
development of hardware and software designs to occur simultaneously. • Updates to the Signetics User's Manual and Signetics host Operating System
The Signetics-83C75I emulator assists in the following design phases: software that are provided at no charge for a ninety (90) day period.
• Software Development • Toll free phone number (l-800-A-HLP-4-51) to resolve system hardware and
• Manufacturing software concerns.
• Integration of target software and system hardware • A 72-hour repair on disabled systems under warranty.
• Field Service
Features Description
Emulator Functions Experiment Macro
• Microcontrollers supported: • Used to specify break and trace triggers • Repetitive routine
83C751, 87C751 • Uses the if-then construct • User created, edited and callable at any time
• Performance • Allowable trigger conditions are:
Real-time 3.5 MHz to 16 MHz PC address
• Transparency: PC address range Symbolic Debug
Operational and electrical Opcode value
• Examine and modify: Opcode class • User and Pre-Defined Symbols
Program Special function registers • Supports MetaLink, Enertec, IAR, Signetics,
Internal data Direct byte address Archimedes, Microtec Research or Intel OMF
Direct byte address range files
Direct bit address • Use a name not address to alter content of:
Direct bit address range bits, bytes, code
User Interface
Immediate operand value
• Advanced menu driven operating system Read/write to bit or direct addresses
• 11 functional capabilities: Logical AND or OR of any of the above Electrical Specification
Load OS-Escape Pass count overflow
Upload Help Input Power (typical):
External input
Download Configure I amp @ + 23 volts DC +/- 5%
• Break and trace triggers
Store Restore • Experiment Editor allows user to create or
Interrogate Exit modify experiments by:
Macro Edit Delete Mechanical Specification
Compile Store Emulator dimensions:
Load Specify Ope ode Class 2.0" x 11.0" x 7.62"
Interrogation • Opcode class is collection of 83C751 5.lcm x 27.9cm x 19.3cm
instructions that make up a set. Target system cable length:
• Allows the user to:
Set is user defined 14.0"
Run experiments
Opcode class editor allows user to create, 35.6cm
Examine the system status
delete or edit Opcode classes Emulator and target system cable weight:
Set break and trace triggers
Examine/modify data 5.0Ibs.
• 14 functional capabilities: 2.2 kg
Run Examine/Modify Memory Emulator probe head:
Single-step Compatible with 24 lead 300 mil wide DIP
• Program memory operations:
Reset on 100 mil centers
Disassemble
OS-Escape Single line assemble
Set pass count Examine/modify raw data
Set simple break and trace triggers Mapping Host Specification
Set repetition counter • Microcontroller internal memory operations: An IBM PC, PC XT, PC AT or 100%
Set phantom break and trace triggers Dump
Set trace triggers (start, end & center) compatible system with 640K bytes of RAM.
Scan and modify PC-DOS 2.0 or later.
View up to 4K of trace buffer Fill Two (2) floppy disk drives.
Examine/modify: Move One (I) RS232C interface card for the PC
Special Function Registers Search and cable,
Internal data memory Compare
Program memory Examine/modify addressable bits
Emulator experiments
warranty
Ninety (90) days limited warranty, parts and
labor.
Signetics
a division of North American Philips Corporation
Signetics Company
MClaLink is a trademark of MctaLink Corporation. 811 E. Arques Avenue
PC-DOS, PC, PC XT and PC AT are trademarks of IBM.
IBM is a registered trademark of IBM Corporation P.O. Box 3409
Intel is a registered trademark of Intel Corporation Sunnyvale, California 94088-3409
fJMETALINK CORPORATION 1988 5--13 Telephone 408/991-2000
System Overview
Signetics-ASM51
8051 Macro
Cross Assembler
PHILIPS 98-8270-050
5-14 l032-o00!688flM
Functional Description
The Signetics-ASM5! Macro Cross Assembler takes an assembly language source file created with a text editor and translates it into a machine language object
file. This translation process is done in two passes over the source file. The Signetics-ASM51 Macro Cross Assembler is supported on IBM PCs and as such
has faster assembly times than traditional methods. The Signetics-ASMS t Macro Cross Assembler supports modular code development or will assemble
previously developed code modules through the use of the INCLUDE capability that brings together these code modules at assembly time.
Features Description
Products Supported Instructions Supported Conditional Assembly
8052 8051 80C51 • Standard mnemonics plus generic CALL/IMP. • IF-THEN-ELSE conditional capability, nested
8032 8031 80C31 up to 255 levels.
87C51
Assembly Time Operators
83C75 I 80C45 I Macro Capability
87C75 I 83C451 • Operations supported are: +, -, HIGH, LOW,
87C451 MOD, /, *, SHR, SHL, NOT. AND, OR, • Full macro capability exists with up to nine (9)
XOR, =, <, >, <>, <=, >=. levels of nesting.
80C552 80C652 • Operations are done in 16-bit 2's complement • Up to 16 parameters can be specified in a
83C552 83C652 arithmetic. macro.
87C552 87C652
Numbers
Object File Format Warranty
• Numbers can be entered in decimal (default),
binary, hexadecimal or octal. • Standard Intel Hexadecimal Object Code Ninety (90) days free update service.
Format.
• MetaLink or Signetics Debug Format for use
with Signetics emulators.
Predefined Addresses
• All MCS-51 architecturally defined Special
Function Registers (SFR) are symbolically Include Capability
defined in the Signetics-ASM51 Macro Cross
Assembler. • Any number of files can be included in the
source file, nested up to eight (8) levels deep.
Signetics
a division of North American Philips Corporation
Signetics Company
MetaLink is a trademark of MetaLink Corporation 811 E. Arques Avenue
PC-DOS, PC, PC XT and PC AT are trademarks of IBM. P.O. Box 3409
IBM is a registered trademark of IBM Corporation.
Intel is a registered Irademark of Intel Corporation. Sunnyvale, Califomia 94088-3409
©METALINK CORPORATION 1988 !'>-15 Telephone 408/991-2000
Universal EPROM Programmer
PROGRAMMING
SITE
SPGM-100
OPERATIONS
o Select EPROM Type
o Blank Check
o Program EPROM array
o Display!Alter Data Buffer
o Fill Buffer with Constant
o Copy EPROM to Buffer
o Verify EPROM Versus Buffer
o Error Display (Program/Verify)
o Help
5-16
Signetics
Signetics Section 6
Additional
Microcontroller
Microprocessor Products
Data Sheets
INDEX
8X305 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 6-3
8X401 Microcontroller
SCN8049 Series. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 6-28
........................................ 6-48
Signetics 8X305
Microcontroller
Product Specification
Microprocessor Products
~ -. :::~:~g~:g= ~~~TROL
--@-Vlt
A,
... G!(N:::3i! .n
G CD
....
...
H _ ~~~:~~EXTERNAL
(Nole 3) -®-GND -u
i3
G ~ I (N:I~2) I Q.
c
a
A,
... 8G28
.
A"
Au
Au
iVO
JV1
M
'"
r
oj:> ~~[i~ 'l:J-(:t.L-J. I .
-----
I
~Jrt±-
~ •
38
jliM
iV'3
IV.
Wi
.w
sc
we
' '=H
,"
'12
"3
2'-
25
...... r(/ :[:lK
'"
'n
"AU
.ESET
NOTES:
1. Registers R1-R6, All and A14-R16 are general-purpose working registers.
2. In any instruction where R7 (IVL) or Rll (IVA) is specified as the destination, the a-bit value is output on the IV bus as an IV device enable address (SC "" High) - R7 = left bank and Rll = right bank; the results are also stored into the -u
specified internal register and may later be accessed as source data.
3. R12 and R13 are general-purpose working registers for all operations except transmit (XMIT).
8.c
4. The feast significant bit of register R10 (OVF) is used to reflect the carryout status resulting from the most recent ADD operation. Q.
5. Auxiliary register RO # 1 is a general-purpose working register that holds the implied operand for Arithmetic and Logical operations; the content of this register is repeated in AUX # 2 (shown dotted). The duplicate register is physically
part of the ALU and is shown separate only for layout convenience. 00 ~o
6. Internal working registers cannot be operated on by the MASK logic.
'*
7. During NZT instructions the ALU tests for all bits equal to "0" (Transfer if A 0) -refer to BASIC OPERATIONS that follow. ><
W 3;
M icrocontroller 8X305
VCRQ
"Q
.. [1
~VR
~
~ ..
..
.. ~ ~"'10
.. [! ~Al1
A3~ ~Al1
A2[! ~HALT INDEX
Al~ 19 RESET
CORNER
9 1 61
.. [! ~MCLK
X1§ ~iYO 10 0 60
X2~ ~iV1
GND@
~iV2
~~ ~iVa PLCC
11~ ~vcc
12@ ~iV4
la§ ~iVs 26 44
I.~ ~iVi
15~ ~M
27 43
.@
11~
~RB
!!lUi
TOP VIEW
COOO68PS
I.~ ~wc
,,~ ~sc
hO~ ~115
111~ !!1h4
112~ ~113
CD09<l61S
PLCC DIP
IDENTIFIER FUNCTION
PIN NO. PIN NO.
4-11,62-66 2-9, 45-49 Ao-A12 Program Address Lines: These active-high outputs permit direct addressing of up to 8192 words
of program storage; A12 is least significant bit.
12, 13 10, 11 Xl, X2 Timing generator connections for a capacitor, a series resonant crystal, or an external clock
source with complementary outputs.
17-23, 13-28 10 -115 Instruction Lines: These active-high input lines receive l6-bit instructions from program storage;
28-36 115 is least significant bit.
37 29 SC Select Command: When high (binary 1), an address is being output on pins IVO through IV7.
38 30 WC Write Command: When high (binary 1), data is being output on pins IVO through IV7.
39 31 LB Left Bank Control: When low (binary 0), devices connected to the Left Bank are accessed. (Note:
Typically, the LB Signal is tied to the ME input pin of 110 peripherals).
45 32 RB Right Bank Control: When low (binary 0), devices connected to the Right Bank are accessed
(Note. Typically, the RB signal is tied to the ME input pin of liD peripherals).
M icrocontroller 8X305
PLCC DIP
IDENTIFIER FUNCTION
PIN NO. PIN NO.
46-49, 33-36, IVO-IV? Interface Vector (Input/Output Bus) - these bidirectional active-low three-state lines
55-58 38-41 communicate data and/or addresses to I/O devices and memory locations. A low voltage level
equals a binary "1"; IV? is Least Significant Bit.
59 42 MCLK Master Clock: This active-high output signal is used for clocking I/O devices and/or
synchronization of external logic.
60 43 RESET When RESET input is low (binary 0), the 8X305 is initialized - sets Program Counter/Address
Register to zero and inhibits MCLK. For the period of time RESET is low, the Left Bank/Right Bank
(IJ3IRB) Signals are forced high asynchronously.
61 44 HALT When HALT input is low (binary 0), internal operation of the 8X305 stops at the start of next
instruction; MCLK is not inhibited nor is any internal register affected. However, both the Left
Bank/Right Bank (LB/RB) signals are synchronously driven high during the first quarter of the
instruction cycle time and remain high during the time HALT is low.
24-2?, - No Connect
40-44,
53, 54
NOTE:
Multiple Vcc, GND, and VCA pins must be externally connected.
Microcontroller 8X305
FUNCTIONAL OPERATION words of program storage - either ROM or simple method of implementation is shown in
PROM. The user interface (IVO through IV7) is Figure 3. When LB is active low, the left bank
Typical System Configuration capable of uniquely addressing 256 Input! is enabled and anyone of 256 locations
Although the system hookup shown in Figure Output locations and, with additional bank within the RAM memory can be accessed for
3 is of the simplest form, it provides a bits (LB, RB), this number is expanded to input! output operations. A similar set of "en-
fundamental look at the 8X305 Microcontral- 512 - each bank comprising 256 address- able/access" conditions are applicable to the
ler and peripheral relationships. As indicated, able locations. The addressable locations of right bank when RB is active low.
the 8X305 can directly address up to 8K each bank can be used in a variety of ways; a
LeQand:
• =110 DATA AND ADDRESS
Wi; - INSTRUCTION ADDRESS
0, = INSTRUCTION
USER
) CONTROLLED
INPUTS
a: 8X450 RAM
w (258.8)
-'
-'
PROGRAM STORAGE
o
(READ ONLY MEMORy)
X2 ",a:
01-
8K)C 18 ROMIPROM GND ..,Z
><0
<0(,)
o
a:
LEFT BANK
1-0F·258
I/'.'---::---I~ ADDRESSABLE
LOCA110NS
Microcontroller 8X305
MOVE OPERATIONS
I---------------REGISTER-TO-REGISTER--------------
SOURCE DATA PROCESSING ALU DATA PROCESSING DESTINATION
(PRE-ALU) (POST-ALU)
RD-R 1? as specified by _ Right rotate as specified r. No operation. No operation. RD-R?, R11-R17 as
"8" field of instruction. by "R" field of specified by "0" field of
instruction. instruction.
1 - - - - - - - - - - - - - - - - REGISTER-TO·W BUS - - - - - - - - - - - - - - - -
SOURCE DATA PROCESSING ALU DATA PROCESSING DESTINATION
(PRE-ALU) (POST-ALU)
RD-R17 as specified by _
"8" field of instruction.
No operation. _ No operation. r- Shift and merge as
specified by "Do" and
- Variable length field of iV
bus - Left Bank (03) or
"L" fields of instruction. Right Bank (RB) as
specified by "Do" and
"01" fields of instruction.
I - - - - - - - - - - - - - - - I V BUS-TO-REGISTER - - - - - - - - - - - - - - -
SOURCE DATA PROCESSING ALU DATA PROCESSING DESTINATION
-
(PRE-ALU) (POST-ALU)
Variable length field of iV _ Right rotate and mask ,.. No operation. No operation. RD-R?, R11-R17 as
bus - Left Bank (03) or as specified by "So" and specified by "0" field of
Right Bank (RB) as ilL" fields of instruction. instruction.
specified by "S,' and
"SO" fields of instruction.
-
(PRE-ALU) (POST-ALU)
Microcontroller 8X305
ADD OPERATIONS
AND OPERATIONS
XEC, REGISTER
SOURCE DATA PROCESSING ALU DATA PROCESSING DESTINATION
- - -
(PRE-ALU) (POST-ALU)
RO - R17 as specified by
"S" field of instruction.
No operation. Add source data to 8-bit
field specified by
No operation. r- Replace 8 LSB of
Address Register with
instruction literal 8-bit sum from ALU.
(0 < J < 377.).
• PG M eTR unchanged.
XEC, IV BUS
SOURCE DATA PROCESSING ALU DATA PROCESSING DESTINATION
- - -
(PRE-ALU) (POST-ALU)
Left or Right Bank of 117 Rotate and mask as Add masked field of No operation. I- Replace 5 LS~ of
bus as specified by "S" specified by "So" and source data to 5-bit Address Register with
field of instruction. "L" fields of instruction. literal specified by "J" 5-bit sum from ALU.
field of instruction
(0 <J <37.). 'PGM eTR unchanged.
Microcontroller 8X305
NZT, REGISTER
- -
(PRE-ALUl
RO-R17 as specified by
"S" field of instruction. - No operation. Test contents of source
register for all zeroes.
- - - - - - If S = 0, increment PC
by 1; if S*O, replace 8
LSB of AR and PC with
literal specified' by "J"
field of instruction.
NZT, W BUS
-
(PRE-ALUl
-
(PRE-ALUl (POST-ALUl
0 .. J .. 3778 - value
specified by "J" field of
>. No operation. No operation. r- No operation. r- RO-R7, R11, R14-R1·7.
Load a-bit integer
instruction. specified by "J" field
into register specified by
"0" field.
0 .. J .. 3778 - value
specified by "J" field of
r- No operation. r- No operation. r- No operation. r- Left (R12) or Right (R13)
Bank of iV bus as
instruction. specified by "0" field of
instruction.
- -
(PRE-ALUl (POST-ALUl
o .. J .. 378 - value
specified by "J" field of
r- No operation, r- No operation. Shift and merge source
data as specified by
Left or Right Bank of iV
bus as specified by "0"
instruction. "00" and "L" fields of field of instruction.
instruction.
Microcontroller 8X305
M icrocontroller 8X305
INSTRUCTION SET
"II- OUTPUTPHASE~ General Format and Operating
----.r
r--INPUTPHASE
Principles
.J ~I_ _--' The 16-bit instruction word (10 through 115)
I 101 I 2nd I 31d I 41h I from program storage is input to the instruc-
j-4-QUARTER--f--QUARTER~QUARTER~QUARTER~
sons SOnl SOna SOns tion register (Figure 1) and is subsequently
INPUT LATCH AND NEXT LATCH I/O decoded to implement the events to occur
INSTRUCTION, PROCESS INSTRUCTION ENABLING during the current instruction cycle.
DECODE INPUT DATA ADDRESS, ADDRESS OR
INSTRUCTION GENERATE 110 DATA INTO The general format for each instruction word
AND, IF CONTROL SELECTED
REQUIRED, SIGNALS, AND PERIPHERAL. is shown in Table 3.
FETCH NEW SETUP 1/0
DATA DATA FOR The 3-bit operation code (OPCODE) define
OUTPUT anyone of eight classes of instructions;
~~-------------~If- IICLK IL
variations within each class are specified by
the remaining thirteen operand bits. The eight
(ACTIVE--I
STATE)
instruction classes can be separated into two
control areas - data and program; general
functions within these areas are as shown in
NOTES:
1. New instruction must be accepted and latched at end of first quarter cycle.
Table 4.
2. The 1/0 data latches are open for the first two quarter cycles, that is, for 1DOns.
3. The address changes during third quarter cycle. Instruction Fields
4. iV bus drivers are active (turned on) during third and fourth quarter cycles. As shown in Table 5, each instruction word
consists of an operation code (OPCODE)
Figure 4. Instruction Cycle and MCLK with: Crystal = 10MHz and
Cycle Time = 200ns. field and from one to three operand fields.
The possible operand fields are: Source (S),
Destination (D), Rotate/Length (R/L), Literal
(J), and Address (A). The OPCODE and
Table 3.
operand fields are described in the para-
! MSB LSB ! graphs that follow the table.
BIT POSITIONS --> 3 4 678 10 11 12 13 14 15
OPERAND(S)
Table 4.
• Data Control-
ADD
AND Arithmetic and Logic Operations
XOR 1
MOVE
XMIT
1Movement of Data and Constants
• Program Control-
XEC
NZT
1 Branch or Test
JMP
Microcontroller 8X305
~!c:o~: 1,01"1'21~HI5!
5-field to internal register specified by D-field. we L L
1 1 3141 : 1617181: Prior to the "MOVE" operation, right-rotate
contents of internal source register by octal Ui H L if D-07.
5-00.-17. D-00.-07., 11.-17. value (0 through 7) defined by the R-field. ~ H L if D-17.
Register·to-IV Bus (Note) Move contents of internal register specified by SC L L
1 0 1'12131415161718191'01"1'21'31'41'51 the 5-field to the iV bus. Before outputting on we L H
iV bus, data is shifted as spec~ied by the least
IopeODE I 5 L D I I significant octal dign of the D-field and the bits LB L if D-20.-27. LifD-20.-27.
I I D, Do I specified by the L-field are merged with the
latched 110 data.
liB L il D-30.-37. L if D-30.-37.
5-00.-17. D-20.-37.
IV Bus-ta-Reglster (Note) Move right-rotated iV bus (source) data SC L H H D=07., 17.
1 0 1'12131415161718191'01"1'21'31'41'51 specified by the 5-field to internal register we L L
I opeODE 5I L I
D
specified by \he D-field. The L-field specHies
the length of source data starting from the Ui Lit 5-20.-27. LHD-07.
5, I So
5=20.-37. D=00.-07., 11.-17.
I I I L5B-position and, if less than B bits, the
remaining bits are filled w:ith zeros.
"FiB L H 5-30.-37. L H D-17.
M icrocontroller 8X305
Microcontroller 8X305
Microcontroller 8X305
Microcontroller 8X305
T 1I'F. V_CR
:r:-::-. BVCEO > 15V
NOTE:
Typical approved parts - 2N5320, 2N5337
Voltage Regulator
Microcontroller 8X305
ABSOLUTE MAXIMUM RATINGS Storage Temperature (TsTG) rating are from -65°C to +150 o G
SYMBOL PIN DESCRIPTION RATING UNIT
LIMITS
SYMBOL PARAMETER TEST CONDITIONS UNIT COMMENTS
Min Typ Max
Microcontroller 8X305
Microcontroller 8X305
AC TEST CIRCUITS
5V 5V
787H 237n
OUTPUT OUTPUT
UNDER TEST UNDER TEST
NOTE:
Load capacitance includes Test Jig and Probe Capacitance
TIMING CONSIDERATIONS all parameters that are cycle-time dependent Condition 1 - Instruction or MCLK to LB/RB
is likewise increased. In some cases, these (input phase) plus I/O port ac-
(Commercial Part)
delays have a significant impact on timing cess time (TIO) < fV data set-
As shown in the AC CHARACTERISTICS
relationships and other areas of systems up time (Figure 5a).
table for the commercial part, the minimum
design; subsequent paragraphs describe
instruction cycle time is 200ns; whereas, the Condition 2 - Program storage access time
these timing parameters and reliable methods
maximum is determined by the on-chip oscil- (TACC) plus instruction to LS/
lator frequency and can be any value the user of calculation.
RS (input phase) plus I/O port
chooses. With an instruction cycle time of Timing parameters for the 8X305 are normal- access time (TIO) plus fV data
200ns, the part can be characterized in terms ly measured with reference to MCLK. (input phase) to address < in-
of absolute values; these are shown in the struction cycle time (Figure
System determinants for the instruction cycle
first" LIMITS" column of the table. When the 5b).
instruction cycle time is greater than 200ns, time are:
• Propagation delays within the 8X305 Condition 3 - Program storage access time
certain parameters are cycle-time dependent;
• Access time of Program Storage plus instruction to address
thus, these parameters are specified in terms
of the four quarter cycles (T 10, T2Q, T3Q, and • Enable time of the I/O port
< instruction cycle time (Fig-
ure 5c).
T4Q) that make up one instruction cycle-
Normally, the instruction cycle time is con-
see 8X305 TIMING DIAGRAM. As the time
strained by one or more of the following
interval for each instruction cycle increases
conditions:
(becomes greater than 200ns), the delay for
I I I I , ~
, ," , I"'II
H !: H
~~ ~
1
,----v. 1 : ~ MCLK I I I I I 1
~'
MCLK ----Jj : '
MClK-.i
SC,WC,lB -a:c' ~
I \
II
~
It
AO-A12~! I
i ! ~i
f-T-CD---I.j I I I I 10-115
l~-::'
I I I I I I I
orRB I~@:~ i 1 :
151
: I~
\ "~"
I I: I I I I I
'E='" ~
10-1 I II I AO-A12 II I I I::
::~:
I I
IVO-1V7 I
I I
I
I
I
I
I
r i : ~ :INSTRUCTlON: I I
l::
I I
I 11 I I I LB,RBI : ~ I I I I : ITO ADDRESS I :
:-0-fi :I lI :I : : \ - i (Ii ~L-..j ~ I I I I I ------+--r I
NOTES: NOTES:
CD MCLK to IS/AB (input phase) or instruction to CD Program s~a~ access time.
[BlAB (input phase). ® MCLK to LB/RS (input phase) or instruction to
® I/O port access (TIO). 03/R8 (input phase).
® TV data setup time (referenced to MCLK). ® !fO port access (TIO).
@ iV data (input phase to address.)
Microcontroller 8X305
r=ICl~_ICP~
XI ______________,
: 1-1........------------------- 1, . . . : IACC 1 .. I
I. tVA - I
lNS(~:~I~:;ON ?~===========,;17"" I I ~'~~----------
SCIWC
1,- TM'S _I. II
II---------<.~
IMI ..
,
:
I
-..J IMWL
hg'~~ .~" J! \
(j/iil! ==--=---=---=---------,-,-'--".~~E I~ t: I X
Pm-1V'1 ~ OUTPUT
~S I MOBS
INPUT
J : -I
OUTPUT
I MODH f--
1-_1--
IMHH_I
_________________ 1MOOS -------------001
i~ t OOSIl
• INDtCATES CHANGING DATA
~ IMtruction , . .
I open
-.J
I
t..-
I
IMtruction 1ICtdr• • ~MCLK ....
cMIIgM I
-----1
I
: : I SC=-1~torI/O :
... sc ==wc ="0" .. :_ eddreM.wc=~,-fot' .. I
:
Iii
:
I
Ili. • _t~lnputo.t.
i
..!:
I
iii
I/OdMII
[I,JlI ... ,~autput . .
i
------i
I
I
:... I/O drtweN; ttw'....tMe - - - -......o-l~ 1/0drfv.,. acthl~ If output UIII 01 ~
I I I eddr... to 1/0 BUS;~"""" ottwwi.. I
:_ tlO'~;w.,.open _: :: :
I I I ..... --~I/Obul . . . ~
: i : ~ :
..
: .........- - - - - - - - - - -....
I I
: - - - - - - - - ONE ~YCLE
I
-------+:-------...,.. :
, I
NOTE:
For an instruction cycle time greater than 200n5, the 1/0 bus can be stable sometime within the third quarter (T3Q) cycle.
Microcontroller 8X305
From condition # 1 and with an instruction valid at the falling edge of MCLK. This rela- noise. For various capacitor (Cx) values, the
cycle time of 200ns, the 1/0 port access time tionship can be derived by the following cycle time can be approximated as:
(TIO) can be calculated as follows: equation:
APPROXIMATE CYCLE
TMIBS + TIO ,,;;; TMIDS 200ns - TMAS - TACC Cx (in pF)
TIME
transposing, TIO";;; TMIDS = TMIBS = 200ns - 140ns - 60ns
substituting, TIO";;; 55ns - 25ns = Ons 100 300ns
result, TIO";;; 30ns 200 500ns
It is important to note that, during the input 500 1.1I'S
Using 30ns for TIO, the constraint imposed by phase, the beginning of a valid LB/RB signal 1000 2.01's
condition # 1 can also be used to calculate is determined by either the instruction to LBI
the minimum cycle time: RB delay (TIIBS) or the delay from the falling Crystal Timing. When a crystal is used, the
edge of MCLK to LB/RB (TMIBS). Assuming on-chip oscillator operates at the resonant
TMIBS + TIO";;; TMIDS
the instruction is valid at the falling edge of frequency (fo) of the crystal. The series-
thus, 25ns + 30ns ,,;;; T 10 + T2Q - 45 MCLK and adding the instruction-to-LB/RB
25ns + 30ns";;; 112 cycle - 45 resonant quartz crystal connects to the
delay (TIIBS = 25ns), the LB/RB signal will 8X305 via pins 10 (X1) and 11 (X2). The lead
therefore, the worst-case instruction cycle be valid 25ns after the falling edge of MCLK. lengths of the crystal should be approximate-
time is 200ns. With subject parameters refer- With a fast program storage memory and with ly equal and as short as possible. Also, the
enced to X1, the same calculations are valid: a valid instruction before the falling edge of timing circuits should not be in close proximity
MCLK - the LB/RB signal will, due to the to external sources of noise. The crystal
TIBS+ TIO + TlDS';; 1/2 cycle TMIBS delay, still be valid 25ns after the should be hermetically sealed (HC type can)
thus, 45ns + 30ns + 25ns';; 112 cycle falling edge of MCLK. Using a worst-case and have the following electrical characteris-
therefore, the worst-case instruction cycle instruction cycle time of 200ns, the user tics:
time is again 200ns. From condition # 2 and cannot gain a speed advantage by selecting a Type - Fundamental mode, series reso-
with an instruction cycle time of 200ns, the memory with faster access time. Under the nant
program storage access time can be calculat- same conditions, a speed advantage cannot Impedance at Fundamental- 35n max.
ed: be obtained by using an 1/0 port with fast Impedance at Harmonics and Spurs-
access time (TIO) because the address bus 50n min.
TACC + TIIBS + TIO + TIVA will be stable 55ns (TAS) after the beginning
,,;;; 200ns of the third quarter cycle - no matter how The resonant frequency (fo) of the crystal is
transposing, TACC';; 200ns - TIIBS - TIO early the 1\7 data input is valid. related to the desired cycle time (T) by the
-TIVA equation: fo = 2/T; thus, for a cycle time of
substituting, TACC';; 200ns - 25ns - 30ns 200ns, fo = 10MHz.
-85ns CLOCK CONSIDERATIONS HALT Logic
thus, TACC';; 60ns The on-chip oscillator and timing-generation The HALT signal is sampled via internal chip
hence, for instruction cycle time of 200ns, a circuits of the 8X305 can be controlled by any logic at the end of the first int<;lrnal quarter of
program storage access time of 60ns is one of the following methods: each instruction cycle. If, when sampled, the
implied. The constraint imposed by condition Capacitor - if timing is not critical HALT signal is active-low, a halt is immediate-
# 3 can be used to verify the maximum Crystal - if precise timing is required ly executed and the current instruction cycle
program storage access time: External Drive - if application requires that is terminated. However, the halt cycle does
the 8X305 be driven from not inhibit MCLK nor does it affect any
TIA + TACC .;; Instruction Cycle internal registers of the 8X305. As long as the
thus, TACC';; 200ns - 140ns a system clock
HALT line is active-low, the SC and WC lines
and, TACC";;; 60ns Capacitor Timing_ A non-polarized ceramic are low (inactive), the Left Bank (LB)/Right
confirming that a program storage access or mica capaCitor with a working voltage Bank (RB) signals are high (inactive), and the
time of 60ns is satisfactory. equal to or greater than 25V is recom- 1\7 bus remains in the 3-State mode of opera-
mended. The lead lengths of capacitor should tion. Normal operation resumes at the next
For an instruction cycle time of 200ns and a be approximately the same and as short as cycle in which HALT is high when sampled
program storage access time of 60ns (Condi- possible; also, the timing circuits should not (see HALT TIMING DIAGRAM.)
tion # 2/Figure 5b), the instruction should be be in close proximity to external sources of
Microcontroller 8X305
x,
------I i~THH
1 1
THS----...! I.-!
Note 1 Note 2
HALT------------------~~\~,~~~,~,~,~,~,~,;,~,~,,~,~,~,~,~,I : ~~-r-r-r--r-r-r~r-r--r-r-r--r-r-,~-------------------------
'\ '\ '\ \ '\ '\ '\ \ '\ '\ \
\ \ '\ '\ '\ '\ I / / / / / / / / / / / / / It.
\\\"\\\\\\\'\\\\'\ /l /////1/111/////
'-'-'-'-'-'-'-'-'-'-'-'-'-'-"-1'-'--...1 -y'......I ../.J...J-/../...J.../J"/-/..../-/-I
!
ou%~~~_~~~1i<~~:~~~~__
1
SC & we ----------___
\ / :\ /
1
X X :1 \( X
MeLK
NOTES:
1. The HALT signal can switch from High to Low at any time during this interval.
2. The RArf signal can switch from Low to High at any time during this interval.
TIMING DESCRIPTIONS:
T HS - setup time from R'ACf to X1 (independent of instruction cycle time)
THH - hold time from X1 to HALT (independent of instruction cycle time)
T MHS - setup time from MCLK to HALT (dependent upon instruction cycle time)
TMHH - hold time from MCLK to HALT (dependent upon instruction cycle time)
Microcontroller 8X305
QUARTE:6~~~:~---1-------~------~------~~~----~------~-------
MeLK
ADDRESS---------~----------~~-~-~.~~~r----------------
AO-A12-----------t----------~---t_-I~~~~~~~~------------
sc'wc-----------1~~~
NOTES
~ DENOTES CHANGING DATA
Microcontroller 8X305
h
mentary outputs of a pulse generator. In PULSE
GENERATOR MICROCONTROLLER
applications where the Microcontroller must
be driven from a master clock, the X1/X2 soil
lines can be interfaced to TTL logic as shown
in Figure 9.
- X2=~
RESET Logic
RESET (pin 43) can be driven from a high PULSE GENERATOR CHARACTERISTICS:
(inactive) state to a low (active) state at any ZOUT = 50D
RISETIME ~ 10ns
time with respect to the system clock, that is, VOUT = 0 to 1.5V
the reset function is asynchronous. To ensure <
Skew 10ns
proper operation, RESET must be held low Figure 8. Clocking With a Pulse Generator
(active) for one full instruction time. When the
line is driven from a high state to an active-
• The input! output (iV) bus goes 3-State During the time RESET is active-low, MCLK is
low state, several events occur - the precise
and remains in that condition as long inhibited. Moreover, if the RESET line is
instant of occurrence is basically a function of
as the RESET line is low. driven low during the last two quarter cycles,
the propagation delay for that particular
• The Select Command and Write MCLK may be shortened for that particular
event. As shown in the RESET TIMING
Command signals are driven low and machine cycle. When RESET line is driven
DIAGRAM. these events are:
remain low as long as the RESET line high (inactive) - one quarter to one full in-
• The Program Counter and Address
is low. struction cycle later, MCLK appears just be-
Register are set to address zero and
fore normal operation is resumed. The RE-
remain in that state as long as the • The Left Bank/Right Bank (LB/RB)
SET /MCLK relationship is clearly shown by
RESET line is low. Other than PC and signals are forced high asynchronously
"B" in the timing diagram. As long as the
AR, RESET does not affect other for the period in which the RESET line
RESET line is active-low, the HALT signal
internal registers. is low.
(described next) is not sampled by internal
logic of the 8X305.
Microcontroller 8X30S
1. Using a 74LS136 Quad Execlusive-OR gate (open collector). 2. Using a 74LS266 Quad Exclusive-NOR gate (open collector)
lk
lk
)--4----1 Xl
)o---+--i Xl
3. Using a 74F38* Quad NAND gate (open collector). 4. Using a 74LS286 Quad Exclusive-OR gate.
+5V 8X305
8X305
+5V
lk
SYSCLK 500
X2
X2
SYSCLK
lk
500
Xl
Xl
-=
TTL DRIVER CHARACTERISTICS,
Fall Time.o;;;;; 1Dns
Skew Between Complementary Outputs.o;;;;; 1Dns
NOTES,
1. All circuits, as drawn, preserve the phase relationship of SYSCLK to X1.
2. The resistor values of 1k ohms for open-conector pull-ups and 500 ohms for active pull-up series resistors are calculated to be optimum for all opening conditions and silicon
varations.
3. The BX305 clock may be driven by circuits other than those shown here. The circuits shown however, have been tested under conditions in excess of those that will be found in a
normal system. Exclusive-OR/NOR type gates were selected to minimize the skew between the X1 and X2 inputs.
4. 74LS38 and 74S38 gates were tested in addition to the 74F38 chip. These were found to be the least robust configurations of all those tested, although they did work over normal
operating conditions abd beyond. When failure occured it was due to excessive skew between X1 and X2 caused by the inverting gate in the X1 leg.
Microcontroller 8X305
,
RESUME NORMAL OPERATION
"_
Note 1 -,-rrryrr
11//1/"
//1/11
Note 2
1 ,'
~----------------------~r------------~/~~~~J~~I
L
W.BUS
OUTPUTS ----.
------./
--~----~~~~\------------~I
SC&WC
"<'------)(
~- ----------------------------------------------~ n ~-----------
NOTES:
1. A High to Low transition of the RESET signal will force the Address Bus to an all-zero configuration.
2. The RESET signal can switch from Low to High at any point within this time interval and, in all cases, MCLK will occur at least one-quarter cycle time later as shown.
Microprocessor Products
ORDERING INFORMATION
DESCRIPTION ORDER CODE
64-pin Ceramic DIP - 900 Mil Wide N8X4011
64-pln Plastic DIP - 900 Mil Wide N8X401N
Microcontroller 8X401
.:':.,- --
AODRESS
--~=;-- -- - -- - -- -- - - -- ---,
COUNTER LEGEND I
I 13
(PC)
I
0
I
ADDRESS FLOW
I I
I
I
I ADDRESS
REGISTER (AR) ·7
PROGRAM
[SJ
I§lI
INSTRUCTION FLOW
DATA fLOW
I
I
I COUNTER I
STACK
~ ADDRESS BUS
I
I
I ADDRESS
I EE
1
DATA ADDRESS BUS
I SOURCE
MUX
I
I ~ INSTRUCTION BUS I
I R17
I
I SF
R11 I
I I
I IR
NZ
,I PS
, I I I I
cv
SI
I
REGISTERS
I
GENERAL PURPOSE RO~RB,RF .d.. ~j!il3~1llll!llllml!!!l
I 1'!'!'''~''f'"''T:,F'1I---------~~',4.~
r- ADDRESS REGS RC-RE ¢-- REGISTER
MERGE
I ~H I~ii
I H 11 CARRY Rl0
STATUS R11 1-....,_-' ..
~, 1:"
I. .
I
, ..L..J"--.... LENGTH/MASK
VECTOR ""BIT",
EZ:
LENGTH/MtSK VECTOR
:":TITITII",,,,,,~;;,,,,,§2':::""lillTII,;;":,c[JJIT:"''''':ITm'':;'':~''::::--~~
I XEC MUX ~ii:
~
LENGTH/MASK
VECTOR
I ALU
11
~~ RIGHT
I SOURCE
MUX
ROTATE
,~~ L-.-..y/
~ ~
ALU _ LEFT
ROTATEF
b
,
I'R12 -
IRa
~ '\ SECOND SEE NOTE
~~~s2~~'~~~~~S:~~If:IR,,~7_=IR=~$>L-_0_P~;~~~~N_C~ --~
INSTRUCTION'
, CARRY
NZ Rl0
~~$~~ESl~~' ~
BUS R17
19-10
I
~
INSTRUCTION
I I 20 .. REGISTER (IR) LENGTH/MASK VECTOR
, 1/0 INTERfACE
I
i INPUT 110 •
I LATCH
~"'~5il~~
, "
"\~ IR19-IRO
MERGE
I
INT-4--------I
Niii
r--;:::=====;-i--;:-
I R1B-R1 F
I---
F)INTERNAL
CONTROL
LENGTH/MASK
VECTOR ~
ff I" CABUS
Microcontroller 8X401
PIN DESCRIPTION
PIN NO. IDENTIFIER FUNCTION
1, 17, 47 GND Ground.
Program Address Lines: These active-high outputs permit direct addressing of up to 8192
2-14 A12-AO
locations of program storage; AO is LSB.
Non-Maskable Interrupt: The falling edge of this active-low input pin generates a non-
15 NMI
maskable interrupt.
Interrupt: This active-low input pin is tested during the fourth quarter of each instruction cycle.
16 INT If an interrupt is indicated and if interrupts are enabled, the address of the next instruction that
was to be executed is stored onto the program counter stack before the interrupt is serviced.
Instruction Lines: These active-high input lines receive 20-bit instructions from program
18-37 119-10
storage; 10 is LSB.
Bank A: When low, devices connected to bank A are accessed. (Note: Typically, the A signal
38 A is tied to the ME input pin of 1/0 peripherals.)
Bank B: When low, devices connected to bank B are accessed. (Note: Typically, the B signal
39 B is tied to the ME input pin of 1/0 peripherals.)
Bank C: When low, devices connected to bank C are accessed. (Note: Typically, the C signal
40 C is tied to the ME input pin of 1/0 peripherals.)
41 SC Select Control: When high, an address is being output on pins DA7 through DAO.
42 WC Write Control: When high, data is being output on pins DA7 through DAO.
43-46 Data Address Bus: These active-low, bidirectional, three-state lines are used for 1/0; DAO is
DA7-DAO
48-51 LSB.
52,64 Vcc + 5V power supply.
Master Clock: This active-high output signal is used to strobe data into data peripherals for
53 MCLK clocking 110 devices andlor synchronization of external logic. MCLK is active-high in the fourth
quarter cycle.
Read/Write Clock: This active-high output signal is used for synchronization of external logic
54 RWC
and is active-high during the third and fourth quarter cycles.
55 RESET Reset: The RESET input pin is used to initialize the 8X401.
Halt: The HALT input is sampled during the first quarter cycle of each instruction cycle. When
56 HALT
the HALT input is low, the instruction cycle is not executed.
Slow Clock Request: This active-low control input is sampled during the first quarter cycle of
each instruction. When SCR is asserted, it will cause the current instruction to be executed at
57 SCR half of the normal clock rate. This control input is necessary to accommodate 1/0 devices that
cannot operate at the 8X401's full speed, without having to continuously run ihe 8X401 at half
speed.
58 CP Clock Pulse: Each 8X401 quarter cycle will correspond to one full cycle of the clock pulse.
Status Input: The value of the SI pin during the fourth quarter cycle is transferred to SI bit in
59 SI
the status register.
60 PS Programmable Status: The programmable status pin is controlled entirely by the user program.
61 NZ Non-Zero: The NZ bit of the status register is reflected on this pin.
Interrupt Receivable: The IR pin indicates whether an interrupt applied at any point in time
62 IR will be serviced. Interrupts are receivable when the interrupt mask (status register, bit 0) is
clear and the stack is not full (1M = 0 and SF = 0).
63 CY Carry: Carry bit from R10 is output on this pin.
Microcontroller 8X401
SMALL SYSTEM pleted operation. Any TTL-compatible memo- 80th data and I/O address information are
I
CONFIGURATION
The system hookup shown on the next page,
ry can be used for program storage, provided
the worst-case access time is compatible with
multiplexed on the DA bus. The SC (Select
Command) and WC (Write Command) signals r
although of the simplest form, provides a the instruction cycle time used for the appli- distinguish between data and I/O address I
fundamental example of the 8X401 Microcon- cation. See timing section for appropriate information as shown in the table below.
troller and compatible peripheral relation- calculations. Although the table shows bank A only, the
ships. As shown, the 8X401 can directly same conditions apply to banks 8 and C.
address up to 8K locations of program stor-
age. 110 INTERFACE AND CONTROL BANK
The Data Address (DA) bus is an 8-bit bidirec- SC WC FUNCTION
A
Each of the three bank pins (A, B, or C) are tional I/O bus which provides a communica-
capable of uniquely addressing 256 input! tion link between the 8X401 and the three High Low Low DA bus is three-
output locations via the Data Address bus banks of the I/O devices. The A (A bank), B state and not
(DA7-DAO). (8 bank), and C (C bank) control signals looking for input
identify which bank is enabled. When all three data.
The addressable locations for each bank can
be used in a variety of ways. The hookup banks go high (inactive), neither bank is Low Low Low The DA bus is
shown below is just one method of implemen- enabled and the DA bus is inactive (three- reading input data.
tation. state). A functional analysis of the three bank
signals is shown below: Low Low High Data is being
When a particular bank signal is asserted, output.
that bank is enabled and anyone of 256 A B C FUNCTION Low High Low Address is being
locations on that bank can be accessed for output.
input! output operations. Low Low Low This state is not
generated by the X High High This condition is
8X401. never generated.
PROGRAM STORAGE Low High High Enable A bank
INTERFACE devices.
As shown in the 8X401 small system hookup,
program memory is connected to output ad- High Low High Enable 8 bank
dress lines A12 through AO (AO = LS8) and devices.
input instruction lines 119 through 10 High High Low Enable C bank
(10 = LS8). An address output on AI2-AO devices.
identifies one 20-bit instruction word in pro-
gram memory. The program memory outputs High High High Disable all devices;
an instruction word on 119 -10 which defines DA bus is three-
the microcontroller operation which is to fol- state
low. One instruction word equals one com-
Microcontroller 8X401
_B
258 ADDIIEIlSAa.E
LOCATlONII
m INSTRUCTION ADDRESS
~ INSTRUC110N IMTA
133 DATA. - . AND CONTROL
Microcontroller 8X401
DATA PROCESSING tion to being general purpose. A summary of into the AUX, the left-rotate and merge
The data processing section of the BX401 the registers is listed below: functions are inhibited when specifying
consists of a number of logical subsections. • RO (Auxiliary Register) - Register 0 is the AUX as a destination address. This
In order of processing, the data sees the right also used as the implied second allows subfields from any internal
rotator, the ALU, the left rotator, and the operand for two operand instructions register or I/O bank to be transferred
merge circuits. Data sources and destinations (ADD, ADD with CARRY, XOR, AND). to the AUX with the subfield LSB right-
can be various on-chip registers, the bidirec- The primary operand is specified in the justified and unspecified bits set to zero.
tional DA bus, or immediate subfields. The source field of the instruction word and • R1 through RA - These 10 addresses
data processing paths are shown below. the AUX register is the implied second specify general-purpose, on-chip storage
operand. Prior to performing arithmetic registers.
or logical operations (other than the
• RB - Register B is also used as the
DATA REGISTERS IMMEDIATE operation), it is assumed implied source for the XEC instruction.
that RO contains the appropriate data.
General-Purpose Storage In order to reduce the possibility of • RF - Register F is also used as the
There are 13 source/destination general-pur- implied destination for the XOR
erroneous results and to minimize the
pose registers available on the BX401. Three IMMEDIATE and AND IMMEDIATE
number of instructions required to
of these registers, specifically Registers 0, B, instruction classes.
transfer a right-justified second operand
and F, have other special functions in addi-
IR NZ PS cY SI
I Itt 1
GENERAL PURPOSE fIOoR8, RF A
I!!Pi iI!W ADDRESS REGS RC-RE
REGISTER
MERGE
CARRY R10 ~
t-~S~TA=IVS~~R~17~----------------~
ALU
SOURCE
MUX
I/O INTERFACE
Microcontroller 8X401
Enabled 1/0 Addresses RY. NZ can also be written to directly when pressed. This allows byte rotate operations to
These three registers (RC RD, and RE) al- specified in the destination field. This opera- be performed. The left-rotate is also sup-
ways contain the address of the most recent- tion will negate and take priority over the pressed when the destination is register O.
ly enabled 110 device for each of the three 1/ normal setting by the ALU output. NZ is not This is the AUX register and is used as the
o banks. When register C, 0, or E is the affected after an XMIT instruction, or after a implied second operand in· certain instruc-
specified destination address, the destination write to R17. tions.
data is sent to both the on-chip register and Bit 2: (PS) - This is the Programmable Sta- It should also be noted that subfields are
the corresponding bank on the DA bus. The tus bit. The contents are reflected on the PS defined at the ends of a register; for example,
relationship between the register addresses output pin. This status is controlled entirely by bit positions 1, 0, 7, and 6 constitute a
and I/O banks is shown below: the user program. contiguous 4-bit subfield.
REGISTER BANK Bits 3 and 4: (UFO, UF1) - These two bits Data Field - The data field holds data that
represent user flags and have no assigned can be processed directly from the instruction
C A
functions. They can be used as l-bit internal word.
o B flags and are entirely under control of the
E C
user program.
When these registers are specified as a
Bit 5: (51) - This bit reflects the state of the
LEFT-ROTATE OVERRIDE
destination address, the L field must be set to BLOCK
status input pin. This read-only bit is updated
o (full 8-bit operation). Also, note that regis- during the 4th quarter cycle. Register addresses 18-1 F are destination
ters C, 0, and E may not be used with the only and are used to independently control
XMIT 5 or ADD IMMEDIATE 5 instructions. Bits 6 and 7: (SE, SF) - These read-only bits left rotation of data prior to storage in the
indicate Stack Empty and Stack Full, respec- destination. Specifying 18-1 F as a destination
Carry tively. The bits are updated during the 3rd
Register 10 contains the Carry bit. Bit position causes the data to be returned to the source
quarter cycle within the instruction thaI. alters address.
o (LSB) is the Carry bit, and positions one
the stack status.
through seven are always zero. The Carry bit In order to move a processed subfield within
is updated each time an ADD, ADD IMMEDI- the same register but in different bit positions
ATE, or ADD WITH CARRY instruction is (the LSB of the contiguous subfield can vary),
performed. When specifying address 10 as a
INSTRUCTION WORD (See
it is necessary to independently specify the
destination, only bit 0 (the Carry bit) will be Table 3) LSB for both the source and destination. The
written to. Data written to the Carry bit will be Operations Code Field - The 4-bit opcode order of operation is as follows:
the LSB of the right-rotated data after any specifies one of 16 classes of instructions. • Register or I/O source data is right-
specified operation. Some instructions require two additional su- rotated as specified by the "R" field.
When the Carry register is the explicit desti- bopcode fields, X and XS. Variations and Along with the "L" field, the subfield
nation of any ADD instruction, it will contain interpretations are displayed in Table 2. data is defined.
the carry resulting from the add operation Source (5) and Destination (D) Fields- • Subfield data is processed via the ALU.
rather than the LSB of the sum. Carry can The 5-bit "S" and "D" fields specify the • Data is left-rotated 0 - 7 bits, depending
also be affected via the Return and Set Carry source and destination, respectively, for the on the corresponding register addresses
or Return and Clear Carry instructions. operation that is defined by the opcode. The 18-1 F as specified in the destination
"S"· and/or "D" fields specify an internal field rather than using the "R" field.
Status Register
This address specifies the current condition 8X401 register or a variable length field from • After left-rotation the specified subfield
of the 8X401 system. The status register may an 110 device. Hexadecimal values and is merged into those bits of the original
be either a source or destination; however, source/destination field assignments for all source data. The unspecified bits of the
certain bits in the status register are read- internal registers are shown in Table 1. original source data remain unchanged.
only. Four status outputs are available on When RC-RE (banks A, B, or C, respectively) • Result is stored in the register address
8X401 pins. They are NZ (Not Equal to Zero), are specified as the destination, the data is specified by the source field.
PS (Programmable Status), IR (Interrupts Re- output onto the DA bus using the specified Note that the left-rotate is always inhibited if
ceivable), and Carry (Rl0, bit 0). The IR pin bank. The data is also stored in the specified the "L" field is zero. Also, addresses 18-1 F
goes high when the interrupt mask is clear register and may be later accessed as source may not be used in the destination field for
and the stack is not full. The IR output is data. the XMIT or ADD IMMEDIATE instructions.
updated during the 4th quarter cycle. The
Rotate (R) and Length (L) Fields - The R The destination addresses and correspond-
following descriptions define the bits within
field is used in conjunction with the L field to ing left-rotate values are shown in Table 2.
the status register.
define the desired data within a register or 1/
Bit 0: (1M) - This bit represents the Interrupt o device. The source data is right-rotated
Mask control. When 1M is set, the interrupt is prior to ALU operations, such that the bit DA BUS CONTROL BLOCK
inhibited. This bit is set automatically by a specified by the R field is right-justified. The L Register addresses 11 - 16 are used by the
response from a standard or non-niaskable field specifies the number of bits of data to be 8X401 to access I/O devices for either a
interrupt, or RESET. 1M can also be set or used for the operation. After the ALU opera- source or destination specified within the
cleared by a write to the status register. tion, the data is left-rotated back to the instruction. Register addresses 13, 15, and
original position prior to merging the data in 16 specify banks A, B, and C, respectively,
Bit 1: (HZ) - This bit is set whenever the
the destination register. whereas addresses 11, 12, and 14 specify
ALU output data is not equal to zero after any
bank pairs AB, CA, and BC, respectively
of the following instructions: MOVE, ADD, When the L field specification is 0 Ondicating (Table 4). One bank of each pair is known as
AND, XOR, ADD IMMEDIATE, AND IMMEDI- a full 8-bit operation), the left-rotate. is sup- the preferred bank. The preferred banks for
ATE, XOR IMMEDIATE, or ADD WITH CAR-
December 17, 1986 6-34
Signetics Microprocessor Products Product Specification
Microcontroller 8X401
pairs AB, CA, and BC are banks A, C, and B, Example 1: PROGRAM COUNTER STACK
respectively. The first letter from each bank The 8X401 stack is capable of saving up to
OPCODE L S R 0
pair can serve as a mnemonic aid as to which four return addresses for subroutines and
ADD I 4 R1 R11
bank is the preferred bank. Having a pre- interrupts. Addresses are pushed onto the
ferred bank is simply a method of determining Bank Pair
stack as a result of a call or a maskable or
which bank to read when an instruction would AB
non-maskable interrupt. Addresses are
otherwise indicate that two banks should be 6 2 popped from the stack as a result of an
read at once. unconditional RETURN, a satisfied condition-
R1 I a I c I Ie
When used as a source, the appropriate If a al RETURN, or a Pop Stack and Jump
bank is enabled and data is read from the Specified instruction. The status of the stack (whether
a
activated If device on that bank. The If a Subfield empty, full, or neither) is available from the SE
device may have been activated by a previ- Source register R1. Note specified and SF flags in the status register and the
ous address select instruction where regis- subfield from L ~ 4 and R ~ 2. Interrupts Receivable (IR) output pin.
ters C-E were the specified destination. If a
bank pair (addresses 11, 12, or 14) is speci- R1+ RO I a' I b' I c' I d' I e' I f' I g' I h' I
fied as a source, only data from the preferred INTERRUPTS
bank of that pair will be read in. Add R1 with RO (AUX). Result after
left~rotate.
Interrupt (INT)
When addresses 11 - 16 are specified as the The interrupt input is tested once each in-
destination address, the destination data is struction cycle, during the fourth quarter cycle
Bank A I i i i Ikl1lmlnlolp I (see Figure 1). When the interrupt input is
sent to the DA bus. The Write Control (WC)
signal goes high, indicating data (as opposed Read preferred bank A of AB. taken low and is enabled, the address of the
to an address) is on the DA bus and is to be next instruction is pushed onto the program
a
written to the activated If device on the
Bank A
counter stack.
selected bank(s). Program flow is transferred to address 2 for
Bank B
When addresses 11 - 16 are specified as the the start of the service routine (Figure 2). This
destination and the "L" field is not zero, the Result after merge. Data put out is accomplished by inserting a dummy in-
on both banks A and B. struction cycle after the interrupt is accepted.
following statements apply: If the source is a
register and the destination is a single bank, If, however, the specified source is a bank or The interrupt mask bit (R17, bit 0) is set
the bank will be read (or the preferred bank of bank pair, any unspecified bits will contain automatically as part of the interrupt re-
a bank pair will be read) to obtain the data unprocessed data from the source If de- a sponse.
required to perform the merge operation. The vice. Below is an example of the outcome
result is that processed data from the speci- with Source = R14 (bank pair BC) and Desti- The Interrupts Receivable (IR) pin indicates
fied subfield of the source register is returned nation = R13 (bank A). whether an interrupt applied at any point in
to that selected field of the destination bank time will be serviced. Interrupts are receivable
Example 2: when the interrupt mask is clear and the
and any bits outside of the specified subfield
will be loaded with unprocessed data from the OPCODE L S R 0 stack is not full (1M = 0 and SF = 0).
a
If device just read. If the destination is a ADD
I
4 R14 R13 Non-Maskable Interrupt (NMI)
bank pair, the data from the procedure just Bank Pair Bank A The function of the non-maskable interrupt is
described is sent to both banks. Below is an BC similar to the standard interrupt, except that
example of the outcome of an ADD instruc- the interrupt receivable status has no effect
tion with Length = 4, Rotate = 2, 7 6 5 4 3 2 0
on its operation and the address jumped to is
Source = R1, and Destination = R11 (bank Bank B I a I b I c I die I f I I h I 1 rather than 2 (Figure 2). Address 1 should
pair AB). contain an unconditional JUMP to the start of
Specified the NMI service routine. An NMI is triggered
Subfield
by a falling edge on the NMI input. The
Read Preferred bank B of Be. Note interrupt mask is set to prevent normal inter-
specified subfield from L = 4 and
R ~2. rupts from interfering with the NMI service
routine. Note that it may not always be
possible to recover from an NMI, since the
Bank B + RO I a' I b' I c' I d' I e' I f' I g' I h' I condition of the interrupt mask prior to the
Add bank B data with RO (AUX). NMI is not known, and the NMI response may
Result after left-rotate. overflow the stack.
Microcontroller 8X401
full speed, without the need to run the 8X401 HALT operation. Like MCLK, RWC continues the first instruction from program storage at
continuously at half speed. to operate during a HALT operation. address O. Only MCLK, RWC, and the ad-
dress bus are in operation during the dummy
cycle. The first active instruction cycle will
HALT RESET LOGIC begin following the first MCLK after RESET is
The HALT input is sampled during the first The RESET pin is used to initialize the 8X401. released. The instruction at address 0 should
quarter cycle of each instruction. If the HALT When RESET is low, the address outputs be an unconditional jump to the beginning of
input is low, the instruction cycle is not (A 12 - AO) are high impedance, the stack the main program (which may be proceeded
executed. The MCLK continues to operate pointer is set to the top of the stack (empty), by a power-up sequence to initialize the
normally (high every fourth quarter cycle), MCLK is inhibited, RWC is low, and the system (Figure 2).
even though program execution has ceased. interrupt mask (bit 0, register 17) is se\.
If RESET is applied during program execu-
When the HALT input goes high, program
When RESET is released, the address out- tion, its effect is immediate. That is, if MCLK is
execution will resume at the next falling edge
puts all go low (program address 0). A dummy high, it may be prematurely terminated by
of MCLK. The DA bus is also inactive during a
instruction cycle occurs to allow time to fetch RESET.
Microcontroller 8X401
Table 2. Various of Instruction Types Instruction Set Overview: The 8X401 in-
!....
struction set is summarized in Table 2. Sub-
INSTRUCTION sets of each instruction type are grouped
VARIATION OPCODE X XS DESCRIPTION
TYPE together showing the variations of each in-
MOVE MOV 0000 - - MOVE struction type. The hardware and software
descriptions can be found in the data opera-
ADD ADD 0001 - - ADD tions section.
ADC 0101 - - ADD with CARRY
AD8 1000 - - ADD IMMEDIATE 8
AD5 1001 - - ADD IMMEDIATE 5
AND AND 0010 - - AND
AN8 1010 - - AND IMMEDIATE 8
AN5 1011 - - AND IMMEDIATE 5
XOR XOR 0011 - - Exclusive-OR
XR8 1100 - - Exclusive-OR IMMEDIATE 8
XR5 1101 - - Exclusive-OR IMMEDIATE 5
XEC XEC 0100 - - EXECUTE
XMIT XT8 0110 - - Transmit IMMEDIATE 8
XT5 0111 - - Transmit IMMEDIATE 5
RETURN RIF NS 1110 000 - RETURN IF SI = 0
RIF S 1110 001 - RETURN IF SI = 1
RIF NC 1110 010 - RETURN IF CARRY = 0
RIF C 1110 011 - RETURN IF CARRY = 1
RIF Z 1110 100 - RETURN IF ALU = 0
RIF NZ
PSJ
1110
1110
101
110
-
-
RETURN IF ALU 0
POP STACK and JUMP
'*
RTN 1110 111 00 RETURN
RCC 1110 111 10 RETURN and CLEAR CARRY
RSC 1110 111 11 RETURN and SET CARRY
JUMP JIF NS 1111 000 - JUMP IF SI =0
JIF S 1111 001 - JUMP IF SI = 1
JIF NC 1111 010 - JUMP IF CARRY = 0
JIF C 1111 011 - JUMP IF CARRY = 1
JIF Z 1111 100 - JUMP IF ALU = 0
JIF NZ
JSR
1111
1111
101
110
-
-
JUMP
JUMP
IF
to
'*
ALU 0
SUBROUTINE
JMP 1111 111 - JUMP
Microcontroller 8X401
I I I I
?PCODE
II I
L
I I I II
DESTINATION
I I I
DATA8
I 15
16
B
C
B
C
6. Format for the JUMP, Subroutine Jump, Conditional Jump, and Conditional
Return Instruction:
I I I I I I I I I I
I OPCODE X ADDRESS
7. Format for the Unconditional Return, Return and Set Carry, and Return and Clear
Carry Instruction:
I I I I I I I I I I
OPCODE X (UNUSED
I----INPUT PHASE---+---OUTPUT P H A S E - j
Figure 1. Instruction Cycle and MCLK with: Clock Input = 26.67MHz and Cycle Time = 150ns
Microcontroller 8X401
MOVE, ADD, AND, XOR, ADD with CARRY (Using left-rotate override R18 - R1 F)
- Left-rotate and mask as
specified by the "R" and
"L" fields of instruction.
- RO - R 17 as specified by
the "Destination" field of
instruction. (Notes 2 & 3)
,---------,
SOURCE PRE-ALU ALU POST-ALU DESTINATION
RO - R17 as specified by
"S" field of instruction.
-
Right-rotate as specified
by "R" field of instruction.
- Perform appropriate ALU
operation. (Note 1)
XMIT 8 (XT8), ADD IMMMEDIATE 8 (AD8), AND IMMEDIATE 8 (AN8), XOR IMMEDIATE 8 (XR8,..:-)_ _ _ _ _--,
SOURCE PRE-ALU ALU POST-ALU DESTINATION
One to eight bit constants
from data field of
instruction and register!
address specified by either
the source or destination
field.
- NOP.
XMIT 5 (XT5), ADD IMMMEDIATE 5 (AD5), AND IMMEDIATE 5 (AN5), XOR IMMEDIATE 5 (XR5)
,----------,
SOURCE PRE-ALU ALU POST-ALU DESTINATION
One to five bit constants
from data field of
instruction and register!
address specified by either
the source or destination.
- Right-rotate as specified
by "R" field, the data
defined in either the
source or destination field.
- Perform appropriate ALU
operation. (Note 6)
- Left·rotate and mask as
specified by the "R" and
"L" fields.
- XT5, AD5: Subfield is
merged into register!
address specified by
destination field. LSB of
data field is sent to bit
position of destination
defined by "A" field.
AN5, XR5: Subfield is
merged into register!
address specified by
source field. The "A" field
specifies the LSB position
of source and RF. Results
are returned to RF.
ALL CONDITIONAL JUMPS, POP STACK AND JUMP (PSJ), and JUMP (JMP)
ADDRESS REGISTER PROGRAM COUNTER STACK
Conditional Jumps: If condition is true. PC=AR. Conditional Jumps: NOP.
AR = instruction word address, else AR = PC + 1. PSJ: POP stack.
PSJ and JMP: AR = instruction word address. JMP, NOP.
Microcontroller 8X401
XEC
ADDRESS REGISTER PROGRAM COUNTER STACK
Right-most L bits of RS merged into corresponding bits PC not updated. NOP.
in instruction address
NOTES:
1. ALU Descriptions:
MOVE: • No operation
ADD: • Source data ADDed to contents of auxiliary register (RD - AUX). Carry bit set if carry is generated at MSB of selected data field.
NZ status bit set jf specified bits are not zero after ALU add.
AND: • Source data ANDed to contents of AUX register. NZ status bit updated accordingly.
XOR: • Source data Exclusive-ORed with contents of AUX register. NZ status bit set accordingly.
ADD with CARRY: • Sum is formed from source data. AUX register, and carry bit (register 10, bit 0). Carry and NZ status bits are set when
appropriate.
2. Left-rotate is suppressed when destination is AO (AUX).
3. When address registers Re, AD and RE are specified in the destination, source data will also go out on banks A, B, C, respectively. The L-field
should be zero (a full a-bit operation) to ensure duplication of the two outputs.
4. A left-rotate of 0 - 7 bits will correspond to R18 - R1F as specified in the "Destination" field of instruction word.
5. ALU Descriptions:
XMIT: • Input constants from the instruction word to specified destination. NZ flag is not updated when an XMIT is performed: however,
NZ can be written to by an XMIT if R17 bit 1 is within the destination field.
ADO IMMEDIATE: • Instruction word data is ADDed to data specified by destination tied. The carry bit is set if a carry is generated at the MSB of
the selected data field. NZ status bit is updated to reflect the value of "L" bits of data atter the addition.
AND IMMEDIATE: • Instruction word data is ANDed to data specified by source field. Returning the destination data to RF allows the operation to
be performed without destroying the original data field. This will facilitate testing of data for certain pre~defined values while still
preserving the original data for other uses. NZ status bit updated accordingly. Unspecified bits in RF remain unchanged.
XOR IMMEDIATE: • Sarne as AND IMMEDIATE, except the logical operation performed is Exclusive-OR.
6. Note that the stack operation IS show before the PC in the CALL and INTERRUPT formats. This is because the stack is actually in operation in
cycle 3, and the PC is updated in cycle 4 (see Figure 1). In fact, for the Call (JSR) instruction and interrupt servicing, cycle order is important for
the user to understand the current status of the PC. The other instructions are in reverse order for visual simplicity in keeping with block diagram
flow, and cycle order is irrelevant.
MAIN
PIIOGIIAII
8K
Microcontroller 8X401
DC ELECTRICAL CHARACTERISTICS Commercial Part 4.75V';;; Vcc';;; 5.25V, O°C';;; TA ,;;; 70°C'
LIMITS
SYMBOL PARAMETER TEST CONDITIONS UNIT COMMENTS
Min Typ Max
NOTES:
1. 64-pin CDIP, airflow required for commercial operation. (The plastic 64-pin DIP with internal heatsink does not have this requirement.)
See above for thermal characteristics.
2. Not more than one output should be tested at a time.
3. Guaranteed by operation to Icc measured at 25°C.
M icrocontroller 8X401
Microcontroller 8X401
I
[
I
!
AC ELECTRICAL CHARACTERISTICS (Continued)
1-
150ns CYCLE > 150ns CYCLE
SYMBOL PARAMETER UNIT COMMENTS
Min Typ Max Min Typ Max
taos CP3 to output data stable 70 ns
T1Q+T2Q
tMOOS MCLK to output data stable 120 ns
+45
SC/WC rising edge to output driver
tOI 18 ns
turn on
tHS Halt setup to CP2 0 ns
tMHS Halt setup to MCLK -10 ns
tHH Halt hold from CP2 50 ns
tMHH Halt hold from MCLK 60 T1Q + 22 ns
tSIS Status input setup to CP1 10 ns
tMSIS Status input setup to MCLK 40 ns
tglH Status input hold from CP1 20 ns
tMSIH Status input hold from MCLK 0 ns
tscRS SCR setup to CP1 0 ns
tMSCRS SCR setup to MCLK 25 ns
See Diagram
tSCRH SCR hold from CP2 (Slow CP2) 20 ns
for CP2
tMSCRH SCR hold from MCLK 63 ST1Q-12 ns Slow T1Q
tiNTS INT setup to CP1 10 ns
tMINTS INT setup to MCLK 40 ns
tlNTH INT hold from CP1 10 ns
tMINTH INT hold from MCLK -10 ns
leyU CP4 to CY update 60 ns
tMCYU MCLK to CY update -10 28-T4Q ns
tNZU CP4 to NZ update 60 ns
tMNZU MCLK to NZ update -5 33-T4Q ns
tlRU CP4 to IR update 75 ns
tMIRU MCLK to IR update 20 58-T4Q ns
tpsu CP4 to PS update 60 ns
tMPSU MCLK to PS update -10 28-T4Q ns
Program memory access time T2Q+T3Q
tACC 60 ns
(address stable to valid instruction) + T4Q-52
I/O port output enable time T1Q+T2Q
tlO 24 ns
(bank signal to valid data on bus) -51
tRW Reset pulse width 150 tpc ns
tNMIW NMI pulse width 50 ns
tNMIS NMI setup to CP2 15 ns See Note 5
tMNMIS NMI setup to MCLK 10 ns See Note 5
NOTES:
1. Inputs swing between OV and 3V. All outputs are measured at 1.5V with loading as specified in the test circuits.
2. CP1, CP2, CP3, and CP4 refer to the clock pulse that causes the first. second, third, and fourth 8X401 quarter cycles, respectively. Parameters
referenced to MCLI<, CP1, CP2, CP3, and CP4 are measured to the falling edge of those signals. Tl Q, T2Q, T3Q, and T4Q represent time intervals
for the first, second, third, and fourth 8X401 quarter cycles. respectively. Duty cycle can be from 40% to 80%.
3. Instructions must be setup before CPl.
4. tWL represents IscL and tWCL' iMWL represents tMSCL and tMWCL·
5. This guarantees NMI is serviced in the current cycle.
Microcontroller 8X401
TEST CIRCUIT
VL=2.3 VL=2.1V
OUTPUT
UNDER
TEST
~
R'
2260
OUTPUT
UNDER
TEST
~ R'
'000
~50PF ~'OOPF
TC11240S
CP1 CP2 CP3 CP4 CP1 CPa CPa CP4 CP1 CPa CP3 CP4 CP1 CPa CPa
I I I I I I I I I I I I I I I
CP
IICLK ---+J
AWe
I
I 1ou.s-l
ADDRESS
(A12-AO) _ _ _ _ _ _ _ _ '--------...JI'----o:----.~- '-__.....____
INSTRUCTION
(119-10) " "........... . ,
sc
--------+-~--~
tMWCL
~~ --------~-~----<'_~_A_~_~_J
,
ii
""",,'"
Microcontroller 8X401
CP2 CP3 CP4 CP1 CP2 CP3 CP1 CP2 CP3 CP4 CP1 CP2
I I I I I I I I I I I I
CP
MCLK
~~§
~IsH ~"'~H
SI
I-t"su- I - typsu
PS }
! - - tNZU - I - tyNZU :
:
NZ
j
1-~~1 I-- tllC~
CY
I-~RUj ~""RU
IR
,
AWC
ASSERTED
RESET c.-----
I tRW
ADDRESS
X CP1
)
CP2 CP3 CP4 CP1 CP2 CP3 CP4 CP1
I I I I I I I I I
CP
f-:~~=~TRUCTION-I
"---
"
MCLK
RESET
RELEASED
AWC
I \ I '---
RESET I
ADDRESS
\
ADDRESS = 0
L )(
Microcontroller 8X401
CPl CP2 CP3 CP4 CPl CP2 CP3 CP4 CPl CP2 CP3 CP4 CPl
I I I I I I I I I I I I I
CP
I I
MCLK
M I I "--
RWC--i
I I
,
tHS-j
-l " ~~HS
I
~tMHH~
I-tHH
I I \..-
CP2 CP3 CP4 CPl CP2 CP3 CP4 CPl CP2 CP3 CP4 CPl
I I I I I I I I I I I I
CP
MCLK
I~ ________~__-L______________________________________________________________
ADDRESS
ADDRESS OF INSTRUCTION NOT
EXECUTED DUE TO INTERRUPT.
ADDRESS = 0002,.
\~--------------------------------------
IR
M icrocontroller 8X401
CPl CP2 CP3 CP4 CPl CP3 CP4 CPl CP2 CP3 CP4 CPl
I I I I I I I I I I I I
CP
UCLK
NMi
t,.1IIW--j
ADORESS * E S S OF INSTRUCTION
l1TED DUE TO NUl.
H!li)( ADDRESS = 0001,. X >C
IR
~
DABUS ( ) (~-----)~-------------
A.B.ORC~ I
_________JI
\
program compatible, differing only in the • Over 90 instructions, 70% single P17
PORT
INDEX
CORNER
40
sors as well as arithmetic processors. RESET ........ 2
0 39
They provide an instruction set which SINGLE
STEP -
allows the user to directly set and reset
EXTERNAL
individual lines within its 110 ports as MEM-
PLCC
well as test individual bits within the
accumulator. A large variety of branch
and table look-up instructions make
TEST f: 17
18 28
29
J 1[
ORDERING INFORMATION
SCN8000 HoODOO (CPxxxx)
PIN DESCRIPTION
PIN NO.
MNEMONIC TYPE NAME AND FUNCTION
DIP PLCC
Vss 20 22 Circuit ground potential.
VDD 26 29 low power standby.
Vee 40 44 Main Power Supply: + 5V during operation.
PROG 25 28 0 Output strobe for 8243 I/O expander.
P10 - P17 27 -34 30 - 33, I/O Port 1: 8·bit quasi·bidirectional port.
35-38
P20 - P27 21-24, 24 - 27, I/O Port 2: 8·bit quasi·bidirectional port. P20·23 contain the four high·order program counter bits
35-38 39-42 during an ex1ernal program memory fetch and serve as a 4·bit I/O expander bus for 8243.
DBO-DB7 12 -19 14- 21 I/O Data Bus: True bidirectional port which can be written or read synchronously using the RD,
WR strobes. The port can also be statically latched. Contains the eight low·order program
counter bits during an ex1ernal program memory fetch and receives the addressed instruction
under the control of PSEN. Also contains the address and data during an external RAM data
store instruction, under control of ALE, RD and WR.
TO 1 2 I Input pin testable using the conditional transfer instructions JTO and JNTO. TO and be
designated as a clock output using the ENTO ClK instruction.
T1 39 43 I Input pin testable using the JT1 and JNT1 instructions. Can be designated the timer/counter
input using the STRT CNT instruction.
XTAl1 2 3 I Crystal 1: One side of the crystal input for internal oscillator. Also input for external source
(non-TTL VIH).
XTAl2 3 4 I Crystal 2: Other side of crystal input.
INT 6 7 I Interrupt: Initiates an interrupt if interrupt is enabled. Interrupt is disabled aiter a reset. Also
testable with conditional jump instruction. Interrupt must remain low for at least three machine
cycles for proper operation.
RESET 4 5 I Reset: Used to initialize the microcomputer. Active low. Internal pullup -75Kr!. During
program verification the address is latched by a "0" to "1" transition on RESET and the
data at the addressed location is output on BUS.
RD 8 9 0 Read: Output strobe activated during a bus read. Can be used to enable data onto the bus
from an ex1ernal device. Used as a read strobe to ex1ernal data memory.
WR 10 11 0 Write: Output strobe during a bus write. Used as write strobe to ex1ernal data memory.
ALE 11 13 0 Address Latch Enable: Occurs once during each cycle and is useful as a clock output. The
negative edge of ALE strobes address into ex1ernal data and program memory.
PSEN 9 10 0 Program Store Enable: Output occurs only during a fetch to ex1ernal program memory.
55 5 6 I Single Step: Can be used in conjunction with ALE to "single step" the processor through
each instruction.
EA 7 8 I External Access: Forces all program memory fetches to reference ex1ernal memory. Useful
for emulation and debug, and essential for testing and program verification.
NOTE:
Each pin on these ports can be assigned, under program control, to be an input or an output. A pin is deSignated as an input by writing a logic" 1" to the pin. RESET
sets all pins to the input mode. Each pin has an internal pullup of approximately SOkn.
August 26, 1986 6-49
Signetics Microprocessor Products Product Specification
FUNCTIONAL DESCRIPTION
The following is a general functional description of the SCNB049 Series microcomputers. Refer to the block diagram below.
BLOCK DIAGRAM
P!"
RESIDENT
ROM
(8048149150 ONLy)
PQRTl P,O
8US
r--------,~----~__----~~----~~----~~----------~--~ B~:~R
LATCH
AEGISTEA2
REGISTER 3
REGISTER ..
POWER
SUPPLY BV
DD
- . RAM SUPPLY
v~ +5V MAIN SUPPLY
!!..OND
REGISTER 5
REGISTER 6
REGISTER 7
8 LEVEL STACK
(VARIABLE LENGTH)
OPTIONAL SECOND
REGISTER BANK
DATA STORE
RESIDENT
RAM ARRAY
TIMING INTERRUPT INITIALIZE EXPANDER CPU OSCILLATOR PROGRAM SINGLE READlWRITE
OUTPUT STROBE MEMORY XTAL MEMORY STEP STROBES
SEPARATE ENABLE
ADDRESS
LATCH
ENABLE
PROGRAM MEMORY locations are indirectly addressable by either An interrupt or CALL to a subroutine causes
Resident program memory consists of up to of two RAM pointer registers at locations 0 the contents of the program counter to be
4K bytes of ROM. The program memory is and 1. The first eight locations of RAM (0-7) stored in one of the 6 register pairs of the
divided into pages of 256 bytes each. As are designated as working registers and are program counter stack. The pair to be used is
shown in the memory map, Figure 1, program directly addressable by several instructions. determined by a 3-bit stack pointer which is
memory is also divided into two 2046-byte part of the Program Status Word (PSW). Data
By selecting register bank 1, RAM locations
banks, MBO and MB1. A total of 4096 bytes RAM locations 6 through 23 are available as
24-31 become the working registers, replac-
can be addressed directly. If more memory is stack registers and are used to store the
ing those in register bank 0 (0-7).
required, an I/O port can be used to address program counter and 4 bits of PSW. The
locations over 4095. RAM locations 6-23 are designated as the stack pointer, when initialized to 000, points
stack. Two locations (bytes) are used per to RAM locations 6 and 9. The first subroutine
There are three locations in program memory CALL, allowing nesting of up to eight subrou- jump or interrupt results in the program count-
of special importance. These locations con- tines. er contents being transferred to locations 6
tain the first instruction to be executed upon and 9 of the RAM array. The stack pointer is
the occurrence of one of three events. If additional RAM is required, up to 256 bytes
then incremented by one to point to locations
may be added and addressed directly using
LOCATION EVENT 10 and 11 in anticipation of another CALL.
the MOVX instructions. If more RAM is re-
Nesting of subroutines within subroutines can
0 Activation then deactivation quired an I/O port can be used to select one
continue up to eight times without overflowing
of the "FfEm line. (256-byte) bank of external memory at a time.
the stack. If overflow does occur the deepest
3 Activation of the liiIf line address stored (location 6 and 9) will be
when the external interrupt overwritten and lost since the stack pointer
is enabled. PROGRAM COUNTER AND
overflows from 111 to 000. It also underflows
7 An overflow of the timer/ STACK from 000 to 111.
counter if the T /C interrupt The Program Counter (PC) is a 12-bit count-
is enabled. er/register that points to the location from The end of a subroutine, which is Signalled by
which the next instruction is to be fetched. a return instruction (RET or RETR), causes
The 6046 and 6049 will automatically address the stack pointer to be decremented and the
external memory when the boundary of their contents of the resulting register pair to be
DATA MEMORY transferred to the program counter.
internal memory is exceeded. All processors
Resident data. memory, as shown in Figure 2,
access external memory if EA is high.
consists of up to 256 bytes of RAM. All
-D
255
8040/8050
USER RAM
128)(8
128
127
8039/8049
USER RAM
-B'~-
64K8
64
63 8035/8046
r---2047 - USER RAM
j SELMBO 32 32)(8
31 BANK 1 ~
'-B
WORKING DIRECTLY
REGISTERS ADDRESSABLE
~
0-
&x8
f----ii1:----
WHEN BANK 1
IS SELECTED
1023
f----iio:----
~
:;:
24
~
0 i
0- ~
23
ADDRESSED
:;: 8 LEVEL STACK
INDIRECT LY
9 'OR
z
-
8 LOCATION 7 - TIMER USER RAM THROUG H
0
i
0-
7
6
I-- INTERRUPT VECTORS
PROGRAM HERE
16)(8 R1 OR RO
(RO' OR R1')
:;: 5
1./
z
0
4
3 ~ I--
LOCATION 3- EXTERNAL
INTERRUPT VECTORS
BANKO
WORKING
~
DIRECTLY
2 PROGRAM HERE REGISTERS" ADDRESSABLE
...-.......=:'1XTALI
CLK Q
XTAL2
c= 15-25pF C
(INCLUDES SOCKET, I
STRAY) -=
SERIES RESONANT, AT CUT CRYSTAL
IN
DRIVING
FROM EXTERNAL
SOURCE
Figure 4_ "Quasi Bidirectional" Port Str~cture
+5V counter. External events are input directly to lines are non-latching; i.e., inputs must be
the counter. The maximum frequency that present until read by an input instruction.
470'l can be counted is one third of the frequency Inputs are fully TTL compatible and outputs
Jo-<f----...:2'1 XTAL I of the cycle counter. The minimum positive will drive one standard TTL load.
duty cycle that can be detected is 0.2 tCY.
The lines of ports 1 and 2 are called quasi-
The counter is under program control and can
470n bidirectional because of a special output
be made to generate an interrupt to the
Circuit structure which allows each line to
processor when it overflows.
serve as an input, an output, or both even
BOTH XI AND X2 SHOULD BE DRIVEN. though outputs are statically latched. Figure 4
RESISTORS TO VCC ARE NEEDED TO ENSURE
shows the circuit configuration. Each line is
~Ill=':i:YJ~~T~lg~~~IJ~~~S~I~~~UM LOW INTERRUPT continuously pulled up to + 5V through a
TIMES ARE 45%. An interrupt may be generated by either an
resistive device of relatively high impedance
external input (I NT, Pin 6) or the overflow of
(--SOK). This pullup is sufficient to provide the
the internal counter, when enabled. In either
LC source current for a TTL high level yet can be
OSCILLATOR case, the processor completes execution of
MODE
pulled low by a standard TTL gate thus
the present instruction and then does a CAll
rr ,: : :;,
allowing the same pin to be used for both
to the interrupt service routine. After service,
input and output. To provide fast switching
C NOMINAL I
a RETR instruction restores the machine to
times in a "0" to "1" transition a relatively
45.H 20pF ---s:2iiiiZ f I the state it was prior to the interrupt. The
low impedance device (--SOKQ) is switched
'-~'
external interrupt has priority over the internal
in momentarily (--SOOns) whenever a "1" is
interrupt.
written to the line. When a "0" is written to
the line, a low impedance (--{3000Q) device
-= c CPP _ 5-IOpF
INPUT/OUTPUT
overcomes the light pullup and provides TTL
3 XT AL2 PIN·TO.PIN current sinking capability.
CAPACITANCE The processor has 27 lines which can be
EACH C SHOULD BE APPROXIMATELY 2OpF, used for input or output functions. These lines Since the pulldown transistor is a low imped-
INCLUDINCl STRAY CAPACITANCE. are grouped as 3 ports of 8 lines each which ance device a "1" must first be written to any
serve as either inputs, outputs or bidirectional line which is to be used as an input. Reset
Figure 3, Crystal Oscillator Mode ports and 3 "test" inputs which can alter initializes all lines to the high impedance "1"
program sequences when tested by condi- state. This structure allows input and output
tional jump instructions. on the same pin and also allows a mix of
input lines and output lines on the same port.
Ports 1 and 2 The quasi-bidirectional port in combination
TIMER/EVENT COUNTER Ports 1 and 2 are each 8 bits wide and have
An internal counter is available which can with the ANL and ORl logical instructions
identical characteristics. Data written to these
count either external events or machine cy- provide an efficient means for handling single
ports is statically latched and remains un-
cles (7 32). The machine cycles are divided line inputs and outputs within an 8-bit proces-
changed until rewritten. As input ports these
by 32 before they are input to the 8-bit sor.
POWERSUPPLY ~
+5V
PROCESSOR I ,
INTERRUPTED I I
POWER SUPPLY - - - - - , i
I NORMAL POWER
FAIL SIGNAL L--...i..--..I----- ON SEQUENCE
ACTIVE
I
I I
I I
IFOLLOWS
PULLUP
RESET 1___Li------
EXTERNAL RESET DATA SAVE ACCESS TO
ROUTINE DATA RAM
EXECUTED INHIBITED
+5V
Figure 6. Power Down Sequence
LIMITS
SYMBOL PARAMETER TEST CONDITIONS 7 UNIT
Min Typ Max
VIL Input low-voltage
All except XT AL 1, XT AL2 -0.5 0.8 V
VIU XTAL1, XTAL2 -0.5 0.6 V
11 MHz 6 MHz
TEST VERSIONS VERSIONS
SYMBOL PARAMETER UNIT
CONDITIONS7
Min Max Min Max
(Refer to Figures 7, 8 and 9)
tLL ALE pulse width 150 400 ns
tAL Address setup to ALE 70 150 ns
tLA Address hold from ALE 50 80 ns
tcc Control pulse width (PSEN, 300 700 ns
RD, WR)
tow Data setup before WR 250 500 ns
two Data hold after WR 40 120 ns
tCY Cycle time 1.36 3.75 2.5 15.0 Ils
tDR Data hold 0 100 0 200 ns
tRO PSEN, RD to data in 200 500 ns
tAW Address setup to WR 200 230 ns
tAO Address setup to data in 400 950 ns
tAFC Address float to RD, PSEN -10 0 ns
tCA Control pulse to ALE 10 10 ns
(Refer to Figure 10)
tcp Port control setup before 100 110 ns
falling edge of PROG
tpc Port control hold after falling 60 130 ns
edge of PROG
tpR PROG to time P2 input must 650 810 ns
be valid
top Output data setup time 200 250 ns
tpo Output data hold time 20 65 ns
tPF Input data hold time 0 150 0 150 ns
tpp PROG pulse width 700 1200 ns
tpL Port 2 110 data setup 250 350 ns
tLP Port 2 110 data hold 20 150 ns
NOTES:
1. Stresses above those listed under absolute maximum ratings may cause permanent damage to the device. This is a stress rating only and functional operation of
the device at these or any other condition above those indicated in the operation section of this specification is not implied.
2. For operating at elevated temperatures. the device must be derated based on + 150°C maximum junction temperature.
3. This product includes circuitry specifically designed for the protection of its internal devices from damaging effects of excessive static charge. Nonetheless, it is
suggested that conventional precautions be taken to aviod applying any voltages larger than the rated maximum.
4. Parameters are valid over operating temperature range unless otherwise specified.
5. All voltage measurements are referenced to ground (VsS>. For testing, all input signals swing between 0.4V and 2.4V with a transition time of 20ns maximum. All
time measurements are referenced at input voltages of 0.8V and 2.0V and output voltages 0.8V and 2.0V as appropriate.
6. Typical values are at + 25·C, typical ssupply voltages and typical processing parameters.
7. Control outputs: CL - 80pF
Bus outputs: CL = 150pF
Icv = 1.36jlS for 11 MHz versions
lev = 2.5jlS for 6 MHz versions
S. Where no specification is shown, the commercial temperature range specification applies.
1.2
~
u 1.1
"'-
Q
+
0
.g 1.0
III
N
:J
"'- ~
c 0.9
lIE
""
a:
0
z o.a
0.7
-25 25 50 75 100
TEMPERATURE, ·C
NORMALIZED TOTAL
SUPPLY CURRENT
VI. TEMPERATURE (TYPICAL)
TIMING DIAGRAMS
I-tLL-!
-------t cv- - - - - - .I
ALE
ALE .J \'------
ALE J \'------- \
ALE
~ ~ICA
rIDP-H-IPD
EXPANDER ,..----""\.
PORT PCH OUTPUT DATA
OUTPUT
EXPANDER
PORT PCH
INPUT
I
PROG 1......-. _ _
Ipp
_____r-
-1
Figure 10. Port 2 Timing
ICy
I 55 51 52 53
I 54
l 55 51
INPUT
J INST. DECODE EXECUTION INPUT
I I I I I
Figure 11. Instruction Cycle
51 52 53 S4 55 51 52 S3 54 55
CLOCK OUT
ON TO
ALE _1-_-+__-1--'
RD--I---+---I---~--+-.,
WR L-~--4--~
PROG
0 0 0 0 0 1 1 1
1
1
1
1
··
contenta by 1.
INC A (A) <- (A) + 1 Increment the accumulato~s 0 0 0 1 0 1 1 1 1 1
oontenta by 1.
ORL A, # data (A) <- (A) OR data Logical OR specified Immadiate 0 1 0 0 0 0 1 1 2 2
data with accumulator. d7 de de d. da d2 d1 do
ORL A, Rr (A) <- (A) OR (Rr) Logical OR oontenta of designated 0 1 0 0 1 r r r 1 1
forr-0-7 register with accumulator.
ORL A, @ Rr (A) <- (A) OR «Rr)) Logical OR indirect the oontenta of 0 1 0 0 0 0 0 r 1 1
for r-O-l data memory location with
accumulator.
RL A (An + 1) <- (An) Rotate accumulator left by l-bR 1 1 1 0 0 1 1 1 1 1
(Ao) <- (A7) withOut carry.
forN-0<-6
RLC A (An + 1) <- (An);
n-0-6
(Ao) <- (C)
Rotate accumulator left by l-bR
through carry.
1 1 1 1 0 1 1 1 1 1
·
(C) <- (A7)
RR A (An) <- (An + 1); Rotate accumulator right by l-bR 0 1 1 1 0 1 1 1 1 1
n-0-6 withOut carry.
(A7) <- (Ao)
RRC A (An) <- (An + 1);
n-0-6
(A7) <- (C)
Rotate accumulator right by I-bit
through carry.
0 1 1 0 0 1 1 1 1 1
·
(C) <- (Ao)
&NAPA (~7) <- (Ao - 3) Swap the 2 4-bit nibbles in the 0 1 0 0 01 1 1 1 1
accumulator.
XRL A, # data (A) <- (A) XOR data Logical XOR specifiad immediate 1 1 0 1 0 0 1 1 2 2
data with accumulator. d7dsde~dad2d1 do
XRL A, Rr (A) <- (A) XOR (Rr) logical XOR Contenta of 1 1 0 1 1 r r r 1 1
for r-0-7 designated register with
accumulator.
XRL A, @ Rr (A) <- (A) XOR «Rr)) Logical XOR indirect the oontenta 1 1 0 1 0 0 0 r 1 1
for r-O-l of date memory location with
accumulator.
JTO addr (PC 0-7) .... addr if Jump to specified address if test 0 0 0 1 1 0 1 1 0 2 2
TO~ 1 is a 1. 87 as as B4 83 82 81 as
(PC) .... (PC) + 2 if
TO-O
JTl addr (PC 0-7) .... addr if Jump to specified address if test 1 0 1 0 1 0 1 1 0 2 2
Tl ~ 1 is a 1. 87 as 85 B4 83 82 81 as
(PC) .... (PC) + 2 if
Tl =0
JZ addr (PC 0 - 7) .... addr if Jump to specified address if 1 1 0 0 0 1 1 0 2 2
A~O accumulator is O. "7 as as .. a3 a2 a, as
(PC) +- (PC) +2 if A*O
Control
EN I Enable the external (INn intemupt. 0 0 0 0 0 1 0 1 1 1
DIS I
SEL RBO (BS) .... 0
Disable the external (INn interrupt.
Select bank 0 (locations 0 - 7) of
data memory.
0 0 0 1 0
1 1 0 0 0
1 0
1 0
1
1
1
1
1
1 .
SEL MBO
(BS) +- 1
(DBF) +- 0
Select bank 1 (locations 24 - 31)
of data memory.
Select program memory bank 0,
1 1 0 1 0 1 0 1
1 1 1 0 0 1 0 1
1
1
1
1
·
addresses 0 - 2047.
SEL MBI (DBF) +- 1 Select program memory bank I, 1 1 1 1 0 1 0 1 1 1
addresses 2048 - 4095
ENTO CLK Enable clock output on TO pin. 0 1 1 1 0 1 0 1 1 1
Data moves
MOV A, # data (A) +- data Move immediate the specified data 0 0 1 0 0 0 1 1 2 2
·.· ·
into data memory. d7 de d5 do da d2 d, do
MOV PSW, A (PSW) ...... (A) Move contents of accumulator into 1 1 0 1 0 1 1 1 1 1
the program status word.
MOVP A, @ A (A) ...... «A)) Move data in the current page into 1 0 1 0 0 0 1 1 2 1
the accumulator.
MOVP3 A, @ A (A) ...... «A)) Move data in page 3 into the 1 1 1 0 0 0 1 1 2 1
in page 3 accumulator.
MOVX A, @ Rr (A) +- «Rr)); r=O-1 Move indirect the contents of 1 0 0 0 0 0 0 r 2 1
external memory location into the
accumulator.
MOVX @ Rr, A «Rr)) ...... (A); r=O-1 Move indirect the contents of the 1 0 0 1 0 0 0 r 2 1
accumulator into external memory.
XCH A, Rr (A) " (Rr); r-0-7 Exchange the accumulator and 0 0 1 0 1 r r r 1 1
designated register's contents.
XCH A, @ Rr (A)"«Rr)); r-O-l Exchange indirect contents of 0 0 1 0 0 0 0 r 1 1
accumulator and location in data
memory.
XCHD A, @ Rr (A 0-3)~(Rr)(0-3) Exchange indirect 4·b~ contents of 0 0 1 1 0 0 0 r 1 1
r-O-l accumulator and data memory.
Flags
CPL
CPL
CPL
C
FO
Fl
(C) +- NOT (C)
(FO) ...... NOT (FO)
(Fl) ...... NOT (Fl)
Complement content of carry btt.
Complement content of flag FO.
1
1
0 1
0 0
0
1
0
0
1
1
1
0
1
1
1
1
1
1 · ·.
Complement content of flag Fl. 1 0 1 1 0 1 0 1 1 1
CLR
CLR
C
FO
(C) ...... 0
(FO) +- 0
Clear content of carry bit to O.
Clear content of flag 0 to O.
1
1
0 0
0 0
1
0
0
0
1
1
1
0
1
1
1
1
1
1 · ·
CLR Fl
Input/output
(Fl) ...... 0 Clear content of flag 1 to O. 1 0 1 0 0 1 0 1 1 1
·
ANL BUS, # data (BUS) +- (BUS) AND Logical AND immediate specified 1 0 0 1 1 0 0 0 2 2
data data with BUS. d7 do d5 do da d2 d, do
ANL Pp, # data (Pp) ...... (Pp) AND data Logical AND immediate specified 1 0 0 1 1 0 P P 2 2
p= 1-2 data with deSignated pori (lor 2). d7 de d5 do da d2 d, do
ANLD Pp, A (Pp) +- (PP) AND (A Logical AND contents of 1 0 0 1 1 1 P P 2 1
0-3) accumulator wtth deSignated pori
p=4-7 (4-7).
I
Table 1. Instruction Set (Continued) ~.
INSTRUCTION CODE FLAGS
MNEMONIC FUNCTION DESCRIPTION CYCLES BYTES
D7 D6 D. D. D3 D2 D, Do C AC FO Fl F2
Input/output (Cant.)
IN A, Pp (A) ..... (Pp); p = 1 - 2 Input data from designated port a a a a 1 a p p 2 1
(1 - 2) into accumulator.
INS A, BUS (A) ..... (BUS) Input strobed BUS data into a a a a 1 a a a 1 2
accumulator.
MOVO A, Pp (A 0-3) ..... (Pp); Move contents of designated port a a a 0 1 1 P P 2 1
p=4-7 (4 - 7) into accumulator.
(A4-7) ..... 0
MOVO Pp, A (Pp) ..... A 0-3; p=4-7 Move contents of accumulator to a a 1 1 1 1 P P 1 1
designated port (4 - 7).
OAlO Pp, A (Pp) ..... (Pp) OA (A logical OA contents of 1 a a a 1 1 P P 1 1
0-3) accumulator with designated port
p =4-7 (4-7).
ORl BUS, # data (BUS) .... (BUS) OA data logical OA immediate specified 1 a a a 1 a a a 2 2
data with BUS. d7 ds ds d4 do d2 d, do
OAl Pp, # data (Pp) ..... (Pp) OA data logical OA immediate specified 1 a a a 1 a p p 2 2
P = 1-2 data with designated port (1 - 2). d7 ds ds d4 do d2 d, do
OUTl BUS, A (BUS) ..... (A) Output contents of accumulator 0 a a a a a 1 a 1 2
onto BUS.
OUTl Pp, A (Pp) .... (A); p = 1-2 Output contents of accumulator to 0 a 1 1 1 a p p 1 1
designated port (1 - 2).
Registers
DEC Ar (Ar) ..... (Ar)-l; r=0-7 Decrement contents of designated 1 1 a a 1 r r r 1 1
register by 1.
INC Ar (Ar) ..... (Ar) + 1; r=0-7 Increment contents of designated a a a 1 1 r r r 1 1
register by 1.
INC @ Ar «Ar» ..... «Ar» + 1; Increment indirect the contents of a a a 1 0 a a r 1 1
r=O-l data memory location by 1.
Subroutine
CAll addr «SP» ..... (PC), (PSW Call designated subroutine. a'Oa9 .. 1 a 1 a a 2 2
4-7) 87 as 8S 84 a3 82 81 ao
(SP) ..... (SP) + 1
(PC 6-10) ..... addr
6-10
(PC 0-7) ..... addr 0-7
(PC 11) ..... OBF
AET (SP) ..... (SP) - 1 Return from subroutine without 1 a a a a a 1 1 2 1
(PC) ..... «SP» restoring program status word.
AETR (SP) ..... (SP) - 1 Return from subroutine restoring 1 a a 1 a a 1 1 2 1
(PC) ..... «SP» program status word.
(PSW 4 - 7) ..... «SP»
TimerI counter
EN TCNTI Enable timer/counter interrupt. a a 1 a a 1 a 1 1 1
DIS TCNTI Disable timer/counter interrupt. a a 1 1 a 1 a 1 1 1
MOV A, T (A) ..... (T) Move contents of timer/counter a 1 a a a a 1 a 1 1
into accumulator.
MOV T, A (T) ..... (A) Move contents of accumulator into a 1 1 a a a 1 a 1 1
timer/counter.
STOP TCNT Stop count for event counter or a 1 1 a a 1 a 1 1 1
timer.
STRT CNT Start count for event counter. a 1 a a a 1 0 1 1 1
STRT T Start count for timer. a 1 a 1 a 1 a 1 1 1
Miscellaneous
NOP No operation performed a a a a a a a a 1 1
NOTES:
1. Instruction code designations rand p form the binary representation of the registers and ports involved.
2. The dot under the appropriate flag bit indicates that its content is subject to change by the instruction in which it appears.
3. Numerical subscripts appearing in the FUNCTION column reference the specific bits affected.
SYMBOL DEFINITIONS
SYMBOL DESCRIPTION P "In-Page" operation designator
A The accumulator Pp Port designator (p = 1, 2 or 4 - 7)
AC The auxiliary carry flag PSW Program status word
addr Program memory address (11 bits) Rr Register designator (r = 0, 1 or 0-7)
Bb Bit designator (b = °- 7) SP Stack pointer
BS The bank switch T Timer
C Carry flag TF Timer flag
ClK Clock signal TO, Tl Testable inputs 0, 1
CNT Event counter # Prefix for immediate data
0 Nibble designator (4 bits) @ Prefix for indirect address
DBF
data
Fa, Fl
Program memory bank flip-flop
Number or expression (8 bits)
Flags 0, 1
-....
$ Program counter's current value
Replaced by
Exchanged with
I Interrupt
INT External interrupt
INSTRUCTION 51 52 53 54 55 51 52 53 54 55
IN A,P
Fetch
Instruction
Increment
Program Counter - Increment
Timer - - Read Port
· - - -
OUTL P,A
Fetch
Instruction
Increment
Program Counter - Increment
Timer
Output
To Port - - · - - -
ANL P, # data
Fetch
Instruction · Increment
Program Counter - Increment
Timer Read Port
Fetch
Immediate Data - · Increment
Program Counter
Output
To Port
-
INS A, BUS
Fetch
Instruction
Increment
Program Counter
- Increment
Timer
- - Read Port
· - - -
OUTl BUS, A
Fetch
Instruction
Increment
Program Counter - Increment
Timer
Output
To Port
- -
· - - -
ANL BUS, #: data
Fetch
Instruction · Increment
Program Counter - Increment
Timer
Read Port
Fetch
Immediate Data - · Increment
Program Counter
Output
To Port -
ORl BUS, # data
Fetch
Instruction · Increment
Program Counter
- Increment
Timer
Read Port
Fetch
Immediate Data - · Increment
Program Counter
Output
To Port
-
MOVX @R,A
Fetch
Instruction
Increment
Program Counter
Output RAM
Address
Increment
Timer
Output
Data to
RAM
- - · - - -
MOVX A,@R
Fetch
Instruction
Increment
program Counter
Output RAM
Address
Increment
Timer
- - Read Data
· - - -
MOVD A, Pi
Fetch
Instruction
Increment
Program Counter
Output
Opcodel Address
Increment
Timer - - Read
P2 lower · - - -
MOVO Pj, A
Fetch
Instruction
Increment
Program Counter
Output
Opcodel Address
Increment
Timer
Output Data
TO P2
Lower
- - · - - -
ANlD P, A
Fetch
Instruction
Increment
Program Counter
Output
Opcodel Address
Increment
Timer
Output
Data
- - · - - -
CRlO P, A Fetch
Instruction
Increment
Program Counter
Output
Opcodel Address
Increment
Timer
Output
Data - - · - - -
J (CONDITIONAL) Fetch
Instruction · Increment
Program Counter
Sample
Condition
Increment
Timer - Fetch
Immediate Data - · Update
Program Counter - -
9TART CNT ISTAT T
Fetch
Instruction · Increment
Program Counter - - Start
Counter
STOP TCNT
Fetch
Instruction · Increment
Program Counter - - Stop
Counter
EN I
Fetch
Instruction · Increment
Program Counter - Enable
Interrupt -
DIS I Fetch
Instruction · Increment
Program Counter - Disable
Interrupt
-
ENTO ClK
NOTES:
Fetch
Instruction · Increment
Program Counter - Enable
Clock -
'Valid instruction address are output at this time if extemal program memory is being accessed,
.. See figures 11 and 12 for instruction cycle and cycle timing,
INDEX -- ~
64 ALE
~
:~
EAIVPP 1 64 AlE/PFiOG T2JP1.0~ 40 Vee
"~'t:l
~ PO.O/ADO
~PS""EN
P2.0/A8 2 P2.0/A 63 PSEN T2EX/Pl.1 ~
P2.1/A9 3 t¥ P6.7 P2.l/A 9 3
P2.2/Al o 4 ~
61
P6.?
P6.6
Pl.2 3
P1.3 4
38 PO.l/AD1
37 PO.2/AD2
P2.2/Al0~ 61 P6.6
PLCC P2.3/Al 36 PO.3/AD3
P2.3/All ~ 60 P6.5
P2.4/Al
'F1, 60 P6.5 P1.4 5
35 PO.4/AD4
~ff
59 P6.4 P1.5 6
:~::;~~!~
26 44 59 P6.4
58 P6.3 P2.5/Al 58 P6.3 P1.6~ 34 PO. 51 ADS
27 43 P2.6/Al 4 8 P6.2 ~
~ :~~~
P2.6/Al4 8 PO.6/AD6
TOP VIEW ~ P6.2
~~
P2.7/Al 56 P6.1 32 PO.7/AD7
:~..;::~~~
56 P6.1 -
Pin Function PI, Function PO.7/AD 55 P6.0 RxD/P3.0 10 DIP 31 EA
55 P6.0
1 P5.0/ADCO 35 XTALl PO.6/AD61fi 54 AfLAG TxD/P3.1 11 30 ALE
:~::;~~:~
2 VoD 36 V" 54 AFLAG
PO.5/AD 512 BFLAG
~I DS
3 STADG 37 V" 53 BFLAG INTO/P3.2 12 29 PSEN
4 PwMo 38 NC PO.4/AD 413 28 P2.7/A15
5 PWMT 39 P2.0/A08 PO.4/AD413
~iOs ODs
INT1/P3.3~
~~
6 f"W 40 P2.1/A09 PO.3/AD3 14 PO.3/AD 51 TO/P3.4 14 ~ P2.6/A14
51 ODS
,
7 P4,O/CMSr~O 41
P4.1/CMSfll 42
P2.2/Al0
P2.3/Al1 PO.2/AD2~ 50 Vss
PO.2/AD
POol/AD 1 16
50 V"
XTALl
T1/P3.5 15 26 P2.5/A13
~
9 P4,?/CM:;f12 43 P2.4/A12 WR/P3.6 16 25 P2.4/A12
:~:~;~~~~
49 XTALl
10
11
r4.:1/CM:;\\J 44
P4,4fCM::!!4 45
P2.S/A13
P2.6/A14 DIP
48 XTAL2 PO.O/AD 017
Ye e 18
DIP 4'47 PS.7
XTAL2 RoJP3.7 17 24 P2.3/Al1
23 P2.2/Al0
12 1'4 !)/C:M~;H5 46 P2.71A1S Vee 18 47 P5.7 XTAL2~
PSEN P4. 46 P5.6
13
14
f'4 n/c'Mll1
i'4.fICMll
H~; !
47
4'
49
ALE
i'A
P4.319
P4.2 20
46 PS.6
45 P5.5
P4. !¥o 45 PS.5
XTAL1 ~
Vss 20
22 P2.1/A9
21 P2.0/A8
"
16
17
PI (J!C1UI
1'1, lie1 II
50
51
PO.7/AD?
PO.S/ADS
P4.1 21 ~ P5.4
P4. 121
P4. 022
44 P5.4
43 PS.3
TOP VIEW
1A l'I.:.'IC1;>1 52 PO.5/AD5 P4.0 22 43 P5.3 INDEX
1,1 1'1,:l/C1:11 63 PC.4/AD4 Pl.0 23 42 PS.2 P1. 023 42 P5.2 CORNER 6 1 40
EJ
PO.3/AD3
"
21
1'1,4/1;>
Pl.f)/fH2
54
55 PO.2/AD2
Pl.! 24
P1.225
41 P5.1 P1.
P1. ~¥S
41 P5.1
40 PS.O
~ :::~/Ro
22 pl.S/sel 56 PO.1/AD'
P1.71SDA 57 PO.D/ADO P1. 326
~
23 P1.326 P3.7IRo PlCC
24 P3.0/RXO 66 AVref-
P1. 427 36 P3.6/WR
:~::~
25 P3.1/TXD 59 AVref+ 38 P3.6/WR
26 P3.2/INTO 60 AVSS P1. 528 37 P3.5/T1 17 29
37 P3.5/T1
27 P3.3/TN'i'T 61 AVOD
~¥o
Pl.629 P1. 36 P3.4/TO
~ :::;;~:T1
28 P3.4/TO 62 P5.7/AOC7 18 28
29 P3.5/Tl 63 P5.6/ADC6 Pl.7 30 P1. 35 P3.3/TNfi TOP VIEW
30 P3.6/~ 64 P5.5/ADC5 RS T31
~
P3.2/1NTo
P3.0/::~~
31 P3.7iRD 65 P5.4/ADC4 34 P3.2/"'iNTO Pin Function Pin Function
32 NC 66 P5.3/ADC3 33 P3.1/TxD P3.0/RxD 32 33 P3.l/TxD 1 NC 23 NC
33 NC 67 PS.2/ADC2 2 T2/Pl.0 24 P2.0/A8
34 XTAl2 P5.1/ADCl TOP VIEW TOP VIEW 3 T2EX/Pl.1 25 P2.1/A9
6'
4 Pl.2 26 P2.2/Al0
INDEX INDEX 5 P1.3 27 P2.3/Al1
CORNER 9 1 61
"~d
S83C652/S80C652 Pl.4 P2.4/A12
'8'
6 28
7 P1.5 29 P2.5/A13
10 0 60 8 P1.6 30 P2.6/A14
PI,O 1 40 Vee 9 P1.7 31 P2.7/A1S
PI,1 2 39 PO.D/ADO LCC LCC 10 RST 32 rsEN
11 RxD/P3.0 33 ALE
I'l" 3 38PO.l/AOl 12 NC 34 NC
1'1 :1 4 37 PO.2/A02 26 44 26 44 13 TxD/P3.1 35 EA
14 rFrrO"/P3.2 36 PO.7/AD7
1'1 4 5 36 PO.3/A03 27 43 27 43 15 mTi/P3.3 37 PO.6/AD6
I' 1 .~, (} 35 PO.4/AD4 TOP VIEW TOP VIEW 16 TO/P3.4 36 PO.5/AD5
17 Tl/P3.5 39 PO.4/AD4
:;CI./I'1.6 I 34 PO.5/AD5 Pin Function Pin Function Pin Function PI, Function Pin Function Pin Function V'i7!=l/P3.6 40 PO.3/AD3
18
~PO.6/AD6 Ri5/P3.7 PO.2/AD2
SDAfrl:~~~ 1 EAJVPP 24 P4.2 47 PS.3 1 i'A 24 P4.2 47 P5.3 19 41
2 P2.0/A8 25 P4.l 48 2 P2.0/A8 25 P4.1 48 20 XTAL2 42 PO.1/AD1
¥.~.7/AD7 PS.4 P5.4
21 XTAL1 43 PO.O/ADO
3 P2.1/A9 26 P4.0 49 P5.5 3 P2.1/A9 26 P4.0 49 P5.S
RxD/DA1A/P:1.O 10
TxD/ClOCK/P3.1 11
DIP 31 EA
30ALE
4
5
P2.2/Al0
P2.3/All
27
28
Pl.0
Pl.1
50
51
P5.6
P5.7
,
4 P2.2/Al0
P2.3/A11
27
28
Pl.0
Pl.1
50
51
P5.6
P5.7
22 V" 44 Vee
IN~~;:::! H
28 P2.7/A1S 8 P2.6/A14 31 Pl.4 54 V" P2.6/A14 31 P1.4 54 V"
gP2.6/A14 9 P2.7/A15 32 P1.S 55 ODS 9 P2.7/A15 32 P1.5 55 ODs
26 P2.5/A13
10 PO.7/AD7 33 Pl.6 56 iDS 10 PO.7/AD7 33 Pl.6 56 iDS
Tl/P3.515 11 PO.6/AD6 34 Pl.? 67 BFLAG 11 PO.6/AD6 34 Pt.7 57 BFLAG
WR/P3.616 25 P2.4/A12 12 PO.5/ADS 35 RST 58 AFLAG 12 PO.5/AD5 35 RST 66 AFLAG
RD/P3.7 H ~P2.3/A11
13
14
PO.4/AD4
PO.3/AD3
36
37
P3.0/RxD 59
P3.l/TxD 60
P6.0
P6.1
13
14
POA/AD4
PO.3/AD3
36
37
P3.0/RxD 59
P3.1/!21L 60
P6.0
P6.1
XTAl218 gP2.2/Al0 15 PO.2/AD2 38 P3.2/ii\l'i'O 61 P6.2 15 PO.2/AD2 38 P3.21ltllQ 61 P6.2
16 PO.l/AD1 39 P3.3/INTl 62 P6.3 16 PO.I/AD1 39 P3.3/1NTl 62 P6.3
XTALl 19 22 P2.l/A9
17 PO.O/ADO 40 P3.4/TO 63 P6.4 17 PO.D/ADO 40 P3.4/TO 63 P6.4
Vss 20 21 P2.0/A8 18 16 Vee 41 P3.5/Tl 64
~~:~~W
Vee 41 64 P6.5 P6.5
19 P4.7 42 65 P6.6 19 P4.7 42 P3.6/!tZB 65 P6.6
'ToPViEW 20 43 20 P4.6 43 P3.7/RD
~~JN
P4.6 P3.7/RD 66 66
INDEX 21 P4.5 44 PS.O 67 ~~'~N 21 P4.5 44 P5.0 67
CORNER 6 1 40 22 P4.4 45 PS.1 68 ALE/Pi"fc5G 22 P4.4 45 P5.l 66 ALE
23 P4.3 46 P5.? 23 P4.3 46 P5.2
Pin Function
EJ
1f
"
PlCC
TOP VIEW
Pin
"
29
Function
1 NC 23 NC
2 PLO 24 P2.0/A8
3 PI.1 25 P2.1/A9
4 P1.2 26 P2.2/Al0
5 PI.3 27 P2.3/Al1
P1A P2.4/A12
6
7
8
Pl.!>
SCLlI'l.t;
"
29
30
P2.5/A13
P2.6/A14
9 SDA/f'l.1 31 P2.7/A1S
10 RST 32 rnN
11 RxD/DA 1 A/P3.0 33 ALE
12 NC 34 NC
13 Tx[)IICII)CK/P3.1 35 ~
14 TNTr\/I':l;.1 36 PO.7/AD7
15 mTill'.1 I 37 PO.6/AD6
16 10!f':1·' 38 PO.5/AD5
17 11/I'::!.!; 39 PO.4/AD4
16 ~/P:1.r, 40 PO.3/AD3
19 1'10/P3.7 41 PO.2/AD2
20 XTAI.;> 42 PO.l/AD1
21 XTAl.l PO.D/ADO
Vco
22 V"
"
Signetics
a division of North American Philips Corporation
Signetics Company
81 1 E. Arq ues Avenue
P. O. Box 3409
Sunnyvale, Cali forn ia 94088-3409
Telephone 4081991-2000
98 -8000 -000 O Copyright 1989 NAPC Printed in U.SA. 9167M fGT Ef70Mf FPf0589
Signetics
Philips Components _
e PHILIPS
PHILIPS