Intel MCS-51 Users Manual Jan 81 PDF
Intel MCS-51 Users Manual Jan 81 PDF
Intel MCS-51 Users Manual Jan 81 PDF
MCS51 FAMILY OF
SINGLE CHIP MICROCOMPUTERS
USER'S MANUAL
JANUARY 1981
Intel Corporation makes no warranty for the use of its products and assumes no responsibility for any errors which
may appear in this document nor does it make a commitment to update the information contained herein.
Intel software products are copyrighted by and shall remain the property of Intel Corporation. Use, duplication or
disclosure is subject to restrictions stated in Intel's software license, or as defined in ASPR 7-104.9 (a) (9). Intel Cor-
poration assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No
other circuit patent licenses are implied.
No part of this document may be copied or reproduced in any form or by any means without the prior written consent
of Intel Corporation.
The following trademarks of Intel Corporation and its affiliates may only be used to describe their products:
BXP Intelevision MULTIBUS*
CREDIT Intellec MULTIMODULE
i iSBC PROMPT
ICE iSBX Promware
ICS Library Manager RMX
im MCS UPI
Insite Megachassis /AScope
Intel Micromap
and the combinations of ICE, iCS, iSBC, MCS or RMX and a numerical suffix.
MDS is an ordering code only and is not used as a product name or trademark. MDS is a registered trademark of
Mohawk Data Sciences Corporation.
*MULTIBUS is a patented Intel bus.
Additional copies of this manual or other Intel literature may be obtained from:
Literature Department
Intel Corporation
3065 Bowers Avenue
Santa Clara, CA 95051
Introduction
ManualOrganization .................................... 1-1
Product Overview ....................................... 1-1
CHAPTER 2
Functional Description
8051 CPU Architecture ................................... 2-1
CPU Hardware. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2-2
On-Chip Peripherals ..................................... 2-5
CHAPTER 3
CHAPTER 4
CHAPTER 5
CHAPTER 6
CHAPTER 7
8048 Family
8021 Single Component 8-Bit Microcomputer ........... 7-1
8021 L Single Component 8-Bit Low Power (10mA)
Microcomputer ................................. 7-4
8022 Single Component 8-Bit Microcomputer with On-chip
AID Converter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 76
8022H High Performance Single Component 8-Bit Micro-
computer with On-chip AID Converter ............. 7-12
8048H/8048H-1/8035HLl8035HL-1 HMOS Single Component
8-bit Microcomputer ........................... 7-13
8048L Special Low Power Consumption Single Component
8-Bit Microcomputer ........................... 7-20
8049H/8039HL HMOS Single Component 8-Bit
Microcomputer ................................ 7-27
8243 MCS-48 Input/Output Expander ............... 7-34
AFN01739A
iii
~ - ........... , ' ' ' _ _ .& \
'-'MAt" I en I ,\JUIU.,
8085 Peripherals
8155/8156/8155-2/8156-2 2048 Bit Static MaS RAM with 1/0
Ports and Timer ................................ 7-40
8185/8185-2 1024 x 8-Bit Static RAM for MCS-85 ....... 7-47
8355/8355-2 16,384-Bit ROM with 1/0 ............... '" 7-51
8755A/8755A-2 16,384-Bit EPROM with 1/0 ............. 7-56
Standard Peripherals
8041A/8641A/8741A Universal Peripheral Interface 8-Bit
Microcomputer ................................ 7-65
8205 High Speed lout of 8 Binary Decoder ............ 7-74
8251A/S2657 Programmable Communication Interface .. 7-78
825318253-5 Programmable Interval Timer ............. 7-83
8255A/8255A-5 Programmable Peripheral Interface ..... 7-92
8271/8271-6/8271-8 Programmable Floppy Disk
Controller ................................... 7-100
8273/8273-4/8273-8 Programmable HDLCISDLC Protocol
Controller ................................... 7-108
8275 Programmable CRT Controller ................. 7-115
8279/8279-5 Programmable KeyboardlDisplay Interface. 7-139
8282/8283 Octal Latch ............................. 7-148
8286/8287 Octal Bus Transceiver .................... 7-153
8291 GPIB TalkerlListener ......................... 7-158
8292 GPIB Controller ............................. 7-173
8293 GPIB Transceiver .......................... " 7-175
8294 Data Encryption Unit ....................... " 7-188
8295 Dot Matrix Printer Controller ................... 7-189
RAM
2114A 1024 x 4-Bit Static RAM .................... " 7-198
2142 1024 x 4-Bit Static RAM ....................... 7-202
2148 1024 x 4-Bit Static RAM ....................... 7-206
2148H 1024 x 4-Bit Static RAM ...................... 7-210
2118 Family 16,384 x 1-Bit Dynamic RAM ........... " 7-214
2147H High Speed 4096 x 1-Bit Static RAM ........... 7-225
EPROM
2716 16K (2K x 8) UV Erasable PROM ................ 7-229
2732 32K (4K x 8) UV Erasable PROM ................ 7-234
2732A 32K (4K x 8) UV Erasable PROM ............... 7-238
2758 8K (1 K x 8) UV Erasable Low Power PROM 7-239
CHAPTER 8
AFN01739A
iv
APPENDIX A
PUM-80 Description of 8051 Instruction Set ................. A-1
APPENDIX B
An Introduction to the Intel MCS-51 Single-Chip Microcomputer
Family ............................................ B-1
APPENDIX C
Using the Intel MCS-51 Boolean Processing Capabilities ...... C-1
v AFN01739A
I
CHAPTER 1
INTRODUCTION
The manual organization is by chapters and appendices. Supporting the applications of the '80s is the target of
Chapter 1 provides a brief introduction to the the 8051 family. On a single die the 8051 microcomputer
MCS-51 family, its software tools, and its develop- combines CPU; non-volatile 4K x 8 read-only program
ment support in the most general terms. memory (8051 and 8751); volatile 128 x 8 read/write
data memory; 32 110 Hnes; two 16-bit timer/event
The second chapter provides a functional description of counters; a five-source, two-priority-Ievel, nested inter-
the 8051 family hardware. rupt structure; serial 110 channel for either
multiprocessor communications, I/O expansion, or full
The third chapter describes the 8051's family memory duplex UART; and on-chip oscillator and clock circuits.
organization, addressing modes, data types and its in-
struction set. The CPU is in a 40-pin package and uses a single 5V
power supply. Intel's HMOS process technology is the
The fourth chapter is an expanded 8051 family con- driving force behind the 8051's ability to bring many
figured system using peripherals and external program peripheral functions on-board a single-chip microcom-
and external data memories. puter.
Chapter 5 lists software routines that handle program- Along with 4K program memory on-board, the 8051 can
ming applications such as radix conversions and stack address another 60K of external program memory. If
mani pulations. external data memory is needed the 8051 can also ad-
dress 64K of external RAM. When an 8031 is used, all
The chapter following, the sixth, is the specification sec- program memory execution is external and it, too, can
tion for the 8051 family. A.C. and D.C. characteristics address 64K of both external program and data
of the 8051 family are located here. memory. The 8051 contains many features for ease of
manipulating variables in Internal Data Memory. The
Chapter 7 provides data sheets on Intel products that stack may be located anywhere within the internal RAM
can be used in conjunction with the 8051. space. There are 4 banks of registers (eight registers in
each bank) that facilitate context switching and provide
The next chapter describes the development support byte efficiency. Also within the Internal Data Memory
available for the 8051 family. are the Special Function Registers. These are memory-
mapped locations for the ports, arithmetic registers,
That's the end of the chapters, but there are two appen- control and status registers and the timer/counters.
dices. Appendix A is a PL/M-80 description of the 8051
instruction set. Appendix B is the AP Note section Within the Internal Data Memory are 256 individually
where AP-69 and AP-70 are reproduced in their entire- addressable bits. 128 bits are located in the Internal
ty. AP-69 is titled, "An Introduction to the Intel Data RAM and the second 128 bits are located in the
MCS-51 Single-Chip Microcomputer Family" and Special Function Register. These 256 addressable bits
AP-70 is titled, "Using the Intel MCS-51 Boolean provide a new dimension in controller applications. The
Processing Capabilities." programmer/designer may now manipulate individual
bits with specific bit instructions! This new feature is the
PRODUCT OVERVIEW Boolean Processor, which is actually a bit processor
Introduced in May, 1980, Intel's 8051 family of single- with its own accumulator, 110 and instruction set.
chip microcomputers is the next generation microcom-
puter for the controller marketplace. With an expan- To increase programming ease the 8051 added new ad-
dable and flexible architecture the 8051 family provides dressing modes. Direct Addressing was added to
high performance for the applications of the future. manipulate variables within the 128-byte Data RAM
11
INTRODUCTION
and the Special Function Registers. Base-Register plus 3) A programmable baud rate from 122 to 31,250 bits
Index-Register Indirect Addressing gives the program- per second (12MHz operation) for a 9-bit frame
mer the ability to easily manipulate constants in pro- and asynchronous operation.
gram memory for table look-ups. Table look-ups are
supported over the entire 64K range by using 16-bit Since microcontrollers are real-time oriented, the 8051
registers. has four 8-bit ports for interfacing to the external
world. Three of the four ports, under software control,
A more in-depth explanation of the 8051 's memory can have additional capabilities. Port 0 is a time multi-
spaces, addressing modes and instruction set is provided plexed bus. It outputs the lower 8 bits of the 16-bit ad-
in Chapter 3. dress and also receives data and instruction during an
external RAM read or external program memory opera-
The 8051 hardware and on-chip peripherals have been tion. Port 0 also outputs the data when a write opera-
briefly described a few paragraphs earlier. Let's add a tion is performed. Port 2 emits the upper 8-bits of the
little more detail in the following paragraphs. For com- 16-bit address when external memories are being ac-
plete operational and functional explanation of the cessed. Port 3 contains the special control signals such
following features please read Chapter 2. as the read and write strobes, the two external interrupt
inputs, the two counter inputs and the transmit and
MCS-51 family has two independent, 16-bit timer/ receive pins of the serial channel. Port 1 is strictly an
counters. Under software control, each timer/counter 8-bit quasi-bidirectional port.
may be placed in one of four modes:
1-2 AFN-01739A
INTRODUCTION
1-3 AFN-01739A
1,1\
i
CHAPTER 2
FUNCTIONAL DESCRIPTION
This chapter explains the functions of the 8051. The Conditional branches are performed relative to the Pro-
first part begins with a brief description of the memory gram Counter. The register-indirect jump permits
spaces and addressing modes. (For more in-depth infor- branching relative to a 16-bit base register with an offset
mation, please see Chapter 3.) The chapter then explains provided by an 8-bit index register. Sixteen-bit jumps
the hardware registers, the ALU, and Boolean Pro- and calls permit branching to any location in the con-
cessor. tiguous 64K Program Memory address space.
The second part of Chapter 2 explains in detail the The 8051 has five methods for addressing source
workings of the on-chip peripherals: the interrupt operands: Register, Direct, Register-Indirect, Im-
system, the I/O pins, the timer/counters and the serial mediate, and Base-Register-plus Index Register-Indirect
channel. Addressing.
64K
I
64K
EXTERNAL
OVERLAPPED SPACE
I
INTERNAL
4095
-------
~,----Ar
255 I
I
12~ I
I 255
Il
i I I 0
, ~
128
,
PROGRAM PROGRAM INTERNAL SPECIAL EXTERNAL
COUNTER MEMORY DATA RAM FUNCTION DATA
REGISTERS MEMORY
2-1 AFN01739A
FUNCTIONAL DESCRIPTION
The 8051 has extensive facilities for byte transfer, logic, Register Banks
and integer arithmetic operations. It excels at bit han-
There are four Register Banks within the Internal Data
dling since data transfer, logic and conditional branch
RAM. Each Register Bank contains registers R7-RO.
operations can be performed directly on Boolean
variables. 128 Addressable Bits
The 8051 's instruction set is an enhancement of the in- There are 128 addressable software flags in the Internal
struction set familiar to MCS-48 users. It is enhanced to Data RAM. They are located in the 16 byte locations start-
allow expansion of on-chip CPU peripherals and to op- ing at byte address 32 and ending with byte location 47 of
timize byte efficiency and execution speed. Op codes the RAM address space.
were reassigned to add new high-power operations and
to permit new addressing modes which make the old Stack
operations more orthogonal. Efficient use of program
memory results from an instruction set consisting of 49 The stack may be located anywhere within the Internal
single-byte, 45 two-byte and 17 three-byte instructions. Data RAM address space. The stack may be as large as 128
When using a 12MHz crystal, 64 instructions execute in bytes on the 8051.
1 ~s and 45 instructions execute in 2 ~s. The remaining SPECIAL FUNCTION REGISTERS
instructions (multiply and divide) require only 4 ~s. The
number of bytes in each instruction and the number of The Special Function Registers include arithmetic
oscillator periods required for execution are listed in the registers (A, B, PSW), pointers (SP, DPH, DPL) and
Instruction Set in Chapter 3 in Table 3-2. registers that provide an interface between the CPU and
the on-chip peripheral functions. There are also 128 ad-
CPU HARDWARE dressable bits within the Special Function Registers. The
memory-mapped locations of these registers and bits are
This section describes the hardware architecture of the discussed in Chapter 3.
8051's CPU in detail. The interrupt system and on-chip
functions peripheral to the CPU are described in subse- A Register
quent sections. A detailed 8051 Functional Block
Diagram is displayed in Figure 2-2. The A register is the accumulator.
Program Counter The carry (CY), auxiliary carry (Aq, user flag 0 (FO),
register bank select (RSO and RSl), overflow (OV) and
The 16-bit Program Counter (Pq controls the sequence in parity (P) flags reside in the Program Status Word (PSW)
which the instructions stored in program memory are ex- Register. These flags are bit-memory-mapped within the
ecuted. It is manipulated with the Control Transfer in- byte-memory-mapped PSW. The PSW flags record pro-
structions listed in Chapter 3. cessor status information and control the operation of
Internal Program Memory the processor.
The 805118751 have 4K bytes of program memory resi- The CY, AC, and OV flags generally reflect the status of
dent on-chip. the latest arithmetic operations. The P flag always reflects
the parity of the A register. The carry flag is also the
Internal Data Memory Boolean accumulator for bit operations. Specific details
on these flags are provided in the Arithmetic Flags section
The 8051 contains a 128-byte Internal Data RAM (which
of Chapter 3. FO is a general purpose flag which is pushed
includes registers R7-RO in each of four Banks), and twen-
onto the stack as part of a PSW save. The two Register
ty memory-mapped Special Function Register.
Bank select bits (RSI and RSO) determine which one of the
INTERNAL DATA RAM four Register Banks is selected.
2-2 AFN-01739A
FUNCTIONAL DESCRIPTION
r---~--r-~------------------'L
r-~-+--r-----------------~U
11 A
A
'I
~ ti PARITY J ~
ffi t-C....Y""'TI-IAC""'TI....FO""'TI.....
0
1~Ir-p..... 4~L..--____....I..-l----..J
IRS'""Illr-"IRS'""I0lrO....,V
0 ACC
(J
III
0
C/)
C/) II:
III III
II: o
0 o(J
0
c( III
II: o
III C/)
--1\" I-
C/)
SBUF
SERIAL
f:l
rV ~II: SCON
PORT II:
o
o
c(
4K x 8
Z THl NONE (8031)
0 > ROM (8051)/
II:
i= TLl o EPROM (8751)
(J
z ~
~ THO :;;
....
c( I----------T-L-O--------~ C~~~~~L
:;;
c(
II:
~
Il.
(:J
o
C/) TMOD II:
Il.
TCON
DPH ~~----~~--------~
:===~~D_P-L_-_-_-_--f--,-V J I ~ '7
SP ~~,,)r~___~'~~~__~~
ffi 128 x 8
PROGRAM CONTROL I - - rV
o
o RAM PCH
(J
III
r------------- PCL
~i -------------
o
c(
-------------
2
REGISTER BANK 3
REGISTER BANK
~
:;;
c(
II:
------------ - PLA
REGISTER BANK 0
CONTROL DRIVERS
DRIVERS ENGINE
k:: ~~
INSTRUCTION
DECODER
l}::
J
OSC
&
TIMING
~:(r
CIRCUITRY
L Pl I I P3 J I P2 J I PO J
, +
X
T
A
L
1
X
T
A
L
2
E
A
/
V
D
A
L
E
/
P
P
S
E
N
D D
PORT 1 PORT 3
D
PORT2
D
PORTO
R
S
T
/
V
V
C
C
V
S
D R P
o D
G
2-3 AFN-01739A
FUNCTIONAL DESCRIPTION
Hie last byte was pushed onto the stack. This is also the ad- Serial Data Buffer
dress of the next byte that will be popped. The SP is in-
The Serial Data Buffer (SBUF) register is used to hold
cremented during a push. SP can be read or written to
serial port input or output data depending on whether the
under software control.
serial port is receiving or transmitting data.
Data Pointer (High) and Data Pointer (Low)
The 16-bit Data Pointer (DPTR) register is the concatena- ARITHMETIC SECTION
tion of registers DPH (data pointer's high-order byte) and
The arithmetic section of the processor performs many
DPL (data pointer's low-order byte). The DPTR is used in
data manipulation functions and is comprised of the
Register- Indirect Addressing to move Program Memory
Arithmetic/Logic Unit (ALU), A register, B register and
constants, to move External Data Memory variables, and
PSW register. The ALU accepts 8-bit data words from one
to branch over the 64K Program Memory address space.
or two sources and generates an 8-bit result under the con-
Port 3, Port 2, Port 1, Port 0 trol of the instruction decoder. The ALU performs the
arithmetic operations of add, subtract, multiply, divide,
The four ports provide 32 I/O lines to interface to the ex- increment, decrement, BCD-decimal-add-adjust and
ternal world. All four ports are both byte and bit ad- compare, and the logic operations of and, or, exclusive-
dressable. The 8051 also allows memory expansion using or, complement and rotate (right, left, or nibble swap (left
Port 0 (PO) and Port 2 (P2) while Port 3 (P3) contains four.
special control signals such as the read and write strobes.
Port 1 (PI) is used for 110 only.
PROGRAM CONTROL SECTION
Interrupt Priority Register The program control section controls the sequence in
The Interrupt Priority (lPC) register contains the control which the instructions stored in program memory are ex-
bits to set an interrupt to a desired level. A bit set to a one ecuted. The conditional branch logic enables conditions
gives the particular interrupt a high priority listing. internal and external to the processor to cause a change in
the sequence of program execution.
Interrupt Enable Register
The Interrupt Enable (lEC) register stores the enable bits OSCILLATOR AND TIMING CIRCUITRY
for each of the five interrupt sources. Also included is a Timing generation for the 8051 is completely self-
global enable/disable bit of the interrupt system. contained, except for the frequency reference which can
be a crystal or external clock source. The on-board
Timer/Counter Mode Register
oscillator is a parallel anti-resonant circuit with a frequen-
Within the Timer Mode (TMOD) register are the bits that cy range of 1.2MHz to 12MHz. There is adivide-by-12 in-
select which operations each timer/counter will do. ternal timing which gives the 8051 a minimum instruction
cycle of 1 iJ.sec. with a 12MHz crystal. The XT AL2 pin is
Timer/Counter Control Register the output of a high-gain amplifier, while XT ALl is its in-
The timer/counters are controlled by the Timer/ put. A crystal connected between XT ALl and XT AL2
Counter Control (TCON) register bits. The start/stop bits provides the feedback and phase shift required for oscilla-
tion. U XT ALl is being driven by an external frequency
for the timer/counters along with the overflow and inter-
rupt request flags are mapped in TCON. source, XT AL2 should be a no connect. The 1.2MHz to
12MHz range is also accommodated when an external
Timer/Counter 1 (High), Timer/Counter 1 (Low), clock is applied to XT ALl as the frequency source.
Timer/Counter 0 (High), Timer/Counter 0 (Low)
There are four register locations for the two 16-bit timer/ BOOLEAN PROCESSOR
counters. These registers can be read or written to, to give The Boolean Processor is an integral part of the 8051 's ar-
the programmer easy access to the timer/counters. THI chitecture. It is an independent bit processor with its own
and THO refer to the 8 high-order bits of timer/counter 1 instruction set, its own accumulator (the carry register)
and 0, respectively. TLl and TLO refer to the low-order and its own bit-addressable RAM and 110. The bit
bits of both timer/counter 1 and O. manipulation instructions allow the Direct Addressing of
128 bits within the Internal Data RAM and 128 bits within
Serial Control Register the Special Function Registers as shown in Figures 2-3 and
This control register (SCON) has bits that enable recep- 2-4. The Special Function Registers with an address evenly
tion of the serial port. Selecting the operating mode of the divisable by eight (PO, TCON, PI, SCON, P2, lEe, P3,
serial port is accomplished with bits in this register also. IPC, PSW, A, and B) contain Directly Addressable bits.
2-4 AFN-01739A
FUNCTIONAL DESCRIPTION
a.) RAM Bit Addresses. A resource requests an interrupt by setting its associated
RAM interrupt request flag in the TCON or SCON register, as
BYTE
7FH 1....----------.,1
(MSB) (lSB)
detailed in Table 2-2. The interrupt request will be
acknowledged if its interrupt enable bit in the Interrupt
. Enable register (shown in Table 2-3) is set and if it is the
highest priority level as established by the polarity of a bit
2FH 7F 7E 70 7C 7B 7A 79 78 in the Interrupt Priority register. These bit assignments
2EH 77 76 75 74 73 72 71 70 are shown in Table 2-4. Setting the resource's associated
20H 6F 6E 60 6C 6B 6A 69 68 bit to a one (1) programs it to the higher level. The priority
2CH 67 66 65 64 63 62 61 60
of multiple interrupt requests occurring simultaneously
2BH SF 5E 50 5C 5B SA 59 58
and assigned to the same priority level is also shown in
2AH
Table 2.4.
57 56 55 54 53 52 51 50
29H 4F 4E 40 4C 4B 4A 49 48
b.) Hardware Register Bit Addresses.
28H 47 46 45 44 43 42 41 40
Direct Hardware
Bit Addresses
:~~ress
27H 3F 3E 3D 3C 3B 3A 39 38 Register
(MSB) (lSB)
Symbol
26H 37 36 35 34 33 32 31 30 OFFH
25H 2F 2E 20 2C 2B 2A 29 28 OFOH F7 I F6 I F5 I F4 I F3 I F2 I F1
I FO
24H 27 26 25 24 23 22 21 20
23H 1F 1E 10 1C 1B 1A 19 18 OEOH E7 I E6 I E5 1 1 1 1 1
E4 E3 E2 E1 EO ACC
22H 17 16 15 14 13 12 11 10
20H 07 06 05 04 03 02 01 00
1FH
Bank 3
18H OB8H - I- I- I BC I BB I BA I B9 I B8 IP
17H
Bank 2
10H OBOH B7 I B6 I B5 I B4 I B3 I B2 I B1 I BO P3
OFH
Bank 1
08H OA8H AF I- I- I AC I AB I AA I A9 I A8 IE
07H
Bank 0
OOH OAOH A7 I A6 I AS I A4 1 I A3 A2 I A1 1 AO P2
plement) and the carry flag it can perform the bit opera-
tion of logical and/ or logical or with the result returned to
the carry flag.
80H 87 I 86 I 85 I 84 I 83 I 82 1 1 81 80 PO
2-5 AFN01739A
FUNCTIONAL DESCRIPTION
Setting/ clearing a bit in the Interrupt Priority (IP) rupt request flags (lEO, lEI, TFO and TFI) are cleared
register establishes its associated interrupt request as a when the processor transfers control to the first instruc-
high/low priority. If a low-priority level interrupt is be- tion of the interrupt service program. The T! and RI in-
ing serviced, a high-priority level interrupt will interrupt terrupt request flags are the exceptions and must be
it. However, an interrupt source cannot interrupt a ser- cleared as part of the serial port's interrupt service pro-
vice program of the same or higher level. gram.
2-6 AFN01739A
FUNCTIONAL DESCRIPTION
made in the last fourteen oscillator periods of the When ITO and ITI are set to one (1), interrupt requests on
instruction-in-progress. Under this circumstance, the INTO and INTI are transition-activated (high-to-Iow), or
next instruction will also execute before the interrupt's else they are low-level activated. lEO and lEI are the inter-
subroutine caIl is made. The first instruction of the service rupt request flags. These flags are set when their cor-
program will begin execution twenty-four oscillator responding interrupt request inputs at INTO and INTI,
periods (the time required for the hardware subroutine respectively, are low when sampled by the 8051 and the
call) after the completion of the instruction-in-progress transition-activated scheme is selected by ITO and ITI.
or, under the circumstances mentioned earlier, twenty- When ITO and ITI are programmed for level-activated in~
four oscillator periods after the next instruction. terrupts, the lEO and lEI flags are not affected by the in-
puts at INTO and INTI, respectively.
Thus, the greatest delay in response to an interrupt request
is 86 oscillator periods (approximately 7\Jsec @ I2MHz).
TransitionActivated Interrupts
Examples of the best and worst case conditions are il-
lustrated in Table 2-5. The external interrupt request inputs (INTO and INTI)
can be programmed for high-to-Iow transition-activated
operation. For transition-activated operation, the input
Table 25. Best and Worst Case Response to
must remain low for greater than twelve oscillator
Interrupt Request
periods, but need not be synchronous with the oscillator.
Time It is internally latched by the 8051 near the falling-edge of
(Oscillator Periods) ALE during an instruction's tenth, twenty-second, thirty-
fourth and forty-sixth oscillator periods and, if the input is
Instruction Best Worst low, lEO and lEI is set. The upward transition of a
Case Case transition-activated input may occur at any time after the
1) External interrupt request 2+ E 2-E twelve oscillator period latching time, but the input must
generated immediately remain high for twelve oscillator periods before reactiva-
before (best) / after (worst) tion.
the pin is sampled. (Time
until end of bus cycle.) LevelActivated Interrupts
2) Current or next instruction 12 12 The external interrupt request inputs (INTO and INTI)
finishes in 12 oscillator can be programmed for level-activated operation. The in-
periods put is sampled by the 8051 near the falling-edge of ALE
3) Next instruction is MUL don't 48 during the instruction's tenth, twenty-second, thirty-
or DIV care fourth and forty-sixth oscillator periods. If the input is
4) Internal latency for hard- 24 24 low during the sampling that occurs fourteen oscillator
ware subroutine call periods before the end of the instruction in progress, an in-
38 86 terrupt subroutine caIl is made. The level-activated input
need be low only during the sampling that occurs fourteen
oscillator periods before the end of the instruction-in-
EXTERNAL INTERRUPTS progress and may remain low during the entire e.xecution
of the service program. However, the input must be raised
The external interrupt request inputs (INTO and INTI) before the service program completes to avoid possibly en-
can be programmed for either transition-activated or voking a second interrupt.
level-activated operation. Control of the external inter-
rupts is provided by the four low-order bits of TCON as
Ports and 1/0 Pins
shown in Table 2-6.
There are 32 110 pins configured as four 8-bit ports. Each
Table 26. Function of Bits in TCON pin can be individually and independently programmed as
(Lower Nibble) input or output and each can be configured dynamically
(Le., on-the-fly) under software control.
Bit
Function Flag Location An instruction that uses a port's bit/byte as a source
operand reads a value that is the logical arid of the last
External Interrupt Request Flag I lEI TCON.3 value written to the bit/byte and the polarity being ap-
Input INTI Transition-Activated ITI TCON.2 plied to the pin/pins by an external device (this assumes
External Interrupt Request Flag 0 lEO TCON.I
that none of the 8051 's electrical specs are being
Input INTO Transition Activated ITO TCON.O violated). An instruction that reads a bit/byte, operates
2-7 AFN01739A
FUNCTIONAL DESCRIPTION
on the content, and writes the result back to the IRE,6.D (READ-
bit/byte, reads the last value written to the bit/byte in- MODIFY-WRITE)
28 AFN-01739A
FUNCTIONAL DESCRIPTION
29 AFN01739A
FUNCTIONAL DESCRIPTION
OSC
T12 T1 T2 T3 T4 TS T6 T7 T8 T9 no n1 T12 n T2
ALE
Ro,WR
PORT 2
PORTO
ALE 8V \0 II
II
RD
~0 011
PORT 2
rx ADDRESS A1S-AS
8) r&l
PORTO INST I~ IFLOAT A7- A O
1 FLOAT
K DATA IN
I FLOAT
ADD RESS
OR FLOAT
I I I I I I
For the MOVe instruction, the op-code is fetched in the and T6 is the period during which the direction of the
first six-oscillator period, the first byte of the next in- bus is changed for the r(;!ad operation. The read cycle
struction is fetched during the second six-oscillator begins during T2, with the assertion of address latch
period, the table entry is fetched in a third six-oscillator enable signal ALE CD: The falling edge of ALE (2) is
period and the first byte of the next instruction is again used to latch the address information, which is present
fetched in the fourth six-oscillator period. on the bus at this time Q) , into the 8282 latch if a non-
multiplexed bus is required. At T5, the address is
Each External Data Memory bus cycle consists of twelve removed from the Port 0 bus and the processor's bus
oscillator periods. These are shown as Tl through TI2 drivers go to the high-impedance state . The data
on Figure 2-8. The twelve-period External Data memory read control signal RD ~, is asserted during
Memory cycle allows the 8051 to use peripherals that are T7. RD causes the addressed device to enable its bus
relatively slower than its program memories. The ad- drivers to the now-released bus. At some later time,
dress is emitted from the processor during T3. Data valid data will be available on the bus . When the
transfer occurs on the bus during T7 through T12. T5 8051 subsequently returns RD to the high level Q), the
AFN-01739A
2-10
FUNCTIONAL DESCRIPTION
addressed device will then float its bus drivers, relin- Mode 1) Configures counter 1 as a 16-bit timer/
quishing the bus again . counter.
The write cycle, like the read cycle, begins with the Mode 2) Configures counter 1 as an 8-bit auto-
assertion of ALE Q) and the emission of an address ~ reload timer/counter. THI holds the
as shown in Figure 2-9. In T6, the processor emits the reload value. TLl is incremented. The
data to be written into the addressed data memory loca- value in THI is reloaded into TLl when
tion Q). This data remains valid on the bus until the TLl overflows from all ones (l's). An 8048
end of the following bus cycle's T2 @. The write signal compatible counter is achieved by con-
WR goes low at T6 CI> and remains active through T12 figuring to mode 2 after zeroing THI.
@.
Mode 3) When counter 1's mode is reprogrammed
to mode 3 (from mode 0, 1 or 2), it disables
Timer/Counters the incrementing of the counter. This mode
is provided as an alternative to using the
Two independent 16-bit timer/counters are on-board TRI bit (TCON.6) to start and stop
the 8051 for use in measuring time intervals, measuring counter 1.
pulse widths, counting events, and causing periodic
(repetitious) interrupts. The serial port receives a pulse each time that counter 1
overflows. The standard UART modes divide this pulse
rate to generate the transmission rate.
TIMER/COUNTER MODE SELECTION
Counter 1 can be configured in one of four modes: Counter 0 can also be configured in one of four modes:
Mode 0) Provides an 8-bit counter with a divide- Modes 0-2) Modes 0-2 are the same as for counter 1.
by-32 prescaler or an 8-bit timer with a
divide-by-32 prescaler. A read/write of Mode 3) In Mode 3, the configuration of THO is not
THI accesses counter l's bits 12-5. A affected by the bits in TMOD or TCON
read/write of TLI accesses counter l's bits (see next section). It is configured solely as
7-0. TLl bits 4-0 are the prescalar (counter an 8-bit timer that is enabled for incremen-
l's bits 4-0), while bits 7-5 are indeter- ting by TCON's TRI bit. Upon THO's
minate and should be ignored. The pro- overflow, the TFI flag gets set. Thus,
grammer should clear the prescaler neither TRI nor TFI is available to counter
(counter 1's bits 4-0) before setting the run 1 when counter 0 is in Mode 3. The func-
flag. tion of TRI can be done by placing counter
ALE (i{ \ I
V
WR
1\0 V
0
PORT 2
~ ADDRESS A15-AS
CD (3) G)
PORTO INST I~ IFLOAT A7- AO
X DATA OUT
ADD RESS
OR FLOAT
I I I I I
2-11 AFN-01739A
FUNCTIONAL DESCRIPTION
1 in Mode 3, so only the function of TFI is Table 27. Function of Bits in TCON
actually given up by counter 1. In Mode 3, (Upper Nibble)
TLO is configured as an 8-bit timer/counter
Bit
and is controlled, as usual, by the Gate
Function Flag Location
(TMOD.3) clf (TMOD.2), TRO
(TCON.4) and TFO (TCON.5) control bits. Counter interrupt request and TFI TCON.7
overflow Flag
Counter enable/disable bit TRI TCON.6
CONFIGURING THE TIMER/COUNTER INPUT
Counter interrupt request and TFO TCON.5
The use of the timer/counter is determined by two 8-bit overflow Flag
registers, TMOD (timer mode) and TCON (timer con- Counter enable/disable bit TRO TCON.4
trol). The counter input circuitry is shown in Figures
2-10 and 2-11. The input to the counter circuitry is from
an external reference (for use as a counter), or from the The functions of the bits in TMOD are shown in Table
on-chip oscillator (f~ use as a timer), depending on 2-8. Recall that the bits in TMOD are not bit ad-
whether TMOD's CIT bit is set or cleared, respectively. dressable.
When used as a time base, the on-chip oscillator fre-
quency is divided by twelve (12) before being input to
the counter circuitry. When TMOD's Gate bit is set (1),
the external reference input (Tl, TO) or the oscillator in- Table 28. Functions of Bits in TMOD
put is gated to the counter conditional upon a second ex- Bit
ternal input (INTO), (INTI) being high. When the Gate Function Flag Location
bit is zero (0), the external reference, or oscillator input,
is unconditionally enabled. In either case, the normal in- Enable input at TI using INTI Gate TMOD.7
terrupt function of INTO and INTI is not affected by Counter I/Timer I select CjT TMOD.6
C I/T I Mode select MSb MI TMOD.5
the counter's operation. If enabled, an interrupt will oc-
C I/T I Mode select LSb MO TMOD.4
cur when the input at INTO or INTI is low. The
Enable input to TO using INTO Gate TMOD.3
counters are enabled for incrementing when TCON's
TRI and TRO bits are set. When the counters overflow
the TFI and TFO bits in TCON get set, and interrupt re~ Counter 0/ Timer 0 select CIT TMOD.2
C OfT 0 Mode select MSb MI TMOD.I
quests are generated. The functions of the bits in TCON
C OfT 0 Mode select LSb MO TMOD.O
are shown in Table 2-7.
COUNTER 0
MODE 0: 8-BIT TIMER WITH PRESCALER/
8-BIT COUNTER WITH PRESCALER
MODE 1: 16-BIT TIMER/COUNTER
MODE 2: 8-BIT AUTO-RELOAD TIMER/COUNTER
MODE 3: 8-BIT TIMER/COUNTER (TLO)
TO---.....I
XTAL1
2-12 AFN01739A
FUNCTIONAL DESCRIPTION
PULSE TO
COUNTER 1 SERIAL PORT
MODE 0: 8-BIT TIMER WITH PRESCALER/
8-BIT COUNTER WITH PRESCALER
MODE 1: 16-BIT TIMER/COUNTER
MODE 2: 8-BIT AUTO-RELOAD T/C
MODE 3: PREVENTS INCREMENTING
OFT/C
COUNTER 0
TXD RXD
TXD
,
RXD TXD RXD RXD TXD
r TXD RXD
r TXD RXD
! TXD ~ RXD
RXD 14- TXD
PORT PIN f...---...-. CTS
A. MULTI-80S1 INTERCONNECT -HALF DUPLEX B. MULTI-80S1 INTERCONNECT -FULL DUPLEX C. 8051-8251 INTERFACE
2-13 AFN-01739A
FUNCTIONAL DESCRIPTION
Mode 2) UART interface with ll-bit frame and fixed Table 29. Functions of Bits in SCON
transmission rate
Bit
Mode 3) UART interface with II-bit frame and Function Flag Location
variable transmission rate Serial Port Operation SMO SCON.7
Mode (MSb)
Modes 2 and 3 also provide automatic wake-up of slave Serial Port Operation SMI SCON.6
processors through interrupt driven address-frame Mode (LSb)
recognition for multiprocessor communications. Conditional Receiver SM2 SCON.5
Several schemes of UART interfacing are shown in Enable
Figure 2-12, and an I/O expansion technique is shown Receiver Enable REN SCON.4
in Figure 2-13. Transmitter Data Bit 8 TB8 SCON.3
Received Data Bit 8 RB8 SCON.2
Transmission Complete TI SCaN. 1
Interrupt Flag.
8051 Reception Complete RI SCaN. 0
Interrupt Flag
DATA
CLOCK
PORT PIN
Mode control bits SMO and SMI program the serial port
A. 1/0 INPUT
EXPANSION in one of four operating modes. A detailed description
of the modes is provided later in the text. The receiver-
8051
enable bit (REN) resets the receiver's start/stop logic.
When software sets REN to one (1), the receiver's
transmission-rate generator is initialized and reception
DATA OS
CLOCK is enabled. REN must be set as part of the serial
EN
PORT PIN channel's initialization program. When REN is cleared,
reception is disabled.
B. 1/0 OUTPUT
EXPANSION
The CPU is informed that the transmitter portion of
Figure 213. 1/0 Expansion Technique SBUF is empty, or the receiver portion is full, by TI and
RI, respectively. TI and RI must be cleared as part of
the interrupt service program so as not to continuously
SERIAL CHANNEL CONTROL AND interrupt the CPU. Since TI and RI are "or-ed" together
DATA REGISTERS to generate the serial port's interrupt request, they must
Data for transmission and from reception reside in the be polled to determine the source of the interrupt.
serial port buffer register (SBUF). A write to SBUF up-
dates the transmitter register, while a read from SBUF OPERATING MODES
reads a buffer that is updated by the receiver register
if/when flag RI is reset. The receiver is double-buffered Operating Mode 0
to eliminate the overrun that would occur if the CPU The I/O expansion mode, Mode 0, is used to expand the
failed to respond to the receiver's interrupt before the number of input and output pins. In this mode, a clock
beginning of the next frame. In general, double buffer- output is provided for synchronizing the shifting of bits
ing of the transmitter is not needed for the high perfor- into, or from, an external register. Eight bits will be
mance 8051 to maintain the serial link at its maximum shifted out each time a data byte is written to the serial
rate. A minor degradation in data rate can occur in rare channel's data buffer (SBUF), even if TI is set. Each
events, such as when the servicing of the transmitter has time software clears the RI flag, eight bits are shifted in-
to wait for a lengthy interrupt service program to com- to SBUF before the RI flag is again set. The receiver
plete. In asynchronous mode, false start-bit rejection is must be enabled [Le., REN set to (1)] for reception to
provided on received frames. A two-out-of-three vote is occur.
taken on each received bit for noise rejection. The serial
port's control and the monitoring of its status is provid- The synchronizing clock is output on pin P3.1 and tog-
ed by the serial port control register (SCaN). The con- gles from high to low near the falling-edge of ALE in
tents of the 8-bit SCON register are shown in Table 2-9. the fifteenth oscillator period following execution of the
2-14 AFN01739A
FUNCTIONAL DESCRIPTION
instruction that updated SBUF or cleared the RI flag. It In Modes 2 and 3, if SM2 is set, frames are received, but
then toggles near the falling-edge of ALE in each subse- an interrupt request is generated only when the received
quent sixth oscillator period until S-bits are transferred. data bit S (RBS) is a one (1). This feature permits inter-
The eighth rising-edge of clock (P3.1) sets the RI or TI rupt generated wake-up during interprocessor com-
flag. At this point, shifting is complete and the clock is munications when multiple S051's are connected to a
once again high. The first bit is shifted out of P3.0 at the serial bus. Thus, data bit S (RBS) awakens all processors
beginning of the eighteenth oscillator period, following on the serial bus only when the master is changing ad-
the instruction that updated SBUF. The first bit shifted dress to a different processor. Each processor not ad-
in from P3.0 is latched by the clock's rising-edge in the dressed then ignores the subsequent transmission of
twenty- fourth oscillator period, following the instruc- control information and data. A protocol for
tion that cleared the RI flag. One bit is shifted every multi-S051 serial communications is shown in Figure
twelfth oscillator period, until all eight bits have been 2-14. The SM2 bit has no effect in Modes 0 and l.
shifted.
2-15 AFN01739A
FUNCTIONAL DESCRIPTION
2-16 AFN01739A
FUNCTIONAL DESCRIPTION
In addition, certain of the control pins are driven to a supply to RST /VPD pin. Applying power to the
high level during reset. These are ALE/PROG and RST /VPD pin resets the 8051 and retains the internal
PSEN. Thus, no ALE or PSEN signals are generated RAM data valid as the vee power supply falls below
while RST /VPD is high. After the processor is reset, all limit. Normal operation resumes when RST /VPD is
ports are written with one (I's). Outputs are undefined returned low. Figure 2-18 shows the waveforms for the
until the reset period is complete. An external reset cir- power-down sequence.
cuit, such as that in Figure 2-17, can be used to reset the
microcomputer.
vee - - - - - - - -....
,i'--...---/'TI----
,
+5V
INTO - - - - - - - "
(POWER-FAIL)
I '
INL.T=ER-=-R-UP=T-J-,_ _ _ _ ..L...\- - - -
, I
I I
RST/VPD - - - - - - - - - ' I
8051
.... -----~.~I~
NORMAL OPERATION SERVICE PROGRAM NORMAL OPERATION
!
RSTNPD
EPROM Programming
+5V
The 8751 is programmed, and the 8051 and 8751 are
L~
verified, using the UPP-851 programming card. For
8051
programming and verification, address is input on Port
RSTNPD 1 and Port pins 2.0-2.3. Pins P2,4 and P2.5 are held to a
t
Figure 217. External Reset
~
\7
TTL low (VIU. Data is input and output through Port
O. RST /VPD is held at a TTL high level (VIHO and
PSEN is held at TTL low level (VIU during program
and verify. To program, ALE/PROG is held at a TTL
low level (VIU. The programming supply voltage is
held at 21 V. The EA/VDD pin receives this program-
ming supply voltage. ALE/PROG is held at TTL high
Power Down (Standby) Operation of level (VIH) to verify the program. Port pin 2.7 forces
Internal RAM the Port 0 output drivers to the high impedance state
when held at a TTL high level and is held at a TTL low
Data can be maintained valid in the Internal Data RAM
level for verification. Erasure of an 8751 will leave the
while the remainder of the 8051 is powered down. When
EPROM programmed to an all one's (I's) state.
powered down, the 8051 consumes about 10070 of its
normal operating power. During normal operation,
Data is introduced by programming "O's" into the
both the epu and the internal RAM derive their power
desired bit locations. Although only "O's" will be pro-
from vee. However, the internal RAM will derive its
grammed, both "1's" and "O's" can be presented in the
power from RST /VPD when the voltage of vee is
d-ata word. The only way to change a "0" to a "1" is by
zero.
ultra-violet light erasure.
When a power-supply failure is imminent, the user's
system generates a "power-failure" signal to interrupt When EA/VDD is at 21 V, the 8751 is in the program-
the processor via INTO or INTI. This power-failure ming mode. It is necessary to put a capacitor between
signal must be early enough to allow the 8051 to save all EA/VDD and ground to block spurious voltage tran-
data that is relevant for recovery before vee falls sients. ALE/PROG receives the 50 msec, active low TTL
below its operating limit. The program servicing the program pulse when the address and data are stable. A
power-failure interrupt request may save any important program pulse must be applied at each address location
data and machine status into the Internal Data RAM. to be programmed. You can program any location at
The service program must also enable the backup power any time - either sequentially or at random.
2-17 AFN-01739A
FUNCTIONAL DESCRIPTION
~
MODE
VPD/RST PSEN PROG/ALE VDD/EA P24-26 P27
2-18 AFN-01739A
Ii~
II
'II'
II
CHAPTER 3
MEMORY ORGANIZATION, ADDRESSING MODES
AND INSTRUCTION SET
Chapter 3 is divided into these categories:
In the 8051 and 8751, the lower 4K of the 64K Program
Memory address space is filled by internal ROM and
Memory Organization EPROM, respectively. By tying the EA pin high, the
processor can be forced to fetch from the internal
Addressing Modes ROM/EPROM for Program Memory addresses 0
through 4K. Bus expansion for accessing Program
Instruction Set Memory beyond 4K is automatic, since external instruc-
tion fetches occur automatically when the Program
The first part, Memory Organization, describes the Counter increases above 4095. If the EA pin is tied low,
memory spaces of the 8051. The Addressing Modes sec- all Program Memory fetches are from external memory.
tion describes addressing techniques used to reach the The execution speed of the 8051 is the same, regardless
memory spaces. The final section explains the instruction of whether fetches are from internal or external Pro-
set, including functional groupings, opcodes and a soft- gram Memory. If all program storage is on-chip, byte
ware example. location 4095 should be left vacant to prevent an
undesired pre-fetch from external Program Memory ad-
MEMORY ORGANIZATION dress 4096.
In the 8051 family the memory is organized over three
address spaces and the program counter. The memory Certain locations in Program Memory are reserved for
spaces shown in Figure 3-1 are the: specific programs. Locations 0000 through 0002 are
reserved for the initialization program. Following reset,
16-bit Program Counter the CPU always begins execution at location 0000.
Locations 0003 through 0042 are reserved for the five
64K-byte Program Memory address space interrupt-request service programs.
64K-byte External Data Memory address space The 64K-byte External Data Memory address space is
automatically accessed when the MOVX instruction is
384-byte Internal Data Memory address space executed.
The 16-bit Program Counter register provides the 8051 Functionally, the Internal Data Memory is the most
with its 64K addressing capabilities. The Program flexible of the address spaces. The Internal Data
Counter allows the user to execute calls and branches to Memory space is subdivided into a 256-byte Internal
any locations within the Program Memory space. There Data RAM address space and a 128-byte Special Func-
are no instructions that permit program execution to tion Register address space. Within these address spaces
move from the Program Memory space to any of the are 256 individually addressable bits. Figure 3-2 shows
data memory spaces. the locations of the address spaces.
!
64K 64K
INTERNAL
409S -------Lml,----A--2S-S-----~Il
t I
____L-___ ~~-------~-
'___ 0:.'-_ _ _.... 12:1 12810..-----'
~----~,~-===:==~------_~
I 0
,10..-____--',
PROGRAM PROGRAM INTERNAL SPECIAL EXTERNAL
COUNTER MEMORY DATA RAM FUNCTION DATA
REGISTERS MEMORY
3-1 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
The Internal Data RA~,,1 address space is 0 to 255. Four thf?m to he accessed as easily as internal RAM. As such,
banks of eight registers occupy locations 0 through 31. they can be operated on by most instructions. In addi-
The stack can be located anywhere in the Internal Data tion, 128 bit locations within the Special Function
RAM address space. In addition, 128 bit locations of Register address space can be accessed using Direct Ad-
the on-chip RAM are accessible through Direct Ad- dressing as shown in Figure 3-4. These bits reside in the
dressing. (See next section, Addressing Modes.) These Special Function Register address space and can be ac-
bits reside in Internal Data RAM at byte locations 32 cessed using Direct Addressing. The addressable bits are
through 47, as shown in Figure 3-3. Currently locations located at byte addresses divisible by eight. An easy way
o through 127 of the Internal Data RAM address space to determine which byte locations are bit addressable
are filled with on-chip RAM. Locations 128 through 255 are those byte locations ending in zero (0) or eight (8)
may be filled on later products without affecting ex- when represented in hexadecimal notation. The twenty
isting software. Special Function Registers are listed in Table 3-1. Their
mapping in the Special Function Register address space
The stack depth is limited only by the available Internal is shown in Figure 3-5.
Data RAM, thanks to an 8-bit reload able Stack Pointer.
The stack is used for storing the Program Counter dur- ADDRESSING MODES
ing subroutine calls, and may be used for passing
parameters. Any byte of Internal Data RAM or Special Since the MCS-51 architecture differentiates between
Data Memory and Program Memory, there are dif-
Function Register'S accessible through Direct Address-
ferent addressing modes for each. These are explained
ing can be pushed/popped.
below.
The Special Function Register address space is 128 to
a,) RAM Bit Addresses,
255. All registers except the Program Counter and the
RAM
four banks of eight working registers reside here. BYTE (MSB) (lSB)
Memory mapping the Special Function Registers allows 7FH l~-------'l
SPECIAL
FUNCTION
-
INTERNAL DATA RAM REGISTERS
( _ _A - - _ V_ _~ 2FH 7F 7E 70 7C 7B 7A 79 78 47
2EH 77 76 75 74 73 72 71 70 46
255 255 248 F8H'
255 FOH 2DH 6F 60 6C 6A 69 68 45
6E 6B
E8H
2CH 67 66 65 64 63 62 61 60 44
EOH
D8H 2BH SF 5E 50 5C 5B SA 59 58 43
DOH
ADDRESS- 2AH 57 56 55 54 53 52 51 50 42
C8H
ABLE
COH 29H 4F 4E 40 4C 4B 4A 49 48 41
BITS IN
B8H SFRs
BOH 28H 47 46 45 44 43 42 41 40 40
(128 BITS)
A8H 27H 3F 3E 3D 3C 3B 3A 39 38 39
AOH
26H 37 36 35 34 33 32 31 30 38
98H
90H 2C 2A 28 37
25H 2F 2E 20 2B 29
88H
128 135 128 80H 24H 27 26 25 24 23 22 21 20 36
22H 17 16 15 14 13 12 11 10 34
Figure 32. Internal Data Memory Address Space Figure 33. RAM Bit Addresses
3-2 AFN-01739A ,
MEMORY, ADDRESSING, INSTRUCTION SET
There are five general addressing modes operating on is appended to the instruction opcode to provide the
bytes. One of these five addressing modes, however, memory location address. The highest-order bit of this
operates on both bytes and bits. byte selects one of two groups of addresses: values be-
tween 0 and 127 (00H-7FH) access internal RAM loca-
Register Addressing tions, while values between 128 and 255 (80H-OFFH) ac-
Register addressing encodes, in the low-order three bits cess one of the Special Function Registers. In the
of the instruction opcode, the number of a register in assembly language, direct addresses are specified with
the currently enabled register bank. RSI (PSW.4) and the address of the variable or register, or a symbolic
RSO (PSW.3) determine which register bank is enabled. name defined earlier as a direct address. The instruction
In the MCS-51 assembly language, register addressing is set mnemonic for Direct Byte Addressing is "direct".
indicated by the register symbols RO through R7, or by a
symbolic name defined earlier as a register. The instruc- BIT OPERANDS
tion set mnemonic for Register Addressing is "Rn" Direct Bit addressing (bit) lets a number of instructions
where n can be any value from 0 to 7. manipulate or test any of 128 user-defined software
flags in internal data RAM, and manipulate or test 128
bits in the Special Functions Registers address space. An
Direct Addressing additional byte appended to the opcode specifies the
flag or bit to be accessed. Values between 0 and 127
BYTE OPERANDS
(00H-7FH) correspond to software flags in sixteen inter-
Direct Byte addressing specifies an on-chip RAM loca- nal RAM locations, addresses 20H-2FH. Bit addresses
tion or a Special Function Register. An additional byte 00H-07H correspond to bits 0-7 of RAM location 20H,
respectively; addresses 77H-7FH correspond to bits 0-7
of RAM location 2FH. Bit address values between 128
Table 31. Special Function Registers
~pecial Byte
Function ASM51 Location b.) Hardware Register Bit Addresses.
Register in Memory Direct Hardware
Bit Addresses
Symbolic Name !~:ress (MSB) (lSB) Register
Symbol
Accumulator*
Arithmetic B register*
ACC
B
224(EOH)
240(FOH)
240 F7 I F6 I F5 I F4 I F3 I F2 I F1 I FO
(high)
Data Pointer DPL 130(82H)
(low)
184 - I- I- I BC I BB I BA I B9 I B8 IP
Port 3* P3 I 76(BOH)
Parallel
I/O
Port
Port
2*
1*
P2
PI
160(AOH)
I 44(90H)
176 B7 I B6 I B5 I B4 I B3 I B2 I B1 I BO P3
Interrupt Control*
System Interrupt Enable IEC 168(A8H) 160 A7 I A6 I A5 I A4 I A3. I A2 I A1 I AO P2
Control*
Buffer
Figure 34. Special Function Register Bit Address
*Bit addressable byte location
33 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
BF
B
~l~ (FOH) equal to RO or Rl. The instruction set mnemonic for
Register-Indirect Addressing uses the "at" ("@") also.
I
ACC A 224 (EOH)
231
Immediate Addressing
1
224
I
PSW 208 (DOH)
215
1I
208
IPC 184 (B8H) Immediate Addressing (#data) appends an additional
184 byte to the instruction to hold the source variable. In the
P3 191
183 176 1
176 (BOH)
8051 assembly language and the 8051 instruction set, a
IEC
~
1
1
175
168
1
168
I
1~
(A8H)
(AOH)
number sign (#) precedes the value to be used, which
may refer to a constant, an expression, or a symbolic
SFR's name. Since the value used is fixed at the time of ROM
m'~'"
(8DH) the 16 bits of data loaded into the data pointer.)
THO 140 (8CH)
TL1 139 (8BH) Figure 3-6 illustrates how the addressing modes reach
TLO 138 (8AH) different Internal Data Memory.
TMOD 1U (89H)
TCON 136 (88H)
DPH
DPL
SP
~
135 128
131
130
129
1U
(83H)
(82H)
(81H)
(80H)
~r-~
INTERNAL
DATA RAMI
STACK
255 255
SPECIAL
FUNCTION
REGISTERS
248 F8H
255 248 FOH
Figure 35. Special Function Registers Address 240 E8H
232
Space 224
EOH
D8H
216
DOH
208
C8H
200 DIRECT
and 255 (80H-OFFH) select bits in the special function 192
COH
AD~RESS-
registers; the high-order five-bit field of the address byte 184 B8H ING
176 BOH (BITS)
is the same as that of the register used, while the low 168 A8H
or&'r three bits give the bit position within that register. 160 AOH
which contains the bit, and the bit's position therein .....~
(e.g., 32.6), separated by a period (.) or by a symbol
previously defined as a direct bit address. The instruc- ~
DIRECT 127 120
tion set signifies a bit location by the mnemonic "bit". ADDRESSING
(BITS)
E 7 0
BaseRegisterPlus Index Register > R7
BANK 3
Indirect Addressing ..?! RO
R7
BANK2
Base-Register-plus Index Register-Indirect Addressing REGISTER ~ RO
ADDRESSING R7
simplifies accessing look-up tables (LUT) resident in BANK 1
~ RO
Program Memory. A byte may be accessed from an R7
BANKO
LUT via an indirect move from a location whose ad- ~ RO
dress is the sum of a base register (the DPTR or PC) and ~
~ DIRECT ADDRESSING
the index register (A).
STACK-POINTER REGISTER-INDIRECT AND
REGISTER-INDIRECT ADDRESSING
Registerlndirect Addressing
Figure 36. Internal Data Memory Addressing
Register-Indirect Addressing (@Ri) accesses a RAM
Modes
location whose address is determined by the current
3-4 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
Branch Destination Addressing Modes If both accumulators are accessed as memory locations
using Direct Addressing, different mnemonics are used.
Three program memory addressing modes are used by
"ACC" is the symbol for the byte accumulator and
conditional and unconditional branch operations. "CY" is the symbol for the bit accumulator.
RELATIVE ADDRESSING (rei) Even though there are two different addressing modes
Relative addressing (reI) encodes an 8-bit signed and a set of mnemonics for each accumulator, both ac-
displacement value in the last instruction byte. During cumulators have only one physical space on the chip.
execution, the CPU computes the destination address by
extending the sign-bit of this byte to 16 bits and adding When an I/O port or pin is the destination of a data
this value to the incremented program counter. In the move instruction, data is written into a corresponding
8051 assembly language, the programmer only needs to data latch. When an I/O port or pin is the source for a
specify the address or label assigned to the desired data transfer, or other two operand instructions, the
destination instruction. The assembler will compute the data present at the input pins is read.
signed displacement needed and produce an error
message if the destination is "out of range." Instructions which use the port as both a source and
destination (such as INC PI or ORL PI, #20H) read the
ABSOLUTE ADDRESSING (addr11) internal buffer rather than the input pins, so only the
Absolute Addressing (addr11) encodes the low-order 11 desired output latch bits will be affected.
bits of the destination address in three bits of the opcode
and the second instruction byte. The high-order five bits When an I/O pin is the destination of a SETB, CLR,
CPL, or MOV instruction, the on-chip data latch cor-
of the destination address are taken from the high-order
five bits of the incremented program counter. Note that responding to that pin is affected. When an I/O pin is
this means that an AJMP or ACALL instruction the source operand for a Boolean move or two-operand
located in addresses 07FEH, for example, will reach a instruction, the instruction reads the data present at the
destination between addresses 0800H and OFFFH. input pin. The CPL and JBC instructions read the inter-
nal buffer rather than the input pin state.
LONG ADDRESSING (addr16)
Since the parity flag (pSW.O) is updated after every in-
Long Addressing (addr16) uses the second and third struction cycle, instructions which explicitly alter the
byte of the instruction to hold the high-order and low- PSW or this bit will have no apparent effect on P, as if
order bytes of the 16-bit destination address, respective- PSW.O is a read-only bit. Bits 7, 6, and 5 of register
ly. The destination can be anywhere in the full 64 IPC, and bits 6 and 5 of register IEC are not im-
kilobyte program memory address space. plemented on the 8051 and are reserved.
3-5 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
Oscillator Oscillator
Mnemonic Description Byte Period Mnemonic Description Byte Period
ADD A,Rn Add register to I 12 SUBB A,direct Subtract direct 2 12
Accumulator byte from Acc
ADD A,direct Add direct 2 12 with borrow
byte to SUBB A,@Ri Subtract 12
Accumulator indirect RAM
ADD A,@Ri Add indirect 12 from Acc with
Ram to borrow
Accumulator SUBB A,#data Subtract 2 12
ADD A,#data Add immediate 2 12 immediate data
data to from Acc with
Accumulator borrow
ADDC A,Rn Add register to 12 INC A Increment 12
Accumulator Accumulator
with Carry INC Rn Increment 12
ADDC A,direct Add direct 2 12 register
byte to INC direct Increment 2 12
Accumulator direct byte
with Carry INC @Ri Increme.nt 12
ADDC A,@Ri Add indirect 12 indirect RAM
RAM to DEC A Decrement 12
Accumulator Accumulator
with Carry DEC Rn Decrement 12
ADDC A,#data Add immediate 2 12 Register
data to Acc DEC direct Decrement 2 12
with Carry direct byte
SUBB A,Rn Subtract 12 DEC @Ri Decrement 12
register from indirect RAM
Accwith
borrow All mnemonics copyrighted ,< Intel Corporation 1980
3-6 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
MEMORY, ADDRESSING, INSTRUCTION SET
Oscillator Oscillator
Mnemonic Description Byte Period Mnemonic Description Byte Period
MOV A,Rn Move register 1 12 MOVX @Ri,A Move Acc to 1 24
to External RAM
Accumulator (8-bit addr)
MOV A,direct Move direct 2 12 MOVX @DPTR,A Move Acc to 24
byte to External Ram
Accumulator (l6-bit addr)
MOV A,@Ri Move indirect 12 PUSH direct Push direct 2 24
RAM to byte onto stack
Accumulator POP direct Pop direct byte 2 24
MOV A,#data Move 2 12 from stack
immediate data XCH A,Rn Exchange 12
to register with
Accumulator Accumulator
MOV Rn,A Move 12 XCH A,direct Exchange 2 12
Accumulator direct byte
to register with
MOV Rn,direct Move direct 2 24 Accumulator
byte to register XCH A,@Ri Exchange 12
MOV Rn,#data Move 2 12 indirect RAM
immediate data with
to register Accumulator
MOV direct,A Move 2 12 XCHD A,@Ri Exchange low- 12
Accumulator order Digit
to direct byte indirect RAM
MOV direct,Rn Move register 2 24 with Acc
to direct byte
MOV direct,direct Move direct 24
byte to direct
MOV direct,@Ri Move indirect 2 24
RAM to direct
byte
MOV direct,#data Move 24
immediate data
to direct byte
MOV @Ri,A Move 12
Accumulator
to indirect
RAM
MOV @Ri,direct Move direct 2 24
byte to indirect
RAM
MOV @Ri,#data Move 2 12
immediate data
to indirect
RAM
MOV DPTR,#dataI6 Load Data 24
Pointer with a
16-bit constant
MOVC A,@A+DPTR Move Code 24
byte relative to
DPTR to Acc
MOVe A,@A+PC Move Code 24
byte relative to
PC and Acc
MOVX A,@Ri Move External 24
RAM (8-bit
addr) to Acc
MOVX A,@DPTR Move External 24
RAM (16-bit
addr) to Acc
All mnemonics copyrighted Intel Corporation 1980
3-8 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
PROGRAMING BRANCHING
Oscillator
Mnemonic Description Byte Period
ACALL addrll Absolute 2 24
Subroutine
Call
LCALL addr16 Long 24
Subroutine
Call
RET Return for 24
Subroutine
RETI Return for 24
interrupt
AJMP addrl1 Absolute Jump 2 24
LJMP addr16 Long Jump 3 24
SJMP rel Short Jump 2 24
(relative addr)
JMP @A+DPTR Jump indirect 24
relative to the
DPTR
JZ rel Jump if 2 24
Accumulator is
Zero
All mnemonics copyrighted Intel Corporation 1980
3-9 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
ARITHMETIC OPERATIONS There are three arithmetic operations that operate ex-
clusively on the A register (the accumulator). These are the
The 8051 implements the arithmetic operations of add, in-
decimal-adjust for BCD addition and the two-test condi-
crement, decrement, compare-to-zero, decrement-and-
tions shown in Figure 3-8. The decimal-adjust operation
compare-to-zero, decimal-add-adjust, subtract-with-
converts the result from a binary addition of two two-digit
borrow, compare, multiply and divide.
BCD values to yield the correct two-digit BCD result. Dur-
ing this operation the auxiliary-carry flag helps effect the
Only unsigned binary integer arithmetic is performed in
proper adjustment. Conditional branches may be taken
the Arithmetic/Logic Unit. In the two-operand opera-
based on the value in the accumulator being zero or not
tions of add, add-with-carry and subtract-with-borrow
zero.
the A register (the accumulator) is the first operand and
receives the result of the operation. The second operand
can be an immediate byte, a register in the selected Register The 8051 simplifies the implementation of software
counters since the increment and decrement operations
Bank, a Register-Indirect Addressed byte or a Direct Ad-
can be performed on the accumulator, a register in the
dressed byte. These instructions affect the overflow (OV),
carry (C), auxiliary-carry (AC), and parity (P) flags in the selected Register Bank, Register-Indirect Addressed byte
in the Internal Data RAM or a byte in the Direct Ad-
Program Status Word (PSW). The carry flag facilitates
nonsigned integer arithmetic and multi-precision rota- dressed Internal Data RAM or Special Function
tions. Handling two's-complement-integer (signed) addi- Register. The 16-bit Data Pointer can be incremented.
tion and subtraction can easily be accommodated with For efficient loop control, the decrement-and-jump-if-
software's monitoring of the PSW's overflow flag. The not-zero operation is provided. This operation can
auxiliary-carry flag simplifies BCD arithmetic. An opera- decrement a register in the selected Register Bank, any
tion that has an arithmetic aspect similar to a subtract is Special Function Register or any byte of Internal Data
the compare-and-jump-if-not-equal operation. This RAM accessible through Direct Addressing, and force a
operation performs a conditional branch if a register in the branch if the result is not zero. The increment/ decre-
selected Register Bank, or a Register-Indirect Addressed ment operations are summarized in Figure 3-9.
byte of Internal Data RAM, does not equal an immediate
value; or ifthe A register does not equal a byte in the Direct The multiply operation multiplies the one-byte A register
Addressable Internal Data RAM, or a Special Function by the one-byte B register and returns a double-byte result
Register. While the destination operand is not updated
and neither source operand is affected by the compare
operation, the carry flag is set if the first operand is less . Declmal-AddAdjust
Jump.If.A.ls.Zero
Jumplf-Als-NotZero
I REG~TER
I
Add
Figure 38. Internal Data Memory Arithmetic
Add-WlthCarry Operations (Register A Specific)
SubtractWlth-Borrow
Compare-And-JumplfNotEqual ( )
DIRECT REGISTER
Data DPTR
(INC, DEC, DJNZ) (INC)
REGISTER
A
REGISTER INDIRECT (INC, DEC)
@R1,@RO
REGISTER REGISTER-INDIRECT
R7-RO @R1,@RO
Figure 37. Internal Data Memory Arithmetic (INC, DEC, DJNZ) (INC, DEC)
Operations
Figure 39. Internal Data Memory Arithmetic
Operations
3-10 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
Divide
Multiply ~ REGISTER
AlB
!I REGISTER I
Figure 310. Internal Data Memory Arithmetic
Operations (Register A with
Register B)
IMMEDIATE
# data
LOGIC OPERATIONS
The 8051 permits the logic operations of and, or, and Figure 311.lnternal Data Memory Logic Operations
exclusive-or to be performed on the A register by a second
operand which can be an immediate value, a register in the
selected Register Bank, a Register-Indirect Addressed
Clear
Complement
Rotate-Left
I REGIASTER J
byte of Internal Data RAM or a Direct Addressed byte of Rotate-Left-Through-Carry
Internal Data RAM or Special Function Register. In addi- Rotate-Right
Rotate-Rlght-Through-Carry
tion, these logic operations can be performed on a Direct Swap-Nibbles (Rotate Lelt Four)
Addressed byte of the Internal Data RAM or Special
Function Register using the A Register as the second Figure 312. Internal Data Memory Logic Operations
operand. Also, use of Immediate Addressing with Direct (Register A Specific)
Addressing permits these logic operations to set, clear or
complement any bit anywhere in the Internal Data RAM
or Special Function Registers without affecting the PSW, REGISTER
Register Bank registers or accumulator. When one takes Set (SETB) C
Clear (CLR) (SETB,
into account that the registers R7-RO and the accumulator Complement (CPL) CLR, CPL)
Jump-II-Blt-Set-Then-Clear-BIt (JBC)
can be Direct Addressed, the two-operand logic opera-
tions allow the destination (first operand) to be a byte in
Figure 313. Internal Data Memory Logic Operations
the Internal Data RAM, a Special Function Register,
(BitSpecific)
Register Bank registers (R7 -RO) or the accumulator, while
the choice of the second operand can be any of the
aforementioned or an immediate value. The 8051 can also
perform a logical or, or a logical and, between the Boolean
accumulator (i.e., the carry register) and any bit, or its DATA TRANSFER OPERATIONS
complement, that can be accessed through Direct Ad- Look-up tables resident in Program Memory can be ac-
dressing. The and, or, and exclusive-or logic operations cessed by indirect moves. A byte constant can be trans-
are summarized in Figure 3-11. ferred to the A register (i.e., accumulator) from the Pro-
gram Memory location whose address is the sum of a base
In addition to the logic operations that are performed on register (the PC or DPTR) and the index register ,A). This
Internal Data Memory as shown in Figure 3-11, there are provides a convenient means for programming transla-
also logic operations that are performed specifically on tion algorithms such as ASCII to seven segment conver-
the accumulator. These are summarized in Figure 3-12. sions. The Program Memory move operations are shown
diagrammatically in Figure 3-14.
In addition to the "and" and "or" bit logicals shown in
Figure 3-11, there are logicals that can operate exclusively A byte location within a 256-byte block of External Data
on a Direct Addressed bit. These operations are listed in Memory can be accessed using Rl or RO in Register-
Figure 3-13. The carry flag is also addressed as a register Indirect Addressing. Any location within the fu1l64K Ex-
and can be set, cleared, or complemented with one-byte ternal Data Memory address space can be accessed
instructions. through Register-Indirect Addressing using a 16-bit base
3-11 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
REGISTER
A powerful set of instructions perform data transfer, con-
A ditional and logical operations on Boolean (i-bit)
variables. The 8051 's Boolean Processor can move any of
256 bits to or from the carry register (C) using Direct Ad-
dressing. Individual instructions will set, clear, or comple-
ment these 256 addressable bits or the carry register with
BASE-REGISTER- PLUS
BASE-REGISTER- PLUS
INDEX-REGISTER-INDIRECT INDEX-REGISTER-INDIRECT
Direct Addressing. In conjunction with the bit-test in-
@PC+A @DPTR+A structions described below, these instructions provide
(PROG MEM D-64K) (PROG MEM 0-64K)
direct 8051 code for logic equations and Boolean expres-
sions.
Figure 314. Program Memory Move Operations
The carry register is a "Boolean Accumulator" for logical
"and" or logical "or" operations on Boolean variables.
The carry register acts as a source operand and the
destination for the logical operations. The source
REGISTER operand can be one of the 256 addressable bits or its
A
complement.
3-12 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
REGISTER REGISTER
C DPTR
16
REGISTER
R7-RO
IMMEDIATE
# dete
REGISTER DIRECT
R7-RO Dala
SP is pre-incremented.
REGISTER
A
4 LOW
REGISTER-INDIRECT NIBBLE
@R1.@RO
SP is pre-incremented.
Figure 317. Internal Data Memory Exchange Figure 319. Call Operations
Operations
313 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
tional and unconditional hranching, relative to the start- Auxiliary Carry: The auxiliary-carry flag (AC) is set if an
ing address of the next instruction (PC + 127 to PC - arithmetic instruction results in a carry-out of bit 3 (from
128). The accumulator test operations allow a conditional addition) or a borrow into bit 3 (for subtraction); other-
branch based on the accumulator being zero or non-zero. wise it is cleared. This flag is useful for BCD arithmetic.
Also provided are compare-and-jump-if-not-equal and
Overflow: The overflow flag (OV) is set if the addition or
decrement-and-jump-if-not-zero. These are shown in
subtraction of signed variables produces an overflow er-
Figure 3-21. The register-indirect jump in the 8051 permits
ror (i.e., if the magnitude of the sum or difference is too
branching relative to a base register (DPTR) with an offset
great for the seven magnitude bits in two's complement
provided by the non-signed integer value in the index
representation); otherwise it is cleared. The same flag also
register (A). This accommodates N-way branching. The
indicates when the product resulting from multiplication
indirect jump is shown in Figure 3-22.
overflows one byte, and if division by zero was attempted.
parity: The parity flag (P) is updated after every instruc-
Short Jump Jump-II-A-Zero
Jump-II-Bit-Set Jump-II-A-Not-Zero tion cycle to indicate the parity of the accumulator. It is set
Jump-II-Bit-Not-Set Decrement-And-Jump-II-Not-Zero
Jump-II-Bit-Set-Then-Clear-Bit Compare-And-Jump-II-Not-Equal if the number of"1" bits in the accumulator is odd, other-
wise, it is cleared.
Instruction Definitions
The rest of this chapter defines all the instructions and
operations which the MCS-51 CPU can perform. There is
Figure 321. Unconditional Short Branch and a separate section for each of the 51 basic operations,
Conditional Branch Operations ordered alphabetically according to the operation
mnemonic.
314 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
instruction is applied to the PSW. Status flags can also be are allowed, and gives the assembly language notation,
modified by the generalized bit-manipulation instruc- byte and cycle counts, encoding format, and a symbolic
tions. description for each.
Nineteen operations allow more than one addressing The information in this chapter is directed towards defin-
mode for the source and/or destination operand. The ing the capabilities of the MCS-Sl architecture and hard-
headings for these sections show the instruction format ware. For details on the assembly language or ASMSI
with such operands enclosed in angle brackets (for exam- capabilities refer to the MeS-51 Macro Assembler User's
ple, MOV <dest-byte> , <src-byte. The operation Guide, publication number 9800937.
description tells what modes (or combinations of modes)
ACAll addr11
Operation: ACALL
(PC) ~ (PC) + 2
(SP) .-(SP) + I
SP,,-( PC 7-0)
(SP) .--(SP) + I
SP..-(PC IS-8)
(PC I 0-0) ~ page address
315 AFN-Q1739A
MEMORY, ADDRESSING, INSTRUCTION SET
Function: Add
Description: ADD adds the byte variable indicated to the accumulator, leaving the result in the accumulator. 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 occurred.
OV is set if there is a carry-out ofbit6 Qut not out of bit 7, or a carry-out of bit 7 but not bit6; 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 immediate.
Example: The accumulator holds OC3H (l1000011B) and register 0 holds OAAH (10101OIOB). The instruction,
ADD A,RO
will leave 6DH (0110 1101 B) in the accumulator with the AC flag cleared and both the carry flag and OV
set to 1.
ADD A,Rn
Bytes:
Cycles:
Encoding:
1
0 0 01 1 r r r I
Operation: ADD
(A).-(A) + (Rn)
ADD A,direct
Bytes: 2
Cycles: 1
Encoding:
1
0 0 01 0 1 0 11 1 direct address I
Operation: ADD
(A).-(A) + (direct)
ADD A,@Ri
Bytes:
Cycles:
Encoding: 10 0 01 0
Operation: ADD
(A)-+- (A) + Ri
ADD A,#data
Bytes: 2
Cycles: 1
Encoding:
1
0 0 01 0 1 0 01 I immediate data I
Operation: ADD
(A)04- (A) + #data
3-16 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
OV is set if there is a carry-out of bit 6 but not out of bit 7, or acarryout of bit 7 but notoutofbit6; other-
wise 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 immediate.
Example: The accumulator hoidsOC3H (llOOOOllB) and register 0 hoidsOAAH (lOlOlOlOB) with the carry flag
set. The instruction,
ADDC A,RO
will leave6EH (01 1011 lOB) in the accumulator with ACcleared and both the carry flag and OV set to 1.
ADDC A,Rn
Bytes:
Cycles:
Encoding: I0 0 1 111 r r r
Operation: ADDC
(A)~(A) + (C) + (Rn)
ADDC A,direct
Bytes: 2
Cycles:
Encoding: 1 0 01 110
Operation: AD DC
(A)-+-(A) + (C) + Rm
ADDC A,#data
Bytes: 2
Cycles: 1
Encoding: I0 0 1 I
1 0 1 0 0 I Iimmediate data I
Operation: AD DC
(A)~ (A) + (C) + #data
3-17 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
A ..UID
"",,'W.I .. """".0101
I.
u. ........
Operation: AJMP
(PC)..-(PC) +2
(PC I 0-0) ~ page address
AN L <dest-byte> , <src-byte>
The two operands allow six addressing mode combinations. When the destination is the ac-
cumulator, 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 (l1OOOOIIB) and register 0 holds OAAH (1010101OB) then the in-
struction,
ANL A,RO
will leave 4lH (01OOOOOlB) in the accumulator.
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 pattern of bits 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 PI ,#01110011 B
will clear bits 7, 3, and 2 of output port 1.
ANL A,Rn
Bytes:
Cycles:
Encoding: 0 r r r
1
Operation: ANL
(A) .... (A) A (Rn)
3-18 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
ANL A,direct
Bytes: 2
Cycles:
Encoding:
Operation:
1
ANL
1 10 1
11
direct address
(A)'--(A) 1\ (direct)
ANL A,@Ri
Bytes:
Cycles:
Encoding:
1 1 10 i I
Operation: ANL
(A) .... (A) 1\ Ri
ANL A,#data
Bytes: 2
Cycles:
Encoding: I-I_o__o__I...I_o_o__I_o.....J
Operation: ANL
(direct) .... (direct) 1\ (A)
AN L direct,#data
Bytes: 3
Cycles: 2
Operation: ANL
(direct) .... (direct) 1\ #data
3-19 AFN,01739A
MEMORY, ADDRESSING, INSTRUCTION SET
1 1 I
Encoding: 11
Operation: ANL
(C)~ (C) /\ (bit)
ANL C,/bit
Bytes: 2
Cycles: 2
En~oding: 11-_1_0___
1 ..&.1_0_0_0__
0-, ( bit address I
Operation: ANL
(C).- (C) .., (bit)
3-20 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
CJNE <destbyte>,<srcbyte>,rel
The first two operands allow four addressing mode combinations: the accumulator may be com-
pared with any directly addressed byte or immediate data, and any indirect RAM location or work-
ing register can be compared with an immediate constant.
Example: The accumulator contains 34H. Register 7 contains 56H. The first instruction in the sequence,
CJNE R7,#60H, NOT_EQ
R7 = 60H.
NOT_EQ: JC IF R7<60H.
R7>60H.
sets the carry flag and branches to the instruction at label NOT_EQ. By testing the carry flag, this
instruction determines whether R7 is greater or less than 60H.
If the data being presented to port 1 is also 34H, then the instruction,
WAIT: CJNE A,P1,WAIT
clears the carry flag and continues with the next instruction in sequence, since the accumulator 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.)
CJ N E A,direct,rel
Bytes: 3
Cycles: 2
Encoding: 1_1_o
.... ___1.....1_o__
1 _0_0_1 I immediate data I I rel. address
Operation: CJNE
(PC) -+- (PC) + 3
IF #data < (A)
THEN (PC) ~(PC) + reI and (C)~
OR
IF #data > (A)
THEN (PC) '--(PC) + reI and (C)1-1
3-21 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
CJ N E Rn,#data,re!
Bytes: 3
Cycles: 2
Operation: CJNE
(PC)..-(PC) + 3
IF #data < Ri
THEN (PC~(PC) + rei and (C)..-1
OR
IF #data > Ri
THEN (PC)~(PC) + rei and (C).-O
CLR A
Encoding: LI_l_ _ _ _
0...l.1_0_l__
0_0--'
Operation: CLR
(A)~O
3-22 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
CLR bit
CLR C
Bytes:
Cycles:
Encoding: 11 0 01 0 0 1 1 I
Operation: CLR
(C)..-O
CLR bit
Bytes: 2
Cycles:
Encoding: 11 0 01 0 0 1 01
Operation: CLR
(bit)..-O
CPL A
Operation: CPL
(A)~ -, (A)
3-23
MEMORY, ADDRESSING, INSTRUCTION SET
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 1 has previously been written with 5BH (01011101B). The instruction sequence,
CPL P1.1
CPL P1.2
will leave the port set to 5BH (0101101IB).
CPL C
Bytes:
Cycles:
Encoding: 11 0 I
1 0 0 1 11
Operation: CPL
(C~ , (C)
CPL bit
Bytes: 2
Cycles: 1
Encoding: 11 0 I
1 0 0 1 01 bit address
Operation: CPL
(bit)..... , (bit)
DA A
If accumulator bits 3-0 are greater than nine (xxxxlOlO-xxxxl111), or if the AC flag is one, six is
added to the accumulator producing the proper BCD digit in the low-order nibble. This internal ad-
dition would set the carry flag if a carry-out of the low-order four-bit field propagated 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 (101Oxxxx-l111xxxx),
these high-order bits are incremented by six, producing the proper BCD digit in the high-order nib-
ble. 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, 60H, or 66H to the accumulator, depending on initial accumulator
and PSW conditions.
3-24 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
Note: DA A cannot simply convert a hexadecimal number in the accumulator to BCD notation, nor
does DA A apply to decimal subtraction.
Example: The accumulator holds the value 56H (0101011OB) representing the packed BCD digits of the
decimal number 56. Register 3 contains the value 67H (01100111 B) 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 (00100100B), in-
dicating the packed BCD digits of the decimal number 24, the low-order two digits of the decimal
sum of 56, 67, and the carry-in. The carry flag will be set by the Decimal Adjust instruction, in-
dicating 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 in-
itially 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: 1
Cycles:
Encoding:
Operation: DA
-contents of Accumulator are BCD
IF [[(A3-0) >9] V [(AC) = 1]]
THEN (A3-0).-(A3-0) + 6
AND
IF [[(A7-4) >9] V [(C) = 1]]
THEN (A7-4).-(A7-4) + 6
3-25 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
I"'lr-,... L. &_
1.11:"" uyn::
Function: Decrement
Description: The variable indicated is decremented by 1. 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.
Example: Register 0 contains 7FH (01111111B). Internal RAM locations 7EH and 7FH contain OOH and 40H,
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: I 0 0 0 1 1. 0 1 0 0 I
Operation: DEC
(A) ...... (A) - 1
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 11111011B) and B contains 18 (l2H or 0001001OB). The in-
struction,
DIV AB
will leave 13 in the accumulator (OOH or 00001101B) and the value 17 (lIH or 00010001 B) in B,
since 251 = (13 x 18) + 17. Carry and OV will both be cleared.
Bytes: 1
Cycles: 4
Operation: DIV
(A) 15-84- (A) / (B)
(B)7-0
DEC Rn
Bytes:
Cycles:
3-26 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
Encoding:
1
0 0 0 111 r r r
Operation: DEC
(Rn)...- (Rn) - 1
DEC direct
Bytes: 2
Cycles: 1
Encoding:
1
0 0 0 1I 0 1 0 11 direct address
Operation: DEC
(direct) +- (direct) - 1
DEC @Ri
Bytes:
Cycles:
Encoding:
10 0 0 11 0 1 1 i I
Operation: DEC
Ri..--Ri - 1
3-27 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
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 01H, 70H, and 15H, respectively.
The instruction sequence,
DJNZ 40H,LABEL_l
DJNZ 50H,LABEL~
DJNZ 60H,LABEL_3
will cause a jump to the instruction at label LABEL~ 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 instruc-
tion sequence,
MOV R2,#8
TOGGLE: CPL P1.7
DJNZ R2,TOGGLE
will toggle P1.7 eight times, causing four output pulses to appear at bit 7 of output port 1. 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) - 1
IF (Rn) > 0 or (Rn) < 0
THEN
(PC~(PC) + rei
DJNZ direct,rel
Bytes: 3
Cycles: 2
3-28 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
INC <byte>
Function: Increment
Descrip.tion: 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 (01 11 111 lOB). Internal RAM locations 7EH and 7FH contain OFFH and
40H, 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 (respectively) OOH
and 41H.
INC A
Bytes:
Cycles:
Encoding: I0 0 0 0 0 I 1 0 0
Operation: INC
(A).-(A) +
INC Rn
Bytes:
Cycles:
Encoding: I0 0 0 0 11 r r r
Operation: INC
(Rn) . - (Rn) +
INC direct
Bytes: 2
Cycles: 1
Encoding:
1
0 0 0 01 0 1 0 1 I I direct address
Operation: INC
(direct).-(direct) +
INC @Ri
Bytes:
Cycles:
Encoding: 10 0 0 0 0 I
Operation: INC
Ri.-Ri +
3-29 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
INC DPTR
Operation: INC
(DPTR).-(DPTR) + 1
JB bit,rel
Encoding: I 1 I 1
bit address I reI. address I
Operation: JB
(PC)~ (PC) + 3
IF (bit) = 1
THEN
(PC)"-(PC) + reI
3-30 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
JBC bit,rel
Encoding:
1
0 0 0 11 0 0 0 01 I bit address I reI. address I
Operation: JBC
(PC)~ (PC) +3
IF (bit) = 1
THEN
(bit)..-- 0
(PC)~(PC) + reI
JC rei
3-31 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
JMP @A+DPTR
JNB bit,rel
3-32 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
JNC rei
JNZ rei
Encoding: 0
_ _ _ _.....
1-1 1 ____-11 1 reI. address I
Operation: JNZ
(PC)~(PC) + 2
IF (A) ~
THEN
(PC)~(PC) + reI
3-33 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
JZ rei
Encoding: 1_o
..... ____
0...LI_o_o__o_o. . 1. reI. address I
Operation: JZ
(PC)~ (PC) + 2
IF (A) =
THEN (PC)~(PC) + rei
LCALL addr16
Encoding: 10
......__
0_0_--'-10__0_1_0.......1 addr 15 - addrS addr7 - addrO I
Operation: LCALL
(PC)~ (PC) + 3
(SP).-(SP) + 1
SP~ (PC7-0)
(SP).-(SP) + 1
SP1-( PC I5-S)
(PC).- addr I5-0
3-34 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
LJMP addr16
MOV <dest-byte>,<src-byte>
This is by far the most flexible operation. Fifteen combinations of source and destination address-
ing modes are allowed.
Example: Internal RAM location 30H holds 40H. The value of RAM location 40H is lOH. The data present at
input port 1 is 1lOO lO lOB (OCAH).
MaV RO,#30H ;RO<= 30H
MaV A,@RO ;A <= 40H
MaV Rl,A ;Rl < = 40H
MaV R,@Rl ;B <= lOH
MaV @Rl,Pl ;RAM (40H) <= OCAH
MaV P2,P! ;P2 #OCAH
leaves the value 30H in register 0, 40H in both the accumulator and register 1, lOH in register B, and
OCAH (llOOlOlOB) both in RAM location 40H and output on port 2.
MOV A,Rn
Bytes:
Cycles:
Encoding: 11 011 r r r I
Operation: Mav
(A)~(Rn)
MOV A,direct
Bytes: 2
Cycles: 1
3-35 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
MOV A,@R!
Bytes:
Cycles:
Encoding: 11 01 0 1 1 i I
Operation: MOV
(A) ' 4 - - Ri
MOV A,#data
Bytes: 2
Cycles: 1
Encoding:
10 11 0 1 0 01 1immediate data 1
Operation: MOV
(A)'-#data
MOV Rn,A
Bytes:
Cycles:
Encoding: I1 111 r r r I
Operation: MOV
(Rn)~(A)
MOV Rn,direct
Bytes: 2
Cycles: 2
Operation: MOV
(Rn).-(direct)
MOV Rn,#data
Bytes: 2
Cycles: 1
Encoding: I0 1I 1 r r r I immediate data
Operation: MOV
(Rn)~#data
MOV direct,A
Bytes: 2
Cycles: 1
Encoding:
I 1 1I 0 1 0 1I direct address I
Operation: MOV
(direct)~ (A)
MOV direct,Rn
Bytes: 2
Cycles: 2
Operation: Mav
(direct)~ (Rn)
MOV direct,direct
Bytes: 3
Cycles: 2
MOV direct,@Ri
Bytes: 2
Cycles: 2
Encoding: 11 1 I0 1 1 i I
Operation: Mav
Ri~(A)
MOV @Ri,direct
Bytes: 2
Cycles: 2
Operation: MaV
Ri~( direct)
MOV @Ri,#data
Bytes: 2
Cycles:
Operation: Mav
RI)~ #data
3-37 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
MOV <destbit>,<srcbit>
MOV bit,C
Bytes: 2
Cycles: 2
Encoding: 11 I
1 1 Ibit address
Operation: MOV
(bit) 4 - (C)
MOV DPTR,#data16
338 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
MOVC A,@A+<basereg>
Encoding: .....
1_l_0_0_----'I_O_O__l_-.J
Operation: MOVC
(A)~ A) + (DPTR
MOVC A,@A+ PC
Bytes: 1
Cycles: 2
Encoding: 11 0 0 I 0 1
Operation: MOVC
(PC)~(PC) +1
(A)~A) + (PC
3-39 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
In the first type, the contents of RO or RI 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 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 out-
puts the high-order eight address bits (the contents of DPH) while PO multiplexes the low-order
eight bits (DPL) with data. P2 retains the high-order bits; any data previously on P2 is lost. 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 the 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 RI.
Example: An external 256 byte RAM using mUltiplexed address/data lines (e.g., an Intel 8155
RAM/I/O/Timer) is connected to the '8051 Port O. Port 3 provides leontrol ones for the external
RAM. Ports 1 and 2 are used for normal I/O. Registers 0 and 1 contain 12H and 34H. Location
34H of the external RAM holds the value 56H. The instruction sequence,
MOVX A,@Rl
MOVX @RO,A
copies the value 56H into both the accumulator and external RAM location 12H.
MOVX A,@Ri
Bytes: 1
Cycles: 2
Encoding: 11 0 0 0 1
1
Operation: MOVX
(A).-Ri
MOVX A,@DPTR
Bytes: 1
Cycles: 2
Encoding: 11 01 0 0 0 01
Operation: MOVX
(A)-DPTR
MOVX @Ri,A
Bytes: 1
Cycles: 2
Encoding: 11 11 0 0 1
Operation: MOVX
Ri-(A)
3-40 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
MOVX @DPTR,A
Bytes: 1
Cycles: 2
Encoding: 11 1 1 1 I
Operation: MOVX
(DPTR..-- (A)
MUL A
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 pro-
duct is greater than 255 (OFFH) the overflow flag is set; otherwise it is cleared. The carry flag is
always cleared.
Example: Originally the accumulator holds the value 80 (50H). Register B holds the value 160 (OAOH). The in-
struction,
MUL AB
will give the product 12,800 (3200H), so B is changed to 32H (00110010B) and the accumulator is
cleared. The overflow flag is set, carry is cleared.
Bytes: 1
Cycles: 4
Operation: MUL
(B) 15-8"-- (A) X (B)
(A) 7-0
NOP
Function: No Operation
Description: Execution continues at the following instruction. Other than the PC, no registers or flags are af-
fected.
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: I I
Operation: NOP
(PC)~(PC) +1
3-41 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
The two operands allow six addressing mode combinations. When the destination is the ac-
cumulator, 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 RO holds 55H (01010101B) then the instruction,
.ORL A,RO
will leave the accumulator holding the value OD7H (11010111B).
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,#00I1001OB
will set bits 5,4, and 1 of output port 1.
ORL A,Rn
Bytes:
Cycles:
Operation: ORL
(A)"-(A) V (Rn)
ORL A,direct
Bytes: 2
Cycles: 1
Encoding:
1
0 0 01 0 i I
Operation: ORL
(A)~(A) V Ri
ORL A,#data
Bytes: 2
Cycles: 1
342 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
Operation: ORL
(A)'-(A) V #data
ORL direct,A
Bytes: 2
Cycles: 1
Encoding: 1_0
..... __0_0--'-1_0_0_1_0. . .1 1 direct address
Operation: ORL
(direct).-(direct) V (A)
ORL direct,#data
Bytes: 3
Cycles: 2
ORL C, <srcbit>
343 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
POP direct
Operation: POP
(direct).-- SP
(SP) ~(SP) - 1
PUSH direct
Operation: PUSH
(SP)'-(SP) + 1
SP.--(direct)
3-44 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
RET
Encoding: 1_o_o
.... __o_l,-o_O__I_0...J1
Operation: RET
(PC 15-8)'-((SP
(SP).-(SP) - 1
(PC 7-0)'-( (SP
(SP)~SP) - 1
RETI
Operation: RETI
(PCI5-8)~SP
(SP)~(SP) - i
(PC7 _O)~ SP
.(SP~(SP) - 1
3-45 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
Rl A
Function: Rotate accumulator Left
Description: The eight bits in the accumulator are rotated one bit to the left. Bit 7 is rotated into the bit 0 position. No
flags are affected.
Example: The accumulator holds the value OC5H (11000101B). The instruction,
RL A
leaves the accumulator holding the value 8BH (10001011B) with the carry unaffected.
Bytes: 1
Cycles: 1
Encoding: 10 0 1 010 0 1
Operation: RL
(An+ })~(An) n=0-6
(AO~(A7)
RLC A
Operation: RLC
(An + t)~ (An) n=0-6
(AO)~(C)
(C)'-(A7)
RR A
Encoding: I0 0 0 I
0 0 0 1
Operation: RR
(An)~(An + I) n=0-6
(A7)~(AO)
3-46 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
RRC A
Function: Rotate accumulator Right through Carry flag
Description: The eight bits in the accumulator and the carry flag are together rotated one bit to the right. Bit 0
moves into the carry flag; the original value of the carry flag moves into the bit 7 position. No other
flags are affected.
Example: The accumulator holds the value OC5H (11000101B), the carry is zero. The instruction,
RRC A
leaves the accumulator holding the value 62 (011000IOB) with the carry set.
Bytes: 1
Cycles: 1
Encoding: I0 0 0 I
1 0 0 1
Operation: RRC
(An)'-(An + I) n=0-6
(A7)~(C)
(C)..-(AO)
SETB <bit>
Encoding: 11 0 I
1 0 0 1 1 I
Operation: SETB
(C)~1
SETB bit
Bytes: 2
Cycles:
3-47 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
SJfv1P ial
(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 (OI23H-0102H) = 21 H. Put another
way, an SJMP with a displacement of OFEH would be a one-instruction infinite loop.)
Bytes: 2
Cycles: 2
SUBB A, <srcbyte>
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 immediate.
Example: The accumulator holds OC9H (11001001B), register 2 holds 54H (01010100B), and the carry flag is
set. The instruction,
SUBB A,R2
will leave the value 74H (01110100B) 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 star-
ting a single or multiple-precision subtraction, it should be explicitly cleared by a CLR C instruc-
tion.
348 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
SUBB A,Rn
Bytes:
Cycles:
Encoding: 11 0 0 1 11 r r r ]
Operation: SUBB
(A)..-(A) - (C) - (Rn)
SUBB A,direct
Bytes: 2
Cycles:
Encoding: 11 0 0 1 0 I i I
Operation: SUBB
(A)...--(A) - (C) - Ri
SU B B A,#data
Bytes: 2
Cycles: 1
SWAP A
Encoding: 11 1 0 0 I
0 1 0 0 I
Operation: SWAP
(A3-0)~(A7-4), (A7-4)~(A3-0)
3-49 AFN-01739A
MEMORY, ADDRESSING, INSTRUCTION SET
XCH A,<byte>
Encoding: 1...._1_ _0
__0-'-11__r_r_r--l
Operation: XCH
(A). (Rn)
XCH A,direct
Bytes: 2
Cycles: 1
Operation: XCH
(A)~Ri
XCHD A,@Ri
Encoding: 11 1 I
Operation: XCHD
(A3-0)~Ri3-0
3-50 AFN01739A
MEMORY, ADDRESSING, INSTRUCTION SET
XRL <destbyte>,<srcbyte>
The two operands allow six addressing mode combinations. When the destination is the ac-
cumulator, 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 (llOOOOIIB) and register 0 holds OAAH (lOlOlOlOB) then the in-
struction,
XRL A,RO
will leave the accumulator holding the value 69H (01 101001 B).
When the destination is a directly addressed byte, this instruction can complement combinations of
bits in any RAM location or hardware register. The pattern of bits to be complemented 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,#OOllOOOIB
will complement bits 5, 4, and 0 of output port 1.
XRL A,Rn
Bytes:
Cycles:
Encoding: ....
1_O____0---LI_l_r__r_r-J
Operation: XRL
(A)~(A) EB (Rn)
XRL A,direct
Bytes: 2
Cycles:
Encoding: I0 01 0 i I
Operation: XRL
(A)~(A) EB Ri
XRL A,#data
Bytes: 2
Cycles: 1
Operation: XRL
(A)~ (A) EB #data
XRL direct,A
Bytes: 2
Cycles:
Encoding: 0____0_11-__0_1_-11
1-1
1 direct address 1
Operation: XRL
(direct)..- (direct) EB (A)
XRL direct,#data
Bytes: 3
Cycles: 2
Operation: XRL
(direct)~ (direct) EB #data
3-52 AFN-01739A
I
I'
'I
Chapter 4
EXPANDED 8051 FAMILY
AFN-01739A
4-1
EXPANDED 8051 FAMILY
AFN-01739A
42
EXPANDED 8051 FAMILY
+5V
+ 5V
40
Vee P40 2
:~~ !~
P41 3
P42 4
D P1.2
P1.3 5
}I/O 8243
1/0
P43 5
P50 1
P1.4 6 EXPANDER P51 23
18 XTAL 2 P1.5 7
P52 22
P1.6 8
P1.7 P53 21
110
8051 11 P20 P60 20
9
8751 10 P21 P61 19
>----.----+1 RESET/VPD 9 P22 P62 18
8 P23 P63 17
7 13
PROG P70 14
31 _ P71
'------10-1 EAIVDD P72 ~~
P73
10
11
P3.0
P3.1
PO.O ;~
PO.1 37 1/0
12 P3.2
PO.2 36 The following software driver is required to
13 P3.3 Interface to the 8243.
PO.3 35
14 P3.4
PO.4 34 Mixing Parallel Output. Input. and
15 P3.5 Control Strobes on Port 2
PO.5 33
16 P3.6
PO.6 32 ;IN8243 INPUT DATA FROM AN 82431/0 EXPANDER
17 P3.7 PO.7
CONNECTED TO P23P20
P25 & P24 MIMIC CSI & PROG
P27P26 USED AS INPUTS
PORT TO BE READ IN ACC
AFN-01739A
4-3
EXPANDED 8051 FAMILY
+5V
40
Vee
-=
8051
8751
lo P~RT
31
RESETIVpo
EAIVOO
lo P0 RT
2
~~
lo
P3.0
12 P3.1
,{ 13
14
15
16
17
P3.2
P3.3
P3.4
P3.5
:~:~
P'1
RT
Additional Inputs
3 Serial 11 3 11
L-t-+---.::t 08 CD4014 In,...-----1"'"'6 08 CD4014
16
+5V Voo CMOS SHIFT REG. +5V 8 voo CMOS SHIFT REG.
8v~ v~
'-------------+-----------,---------4- - - - -- - - --
AFN-01739A
4-4
EXPANDED 8051 FAMILY
+5V
40
VCC
P1.0 1
lo
P1.1 2
P1.2 3
D P1.3 4
P0 RT
P1.4 5
1
P1.5 6
P1.6 7
P1.7 8
8051
= 8751 P2.0 21
lo
P2.1 22
RESETIVPO P2.2 23
P2.3 24
P2.4 25 P~RT
P2.5 26
31 _ P2.6 27
EAIVOO P2.7 28
10 P3.0 (RXO)
lo
11 P3.1 (TXO)
,,{
12 P3.2 (INTO)
13 P3.3 (INT1)
14 P3.4 (TO) POORT
15 P3.5 (T1)
16 P3.6 (WR)
17 P3.7 (RD)
29
Additional Outputs
L-f-+--~OATA
2 ~1~0______~2~OATA
+5V 16 VOO CD4094 +5V 16 VOO CD4094
8 Vss CMOS SHIFT REG. OE 15 8 Vss CMOS SHIFT REG. OE 15
AFN-01739A
45
+5V
[l:
+(20
Vee
~
GND
1,,,
Vee Vpp
112
L~
CE
r
40
Vee VSS
XTAL 1 P1.0 DIO DOO 1 A7
P1.1
P1.2
t=}
~
t=
DI1
DI2 8282
D01
D02
2
3
A6
A5
A8~
~
P1.3 DI3 D03 4 A4 A9~
P1.4 I/O D04 5 A3 m
XTAL 2 P1.5 ~
DI4
DI5 D05 ; A2
2716
A10 ~ ><
8031
8051
8751
P1.6
P1.7
~
~. .---
DI6
DI7
D06
D07
8 A1
Ao "z
P2.0
21
c
'- 9 P2.1
22
m
".. RESET/VPD P2.2
23
c
~}
.J:>,
m +5
805
8751,
IGND
P2.3
P2.4
co
o
for
P2.5 ~
STB 6E
110 U'I
31 _
EAIVDD
P2.6 ~
P2.7 ~.
t ~
"'T1
{~
P3.0
P3.1
(RXD)
(TXD)
PO.O 39
PO.1 38
1~ 00
3:
01
~ P3.2 (INTO) PO.2 ;~
11
13 02 r-
~ P3.3
I/O ~ P3.4
(fNT1)
(TO)
PO.3
PO.4 35
14
15
03
04
-<
--l P3.5 (T1) PO.5 34
16 05
~ P3.6 (WR) PO.6 33
17 06
_-17 P3.7 (AD) PO.? 32 07
ALE/PROG PSEN 6E
30
1 - - -
29
1
- - ---- ------------- - - - - -
120
-n
Z
I
+5V
[1-
I
~
+5V
I
~
+r:
124 118 l12 I
Vee Vss
~l
XTAL 1 P1.0 1 010 000 19 1 A7
~
23 '
PU ~ 2 011 001 18 2 A6 A8~
P1.2 ~ 3
012 8282 002 17 3 A5
4
A9~
t=J
003 16
P1.3 013 4 A4
m
~
5
P1.4
P1.5
~
6
014
015
004 15
~~
5
6
A3
M A10 r!L- ><
"Z
XTAL 2 7 005
7 A1
8031 ~~~
016
~. l>
P1.6
P1.7 ~ 017 12 8 AO 2732A An ~
8051
8751 P2.0 ~ c
9 P2.1
22 m
~
.....
'"
RESETIVPO P2.2
23
24
c
+5 B751. P2.3 Q)
~
~}
805
for
IGNO P2,4
26 STB OE
o(J'1
P2.5
~ .....
~
1/0
31 _ P2.6
EAlVoO P2.7 ~. ~
l>
;~
9
s:
{~
P3.0 (RXO) PO.O 00
~ P3.1 (TXO) PO.1 37 :~ 01
~ P3.2 (INTO) PO.2 36 02 r-
I/O
13
P3.3
~ P3,4
(INT1)
(TO)
PO.3 35
13
14 03
04
-<
POA 34
15 P3.5 (T1)
15
05
16 P3.6 (WR)
PO.5 33 16
.:E P3.7 (RO)
PO.6
PO.7
32 17 06
07
OElVpp
ALE/PROG PSEN
30 29 20
1 1
1 - - - - - - - -----------_._-
~
z
6
~
~ Figure 46. External Program Memory Using a 2732
EXPANDED 8051 FAMILY
+5V
-=
40 20
19 VCC VSS
XTAL 1 P1.0 1
P1.1 2
Jo
P1.2 3
CJ P1.3 4
P1.4 ~
18 XTAL 2 P1.5 7
P1.6 8
-= 8051
P1.7
8751 P2.0 ~~
9
}o
P2.1 23 + 5V GND
RESETIVPD
P2.2 24
P2.3 25 20
:~:: 26 PAO 21
31 _ P2.6 27 PA1 22
EA/VDD P2.7 28 PA2 23
PA3 24
,,{
10 P3.0 (RXD) PO.O 39 12 ADO PM 25
11 P3.1 (TXD) PO.1 38 13 AD1 PA5 26
12 P3.2 (INTO) PO.2 ;~ ~: AD2 PA6 27
13 P3.3 (INT1) PA7 28
14 P3.4 (TO) :~~ 35
16 AD3
17 AD4
15 P3.5 (T1) PO.5 34
18 AD5
16 P3.6 (WR) PO.6 33 8155 PCO 37
17 P3.7 (RO) _ _ PO.7 32 19 ~~~ 256 x 8 PC1 38
ALE/PROG PSEN RAM PC2 39
110
30 29 PC3 1
101M
PC4 2
9_ PC5 5
RD
10_
WR PBO 29
PB1 30
11 PB2 31
ALE
PB3 32
PB4 ~~
PB5 35
::~ 36
AFN01739A
48
EXPANDED 8051 FAMILY
EXTERNAL
2581-------1
2571-------1
2561-------1
255 +5V +5V GND GND
4095
I I I I
INTERNAL VCC VDD VSS CE
21 A8 PAO ~
0
PROGRAM
0
EXTERNAL
22 A9 PA1 ~
MEMORY DATA
23 A10 PA2 ~
MEMORY PA3 ~
+5V
PO.O
PA4 ~
PO.1
12 ADO PA5 ~
13 AD1 ~
[l 8755A PA6
PO.2 14 AD2 PA7 ~
PO.3 15 AD3 I/O
40 PO.4 16 AD4 ~
r
PBO
Vee VSS PO.5
XTAL 1 P1.0 PO.6
17 AD5 PB1 ~
18 AD6 ~
CJ
P1.1
P1.2 "-l
~
~
PO.? 19 AD?
PB2
PB3
PB4
~
~
t=J
P1.3 8 _
~
~
lOR PB5
P1.4
~
XTAL2 P1.5 iL- ~9 lOW
PB6
PB7 a-
P1.6 ~ _
P1.7 ~ RD
8051 ~ ALE
8751 P2.0 ~ 2_
9 22 CE
P2.1
RESETIVPD 23 RESET
P2.2
+5 V for 8751, P2.3 ~IIO
25 ~4 ~
[3
NC
16
NC
805 1, and GND P2.4
for 8031 P2.5 ~--,
31 _
EAIVDD
P2.6 ~IIO
P2.7 ~--1
+r 40
G,D
20
Vec VSS
39 ADO
{~
P3.0 (RXD) PO.O 12 ADO PAO ~
-1.lP3.1 (TXD) PO.1 38 AD1 13 AD1 PA1 lL
12 37 AD2
110
P3.2
::::::U (INTO) PO.2 14 AD2 PA2 ~
P3.3 (INT1) PO.3 36 AD3 15 AD3 PA3 ~
-.J4P3.4 (TO) PO.4 35 AD4 16 AD4 PA4 ~
-~ P3.5 (T1) P05 34 AD5 17 AD5 PA5 ~
16 P3.6 (WR) PO.6 33 AD6 18 AD6 8155 PA6 ~
,.--1Z P3.7 (AD) PO.7 32 AD7 19 AD7 PA7 ~
ALEIPROG PSEN
7 -
30 f29 101M
PCO a-
9 _ PC1 ~
RD PC2 ~
PC3 ~ 110
PC4 ~
10_
WR
PC5 ~
11
ALE
PBO ~
PB1 ~
PB2 ~
8- PB3 ~
For 8031 P2.4 should connect CE PB4 ~
to Pin 1 (CE) of 8755 PB5 ~
PB6 ~
CAN BE SUPPLIED BY
~ RESET 'i'iME"R TIMER PB7 ~
OUT IN
SYSTEM RESET OR PORT -
LINE OF 8051 .6 P
i
TIMER
AFN01739A
4-9
EXPANDED 8051 FAMILY
+5V
40
Vee
XTAL 1
CJ
8031
8051
-= 8751
RESET/VPD
+5V for 8751.
I/O
8051. and GND
for 8031
31 _
EA/VDD
10 P3.0
11 P3.1
,,{
12 P3.2
13 P3.3
14 P3.4
15 P3.5
16 P3.6
17 P3.7
29
+5V
40
Vee
1
Pl.0 2
Pl.1 3
P1.2 4
0 Pl.3 5
Pl.4 6
P1.5 7
P1.6 8
8031 PH
8051
-= 8751
RESETIVPD
+5V for 8751.
I/O
8051. and GND
for 8031
31 _
EAIVDD
10 P3.0
11 P3.1
I 12 P3.2
I 13 P3.3
I
I
I
I
I
I
"o{ 14
15
16
17
P3.4
P3.5
P3.6
P3.7
I
I Asynchronous
: Line
AFN-01739A
410
EXPANDED 8051 FAMILY
+5V
40
VCC
P1.0 1
P1.1 2
P1.2 3
D P1.3 4
P1.4 5
P1.5 6
P1.6 7
8051 P1.7 8
8751
P2.0 21
-= P2.1 22 I/O
RESET/VPD P2.2 23
P2.3 24
P2.4 25
OPEN P2.5 26
COLLECTOR
INVERTERS P2.6 27
+ 5V 31 -
DEVICE EAIVDD P2.7 28
1
10 P3.0 (RXD) PO.O 39
1/0-[ 11 P3.1 (TXD) PO.1 38
12 P3.2 (iNfO) PO.2 37
,,{
13 P3.3 (lNT1) PO.3 36
14 P3.4 (TO) PO.4 35
15 P3.5 (T1) PO.5 34
16 P3.6 (WR) PO.6 33
17 P3.7 (AD) PO.7 32
ALE/PROG
29
AFN-01739A
411
I
11
I
"
li,l
i
I
CHAPTER 5
8051 SOFTWARE ROUTINES
,
;BINBCD CONVERT 8BIT BINARY VARIABLE IN ACCUMULATOR
TO 3DIGIT PACKED BCD FORMAT.
HUNDREDS' PLACE LEFT IN VARIABLE 'HUND',
TENS' AND ONES' PLACES IN 'TENONE'.
,
HUND DATA 21H
TENONE DATA 22H
,
BINBCD: MOV B,#100 ;DIVIDED BY 100 TO
DIV AB ;DETERMINE NUMBER OF HUNDREDS
MOV HUND,A
MOV A,#10 ;DIVIDE REMAINDER BY TEN TO
XCH A,B ;DETERMINE NUMBER OF TENS LEFT
DIV AB ;TEN'S DIGIT IN ACC, REMAINDER IS
;ONE'S DIGIT
SWAP A
ADD A,B ;PACK BCD DIGITS IN ACC
MOV TENONE,A
RET
The divide instruction can also separate data in the ac- the digits can be processed individually. This example
cumulator into sub-fields. For example, dividing packed receives two packed BCD digits in the accumulator,
BCD data by 16 will separate the two nibbles, leaving separates the digits, computes their product, and returns
the high-order digit in the accumulator and the low- the product in packed BCD format in the accumulator.
order digit (remainder) in B. Each is right-justified, so
,
;MULBCD UNPACK TWO BCD DIGITS RECEIVED IN ACCUMULATOR,
FIND THEIR PRODUCT, AND RETURN PRODUCT
IN PACKED BCD FORMAT IN ACCUMULATOR
5-1
8051 SOFTWARE ROUTINES
iviUi..BCD: ..,,"
IYIVY
a U1nu
u,rr "I' ;D!V!DE !NPUT BY 16
DIV AB ;A & B HOLD SEPARATED DIGITS
;(EACH RIGHT JUSTIFIED IN REGISTER).
MUL AB ;A HOLDS PRODUCT IN BINARY FORMAT (0
;99 (DECIMAL) = 0 - 63H)
MOV B,#10 ;DIVIDE PRODUCT BY 10
DIV AB ;A HOLDS NUMBER OF TENS, B HOLDS
;REMAINDER
SWAP A
ORL A,B ;PACK DIGITS
RET
,
;SUBSTR SUBTRACT STRING INDICATED BY R1
FROM STRING INDICATED BY RO TO
PRECISION INDICATED BY R2.
CHECK FOR SIGNED UNDERFLOW WHEN DONE.
,
SUBSTR: CLR C ;BORROW =0.
SUBS1: MOV A,@RO ;LOAD MINUEND BYTE
SUBB A,@R1 ;SUBTRACT SUBTRAHEND BYTE
MOV @RO,A ;STORE DIFFERENCE BYTE
INC RO ;BUMP POINTERS TO NEXT PLACE
INC R1
DJNZ R2,SUBS1 ;LOOP UNTIL DONE
JNB OV,OV_OK
(OVERFLOW RECOVERY ROUTINE)
OVOK: RET ;RETURN
5-2 AFN-01739A
8051 SOFTWARE ROUTINES
(lNDEXI, INDEXl) is determined by the formula, the assembly object code as part of the accessing
subroutine itself.
Entry Address = [BASE + (NDIMEN x INDEXI) +
INDEXl]
To handle the more general case, subroutine MATRX2
The subroutine MATRXI can access an entry in any ar- allows tables to be unlimited in size, by combining the
ray with less than 255 elements (e.g., an 11x21 array MUL instruction, double-precision addition, and the
with 231 elements). The table entries are defined using data pointer-based version of MOVe. The only restric-
the Data Byte ("DB") directive, and will be contained in tion is that each index be between 0 and 255.
,
;MATRX1 LOAD CONSTANT READ FROM TWO DIMENSIONAL LOOKUP
TABLE IN PROGRAM MEMORY INTO ACCUMULATOR
USING LOCAL TABLE LOOKUP INSTRUCTION, 'MOVC A,@A+PC'.
THE TOTAL NUMBER OF TABLE ENTRIES IS ASSUMED TO
BE SMALL, I.E. LESS THAN ABOUT 255 ENTRIES.
TABLE USED IN THIS EXAMPLE IS 11 x 21.
DESIRED ENTRY ADDRESS IS GIVEN BY THE FORMULA,
INC A
MOVC A,@A+PC
RET
BASE1: DB 1 ;(entry 0,0)
DB 2 ;(entry 0,1)
DB 21 ;(entry 0,20)
DB 22 ;(entry 1,0)
DB 42 ;(entry 1,20)
53
8051 SOFTWARE ROUTINES
DB 0 ;(entry 0, NDIMEN1)
DB 0 ;(entry 1,0)
DB 0 ;(entry 1, NDIMEN1)
,
LOC_TMP EQU $ ;REMEMBER LOCATION COUNTER
5-4 . AFN01739A
8051 SOFTWARE ROUTINES
1FH
For example, the subroutine HEXASC converts a hex-
adecimal value to ASCII code for its low-order digit. It
first reads a parameter stored on the stack by the calling OOH
The background program may reach this subroutine be needed until later. The example below converts the
with several different calling sequences, all of which three-digit BCD value computed in the Radix Conver-
PUSH a value before calling the routine and POP the sion example above to a three-character string, calling a
result to any destination register or port later. There is subroutine SP _OUT to output an eight-bit code in the
even the option of leaving a value on the stack if it won't accumulator.
5-5 AFN-01739A
8051 SOFTWARE ROUTINES
PUSH HUND
CALL HEXASC ;CONVERT HUNDREDS DIGIT
POP ACC
CALL SP_OUT ;TRANSMIT HUNDREDS CHARACTER
PUSH TENONE
CALL HEXASC ;CONVERT ONE'S PLACE DIGIT
;BUT LEAVE ON STACK!
MOV A, TENONE
SWAP A ;RIGHTJUSTIFY TEN'S PLACE
PUSH ACC ;CONVERT TEN'S PLACE DIGIT
CALL HEXASC
POP ACC
CALL SP_OUT ;TRANSMIT TEN'S PLACE CHARACTER
POP ACC
CALL SP_OUT ;TRANSMIT ONE'S PLACE CHARACTER
NWay Branching
There are several different means for branching to sec- execution. The instruction adds the eight-bit unsigned
tions of code determined or selected at run time. (The accumulator contents with the contents of the sixteen-
single destination addresses incorporated into condi- bit data pointer, just like MOVe A,@A+ DPTR. The
tional and unconditional jumps are, of course, fixed at resulting sum is loaded into the program counter and is
assembly time.) Each has advantages for different ap- used as the address for subsequent instruction fetches.
plications. Again, a sixteen-bit addition is performed: a carry-out
from the low-order eight-bits may propagate through
In a typical N-way branch situation, the potential the higher-order bits. In this case, neither the ac-
destinations are generally known at assembly time. One cumulator contents nor the data pointer is altered.
of a number of small routines is selected according to
the value of an index variable determined while the pro- The example subroutine below reads a byte of RAM in-
gram is running. The most efficient way to solve this to the accumulator from one of four alternate address
problem is with the MOVe and an indirect jump in- spaces, as selected by the contents of the variable
struction, using a short table of offset values in ROM to MEMSEL. The address of the byte to be read is deter-
indicate the relative starting addresses of the several mined by the contents of RO (and optionally Rl). It
routines. might find use in a printing terminal application, where
four different model printers all use the same ROM
JMP @A+ DPTR is an instruction which performs an code but use different types (and sizes) of buffer
indirect jump to an address determined during program memory for different speeds and options.
,
MEMSEL EQU R3
,
JUMP_4: MOV A,MEMSEL
MOV DPTR,#JMPTBL
MOVC A,@A+DPTR
JMP @A+DPTR
JMPTBL: DB MEMSPOJMPTBL
DB MEMSP1JMPTBL
DB MEMSP2JMPTBL
DB MEMSP3JMPTBL
MEMSPO: MOV A,@RO ;READ FROM INTERNAL RAM
RET
MEMSP1: MOVX A,@RO ;READ 256 BYTE EXTERNAL RAM
RET
MEMSP2: MOV DPL,RO ;READ 64K BYTE EXTERNAL RAM
MOV DPH,R1
MOVX A,@DPTR
RET
5-6 AFN01739A
8051 SOFTWARE ROUTINES
To use this approach, the size of the jump table plus the For applications where up to 128 destinations must be
length of the alternate routines must be less than 256 selected, all residing in the same 2K page of program
bytes. The jump table and routines may be located memory, the following technique may be used. In the
anywhere in program memory and are independent of printing terminal example, this sequence could process
256-byte program memory pages. 128 different codes for ASCII characters arriving via the
80S! serial port.
,
OPTION EOU R3
AJMP PROC7E
AJMP PROC7F
The destinations in the jump table (PROCOO-PROC7F) handled by computing the destination address at run-
are not all necessarily unique routines. A large number time with standard arithmetic or table look-up instruc-
of special control codes could each be processed with tions, then performing an indirect branch to that ad-
their own unique routine, with the remaining printing dress. There are two simple ways to execute this last
characters all causing a branch to a common routine for step, assuming the 16-bit destination address has
entering the character into the output queue. already been computed. The first is to load the address
into the DPH and DPL registers, clear the accumulator
and branch using the JMP @A + DPTR instruction; the
Computing Branch Destinations
second is to push the destination address onto the stack,
at Run Time
low-order byte first (so as to mimic a call instruction)
In some rare situations, 128 options are insufficient, the then pop that address into the PC by performing a
destination routines may cross a 2K page boundary, or a return instruction. This also adjusts the stack pointer to
branch destination is not known at assembly time (for its previous value. The code segment below illustrates
whatever reason), and therefore cannot be easily includ- the latter possibility.
ed in the assembled code. These situations can all be
RTEMP EOU R7
5-7 AFN01739A
8051 SOFTWARE ROUTINES
,
ADRTBl: OW PROCOO ;UP TO 256 CONSECUTIVE DATA
OW PROC01 ;WORDS INDICATING STARTING ADDRESSES
OW PROCFF
In-line-Code Parameter-Passing
Parameters can be passed by loading appropriate variable in internal RAM and stores the sum in a dif-
registers with values before calling the subroutine. This ferent two-byte buffer. The utility must be given the
technique is inefficient if a lot of the parameters are constant and both buffer addresses. Rather than using
constants, since each would require a separate register four working registers to carry this information, all four
to carry it, and a separate instruction to load the register bytes could be inserted into program memory each time
each time the routine is called. the utility is called. Specifically, the calling sequence
below invokes the utility to add 1234 (decimal) with the
If the routine is called frequently, a more code-efficient string at internal RAM address 56H, and store the sum
way to transfer constants is "in-line-code" parameter- in a buffer at location 78H.
passing. The constants are actually part of the program
code, immediately following the call instruction. The The ADDBCD subroutine determines at what point the
subroutine determines where to find them from the call was made by popping the return address from the
return address on the stack, and then reads the stack into the data pointer high- and low-order bytes. A
parameters it needs from program memory. MOVC instruction then reads the parameters from pro-
gram memory as they are needed. When done, ADD-
For example, assume a utility named ADDBCD adds a BCD resumes execution by jumping to the instruction
16-bit packed-BCD constant with a two-byte BCD following the last parameter.
CAll ADDBCD
OW 1234H ;BCD CONSTANT
DB 56H ;SOURCE STRING ADDRESS
DB 78H ;DESTINATION STRING ADDRESS
;CONTINUATION OF PROGRAM
58 AFN-01739A
8051 SOFTWARE ROUTINES
This example illustrates several points: pushed these registers onto the stack (after popping
the parameter list starting address), and popped
1) The "subroutine" does not end with a normal return before returning.
statement; instead, an indirect jump relative to the
data pointer returns execution to the first instruc- Passing parameters through in-line-code can be used in
tion following the parameter list. The two initial conjunction with other variable passing techniques.
POP instructions correct the stack pointer contents.
The utility can also get input variables from working
2) Either an ACALL or LCALL works with the registers or from the stack, and return output variables
subroutine, since each pushes the address of the to registers or to the stack.
next instruction or data byte onto the stack. The
call may be made from anywhere in the full 8051 PERIPHERAL INTERFACING
address space, since the MOVC instruction accesses
TECHNIQUES
all 64K bytes.
1/0 Port Reconfiguration (First Approach)
3) The parameters passed to the utility can be listed in
whatever order is most convenient, which may not 110 ports must often transmit or receive parallel data in
be that in which they're used. The utility has essen- formats other than as eight-bit bytes. For example, if an
tially "random access" to the parameter list, by application requires three five-bit latched output ports
loading the appropriate constant into the ac- (called X, Y, and Z), these "virtual" ports could be
cumulator before each MOVC instruction. mapped onto the pins of "physical" ports 1 and 2 as
shown below:
4) Other than the data pointer, the whole calling and
processing sequence only affects the accumulator,
PSW and pointer registers. The utility could have
PZO PZI PZ2 PZ3 PZ4 PY4 PY3 PY2 PYI PYO PX4 PX3 PX2 PXI PXO
P2.7 P2.6 P2.5 P2.4 P2.3 P2.2 P2.I P2.0 Pl.7 Pl.6 Pl.5 PIA Pl.3 Pl.2 PI.I PI.O
59 AFN-01739A
8051 SOFTWARE ROUTINES
Notice that the bits of port Z are reversed. The highest- Writing to the virtual ports must not affect any other
order port Z pin corresponds to pin P2.2, and the pins. Since the virtual output aigorithms are non-trivial,
lowest-order pin of port Z is P2.6, due to P.e. board a subroutine is needed for each port: OUT_PX,
layout considerations. When connecting an 8051 to an OUT_PY and OUT_PZ. Each is called with data to
immediately adjacent keyboard column decoder or output right-justified in the accumulator, and any data
another device with weighted inputs, the corresponding in bits ACe.7-ACC.5 is insignificant. Each subroutine
pins may not be aligned. The interconnections must be saves the data in a "map" variable for the virtual port,
"scrambled" to compensate either with interwoven then calls other subroutines which use the data in the
circuit board traces or through software (as shown various map bytes to compute and output the eight-bit
below). pattern needed for each physical port affected.
,
OUT_P1: MOV A,PY_MAP ;OUTPUT ALL P1 BITS
SWAP A
RL A ;SHIFT PY_MAP LEFT 5 BITS
ANL A,#11100000B ;MASK OUT GARBAGE
ORL A,PX_MAP ;INCLUDE PX_MAP BITS
MOV P1,A
RET
,
OUT_P2: MOV C,PZ_MAP.O ;LOAD CY WITH P2.6 BIT
RLC A ;AND SHIFT INTO ACC.
MOV C,PZ_MAP.1 ;LOAD CY WITH P2.5 BIT
RLC A ;AND SHIFT INTO ACC.
MOV C,PZ_MAP.2 ;LOAD CY WITH P2.4 BIT
RLC A ;AND SHIFT INTO ACC.
MOV C,PZ_MAP.3 ;LOAD CY WITH P2.3 BIT
RLC A ;AND SHIFT INTO ACC.
MOV C,PZ_MAP.4 ;LOAD CY WITH P2.2 BIT
RLC A ;AND SHIFT INTO ACC.
MOV C,PZ_MAP.4 ;LOAD CY WITH P2.1 BIT
RLC A ;AND SHIFT INTO ACC.
MOV C,PZ_MAP.3 ;LOAD CY WITH P2.0 BIT
RLC A ;AND SHIFT INTO ACC.
SETB ACC.7 ;(ASSUMING INPUT ON P2.7)
MOV P2.A
RET
The two level structure of the above subroutines can be corresponding ACALL instructions. OUT_PY would
modified somewhat if code efficiency and execution not be changed, but now the destinations for its
speed are critical: incorporate the code shown as ACALL instructions would be alternate entry points in
subroutines OUT_PI and OUT_P2 directly into the OUT_PX and OUT_PZ, instead of isolated
code for OUT_PX and OUT_PZ, in place of the subroutines.
5-10 AFN01739A
8051 SOFTWARE ROUTINES
,
OUT PZ: RRC A ;MOVE ORIGINAL ACC.O INTO CY
MOV P2.6,C ;AND STORE TO PIN P2.6.
RRC A ;MOVE ORIGINAL ACC.1 INTO CY
MOV P2.S,C ;AN D STORE TO PIN P2.S.
RCC A ;MOVE ORIGINAL ACC.2 INTO CY
MOV P2.4,C ;AND STORE TO PIN P2.4.
RRC A ;MOVE ORIGINAL ACC.3 INTO CY
MOV P2.3,C ;AND STORE TO PIN P2.3.
RRC A ;MOVE ORIGINAL ACC.4 INTO CY
MOV P2.2,C ;AND STORE TO PIN P2.2.
RET
8243 Interfacing
The 8051's quasi-bidirectional port structure lets each Even though the 8051 does not include 8048-type
110 pin input data, output data, or serve as a test pin or instructions for interfacing with an 8243, the parts can
output strobe under software control. An example of be interconnected and the protocol may be emulated
these modes operating in conjunction is the host- with simple software; see Figure 5.2.
processor interface expected by an 8243 110 expander.
5-11 AFN-01739A
8051 SOFTWARE ROUTINES
,
;IN8243 INPUT DATA FROM AN 8243 I/O EXPANDER
CONNECTED TO P23P20.
P25 & P24 MIMIC CS &PROG.
P27P26 USED AS INPUTS. CODE FOR
PORT TO BE READ IN ACC.1ACC.0
,
PROG BIT P2.4 ;SYMBOLIC PIN DESCRIPTION
,
IN8243: ORL A,#11010000B ;SET PROG AND PINS USED AS INPUT
MOV P2,A ;OUTPUT PORT CODE AND OPERATION CODE
CLR PROG ;LOWER PROG TO LATCH ADDRESS
ORL P2,#00001111 B ;SET LOW ORDER PINS FOR INPUT
MOV A,P2 ;READ IN PORT DATA
ORL P2,#00110000B ;SET PROG AND CS HIGH
CLR WR
MOV R2,#24
DJNZ $2,$
SETB WR
P2.5 cs P5
Configuring the 8051's Serial Port for a given data rate P2.4 PROG
and protocol requires essentially three short sections of
software. On power-up or hardware reset the serial port P2.3 P23 P&
P2.2 P22
and timer control words must be initialized to the P2.1 P21
appropriate values. Additional software is also needed P2.0 P20 P7
in the transmit routine to load the serial port data
register and in the receive routine to unload the data as
it arrives. Figure 52. Connecting an 8051 with an 8243
1/0 Expander
To choose one arbitrary example, assume the 8051
should communicate with a standard CRT operating at
2400 baud (bits per second). Each character is the output software know the output register is
transmitted as seven data bits, odd parity, and one stop available. All this can be set up with instruction at label
bit. The resulting character rate is 2400 baud/9bits, SPINIT.
approximately 265 characters per second.
Timer 1 will be used in auto-reload mode as a baud rate
For the sake of clarity, the transmit and receive generator. To achieve a data rate of 2400 baud, the
subroutines here are driven by simple-minded software timer must divide the IMHz internal clock by
status polling code rather than interrupts. The serial
port must be initialized to 8-bit UART mode (SMO, 1 x 106
SMI = 01), enabled to receive all messages (SM2=0, (32) (2400)
REN = 1). The flag indicating that the transmit register
is free for more data will be artificially set in order to let which equals 13 (actually, 13.02) instruction cycles. The
512 AFN01739A
8051 SOFTWARE ROUTINES
,
;SP_OUT ADD ODD PARITY TO ACC AND
TRANSMIT WHEN SERIAL PORT READY.
,
SP_OUT: MOV C,P
CPL C
MOV ACC.7,C
JNB TI,$
CLR TI
MOV SBUF,A
RET
5-13 AFN-01739A
8051 SOFTWARE ROUTINES
CALL XSTRING
DB CR,LF ;NEW LINE
DB 'INTEL DELIVERS' ;MESSAGE
DB ESC ;ESCAPE CHARACTER
(CONTINUATION OF PROGRAM)
,
XSTRING: POP DPH ;LOAD DPTR WITH FIRST CHARACTER
POP DPL
XSTR_1: CLR A ;(ZERO OFFSET)
MOVC A,@A+DPTR ;FETCH FIRST CHARACTER OF STRING
XSTR_2: JNB TI,$ ;WAIT UNTIL TRANSMITTER READY
CLR TI ;MARK AS NOT READY
MOV SBUF,A ;OUTPUT NEXT CHARACTER
INC DPTR ;BUMP POINTER
CLR A
MOVC A,@A+DPTR ;GET NEXT OUTPUT CHARACTER
CJNE A,#ESC,XSTR_2 ;LOOP UNTIL ESCAPE READ
MOV A,#1
JMP @A+DPTR ;RETURN TO CODE AFTER ESCAPE
,
CHAR EaU R7 ;CHARACTER CODE VARIABLE
514 AFN-01739A
8051 SOFTWARE ROUTINES
The interrupt routine DQUEUE is invoked when the fer (SBUF) and the pointers are updated. If not,
transmitter is ready for another character. First it deter- DQUEUE disables serial port interrupts and returns to
mines if any characters are available for transmission, the background program. ENTERQ will re-enable such
indicated by QHEAD and QT AIL being not equal. If interrupts as more data is available. (This example does
more data is available, it is written to the transmit buf- not consider interrupt-driven serial input.)
ORG 0023H
PUSH ACC ;SAVE CPU STATUS
PUSH PSW
MOV PSW,#30Q ;SELECT BANK 3
DQUEUE: MOV A,QTAIL
CJNE A,QHEAD,DQ_1 ;TEST IF QUEUE EMPTY
CLR ES ;IF SO, CLEAR ENABLE BIT AND RETURN
SJMP TI_RET
515 AFN-01739A
8051 SOFTWARE ROUTINES
5-16 AFN01739A
8051 SOFTWARE ROUTINES
5-17 AFN01739A
8031/8051/8751
SINGLE-COMPONENT 8-BIT MICROCOMPUTER
The Intel 8031/8051/8751 is a stand-alone, high-performance single-chip computer fabricated with Intel's highly-reliable
+ 5 Volt, depletion-load, N-Channel, silicon-gate HMOS technolgy and packaged in a40-pin DIP.lt provides the hardware
features, architectural enhancements and new instructions that are necessary to make it a powerful and cost effective
controller for applications requiring up to 64K bytes of program memory and/or up to 64K bytes of data storage.
The 8051/8751 contains a non-volatile 4K x 8 read only program memory; a volatile 128 x 8 read/write data memory; 32110
Iines; two 16-bit timer/counters; a five-source, two-priority-Ievel, nested interrupt structure; a serial 110 port foreither multi-
processor communications, I/O expansion, or full duplex UART; and on-chip oscillator and clock circuits. The 8031 is in-
dentical, except that it lacks the program memory. For systems that require extra capabi lity, the 8051 can be expanded us-
ing standard TTL compatible memories and the byte oriented MCS-80 and MCS-85 peripherals.
The 8051 microcomputer, like its 8048 predecessor, is efficient both as a controller and as an arithmetic processor. The
8051 has extensive facilities for binary and BCD arithmetic and excels in bit-handling capabilities. Efficient use of pro-
gram memory results from an instruction set consisting of 44 % one-byte, 41 % two-byte, and 15% three-byte instructions.
With a 12 MHz crystal, 58% of the instructions execute in 1 ).IS, 40% in 2).1s and multiply and divide requireonly4 ).Is. Among
the many instructions added to the standard 8048 instruction set are multiply, divide, subtract and compare.
FREQUENCY
REFERENCE
-1
I
I
'--~--' ,
I
,
""-----'""---.',
I
.........--,--' I
r RXD
TXO~__
;:=: ;
t w-
L n __ AD
TO--. ~
PARALLEL PORTS,
ADDRESS/DATA BUS,
AND 1/0 PINS
SERIAL
IN
SERIAL
OUT t WA4-
RD4-
Intel Corporalion Assumes No Responsibilily for the Use of any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied.
INTELCORPORATION,1980
6-1
8031/8051/8751
6-2
inter 8031/8051/8751
VIH3 Input High Voltage (VpD) 4.5 5.5 V Power Down Only
(VCC = 0)
VOH1 Output High Voltage (ALE and PSEN, 2.4 V IOH:= -400 tJA
Port 0 In External Bus Mode)
ILO Pullup Resistor Current (P1, P2, P3) -500 tJA .45V5. VIN 5.VCC
6-3
8031/8051/8751
A.C. CHARACTER!ST!CS
TA = OC TO 70C; VCC=5V5% Port 0, ALE and PSEN Outputs - CL = 150 PF;
All Other Outputs - CL = 80PF
6-4
8031/8051/8751
OSC
ALE
PSEN
RD, WR
ADDRESS OR
PORT 2
SFR P2
PORT 0 FLOAT
ALE
PSEN
TRLRH
RD ~
ALE
PSEN
- TWLWH
WR ~
ADDR ESS OR
PORT 2 ADDRESS A1S-AS
SFR P2
TAVWL
TOVWH TWHOX--1
6-5
8031/8051/8751
2.4
V 2.0 _2.0V
0.45
_______ ~A 0.8::' TEST POINTS - 0.8_ A"--_______
-
PROGRAM VERIFY
\~--1
PORT 27
r--+
PORT 1017 ADDRESS ADDRESS ADDRESS. 1
TAVPL "I" -\
ADDRESS
R- TPHAX TAvav
ADDRESS ADDRESS T 1
;,---------..~~T_EHaz _
-------------~\
I" ~ I" TPLPH
~~----------------------------------------
PROG/ALE ~
_V_DD_/E_A_ _ _ _ T_V_HP_L_~_p_PJ"~ ~ ~~ __
TP_H_V_L_____________________________________________
6-6
8021
SINGLE COMPONENT 8-BIT MICROCOMPUTER
P22 VCC
PORT P23
XTAL \ P21
Jt()
PROG P20
PORT POO P1l
#1 POl P16
RESET P02 P15
PORT
P03 P14
#2
TEST P04 P13
ADDRESS P05 P12
LATCH P06 P11
ENABLE
POl P10
PORT ALE RESET
EXPANDER Tl XTAL 2
STROBE
VSS XTAL 1
Intel Corporation Assumes No Responsibility for the Use of any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied
INTELCORPORATION,1980 7-1 AFNQ1567AQ1
8021
ABSOLUTE MAXiiViUiVi RATINGS *i"}OTiCE: Stres,ses a.bova t"1ose listed under ",4bso!ute
Maximum Ratings" may cause permanent damage to the
Ambient Temperature Under Bias. . . . . . .. 0 C to 70 C
device. This is a stress rating only and functional opera-
Storage Temperature ............... -65C to +150C tion of the device at these or any other conditions above
those indicated in the operational sections of this specifi-
Voltage on Any Pin with cation is not implied. Exposure to absolute maximum
Respect to Ground .................... -0.5V to +7V rating conditions for extended periods may affect device
Power Dissipation .............................. 1 W reliability.
T1 ZERO CROSS CHARACTERISTICS TA:;;: ooe to 70C, Vcc:;;: 5.5V 1V, VSS:;;: OV, CL = SOpF
ADD A,R r Add register to A 1 1 6S-6F JMP addr Jump unconditional 2 2 04,24,44,64,
ADD A,@R Add data memory to A 1 1 60-61
ADD A,#data
Add immediate to A 2 2 03 JMPP @ A Jump indirect 1 2 B3
ADDC A,R rAdd register with carry 1 1 7S-7F J:. DJNZ R,ro addr Decrement register and 2 2 ES-EF
ADDC A,@R Add data memory with 1 1 70-71 g jump on R not zero
III
carry ~ JC addr Jump on carry= 1 2 2 F6
ADDC A,#data Add immediate with 2 2 13 JNC addr Jump on carry=O 2 2 E6
carry JZ addr Jump on A zero 2 2 C6
ANL A,R r And register to A 1 1 5S-5F JNZ addr Jump on A not zero 2 2 96
ANL A,@R And data memory to A 1 1 50-51 JT1 addr Jump on Tl=1 :2 2 56
ANL A,#data And immediate to A 2 2 53 JNT1 addr Jump on T1=0 2 2 46
ORL A,R r Or register to A 1 1 4S-4F JTF addr Jump on timer flag 2 2 16
C5 ORL A,@R Or data memory to A 1 1 40-41
~ ORL A,#data Or immediate to A
:s
XRL A,R r Exclusive Or register
2
1
2
1
43
DS-DF ~e CALL addr Jump to subroutine 1 2 14,34,54,74
~
XRL A,@R
to A
Exclusive Or data 1 1 DO-Dl
-g
rn
RET Return 1 2 S3
memory to A til
97
CI CLR C Clear carry 1 1
XRL A,#data Exclusive Or immediate 2 2 03 III
Complement carry 1 A7
Li: CPL C 1
to A
INC A Increment A 1 1 17 MOV A,R r Move register to A 1 r FS-FF
DEC A Decrement A 1 1 07 MOV A,@R Move data memory to A 1 1 FO-Fl
CLR A Clear A 1 1 27 MOV A,#data Move immediate to A 2 2 23
CPL A Complement A 1 1 37 MOV Rr,A Move A to register 1 t AS-AF
DA A Decimal adjust A 1 1 57 MOV@ R,A Move A to data memory 1 1 AO-Al
SWAP A Swap nibbles of A 1 1 47 MOV Rr,#data Move immediate to 2 2 B8-BF
RL A Rotate A left 1 1 E7 til
register
RLC A Rotafe A left through 1 1 F7 ~
0 MOV@R,#data Move immediate to 2 2 BO-B1
carry ::E
co data memory
RR A Rotale A right 1 1 77 III XCH A,R, Exchange A and 1 1 2S-2F
RRC A Rotate A right through 1 1 67
c
register
carry XCH A,@R Exchange A and data 1 1 20-21
memory
IN A, Pp Input port to A 1 2 OS,09,OA
XCHDA,@R Exchange nibble of A 1 1 30-31
'S OUTLPpA Output A to port 1 '2 90,39,3A
and register
~ MOVD A,P p Inpu~ expander port 1 2 OC-OF
MOVP A,@A Move to A from current 1 2 A3
e'S MOVD Pp,A
to A
Output A to expander 1 2 3C-3F
page
CI.
.E port
~
ANLD Pp.A And A to expander port 1 2 9C-9F MOV A,T Read timer I counter 1 1 42
ORLD Pp.A Or A to expander port 1 2 SC-SF 0
MOV T,A Load timer I counter 1 1 62
~ STRT T Start timer 1 1 55
til iii STRT CNT Start counter 1 1 45
~ INC Rr Increment register 1 l lS-1F E
i= STOP TCNT Stop timer I counter 1 1 65
': INC@R Increment sata memory 1 1 ttl-l1
IX:
Nap No operation 1 1 00
8021L
SINGLE COMPONENT 8-BIT MICROCOMPUTER
LOW POWER 10mA
21 I/O Lines
Single 5V Supply (+4.5V to 8V)
Interval Timer/Event Counter
8.38 J..Lsec Cycle With 3.58 MHz XTAL;
All instructions 1 or 2 Cycles orClock Generated With Single Inductor
Crystal
The 8021 L contains 1 K X 8 program memory, a 64 X 8 data memory, 21 1/0 lines, and an 8-bit timerlevent
counter, in addition to on-board oscillator and clock circuits. For systems that require extra 1/0 capability, the
8021 L can be expanded using the 8243 or discrete logic.
This microprocessor is designed to be an efficient controller as well as an arithmetic processor. The 8021 L has
bit handling capability as well as facilities for both binary and BCD arithmetic. Efficient use of program
memory results from an instruction set consisting mostly of single byte instructions and no instructions over
two bytes in length.
To minimize the development problems and maximize flexibility, an 8021 L system can be easily designed using
the 8021 L emulation board, the EM-1. The EM-1 contains a 40-pin socket which can accommodate either the
8748 shipped with the board or an ICE-49 plug. Also, the necessary discrete logic to reproduce the 8021 L's
additional 1/0 features is included.
P22 VCC
PORT P23
XTAL\ P21
#Q
PROG P20
PORT POD P17
#1 POl P16
RESET P02 P15
PORT
P03 P14
#2
TEST P04 P13
ADDRESS P05
LATCH P06 Pll
ENABLE P07 Pl0
PORT ALE RESET
EXPANDER T1 XTAL 2
STROBE
Vss XTAL 1
Intel Corporation Assumes No Responsibility for the Use of any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent licenses are Implied.
INTELCORPORATION,1980 7-4 AFN-01813A-Ol
8021L
ABSOLUTE MAXIMUM RATINGS 'NOTICE: Stresses above those listed under "Absolute
Ambient Temperature Under Bias OC to 70C Maximum Ratings" may cause permanent damage to the
Storage Tem perature -65 C to +150 C device. This is a stress rating only and functional opera-
Voltage on Any Pin with tion of the device at these or any other conditions above
Respect to Ground -0.5V to +7V those indicated in the operational sections of this specifi-
Power Dissipation. 1 W cation is not implied. Exposure to absolute maximum
rating conditions for extended periods may affect device
reliability.
7-5 AFN-01813A-02
8022
SINGLE COMPONENT a-BIT MICROCOMPUTER
WiTH ON-CHiP AID CONVERTER
8-Bit CPU, ROM, RAM, I/O in Single 40-Pin
Package
2K x 8 ROM, 64 x 8 RAM, 28 I/O Lines
On-Chip 8-Bit A/D Converter; Two Input 8.38 ~sec Cycle; All Instructions 1 or 2
Cycles
Channels
Vee
XTAL r PORTO
- - - THRESHOLD
REFERENCE P26
P27
Vee
P2S
AVec P24
~-:>PORT2 POl
P02
P1S
P14
AID P13
P03
REFERENCE
P04 P12
POS Pll
t t
AID
t
AID SUBSTRATE
Vee Vss
Figure 1. Figure 2. Figure 3. Pin
Block Diagram Logic Symbol Configuration
Intel Corporation Assumes No Responsibility for the Use of any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied.
INTELCORPORATION,1980 7-6 AFN-00187A-Ol
8022
+SV
}-,
25
P10
26
Pll
27
VAAEF P12
28
P13 [ INPUT]
AVec 29 AND
P14
30 OUTPUT
P1S
10-200"F 31
P16
32
P17
AVss
}-,
20 33
Vss
34
P21
1"F 8022 35
P22
36
P23 [ INPUT]
SUBST 38 AND
P24
39 OUTPUT
P2S
ANl
P26
P27
VTH
10
POO
},~o
XTALl 11
POl
12
1M P02
13
P03 [ INPUT]
14 AND
XTAL2 P04 OUTPUT
15
POS
16
T1 P06
17
1"F P07
7.7
8022
........ ~ ~.- . . . . " ft ......... "r-* "'''vOTiCE: Stresses above those listed undei "Absolute
AI:J~VLU I C MAAIMUM ""'. lI'fUo:J
Ambient Temperature Under Bias ....... 0 C to 70 C Maximum Ratings" may cause permanent damage to the
Storage Temperature ............... -65C to +150C device. This is a stress rating only and functional opera-
Voltage on Any Pin with tion of the device at these or any other conditions above
Respect to Ground .................... -0.5V to +7V those indicated in the operational sections of this specifi-
Power Dissipation ............................ 1 Watt cation is not implied. Exposure to absolute maximum
rating conditions for extended periods may affect device
reliability.
AFN-00187 A-Q3
8022
tLl ALE Pulse Width 3.9 23.0 j.1S tCy=8.38 J.Ls for min
Port 2 Timing
NORMAL OPERATION
--l I-- ILL
ALEr\ 1\
PORT
OUTPUT
:=x y--omy
IPL--j .-r I - I LP
ALEr\ 1\
PORT
INPUT
( DATA
X
I- IpRL
-I -1 r-
EXPANDER OPERATION
IPFL
ALE r\ 1\
PROG \ I
I- Ipp
-I
PORT
OUTPUT XC6~~JOLX X DATA
x:=
ICPi-r
I--IPC
IDPi
--r- ~lpD
ALE/\ 1\
PROG
\ I
PORT
INPUT XCb~nOL >---<: DATA
x==
'C'~L
--ll--IPF
IpR
~
7n
8022
AID CONVERTER CHARACTERISTICS TA =O"C io 70"C, vee = 5.5V 1V, Vss = av, AVec =5.5V 1V,
AVSS = OV, AVCC/2 ~ VAREF ~ AVCC
ALE
ANALOG
INPUT
NOTE
1. The analog input must be maintained at a constant voltage during the sample time (tss + t SH )'
7-10 AFN-00187A-05
8022
Hexadecimal Hexadecimal
Mnemonic Description Bytes Cycle Opcode Mnemonic Description Bytes Cycle Opcode
~
MOV A,T Read timer I counter 1 1 42
IN A, Pp Input port to A 1 2 08,09,OA MOV T,A Load timer / counter 1 1 62
0
::0
OUTL Pp.A Output A to port 1 2 90,39,3A
~ STRT T Start timer 1 1 55
MOVD A.Pp Input expander port 1 2 OC-OF ~ STRT CNT Start counter 1 1 45
~ to A E STOP TCNT Stop timer / counter 1 1 65
~
j::
MOVD Pp,A Output A to expander 1 2 3C-3F
port
~ ANLD Pp.A And A to expander port 1 2 9C-9F
! RAD Move conversion resuli 1 2 80
~
register to A
ORLD Pp.A Or A to expander port 1 2 8C-8F SEL ANO Select analog input 1 1 85
0
u zero
III
e SEL AN1 Select analog input one 1 1 95
~.~ INC Rr
INC@R
Increment register
Increment data memory
1
1
1
1
18-1F
10-11
oCt
EN I Enable external 1 1 05
a:
interrupt
DIS I Disable external 1 1 15
JMP addr Jump unconditional 2 2 04,24,44,64,
III interrupt
~
84,A4,C4,E4
EN TCNTI Enable timer! counter 1 1 25
JMPP@ A Jump indirect 1 2 B3
~
.l: interrupt
u DJNZ R,addr Decrement register and 2 2 E8-EF
c: DIS TCNT! Disable timer / counter 1 1 35
co jump on R not zero
cD JC addr interrupt
Jump on carry= 1 2 2 F6
RET I Return from interrupt 1 2 93
JNC addr Jump on carry=O 2 2 E6
JZ addr Jump on A zero 2 2 C6
NOP No operation 1 1 00
JNZ addr Jump on A not zero 2 2 96
7_11
8022H
HIGH PERFORMANCE
SINGLE COMPONENT 8-BIT MICROCOMPUTER
WITH ON-CHIP AID CONVERTER
8-Bit CPU, ROM, RAM, I/O in Single 40-Pin
Package
2K x 8 ROM, 64 x 8 RAM, 28 I/O Lines
On-Chip 8-Bit A/D Converter; Two Input 5 f1sec Cycle; All Instructions 1 or 2
Cycles (6 MHz Clock)
Channels
8Zero-Cross
Comparator Inputs (Port 0) IInstructions-8048 Subset
Single SV Supply
Detection Capability Clock
nterval Time/Event Counter
Two Interrupts-External
(4.SV to 6.SV) CrystalGenerated with Single Inductor or
and Timer
Easily Expanded I/O
The Intel@ S022H is designed to satisfy the requirements of low cost, high volume applications which involve
analog signals, capacitive touch panel keyboards, and/or large ROM space. The S022H addresses these
applications by integrating many new functions on-chip, such as A/D conversion, comparator inputs and
zero-cross detection.
The features of the S022H include 2K bytes of program memory (ROM), 64 bytes of data memory (RAM), 2S
I/O lines, an on-chip A/D converter with two input channels, an S-bit port with comparator inputs for
interfacing to low voltage capacitive touch panels or other non-TTL interfaces, external timer interrupts, and
zero-cross detection capability. In addition, it contains the S-bit interval timer/event counter, on-board
oscillator and clock circuitry, single 5V power supply requirement, and easily expandable I/O structure
common to all members of the MCS-4S family.
The S022H is designed to be an efficient controller as well as an arithmetic processor. It has bit handling
capability plus facilities for both binary and BCD arithmetic. Efficient use of program memory results from
using the MCS-4S instruction set which consists mostly of single byte instructions and has extensive
conditional jump and direct table lookup capability. Program memory usage is further reduced via the S022H's
hardware implementation of the A/D converter which simplifies interfacing to analog signals.
Vee Vss
XTAL r PORTO
- - THRESHOLD
REFERENCE P26
P27
Vee
P25
AVec P24
RESET _
=<> PORTO
VAREF
AN1
PROG
P23
P22
TEST ()..
~)PORT1
P21
P20
8022
VTH P17
TEST 1
po~ P16
~)PORT2 P15
P14
AID
P13
REFERENCE
P04 P12
P05 P11
ADDRESS P06 P10
-LATCH P07 RESET
ENABLE
ALE XTAL 2
T1 XTAL 1
Vss SUBST
AN1 PORT
--EXPANDER
STROBE
l l l
AID AID SU BSTRATE
Vee Vss
Figure 1. Figure 2. Figure 3. Pin
Block Diagram Logic Symbol Configuration
Intel Corporation Assumes No Responsibility for the Use of any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied.
INTELCORPORATION,1980 7.12 AFN01814A
S04SH/S04SH-1/S035HLlS035H L-1
HMOS SINGLE COMPONENT S-BIT MICROCOMPUTER
8BIT
Package
CPU, ROM, RAM, 110 in Single
64x
1Kx8 ROM
RAM
High Performance HMOS 27110 Lines
1.4 J,lsec and 1.9 J,lsec Cycle Versions
Reduced Power Consumption
Interval Timer/Event Counter
All Easily Expandable Memory and 110
Instructions 1 or 2 Cycles
Compatible with 8080/8085 Series
Over 90 Instructions: 70% Single Byte Peripherals
Two Single Level Interrupts
The Intel 8048H/8048H1/8035HU8035HL-1 are totally self-sufficient, 8-bit parallel computers fabricated on single
silicon chips using Intel's advanced N-channel silicon gate HMOS process.
The8048H containsa 1KX8 program memory, a64X8 RAM data memory, 271/0 lines, and an 8-bit timer/counterin addition
to on-board oscillator and clock circuits. For systems that require extra capability the8048H can be expanded using stan-
dard memories and MCS-80 IMCS-85 peripherals. The 8035HL is the equivalent of the8048H without program memory
and can be used with external ROM and RAM.
To reduce development problems toa minimum and provide maximum flexibility, a logically and functionally pin compati-
ble version of the8048H with UV-erasable user-programmable EPROM program memory is available. The87 48 will emulate
the 8048H up to 6 MHz clock frequency with minor differences.
The 8048H is fully compatible with the 8048 when operated at 6MHz.
These microcomputers are designed to be efficient controllers as well as arithmetic processors. They have extensive bit
handling capability as well as facilities for both binary and BCD arithmetic. Efficient use of program memory results from
an instruction set consisting mostly of single byte instructions and no instructions over 2 bytes in length.
TO Vee
PORT
XTAL 1 T1
01
XTAL 2 P27
RESET P26
PORT 55 P25
02
INT P24
EA PH
AD P16
B04BH PSEN P15
B035HL Wi! P14
B04BH-1 ALE P13
B035HL-1
DBO P12
DB1 P11
DB2 P10
DB3 Voo
OB4 PROG
DBS P23
DB6 P22
DB7 P21
Vss P20
Intel Corporation Assumes No Responsibilty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent licenses are Implied.
INTEL CORPORATION, 1980 7-13 AFN-01491B-Ol
S04SH/S04SH-1 IS035H L/S035H L-1
DBO-DB7 12-19 True bidirectional port which ALE 11 Address latch enable. This signal
BUS can be written or read occurs once during each cycle
synchronously using the RD, WR and is useful as a clock output.
strobes. The port can also be The negative edge of ALE strobes
statically latched. address into external data and
Contains the 8 low order pro- program memory.
--
gram counter bits during an PSEN 9 Program store enable. This out-
external program memory fetch, put occurs only during a fetch to
and receives the addressed external program memory.
instruction under the control of (Active low)
PSEN. Also contains the address -
SS 5 Single step input can be used
and data during an external RAM
in conjunction with ALE to "single
data store instruction, under
step" the processor through each
control of ALE, RD, and WR.
instruction. (Active low)
TO 1 Input pin testable using the
EA 7 External access input which
conditional transfer instructions
forces all program memory
JTO and JNTO. TO can be
fetches to reference external
designated as a clock output
memory. Useful for emulation
using ENTO CLK instruction.
and debug, and essential for
T1 39 Input pin testable using the JT1, testing and program verification.
and JNT1 instructions. Can be (Active high)
designated the timer/counter
XTAL1 2 One side of crystal input for
input using the STRT CNT
internal oscillator. Also input for
instruction.
- external source. (Non TTL VIH)
INT 6 Interrupt input. Initiates an
XTAL2 3 Other side of crystal input.
interrupt if interrupt is enabled.
Interrupt is disabled after a reset.
AFN-01491B-02
7-14
S04SH/S04SH-1 IS035H L/S035H L-1
Accumulator Subroutine
AFN-01491B-03
7-15
S04SH/S04SH-1 IS035H L/S03SHL-1
ABSOLUTE MAXIMUM RATINGS* *NOTlCE: Stresses above those listed under "Absolute
Ambient Temperature Under Bias ....... OC to 70C Maximum Ratings" may cause permanent damage to the
Storage Temperature ................ -65C to +150C device. This is a stress rating only and functional opera-
Voitage On Any Pin 'vVith Respect tion of device at these 0; any othSi conditions above those
to Ground ........................... -0.5V to +7V indicated in the operational sections of this specification
Power Dissipation .......................... 1.5 Watt is not implied.
Limits
Symbol Parameter Unit Test Conditions
Min. Typ. Max.
VOO RAM Standby Pin Voltage 2.2 5.5 V Standby Mode, Reset ~0.6V
J:
9
-30 mA
10 mA
OV 2V
VOH
4V
J:
9
300 Jl
1001lA
OV
VOH
9
...J 30 mA
10 mA
OV
~
~ 2V
VOL
4V
AFN-014918-04
7-16
S04SH/S04SH-1 /S035H L-1 /S035H L-1
8048H 8048H-1
8035HL 8035HL-1
6 MHz 8 MHz 11 MHz Conditions
Symbol Parameter F (tCY) Min. Max. Min. Max. Min. Max. Unit (Note 1)
tLL ALE Pulse Width 7/30 tCY -170 410 260 150
tAL Addr Setup to ALE 1/5 tCY -110 390 260 160
tLA Addr Hold from ALE 1/15 tCY -40 120 80 50
tCC1 Control Pulse Width 1/2 tCY -200 1050 730 480
(RD, WR)
tCC2 Control Pulse Width (PSEN) 2/5 tCY -200 800 550 350
tDW Data Setup before WR 13/30 tCY -200 880 610 390
tWD Data Hold after WR 1/5 tCY -150 350 220 120 (Note 2)
tDR Data Hold (RD, PSEN) 1/10 tCY -30 0 220 0 160 0 110
tRD1 RD to Data in 2/5 tCY -200 800 550 350
tRD2 PSEN to Data in 3/10 tCY -200 550 360 210
tAW Addr Setup to WR 2/5 tCY -150 850 600 300
tAD1 Addr Setup to Data (RD) 23/30 tCY -250 1670 1190 750
tAD2 Addr Setup to Data (PSEN) 3/5 tCY -250 1250 880 480
tAFC1 Addr Float to RD, WR 2/15 tCY -40 290 210 140
tAFC2 Addr Float to PSEN 1/30 tCY -40 40 20 10
tLAFC1 ALE to Control (RD, WR) 1/5 tCY -75 420 300 200
tLAFC2 ALE to Control (PSEN) 1/10 tCY -75 170 110 60
AFN-014918-05
S04SH/S04SH-1 IS035H L/S035H L-1
a 'I..~~"r.
YY"'Yl:rvnm~
.....
~ILAFC1
L ALE
J I I I L
r- ICC1
-j ICA1
1-
j It: -\I
RD
IAFC1 tlDR
FLOATING
BUS ~ FLOATING
~ IAD1 S I R D 1
Instruction Fetch From External Program Memory Read From External Data Memory
ILAFC1n
ALE Jr-----'I L
i--
---------------------~
ICC1
WR
O.4SV __________
BUS
PORT 2 TIMING
I
OUTPUT PCH PORT CONTROL OUTPUT DATA
EXPANDER
PORT
PROG
AFN-01491B-06
7-18
S04SH/S04SH-1 IS035H L/S035H L-1
I 1 1'----1 - - - - I
PSEN
\'--_----'f
I
~~~~~T~------------PC-H------------~)(r--------p-O-R-T-2-0--2-3-D-A-TA---------,~~----N-E-W-P-2-0--23--DA-T-A----J)(~------PC-H------
P24-27
P10-17
OUTPUT
___________________________________________
PORT 24-27, PORT 10-17 DATA ...J
x. .____________________NEW PORT DATA
m
f~--
~
t----:'---...----;XTAL1 XTAL1
21njLC'
c,;~, = C'-~
c
-= t-~!--+----;XTAL2
d
-=
C
L
3
XTAL2
2
Cpp'" 5-10 pF
PIN-TO-PIN
CAPACITANCE
C3
C1 " 5pF . 1/2pF. STRAY 5pF
C2 CRYSTAL' STRAY 8pF
0
C NOMINAL f
C3 20pF , 1 pF . STRAY. 5pF
0 20pF 5.2 MHz
20pF 3.2 MHz
470Q
D - - - - < . - - - - - - I XTAL1
+5V
OPEN COLLECTOR
TTL GATES
470Q
'---"'---1 XTAL2
AFN-01491 B-07
7-1~
8048L
SPECIAL LOW POWER CONSUMPTION SINGLE
COMPONENT 8-BIT MICROCOMPUTER
Typical Power Consumption 100mW 641K xx SSRAM
ROM
TO Vee
PORT
XTAL 1 T1
XTAL 2 P27
RESET P26
PORT
2
55 P2S
fNT P24
EA PH
AD P16
PSEN P1S
WR P14
8048L
ALE P13
DBO P12
DBl Pll
DB2 Pl0
DB3 VDD
DB4 PROG
DBS P23
Intel Corporation Assumes No Responsibilty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied .
. INTEL CORPORATION, 1980 7-20 AFN-Q1591A-Ol
intel" 8048L [F)OO~[bn[M]n~~OO\1
PIN DESCRIPTION
Designation Pin = Function Designation Pin = Function
VSS 20 Circuit GND potential testable with conditional
VDD 26 low power standby pin jump instruction.
(Active low)
VCC 40 Main power supply; +5V
during operation. RD 8 Output strobe activated
during a BUS read. Can be
PROG 25 Output strobe for 8243 I/O used to enable data onto the
expander. bus from an external device.
P10-P17 27-34 8-bit quasi-bidirectional Used as a read strobe to
Port 1 port. external data memory.
P20-27 21-24 8-bit quasi-bidirectional (Active low)
Port 2 port.
RESET 4 Input which is used to
35-38 P20-P23 contain the four
initialize the processor.
high order program counter
(Active low)
bits during an external pro-
gram memory fetch and (Non TTL VIH)
serve as a 4-bit I/O expander WR 10 Output strobe during a bus
bus for 8243. write. (Active low)
DBO-DB7 12-19 True bidirectional port Used as write strobe to
BUS which can be written or read external data memory.
synchronously using the ALE 11 Address latch enable. This
RD, WR strobes. The port signal occurs once during
can also be statically each cycle and is useful as a
latched. clock output.
Contains the 8 low order The negative edge of ALE
program counter bits during strobes address into ex-
an external program ternal data and program
memory fetch, and receives memory.
the addressed instruction
PSEN 9 Program store enable. This
under the control of PSEN.
Also contains the address output occurs only during a
fetch to external program
and data during an external
memory. (Active low)
RAM data store instruction,
under control of ALE, RD, SS 5 Single step input can be
and WR. used in conjunction with
TO ALE to "single step" the
Input pin testable using the
processor through each
conditional transfer in-
instruction. (Active low)
structions JTO and JNTO. TO
can be designated as a clock EA 7 External access input which
output using ENTO ClK forces all program memory
instruction. fetches to reference external
T1 39 Input pin testable using the memory. Useful for emula-
JT1, and JNT1 instructions. tion and debug, and
Can be designated the essential for testing and
timer/counter input using program verification.
the STRT CNT instruction. (Active high)
INT 6 Interrupt input. Initiates an XTAl1 2 One side of crystal input for
interrupt if interrupt is internal oscillator. Also
enabled. Interrupt is dis- input for external source.
abled after a reset. Also (Non TTL VIH)
XTAl2 3 Other side of crystal input.
7.?1 AFN-01S91A-02
inter 8048L [F)[ffi ~[}J ~OOO&[ffiW
INSTRUCTION SET
Accumulator Subroutine
AFN-01591A-03
7-?2
8048L
ABSOLUTE MAXIMUM RATINGS COMMENT Stresses above those listed under "Abso-
Ambient Temperature Under Bias ....... 00 C to 70 0 C lute Maximum Ratings" may cause permanent damage to
Storage Temperature ............... -65 0 C to + 125 0 C the device. This is a stress rating only and functional
Voltage On Any Pin With Respect operation of device at these or any other conditions
to Ground ............................ -0.5V to +7V above those indicated in the operational sections of this
Power Dissipation ......................... 1.5 Watt specification is not implied.
Limits
Symbol Parameter Unit Test Conditions
Min. Typ. Max.
V IL Input Low Voltage -.5 .8 V
(All Except RESET, X1, X2)
V IL1 Input Low Voltage -.5 .6 V
(RESET, X1, X2)
V IH Input High Voltage 2.0 VCC V
(All Except XTAL1, XTAL2, RESET)
V IH1 Input High Voltage (X1, X2, RESET) 3.8 VCC V
VOL Output Low Voltage (BUS) .45 V VOL = 2.0 mA
V OL1 Output Low Voltage .45 V IOL =1.8 mA
(RO, WR, PSEN, ALE)
V OL2 Output Low Voltage (PROG) .45 V IOL =1.0 mA
VOL3 Output Low Voltage .45 V IOL =1.6 mA
(All Other Outputs)
V OH Output High Voltage (BUS) 2.4 V IOH = -400 /-L A
V OH1 Outp~igh Voltage 2.4 V IOH =-100 /-LA
(RO, WR, PSEN, ALE)
VOH2 Output High Voltage 2.4 V IOH =-40 /lA
(All Other Outputs)
1L1 Input Leakage Current (T1, INT) 10 /-LA VSS < VIN < VCC
IU1 Input Leakage Current -500 IlA VSS + .45~VIN~YCC
(P10-P17, P20-P27, EA, SS)
I LO Output Leakage Current (BUS, TO) 10 I1A VSS + .45 ~VIN ~Ycc
(High Impedance State)
100 V DO Supply Current 2 4 mA
100+ Total Supply Current 20 40 mA
ICC
VOO Ram Standby Pin Voltage 2.2 5.5 V Standby Mode, Reset:50.6V
:I:
.9
-10 rnA
OV 2V 4V
:I:
.9
-300 /1
-100/1A
OV 2V 4V
-' 30 rnA
.9
10 rnA
OV
~
0 2V
VOL
4V
VOH VOH
7_?1. AFN-01591A-04
8048L
PORT 2 TIMING
ALE J \~---~y
EXPANDER
PORT
I
OUTPUT PCH PORT CONTROL OUTPUT DATA
I
EXPANDER
PORT
PROG ------------------4~
I 114.---tPP'----
V
I I
AFN-01591 A-OS
7-?A.
8048L
WAVEFORMS
i_
4
- - t L - L - _ - I - - tCY -------1
ALE J ,--I_ _ _----'1..------.L ALE J I L
I --tAFC!_TCC-1 TCA f.-
r------------
! _ tCC -1 tCA \-
--------~--r_~ --------~I 1
t
RD
l-tAD~1
Instruction Fetch From External Program Memory Read From External Data Memory
ALE J L
WR
2.4V - - - - - - . . . . . ~-----
AFN-01591A-06
8048L
~:f-l -::-lr-:-:--,L
. . . -.-~
-C-2 XTAll
~ ~3:1- _ _L...--_----<
T_.-----'-I3 XTAl2
<
Cl = 5pF 1/2pF + STRAY 5pF
C2 = CRYSTAL + STRAY < 8pF
C3 = 20pF lpF + STRAY < 5pF
CRYSTAL SERIES RESISTANCE SHOULD BE LESS THAN 75S} AT 6 MHz LESS THAN l80Q AT 3.6MHz
LC OSCILLATOR MODE
l C NOMINAL 1 1
45pH 20pF 5.2 MHz F---
120pH 20pF 3.2 MHz 2rrIjLC
2
rt
XTAll
C + Cpp
C
2
~
Jl
).
-= "'[C
3 XTAl2
Cpp 5-10 pF PIN TO PIN
0
CAPACITANCE
+5V
470,1;1
D-......- - - - - ; XTAll
+5V
470,1;1
XTAL 1 MUST BE HIGH 35-65% OF THE PERIOD AND XTAL 2 MUST BE HIGH 35-65% OF THE
PERIOD. RISE AND FALL TIMES MUST NOT EXCEED 20n8.
AFN-01S91A-07
S049H/S039HL
HMOS SINGLE COMPONENT S-BIT MICROCOMPUTER
8049H Mask Programmable ROM
8039HL CPU Only with Power Down Mode
TO Vee
PORT
01 XTAL 1 T1
XTAL 2 P27
RESET 4 P26
PORT 55 P2S
02
P24
8049H EA PH
8039HL
AD P16
PSEN 9 P1S
WR P14
P13
P12
DB1 P11
DB2 P10
DB3 VDD
DB4 PROG
DBS P23
DB6 P22
BUS
DB7 P21
VSS P20
Intel Corporation Assumes No Responsibilty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied
'INTEL CORPORATION, 1980 7-27 AFN-01784A-01
S049H/S039HL
7-28 AFN-01784A-02
S049H/S039HL
Accumulator Subroutine
7-29 AFN-01784A-03
Intel S049H/S039H L
Limits
Symbol Parameter Unit Test Conditions
Min. Typ. Max.
1L1 Input Leakage Current (T1, INT) :!:. 10 fLA VSS $ VIN $ VCC
IU1 Input Leakage Current _ -500 fLA VSS + .45 ~ VIN:5 VCC
(P10-P17, P20-P27, EA, SS)
ILO Output Leakage Current (BUS, TO) . 10 fLA VSS + .45:$ VIN :5 VCC
(High Impedance State)
:z:
9
OV 2V
VOH
4V
9
:z: -300
-100/lA
/l
OV 2V
VOH
4V
....I
9
30 mA
10 mA
OV
~
~ 2V
VOL
4V
7-30 AFN-01784A-04
S049H/S039HL
tCC1 Control Pulse Width (RD, WR) 1/2 tCY -200 480 ns
--
tCC2 Control Pulse Width (PSEN) 2/5 tCY -200 350 ns
Data Hold
---
(RD, PSEN) 0 110 ns
tOR 1/10 tCY -30
-
tRD1 RD to Data in 2/5 tCY -200 350 ns
t
OPRR
to Rep Rate 3/15 tCY 270 ns
Notes:
1. Control Outputs CL = 80pF 2. BUS High Impedance Load 20pF 3. Calculated values will be equal
BUS Outputs CL = 150pF to or better than published 8049 values.
7-31 AFN-01784A-05
S049H/S039HL
WAVEFORMS
----.l TLAFC1 L
ALE J---\L..__ 1_ _ _ _..... 1 L
RD ------i\
r- ICC1 -..j
1
ICA1 1-
IAFC1j
I~
FLOATING
-I tlDR
_ _ _ _ __
BUS ~ FLOATING
~ IAD1 i :IIRD1
Instruction Fetch From External Program Memory Read From External Data Memory
---..j T LAFC1
ALE Jr"------. L
ICA1 1---
WR
2.4V - - - - _ _
0.4SV _ _ _ _ --JX~:: ~ TEST POINTS ~:::X'"
r-----
_____
BUS
Write to External Data Memory Input and Output for A.C. Tests
ALE J \----------! \ /
'------~lrICA1
EXPANDER
PORT rIDP-ttPDl
I
OUTPUT PCH PORT 20-23 DATA I PORT CONTROL OUTPUT DATA
EXPANDER
PORT
1001----- IpR - - - - - . I
I
INPUT PCH PORT 20-23 DATA PORT CONTROL
PROG
AFN-01784A-06
7-32
S049H/S039HL
J \ I-' 1-----,t 1
ec
'ev /'--'----'L
ALE
I 1 1'-----1 - - - - I
PSEN
\-------1/
I
~~~~~T~~----------PC-H------------~)(~-------P-O-R-T-2-0--2-3-D-A-TA--------~)(~____N_E_W_P_2_0-_23__DA_T_A____J)(~ ______ PC_H
______
I
P24-27 ----------------------------------------------------------~xr----------------------------------
OUTPUT __________________________________________________________
P10-17 PORT 24-27, PORT 10-17 DATA - J ~______________________________
NEW PORT DATA ___
DRIVING FROM
OSCILLATOR MODE LC OSCILLATOR MODE EXTERNAL SOURCE
,. - -1 +5V
m
C1
27TVLC'
~ e';t' =
1----,--.....--tXTAL1 XTAL1
C = 3Cpp
JC C'=--2-
470Q
CRYSTAL SERIES RESISTANCE SHOULD EACH C SHOULD BE APPROXIMATELY 20pF, FOR THE 8048, XTAL 1 MUST BE HIGH
BE LESS THAN 75 II AT 6MHz; LESS THAN INCLUDING STRAY CAPACITANCE. 35-65% OF THE PERIOD AND XTAL2
180 II AT 3.6MHz. MUST BE HIGH 35-65% OF THE PERIOD
AFN-01784A-07
7-33
8243
MCS-48 INPUT/OUTPUT EXPANDER
The Intel 8243 is an input/output expander designed specifically to provide a low cost means of 1/0
expansion for the MCS-48 falT)ily of single chip microcomputers. Fabricated in 5 volts NMOS, the 8243
combines low cost, single supply voltage and high drive current capability.
The 8243 consists of four 4-bit bidirectional static 1/0 ports and one 4-bit port which serves as an interface to
the MCS-48 microcomputers. The 4-bit interface requires that only 4 1/0 lines of the 8048 be used for 1/0
expansion, and also allows multiple 8243's to be added to the same bus.
The 1/0 ports of the 8243 serve as a direct extension of the resident 1/0 facilities of the MCS-48 microcomputers
and are accessed by their own MOV, ANL, and ORL instructions.
PORT4
PSO vee
P40 PS1
PORTS
1'41 P52
Pt12 PS3
PORT 2 P43 P60
CS P61
PROG P62
P23 P63
PORT 6
P22 P73
P21 P72
P20 P71
GND P70
PORT 7
Figure 2. 8243
Pin Configuration
Figure 1. 8243
Block Diagram
Intel Corporation Assumes No Responsibilty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied.
'INTEL CORPORATION. t980 7-34 AFN-D0214A-Ol
8243
7-35 AFN-00214A-02
8243
ABSOLUTE MAXIMUM RATINGS 'NOTlCE: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating only and functional opera-
Ambient Temperature Under Bias ........ OC to 70C tion of the device at these or any other conditions above
Storage Temperature ............... -65C to +150C those indicated in the operational sections of this specifi-
Voltage on Any Pin cation is not implied. Exposure to absolute maximum
With Respect to Ground .............. -0.5 V to +7V rating conditions for extended periods may affect device
Power Dissipation ............................ 1 Watt reliability.
2.4
0.45----
-----'X > <::x_ 20
0 .8 TEST POINTS
7-36 AFN-00214A-03
8243
WAVEFORMS
PROG
IK
10
IpO
liP
-- liP
ICS ICS
AFN-00214A-04
7-37
Intel 8243
I
125
100
75
25
10 11 12 13
Figure 3
Sink Capability Example: This example shows how the use of the 20 mA
sink capability of Port 7 affects the sinking
capability of the other 1/0 lines.
The 8243 can si nk 5 rnA @ .45V on each of its 16 I/O
lines simultaneously. If, however, all lines are not
sinking simultaneously or all lines are not fully
An 8243 will drive the following loads simul-
loaded, the drive capability of any individual line
taneously.
increases as is shown by the accompanying curve.
Example: How many pins can drive 5 TTL loads (1.6 mA)
assuming remaining pins are unloaded? flOl = (2 x 20) + (8 x 4) + (6 x 3.2) = 91.2 mA.
From the curve: for 10l = 4 mA, flOl "'" 93 mA.
since 91.2 mA < 93 mA the loads are within
10l = 5 x 1.6 mA = 8 mA specified limits.
flOl = 60 mA from curve
# pins =60 mA + 8 mAlpin =7.5 =7
I n this case, 7 lines can sink 8 mA for a total of Although the 20 mA @ 1V loads are used in
56mA. This leaves 4 mA sink current capability calculating fiOL. it is the largest current re-
which can be divided in any way among the quired @ .45V which determines the maximum
remaining 8 1/0 lines of the 8243. allowable EiOl.
NOTE: A 10 to SOK 0 pullup resistor to +SV should be added to 8243 outputs when driving to SV CMOS directly.
7-38 AFN-oG214A-05
8243
-::-
I/O
cs
P4 I/O
PROG PROG
TEST P5 I/O
INPUTS
8048 8243
P6 I/O
P20P23 DATA IN
P2
P7 I/O
OO} READ
01 WRITE OO}
01 PORT
.IX'--_____.I)>-----
10 OR 10 ADDRESS
lL AND 11
P20P23 - - { " '_ _ _
BUS
PORT 1
8048
PROG~---------------+----------------~----------------~~--------------~
7-39 AFN-00214A-06
inter
8155/8156/8155-2/8156-2
2048 BIT STATIC MOS RAM WITH 1/0 PORTS AND TIMER
The 8155 and 8156 are RAM and I/O chips to be used in the 8085A and 8088 microprocessor systems. The RAM portion
is designed with 2048 static cells organized as 256 x 8. They have a maximum access time of 400 ns to permit use with
no wait states in 8085A CPU. The 81552 and 81562 have maximum access times of 330 ns for use with the 8085A2 and
the full speed 5 MHz 8088 CPU.
The I/O portion consists of three general purpose I/O ports. One of the three ports can be programmed to be status
pins, thus allowing the other two ports to operate in handshake mode.
A 14bit programmable counter/timer is also included on chip to provide either a square wave or terminal count pulse
for the CPU system depending on timer mode.
PC 3 Vee
PC 4 pC 2
TIMER IN PC,
0
101M
RESET PC o PA o- 7
PC s PB 7
ADo 7 256 X 8
TIMER OUT PB 6
STATIC
101M PBs RAM
AD
WR
ALE
ADo
PB 4
PB 3
PB 2
PB,
PB o
*
ALE
RD
0 PBo--7
WR
G
AD, PA 7 PC O- 5
AD2 PA 6 RESET TIMER
AD3 PAs
AD4
ADs
PA 4
PA 3
TIMER ClK Lvcc (+5VI
Vss (OVI
TIMER OUT
AD6 PA 2
AD7 PAl
Vss PAo
': 8155/81552 = CE, 8156/81562 = CE
740
8155/8156/8155-2/8156-2
7-41
8155/8156/8155-2/8156-2
ABSOLUTE MAXIMUM RATINGS *COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating only and functional opera
TemperatureUnderBias ................ 0Cto+70C tion of the device at these or any other conditions above
Storage Temperature ... . . . . . . . . . . .. -65C to +150 C those indicated in the operational sections of this specifi
Voltage on Any Pin cation is not implied. Exposure to absolute maximum
With Respect to Ground ............... -0.5V to +7V rating conditions for extended periods may affect device
Power Dissipation ..... . . . . . . . . . . . . . . . . . . . . . . .. 1.5W reliability.
742
8155/8156/8155-2/8156-2
tRO Valid Data Out Delay from READ Control 170 140 ns
7-43
8155/8156/8155-2/8156-2
WAVEFORMS
8. Read Cycle
CE (8155 )
\r- ~( '\
OR
CE (8156 ) jf- ~\
/
101M
\ ,/ '\
.. tAD
If- r-
~
-'I ~
~ ADDRESS
-J )t-- ~
DATA VALID
.., H
- t Al - - t LA -
AL E J<- ~I\.- .(
- tLL - l" tROE .. I-- t RoF ....
t><-
~~
~"--
___ tRO_
,I{
_ t LC - -
- tcc -
--
- tRV -
t CL -
b. Write Cycle
CE (8155)
OR
CE (8156)
101M
ALE
_ t wo -
tRV-
7-44
8155/8156/8155-2/8156-2
BF
INTR
INPUT DATA
BF
INTR
OUTPUT DATA
TOPORT ________________________________~~~------------------------------------------
DATA BUS
OUTPUT
I
LOAD COUNTER FROM CLR
2 I 1
--l
I
RELOAD COUNTER FROM CLR
I 2 I 1
-I
TIMER IN
TIMER OUT
(PULSE) "
'- (NOTE
___ 1)
J"
TIMER OUT , I
(SOUARE WAVE) , (NOTE 1) I
'- _ _ _ _ _ _ _ _ J
7-46
inter
8185/8185-2
1024 x 8-BIT STATIC RAM FOR MCS-85
The Intel@ 8185 is an 8192-bit static random access memory (RAM) organized as 1024 words by 8-bits using
N-channel Silicon-Gate MOS technology. The multiplexed address and data bus allows the 8185 to interface directly
to the 8085A and 8088 microprocessors to provide a maximum level of system integration.
The low standby power dissipation minimizes system power requirements when the 8185 is disabled.
The 8185-2 is a high-speed selected version of the 8185 that is compatible with the 5 MHz 8085A-2 and the full speed
5 MHz 8088.
ADO Vee
AD, RD
AD2
AD3
AD4
WR
ALE
-
CS
CE,
.
CS CE 2 R/W
AD5 CE, @ LOGIC
AD6 CE 2 WR
ALE
AD7 As
Vss As
l
-\ DATA lK x 8
RAM
r---v
BUS
BUFFER MEM0RY
ARRAY
xy DECODE
PIN NAMES
OPERATIONAL DESCRIPTION
Vss Vee
The 8185 has been designed to provide for direct interface
!!!
to the multiplexed bus structure and bus timing of the
8085A microprocessor. -- TRAP
x, x2 RESET IN
HOLD I-
At the beginning of an 8185 memory access cycle, the 8-
bit address on ADo-7, As and Ag, and the status of CE1 and -- RST7,5
RST6,5
8085A
HLDA
SOD
f--
f-
--
RST5,5 SIDI-
CE2 are all latched internally in the 8185 by the falling edge INTR s,i--
RESET
of ALE. If the latched status of both CE1 and CE2 are INTA
ADDRI OUT So i--
ADDR DATA ALE AD WR 101M RDY ClK
active, the 8185 powers itself up, but no action occurs until
Vee
the CS line goes low and the appropriate RD or WR control
signal input is activated.
(8) (8)'"
Tl
The CS input is not latched by the 8185 in order to allow r-- ~ POR~W
the maximum amount of time for address decoding in
selecting the 8185 chip. Maximum power consumption
WR
_
RD
PORT
8156 B
W (8)
savings will occur, however, only when CE1 and CE2 are
activated selectively to power down the 8185 when it is not
in use. A possible connection would be to wire the 808SA's
10iM line to the 8185's CE1 input, thereby keeping the
...
"
If
ALE
DATAl
ADDR
PORT
IN
C
W (6)
lOW
TABLE 1.
AD
TRUTH TABLE FOR
POWER DOWN AND FUNCTION ENABLE
W
ALE
PORT
Itr- eE A
0 1 1 0
Function Disable[ll
Powered Up and
101M
RESET
ROY
PORT
B
W
Function Disable[11
~ elK
0 1 0 1 Powered Up and
Enabled tttt
Vss Vee VDD PROG
Notes:
X: Don't Care. WR
1: Function Disable implies Data Bus in high impedance state AD
and not writing.
GE, 8185
2: CS = (CEl = 0) (CE2 = 1) (CS = 0) ALE
CS = 1 signifies all chip enables and chip select active
h-- CS, eE 2
!-t-- As, Ag
.II "-
TABLE 2. / AD o.7
8185 8185-2
Preliminary Preliminary
Symbol Parameter [1] Min. Max. Min. Max. Units
tAL Address to Latch Set Up Time 50 30 ns
tlA Address Hold Time After Latch 80 30 ns
tLC Latch to READ/WRITE Control 100 40 ns
tRO Valid Data Out Delay from READ Control 170 140 ns
tLO ALE to Data Out Valid 300 200 ns
tLl Latch Enable Width 100 70 ns
tROF Data Bus Float After READ a 100 a 80 ns
tCl READ/WRITE Control to Latch Enable 20 10 ns
tcc READ/WRITE Control Width 250 200 ns
tow Data In to WRITE Set Up Time 150 150 ns
two Data In Hold Time After WRITE 20 20 ns
tsc Chip Select Set Up to Control Line 10 10 ns
tcs Chip Select Hold Time After Control 10 10 ns
tAlCE Chip Enable Set Up to ALE Falling 30 10 ns
tLACE Chip Enable Hold Time After ALE 50 30 ns
Notes:
1. All AC parameters are referenced at
a) 2.4V and .45V for inputs
b) 2.0V and .BV for outputs.
___..JX~::> TESTP'"NTS::::X"'-____
ALE
(CE, =0)-
(C E 2' 1)
WR,RD
ADo-AD7
(READ CYCLE)
(AB, Ag)
--tcc----~I
(WRITE CYCLE)
(SELECTED) (DESELECTED)
GE, Vee
CE 2 PB 7 ClK
ClK PBs
RESET PBs
READY
N.C. (NOT CONNECTED) 5 PB 4
AD _
READY PB 3 o 7
~
101M PB 2
G
PB, PA o- 7
As-,o
AD PB o
row PA 7 CE2
GE, ROM
~
ALE PAs
101M
PAs
ALE PB O- 7
AD, PA 4
AD
AD2 PA 3
lOW
AD3 PA 2
RESET
AD4 PA,
iOR
ADs PAo
ADs
AD7
AlO
Ag ~Vec (+5V)
Vss (OV)
Vss
Intel Corporation Assumes No Responsibility tor the Use of Any CirCUitry Other Than Circuitry Embodied In an Intel PrOduct No Other CirCUit Patent licenses are Implied
7-51
8355/8355-2
CE1 Chip Enable Inputs: CE1 is active low Read operation is selected by either
CE2 and CE2 is active.b.!.9!l. The 8355 can be lOR low and active Chip Enables and
(Input) accessed only when BOTH Chip En- ADo low, Q! 10/M high, RD low, active
ables are active at the time the ALE chip enables, and ADo low.
signal latches them up. If either Chip PBo-7 This general purpose I/O port is
Enable input is not active, the ADo-7 (Input/ identical to Port A except that it is
and READY outputs will be in a high Output) selected by a 1 latched from ADo.
impedance state.
RESET An input high on RESET causes all pins
10iM If the latched 10/M is high when RD is (Input) in Port A and B to assume input mode.
(Input) low, the output data comes from an
lOR When the Chip Enables are active, a low
I/O port. If it is low the output data (Input) on lOR will output the selected I/O port
comes from the ROM.
onto the AD bus. lOR low performs the
RD If the latched Chip Enables are active same function as the combination 10/M
(Input) when RD goes low, the ADo-7 output high and RD low. When lOR is not used
buffers are enabled and output either in a system, lOR should be tied to Vee
the selected ROM location or I/O port. ("1" ).
When both RD and lOR are high, the
Vee +5 volt supply.
ADo-7 output buffers are 3-state.
lOW If the latched Chip Enables are active,
Vss Ground Reference.
(Input) a Iowan lOW causes the output port
pointed to by the latched value of ADo
to be written with the data on ADo-7.
The state of 10/M is ignored.
7-52
8355/8355-2
ABSOLUTE MAXIMUM RATINGS 'COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating onlv and functional opera
tion of the device at these or any other conditions above
Temperature Under Bias ................ aoc to +70C
Storage Temperature ............... -65 0 C to +150 C those indicated in the operational sections of this specifi-
Voltage on Any Pin cation is not implied. Exposure to absolute maximum
With Respect to Ground ............... -0.5V to +7V rating conditions for ex tended periods may affect device
Power Dissipation ............................. 1.5W reliability.
A8-10
101M
1 4 - - - - - - - - tAo - - - - - - - - - . . I
ADo_7 DATA
ALE
1 + - - - - - tow - - - - - - - + I
7-54
8355/8355-2
8. Input Mode
d::,~
PORT
INPUT
==x
DATA*- - -- - - -)(
BUS
------- ----------------------
b. Output Mode
GLITCH FREE
/OUTPUT
PORT
OUTPUT
~
J\ _______..JX\._____
DATA* - - - - -
BUS ____ _
7-55
intel~
8755A /8755A2
16,3848IT EPROM WITH I/O
2048 Words )( 8 Bits 2 General Purpose 8Bit 1/0 Ports
The Intel@ 8755A is an erasable and electrically reprogrammable ROM (EPROM) and I/O chip to be used in the 8085A
and 8088 microprocessor systems. The EPROM portion is organized as 2048 words by 8 bits. It has a maximum
access time of 450 ns to permit use with no wait states in an 8085A CPU.
The I/O portion consists of 2 general purpose I/O ports. Each I/O port has 8 port lines, and each I/O port line is
individually programmable as input or output.
The 8755A-2 is a high speed selected version of the 8755A compatible with the 5 MHz 8085A-2 and the full speed 5
MHz 8088.
CLK
RESET
READY-----t
VDD PB 4
READY PB 3
101M PB 2
lOR PB,
RD PB o
CE2 - - - - I 2K x 8 lOW
IO/M----~ EPROM
ALE
ALE---_I ADo PA 5
Fill----I AD, PA 4
IOW----I AD2 PA 3
RESET-----t AD3 PA 2
~VCC(+5VI AD6
AD7
A,O
A9
Vss (OVI
Vss
Intel Corporation Assumes No Responsibilty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses 8Je Implied.
"INTEL CORPORATION. 1980 7-56 AFN-01841B
8755A/8755A-2
7-57 AFN-01B41B
intel 8755A/8755A-2
87,5A
FUNCTIONAL DESCRIPTION ONE BIT OF PORT A AND ODR A
PROM Section
The 8755A contains an 8-bit address latch which allows it
to interface directly to MCS-48, MCS-85 and iAPX 88/10
Microcomputers without additional hardware.
The PROM section of the chip is addressed by the 11-bit
address and CEo The address, CE 1 and CE2 are latched
into the address latches on the falling edge of ALE. If the
latched Chip Enables are active and 10iM is low when RD
goes low, the contents of the PROM location addressed
by the latched address are put out on the ADO-7 lines WRITE DDR A
7-58 AFN-01B41B
8755A/8755A-2
The recommended erasure procedure for the 8755A is If a memory mapped I/O approach is used the 8755A will be
exposure to shortwave ultraviolet light which has a wave- sel~ted by the combination of both the Chip Enables and
length of 2537 Angstroms (AI. The integrated dose Ii.e., 10/M using the ADs-15 address lines. See Figure 1.
UV intensity X exposure time I for erasure should be a
minimum of 15W-sec/cm2. The erasure time with this
dosage is approximately 15 to 20 minutes using an ultra-
violet lamp with a 12000pW/cm2 power rating. The
8755A should be placed within one inch from the lamp
tubes during erasure. Some lamps have a filter on their
tubes and this filter should be removed before erasure.
/1
PROGRAMMING
Initially, and after each erasure, all bits of the EPROM
K;8.15 )
portions of the 8755A are in the "1" state. Information is 8085A
~D07
'J
"-
V
introduced by selectively programming "0" into the
ALE
desired bit locations. A programmed "0" can only be
RD
-
changed to a "1" by UV erasure.
WR
-
The 8755A can be programmed on the Intel Universal elK 10.,21
-
PROM Programmer (UPp i, and the PROMPr M 80/85 and READY
-
PROMPT-48 design aids. The appropriate programming -
modules and adapters for use in programming both
101M
f--- t
vee
8755A's and 8755's are shown in Table 1.
The program mode itself consists of programming a
r"'7 "(/
A/Do_7 A_
s 10 RD elK
I
101M
single address at a time, giving a single 50 msec pulse iDA ALE iOW READY CE
for every address. Generally, it is desirable to have a
8755A
verify cycle after a program cycle for the same address
as shown in the attached timing diagram. In the verify
cycle (i.e., normal memory read cycle I 'Voo' should
be at +5V.
Preliminary timing diagrams and parameter values per-
taining to the 8755A programming operation are con- Figure 3. 8755A in 80S5A System
tained in Figure 7. (Memory-Mapped I/O)
7-59
8755A/8755A2
ABSOLUTE MAXIMUM RATINGS 'NOTICE: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating only and functional opera-
TemperatureUnderBias ................ OCto+70C tion of the device at these or any other conditions above
Storage Temperature ............... -65C to "150C those indicated in the operational sections of this specifi-
Voltage on Any Pin cation is not implied. Exposure to absolute maximum
With Respect to Ground ............... -O.5V to +7V rating conditions for extended periods may affect device
Power Dissipation ............................. 1.5W reliability.
D.C. CHARACTERISTICS- PROGRAMMING (TA = 0Ct070, Vee = 5V 5%, Vss = OV, Voo = 25V 1V;
Vee = Voo = 5V 10% for 8755A-2)
760 AFN-01841B
intel" 8755A18755A2
NOTE:
eLOAD = 150pF.
'Or TAD - (TAL + he), whichever is greater.
7-61 AFN-01841B
in1:el" 8755A/8755A2
!NPUT/OUTPUT
,. ~"'O<H"<
0.45
0.8
"X=
0.8
DEVICE
UNDER
"--____. . I
TEST
~
CL 150 pF
WAVEFORMS
As,o
~ ADDRESS
I
ADDRESS
tAD
ADO7
~ ADDRESS )---~
--.J DATA
~>-----< ADDRESS
l-
ALE
e I-tLL--
,I
'k-
f.-tAL- I------ t LA - - -
-
(PROGI/CE, \k-
CE 2 )~ ~\
\
--
-'1\
I---tROE
-)~
tROF 1---
....
iORFili
!----tLc _ _
k-
tcc
L
I----tCL-
Please note that GEl must remain low for the entire cycle. . tRV
762 AFN-Ol841B
8755A/8755A2
WAVEFORMS (Continued)
1/0 PORT
A. INPUT MODE
ROOR
iiYR
B. OUTPUT MODE
lOW
GLITCH FREE
~ ~/ OUTPUT
CLK
ICE=1) ICE=O)
ALE
READY- - - -l"'"
I
4-
I
tAAY'"
, ...... _-----.
763 AFN-01B41B
8755A18755A2
WAVEFORMS (Continued)
FUNCTION
I. . .~------ PROGRAM CYCLE -------~ .. 11.....- - - - - VERIFY CYCLE' --1_ PROGRAM CYCLE
ALEJ
\_--_1\_-
DATA TO BE
A/DO-7 PROGRAMMED
tPD--
AS-l0
tH _ _
+25
VDD
-
+5--------------------------~
'VERIFY CYCLE IS A REGULAR MEMORY READ CYCLE (WITH VDD = +5V FOR 8755A)
7-64 AFN-01841B
8041 AJ8641AJ8741 A
UNIVERSAL PERIPHERAL INTERFACE
8BIT MICROCOMPUTER
8Bit CPU plus ROM, RAM, I/O, Timer
and Clock in a Single Package
Fully Compatible with MCS48,
MCS80, MCS85, and MCS86
Microprocessor Families
ters
One 8Bit Status and Two Data Regis
for Asynchronous SlavetoMaster Versions
Interchangeable ROM and EPROM
Interface
Supported
DMA, Interrupt, or Polled Operation 3.6 MHz 8741A8 Available
Expandable I/O
8Bit
1024 x 8 ROM/EPROM, 64 x 8 RAM, RAM PowerDown Capability
Timer/Counter, 18 Programmable Over 90 Instructions: 700/0 Single Byte
I/O Pins Single 5V Supply
The Intel@ 8041A/8741A is a general purpose, programmable interface device designed for use with a variety of 8-bit
microprocessor systems. It contains a low cost microcomputer with program memory, data memory, 8-bit CPU, 1/0
ports, timerlcounter, and clock in a single 40-pin package. Interface registers are included to enable the UPI device to
function as a peripheral controller in MCS-48, MCS-80, MCS-85, MCS-86, and other 8-bit systems.
The UPI-41A has 1K words of program memory and 64 words of data memory on-chip. To allow full user flexibility the
program memory is available as ROM in the 8041A version or as UV-erasable EPROM in the 8741A version. The 8741A
and the 8041A are fully pin compatible for easy transition from prototype to production level designs. The 8641A is a
one-time programmable (at the factory) 8741A which can be ordered as the first 25 pieces of a new 8041A order. The
substitution of 8641A's for 8041A's allows for very fast turnaround for initial code verification and evaluation results.
The device has two 8-bit, TTL compatible 1/0 ports and two test inputs. Individual port lines can function as either in-
puts or outputs under software control. 1/0 can be expanded with the 8243 device which is directly compatible and has
16 1/0 lines. An 8-bit programmable timerlcounter is included in the UPI device for generating timing sequences or
counting external inputs. Additional UPI features include: single 5V supply, low power standby mode (in the 8041 A),
single-step mode for debug (in the 8741A), and dual working register banks.
Because it's a complete microcomputer, the UPI provides more flexibility for the designer than conventional LSI inter-
face devices. It is designed to be an efficient controller as well as an arithmetic processor. Applications include key-
board scanning, printer control, display multiplexing and similar functions which involve interfacing peripheral
devices to microprocessor systems.
TEST 0
XTALl
XTAL2
P281DRQ
P2s1iiiF
P2410BF
...
,
r
~. .,. .- - - M-~-:-b~-R-:~l;:' , ~;::
RANDOM
ACCESS
MEMORY
L..............,..,~~~
PERIPHERAL
INTERFACE
I-BIT
I'y------,/IEVEN~I~~~NTER
00188A
8041 AJ8641AJ8741 A
7-66 00 188A
8041 AJ8641 AJ8741 A
APPLICATIONS
DATA
W
AD AD
W
808SA
ADDR
TO
PERIPHERAL
DEVICES
8048
WR WR 8041A1
CS 8741A
W TO
PERIPHERAL
DEVICES
--TO PORT CONTROL 2 -TO
AO
CONTROL A
--T1 BUS DATA BUS 8 DBS -T1
~
8243 KEYBOARD
EXPANDER MATRIX z
z 0
0 ~ i=
i= a: iii
iii 0 0
0
u.. 11.
11. u.. 0
I-
0 UJ
11. UJ
Z u..
~ 0
I- IU
11. Z
::.
PORT2
8041A/8741A
8041 Al8741 A
DATA SUS
CONTROL BUS
7_~7 00 188A
8041 AJ8641AJ8741 A
A.C. CHARACTERISTICS
T A = OC to 70C, Vss= OV, 8041A: Vee= Voo= + 5V 10%, 8741A: Vee= Voo= + 5V 5%
DBB READ
Symbol Parameter Min. Max. Unit Test Conditions
tAR CS, Ao Setup to RDI 0 ns
tRA CS, Ao Hold After RDI 0 ns
tRR RD Pulse Width 250 ns
tAD CS, Ao to Data Out Delay 225 ns C l = 150 pF
t Ro RDI to Data Out Delay 225 ns C l = 150 pF
tOF Fml to Data Float Delay 100 ns
tey Cycle Time (Except 8741A-8) 2.5 15 P.s 6.0 MHz XTAL
tey Cycle Time (8741A-8) 4.17 15 P.s 3.6 MHz XTAL
DBB WRITE
Symbol Parameter Min. Max. Unit Test Conditions
tAW CS, Ao Setup to WRI 0 ns
tWA CS, Ao Hold After WRf 0 ns
tww WR Pulse Width 250 ns
tow Data Setup to WRf 150 ns
two Data Hold After WRf 0 ns
7-nR 00188A
8041 AJ8641AJ8741 A
WAVEFORMS
(SYSTEM'S
~OR Ao ADDRESS BUSI
+-'AR----I
--+----1' 1--- ---'RR------~_ _ _~
1
(READ CONTROLI
~oA~T~~~~----------I--- om "uod---------
2. WRITE OPERATION-DATA BUS BUFFER REGISTER.
~ OR Ao
~
--fT--------------------'I r ~__________
(SYSTEM'S
ADDRESS BUSI
60 rnA
40 rnA
20 rnA
20 40 60 80
TEMP (C)
7-69 00l88A
8041 A/8641 Al8741 A
A.C. CHARACTERISTICS-PORT 2
T A= O'C to 70'C, 8041 A: Vcc= + 5V 10%, 8741A: Vcc = + 5V 5%.
PORT 2 TIMING
SYNC
EXPANDER
PORT
OUTPUT PORT 20-3 DATA
EXPANDER
PORT
INPUT peRT 20-3 DATA
PROG
A.C. CHARACTERISTICS-DMA
Symbol Parameter Min. Max. Unit Test Conditions
t ACC DACK to WR orRD 0 ns
t CAC RD or WR to DACK 0 ns
t ACD DACK to Data Valid 225 ns C L = 150 pF
WAVEFORMS-DMA
DRQ -----t---"I
7.7fl DD188A
8041 AJ8641AJ8741 A
+5V
r----- XTAL1
I
I 470Q
< 15 pF I
(INCLUDES XTAL,
SOC:(ET, STRAY)
...,
....L
I
J>---+------i XTAL 1
I +5V
I
L ____ _
470Q
15 - 25 pF
(INCLUDES SOCKET,
STRAY)
I-=- ' - - - - + - - - i XTAL2
LC OSCILLATOR MODE
..l.. ..Q.. NOMINAL f
45 ~H 20 pF 5.2 MHz
120 ~H 20 pF 3.2 MHz
.--_-~ XTAL1
C'= C+3Cpp
2
WARNING:
PROGRAMMING, VERIFYING, AND
An attempt to program a missocketed 8741A will result in severe
ERASING THE 8741A EPROM
damage to the part. An indication of a properly socketed part is the
appearance of the SYNC clock output. The lack of this clock may
Programming Verification be used to disable the programmer.
In brief, the programming process consists of: activating The Program/Verify sequence is:
the program mode, applying an address, latching the 1. AO= OV, CS = 5V, EA = 5V, RESET = OV, TESTO = 5V,
address, applying data, and applying a programming pulse. V DD = 5V , clock applied or internal oscillator operating,
Each word is programmed completely before moving on to BUS and PROG floating.
the next and is followed by a verification step. The follow- 2. Insert 8741 A in programming socket
ing is a list of the pins used for programming and a descrip- 3. TEST 0 = Ov (select program mode)
tion of their functions:
4. EA = 23V (activate program mode)
5. Address applied to BUS and P2(}'1
Pin Function
6. RESET = 5v (latch address)
7. Data applied to BUS
XTAL1 Clock Input (1 to 6MHz)
8. V DO = 25v (programm ing power)
Reset Initialization and Address Latching
9. PROG = Ov followed by one 50ms pulse to 23V
Test 0 Selection of Program or Verify Mode
10. V OD= 5v
EA Activation of Program/Verify Modes
11. TEST 0 = 5v (verify mode)
BUS Addre~sand Data Input
12. Read and verify data on BUS
Data Output During Verify
P20-1 Address Input 13. TEST 0 = Ov
14. RESET = Ov and repeat from step 5
VOO Programming Power Supply
15. Programmer should be at conditions of step 1 when
PROG Program Pulse Input
8741 A is removed from socket.
7-71 00188A
8041 A/8641 A18741 A
8741A Erasure Characteristics should be placed over the 8741A window to prevent
unintentional erasure.
The erasure characteristics of the 8741A are such that
erasure begins to occur when exposed to light with
wavelengths shorter than approximately 4000 Ang- The recommended erasure procedure for the 8741A is
stroms (A). It should be noted that sunlight and certain exposure to shortwave ultraviolet light which has a
types of fluorescent lamps have wavelengths in the wavelength of 2537 A. The integrated dose (Le., UV inten-
3000-4000A range. Data show that constant exposure to sity x exposure time) for erasure should be a minimum
room level fluorescent lighting could erase the typical of 15 w-sec/cm 2. The erasure time with this dosage is
8741A in approximately 3 years while it would take ap- approximately 15 to 20 minutes using an ultraviolet
proximately one week to cause erasure when exposed lamp with a 12,000 p.W/cm 2 power rating. The 8741A
to direct sunlight. If the 8741 A is to be exposed to these should be placed within one inch of the lamp tubes dur-
types of lighting conditions for extended periods of ing erasure. Some lamps have a filter on their tubes
time, opaque labels are available from Intel which which should be removed before erasure.
7_7? onlRRA
8041 AJ8641 AJ8741 A
_----II
23V
EA
_.'""1'>------
5V
- - - - - - - - - - - - - PROGRAM - ----~+-- VERIFY PROGRAM - - - - -
TESTO
-------
+5 W
I'~ i-two- - - -
trr-TI
~ I
PROG +5------------
+0
I
' ----'
r----------,~.-----------------
~\\..-. _ _- J/ \\...-_---J/
RESET
\'-----
=>--- ADDRESS
10-7) VALID - - -<I..____A_~_~_~E_T ~XI.._~_~_~_\_~_~_i~--I>- - - - - - - -
S_S__
NOTES:
1. PROG MUST FLOAT IF EA IS LOW (I.e., *23V), OR IF TO = 5V FOR THE 8741A. FOR THE
8041A PROG MUST ALWAYS FLOAT.
2. XTAL 1 AND XTAL 2 DRIVEN BY 3.6 MHz CLOCK WILL GIVE 4.17 !,sec tCY' THIS IS ACCEPT
ABLE FOR 8741A8 PARTS AS WELL AS STANDARD PARTS.
3. AO MUST BE HELD LOW (I.e., = OV) DURING PROGRAMNERIFY MODES.
7-73 00188A
inter
8205
HIGH SPEED 1 OUT OF 8 BINARY DECODER
110 Port or Memory Selector Low Input Load Current - 0.25 mA
Max, 116 Standard TTL Input Load
Simple Expansion -' Enable Inputs
Minimum Line Reflection - Low
High Speed Schottky Bipolar Voltage Diode Input Clamp
Technology - 18 ns Max Delay Outputs Sink 10 mA Min
Directly Compatible with TTL Logic 16Pin Dual In-Line Ceramic or Plastic
Circuits Package
The Intel@ 8205 decoder can be used for expansion of systems which utilize input ports, output ports, and memory
components with active low chip select input. When the 8205 is enabled, one of its 8 outputs goes "low", thus a single
row of a memory system is selected. The 3-chip enable inputs on the 8205 allow easy system expansion. For very large
systems, 8205 decoders can be cascaded such that each decoder can drive 8 other decoders for arbitrary memory
expansions.
The 8205 is packaged in a standard 16-pin dual in-line package, and its performance is specified over the temperature
range of OC to +75C, ambient. The use of Schottky barrier diode clamped transistors to obtain fast switching speeds
results in higher performance than equivalent devices made with a gold diffussion process.
Ao 16 V-cc Ao
Al 15 00 Al 0,
A2 14
1 A2 02
El 4 13 2 03
8205 8205
E2 12 03
04
E3 6 11 4 E, 05
07 10 5 E2 Os
GRD 8 9 06
E3 07
E I' E3
00' 07
ENABLE INPUTS
DECODED OUTPUTS
1 H
L
H
H
L
L
L
H
H L
L
L
L
L
L
H
H
H
H
H
H
H
H
H
H
H
H
L
H
H
H
L
H
H
H
L
H
H
H
H
H
H
L H H L L H H Ii H H H H L H
H H H L l H H H H H H H H L
X X X l l L H H H H H H H H
X X X H L L H H H H H H H H
X X X L H L H H H H H H H H
X X X H H L H H H H H H H H
X X X H L H H H H H H H H H
X X X l H H H H H H H H H H
X X X H H H H H H H H H H H
7-74 AFN-00204B-01
8205
FUNCTIONAL DESCRIPTION
Decoder
AO ~
The 8205 contains a one out of eight binary decoder. It ac-
A, 0,
cepts a three bit binary code and by gating this input. creates
an exclusive output that represents the value of the input A2 2
code.
3
For example. if a binary code of 101 was present on the AO. DECODER
A 1 and A2 address input lines. and the device was enabled. 4
an active low signal wou Id appear on the 05 output line.
Os
Note that all of the other output pins are sitting at a logic
high. thus the decoded output is said to be exclusive. The Os
decoders outputs will follow the truth table shown below in
0;
the same manner for all other input variations.
Enable Gate
7-75 AFN-00204B-02
8205
D.C. CHARACTERISTICS
8205
LIMIT
SYMBOL PARAMETER UNIT TEST CONDITIONS
MIN. MAX.
IF INPUT LOAD CURRENT -0.25 mA Vee = 5.25V, V F = 0.45V
TYPICAL CHARACTERISTICS
,
vee = 5.0V TA = 750C
II
"
TA = OOC
60 -20 3.0
J [\ ~
J' I TA = 25"C-
-,
-\- --\1\
,
40 2.0
-30
I[ \
"
TA = 75OC- \
20
TA = 75OC ........
~ -40 I 1.0 \
1. '- t- \ \
..M
.2
-.4
T~ = ooc
t- TA = 25"C
.6 .8 1.0
-50
1.0
/J
2.0 3.0 4.0 5.0 o .2 .4 .6 .8 1.0
\.. ~ ~
1.2 1.4 1.6 1.8 2.0
OUTPUT "LOW" VOL TAGE (V) OUTPUT "HIGH" VOLTAGE (V) INPUT VOLTAGE (V)
7-76 AFN-00204B-05
8205
SWITCHING CHARACTERISTICS
Test Waveforms
ADDRESS OR ENABLE
INPUT PULSE
OUTPUT
A.C. CHARACTRISTICS
TA = QOCto +75C,V CC = 5V 5% unless otherwise specified.
SYMBOL PARAMETER MAX. LIMIT UNIT TEST CONDITIONS
t++ 18 ns
t_+ ADDRESS OR ENABLE TO 18 ns
OUTPUT DE LA Y 18 ns
t+_ --
t -- 18 ns
CIN (1) INPUT CAPACITANCE P8205 4(typ.) pF f = 1 MHz, Vee = OV
C8205 5(typ.) pF VBIAS = 2.0V, T A ~ 250 e
1. This parameter IS periodically sampled and IS not 100% tested.
TYPICAL CHARACTERISTICS
ADDRESS OR ENABLE TO OUTPUT ADDRESS OR ENABLE TO OUTPUT
DELAY VS. LOAD CAPACITANCE DELAY VS. AMBIENT TEMPERATURE
20,-----,-----,------,-----, 20,-------,--------.-1------.
Vec = 5.0V
CL = 30 pF
15 15r--------~-------.~1~----~
-:~~.:.~~-~------
10
O~------~------~------~
50 100 150 200 o 25 50 75
LOAD CAPACITANCE (pFI AMBIENT TEMPERATURE lOCI
7-77 AFN-00204B-06
8251A/S2657
PROGRAMMABLE COMMUNICATION INTERFACE
Ii Synchionous and Asynchronous Asynchronous Baud Rate - DC to
Operation 19.2K Baud
Full Duplex, Double Buffered, Trans
Synchronous 58 Bit Characters; mitter and Receiver
Internal or External Character Synchro
nization; Automatic Sync Insertion Error Detection - Parity, Overrun and
Framing
Asynchronous 58 Bit Characters; Fully Compatible with 8080/8085 CPU
Clock Rate-1, 16 or 64 Times Baud
Rate; Break Character Generation; 1, 28Pin DIP Package
1112, or 2 Stop Bits; False Start Bit
Detection; Automatic Break Detect All Inputs and Outputs are TTL
and Handling. Compatible
Single + 5V Supply
Synchronous Baud Rate - DC to 64K
Baud Single TTL Clock
The Intel 8251A is the enhanced version of the industry standard, Intel 8251 Universal Synchronous/Asynchronous
Receiver/Transmitter (USART), designed for data communications with Intel's new high performance family of
microprocessors such as the 8085. The 8251A is used as a peripheral device and is programmed by the CPU to operate
using virtually any serial data transmission technique presently in use (including IBM "bi-sync"). The USART accepts
data characters from the CPU in parallel format and then converts them into a continuous serial data stream for
transmission. Simultaneously, it can receive serial data streams and convert them into parallel data characters for the
CPU. The USART will signal the CPU whenever it can accept a new character for transmission or whenever it has
received a character for the CPU. The CPU can read the complete status of the USART at any time. These include data
transmission errors and control signals such as SYNDET, TxEMPTY. The chip is constructed using N-channel silicon
gate technology.
~-- ---~-~-----~--~~--
PIN CONFIGURATION
BLOCK DIAGRAM
DI
Do
RxD Vel
GND RxC
DTR 0 7 "0 0
RTS
Dr, DSR
D, RESET
TxC ClK
WR TxD
CS TxEMPTY
C/O CTS
RD SYNDET/SO
RxRDY TxRDY
--......----~
PIN NAMES
--_._-------
~;~~r~~~:8D~lt~11S i
01- 0 0 OSR Data Set Ready
C/O !O be Written or Redd OTR Data Terminal Ready
fill
~R
~::t~ ~:~: ~~~':nat~:1 Commdnd II
SYNOET/SO SyncOetectl
Break Detect
CS Chip Enable I RTS Request to Send Data
CLK Clock Pulse ITTLI
RESET Reset CTS Clear to Send Data
hl Transmitter Clock TxE Transmitter Empty
TxD Transmitter Data Vee +5 Volt Supply
RXC Receiver Clock
GNO Ground
RxD Receiver Data
RxRDY Receiver Ready (has chClracter for 80801
TxRDY Transmitter Ready (ready for char from BOBOl
7-78
8251 A/~2t)5 7
In asynchronous operations, the Receiver The 8251 A Status can be read at any time
detects and handles "break" automatically, but the status update will be inhibited during
relieving the CPU of this task. status read.
A refined Rx initialization prevents the The 8251 A is free from extraneous gl itches
Receiver from starting when in "break" and has enhanced AC and DC characteristics,
state, preventing unwanted interrupts from providing higher speed and better operating
a disconnected USART. margins.
At the conclusion of a transmission, TxD Synchronous Baud rate from DC to 64K.
line will always return to the marking state Fully compatible with Intel's new industry
unless SBRK is programmed. standard, the MCS-85.
7-79 00216A
8251 A/S2657
ABSOLUTE MAXIMUM RATINGS* *COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating only and functional opera
c
.A.mbient Temperature Under Bias . . . . . . . . . OC to 70 e tio{1 of the device at these or any other conditions above
Storage Temperatur~ . . . . . . . . . . . . . . -65C to +150C those indicated in the operational sections of this specifi-
Voltage On Any Pin cation is not implied. Exposure to absolute maximum
With Respect to Ground . . . . . . . . . . . . -0.5V to + 7V rating conditions for extended periods may affect device
Power Dissipation . . . . . . . . . . . . . . . . . . . . . . . 1 Watt reliability.
D.C. CHARACTERISTICS
T A = OC to 70C; Vee = 5.0V 5%; GND = OV
CAPACITANCE
TA = 25C; Vee = GND = OV
+20
+10
0:
2V >
~Cl
....
~
lN914
....
::l
0
-1
8251A t-----,--+---o OUT -10
6K
Figure 16. Test Load Circuit Figure 17. Typlcalll Output Delay vs. Il
Capacitance (pF)
780 00216A
8251 A/S2657
A.C. CHARACTERISTICS
Write Cycle:
NOTES: 1. AC timings measured VOH = 2.0, VOL = 0.8, and with load circuit of Figure 1.
2. Chip Select (CS) and Command/Data (C/O) are considered as Addresses.
3. Assumes that Address is valid before R Dt.
4. This recovery time is for Mode Initialization only. Write Data is allowed only when TxRDY = 1.
Recovery Time between Writes for Asynchronous Mode is 8 tCY and for Synchronous Mode is 16 tCY.
0.45
______X:::
2.4 - - - - - - , . ,.----------------...
7-81 00216A
8251A/S2657
Other Timings:
SYMBOL PARAMETER IMIN. MAX. UNIT TEST CONDITIONS
tCY Ciock Period 320 1350 ns Notes 5, 6
tq> Clock High Pulse Width 140 tCY-9O ns
qj Clock Low Pulse Width 90 ns
tR, tF Clock Rise and Fall Time 20 ns
tDTx TxD Delay from Falling Edge of TxC 1 ps
fTx Transmitter Input Clock Frequency
1x Baud Rate DC 64 kHz
16x Baud Rate DC 310 kHz
64x Baud Rate DC 615 kHz
tTPw Transmitter Input Clock Pulse Width
1x Baud Rate 12 tCY
16x and 64x Baud Rate 1 tCY
tTPD Transmitter Input Clock Pulse Delay
1x Baud Rate 15 tCY
16x and 64x Baud Rate 3 tCY
fRx Receiver Input Clock Frequency
1x Baud Rate DC 64 kHz
16x Baud Rate DC 310 kHz
64x Baud Rate DC 615 kHz
tRPW Receiver Input Clock Pulse Width
1x Baud Rate 12 tCY
16x and 64x Baud Rate 1 tCY
tRPD Receiver Input Clock Pulse Delay
1x Baud Rate 15 tCY
16x and 64x Baud Rate 3 tCY
tTxRDY TxRDY Pin Delay from Center of last Bit 8 tCY Note 7
tTxRDY CLEAR TxRDY t from Leading Edge of WR 6 tCY Note 7
tRxRDY RxRDY Pin Delay from Center of last Bit 24 tCY Note 7
tRxRDY CLEAR RxRDY ,} from Leading Edge of RD 6 tCY Note 7
tiS Internal SYNDET Delay from Rising
24 tCY Note 7
Edge of RxC
tES External SYNDET Set-Up Time Before
16 tCY Note 7
Falling Edge of RxC
tTxEMPTY TxEMPTY Delay from Center of Last Bit 20 tCY Note 7
twc Control Delay from Rising Edge of 8 tCY Note 7
WRITE {TxEn, DTR, RTS)
tCR Control to READ Set-Up Time (DSR, CTS) 20 tCY Note 7
5. The TxC and RxC frequencies have the following limitations with respect to ClK.
For 1x Baud Rate, fTx or fRx ,,;; 1/(30 tCY)
For 16x and 64x Baud Rate, fTx or fRx";; 1/(4.5 tCY)
6. Reset Pulse Width = 6 tCY minimum; System Clock must be running during Reset.
7. Status update can have a maximum delay of 28 clock periods from the event affecting the status.
7-82 00216A
inter
8253/82535
PROGRAMMABLE INTERVAL TIMER
MCS-85 Compatible 82535 Count Binary or BCD
The Intel\!) 8253 is a programmable counter/timer chip designed for use as an Intel microcornputer peripheral. It uses
nMOS technology with a single +5V supply and is packaged in a 24-pin plastic DIP.
It is organized as 3 independent 16-bit counters, each with a count rate of up to 2 MHz. All modes of operation are soft-
ware programmable.
D7 Vee
ClK 0
D6 WR DATA
Ds AD BUS GATE 0
BUFFER
D4 cs OUT 0
D3 A,
D2 Ao
D, eLK 2
Do OUT 2
RD---Cf
eLK 0 GATE 2 ClK 1
OUT 0 eLK 1
GATE 1
GATE 0 GATE 1
GND OUT 1 OUT 1
CS--------'
INTel CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE OF ANY CIRCUITRY OTHER THAN CIRCUITRY EMBODIED IN AN INTel PRODUCT. NO OTHER CIRCUIT PATENT LICENSES ARE IMPliED.
'0 INTel CORPORATION. 1979 7-83 AFN-00745A-Ol
8253/82535
RD (Read) -
CS RD WR A, Ao
A "low" on this input informs the 8253 that the CPU is
0 1 0 0 0 Load Counter No. 0
inputting data in the form of a counters value.
0 1 0 0 1 Load Counter No.1
WR (Write) 0 1 0 1 0 Load Counter No. 2
A "low" on this input informs the 8253 that the CPU is
0 1 0 1 1 Write Mode Word
outputting data in the form of mode information or loading
counters. 0 0 1 0 0 Read Counter No. 0
0 0 1 0 1 Read Counter No. 1
0 0 1 1 0 Read Counter No.2
0 0 1 1 1 No-Operation 3-State
1 X X X X Disable 3-State
0 1 1 X X No-Operation 3State
784 AFN-0074SA-02
8253/82535
8253
11
Figure 3. 8253 System Interface
7-85 AFN-00745A-03
8253/82535
CLOCK CLOCK
2 4
WRn~ I OUTPUT In =4)
I
o OUTPUT In =5)
OUTPUT (INTERRUPT) I
In=4) I-+-n-:
I I
I I
WRm~
, ,
TRIGGER
~
4
OUTPUT
~~--------~
LOADn~
TRIGGER~
4 3 2 3 2 1 GATE -----~~~------
OUTPUT - - , L_ _ _ _ _ _ _ _- ' o
OUTPUT ------~----~~--~~
CLOCK
GATE -----1
4
OUTPUT In = 4)
LJ
GATE~
4343210
OUTPUT In = 4) U
786 AFN-00745A-06
8253/8253-5
All counters are down counters. Thus, the value loaded Count Register Byte
into the count register will actually be decremented.
No.4 LSB 0 1
Counter'
Loading all zeroes into a count register will result in the
Count Register Byte
maximum count (2 '6 for Binary or 104 for BCD). In MODE a 0 1
the new count will not restart until the load has been No. 5 MSB Counter'
completed. It will accept one of two bytes depending on
how the MODE control words (RLO. RL 1) are program- No.6 LSB
Count Register Byte
Counter 2
, 0
med. Then proceed with the restart operation.
No. 7 MSB
Count Register Byte
Counter 2
, 0
7-87 AFN-0074SA-07
8253/82535
There are two methods that the programmer can use to Reading While Counting
read the value ot'the counters.' The first method involves
the use of simple 1/0 read operations of the selected In order for the programmer to read the contents of any
counter. By controlling the AD, A 1 inputs to the 8253 the counter without effecting or disturbing the counting
programmer can select the counter to be read (remember operation the 8253 has special internal logic that can be
that no read operation of the mode register is allowed AD, accessed using. simple WR commands to the MODE
A1-11). The only requirement with this method is that in register. Basically, when the programmer wishes to read
order to assure a stable count reading the actual operation the contents of a selected counter "on the fly" he loads the
of the selected counter must ~ inhibited either by MODE register with a speCial code which latches the
controlling the Gate input or by external logic that inhibits present count value into a storage register so that its
the clock input. The contents of the counter selected will contents contain an accurate, stable quantity. The
be available as follows: programmer then issues a normal read command to the
selected counter and the contents of the latched register is
first 1/0 Read contains the least significant byte (LSB). ayatlable.
second 1/0 Read contains the most significant byte
(MSB). MODE Register for Latching Count
Due to the .internal logic of the 8253 It is absolutely AO, A1 11
necessary to complete the entire reading procedure. If two
bytes are programmed to be read then two bytes must be
read before any loading WR command can be sent to the
same counter.
3MHz 1.5MHz
CLK 2 CLK
8085 8253-5
*If an 8085 clock output is to drive an 8253-5 clOck input, it must be reduced to 2 MHz or less_
7-88 AFN-0074SA-08
8253/82535
ABSOLUTE MAXIMUM RATINGS 'COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating only and functional opera-
Ambient Temperature Under Bias OCto 70C
tion of the device at these or any other conditions above
Storage Temperature -65 C to +150 C
Voltage On Any Pin those indicated in the operational sections of this specifi-
With Respect to Ground -0.5 Vto +7 V cation is not implied. Exposure to absolute maximum
Power Dissipation 1 Watt rating conditions for ex tended periods may affect device
reliabili tv.
D
D.C. CHARACTERISTICS (TA = ODC to 70 C; Vee = 5V 5%)
D
CAPACITANCE TA = 25 C; Vee = GND = OV
7-89 AFN-00745A-09
8253/82535
Read Cycle:
8253 8253-5
SYMBOL PARAMETER MIN. MAX. MIN. MAX. UNIT
Write Cycle:
8253 8253-5
SYMBOL PARAMETER MIN. MAX. MIN. MAX. UNIT
____
Ao-1. CS
J~~--------------~~~-------
DATA BUS
2 . 4 - - -...
0.45 _ _ _..J X
> 2
<:::x'----
7-90 AFN-00745A-l0
8253/82535
8253 82535
SYMBOL PARAMETER MIN. MAX. MIN. MAX. UNIT
AFN-Q0745A-11
7-91
8255A/8255A5
PROGRAMMABLE PERIPHERAL INTERFACE
The Intel@ 8255A is a general purpose programmable 1/0 device designed for use with Intel@ microprocessors. It has
241/0 pins which may be individually programmed in 2 groups of 12 and used in 3 major modes of operation. In the first
mode (MODE 0), each group of 121/0 pins may be programmed in sets of 4 to be input or output. In MODE 1, the second
mode, each group may be programmed to have 8 lines of input or output. Of the remaining 4 pins, 3 are used for hand-
shaking and interrupt control signals. The third mode of operation (MODE 2) is a bidirectional bus mode which uses 8
lines for a bidirectional bus, and 5 lines, borrowing one from the other group, for handshaking.
S~~:L~~S { - - +5V
-_GND 10
PA7-PAO
10
pe7- pee
PIN NAMES
0 7 -0. DATA BUS (BI-DIRECTIONAL)
RESET RESET INPUT
CS CHIP SElECT
RD READ INPUT
WR WRITE INPUT
AO.A1 PORT ADDRESS
PA7PAO PORT A (BIT)
P87P80 PORTB (BIT)
PC7.f'CO PORTe (BIT)
Vee +5 VOLTS
GND 'VOLTS
AFN-00744A-01
7-92
8255A18255A5
trol busses and in turn, issues commands to both of the 0 0 1 0 0 DATA BUS = PORT A
Control Groups. 0 1 1 0 0 DATA BUS = PORT B
1 0 1 0 0 DATA BUS = PORT C
1 1 1 0 0 DATA BUS = CONTROL
DISABLE FUNCTION
(CS) X X X X 1 DATA BUS =
3-STATE
1 1 0 1 0 I LLEGAL CONDITION
Chip Select. A "low" on this input pin enables the com-
muniction between the 8255A and the CPU. X X 1 1 0 DATA BUS=3-STATE
Figure 1. 8255A Block Diagram Showing Data Bus Buffer and Read/Write Control Logic Functions
7-93 AFN-00744A-02
8255A18255A5
PIN CONFIGURATION
PAl
PA6
_ _ +,v
POWER
SUPPLIES { -_GNO 10
FlA7-PAO Do
0,
0,
OJ
8255A D.
0,
10
PC7-PC4
10
PC3-PCO P85
PBl l 19 22 "l P84
P82f 20 21 1 PBJ
10 PIN NAMES
PB7-PBO
794 AFN-00744A-03
's18255A18255Ao5 ~
ABSOLUTE MAXIMUM RATINGS *COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating only and functional opera-
Ambient Temperature Under Bias . . . . . . . . . OC to 70C tion of the device at these or any other conditions above
Storage Temperature . . . . . . . . . . . . . . -65"C to +150C those indicated in the operational sections of this specifi-
Voltage on Any Pin cation is not implied. Exposure to absolute maximum
With Respect to Ground . . . . . . . . . . . . -O.5V to + 7V rating conditions for ex tended periods may affect device
Power Dissipation . . . . . . . . . . . . . . . . . . . . . . . 1 Watt reliabili tv.
D.C. CHARACTERISTICS
TA = OC to 70C. Vee = +5V 5%; GND = OV
CAPACITANCE
TA = 25C; Vee = GND = ov
SYMBOL PARAMETER MIN. TYP. MAX. UNIT TEST CONDITIONS
~~~!~
L:.:.J l ___ :YV ------,.., VEXT*
I 100PF
AFN-00744A-17
795
8255A/8255A5
A.C. CHARACTERISTICS
TA = oc to 70C; VCC = +5V 5%; GND = OV
Bus Parameters
Read:
8255A
SYMBOL PARAMETER MIN. MAX. UNIT
Write:
8255A
SYMBOL PARAMETER MIN. MAX. UNIT
Other Timings:
8255A
SYMBOL PARAMETER MIN. MAX. UNIT
7-96 AFN-00744A-18
8255A18255A5
2.4------....
~2.0X
X
2.O -.
0.45 _ _ _ _ ~ 0.8';::' TEST POINTS ---... O.~ '-_ _ _ __
RO
WR
--~-'wD-j
i------tAW--------i i------'wA----~
CS. Al. AO
OUTPUT
7-97 AFN-00744A-19
8255A18255A5
______________~I------t.T------Ir_--~------------------------------~~-----------
IBF
INTR
INPUT FROM _ _ _
PERIPHERAL
I-----tps-------I
INTR
OUTPUT
798 AFN-00744A-20
8255A18255A5
DATA FROM
~ 8080 TO 8255
INTR
IBF
PERIPHERAL _ _ _ _ _ _ _ _ _ _
BUS
DATA FROM
PERIPHERAL TO 8255
DATA FROM
8255 TO 8080
NOTE: Any sequence where WR occurs before ACK and STB occurs before RD is permissible.
(INTR = IBF MASK STB RD + OBF MASK' ACK WR I
7.00
intel"
ftft.,
O~ I ..II '8ft .,..
~ I . - 6,'8 7" 8
ft
~
IBM 3740 Soft Sectored Format Compatible Internal CRC Generation and Checking
Programmable Record Lengths Programmable Step Rate, Settle Time, Head
Load Time, Head Unload Index Count
MultlSector Capability
Overhead
Maintain Dual Drives with Minimum Software Fully MCSSOTM and MCSSS Compatible
Expandable to 4 Drives
Single + SV Supply
Automatic Read/Write Head Positioning and
Verification 40Pln Package
The Intel~ 8271 Programmable Floppy Disk Controller (FOC) is an LSI component designed to interface one to 4 floppy
disk drives to an 8bit microcomputer system. Its powerful control functions minimize both hardware and software
overhead normally associated with floppy disk controllers.
PIN NAMES
~~-DBo DATA 8US IBIDlRECTlONAl) PLOISS
CLOCk INPUT ITTL) DATA WINDOW DATA WINDOW
!~~~CTT~E:ET/OPTIONAl OUTPUT
SELECT 1,0 UNSEPOATA UNSE'AAA TE 0 DA T A
FAUlTRSET/OPO fAul'T FAULT
RUU CHIPAESET WRDATA WRITE DATA
mIW'l . READY 1,0 ~ COUNT/OPTIONAllNPUT
~ OM" 4CkNOWLIEDGE mo THACkO
INTERNAL
""Q WAPAOTECT WAITEPAOTECT DATA BUS
Ii!5 iNDEX INDEX
iII1I WAITE ENABLE
SEEK/STEP SEEK/STEP
~~S:NC
DIRECTION
CPU INTERFACE
LOAD HEAD
~ lOWCUARENT
AFN-00223A
7100
8271/82716/82718
.----------
8271 BASIC FUNCTIONAL DESCRIPTION Pin Pin
Name No. 1/0 Description
General
A,-Ao (22-21) I These two lines are CPU Inter-
The 8271 Floppy Disk Controller (FOC) interfaces either
face Register select lines.
two single or one dual floppy drive to an eight bit
microprocessor and is fully compatible with Intel's DRQ (8) 0 The DMA request signal is used to
new high performance MCS-85 microcomputer system. request a transfer of data between
the 8271 and memory.
With minimum external circuitry, this innovative controller
supports most standard, commonly-available flexible disk (7) The DMA acknowledge signal
drives including the mini-floppy. notifies the 8271 that a DMA cycle
has been granted. For non-DMA
The 8271 FOC supports a comprehensive soft sectored transfers, this signal should be
format which is IBM 3740 compatible and includes driven in the manner of a "Chip
provision for the designating and handling of bad tracks. It Select".
is a high level controller that relieves the CPU (and used of
Select 1- (6) 0 These lines are used to specify the
many of the control tasks associated with implementing a
Select a (2) selected drive. These lines are set
floppy disk interface. The FOC supports a variety of high by the command byte.
level instructions which allow the user to store and retrieve
Fault Reset/ (1) 0 The optional fault reset output line
data on a floppy disk without dealing with the low level
OPO is used to reset an error condition
details of disk operation. which is latched by the drive. If
In addition to the standard read/write commands, a scan this line is not used for a fault
command is supported. The scan command allows the reset it can be used as an optional
user program to specify a data pattern and instructs the output line. This line is set with
FOC to search for that pattern on a track. Any application the write special register com-
mand.
that is required to search the disk for information (such as
point of sale price lookup, disk directory search, etc.), may Write Enable (35) O This signal enables the drive write
use the scan command to reduce the CPU overhead. Once logic.
the scan operation is initiated, no CPU intervention is Seek/Step (36) 0 This mUlti-function line is used dur-
required. ing drive seeks.
Direction (37) 0 The direction line specifies the
Hardware Description seek direction. A high level on
The 8271 is packaged in a 40 pin DIP. The following is a this pin steps the R/W head
functional description of each pin. toward the spindle (step-in), a
low level steps the head away
Pin Pin from the spindle (step-outl.
Name No. I/O Description
Load Head (38) 0 The load head line causes the
Vee (40) +5V supply drive to load the Read/Write head
GND (20) Ground against the diskette.
Clock (3) A square wave clock Low Current (39) 0 This line notifies the drive that track
43 or greater is selected.
Reset (4) A high signal on the reset input
forces the 8271 to an idle state. Ready 1, (5) These two lines indicate that the
The 8271 remains idle until a com- Ready a (32) specified drive is ready.
mand is issued by the CPU. The (28)
Fault This line is used by the drive to
output signals of the drive inter-
specify a file unsafe condition.
face are forced inactive (LOW).
Reset must be active for 10 or Count/OPI (30) If the optional seek/direction/
more clock cycles. count seek mode is selected, the
count pin receives pulses to step
(24) The 1/0 Read and 1/0 Write inputs the R/W head to the desired track.
are enabled by the chip select signal. Otherwise, this line can be used
DBrDBo (19-12) 1/0 The Data Bus lines are bidirection- as an optional input.
al, three-state lines (8080 data Write Protect (33) This signal specifies that the
bus compatible). diskette inserted is write pro-
(10) The Write signal is used to signal tected.
the control logic that a transfer of TRKO (31) This signal indicates when the RIW
data from the data bus to the 8271 head is positioned over track zero.
is required.
(9)
Index (34) The index signal gives an indication
The Read signal is used to signal
of the relative position of the diskette.
the control logic that a transfer of
data from the 8271 to the data bus PLO/SS (25) This pin is used to specify the type
is required. of data separator used. Phase-
INT (11) 0 The interrupt signal indicates that Locked Oscillator/Single Shot.
the 8271 requires service. Write Data (29) 0 Composite write data.
7-101 00223A
8271/82716/82718
lilT L
Data Window (26) This is a data window established oI0 I I I I0 I
~,"'m""
by a single-shot or phase-locked
oscillator data separator.
INSYNC (23) 0 This line is high when 8271 has ::::~::::: ~~::
attained input data synchroni- DELETED DATA FOUND
zation, by detecting 2 bytes of L..-_ _ _ _ _ _ _ _ _ _ NOT USED = 00
zeros followed by an expected
Address Mark. It will stay high
until the end of the ID or data
field.
A, Ao 07 06 05 04 03 02 0, Do
I 0 I0 I I
I0 I0 I I I I I0 I0 I
SURFACE/DRIVE
.
I 1 = INTERRUPT REQUEST
(SELECT o. 11
1 = RESULT REGISTER FULL
7-102 00223A
8271/82716/82718
D.C. CHARACTERISTICS
Vee= + 5.0V 5%
8721 and 8271-8: TA= OC to 70C; 8271-6: T A = OC to 50C
CAPACITANCE
TA=25C, Vcc=GND=OV
Symbol Parameter Min. Typ. Max. Unit Test Conditions
CIN Input Capacitance 10 pF tc= 1 MHz
CliO I/O Capacitance 20 pF Unmeasured Pins Returned to GND
7_1n~ nn??~A
8271/82716/82718
A.C. CHARACTERISTICS
Vcc= + 5.0V 5%
8271 and 82718: TA = ooe to 7o oe; 82716: T A:: ooe to 50 0 e
Read Cycle
Symbol Parameter Min. Max. Unit Test Conditions
tAc Select Setup to RD 0 ns Note 2
tCA Select Hold from RD 0 ns Note 2
tRR RD Pulse Width 250 ns
tAD Data Delay from Address 250 ns Note 2
tRO Data Delay from RD 150 ns C L = 150 pF, Note 2
C L = 20 pF for Minimum;
tOF Output Float Delay 20 100 ns
150 pF for Maximum
toc DACK Setup to RD 25 ns
tco DACK Hold from RD 25 ns
tKO Data Delay from DACK 250 ns
Write Cycle
Symbol Parameter Min. Max. Unit Test Conditions
tAC Select Setup to WR 0 ns
tCA Select Hold from WR 0 ns
tww WR Pulse Width 250 ns
tow Data Setup to WR 150 ns
two Data Hold from WR 0 ns
toc DACK Setup to WR 25 ns
tco DACK Hold from WR 25 ns
DMA
Symbol Parameter Test Conditions
tca Request Hold from WR or RD (for NonBurst Mode)
Other Timing
8271/82716 82718
Symbol Parameter Unit Test Conditions
Min. Max. Min. Max.
NOTES:
1. All timing measurements are made at the reference voltages unless otherwise specified: Input "1" at 2.0V, "0" at O.BV
Output "1" at 2.0V, "0" at 0.8V
2. tAD, tRO, tAC, and tCA are not concurrent specs.
3. Standard Floppy: tCY = 250 ns 0.4% Mini-Floppy: tCY = 500 ns 0.4%
7104 00223A
8271/82716/82718
WAVEFORMS
Read Waveform,
OACK
=> -toc-
X
I---tco-------=I
) 1(
I
tRR . I-tcA-1
~ 1
~
-tAC-- tRO OF
I-t - } _______
DATA BUS --- ------------
. tAD
tKO
Write Waveforms
OACK
toc--" -tco-
-----:..- ..
~ i J(
I---tAC--' ,- tww -tCA-l
\... ,
DATA BUS )( )(
I tow tw~~
DMA Waveforms
__~I
r 'cc~
ORQ
\_--+-------------------------------
~ORWR ------------------~~ _______________________________________ _
CHIP CLOCK
7-105 OO223A
8271182716182718
WRITE DATA PW
r--F-I
PULSE WIDTH PW = tCY 30 ns *tCY = 250 ns 0.4% **tCY = 500 ns 0.4%
H (HALF BIT CELL) = 8 tCY 250 ns 30 ns 500 ns 30 ns
F (FULL BIT CELL) = 16 tCY 2.0 lAS 8 ns 4.0 lAS 16 ns
4.0 lAS 16 ns 8.0 lAS 32 ns
READ DATA
F = 16 tCY 8 tCY
H = 8 tCY 4 tCY
7106 00223A
8271/82716/82718
UNSEPARATED
DATA
DATA
WINDOW
tDH~Ons-
*DAfA
WINDOW
7-107 00223A
8273, 8273-4, 8273-8
PROGRAMMABLE HOLC/SOLC PROTOCOL
CONTROLLER
CCITT X.25 Compatible Programmable N RZI Encode/ Decode
H OLC/SDLC Compatible Two User Programmable Modem
SOLC
Full Duplex, Half Duplex, or Loop
Operation
Control Ports
Recovery
Digital Phase Locked Loop Clock
Transfers
Up to 64K Baud Synchronous
A,
PIN NAMES RESET RxD
R;c
080-DB7 DATA BUS (8 BITS) CS CHIP SELECT
~ FLAG DETECT 32.CLK 32 TIMES CLOCK Cs
T.INT TRANSMITTER INTERRUPT R.D RECEIVER DATA CLK
FLAG DEl
CLK CLOCK INPUT R. C RECEIVER CLOCK
RESET RESET T. C TRANSMITTER CLOCK
~ TRANSMITTER DMA ACKNOWLEDGE T.D TRANSMITTER DATA
T.DRQ TRANSMITTER DMA REQUEST ill CLEAR TO SEND CPU INTERFACE MODEM INTERFACE
Rl5 READ INPUT ED CARRIER DETECT
iiII WRITE INPUT PA2-PAC GP INPUT PORTS
~-P84 ~~g~::~~6~~~~
R.DACK RECEIVER OMA ACKNOWLEDGE
R. DRQ RECEIVER OMA REQUEST
R. INT RECEIVER INTERRUPT Vee +5 VOLT SUPPL Y
AO-Al COMMAND REGISTER SELECT ADDRESS GND GROUND
l5nt DIGITAL PHASE LOCKED LOOP
7108
8273, 82734, 82738
VARIABLE LEN.GTH
01111110 8 BITS 8 BITS (ONL Y IN I FRAMES) 16 BITS 0' , , , '10
7-109
8273, 82734, 82738
ABSOLUTE MAXIMUM RATINGS 'COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
AmbientTemperatureUnderBias ........ OCt070C device. This is a stress rating only and functional
Storage Temperature ............... -65 C to +150C operation of the device at these or any other conditions
above those indicated in the operational sections of this
Voltage on Any Pin With
specification is not implied. Exposure to absolute
RespecttoGround ..................... -O.5Vto+7V
maximum rating conditions for extended periods may
Power Dissipation ......... . . . . . . . . . . . . . . . . .. 1 Watt affect device reliability.
CAPACITANCE (8273,82734,82738)
TA=25C, Vcc=GND=OV
A.C. CHARACTERISTICS
TA=OC to 70C, Vcc= +5.0V5%
Clock Timing (8273)
7111
8273, 82734, 82738
Symbol
I I I r lalli' I M'lin. Max. I Iunh
I '&I .65, "onuhions
tAC Select Setup to RD 0 ns Note 3
tCA Select Hold from RD 0 ns Note 3
tRR RD Pulse Width 250 ns
tAD Data Delay from Address 300 ns Note 3
tRD Data Delay from RD 200 ns Cl = 150pF, Note 3
tOF Output Float Delay 20 100 ns
=
C l 20 pF for Minimum;
150pF for Maximum
toc DACK Setup to RD 25 ns
tCD DACK Hold from RD 25 ns
tKD Data Delay from DACK 300 ns
Write Cycle
DMA
Other Timing
NOTES:
1. All timing measurements are made at the reference voltages unless otherwise specified: Input "1" at 2.0V, "0" at 0.8V;
Output "1" at 2.0V, "0" at 0.8V.
2. tAD, tRO, tAC, and tCA are not concurrent specs.
7112
8273, 8273-4, 8273-8
WAVEFORMS
Read Waveforms
I
DACK
--
~
i---'oc
).
~~ICO
)(
1<.
~I
'RR _1~ICA--.:J
~
I---IDF-~
~
_IAC-- IRD
_______
Write Waveforms
DACK ~ I I 0
:;;::;;
AO' A,. csi
~ ](
~IAC---~- IWW I--ICA~
DATA BUS )( ](
I IDW two---J
DMA Waveforms
--II
r ICO~
DRQ __
\~----~-------------------------------
R5 OR WR --{L--_ _ __
t tCY =l
CHIP CLOCK
L."~.'" ----1--------J1
~ tCY32 =:1
32X CLOCK 1
CtCL32=--:CtCH32J-----J
7-113 00743A
8273,8273-4, 8273-8
,r
-'~
j
~~--------------~ ~~-----------------
- - - - - IDCl ---~----I 1---
k - - - - - - - - - - - - IDCY -------
TxD \J~
____________~---'A~~----------------------------------J
7-114 00743A
8275
PROGRAMMABLE CRT CONTROLLER
Programmable
Format
Screen and Character Compatible
Fully MCSSO and MCSSS
The Intell!> 8275 Programmable CRT Controller is a single chip device to interface CRT raster scan displays with
Intell!> microcomputer systems. Its primary function is to refresh the display by buffering the information from main
memory and keeping track of the display position of the screen. The flexibility designed into the 8275 will allow simple
interface to almost any raster scan CRT display with a minimum of external hardware and software overhead.
LC3 vcc
LC2 LAO
LC, LA,
CCLK
LCO LTEN
ORO RVV
DACK VSP
HRTC GPA,
VRTC GPAO
RD HLGT 0110-7 CCO_6
WR IRa
LPEN CCLK
DBo CC6
DB, CC5
DB2 CC4
DB3 CC3 ORO _ - - - - - - , LCO_3
DB4 CC2 OACK
DB5 CC, IRa
DB6 CCo
DB7 cs
GND AO
LAo-l
HRTC
VRTC
HLGT
RVV
PIN NAMES LTEN
VSP
GPAO_l
~;-i- Bl-DIRECTIDNAL DATA BUS LCO-3 LINE COUNTER OUTPUTS
DRO DMA REOUEST OUTPUT LAo-l LINE ATTRIBUTE OUTPUTS
lim DMA ACKNOWLEDGE INPUT HRTC HORIZONTAL RETRACE OUTPUT LPEN
i-liia-- INTERRUPT REOUEST OUTPUT VRTC VERTICAL RETRACE OUTPUT
1m READ STROBE INPUT HLGT HIGHLIGHT OUTPUT
WI! WRITE STROBE INPUT RVV REVERSE VIDEO OUTPUT
1-1-=-csAo---+-c-CR=_HE=Glpl=STSE=ELRE=-=CAT=DID=NRPU=ESST=INP:::cU=-T_---tt_-H -:C-=-vspLT~E=N=~~LIG~H~T~EN~AB~L~EO~U~TP~UT~=======:::i
VIDEO SUPPRESS OUTPUT
CCLK CHARACTER CLOCK INPUT GPAo-l GENERAL PURPOSE ATTRIBUTE OUTPUTS
,-,-CC",-O_-'06-,-_C,-H_AR_A,,-,-CT-,-ER-,CO-,-DC-'E-,,-OU,,-,-T-,PU,--,TS= _LP_EN___ LIGHT PEN INPU'-T_ _ _ _ _--'
7-115 00224A
8275
PIN DESCRIPTIONS
Pin :# Pin Name 1/0 Pin Description Pln:# Pin Name 1/0 Pin Description
1 LC3 0 Line count. Output from the line count- 40 VCC +5V power supply
2 LC2 er which is used to address the character
3 generator for the line positions on the
39 LAO o Line attribute codes. These attribute
LCl 38 codes have to be decoded externally by
LAl
4 LCo screen.
the dot/timing logic to generate the
5 DRQ 0 DMA request. Output signal to the 8257 horizontal and vertical line combinations
DMA controller requesting a DMA cycle. for the graphic displays specified by the
DMA acknowledge. Input signal from character attribute codes.
6 DACK
the 8257 DMA controller acknowledging 37 LTEN o Light enable. Output signal used to
that the requested DMA cycle has been enable the video signal to the CRT. This
granted. output is active at the programmed
7 HRTC Horizontal retrace. Output signal which underline cursor position, and at posi-
0
tions specified by attribute codes.
is active during the programmed hori-
zontal retrace interval. During this peri- 36 RVV o Reverse video. Output signal used to
od the VSP output is high and the indicate the CRT circuitry to reverse the
L TEN output is low. video signal. This output is active at the
8 VRTC o Vertical retrace. Output signal which is cursor position if a revel~e video block
active during the programmed vertical cursor is programmed or at the positions
retrace interval. During this period the specified by the field attribute codes.
VSP output is high and the L TEN out- 35 VSP o Video suppression. Output signal, ed to
put is low. blank the video signal to the CRT. This
9 RD Read input. A control signal to read output is active:
registers. during the horizontal and vertical re-
10 WR Write input. A control signal to write trace intervals.
commands into the control registers or at the top and bottom lines of rows if
write data into the row buffers during a underline is programmed to be number
DMA cycle. 8 or greater.
11 LPEN Light pen. Input signal from the CRT when an end of row or end of screen
system signifying that a light pen signal code is detected.
has been detected. When a DMA underrun occurs.
12 DBO I/O Bi-directional three-state data bus lines. at regular intervals (1/16 frame fre-
13 DBl The outputs are enabled during a read of quency for cursor, 1/32 frame fre-
14 DB2 the C or P ports. quency for character and field attri-
15 DB3 butes) - to create blinking displays
16 DB4 as specified by cursor, character attri-
17 DB5 bute, or field attribute programming.
18 DB6 34 GPAl o General purpose attribute codes. Out-
19 DB7 33 GPAo puts which are enabled by the general
20 Ground Ground purpose field attribute codes.
32 HLGT o Highlight. Output signal used to intensi-
fy the display at particular positions on
the screen as specified by the character
attribute codes or field attribute codes.
31 IRQ o Interrupt request.
30 CCLK I Character clock (from dotltiming logic).
29 CC6 o Character codes. Output from the row
28 CC5 buffers used for character selection in
27 CC4 the character generator.
26 CC3
25 CC2
24 CCl
23 CCo
22 CS Chip select. The read and write are en-
abled by CS.
21 AO Port address. A high input on AO selects
the "c" port or command registers and a
low input selects the "P" port or param-
eter registers.
7-116 00224A
8275
FUNCTIONAL DESCRIPTION
Data Bus Buffer CCLK
AO OPERATION REGISTER
ORO
LCO_3
0 Read PREG OACK
PREG IRa
0 Write
1 Read SREG
AD
1 Write CREG
LAo-l
HRTC
VRTC
HLGT
RVV
LTEN
RD (Read) VSP
cs GPAO_l
A "Iow" on this input informs the 8275 that the CPU is
reading data or status information from the 8275.
LPEN
WR (Write)
A "Iow" on this input informs the 8275 that the CPU is
writing data or control words to the 8275. Figure 1. 8275 Block Diagram Showing Data Bus Buffer
.and ReadlWrlte Functions
CS (Chip Select)
A "Iow" on this input selects the 8275. No reading or writ-
ing will occur unless the device is selected. When CS is high, Ao RD WR CS
the Data Bus in the float state and RD and WR will have no
0 0 1 0 Write 8275 Parameter
effect on the chip.
0 1 0 0 Read 8275 Parameter
DRQ (DMA Request) 1 0 1 0 Write 8275 Command
1 0 0 Read 8275 Status
A "high" on this output informs the DMA Controller that
X 0 Three-State
the 8275 desires a DMA transfer.
X X X Three-state
DACK (DMA Acknowledge)
A "Iow" on this input informs the 8275 that a DMA cycle
is in progress.
7-117 00224A
8275
Character Counter
CCLK
The Character Counter is a programmable counter that is
used to determine the number of characters to be displayed
per row and the length of the horizontal retrace interval. It
is driven by the CCLK (Character Clock) input, which
should be a derivative of the external dot clock.
CCO_6
Line Counter
The Line Counter is a programmable counter that is used to
determine the number of horizontal lines (Sweeps) per
character row. Its outputs are used to address the external DRQ _ _ _- - ,
character generator ROM. LCO-3
DACK
IRQ
Row Counter
The Row Counter is a programmable counter that is used to
determine the number of character rows to be displayed per LAO_l
frame and length of the vertical retrace interval. HRTC
VRTC
HLGT
RVV
LTEN
Light Pen Registers VSP
GPAO_l
The Light Pen Registers are two registers that store the con-
tents of the character counter and the row counter when- LPEN
ever there is a rising edge on the LPEN (Light Pen) input.
Note: Software correction is required.
Figure 2. 8275 Block Diagram Showing Counter and
Raster Timing and Video Controls Register Functions
The Raster Timing circuitry controls the timing of the
FIFOs
HRTC (Horizontal Retrace) and VRTC (Vertical Retrace)
outputs. The Video Control circuitry controls the genera- There are two 16 character FIFOs in the 8275. They are
tion of LAo_1 (Line Attribute), HGL T (Highlight), RVV used to provide extra row buffer length in the Transparent
(Reverse Video), LTEN (Light Enable), VSP (Video Sup- Attribute Mode (see Detailed Operation section).
press), and GPAO-1 (General Purpose Attribute) outputs.
Buffer Input/Output Controllers
Row Buffers The Buffer Input/Output Controllers decode the characters
The Row Buffers are two 80 character buffers. They are being placed in the row buffers. If the character is a charac-
filled from the microcomputer system memory with the ter attribute, field attribute or special code, these con-
character codes to be displayed. While one row buffer is trollers control the appropriate action. (Examples; An
displaying a row of characters, the other is being filled with "End of Screen-Stop DMA" special code will cause the
the next row of characters. Buffer Input Controller to stop further DMA requests. A
"Highlight" field attribute will cause the Buffer Output
Controller to activate the HG i.. T output.)
7-118 00224A
8275
SYSTEM OPERATION
The 8275 is programmable to a large number of different It is designed to interface with the 8257 DMA Controller
display formats. It provides raster timing, display row buf- and standard character generator ROMs for dot matrix
fering, visual attribute decoding, cursor timing, and light decoding. Dot level timing must be provided by external
pen detection. circuitry.
MEMORIES
U (
< SYSTEM BUS
DBO-7
MEMR AO
lOW DBO-7
MEMW WR
lOR lID
CS CS
HRQ IRQ
HACK
DRQ LCO-3
8257 VIDEO SIGNAL
DMA CHARACTER
CONTROLLER DACK GENERATOR
HORIZONTAL SYNC
8275 CCO-6 DOT
CRT
TIMING VERTICAL SYNC
CONTROLLER
CCLK AND
INTERFACE
INTENSITY
VIDEO CONTROLS
7-119 00224A
8275
General Systems Operational Description The number of lines per character row, the underline posi-
tion, and blanking of top and bottom lines are program-
The 8275 provides a "window" into the microcomputer mable. (See Programrriing Section.)
system memory.
The 8275 provides special Control Codes which can be used
to minimize DMA or software overhead. It also provides
Display characters are retrieved from memory and dis-
, played on a row by row basis. The 8275 has two row buf- Visual Attribute Codes to cause special action or symbols
fers. While one row buffer is being used for display, the on the screen without the use of the character generator
other is being filled with the next row of characters to be (see Visual Attributes Section).
displayed. The number of display characters per row and The 8275 also controls raster timing. This is done by gen-
the number of character rows per frame are software pro- erating Horizontal Retrace (H RTC) and Vertical Retrace
grammable, providing easy interface to most CRT displays. (VRTC) signals. The timing of these signals is program-
(See Programming Section.) mable.
The 8275 can generate a cursor. Cursor location and format
The 8275 requests DMA to fill the row buffer that is not
are programmable. (See Programming Section.)
being used for display. DMA burst length and spacing is
programmable. (See Programming Section.) The 8275 has a light pen input and registers. The light pen
input is used to load the registers. Light pen registers can be
The 8275 displays character rows one line at a time. read on command. (See Programming Section.)
---------------------
Character Character Character Character Character Character
---------------------
Character Character Character Character Character Character
-------------------..--
Character Character Character Character Character Character
1st
Character
~..---"--"-..
2nd
Character
3rd
Character
4th
Character
5th
Character
6th
...---
Character
0.0000.00.00.0.00.0000000000000.0.0000.000.00.0.0.0
o.oooo.oo.ooo co.ooooooooooooo.oo.ooo.ooo.oo.o.o.o
00000.0000.00 000000000.0 O. 0000 000 O. O. 0 0
Seventh Line of a Character Row
7-120 00224A
8275
Display Row Buffering After all the lines of the character row are scanned, the
Before the start of a frame, the 8275 requests DMA and roles of the two row buffers are reversed and the same
one row buffer is filted with characters. procedure is followed for the next row.
CCLK
CCLK
DBO_7 CCO_6
DATA
DBO_7 _"-E3t"~'-+E>fw CCO-6
BUFFER
LCO_3
ORO
LCO_3
DACK
IRO
LAO_l R5
HRTC LAO_l
VRTC
HLGT HRTC
RVV VRTC
AO-- HLGT
LTEN
vsp RVV
LTEN
GPAO_l vsp
cs GPAO_l
LPEN
LPEN
DBO_7 CCO_6
LCO_3
READ/
WRITE/
LAO_l
WR-
CO~~~OL d HRTC
LOGIC VRTC
AO-- HLGT
RVV
LTEN
vsp
GPAO_l
LPEN
7-121 00224A
8275
Line Line
Line Counter Counter
123456789 . . . . . . . . . . . . . . . 80 Number Mode 0 Mode 1
2 0 0 0 0 0 D. 0 0 0000 1001
3 1 0 0 0
0 0 0 0001 0000
2 0 0
0 0 0 0010 0001
4 3 0
0
0 0 0 001 1 0010
5 4 0
0
0 0 0 0100 0011
5 0
0 0101 0100
6 0
0
0 0 0 0110 0101
7
8
0
0
0
0
0
0
0
0
0 0
0
0
0111
1000
01 10
01 1 1
9 0 0 0 0 0 0 0 1001 1000
64
Figure 11. Example of a 10Llne Format
Figure 9. Blank Alternate Rows Mode Mode 0 is useful for character generators that leave address
zero blank and start at address 1. Mode 1 is useful for char-
acter generators which start at address zero.
7-122 00224A
8275
a 0 0 0 0 0 [J 0 0 0 0000 1011
1 0 0 0 0
0 0 0 0 0001 0000
2 0 0 0
0
0 0 0 0010 0001
3 0 0
0 0 0
0 0 0011 0010
4 0
0 0 0 0 o 0 0100 00 11
5 0
0 0 0 0 0 0 a1a1 0100 LC
6 0
0 a 11 a 0101
7 0
.0 0 0 0 0 0 0111 0110 8275
8 0
0 0 0 0 0 0 1000 011 1 cc
9 0
0 0 0 0 0 0 100 1 1000
10
11
0 0 0 0 0 0 0 0 0
1010
1011
10 01
1010
VIDEO
vSP
Top and Bottom
Lines are Blanked Figure 14. Typical Dot Level Block Diagram
Figure 12. Underline In Line Number 10
If the line number of the underline is less than or equal to 7 Dot width is a function of dot clock frequency.
(line number MSB = 0). then the top and bottom lines will
Character width is a function of the character generator
not be blanked. width.
Horizontal character spacing is a function of the shift
register length.
Note: Video control and timing signals must be synchronized with
the video signal due to the character generator access delay.
Line Line
Line Counter Counter
Number Mode 0 Mode 1
0 0 0 0
0 0 0 0000 0111
1 0 0
0
0 0 0001 0000
2 0
0 0 0 0 0010 0001
3 0
0 0 0 0 0011 0010
4 0
0 0100 00 11
5 0
0 0 0 0 a 10 1 0100
6 0
0 0 0 0 0110 a1a1
7 0111 0110
7-123 00224A
8275
Raster Timing The row counter is an internal counter driven by the line
The character counter is driven by the character clock input counter. It controls the functions of the row buffers and
(CCLKI. !t counts out the characters being displayed counts the number of character rows displayed.
(programmable from 1 to 80). It then causes the line
counter to increment, and it 'starts counting out the hori- r
.
ONE CHARACTER ROW
\
zontal retrace interval (programmable from 2 to 32). This
is constantly repeated. HRTC ----U--UU-U-
CCLK
INTERNAL
ROW COUNTER
'''~''"~
PROGRAMMXBLE 1 TO 16
LINE COUNTS
PROGRAMMABLE 1 TO 80 CCLKS
After the row counter counts all of the rows in a frame
______________________ J NEXT
LC0-3 PRESENT LINE COUNT LINE COUNT (programmable from 1 to 64), it starts counting out the
vertical retrace interval (programmable from 1 to 4).
"OW'~:;::''':i Jcx::><::x::x:2(:x:X:::x=
FIRST LAST FIRST LAST
The line counter is driven by the character counter. It is DISPLAY
ROW
DISPLAY
ROW
RETRACE RETRACE
ROW ROW
used to generate the line address outputs (LC _ ) for the
o
character generator. After it counts all of the lines in a
character row (programmable from 1 to 16), it increments
the row counter, and starts over again. (See Character For
PROGRAMMABLE
PROGRAMMABLE
mat Section for detailed description of Line Counter 1 TO 64 ROW COUNTS 1 TO 4 ROW COUNTS
functions.)
Figure 17. Frame Timing
7-124 00224A
8275
The 8275 can be programmed to request burst DMA trans- The 8275 can be programmed to generate an interrupt
fers of 1 to 8 characters. The interval between bursts is also request at the end of each frame. This can be used to
programmable (from 0 to 55 character clock periods 1). reinitialize the DMA controller. If the 8275 interrupt
This allows the user to tailor his DMA overhead to fit his enable flag is set, an interrupt request will occur at the
system needs. beginning of the last display row.
The first DMA request of the frame occurs one row time
before the end of vertical retrace. DMA requests continue
as programmed, until the row buffer is filled. If the row
buffer is filled in the middle of a burst, the 8275 terminates
the burst and resets the burst counter. No more DMA INTERNAL~
ROW
COUNTER
requests will occur until the beginning of the next row. L I
DISPLAY RETRACE
At that time, DMA requests are activated as programmed ROW ROW
until the other buffer is filled.
The first DMA request for a row will start at the first char-
VRTC ~'r---e--..1
acter clock of the preceding row. If the burst mode is used,
the first DMA request may occur a number of character
IRQ
clocks later. This number is equal to the programmed burst
space.
Figure 19. Beginning of Interrupt Request
If, for any reason, there is a DMA underrun, a flag in the
status word will be set.
INTERNAL
ROW
COUNTER
"Q }
BUR~/
RD~~}-
_----J
-..----
~ffi
;~
~
ct
g
.. NEXT
ROW BUFFER
FILLED
""'a: ~:Ro~
:~ <~ ....
g~ gC~
---
a:: 0 a:
~~ Q
0..
Figure 20. End of Interrupt Request
ONE
ROW BUFFER
FILLED
7-125 00224A
8275
Character Attributes
MSB LSB
11CCCCBH
IL HIGHLIGHT
I
L _____
BLINK
CHARACTER ATTRIBUTE CODE
OO~------------~~ __~________~
O,~--------+---r-~ __~________~
02~--------+---r-~__~--------~
CHARACTER
GENERATOR
~?,~ OJ~--------+---~~__~==~==~~r=J
SHIFT
REGISTER
05.1----------+---r\-__~--+_____I--__I
8275
06~---------+---.,----).___+_--_+_--_+_-_I......JI
LA,
VIDEO
LAO
VSP
LTEN
HGLT t---------------- HIGHLIGHT
7-126 00224A
8275
DESCRIPTION
1101 Illegal
1110 Illegal
1111 Illegal
*Character Attribute Code 1011 is not recommended for Character Attribute Codes 1101, 1110, and 1111 are illegal.
normal operation. Since none of the attribute outputs are
active, the character Generator will not be disabled, and Blinking is active when B = 1.
an indeterminate character will be generated. Highlight is active when H = 1.
7-127 00224A
8275
Specla. Code. character following the code up to, and including, the
Four special codes are available to help reduce memory, character which precedes the next field attribute code, or
software, or DMA overhead. up to the end of the frame. The field attributes are reset
during the vertical retrace interval.
Specla. Control Character
There are six field attributes:
MSB LSB
1 1 1 1 o 0 S S 1. Blink - Characters following the code are caused
Field Attribute. *More than one attribute can be enabled at the same time.
The field attributes are control codes which affect the If the blinking and reverse video attributes are enabled
visual characteristics for a field of characters, starting at the simultaneously, only the reversed characters will blink.
7-128 00224A
8275
The 8275 can be programmed to provide visible or invisible Each row buffer has a correspond ing FIFO. These F IFOs
field attribute characters. are 16 characters by 7 bits in size.
If the 8275 is programmed in the visible field attribute When a field attribute is placed in the row buffer during
mode, all field attributes will occupy a position on the DMA, the buffer input controller recognizes it and places
screen. They will appear as blanks caused by activation of the next character in the proper FIFO.
the Video Suppression output (VSP). The chosen visual
When a field attribute is placed in the Buffer Output Con-
attributes are activated after this blanked character. troller during display, it causes the controller to immedi-
ately put a character from the FIFO on the Character Code
outputs (CCO-6). The chosen Visual Attributes are also
activated.
,'---------------------------------~
1 234 5 6 7 8 9
I
Figure 24. Example of the Invisible Field Attribute
Mode (Underline Attribute)
7129 00224A
8275
The cursor blinking frequency is equal to the screen refresh 0 Write PREG
frequency divided by 16. 1 Read SREG
If a non-blinking reverse video cursor appears in a non- 1 Write CREG
blinking reverse video field, the cursor will appear as a
normal video block. The 8275 expects to receive a command and a sequence
If a non-blinking underline cursor appears in a non-blinking of 0 to 4 parameters, depending on the command. If the
underline field, the cursor will not be visible. proper number of parameter bytes are not received before
another command is given, a status flag is set, indicating an
Light Pen Detection improper command.
A light pen consists of a micro switch and a tiny light Instruction Set
sensor. When the light pen is pressed against the CRT screen, The 8275 instruction set consists of 8 commands.
the micro switch enables the light sensor. When the raster
sweep reaches the light sensor, it triggers the light pen COMMAND NO. OF PARAMETER BYTES
output. Reset 4
If the output of the light pen is presented to the 8275 Start Display o
LPEN input, the row and character position coordinates are Stop Display o
stored in a pair of registers. These registers can be read on Read Light Pen 2
command. A bit in the status word is set, indicating that Load Cursor 2
the light pen signal was detected. The LPEN input must be Enable Interrupt o
a 0 to 1 transition for proper operation. Disable Interrupt o
Preset Counters o
Note: Due to internal and external delays, the character position
coordinate will be off by at least three character positions. In addition, the status of the 8275 (SREG) can be read by
This has to be corrected in software. the CPU at any time.
7-130 00224A
8275
o Normal Rows
Spaced Rows
Parameter - M Line Counter Mode
M LINE COUNTER MODE
Parameter - HHHHHHH Horizontal Characters/Row o Mode 0 (Non-Offset)
NO. OF CHARACTERS Mode 1 (Offset by 1 Count)
H H H H H H H PER ROW
0 0 0 0 0 0 0
0 0 0 0 0 0 2
0 0 0 0 0 0 3 Parameter - F Field Attribute Mode
F FIELD ATTRIBUTE MODE
o Transparent
Non-Transparent
0 0 1 80
0 0 0 0 0 Undefined
o 0 1
o 1 2
o 3 Parameter - ZZZZ Horizontal Retrace Count
4 NO. OF CHARACTER
Z Z Z Z COUNTS PER HRTC
0 0 0 0 2
Parameter - RRRRRR Vertical Rows/Frame 0 0 0 1 4
R R R R R R NO. OF ROWS/FRAME 0 0 0 6
0 0 0 0 0 0 1
0 0 0 0 0 1 2
0 0 0 0 0 3
1 1 1 32
7-131 00224A
8275
I
OPERATION AO I I DESCRIPTION I MSB
DATA BUS
LSB
I IOPERAT!ON I AO I DESCRIPTION I MSB
DATA BUS
Parameters
Write o Char. Number (Char. Position in Row)
Write o Row Number (Row Numbed
SSS BURST SPACE CODE Action - The 8275 is conditioned to place the next two
NQ OF CHARACTER CLOCKS
parameter bytes into the cursor position registers. Status
S S S BETWEEN DMA REQUESTS flags not affected.
0 0 0 0
0 0 1 7
0 0 15
0 1 1 23
6. Enable Interrupt Command:
0 0 31
DATA BUS
0 1 39 IOPERATION AO DESCRIPTION MSB LSB
0 47
55 Command J Write 1 Enable Interrupt 1 0 1 0 0 0 0 0
No parameters
BB BURST COUNT CODE
NO. OF DMA CYCLES PER Action - The interrupt enable status flag is set and inter-
B B BURST rupts are enabled.
0 0
0 1 2
0 4
8
7. Disable Interrupt Command:
Action - 8275 interrupts are enabled, DMA requests begin,
video is enabled, Interrupt Enable and Video Enable status
flags are set.
I OPERATION AO DESCRIPTION MSB
DATA BUS
LSB
7132 00224A
8275
Status Flags
IC - (Improper Command) This flag is set when a
DATA BUS
MSB LSB
command parameter string is too long or too
short. The flag is automatically reset after a
Command OlE IR LP ICVE au FO status read.
IE - (lntp.rrupt Enable) Set or reset by command. It VE - (Video Enable) This flag indicates that video
enables vertical retrace interrupt. It is auto- operation of the CRT is enabled. This flag is
matically set by a "Start Display" command set on a "Start Display" command, and reset
and reset with the "Reset" command. on a "Stop Display" or "Reset" command.
IR - (Interrupt Request) This flag is set at the begin- DU - (DMA Underrun) This flag is set whenever a
ning of display of the last row of the frame if data underrun occurs during DMA transfers.
the interrupt enable flag is set. It is reset after Upon detection of DU, the DMA operation is
a status read operation. stopped and the screen is blanked until after
LP - This flag is set when the light pen input (LPEN) the vertical retrace interval. This flag is reset
is activated and the light pen registers have been after a status read.
loaded. This flag is automatically reset after a FO - (FIFO Overrun) This flag is set whenever the
status read. FIFO is overrun. It is reset on a status read.
00224A
7-133
8275
D.C. CHARACTERISTICS
T A = OC to 70C; Vee = 5V 5%
CAPACITANCE
T A = 25C; Vee = GND = OV
7-134 00224A
8275
Other Timing:
SYMBOL PARAMETER MIN. MAX. UNITS TEST CONDITIONS
tcc Character Code Output Delay 150 ns CL = 50 pF
tHA Horizontal Retrace Output Delay 200 ns CL = 50 pF
tLC Line Count Output Delay 400 ns CL = 50 pF
tAT Control/Attribute Output Delay 275 ns CL = 50 pF
tVA Vertical Retrace Output Delay 275 ns CL = 50 pF
tAl IRO~ from ROt 250 ns CL = 50 pF
twa DROt from WRt 250 ns CL = 50 pF
tAQ DRO~ from WR~ 200 ns CL = 50 pF
tLA DACK~ to WR~ 0 ns
tAL WRt to DACKt 0 ns
tpA LPEN Rise 50 ns
tpH LPEN Hold 100 ns
Note: Timing measurements are made at the following reference voltages: Output "1" = 2.0V, "0" = O.BV.
Input "1 "=2.4V , "0"=0.45V
WAVEFORMS
EXT OOTCLK
CCLK' l . .______. .
CCo-s FIRST CHARACTER CODE SECOND CHARACTER CODE
ATTRIBUTES
& CONTROLS
VIDEO
(FROM SHIFT
REGISTER)
7-135 00224A
8275
~ n
r r
CCLK
I I '
CCO-6
HRTC
~l-tLC
LCO-3 -+-____P_RE_S_EN_T_L_IN_E_C_O_U_N_T_ _---I, 'r---------------.....~ NEXT LINE COUNT
VIDEO
CONTROLS
AND ATTRIBUTES'
CCLK
HRTC
LCO_3
CCLK
~
INTERNAL AST
ROW RETRACE
COUNTER ROW
VRTC
7-136 00224A
8275
\
CCLK
HRTC
IRQ
INTERNAL
-: ------LAS-~-T-D-IS+-PL-A-f-'-OW-~t-I-R--~-_-_-_-_-_-
CCLK
-JtKQt----..
DRQJ \\,._ __
LPEN _ _
j ..}"'---_
Figure 30. DMA Timing
7-137 00224A
8275
A.C. CHARACTERISTICS
T A = OC to 70C; VCC = 5.0V 5%; GND = OV
Write Cycle:
SYMBOL PARAMETER MIN. MAX. UNITS TEST CONDITIONS
Clock Timing:
SYMBOL PARAMETER MIN. MAX. UNITS TEST CONDITIONS
---=:rtAR
RD
INVALID
CCLK
2.4
0.45
=:x:::> TEST POINTS :x==
<:.
7-138 00224A
inter
8279/82795
PROGRAMMABLE KEYBOARD/DISPLAY INTERFACE
MCS85 Compatible 82795 Dual 8 or 16Numerical Display
Simultaneous Keyboard Display
Single 16Character Display
Operations
Scanned Keyboard Mode Right or Left Entry 16Byte Display
RAM
Scanned Sensor Mode
Strobed Input Entry Mode Mode Programmable from CPU
8Character Keyboard FI FO
Programmable Scan Timing
2Key Lockout or NKey Rollover with
Contact Debounce Interrupt Output on Key Entry
The Intel@ 8279 is a general purpose programmable keyboard and display I/O interface deyice designed for use with
Intel@ microprocessors. The keyboard portion can provide a scanned interface to a 64-contact key matrix. The
keyboard portion will also interface to an array of sensors or a strobed interface keyboard, such as the hall effect and
ferrite variety. Key depressions can be 2-key lockout or N-key rollover. Keyboard entries are debounced and strobed in
an 8-character FIFO. If more than 8 characters are entered, overrun status is set. Key entries set the interrupt output
line to the CPU.
The display portion provides a scanned display interface for LED, incandescent, and other popular display
technologies. Both numeric and alphanumeric segment displays may be used as well as simple indicators. The 8279
has 16X8 display RAM which can be organized into dual 16X4. The RAM can be loaded or interrogated by the CPU. Both
right entry, calculator and left entry typewriter display formats are possible. Both read and write of the display RAM
can be done with auto-increment of the display RAM address.
PIN NAMES
IRQ
DATA
BUS
SHIFT 1---- - KEY DATA
RD
CNTL'STB
WR
CPU
OUT B, INTERFACE
OUTB2 - CS
SLO_3 SCAN
OUT B3
OUT Ao AO
OUT A,
l-
I OUT AO-3
qUT A2
RESET
OUT A3
BD DISPLAY
cs CLK OUT B()'3 DATA
Vss
7_1~Q
8279/82795
HARDWARE DESCRIPTION SHIFT The shift input status is stored
The 8279 is packaged in a 40 pin DIP. The following is along with the key position on
a functional description of each pin. key closure in the Scanned
No. Of No. Of
Pins Designation Function Pins Designation Function
8 DBo-DB7 Bi-directional data bus. All data Keyboard modes. It has an ac-
and commands between the
tive internal pullup to keep it
CPU and the 8279 are trans-
high until a switch closure pulls
mitted on these lines.
it low.
ClK Clock from system used to gen-
erate internal timing. CNTLlSTB For keyboard modes this line is
RESET A high signal on this pin resets used as a control input and
the 8279. After being reset the stored like status on a key clo-
8279 is placed in the following sure. The line is also the strobe
mode: line that enters the data into the
1) 16 8-bit character display FIFO in the Strobed Input mode.
-left entry.
(Rising Edge). It has an active
2) Encoded scan keyboard-2
internal pullup to keep it high
key lockout.
until a switch closure pulls it
Along with this the program
low.
clock prescaler is set to 31.
Chip Select. A low on this pin 4 OUT Ao-OUT A3 These two ports are the outputs
enables the interface functions 4 OUT Bo-OUT B3 for the 16 x 4 display refresh
to receive or transmit. registers. The data from these
Ao Buffer Address. A high on this outputs is synchronized to the
line indicates the signals in or scan lines (Slo-Sl3) for multi-
out are interpreted as a com- plexed digit displays. The two 4
mand or status. A low indicates bit ports may be blanked inde-
that they are data. pendently. These two ports may
2 I nput/Output read and write. also be considered as one 8 bit
These signals enable the data port.
buffers to either send data to BD Blank Display. This output is
the external bus or receive it used to blank the display during
from the external bus. digit switching or by a display
IRO Interrupt Request. In a keyboard blanking command.
mode, the interrupt line is high
when there is data in the FIFO/
Sensor RAM. The interrupt line
PRINCIPLES OF OPERATION
goes low with each FIFO/
The following is a description of the major elements of the
Sensor RAM read and returns
8279 Programmable Keyboard/Display interface device.
high if there is still informa-
Refer to the block diagram in Figure 1.
tion in the RAM. In a sensor
mode, the interrupt line goes 110 Control and Data Buffers
high whenever a change in a
The I/O control section uses the CS, Ao, RD and WR lines
sensor is detected. to control data flow to and from the various internal
2 Vss , Vee Ground and power supply pins. registers and buffers. All data flow to and from the 8279 is
enabled by CS. The character of the information, given or
4 Slo-Sl3 Scan Lines which are used to
desired by the CPU, is identified by Ao. A logic one
scan the key switch or sensor means the information is a command or status. A logic
matrix and the display digits. zero means the information is data. RD and WR determine
These lines can be either en- the direction of data flow through the Data Buffers. The
coded (1 of 16) or decoded (1 of Data Buffers are bi-directional buffers that connect the
4). internal bus to the external bus. When the chip is not
selected (CS = 1), the devices are in a high impedance
8 Rlo-Rl7 Return line inputs which are
state. The drivers input during WR-CS and output during
connected to the scan lines
RD -CS.
through the keys or sensor
switches. They have active in- Control and Timing Registers and Timing Control
ternal pull ups to keep them These registers store the keyboard and display modes and
high until a switch closure pulls other operating conditions programmed by the CPU. The
one low. They also serve as an modes are programmed by presenting the proper
8-bit input in the Strobed Input command on the data lines with Ao = 1 and then sending
mode. a WR. The command is latched on the rising edge of WR.
AFN-00742A-02
7-140
8279/82795
FUNCTIONAL DESCRIPTION
Since data input and display are an integral part of many Scanned Sensor Matrix - with encoded (8 x a matrix
microprocessor designs. the system designer needs an switches) or decoded (4x8 matrix switches) scan lines.
interface that can control these functions without placing Key status (open orclosed) stored in RAM addressable
a large load on the CPU. The 8279 provides this function by CPU.
for a-bit microprocessors. Strobed Input -- Data on return lines during control
The 8279 has two sections: keyboard and display. The line strobe is transferred to FIFO.
keyboard section can interface to regular typewriter style
keyboards or random toggle or thumb switches. The
display section drives alphanumeric displays or a bank of Output Modes
indicator lights. Thus the CPU is relieved from scanning 8 or 16 character multiplexed displays that can be or-
the keyboard or refreshing the display. = =
ganized as dual 4-bit or single 8-bit (80 Do, A3 0 7 ).
The 8279 is designed to directly connect to the Right entry or left entry display formats.
microprocessor bus. The CPU can program all operating
modes for the 8279. These modes include: Other features of the 8279 include:
Mode programming from the CPU.
Input Modes Clock Prescaler
Scanned Keyboard - with encoded (8 x 8 key Interrupt output to signal CPU when there is keyboard
keyboard) or decoded (4 x 8 key keyboard) scan lines. or sensor data available.
A key depression generates a 6-bit encoding of key
An 8 byte FIFO to store keyboard information.
position. Position and shift and control status are
stored in the FIFO. Keys are automatically debounced 16 byte internal Display RAM tor display refresh. This
with 2-key lockout or N-key rollover. RAM can also be read by the CPU.
DISPLAY
ADDRESS KEYBOARD
16 x 8 DEBOUNCE
REGISTERS DISPLAY AND
RAM CONTROL
TIMING
AND
CONTROL
7-141 AFN-00742A-03
8279/82795
7-142 AFN-00742A-04
8279/82795
board Mode, the Auto-Increment flag (AI) and the RAM Clear
address bits (AAA) are irrelevant. The 8279 will automati-
cally drive the data bus for each subsequent read (AD =0) The <;,bits are available in this command to clear all rows
in the same sequence in which the data first entered the of the Display RAM to a selectable blanking code as fol-
r
FIFO. All subsequent reads will be from the FIFO until lows:
another command is issued.
The CPU sets up the 8279 for a write to the Display RAM
Code: 11 11 11 IE IX Ix Ix Ix 1 X = Don't care.
by first writing this command. After writing the com-
= =
mand with AD 1, all subsequent writes with AD 0 wi II For the sensor matrix modes this command lowers the
be to the Display RAM. The addressing and Auto- IRQ line and enables further writing into RAM. (The IRQ
Increment functions are identical to those for the Read line would have been raised upon the detection of a
Display RAM. However, this command does not affect change in a sensor value. This would have also inhibited
the source of subsequent Data Reads; the CPU will read further writing into the RAM until resetl.
from whichever RAM (Display or FIFO/Sensor) which
For the N-key rollover mode - if the E bit is programmed
was last specified. If, indeed, the Display RAM was last
to "1" the chip will operate in the special Error mode. (For
specified, the Write Display RAM will, nevertheless,
further details, see Interface Considerations Section.)
change the next Read location.
Status Word
Display Write Inhibit/Blanking The status word contains the FIFO status, error, and
display unavailable signals. This word is read by the CPU
The IW Bits can be used to mask nibble A and nibble B when AD is high and CS and RD are low. See Interface
in applications requiring separate 4-bit display ports. By Considerations for more detail on status word.
setting the IW flag (IW = 1) for one of the ports, the port
becomes marked so that entries to the Display RAM
Data Read
from the CPU do not affect that port. Thus, if each nibble Data is read when AD, CS and RD are all low. The source
is input to a BCD decoder, the CPU may write a digit to of the data is specified by the Read FIFO or Read Display
the Display RAM without affecting the other digit being commands. The trailing edge of RD will cause the address
displayed. It is important to note that bit Bo corresponds of the RAM being read to be incremented if the Auto-
to bit Do on the CPU bus, and that bit A3 corresponds to Increment flag is set. FIFO reads always increment (if no
bit 0 7, error occurs) independent of AI.
If the user wishes to blank the display, the BL flags are Data Write
available for each nibble. The last Clear command issued Data that is written with AD. CS and WR low is always
determines the code to be used as a "blank." This code written to the Display RAM. The address is specified by the
defaults to all zeros after a reset. Note that both BL latest Read Display or Write Display command. Auto-
flags must be set to blank a display formatted with a Incrementing on the rising edge of WR occurs if AI set by
single 8-bit port. the latest display command.
7-143 AFN-00742A-05
8279, 8.279-5
ABSOLUTE MAXIMUM RATINGS *COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
Ambient Temperature . . . . . . . . . . . . . . OC to 70C
device. This is a Sti6SS iating only and functional opsia-
Storage Temperature . . . . . . . . . . . . . -65C to 125C
tion of the device at these or any other conditions above
Voltage on any Pin with those indicated in the operational sections of this specifi-
Respect to Ground . . . . . . . . . . . . . . -0.5V to +7V cation is not implied. Exposure to absolute maximum
Power Dissipation . . . . . . . . . . . . . . . . . . . . . . 1 Watt rating conditions for extended periods may affect device
reliability.
Notes:
1. 8279, vee = +5V 5%; 8279-5, Vee = +5V 10%.
2. 8279, IOL = 1.6mA; 82795, IOL = 2.2mA.
3. 8279, IOH = -100,uA; 8279-5, IOH = -400,uA.
CAPACITANCE
SYMBOL TEST TYP. MAX. UNIT TEST CONDITIONS
7144 AFN-00742A-09
8279, 8279-5
A.C. CHARACTERISTICS
TA = oc to 70C, Vss = OV, (Note 1)
BUS PARAMETERS
READ CYCLE:
8279 8279-5
Symbol Parameter Min. Max. Min. Max. Unit
tAR Address Stable Before READ 50 0 ns
tRA Address Hold Time for READ 5 0 ns
tRR READ Pulse Width 420 250 ns
tRO[2] Data Delay from READ 300 150 ns
tAO[2] Address to Data Valid 450 250 ns
tDF READ to Data Floating 10 100 10 100 ns
tRCY Read Cycle Ti me 1 1 iJ.s
WRITE CYCLE:
8279 8279-5
Symbol Parameter Min. Max. Min. Max. Unit
tAW Address Stable Before WR ITE 50 0 ns
tWA Address Hold Time for WR ITE 20 0 ns
tww WR ITE Pulse Width 400 250 ns
tDW Data Set Up Time for WR ITE 300 150 ns
two Data Hold Time for WR ITE 40 0 ns
Notes:
1. 8279, V CC =+5V 5%; 8279-5, VCC = +5V 10%.
2. 8279, CL = 1OOpF; 8279-5, CL = 150pF.
OTHER TIMINGS:
8279 8279-5
Symbol Parameter Min. Max. Min. Max. Unit
t</>w Clock Pu Ise Width 230 120 nsec
tCY Clock Period 500 320 nsec
"=X
0.45
2.0
0.8
> TEST POINTS < 2.0
0.8 )C
7-145 AFN-00742A-10
8279, 8279-5
WAVEFORMS
1. Read Operation
AO, ES (SYSTEM'S
ADDRESS BUS)
~-----------------------
-tAR - - 1....>---------------------'RCy ------+-'~-----------I
(READ CONTROL)
1.--------tAo--------
DATA BUS
(OUTPUT)
~~~~~~~~~~~+-----------------~~~~~~~~~~~~~
2. Write Operation
(SYSTEM'S
AO, CS ADDRESS BUS)
(WRITE CONTROL)
3. Clock Input
7-146 AFN-00742A-11
8279 SCAN TIMING
SCAN WAVEFORMS
ENCODED
L
SCAN
L
L
~U U U U
DECODED
5.1
~ U U U
u
SCAN
u u
u u u LJ
DISPLAY WAVEFORMS
ASSUME INTERNAL FREQUENCY =100 kHz
1+-------640~$=64ICy------1 SO ICY= 10~$
Ao- A 3
ACTIVE HIGH A(1)
Bo-B3
ACTIVE HIGH B(1)
7-147 AFN-00742A-12
intJ
8282/8283
OCTAL LATCH
The 8282 and 8283 are 8-bit bipolar latches with 3-state output buffers. They can be used to implement latches, buffers,
or multiplexers. The 8283 inverts the input data at its outputs while the 8282 does not. Thus, all of the principal periph-
eral and input/output functions of a microcomputer system can be implemented with these devices.
OE 007 OE 007
7-148
828218283
r-------, 8282
8--- I
D Q -t-B
I
I
8-.---+----f >---,--s
I
I
I
L ______ _ L ______ _
-------; {j
m -{:TI
Dis
~-------
:::::J --*O~
8-
01
6
L ______ _
'" FL------- -~
~
Figure 3. Logic Diagrams
STB STROBE (Input). STB is an input control The 8282 and 8283 octal latches are 8-bit' latches with
pulse used to strobe data at the data input 3-state output buffers. Data having satisfied the setup
pins (Ao-A7) into the data latches. This time requirements is latched into the data latches by
signal is active HIGH to admit input data. strobing the STB line HIGH to LOW. Holding the STB
The data is latched at the HIGH to LOW line in its active HIGH state makes the latches appear
transition of STB. transparent. Data is presented to the data output pins by
OUTPUT ENABLE (Input). OE is an input activating the OE input line. When OE is inactive HIGH
control signal which when active LOW the output buffers are in their high impedance state.
enables the contents of the data latches Enabling or disabling the output buffers will not cause
onto the data output pin (Bo-B7). OE being negative-going transients to appear on the data output
inactive HIGH forces the output buffers to bus.
their high impedance state.
DATA INPUT PINS (Input). Data presented
at these pins satisfying setup time re-
quirements when STB is strobed and
latched into the data input latches.
7-14Q
intJ 828218283
D.C. CHARACTERISTICS
Conditions: Vee = 5V 10%, TA = ooe to 70C
Symbol Parameter Min Max Units Test Conditions
F = 1 MHz
CIN Input Capacitance 12 pF V SIAS = 2.5V, Vee= 5V
TA=25C
NOTE: 1. Output Loading IOL = 32 mA, IOH = - 5 mA, e L= 300 pF.
A.C. CHARACTERISTICS
Conditions: Vee = 5V 10%, TA = ooe to 70C
Loading: Outputs - IOL = 32 mA, IOH = - 5 mA, C L = 300 pF
WAVEFORMS
INPUTS
TlVSL
STB
~----~-TSHSL------~ ~------------------------------------------------------
OUTPUTS
TELOV
VO:~ _ _ _ _
-C
-----+__________- J 'fo-oI.......- - - - - - - - - - - - - - - - - - - - - - - - - - - , VOL +.1V
TSHOV
NOTE: 1.8283 ONLY - OUTPUT MAY BE MOMENTARILY INVALID FOLLOWING THE HIGH GOING STB TRANSITION.
2. ALL TIMING MEASUREMENTS ARE MADE AT 1.5V UNLESS OTHERWISE NOnD.
50
8283
40
0
w
I/)
30
z
>-
<C
...I
W
Q
20
10
pF LOAD
50
8282
40
0
w
I/)
z 30
>-
<C
...I
W
Q
20
10
pF LOAD
7-152
8286/8287
OCTAL BUS TRANSCEIVER
The 8286 and 8287 are 8-bit bipolar transceivers with 3-state outputs. The 8287 inverts the input d~ta at its outputs
while the 8286 does not. Thus, a wide variety of applications for buffering in microcomputer systems can be met.
Ao Vee Ao Vee
A1 Bo A1 So
A2 B1 A2 B1
A3 B2 A3 B2
A4 B3 A4 B3
As B4 AS B4
AS BS A6 BS
A7 B6 A7 B6
OE B7 OE B7
GND T GND T
Intel Corporation Assumes No Responsibilty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied
'INTEL CORPORATION. 1980 7 -153 Mav 1980 AFN 01506A
8286/8287
r-------l 8286
r--------,
8287
I I I I
I I
I I
Pin Description
T TRANSMIT (Input). T is an input control signal used to control the direction of the transceivers.
When HIGH, it configures the transceiver's Bo-B7 as outputs with Ao-A7 as inputs. T LOW con
figures Ao-A7 as the outputs with Bo-B7 serving as the inputs.
OE OUTPUT ENABLE (Input). OE is an input control signal used to enable the appropriate output
n
driver (as selected by onto its respective bus. This signal is active LOW.
Ao-A7 LOCAL BUS DATA PINS (Input/Output). These pins serve to either present data to or accept data
from the processor's local bus depending upon the state of the T pin.
~-~(8286) SYSTEM BUS DATA PINS (Input/Output). These pins serve to either present data to or accept
Bo-B7 (8287) data from the system bus depending upon the state of the T pin.
FUNCTIONAL DESCRIPTION
The 8286 and 8287 transceivers are 8-bit transceivers with high impedance outputs. With T active HIGH and OE active
LOW, data at the Ao-A7 pins is driven onto the Bo-B7 pins. With T inactive LOW and OE active LOW, data at the Bo-B7
pins is driven onto the Ao-A7 pins. No output low glitching will occur whenever the transceivers are entering or leaving
the high impedance state.
AFN 01506A
7-154
Intel 8286/8287
AFN 01506A
7-155
8286/8287
WAVEFORMS
INPUTS \V
--------/~~---------------------------------------------
\
C=
V
1 I\~-------
-Tivov- -- TEHOZ I- TELOV-
VOH - .W
OUTPUTS
/1\\-.._____-:--____1--_~------
_________\V VOL + .W
1
--TEHTV-I I--TTVEL
T~------------------------------------~t~----------
NOTE: 1. All timing measurements are made at 1.5V unless otherwise noted.
50 50
1287 8288
40 40
U U
UI III
I/) I/)
30 z 30
z
~ ~
j j
UI III
Q Q
20 20
10
pF LOAD pF LOAD
O"'~''" OUT
66Q
O"'~""
1300 pF 1300 pF
roo, ! 100pF
1"0"
3STATE TO VOH 3STATE TO VOH SWITCHING
GPIB TALKER/LISTENER
The 8291 GPIB Talker/Listener is a microprocessor-controlled chip designed to interface microprocessors (e.g., 8048,
8080,8085,8086) to an IEEE Standard 488 Instrumentation Interface Bus. It implements all of the Standard's interface
functions except for the controller.
18291
GPIB DATA
INTERFACE
FUNCTIONS I/,-_-'=-~
SH GPIB CONTROL TO NON-INVERTING
i5i06 AH BUS TRANSCEIVERS
TE
DIOS
LE
Di04 SR
i5i03 I
T/R CONTROL
DI02
DiOi
D3 ill
D4 fiEiij
7-158
8291
PIN DESCRIPTION
Symbol I/O Pin No. Function Symbol I/O Pin No. Function
00-07 I/O 12-19 Data bus port, to be connected NRFO I/O 37 Not ready for data; GPIB hand-
to microprocessor data bus. shake control line. Indicates the
condition of readiness of de-
RSo-RS2 21-23 Register select inputs, to be con-
vice(s) connected to the bus to
nected to three non-multiplexed
accept data.
microprocessor address bus
lines. Select which of the 8 in- I/O 38 Not data accepted; GPIB hand-
ternal read (write) registers will shake control line. Indicates the
be read from (written into) with condition of acceptance of data
the execution of RO (WR). by the device(s) connected to
the bus.
8 Chip select. When low, enables
reading from or writing into the 26 Attention; GPIB command line.
register selected by RSo-RS2. Specifies how data on 010 lines
are to be interpreted.
9 Read strobe. When low, selected
register contents are read by the 24 Interface clear; GPIB command
CPU. line. Places the interface func-
tions in a known quiescent state.
WR 10 Write strobe. When low, data is
written into the selected register. o 27 Service request; GPIB command
line. Indicates the need for
INT (INT) 0 11 Interrupt request to the micro-
attention and requests an inter-
processor, set high for request
ruption of the current sequence
and cleared when the appropri-
of events on the GPIB.
ate register is accessed by the
CPU. May be software config- 25 Remote enable; GPIB command
ured to be active low. line. Selects (in conjunction with
other messages) remote or local
OREQ 0 6 OMA request, normally low, set
control of the device.
high to indicate byte output or
byte input, in OMA mode; reset I/O 39 End or identify; GPIB command
by OACK. line. Indicates the end of a
multiple byte transfer sequence
OMA acknowledge. When low,
or, in conjunction with ATN,
resets OREQ and selects data
addresses the device during a
in/data out register for OMA
polling sequence.
data transfer (actual transfer
done by RO/WR pulse). T/R1 o External transceivers control
Must be high if OMA is not used. line. Set high to indicate output
data/Signals on the 0101-010s
TRIG 0 5 Trigger output, normally low; and DAV lines and input signals
generates a triggering pulse with on the NRFO and NOAC lines
1,usec min. width in response to (active source handshake). Set
the GET bus command or low to indicate input datal
Trigger auxiliary command. signals on the 0101-010s and
CLOCK 3 External clock input, used only OAV lines and output signals on
for Tl delay generator. May be the NRFO and NOAC lines (ac-
any speed in 1-8 MHz range. tive acceptor handshake).
RESET 4 Reset input. When high, forces T/R2 o 2 External transceivers control
the device into an "Idle" (initiali- line. Set high to indicate output
zation) mode. The device will re- signals on the EOI line. Set low
main at "Idle" until released by to indicate expected input signal
the microprocessor. on the EOI line during parallel
poll.
8-bit GPIB data port, used for
bidirectional data byte transfer Vee P.S. 40 Positive power supply (5V
between 8291 and GPIB via non- 10%).
inverting external line trans-
GNO P.S. 20 Potential ground circuit.
ceivers.
I/O 36 Data valid; GPIB handshake
control line. Indicates the avail-
ability and validity of infor-
mation on the 010 lines.
Note: All signals on the S291 pins are specified with positive logic.
However, IEEE488 specifies negative I~ on its 16 signal lines. Thus, the
data is inverted once from 00-07 to OIO,-OIOa and non-inverting bus
transceivers should be used.
7-159
8291
r - -
I DMA
- - 'I
1-------1
DREO r--~~-
8291
... T/R2
t-----,
The 8291 is a microprocessor controlled device de- (e.g. digital DATA BYTE
signed to interface microprocessors e.g., 8048, 8080,
8085,8086 to the GPIB. It implements all of the interface
functions defined in the IEEE 488 Standard. If an imple-
multimeterl
DEVICE C
(e-
- TRANSFER
CONTROL
transfers. The rest of the write registers control the various IFC
features of the chip, while the rest of the read registers ATN
SRO
provide the microprocessor with a monitor of GPIB states, REN
various bus conditions, and device conditions. EOI
7-160
8291
TABLE 1.
IEEE 488 INTERFACE STATE MNEMONICS
7-161
8291
TABLE 2.
IEEE 488 INTERFACE MESSAGE REFERENCE LIST
7-162
8291
TABLE 2. (Cont'd)
IEEE 488 INTERFACE MESSAGE REFERENCE LIST
7-163
8291
A.C. CHARACTERISTICS
10%, Commercial: TA =
Vee = 5V OC to 70C
Notes:
1. 8080 System CLmax = 100pF; CLmin = 15pF; 3 MHz clock.
2. 8085 System CL = 150pF; 4 MHz clock.
7-164
8291
TIMING WAVEFORMS
CS/RSj
1-.---t RR - - - . 1
!.------tAD---_
READ:
-tAR_ -tRD-
DATA BUS
(DATA OUT)
CS/RSj
WRITE - -......--....t
DREQ -----/1 t __
----------""IIj _~'mo
DACK \
7-165
8291
GPIB TIMINGSl 1 1
7-166
8291
Appendix A
MODIFIED STATE DIAGRAMS ically true at <O.8V and is equivalent to pin 36 on the
8291.
Figure A.1 presents the interface function state diagrams.
D. All remote multiline messages decoded are condi-
It is derived from IEEE Std. state diagrams, with the
tioned by ACDS. The multiplication by ACDS is not
following changes:
drawn to simplify the diagrams.
A. The 8291 supports the complete set of IEEE-488 E. The symbol
interface functions except for the controller. These
include: SH1, AH1, T5, TE5, L3, LE3, SR1, RL 1, PP1, DC1,
DT1, and CO. indicates:
B. Addressing modes included in T,L state diagrams. 1. When event X occurs, the function will return to
Note that in Mode 3, MSA, OSA are generated only after state S.
secondary address validity check by the microprocessor 2. X overrides any other transition condition in the
(APT interrupt). function.
C. In these modified state diagrams, the IEEE-488 con- Statement 2 simplifies the diagram, avoiding the explicit
vention of low true logic is followed. Thus, DAV is log- use of X to condition all transitions from S to other states.
,----1
I I
ISH I
IL _ _ _ _ ...lI
pon
DAC
ATN + Pi
(WITHIN t2) DAV
Fl = TACS + SPAS
r-----,
I I
I AH I
I I
L ____ J
F2 = A TN + LACS + LADS
F3 = ATN + rdy
T3' = T3 CPT' APT
7-167
8291
r-----,
I I
ton + MTA MODE 1 I TEl
+ MSA . TPAS . MODE 1 ATN'SPMS I I
L ____ j
IFC
(WITHIN t4)
RQS IN STB I I
I SR a I
I I
L ____ J
IFC
(WITHIN (4)
r-----,
I I
I LE I
I I
L ____ J r----l
I I
I RL I
pon---~
I I
L ____ J
pon---~
7-168
8291
r----1
r-----, I I
I I DC I
PP2 I IL _ _ _ _ JI
I I
c:x:B
L ____ J
pon---~
F6
IDY* r ----1
(WITHIN (5)
I I
I DT I
Il ____ ...JI
Appendix B
IEEE 488 TIME VALUES
Time Value
Identifier* Function (Applies to) Description Value
T1 SH Settling Time for Multiline Messages ::::: 2/-lst
-
t2 LC,IC,SH,AH,T,L Response to A TN ::; 200ns
T3 AH Interface Message Accept Time t > 00
t4 T,TE,L,LE,C,CE Response to IFC or REN False < 100/-ls
ts PP Response to ATN+EOI ::; 200ns
Ta C Parallel Poll Execution Time ::::: 2/-ls
T7 C Controller Delay to Allow Current Talker ::::: 500ns
to see A TN Message
Ta C Length of IFC or REN False > 100/-ls
Tg C Delay for EOI ** ::::: 1.5/-lstt
* Time values specified by a lower case t indicate the maximum time allowed to make a state transition. Time values specified by an
upper case T indicate the minimum time that a function must remain in a state before exiting.
If three-state drivers are used on the DIO, DAV, and EOI lines, T1 may be:
1. 2: 11 OOns
2. Or 2: 700ns if it is known that within the controller ATN is driven by a three-state driver.
3. Or 2: 500ns for all subsequent bytes following the first sent after each false tranSition of ATN (the first byte must be sent in
accordance with (1) or (21.
4. Or 2: 350ns for all subsequent bytes following the first sent after each false transition of ATN under conditions specified in
Section 5.2.3 and warning note. See IEEE Standard 488.
t Time required for interface functions to accept, not necessarily respond to interface messages.
{) Implementation independent.
** Delay required for EOI, NDAC, and NRFD signal lines to indicate valid states.
7-169
8291
Appendix C
THE THREE WIRE HANDSHAKE
_TWRD15i
I VALID
I NOT VALID
I VALID
T1L
I----n
,
TDVNRl
I\.
!--TNDDV1-
}'t
~ t--TWRDV2-
,
-TRDNR3- I----
i\.-
I---- TNRDV2 ---
V-
)
!---TDVND3 ... !--TDVND2
) "
~mDD"J
DREO(SH)
~,"VD"J
DREO(AH)
\
V
WR
U
V
Figure C-1. 3-Wire Handshake Timing at 8291.
7170
8291
SOURCE ACCEPTOR
YES
YES
NO
7-171
8291
Appendix D
FUNCTIONAL PARTITIONS
DEVICE (APPARATUS)
\
\
\
\
\
\
\
\
\
\
\
\ DRIVERS
\ AND
\ RECEIVERS
DEVICE MESSAGE
FUNCTIONS CODING
7-172
8292
GPIB CONTROLLER
The 8292 GPIB Controller is a microprocessor-controlled chip designed to function with the 8291 GPIB Talker/Listener
to implement the full IEEE Standard 488 controller function, including transfer control protocol. The 8292 is a pre-
programmed Intel 8041A.
X1 COUNT
GND EOI
RD SPI
T/R2
AO TCI
WR CIC
SYNC NC
DO ATNO TiAl
01 NC
02 CLTH
03 VCC 8293
BUS
04 NC TRANSCEIVERS
05 SYC
Os IFC
07 ATNI
VSS SRQ
GENERAL PURPOSE INTERFACE BUS
7-173 00741C
8292
PIN DESCRIPTION
Function
~ymbOI I~~ I~i:"N~~ I ~. , Function
irvL. I I I r v neCeiVeU \laIClleU} - I lie O~l1~ vee t"".i). 0, ~O, QU +ov supply inpUt. ~ IU70.
monitors the IFC Line (when not COUNT. I 39 Count Input - When enabled by
system controller) through this
the proper command the internal
pin. counter will count external events
X 1, X2 I 2, 3 Inputs for a crystal, LC or an exter- through this pin. High to low tran-
nal timing signal to determine the sition will increment the internal
internal oscillator frequency. counter by one. The pin is sampled
RESET I 4 Used to initialize the chip to a once per three internal instruction
known state during power on. cycles (7.5J.1sec sample period
when using 6 MHz XTAL). It can be
CS I 6 Chip Select Input - Used to select used for byte counting when con-
the 8292 from other devices on the nected to NOAC, or for block
common data bus. counting when connected to the
RO I 8 1/0 write input which allows the EOL
master CPU to read from the 8292. REN 0 38 The Remote Enable bus signal
Ao I 9 Address Line - Used to select be- selects remote or local control of
tween the data bus and the status the device on the bus. A GPIB bus
register during read operations management line, as defined by
and to distinguish between data IEEE Std. 488-1978.
and commands written into the OAV 1/0 37 OAV Handshake Line - Used duro
8292 during write operations. ing parallel poll to force the 8291
-
WR I 10 1/0 read input which allows the to accept the parallel poll status
master CPU to write to the 8292. bits. It is also used during the tcs
procedure.
SYNC 0 11 8041A instruction cycle synchro-
nization signal; it is an output IBFI o 36 Input Buffer Not Full - Used to
clock with a frequency of interrupt the central processor
XTAL+ 15. while the input buffer of the 8292
is empty. This feature is enabled
0 0 -0 7 110 12-19 8 bidirectional lines used for com-
and disabled by the interrupt
munication between the central
mask register.
processor and the 8292's data bus
buffers and status register. OBFI o 35 Output Buffer Full - Used as an
interrupt to the central processor
Vss P.S. 7, 20 Circuit ground potential.
while the output buffer of the 8292
SRO I 21 Service Request - One of the is full. The feature can be enabled
IEEE control lines. Sampled by the and disabled by the interrupt
8292 when it is controller in mask register.
charge. If true, SPI interrupt to the
master will be generated.
EOl2 110 34 End Or Identify - One of the GPIB
management lines, as defined by
ATNI I 22 Attention In - Used by the 8292 to IEEE Std. 488-1978. Used with ATN
monitor the GPIB ATN control as Identify Message during paral-
line. It is used during the transfer lel poll.
control procedure.
SPI o 33 Special Interrupt - Used as an
IFC 1/0 23 Interface Clear - One of the GPIB interrupt on events not initiated by
management lines, as defined by the central processor.
IEEE Std. 488-1978, places all de-
vices in a known quiescent state.
TCI o 32 Task Complete Interrupt - Inter-
rupt to the control processor used
SYC I 24 System Controller - Monitors the to indicate that the task requested
system controller switch. was completed by the 8292 and
CLTH 0 27 CLEAR LATCH Output - Used to the information requested is ready
clear the IFCR latch after being in the data bus buffer.
recognized by the 8292. Usually CIC o 31 Controller In Charge - Controls
low (except after hardware Reset), the SIR input of the SRO bus
it will be pulsed high when IFCR is transceiver. It can also be used to
recognized by the 8292. indicate that the 8292 is in charge
ATNO 0 29 Attention Out - Controls the ATN of the GPIB bus.
control line of the bus through ex-
ternal logic for tcs and tca pro-
cedures. (ATN is a GPIB control
line, as defined by IEEE Std~
488-1978.)
7-174 00741C
8293
GPIB TRANSCEIVER
The Intel 8293 GPIB Transceiver is a high current, non-inverting buffer chip designed to interface the 8291 GPIB
Talker/Listener or the 8292 GPIB Controller with the 8291 to the IEEE Standard 488-1978 Instrumentation Interface
Bus. Each GPIB interface would contain two 8293 Bus Transceivers. In addition, the 8293 can also be used as a general
purpose bus driver.
8293
BUS
TRANSCEIVERS
7-175
8293
DATA1- 110 5-11, These are the pins to be Gon- o 4 Attention; this pin is used by
DATA10 23-25 nected to the 8291 and 8292 to the 8291 to monitor the GPIB
interface with the GPIB bus. ATN control line. It specifies
Their use is programmed by how data on the DIO lines is to
the two mode select pins, be interpreted. This output is
OPTA and OPTB. All these TTL compatible.
pins are TTL compatible. OPTA 27 These two pins are to control
T/R1 Transmit receive 1; this pin OPTB 26 the function of the 8293. A
controls the direction for truth table of how this pro-
NDAC, NRFD, DAV, and D101- grams the various modes is in
D108. Input is TTL compatible. Table 1.
T/R2 2 Transmit receive 2; this pin Vee P.S. 28 Positive power supply (5V
controls the direction for EOL 10%).
Input is TTL compatible. GND P.S. 14,20 Circuit ground potential.
OPTA 27 0 1 0 1
OPTB 26 0 0 1 1
Note: These pins are the IEEE488 bus noninverting driver/receivers. They include all the bus terminations required by the Standard and may be
connected directly to the GPIB bus connector.
7-176
8293
MODEO
GENERAL DESCRIPTION
The 8293 is a bidirectional transceiver. It was designed OPTA
TIR2
GPIB
NRFD
OPTA
OPTB NDAC
12 8293
Tlih
MODE 1
TO
PROCESSOR
TIC 1 =THREE STATE
0= OPEN COLLECTOR 3 =+5V
BUS
14 8291 18 SIR 1 = SEND TO GPIB
0= RECEIVE FROM GPIB
-& =OV
" = IEEE488 BUS NONINVERTING DRIVERIRECEIVER
7-177
8293
Symbol I/O Pin No. Function Symbol I/O Pin No. Function
NRFO" 110 17 Not Ready For Data; IEEE o 5 Interface Clear; processor
GPIB bus handshake control GPIB bus contiolline; used by
line, When an input, it is a TTL a controller to place the inter-
compatible Schmitttrigger. face system into a known
When an output, it is an open- quiescent state. It is a TTL
collector driver with a 48 mA compatible output.
current sinking capability. IFC* 12 Interface Clear; IEEE GPIB
T/R2 2 Transmit receive 2; direction bus control line. This input is
control for EOL If T/R2 is high, a TTL compatible Schmitt-
EOI* is sending. Input is TTL trigger.
compatible. T/RI01 11 Transmit receive General 10;
1/0 3 End or Identify; processor T/RI02 23 direction control for the two
GPIB bus control line; is used spare transceivers. Input is
by a talker by indicate the end TTL compatible.
of a multiple byte transfer. 110 24 General 10; this is the TTL
This pin is TTL compatible. 110 25 side of the two spare tran-
EOI" 1/0 15 End or Identify; IEEE GPIB bus sceivers. These pins are TTL
control line; is used by a talker compatible.
to indicate the end of a multi- 110 21 General 10; these are spare
G101*
ple byte transfer. This pin is a G102* 110 22 three-state (push-pull) driversl
three-state (push-pull) driver Schmitt-trigger receivers. The
capable of sinking 48 mA and drivers can sink 48 mAo
a TTL compatible receiver
with hysteresiS.
8 Service Request; processor
GPIB bus control line; used by MODEl
7178
8293
OPTA
Symbol I/O Pin No. Function OPTB
SYC
RE"R REN"
3 End of Sequence and Atten-
4 tion; processor GPIB control
lines. These two control SRO"
SRO
signals are ANDed together to
determine whether all the
transceivers in the 8293 are A'i'Ni
ATN"
AfR
three-state (push-pull) or
open-collector. When both
signals are low (true), then the Ern2 EOI"
controller is performing a A'ftm
parallel poll and the tran-
sceivers are all open- EOi
collector. These inputs are T/R2
TTL compatible.
IFCL J--................
1/0 24 Data Valid; processor GPIB CLTH r----..._
bus handshake control line; CIC r - - - -........- '
used to indicate the condition
(availability and validity) of in-
formation on the DIO signals. Figure 5. Talker/Listener/Controller Control
It is TTL compatible. Configuration
DAV* 1/0 21 Data Valid; IEEE GPIB bus MODE 2 PIN DESCRIPTION
handshake control line. When
an input, it is a TTL compati- Symbol I/O Pin No. Function
ble Schmitt-trigger. When
DAV* is an output, it can sink T/R1 Transmit receive 1; direction
48 mA. control for NDAC and NRFD.
If T/R1 is high, then NDAC and
NRFD are receiving. Input is
1/0 25,23, Data InputlOutput; processor TTL compatible.
10,9, GPIB bus data lines; used to 1/0 10 Not Data Accepted; processor
8,7, carry message and data bytes GPIB bus handshake control
6,5 in a bit-parallel byte-serial line; used to indicate the con-
form controlled by the three dition of acceptance of data
handshake signals. These by device(s). This pin is TTL
lines are TTL compatible. compatible.
NDAC* 1/0 18 Not Data Accepted; IEEE
D101* 1/0 22, 19, Data Input/Output; IEEE GPIB GPIB bus handshake control
D108* 18,17, bus data lines. They are TTL line. It is a TTL compatible
16, 15, compatible Schmitt-triggers Schmitttrigger when used for
13, 12 when used for input and can input and an open-collector
sink 48 mA when used for out- driver with a 48 mA current
put. See ATN and EOI descrip- sink capability when used for
tion for output mode. output.
7-179
8293
Symbol 1/0 Pin No. Function Symbol I/O Pin No. Function
NRFO I/O 9 Not Ready For Data; processor is recognized by the 8292.
GPI8 bus handshake contiOl This input is TTL compatible.
line; used to indicate the con o 25 IFC Received Latched; the
dition of readiness of device(s) 8292 monitors the IFC line
to accept data. This pin is TTL when it is not the active con-
compatible. troller through this pin.
NRFO* 1/0 17 Not Ready For Data; IEEE 1/0 8 Service Request; processor
GPIB bus handshake control GPIB control line; indicates
line. It is a TTL compatible the need for attention and re-
Schmitttrigger when used for quests the active controller to
input and an open-collector interrupt the current sequence
driver with a 48 mA current of events on the GPIB bus.
sink capability when used for This pin is TTL compatible.
output.
SRO* I/O 16 Service Request; IEEE GPIB
SYC 22 System Controller; used to bus control line. When used
monitor the system controller as an input, this pin is a TTL
switch and control the direc- compatible Schmitt-trigger.
tion for IFC and REN. This pin When used as an output, it is
is a TTL compatible input. an open-collector driver with a
REN 1/0 6 Remote Enable; processor 48 mA current sinking capa-
GPIB control line; used by the bility.
active controller (in conjunc- T/R2 2 Transmit receive 2; controls
tion with other messages) to the direction for EOL This in-
select between two alternate put is TTL compatible.
sources of device program-
23 Attention Out; processor
ming data (remote or local con-
GPIB bus control line; used by
trol). This pin is TTL compa- the 8292 for ATN control of
tible. the IEEE bus during "take
REN* 1/0 13 Remote Enable; IEEE GPIB control synchronously" opera-
bus control line. When used as tions. A low on this input
an input, this is a TTL compati- causes ATN to be asserted if
ble Schmitt-trigger. When an CIC indicates that this 8292 is
output, it is a three-state driver in charge. ATNO is a TTL com-
with a 48 mA current sinking patible input.
capability. o 11 Attention In; processor GPIB
IFC 1/0 5 Interface Clear; processor bus control line; used by the
GPIB bus control line; used by 8292 to monitor the ATN line.
the active controller to place This output is TTL compatible.
the interface system into a
known quiescent state. This
o 4 Attention; processor GPIB
bus control live; used by the
pin is TTL compatible. 8292 to monitor the ATN line.
IFC* 1/0 12 Interface Clear; IEEEGPIB bus This output is TTL compatible.
control line. This is a TTL com- ATN* I/O 19 Attention; IEEE GPIB bus con-
patible Schmitt-trigger when trol line; used by a controller
used for input and a three- to specify how data on the
state driver capable of sinking 010 signal lines are to be in-
48 mA current when used for terpreted and which devices
output. must respond to data. When
24 Controller in Charge; used to used as an output, this pin is a
control the direction of the three-state driver capable of
SRO and to indicate that the sinking 48 rnA current. As an
8292 is in charge of the bus. input, it is a TTL compatible
CiC is a TTL compatible input. Schmitt-trigger.
CLTH 21 Clear Latch; used to clear the I/O 7 End or Identify 2; processor
IFC Received latch after it has GPIB bus control line; used in
been recognized by the 8292. conjunction with ATN by the
Normally low (except after active controller (the 8292) to
a hardware reset), it will be execute a polling sequence.
pulsed low when IFC Received This pin is TTL compatible.
7-180
8293
7-181
8293
8293
25
0101 0101 -1922
23
0102 0102 -
10
9
DT03 0103 -17
18
.E...
IEEE488
BUS
REN
IFC
24 I 8
SRO SRO r-!!..
6
REN REN ,..!.!..
5
IFC IFC r-!!..
OPTA ~ GNO
OPTB ~ GNO
MOOEO
= GPIB BUS TRANSCEIVER
7-182
8293
TO MICROPROCESSOR
~ -0101 28 25
DO 0101 0101" rE-
~~ 01 -
0102
29 23
0102 0102" ~
t-~ 02
0103
30 10
0103 0103" ~
15
03 31 9
16
04
0104 0104 0104" ~
32 8
17
05 0105 0105 0105" ~ TO
7 IEEE488
18
06 0106
33
0106 0106" ~ BUS
19
0107" ~
34 6
07 0107 0107
21 8291 5 8293
Dl08'- ~
RSO 35
0108 0108
22
RS1 1 1
23 TlR1 Tlih
RS2
~
36 24
9 OAV OAV OAV"
Flo 39 3
10 EOI EOI
WR
4 26 4
TO RESET ATN ATN
6 27
MICROPROCESSOR OREO SRO
7
OACK 24
8 IFC
Cs 38
3 NOAC
CLOCK 37
11 NRFO
INT
TlR2
2
.....--2.!.. ATNO OPTA ~ Vee
GPIB
TRIGGER
5
TRIG REN 12-1-1- .-!. IFCL OPTB ~ Vee
OUTPUT MODE 3
~
4 COUNT EOI EOI"
RESET -EOl2 34 7
6 EOl2
Cs 22 11
32 ATNI ATNI
TCI
MICROPROCESSOR
TO I 33
35
36
SPI
OBFI
IBFI
OSCILLATOR 11
SYNC
OUTPUT
Vee~ 1 25
IFCL IFCL
~ X,
CIC
31 24
CIC
~3
r
21
X2 CLTH
27
CLTH OPTA ~ GNO
22
SYC
24
SYC OPTB ~ Vee
1525 pF
Lr ON
0FF
1.
SYSTEM
CONTROLLER
SWITCH
MOOE2
7-183
8293
LIMITS
SYMBOL PARAMETER UNIT TEST CONDITIONS
MIN. TYP. MAX.
Capacitance
7184
8293
A.C. Characteristics
TA=OC to 70C; Vcc =5.0V 10%; GND=OV
"Typical @ TA = 25C.
--
4.0
I
fii 40 r - - - - vcc ~ 5.0 v-+--~r:::::1~~~::::~:::1
<"
2.0
I ~ g . TA=25C
.. ~
I-
z -2.0 ,.- " .
~
J
I w
~ 3.0 1 - - - + - - + - - + - - + - - + - - - + - + - - + - - - /
'"a:a: -4.0 ~ !:i
o
:;) I >
U -6.0
II) ~ 2.0 r--+--+--+--f--+--~f---+----I
:;)
NONSHADED AREA Q.
III -8.0 CONFORMS TO - I-
:;)
PARAGRAPH 3.5.3 OF
j -10 IEEE STANDARD
- ~ 1.01---+--+--+--+--+----+-+--+---/
-12 488 1978 - ~
Vcc=5.0V
-14
-4.0 -2.0 -0 2.0 4.0 6.0
U 1~ 1~ 2.0
VBUS, BUS VOLTAGE (VOLTS) VI, INPUT VOLTAGE (VOLTS)
Figure 9. Typical Bus Load Line Figure 10. Typical Receiver Hysteresis Characteristics
7185
8293
TO SCOPE TO SCOPE
(OUTPUT) +2.3V (OUTPUT) +s.OV
38.3Q 240Q
BUS DATA
IN916
C, fOp, OR EQUIV.
CL INCLUDES JIG AND PROBE CAPACITANCE CL INCLUDES JIG AND PROBE CAPACITANCE
Figure 11. Data Input to Bus Output (Driver) Figure 12. Bus Input to Data Output (Receiver)
TO SCOPE TO SCOPE
(OUTPUT) 1.1V (OUTPUT) s.OV
280Q
f f
480Q 3 KQ
CL INCLUDES JIG AND PROBE CAPACITANCE CL INCLUDES JIG AND PROBE CAPACITANCE
Figure 13. Send/Receive Input to Bus Output (Driver) Figure 14. Send/Receive Input to Data Output (Receiver)
7~186
8293
8293 WAVEFORMS
tpLH2
OUTPUT
(RECEIVER PROP. DELAY) 1.5V
FIGURE 12 LOAD
tPZH1
OUTPUT I----------voH------+_----~
(DRIVER ENABLE DELAY 2.0V
WITH INPUT HIGH)
FIGURE 13 LOAD VZ== 1.0V
tPZL1
OUTPUT VZ== 1.13V
(DRIVER ENABLE DELAY
WITH INPUT LOW) O.SV
FIGURE 13 LOAD
OUTPUT
(RECEIVER ENABLE DELAY
-- tPZH2
I~---------VOL------+---~~
~--------VOH------+---~~
Inur
WITH INPUT HIGH) 1.5V
FIGURE 14 LOAD OV
OUTPUT
(RECEIVER ENABLE DELAY
I"" t:- 5V
7187
8294
DATA ENCRYPTION UNIT
Certified by National Bureau of 7Bit User Output Port
Standards
Single 5V 100/0 Power Supply
SO Byte/Sec Data Conversion Rate
Peripheral to MCSS6, MCSS5,
64Bit Data Encryption Using 56Bit MCSSOTM and MCS48 Processors
Key
DESCRIPTION
The Intel@ 8294 Data Encryption Unit (DEU) is a microprocessor peripheral device designed to encrypt and decrypt
64-bit blocks of data using the algorithm specified in the Federal Information Processing Data Encryption Standard.
The DEU operates on 64-bit text words using a 56-bit user-specified key to produce 64-bit cipher words. The operation
is reversible: if the cipher word is operated upon, the original text word is produced. The algorithm itself is perma-
nently contained in the 8294; however, the 56-bit key is user-defined and may be changed at any time.
The 56-bit key and 64-bit message data are transferred to and from the 8294 in 8-bit bytes by way of the system data
bus. A DMA interface and three interrupt outputs are available to minimize software overhead associated with data
transfer. Also, by using the DMA interface two or more DEUs may be operated in parallel to achieve effective system
conversion rates which are virtually any multiple of 80 bytes/second. The 8294 also has a 7-bit TTL compatible output
port for user-specified functions.
Because the 8294 implements the NBS encrypti'on algorithm it can be used in a variety of Electronic Funds Transfer
applications as well as other electronic banking and data handling applications where data must be encrypted.
PIN
CONFIGURATION BLOCK DIAGRAM
VCC
DATA
Xl NC
BUS
X2
RESET ORQ
NC SRQ
cs OAV
NC
AD P6
AO P5 Ao
WR P4 SRO
P3 OAY
CCMP
Po'Ps
"m~
02
03 VOO
NC SYNC
NC X,
NC X2 TIMING
+5Y--
POWER-- INTERNAL
BUS
GNO--
7-188 002308
inter
8295
DOT MATRIX PRINTER CONTROLLER
The Intel@ 8295 Dot Matrix Printer Controller provides an interface for microprocessors to the LRC 7040 Series dot
matrix impact printers. It may also be used as an interface to other similar printers.
The chip may be used in a serial or parallel communication mode with the host processor. In parallel mode, data
transfers are based on polling, interrupts, or DMA. Furthermore, it provides internal buffering of up to 40 characters
and contains a 7 x 7 matrix character generator accommodating 64 ASCII characters.
PIN
CONFIGURATION BLOCK DIAGRAM
INTERNAL
BUS
7-189 002318
8295
PIN DESCRIPTION
PFEED Paper feed input switch. HOME 39 Home input switch, used by the
XTAL1 2 Inputs for a crystal to set internal 8295 to detect that the print head
XTAL2 3 oscillator frequency. For proper is in the home position.
operation use 6 MHz crystal. DACK/SIN 38 In the parallel mode used as DMA
acknowledgement; in the serial
4 Reset input, active low. After
mode, used as input for data.
reset the 8295 will be set for 12
characters/inch single width DRQ/CTS 0 37 In the parallel mode used as DMA
printing, solenoid strobe at 320 request output pin to indicate to
msec. the 8257 that a DMA transfer is re-
quested; in the serial mode used
NC 5 No connection or tied high. as clear-to-send signal.
CS 6 Chip select input used to enable IRQ/SER o 36 In parallel mode it is an interrupt
the RD and WR inputs except dur- request input to the master CPU;
ing DMA. in serial mode it should be
GND 7 This pin must be tied to ground. strapped to Vss.
RD 8 Read input which enables the MOT o 35 Main motor drive, active low.
master CPU to read data and STB o 34 Solenoid strobe output. Used to
status. In the serial mode this pin determine duration of solenoids
must be tied to Vee. activation.
Vee 9 + 5 volt power input: + 5V 10%. o 33 Solenoid drive outputs; active
32 low.
WR 10 Write input which enables the
31
master CPU to write data and
30
commands to the 8295. In the
29
serial mode this pin must be tied
28
to Vss.
27
SYNC o 11 2.5 '"'s clock output. Can be used
26 + 5V power input (+ 5V 10%).
as a strobe for external circuitry.
Low power standby pin.
Do I/O 12 Three-state bidirectional data bus
13 buffer lines used to interface the NC 25 No connection.
D1
D2 14 8295 to the host processor in the GP1 o 24 General purpose output pins.
D3 15 parallel mode. In the serial mode
16 Do- D2 sets up the baud rate.
GP2 o 23
D4
D5 17 TOF 22 Top of form input, used to sense
D6 18 top of form signal for type T
D7 19 printer.
GND 20 This pin must be tied to ground. o 21 Paper feed motor drive, active
Vee 40 + 5 volt power input: + 5V 10%. low.
7-190 002316
8295
FUNCTIONAL DESCRIPTION Communication between the 8295 and the host proc-
essor can be implemented in either a serial or parallel
mode. The parallel mode allows for character transfers
The 8295 interfaces microcomputers to the LRC 7040 into the buffer via DMA cycles. The serial mode features
Series dot matrix impact printers, and to other similar selectable data rates from 110 to 4800 baud.
printers. It provides internal buffering of up to 40 char- The 8295 also offers two general purpose output pins
acters. Printing begins automatically when the buffer is which can be set or cleared by the host processor. They
full or when a carriage return character is received. It can be used with various printers to implement such
provides a modified 7x7 matrix character generator. The functions as ribbon color selection, enabling form
character set includes 64 ASCII characters. release solenoid, and reverse document feed.
COMMAND SUMMARY
Hex Code Description Hex Code Description
00 Set GP1. This command brings the GP1 pin 09 Tab character.
to a logic high state. After power on it is
OA Line feed.
automatically set high.
01 Set GP2. Same as the above but for GP2. OB Multiple Line Feed; must be followed by a
byte specifying the number of line feeds.
02 Clear GP1. Sets GP1 pin to logic low state,
inverse of command 00. OC Top of Form. Enables the line feed output
until the Top of Form input is activated.
03 Clear GP2. Same as above but for GP2. In-
verse command 01. 00 Carriage Return. Signifies end of a line and
04 Software Reset. This is a pacify command. enables the printer to start printing.
This command is not effective immediately OE Set Tab #1, followed by tab position byte.
after commands requiring a parameter, as
the Reset command will be interpreted as a OF Set Tab #2, followed by tab position byte.
parameter. Should be greater than Tab #1.
05 Print 10 characterslin. density. 10 Set Tab #3, followed by tab position byte.
Should be greater than Tab #2.
06 Print 12 characterslin. density.
07 Print double width characters. This com- 11 Print Head Home on Right. On some
mand prints characters at twice the normal printers the print head home position is on
width, that is, at either 17 or 20 characters the right. This command would enable nor-
per line. mal left to right printing with such printers.
08 Enable DMA mode; must be followed by 12 Set Strobe Width; must be followed by
two bytes specifying the number of data strobe width selection byte. This command
characters to be fetched. Least significant adjusts the duration of the strobe activa-
byte accepted first. tion.
002318
7-191
8295
lowed by a byte specifying the column. The tab posi- the 8257 DMA controller without further CPU interven-
tions will then remain valid until new Set Tab commands tion. Figure 2 shows a block diagram of the 8295 in DMA
are issued. mode.
Sending a tab character (09H) wiii automaticaiiy fiii the
character buffer with blanks up to the next tab position.
The character sent immediately after the tab character
will thus be stored and printed at that position.
PARALLEL INTERFACE
Two internal registers on the 8295 are addressable by
the CPU: one for input, one for output. The following
table describes how these registers are accessed.
DONE
RD WR CS Register
Figure 1. Host to 8295 Protocol Flowchart
100 Input Data Register
010 Output Status Register
8257
Input Data Register-Data written to this register is DMA
' - - - - -.. '1 CONTROLLER
interpreted in one of two ways, depending on how the
DACKx
data is coded. DROx
1. A command to be executed (OXH or lXH).
OPTIONAL
2. A character to be stored in the character buffer for
printing (2XH, 3XH, 4XH, or 5XH). See the character
set, Table 2. X, X2
Output Status Register-8295 status is available in this I/)
::;,
ID
cs DRO
register at all times. ::IE AD DACK
....w
I/)
WR
>
I/) REID
STATUS BIT:
IBF
MOT
FUNCTION: PA DE
PFM
8295
PA-Parameter Required; PA = 1 indicates that a com- D7
mand requiring a parameter has been received. After the DO 57 PRINTER
necessary parameters have been received by the 8295,
the PA flag is cleared. IRO
7-192 oo231B
8295
SERIAL INTERFACE +5
a 1 1 600 52
1 a a 1200
1 a 1 2400 51
a
I
4800 MOT
TO MOTOR
4800 DRIVERS
PFM
Table 2.
The serial data format is shown in Figure 3. The CPU Figure 4. 8295 To Printer Solenoid Interface
should wait for a clear to send signal (CTS) from the
8295 before sending data.
OSCILLATOR AND TIMING CIRCUITS
The 8295's internal timing generation is controlled by a
self-contained oscillator and timing circuit. A 6 MHz
crystal is used to derive the basic oscillator frequency.
The resident timing circuit consists of an oscillator, a
+5 state counter and a cycle counter as illustrated in Figure
5. The recommended crystal connection is shown in
Figure 6.
PRINTER
PFEED 1 - - - - - - - ;
HOME I------~
SYNC
OUTPUT
(2.5 "lee)
SERIAL
INPUT
STOP
BIT
INTERNAL TIMING
7-193 OO231e
8295
Limits
Symbol Parameter Unit Test Conditions
Min. Typ. Max.
VIL Input Low Voltage (All -0.5 0.8 V
Except X1, X2, RESEl)
VIL1 Input Low Voltage (X h X2, -0.5 0.6 V
RESEl)
VIH Input High Voltage (All 2.2 Vee V
Except X1, X2, RESEl)
VIH1 Input High Voltage (X 1, X2, 3.8 Vee V
RESEl)
VOL Output Low Voltage (Do- D 7) 0.45 V IOL=2.0mA
VOl1 Output Low Voltage (All 0.45 V 10L= 1.6mA
Other Outputs)
VOH Output High Voltage (00- 0 7) 2.4 V 10H= -400",A
VOH1 Output High Voltage (All 2.4 V 10H= -50",A
Other Outputs)
IlL Input Leakage Current 10 !lA Vss ~ VIN ~ Vee
(RD, WR, CS, A~
loz Output Leakage Current 10 !lA Vss+O.45~ VIN~ Vee
(Do-D7' High Z State)
100 Voo Supply Current 5 15 mA
100+ lee Total Supply Current 60 125 mA
lu Low Input Load Current 0.5 mA VIL=0.8V
(Pins 24, 27-38)
IU1 Low Input Load Current 0.2 mA VIL= 0.8V
(RESET)
7-194 002318
8295
A.C. CHARACTERISTICS
TA=OC to 70C, Vcc=Voo= +5V 10%, VSS=OV
DBB READ
Symbol Parameter Min. Max. Unit Test Conditions
tAR CS, Ao Setup to RD + 0 ns
tRA CS, Ao Hold After RD t 0 ns
tRR RD Pulse Width 250 ns
tAD CS, Ao to Data Out Delay 225 ns C L = 150 pF
tRO RD +to Data Out Delay 225 ns C L = 150 pF
tOF RD t to Data Float Delay 100 ns
tCY Cycle Time 2.5 15 ",s
DBB WRITE
Symbol Parameter Min. Max. Unit Test Conditions
tAW CS, Ao Setup to WR + 0 ns
tWA CS, Ao Hold After WR t 0 ns
tww WR Pulse Width 250 ns
tow Data Setup to WR t 150 ns
two Data Hold to WR t 0 ns
7-195 002318
8295
WAVEFORMS
CS OR Ao ). K (SYSTEM'S
ADDRESS BUS)
-'AR,
- 'RR /- 'RA--
\ ~ (READ CONTROL)
--'RO-- '-'OF1
DATA OUs
(OUTPUT)
'AD -=j
-------------(j--DATAVALD---=v--------------
J)
~--"'11---'ww-------O.~-_'WA-+"-----
~
(SYSTEM'S
CS OR AO ADDRESS BUS)
- - _- _- _
WR '{ (WRITE CONTROL)
~------------'-Ow-------- - - 'WO
~
IcAC-
II
-
~ J
ORO
'CRO
}
D:~: ~---- --------V_AL_ID--------------J)(~--------------
-'ACO
_________________ __
7-196 002318
8295
MOTOR DRIVE
\ )
V
HOME
I , ....
J \
SOLENOID DATA
) K
- -SDS
- MHH ~
r--'~~U
.(\.
SOLENOID STROBE
J
I-- PDH--
7197 002318
inter
2ii4A
1024 X 4 BIT STATIC RAM
2114AL-1 2114AL-2 2114AL-3 2114AL-4 2114A-4 2114A-5
Max. Access Time (ns) 100 120 150 200 200 250
Max. Current (mA) 40 40 40 40 70 70
The Intel@! 2114A is a 409~bit static Random Access Memory organized as 1024 words by 4-bits using HMOS, a high per-
formance MOS technology. It uses fully DC stable (static) circuitry throughout, in both the array and the decoding, therefore it
requires no clocks or refreshing to operate. Data access is particularly simple since address setup times are not required. The
data is read out nondestructively and has the same polarity as the input data. Common input/output pins are provided.
The 2114A is designed for memory applications where the high performance and high reliability of HMOS, low cost, large bit
storage, and simple interfacing are important design objectives. The 2114A is placed in an 18-pin package for the highest
possible density.
It is directly TTL compatible in all respects: inputs, outputs, and a single +5V supply. A separate Chip Select (CS) lead allows
easy selection of an individual package when outputs are or-tied.
~ @
~ vee Ao
A3
0)
--=-- vee
A4 --ill-GND
As A7 A, 110,
As MEMORY ARRAY
A2 ROW
A4 As '1) SELECT 64 ROWS
A .- 64COLUMNS
A3 Ag ~
1/2
6@
A7
A4
Ao 110, @
As
As
A, I/~ 1/3
A6
IIO,@
~ 1/3 A7
CS 1/4 As
1/4
GND WE Ag
WE CS
PIN NAMES
INTEL CORPORA TlON ASSUMES NO RESPONSIBILITY FOR THE USE OF ANY CIRCUITRY OTHER THAN CIRCUITRY EMBODIED IN AN INTEL PRODUCT. NO OTHER CIRCUIT PATENT LICENSES ARE IMPLIED.
c INTEL CORPORATION_ 1977. 1979 7-198 DECEMBER. 1979
2114A FAMILY
2114AL-1/L-2/L-3/L-4 2114A-4/-5
SYMBOL PARAMETER Min. Typ.lll Max. Min. Typ.lll Max. UNIT CONDITIONS
10L Output Low Current 2.1 9.0 2.1 9.0 mA VOL = O.4V
10H Output High Current -1.0 -2.5 -1.0 -2.5 mA VOH = 2.4V
CAPACITANCE
TA = 25C, f = 1.0 MHz
SYMBOL TEST MAX UNIT CONDITIONS
7-199
2114A FAMILY
A.C. CHARACTERISTICS TA =OC to 70C, Vee =5V 10%, unless otherwise noted,
SYMBOL PARAMETER Min. Max. Min. Max. Min. Max. Min. Max. Min. Max. UNIT
NOTES:
1. A Read occurs during the overlap of a low CS and a high WE.
2. A Write occurs during the overlap of a low CS and a low WE. tw is measured from the latter of CS or WE going low to the earlier of CS or WE going high.
WAVEFORMS
READ CYCLE@ WRITE CYCLE
1-------tRc------+I twc
1------tA-------i
ADDRESS
~\\
-tOT~
NOTES: DOUT
transition, the output buffers remain in a high impedance state. 'V V'
D,N ~
5. "WE must be high during all address transitions.
7-200
2114A FAMILY
1.1 1.1
:f.
Cl
w
N
::;
~
1.0
0.9
0.8
-- r--
:f.
fil
N
::;
~
1.0
0.9
0.8
~ ---
~f-""
II: II:
0
Z
oZ
0.7 0.7
0.6 0.6
0.5 0.5
4.50 4.75 5.00 5.25 5.50 o 20 40 60 80
/"
----r----- ----
1.2 u 1.0
S?
:f. V fil
Cl
w 1.1 ./" N
::;
0.9
N
:::;
~ 1.0
//
~
II: 0.8
r---
II: o
0 Z
z I
0.9 0.7
0.8 0.6
0.7 0.5
100 150 200 250 300 350 o 20 40 60 80
/
//
30 60
20 40
~ V
10 ~ 20
/
~
o
o
o /
o
7201
1024 X 4 BIT STATIC RAM
2142-2 2142-3 2142 2142L2 2142L3 2142L
I Max. Access Time (ns) 200 300 450 200 300 450
I Max. Power Dissipation (mw) 525 525 525 370 370 370
Access
High Density 20 Pin Package No Clock or Timing Strobe Required
I dentlcalTime Selections From 200-450ns Directly
Completely Static Memory
Low Operating
Cycle and Access Times and Outputs
TTL Compatible: All Inputs
.1mW/Blt TypicalPower Dissipation
Three-State
Common Data Input and Output Using
Single +5V Supply Outputs
The Intel@ 2142 is a 4096-bit static Random Access Memory organized as 1024 words by 4-bits using N-channel Silicon-
Gate MOS technology. It uses fully DC stable (static) circuitry throughout - in both the array and the decoding - and
therefore requires no clocks or refreshing to operate. Data access is particularly simple since address setup times are not
required. The data is read out nondestructively and has the same polarity as the input data. Common input/output pins are
provided.
The 2142 is designed for memory applications where high performance, low cost, large bit storage, and simple interfacing
are important design objectives. It is directly TTL compatible in all respects: inputs, outputs, and a single +5V supply.
The 2142 is placed in a 2o-pin package. Two Chip Selects (CS1 and CS2) are provided for easy and flexible selection of
individual packages when outputs are OR-tied. An Output Disable is included for direct control of the output buffers.
The 2142 is fabricated with Intel's N-channel Silicon-Gate technology - a technology providing excellent protection
against contamination permitting the use of low cost plastic packaging.
A3
As Vcc AO @
A4 @
-----0 Vcc
A5 A7 A, I/O,
A5
MEMORY ARRAY
A4 As A2 ROW 64 ROWS @ 0 GND
G) SELECT 64 COLUMNS
A6
A3 Ag A3
1/02 @)
CS2 00 A7
A4
@)
Ao I/O, A5 AS
1/03
A, 1/0 2 A6
1/0,
A2 1/03 A7
GNO WE
1/0 3
1/0 4
PIN NAMES
AO-A9 ADDRESS INPUTS DO OUTPUT DISABLE
WE WRITE ENABLE Vcc POWER (+5V)
CSi, CS2
1/01-1104
CHIP SELECT
DATA INPUT/OUTPUT
GND GROUND o = PIN NUMBERS
7-202
2142 FAMILY
ABSOLUTE MAXIMUM RATINGS* *COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
Temperature Under Bias . . . . . . . . . . . . _10C to a<tc
device. This is a stress rating only and functional opera-
Storage Temperature . . . . . . . . . . . . . .-65C to +150C
tion of the device at these or any other conditions above
Voltage on Any Pin
those indicated in the operational sections of this specifi-
With Respect to Ground ........... -0.5V to +7V
cation is not implied. Exposure to absolute maximum
Power Dissipation . . . . . . . . . . . . . . .. 1.0W
rating conditions for extended periods may affect device
D.C. Output Current . . . . . . . . . . . . . . . . . . . . . lOrnA
reliability.
ICC2 Power Supply Current 100 70 rnA VIN = 5.25V, 1110 = 0 mA,
TA = OC
10L Output Low Current 2.1 6.0 2.1 6.0 rnA VOL = 0.4V
10H Output High Current -1.0 -1.4 -1.0 -1.4 rnA VOH = 2.4V
105[2J Output Short Circuit 40 40 rnA VI/a = GND to VCC
Current
CAPACITANCE
TA = 25C, f = 1.0 MHz
7-203
2142 FAMILY
NOTES:
1. A Read occurs during the overlap of a low CS and a high WE.
2. A Write occurs during the overlap of a low es and a low WE.
WAVEFORMS
READ CYCLE@ WRITE CYCLE
t+------tRC-----~ twc
1+-----tA - - - - - - I
ADDRESS ADDRESS
OD OD
(it
tWR-
- ).\\\\\\
-tOTO+-
11/ 'il/. lL ,\ \ \ \ \ \ \ \
tw
DOUT
NOTES:
@
D,N----~r--l.,+,.-x,....,...xx~x>
WE is high for a Read Cycle. tow- f.tOH
7-204
2142 FAMILY
-- ---
1. 1 1.1
I'--..
--------
1.0 1.0
0.9
r--- :!
fa
N O.9
~
:::;
<{
0.8 ~ 0.8
~
0.7 0.7
0.6 0.6
0.5 0.5
4.50 4.75 5.00 5.25 5.50 o 20 60 80
Vee (V)
1.1
~
l..-- - - 1.2
1.1
1.0 ~ 1.0
:!
fa 0.9
~
faN 0.9 ~
~ "'-.
- --
N
:::; :::;
<{ <(
::0; 0.8 ::0; 0.8
a: a:
0 0
z z
0.7 0.7
0.6 0.6
0.5
100 200 300 400 500 600 20 60 80
CL (pF)
30 30
/
20
10
o
"" \
~
'"~
1...
.E
20
10
o /
/
V
./
o o
VOH (V) VOL IV)
7-205
2148
1024 x 4 BIT STATIC RAM
21483 2148 21486
Max. Access Time (ns) 55 70 85
Max. Active Current (rnA) 125 125 125
Max. Standby Current (rnA) 30 30 30
A6 Vcc
AO ~VCC
AS A7
A1
1/01 ~GND
A2
A4 AS A6
A3 MEMORY ARRAY
ROW 64 ROWS
A3 Ag 1/02 SELECT
A7 64 COLUMNS
A4
Ao 1/01
AS AS
A1 1/02 1/03
A6
A2 1/03
A7
Ag
o = PIN NUMBERS
cs 1/04
AS
1104
@
1101
GND WE
@
1102
@
1103
PIN NAMES
Ao-Ag ADDRESS INPUTS 1104
WE WRITE ENABLE
cs CHIP SELECT
1/0 1 -1104 DATA INPUTIOUTPUT
Vcc POWER (+sV)
GND GROUND
TRUTH TABLE
CS WE MODE 1/0 POWER
H X NOT SELECTED HIGHZ STANDBY
L L WRITE DIN ACTIVE
L H READ DOUT ACTIVE
INTEL CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE OF ANY CIRCUITRY OTHER THAN CIRCUITRY EMBODIED IN AN INTel PRODUCT NO OTHER CIRCUIT PATENT LICENSES ARE IMPLIED.
(f INTEL CORPORATION 1979 7-206 June 1979
2148
ABSOLUTE MAXIMUM RATINGS COMMENT: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
Temperature Under Bias ............ -10Cto +85C
device. This is a stress rating only and functional opera-
Storage Temperature .............. - 65C to + 150C tion of the device at these or any other conditions above
Voltage on Any Pin with those indicated in the operational sections of this specifi-
Respect to Ground ................. -3.5V to + 7V cation is not implied. Exposure to absolute maximum
D.C. Output Current ......................... 20 mA rating conditions for extended periods may affect device
Power Dissipation ........................... 1.2W reliability.
III Input Load Current (All Input Pins) 0.01 10 iJ. A Vee = max, V 1N = GND to Vee
CS = V 1H , Vee = max,
IILOI Output Leakage Current 0.1 50 iJ. A
VOUT = GND to 4.5V
75 115 mA -
TA = 25C Vee = max, CS = V 1L ,
Icc Operating Current
125 mA TA = OC Outputs Open
los Output Short Circuit Current TBD TBD mA VOUT = GND to Vee
Notes:
1. The operating ambient temperature range is guaranteed with transverse air flow exceeding 400 linear feet per minute.
2. Typical limits are at Vee = 5V, TA = +25C, and Load A.
3. A pullup resistor to Vee on the CS input is required to keep the device deselected; otherwise, poweron current approaches Icc
active.
+5V
A.C. TEST CONDITIONS
Input Pulse Levels GND to 3.0 Volts 510n
3300 5pF
CAPACITANCE (4)
LoadA.
TA = 25 C, f = 1.0 MHz
Symbol Parameter Max. Unit Conditions
7-207
2148
A.C. CHARACTERISTICS
=
T A OC to + 70C, Vcc = +5V 10% unless otherwise noted.
READ CYCLE
WAVEFORMS
f-- ~1 -l
*
_"_1"_"
I
~-----
DATA VALID
Notes:
1. Chip deselected for greater than 55 ns prior to CS transition low.
2. Chip deselected for a finite time that is less than 55 ns prior to CS transition low. (If the deselect time is 0 ns, the chip is by
definition selected and access occurs according to Read Cycle No.1.)
3. WE is high for Read Cycles.
4. Device is continuously selected, CS =V1L.
5. Addresses valid prior to or coincident with CS transition low.
6. At any given temperature and voltage condition, tHZ max. is less than tLl min. both for a given device and from device to device.
7. Transition is measured 500mV from high impedance voltage with Load B. This parameter is sampled and not 100% tested.
7-208
2148
WRITE CYCLE
WAVEFORMS
WRITE CYCLE #1 (WE CONTROLLED)
-----twc
'ew
CSllI
'AW
WE
\\1 1
____________________________
DATA UNDEFINED
~~L----H-'GH-'-MP-ED-A-NC-E-------------
,.,-
_
Notes: 1. If CS goes high simultaneously with WE high, the output remains in a high impedance state.
2. Transition is measured 500 mV from high impedance voltage with Load B. This parameter is sampled and not 100% tested.
2148H
1024 x 481T STATIC RAM
2148H-3 2148H 2148HL-3 2148HL
Maximum Access Time (ns) 55 70 55 70
Maximum Active Current (mA) 180 180 125 125
Maximum Standby Current (mA) 30 30 20 20
- AO
.- A,
101 -
A,
- A,
@
--Vee - A,
~GNO - A,
10) -
- Ab
MEMORY ARRAY
ROW 64 ROWS - A,
SELECT 64 COLUMNS
- A,
WE
o= P'N NUMBERS
?
PIN NAMES
Ao-A, ADDRESS INPUTS
WE WRITE ENABLE
Ci CHIP SELECT
UO,-U04 DATA INPUT/OUTPUT
Vee POWER (+SV)
GND GROUND
TRUTH TABLE
CS WE MODE 110 POWER
H X NOT SELECTED HIGHZ STANDBY
L L WRITE DIN ACTIVE
L H READ DOUT ACTIVE
ABSOLUTE MAXIMUM RATINGS COMMENT: Stresses above those listed under "Ab-
solute Maximum Ratings" may cause permanent
Temperature Under Bias ............ - 10C to + 85C damage to the device. This is a stress rating only and
Storage Temperature ............. - 65C to + 150C functional operation of the device at these or any other
Voltage on Any Pin with conditions above those indicated in the operational sec-
Respect to Ground ................. - 3.5V to + 7V tions of this specification is not implied. Exposure to
D.C. Continuous Output Current ............. 20 mA absolute maximum rating conditions for extended
Power Dissipation ............................ 1.2W periods may affect device reliability.
2148H/H-3 2148HL/HL-3
(21 (21
Symbol Parameter Min. Typ Max. Min. Typ Max. Unit Test Conditions
III Input Load Current (All Input Pins) 0.01 10 0.01 10 f.1A Vee = max, VIN = GND to Vee
CS = VIH, Vee = max,
IILol Output Leakage Current 0.1 50 0.1 50 f.1A
VOUT = GND to 4.5V
los Output Short Circuit Current 150 200 150 200 mA VOUT = GND to Vcc
Notes:
1. The operating ambient temperature range is guaranteed with transverse air flow exceeding 400 linear feet per minute. Typical
thermal resistance values of the package at maximum temperatures are:
8JA (@ 400 fPM air flow) = 40 C/W
8JA (still air) = 70 C/W
8JC = 25 C/W
2. Typical limits are at Vcc = 5V, TA = +25C, and Load A.
3. A pull-up resistor to Vcc on the CS input is required to keep the deviee deselected during power-on. Otherwise, power-on current
approaches Icc active.
+5V
A.C. TEST CONDITIONS
Input Pulse Levels GND to 3.0 Volts 4800
2550 5pF
CAPACITANCE (4)
Load A.
TA =25C, f =1.0 MHz
Symbol Parameter Max. Unit Conditions
Load B.
CIN Address/Control Capacitance 5 pF VIN = OV
CIO Input/Output Capacitance 7 pF VOUT = OV
A.C. CHARACTERISTICS
TA =OC to + 70C, Vcc = +5V 10% unless otherwise noted.
READ CYCLE
WAVEFORMS
~ ~~~~~~~C--~----~~~~
,
~~ 'O"~ "I
DATA OUT PREVIOUS DATA vAlID! XX*=============DA=T=A=VA=L-I_D================
READ CYCLE NO. 213&1
tRc--------------------~l
cs - ( --_l-
14-----t.cs - - - - - - - - - 1
tLz------..i
Notes:
1. Chip deselected for greater than 55 ns prior to CS transition low.
2. Chip deselected for a finite time that is less than 55 ns prior to CS transition low. (If the deselect time is 0 ns, the chip is
by definition selected and access occurs according to Read Cycle No 1.)
3. WE is high for Read Cycles.
4. Device is continuously selected, CS = V 1L .
5. Addresses valid prior to or coincident with CS transition low.
6. Transition is measured 500mV from high impedance voltage with Load B. This parameter is sampled and not 100%
tested.
2148H FAMILY
WRITE CYCLE
2148H-3/HL-3 2148H/HL
Test
Symbol Parameter Min. Max. Min. Max. Unit Conditions
WAVEFORMS
WRITE CYCLE No. 1 (WE CONTROLLED)
1---------- twc---------11
ADDRESS ____~-----------------------------------JI~--------
CS[1]
DATA IN
DATAOUT ______~~~~~~__~~=-------_t---rl-----------
-
ADDRESS
IASI lew
- ~.
lAW
-IWR-
Iwp
,\\ \\\ \\\\\\\\'\ tlillIiiiiI III I I III!
, t::.IDW-_IDW~1
DATA IN I DATA IN VALID )(
f---Iwz
DATA OUT ------DA-T-A-U-N-DE-F-IN-E-O-..,;:.:..::=1...___H_IG_H_I_M_P_ED_A_N_C_E_____________
Notes: 1. If CS goes high simultaneously with WE high, the output remains in a high impedance state.
2. Transition is measured 500mV from high impedance voltage with Load B. This parameter is sampled and not
100% tested.
inter
2ii8 FAMilY
16,384 x 1 BIT DYNAMIC RAM
2118-3 2118-4 2118-7
Maximum Access Time (ns) 100 120 150
Read, Write Cycle (ns) 235 270 320
Read-Modify-Write Cycle (ns) 285 320 410
The Intel 2118 is a 16,384 word by 1-bit Dynamic MOS RAM designed to operate from a single +5V power supply. The
2118 is fabricated using HMOS - a production proven process for high performance, high reliability, and high storage
density.
The 2118 uses a single transistor dynamic storage cell and advanced dynamic circuitry to achieve high speed with low
power dissipation. The circuit design minimizes the current transients typical of dynamic RAM operation. These low
current transients contribute to the high noise immunity of the 2118 in a system environment.
Multiplexing the 14 addreas bits into the 7 address input pins allows the 2118 to be packaged in the industry standard
16-pin DIP. The two 7-bit address words are latched into the 2118 by the two TTL clocks, Row Address Strobe (RAS) and
Column Address Strobe (CAS). Non-critical timing requirements for RAS and CAS allow use of the address multiplexing
technique while maintaining high performance.
The 2118 three-state output is controlled by CAS, independent of RAS. After a valid read or read-modify-write cycle, data
is latched on the output by holding CAS low. The data out pin is returned to the high impedance state by returning CAS to
a high state. The 2118 hidden refresh feature allows CAS to be held low to maintain latched data while RAS is used to
execute RAS-only refresh cycles.
The single transistor storage cell requires refreshing for data retention. Refreshing is accomplished by performing RAS-
only refresh cycles, hidden refresh cycles, or normal read or write cycles on the 128 address combinations of Ao through
A6 during a 2ms period. A write cycle will refresh stored data on all bits of the selected row except the bit which is
addressed.
OUTPUT
DOUT
BUFFER
AmbientTemperatureUnderBias ... -10Cto+80C Stresses above those listed under "Absolute Maximum
Storage Temperature ............. -65Cto+150C Rating" may cause permanent damage to the device. This
Voltage on Any Pin Relative to Vss ............ 7.5V is a stress rating only and functional operation of the de-
Data Out Current ............................ 50mA vice at these or at any other condition above those indi-
Power Dissipation . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.0W cated in the operational sections of this specification is
not implied. EXPQsure to absolute maximum rating con-
ditions for extended periods may affect device reliability.
Limits
Symbol Parameter Min. Typ,!2] Max. Unit Test Conditions Notes
IILlI Input Load Current (any input) 0.1 10 J.l.A VIN=VSS to Voo
IILOI Output Leakage Current for Chip Deselected: CAS at VIH,
High Impedance State 0.1 10 J.l.A Your = a to 5.5V
1001 Voo Supply Current, Standby 1.2 2 mA CAS and RAS at VIH
1002 Voo Supply Current, Operating 23 27 mA 2118-3, tRC = tRCMIN 3
21 25 mA 2118-4, tRC = tRCMIN 3
19 23 mA 2118-7, tRC = tRCMIN 3
1003 Voo Supply Current; RAS-Only 16 18 mA 2118-3, tRC = tRCMIN 3
Cycle 14 16 mA 2118-4, tRC = tRCMIN 3
12 14 mA 2118-7, tRC = tRCMIN 3
1005 Voo Supply Current, Standby, 2 4 mA CAS at VIL. RAS at VIH 3
Output Enabled
VIL Input Low Voltage (all inputs) -2.0 0.8 V
VIH Input High Voltage (all inputs) 2.4 7.0 V
VOL Output Low Voltage 0.4 V IOL = 4.2mA
VOH Output High Voltage 2.4 V IOH = -5mA
NOTES:
1. All voltages referenced to V55
2. Typical values are for TA = 25C and nominal supply voltages.
3. 100 is dependent on output loading when the device output is selected. Specified 100 MAX is measured with the output open.
CAPACITANCE!1)
TA = 25C, Voo = 5V 10%, VSS = OV, unless otherwise noted.
NOTES:
I. Capacitance measured with Boonton Meter or effective capacitance calculated from the equation:
C = Iolt with J.V equal to 3 volts and power supplies at nominal levels.
J.V
2118 FAMILY
A.C. CHARACTERISTICS[1,2,3)
TA = OC to 70C, VDD = 5V 10%, VSS = OV, unless otherwise noted,
READ, WRITE, READ-MODIFY-WRITE AND REFRESH CYCLES
2118-3 2118-4 2118-7
Symbol Parameter Min, Mu, Min, Mu. Min, Max, Unit Notel
tAAC Access Time From RAS 100 120 150 ns 4,5
tCAC Access Time From CAS 55 65 80 ns 4,5,6
tAEF Time Between Refresh 2 2 2 ms
tAP RAS Precharge Time 110 120 135 ns
tCPN CAS Precharge Time I nonpage cycles l 50 55 70 ns
tCRP CAS to RAS Precharge Time 0 0 0 ns
tRCO RAS to CAS Delay Time 25 45 25 55 25 70 ns 7
tASH RAS Hold Time 70 85 105 ns
tCSH CAS Hold Time 100 120 165 ns
tASA Row Address Set-Up Time 0 0 0 ns
tAAH Row Address Hold Time 15 15 15 ns
tASC Column Address Set-Up Time 0 0 0 ns
tCAH Column Address Hold Time 15 15 20 ns
tAR Column Address Hold Time, to RAS 60 70 90 ns
IT Transition Time (Rise and Fall! 3 50 3 50 3 50 ns 8
tOFF Output euffer Turn Off Delay 0 45 0 50 0 60 ns
WRITE CYCLE
tAC Random Write Cycle Time 235 270 320 ns
tAAS RAS Pulse Width 115 10000 140 10000 175 10000 ns
tCAS CAS Pulse Width 55 10000 65 10000 95 10000 ns
twcs Write Command Set-Up Time 0 0 0 ns 9
tWCH Write Command Hold Time 25 30 45 ns
tWCR Write Command Hold Time, to RAS 70 85 115 ns
twp Write Command Pulse Width 25 30 50 ns
tAWL Write Command to RAS Lead Time 60 65 110 ns
tCWL Write Command to CAS Lead Time 45 50 100 ns
tos Data-In Set-Up Time 0 0 0 ns
tOH Data-In Hold Time 25 30 45 ns
tOHA Data-In Hold Time, to RAS 70 85 115' ns
READ-MODIFY-WRITE CYCLE
tAWC Read-Modify-Write Cycle Time 285 320 410 ns
tAAW RMW Cycle RAS Pulse Width 165 10000 190 10000 265 10000 ns
tCRW RMW Cycle CAS Pulse Width 105 10000 120 10000 185 10000 ns
tAwO RAS to WE Delay 100 120 150 ns 9
tcwo CAS to WE Delay 55 65 80 ns 9
NOTES
All voltages referenced to Vss 7 tACO Imax liS specified as a reference pOint only. "tACO IS less
Eight cycles are required after power-up or prolonged periods than tRCD Imax ! access time IS tRAC. If tRCO IS greater than tRCO
Igreater than 2msl of AAS inactivity before proper device Imax ) access time IS tRCD ~ tCAG
operation IS achieved Any 8 cycles which perform refresh are IT IS measured between VIH IMln I and VtL Imax I
adequate for thiS purpose twcs. tcwD and tAwD are specified as reference POints only If
A C Characteristics assume tT' = 5ns twcs c twcs Imln I the cycle IS an early write cycle and the data
Assume that tACO'" tACO Imax I. If tACO IS greater than tACO out pin Will remain high Impedance throughout the entire
Imax I then tAAC will Increase by the amount that tACO exceeds cycle If tCW') tcwD Imln.1 and tAwD ~ tAwD Imln I. the cycle IS
,>
tRCO (max I a read-modlfy-wrlte cycle and the data out will contain the data
Load = 2 TTL loads and 100pF read from the selected address If neither of the above
Assumes tRCD ? tRCD (max) conditions IS satisfied. the condition of the data out IS
7 ') ~ c:. indeterminate
2118 FAMILY
WAVEFORMS
READ CY CLE
V,H
- t AAS
tAC
l-tAP~
I
RAS
V ,L
031\10 ~
tCSH - tcP
tcAP-1 e.f-- NI
tACO tASH
V ,H
CAS
V ,L I CD
1\\\\l0
tAA
tCAS
.11
"iH
ADDRESSES
V ,L ~
'2
ROW
ADDRESS
K ~
COLUMN
ADDRESS
K
V ,H
1--. t ACS Ht ACH
0
WE
V ,L d!I tCAC
\
tAAC !--tOFF-
VO H HIGH CD
DOUT
VOL IMPEDANCE o VALID
~D_A_T.....
A_O_U_T_ _ _ _..Jf
WRITE CY CLE t AC
tAAS l - t AP -
8 l\@
VI L
tCAP -1 \+t--
tRCO
tCSH
t RSH - - - - -
l-tCPN-1
J (i)
K\,\l\~
tAR
tCAS
)t
tASA ---t-- - t RAH ---1 tASC- t-- --tCAH-
ADDRESSES
V
V ,L
,H
){tJ)0 ROW
ADDRESS
XX COLUMN
ADDRESS
K
t AWL
'cWl
V,H -twcs- _ t WCH -
WE V,L i twp
tWCA
e.-@t os - _ t OH @ -
V ,H
} CD
D'N
V'L CD JK
tOHR
~~~--------------~I~M~~~~~:~N~C~E--------------------------------------------------------------------
NOTES: 1,2. V ,H MIN AND V ,l MAX ARE REFERENCE LEVELS FOR MEASURING TIMING OF INPUT SIGNALS.
3,4. V OH MIN AND Val MAX ARE REFERENCE LEVELS FOR MEASURING TIMING OF D oUT '
5. tOFF IS MEASURED TO lOUT'; lila I
6. tos AND tOH ARE REFERENCED TO CAS OR WE, WHICHEVER OCCURS LAST.
7. tACH IS REFERENCED TO THE TRAILING EDGE OF CAS OR RAS, WHICHEVER OCCURS FIRST
8. tCAP REQUIREMENT IS ONLY APPLICABLE FOR RAS/CAS CYCLES PRECEEDED BY A CAS-
ONLY CYCLE Il.e., FOR SYSTEMS WHERE CAS HAS NOT BEEN DECODED WITH RASI.
7-217
2118 FAMILY
WAVEFORMS
READMODIFYWRITE CYCLE
tRwe J
tRRW
'==-'RP_:I
(1, 1\2) '7 "\
(8)ICRP-j f.~'RCo-:--- I---'CPN-i
'cRW
'~ il)
~\\\ (2)
f----IAR - - t RWl -
H'RAH
tASR-t--- tAS~tw" 1- teAH ---t CWl- - -
ADDRESSES Vil
V ,H
)( (1) AD~~~SS }( X ;g~~~~ K
(2)
r;;'~
,3)
IRcsrl
tRWD
'cWO
,,-,wp-k
'OS 'I t-~loH-=-
XI}) DATA IN
VALID K
H HIGH
tRAe
tCAC-t
fiJI
I
CD
VALID
- "l;
tOFF
tRAS
_II=='RP-:I
~
V,H
RAS (i) I"l 1) 1\
Vil
V,H
I f--'CRP
CAS
Vil
---'IASRt- -'RAH!
V,H
ROW
ADDRESSES
Vil
X~ ADDRESS ](
"'"
VOH HIGH
DOUT
Val IMPEDANCE
V,H
ADDRESSES
Vil
V,H
WE
Vil
DOUl
VOH "",Jr.."i"...C----------V-A-lI~~i-tD-AT-A-------------:!I~.,.0;..0_" _ _ __
VOL
NOTES: 1,2. V ,H MIN AND V ,l MAX ARE REFERENCE LEVELS FOR MEASURING T1MING OF INPUT SIGNALS.
3,4. V OH MIN AND VOL MAX ARE REFERENCE LEVELS FOR MEASURING TIMING OF DOllT '
5. IOFF IS MEASURED TO lOUT" IllO I
6. 'DS AND IDH ARE REFERENCED TO CAS OR WE, WHICHEVER OCCURS LAST.
7.IRCH IS REFERENCED TO THE TRAILING EDGE OF CAS OR RAS, WHICHEVER OCCURS FIRST.
S.ICRP REOUIREMENT IS ONLY APPLICABLE FOR RAS/CAS CYCLES PRECEEDEDBY A CAS-
ONLY CYCLE Ii .. , FOR SYSTEMS WHERE CAS HAS NOT BEEN DECODED WITH RAS).
7218
2118 FAMILY
WAVEFORMS
PAGE MODE READ CYCLE
~------------------------------IR~--------------------------------~I~
__ V'HC
~~--------~------------------------------~~--~,-.~---~~~::-tR-5-H--------~tR'~
RAS
WE V 1HC
V'l _ _ _ +-_J
VOH
DOUT VOl-----------------------~~
NOTES: 1.2. V'H MIN AND V'l MAX ARE REFERENCE LEVELS FOR MEASURING TIMING OF INPUT SIGNALS.
3,4. V OH MIN AND Val MAX ARE REFERENCE LEVELS FOR MEASURING TIMING OF D oUT '
5. IOFF IS MEASURED TO lOUT IILO I.
6.IReH IS REFERENCED TO THE TRAILING EDGE OF CAS OR RAS, WHICHEVER OCCURS FIRST
7. ALL VOL TAGES REFERENCED TO Vss
8. AC CHARACTERISTIC ASSUME IT = 5n .
9. SEE THE TYPICAL CHARACTERISTICS SECTION FOR VALUES OF THIS PARAMETER
UNDER AL TERNATE CONDITIONS.
10. tCRP REQUIREMENT IS ONLY APPLICABLE FOR RAS/CAS CYCLES PRECEEDED BY A CAS-
ONLY CYCLE (i.e" FOR SYSTEMS WHERE CAS HAS NOT BEEN DECODED WITH RASI.
" ALL PREVIOUSLY SPECIFIED A.C. AND D.C. CHARACTERISTICS ARE APPLICABLE TO THEIR
RESPECTIVE PAGE MODE DEVICE (j.e" 21183, 56329 WILL OPERATE AS A 211831.
7-219
2118 FAMILY
PAGE MODE
WRITE CYCLE ~---------------------------------tRPM--------------------------------~1
,H
ADDRESSES V
V'L--~~T-~~~~~~~------~---~~--~~----~------~~--~~~--~~------+r------------
WE V ,HC
V ,H
D'N
VIL ______ ~~~~--------~~----~~----------~~--------,~~~----------~~----------------
V'H
ADDRESSES
V'L
V'H
WE
V'L
V 1H
D'N
V'L
NOTES: 1,2. V ,H MIN AND V'l MAX ARE REFERENCE LEVELS FOR MEASURING TIMING OF INPUT SIGNALS
3,4. V OH MIN AND VOL MAX ARE REFERENCE LEVELS FOR MEASURING TIMING OF DOUT
5. IOFF IS MEASURED TO lOUT' l'lO I.
6. IDS AND IDH ARE REFERENCED TO CAS OR WE, WHICHEVER OCCURS LAST
7. IRCH IS REFERENCED TO THE TRAILING EDGE OF CAS OR RAS, WHICHEVER OCCURS FIRST
8. ICRP REQUIREMENT IS ONLY APPLICABLE FOR RAS/CAS CYCLES PRECEEDED BY A CAS-
ONLY CYCLE (,.e., FOR SYSTEMS WHERE CAS HAS NOT BEEN DECODED WITH RAS)
7-220
2118 FAMILY
60 1\ 1\
1\ 1\
(rnA)
40 n I JI
I\
-""
1\ /1 J\
, Ll
I
M
20 11 11 \ I 11\ I \
~I\J \ 1\ J JJJ 1\ I L \1\1\ II \
J III l;-
"'--J V i'... ) V
""'- '~
100 200 300 400 500 100 200 300
TIME (ns) TIME (ns)
LONG RAS/CAS
60
IDO 40 J\
(rnA) I, 11 1\ JJI1
20
I
LJ /\ 111
j 1M I 1\ 111 [ \
100
J
200
~ 'V 300
\ ,J ' \
400 500
_'I ,
I---
600 700
I'...
800 900
TIME (ns)
Typical power supply waveforms vs. time are shown for temperature on the 100 current are shown in graphs
the RAS/CAS timings of Read/Write, Read/Write (Long included in the Typical Characteristics Section. Each
RAS/CAS), and RAS-only refresh cycles. 100 current family of curves for 1001, 10 02 , and 1003 is related by a
transients at the RAS and CAS edges require adequate common point at V DO = 5.0V and T A = 25 C for two given
decoupling of these supplies. tRAS pulse widths. The typical I DO current for a given
condition of cycle time, V DO and T A can be determi ned by
The effects of cycle time, V DO supply voltage and ambient combining the effects of the appropriate family of curves.
7-221
2118 FAMILY
TYPICAL CHARACTERISTICS
GR,ll,PH 2
GRAPH 1 TYPICAL ACCESS TIME GRAPH 3
TYPICAL ACCESS TIME tRAG (NORMALIZED) VS. TYPICAL STANDBY CURRENT
tRAG (NORMALIZED) VS. VOO AMBIENT TEMPERATURE 1001 VS. VOO
/
~ 1.1 1.1 /" <"
S 1.2
~
0
V
--
TA = 70 D C f-
on Z
fG
"o
~ 1.0
~
1.0
/ W
II:
II: 1.0
~
:J
/~ ~
()
~ u
~ ~
/!
'0 0.9
<:::
0.9
Q,
Q, 0.8
~
:J TA = ODC
~
Ul
u I
;
u
0.8
; 0.8 _0
Q
0.6
VDO = 4.5V
0.7
1 0.4
0.7
4.0 4.5 5.0 5.5 6.0 20 40 60 80 4.0 4.5 5.0 5.5 6.0
Voo - SUPPL Y VOLTAGE (VOLTS) TA - AMBIENT TEMPERATURE (DC) voo-SUPPLY VOLTAGE (VOLTS)
1.4 50 50
<"
S
1.2 1.,,,- <"
S
TA 25 DC
40 I---- VOO = 5.0V
J <"
S
40 ~T,."t
,
I- f-
-----------
f- Z
Z Z W
W W
-- --
a: II: II:
30 tRAS = 115ns_
1.0 30 II:
a: II:
:J
t RC = 235ns
:J :J ()
() ()
0.4
.9
g
10
o
I"-...
- ~RAS =,500nS
tRAS = 11 5nS
_
-..;;
Jl 10
o
~
tRAS = 500ns
fRC ~ 750ns
o 20 40 60 80 200 400 600 800 1000 4.0 4.5 5.0 5.5 6.0
TA -AMBIENT TEMPERATURE (DC) tRc-CYCLE TIME (ns) VOD - SUPPLY VOLTAGE (VOLTS)
GRAPH 8 GRAPH 9
GRAPH 7 TYPICAL RAS ONLY TYPICAL RAS ONLY
TYPICAL OPERATING CURRENT REFRESH CURRENT REFRESH CYCLE
1002 VS. AMBIENT TEMPERATURE 1003 VS. tRC ID03 VS. Voo
50 50 50
I
<" 40 f-- VOO
I
5.0V <" TA = 2JC
40 I- Voo = 5.0V
<" 40
TA = 25DC
S
=
S S
f- I-
f- Z
Z Z W
W W
a: II:
30 II: 30 II: 30
a: II: :J
:J tRAS = 115ns :J ()
() ()
t RC = 235ns
~ ::; ::;
Q, Q,
Q,
20 tRAS = 115ns
20 20 Q,
Q, Q,
:J tRC = 235ns
:J :J (j'J
Ul
I
Ul
I I --l
g 0 ....... 0
0 10 r--
_0 _0 10
I_
10
tRAS = 500ns
.............
r-- tRAS =,500 ns
tRAS = 500ns
tRC = 750ns tRAS = 115 ns tRC = 750ns
o o
o 20 40 60 80 200 400 600 800 1000 4.0 4.5 5.0 5.5 6.0
TA -AMBIENT TEMPERATURE (DC) tRC -CYCLE TIME (ns) Voo -SUPPLY VOLTAGE (VOLTS)
7222
2118 FAMILY
TYPICAL CHARACTERISTICS
GRAPH 10
TYPICAL RAS ONLY GRAPH 11 GRAPH 12
REFRESH CURRENT TYPICAL OUTPUT SOURCE CURRENT TYPICAL OUTPUT SINK CURRENT
1003 VS. AMBIENT TEMPERATURE 10H VS. OUTPUT VOLTAGE VOH 10L VS. OUTPUT VOLTAGE VOL
50 100 100
I ~ ~
voo = 5.0V .s TA 1250C .s I
f- 40 f-
zw 80 r---Voo = 5.0V !z 80 J~;}rO~-
~ a:
w
a:
a: a: a:
a: :::J :::J
:::J ()
() 30 60 () 60
w :.:
~ U z
""
Q. a: iii ~
Q. :::J
:::J 0 f- j
20 I - - - - + - - - + - - - . . . ! . - - - - I ~
(/J
(/J 40 40
~~
/
I IRAS=115ns f-
f-
IRC = 235ns :::J
o Q. :::J
o f- o
:::J I
10 I----l---------je---- IRAS = 500 ns - 0 20 -' 20
~ t---- V
IRC = 750 ns I _0
I
.2
i
20 40 60 80
TA -AMBIENT TEMPERATURE (OC) VOH-OUTPUT VOLTAGE (VOLTS) VOL - OUTPUT VOLTAGE (VOLTS)
Access time from RAS, tRAC, and access time from CAS, A RAS-only refresh cycle is the recommended technique
tCAC, are device parameters. Row to column address for most applications to provide for data retention. A RAS-
strobe delay time, tRCO, are system dependent timing only refresh cycle maintains the Dour in the high
2118 FAMILY
impedance state with a typical power reduction of 30% This feature allows a refresh cycle to be "hidden" among
over a Read or Write cycle. data cycles without affecting the data availability.
RAS/CAS TIMING
RAS and CAS have minimum pulse widths as defined by
POWER ON
tRAS and teAs respectively. These minimum pulse widths
must be maintained for proper device operation and data After the application of the Voo supply, or after extended
integrity. A cycle, once begun by bringing RAS and/or periods of bias (greater than 2ms) without clocks, the
CAS low must not be ended or aborted prior to fulfilling device must perform a minimum of eight (8) initialization
the minimum clock signal pulse widthls I. A new cycle can cycles (any combination of cycles containing a RAS clock
not begin until the minimum prechargetime, tRP, has been such as RAS-only refresh) prior to normal operation.
met.
DATA OUTPUT OPERATION
The Voo current (100) requirement of the 2118 during
The 211'8 Data Output I DOUT I, which has three-state power on is, however, dependent upon the input levels of
capability, is controlled by CAS. During CAS high state RAS and~. If the input levels of these clocks are at VIH
I CAS at VIH 1 the output is in the high impedance state. The or V oo , whichever is lower, the 100 requirement per device
following table summarizes the DOUT state for various is 1001 (100 standby). If the input levels for these clocks
types of cycles. are lower than V 1H or Voo the 100 requirement will be
greater than 1001, as shown in Figure 2.
Intel 2118 Data Output Operation
for Various Types of Cycles
HIDDEN REFRESH
An optional feature of the 2118 is that refresh cycles may
be performed while maintaining valid data at the output
pin. This feature is referred to as Hidden Refresh. Hid-
den Refresh is performed by holding CAS at VIL and
taking RAS high and after a specified precharge period Voo (VOLTS)
(tRP)' executing a "RAS-Only" refresh cycle, but with CAS
held low (see Figure 1.)
Dour - - . . .HIGHZ
. ; . . - - - (( DATA
~-------'
>-- loading such that the power supply may current limit. To
assure that the system will not experience such loading
during power on, a pullup resistor for each clock input to .
Voo to maintain the non-selected current level (1001) for
Figure 1. Hidden Refresh Cycle. the power supply is recommended.
7-224
inter 2147H
HIGH SPEED 4096 x 1 BIT STATIC RAM.
2147H1 2147H2 2147H3 2147HL3 2147H 2147HL
Max. Access Time (ns) 35 45 55 55 70 70
Max. Active Current (rnA) 180 180 180 125 160 140
Max. Standby Current (rnA) 30 30 30 15 20 10
Pinout, Function, and Power Com Direct Performance Upgrade for 2147
patible to Industry Standard 2147
HMOS II Technology Automatic PowerDown
@
DIN------f DOUT
PIN NAMES
AO-A" ADDRESS INPUTS Vee POWER (+5V)
WE WRITE ENABLE GND GROUND
CS CHIP SELECT
D,N DATA INPUT
DoUT DATA OUTPUT
TRUTH TABLE
B Wl MODE OUTPUT POWER
H X NOT SELECTED HIGHZ STANDBY
L L WRITE HIGHZ ACTIVE
L H READ DOUT ACTIVE
Intel. Corporation assumes no responsibility for the use of any circuitry other than cirCUitry embodied In an Intel product. No other CIrCUIt patent licenses are Implied
Intel Corporation. 1979. 1980 April. 1980
7-225
2147H
ABSOLUTE MAXIMUM RATINGS* *COMMENT: Stresses above those listed under "Abso-
lute Maximum Ratings" may cause permanent damage
Temperature Under Bias . . . . . . . . . . . .. - 10 C to 85C to the device. This is a stress rating only and functional
Storage Temperature. . . . . . . . . . . .. - 65C to + 150C operation of the device at these or any other conditions
Voltage on Any Pin above those indicated in the operational sections of this
With Respect to Ground . . . . . . . . . . .. - 3.5V to + 7V specification is not implied. Exposure to absolute maxi-
Power Dissipation ........................... 1.2W mum rating conditions for extended periods may affect
D.C. Output Current ......................... 20 mA device reliability.
Vee
5101!
CAPACITANCE[4] (TA=25C, f= 1.0 MHz)
DOUT - - -.......- -....
Symbol Parameter Max. Unit Conditions
5 pF
C IN Input Capacitance 5 pF VIN = OV
COUT Output Capacitance 6 pF VOUT=OV
NOTE:
4. This parameter is sampled and not 100% tested. Figure 2. Output Load for tHZ. tLZ. twz. tow
7-226
2147H
A.C. CHARACTERISTICS (TA =OC to 70C, Vcc = + 5V 10%, unless otherwise noted.)
Read Cycle
2147H3, 2147H,
2147H1 2147H2 HL3 2147HL
Symbol Parameter Min. Max. Min. Max. Min. Max. Min. Max. Unit
t [1] Read Cycle Time 35 45 55 70 ns
RC
tAA Address Access Time 35 45 55 70 ns
tACS1[8] Chip Select Access Time 35 45 55 70 ns
tACS2[9] Chip Select Access Time 35 45 65 80 ns
tOH Output Hold from Address Change 5 5 5 5 ns
td2,3,7] Chip Selection to Output in Low Z 5 5 10 10 ns
tHZ[2,3,7] Chip Deselection to Output in High Z 0 30 0 30 0 30 0 40 ns
tpu Chip Selection to Power Up Time 0 0 0 0 ns
t pD Chip Deselection to Power Down Time 20 20 20 30 ns
WAVEFORMS
tRe
ADDRESS ~(': )\
----./1\
tOH
tAA .
DATA OUT PREVIOUS DATA VALID
XX X ~ DATA VALID
tRe
~r l
I\.
tACS . -tHZ-
,
tlZ
~XX~
HIGH IMPEDANCE HIGH
DATA OUT DATA VALID
J IMPEDANCE
Vee
SUPPL Y
CURRENT
Ice_-~p~1-~
50%
_ _ _ _r-_tP0==L 50%
158 - - - - -
NOTES:
1. All Read Cycle timings are referenced from the last valid address to the first transitioning address.
2. At any given temperature and voltage condition, tHZ max. is less than tLZ min. both for a given device and from device to device.
3. Transition is measured 500 mV from steady state voltage with specified loading in Figure 2.
4. WE is high for Read Cycles.
5~ Device is continuously selected, CS = V1L .
6. Addresses valid prior to or coincident with CS transition low.
7. This parameter is sampled and not 100% tested.
8. Chip deselected for greater than 55 ns prior to selection.
9. Chip deselected for a finite time that is less than 55 ns prior to selection. If the deselect time is 0 ns, the chip is by definition
selected and access occurs according to Read Cycle NO.1. Applies to 2147H, 2147HL, 2147H-3, and 2147HL3.
7227
Intel 2147H
----------'we
WAVEFORMS
Write Cycle No. 1 ADDRESS
CSI' I~ ~ t AW - -
II IIII
I----'wo-
tAS----j _twp~
Ii
\\
DATA IN
I
t ---tDW-~
DATA IN VALID
~tOHj
.l
~
DATA O U T - - - - - - - D - A - T A - U - N D - E F - I N - E D - - - - -.....
" " ,~,,.~,1-----
-'<>w
~-------~w-------~
~+-----'<>w - - - - - - - . . j -
NOTES:
DATA our - - - " ' J:J. .------------
DATA UNDEFINED
1. If CS goes high simultaneously with WE high, the output remains in a high impedance state.
HIGH IMPEDANCE
2. All Write Cycle timings are referenced from the last valid address to the first transitioning address.
3. Transition is measured 500 mV from steady state voltage with specified loading in Figure 2.
4. CS or WE must be high during address transitions.
7228
inter 2716
16K (2K x 8) UV ERASABLE PROM
~
Ce/PGM Oe Vpp Vec OUTPUTS
(181 (201 (211 (241 (911,13171
MODE
BLOCK DIAGRAM
t Refer to 2732 UATAOUTPUTS
----
00 01
PIN NAMES
ADDRESSES
CHIP ENABLE/PROGRAM
AO-A,O
OUTPUT ENABLE ADDRESS
OUTPUTS INPUTS
7229 AFN-00811A-Ol
2716
PROGRAMMING
The programming specifications are described in the Data Catalog PROM/ROM Programming Instructions Section. ;
READ OPERATION
D.C. and Operating Characteristics
Limits
Symbol Parameter Unit Conditions
Min. Typ.[31 Max.
Typical Characteristics
60 ~
-r--- r-- 600 600
50
r--- r--~
ICC2 ACTIVE CURRENT
500 500
--
~=Vll Vee = 5V
< 40 VCC=5V -r---
--
400 ~ 400
!
-
'-'
--
'-' ~ '-'
-
!:? 30
-
300 ;: 300
f.-- f--- !----
~
20 200 200
ICCI STANDBY CURRENT
~=VIH
10 VCC=5V~
100 100
o
o 10
I
20 30 40 50
1
60 70 80 100 200 300 400 500 600 700 800
o
o 10 20 30 40 50 60 70 80
TEMPERATURE I C) CllpF) TEMPERATURE I'C)
tOE Output Enable to Output Delay 120 120 120 160 200 CE = V IL
tOF Output Enable High to Output Float 0 100 0 100 0 100 0 100 0 100 CE=VIL
A. C. Waveforms [11
ADDRESSES
ADDRESSES
VALID
CE-----------------+--~
teE
6E----------------~~--------~
'-------+-- . . . . . . . . . .
[6J
tDF
-~""""I"""'II"""'I~-
HIGH Z HIGH Z
OUTPUT-------------------------------+-+-. . . .~~
----........ ~- ...... .
NOTE: 1. Vce must be applied simultaneously or before Vpp and removed simultaneously or after Vpp.
2. Vpp may be connected directly to VCC except during programming. The supply current would then be the sum of ICC and IpP1.
3. Typical values are for TA = 25 C and nominal supply voltages.
4. This parameter is only sampled and is not 100% tested.
5. OE may be delayed up to tACC - tOE after the falling edge of CE without impact on tACC.
6. tDF is specified from OE or CE, whichever occurs first.
ADO-7 t-t--......- . .I
8212
ADDRESS VCC
ALE ~"-_ _ _ _""I LATCH
RD r-r--------------------~
8085
512 X 8
O_C_
PROM
3S04A
.... N CE5
(1)(1)
101M (J(J CES
eE7
This scheme accomplished by using CE (PD) as the primary decode_ OE (CS) is now controlled by previously unused
signal. RD now controls data on and off the bus by way of OE_
A selected 2716 is available for systems which require CE access of less than 450 ns for decode network operation_
The use of a PROM as a decoder allows for:
a) Compatibility with upward (and downward) memory expansion.
b) Easy assignment of ROM memory modules, compatible with PUM modular software concepts.
, D D
A'2 0 A B
D
co . _ a
_._
D_
A,o 0
A9~.
~~
0.-
..:..:... -
..-
A11 00--4IOI-4l, . . . . . - . - . . . _ _ _ _
..
~ .-
~------~
~
~
~
..
~
"'--
~"'--
~
....
o ... '-
:.. ~.... "'--
~
+
0
COMPONENT SlOE
0 0.
00 0,0203 CEl 04 0 5 0 6 0 7 eE2
7-232
2716
~
CE/PGM DE VPP Vee OUTPUTS to be programmed. You can program any location at any
(18) (20) (21) (24) (911.1317)
MODE
time - either individually, sequentially, or at random.
The program pulse has a maximum width of 55 msec. The
Read VIL VIL +5 +5 DOUT
2716 must not be programmed with a DC signal applied to
Standby VIH Don't Care +5 +5 High Z
+25
the CE/PGM input.
Program Pulsed VIL to VIH VIH +5 DIN
Program Verify VIL VIL +25 +5 DOUT Programming of multiple 2716s in parallel with the same
+25 +5 High Z
Program Inhibit VIL VIH data can be easily accomplished due to the simplicity of
the programming requirements. Like inputs of the paral-
READ MODE
leled 2716s may be connected together when they are pro-
The 2716 has two control functions, both of which must be grammed with the same data. A high level TTL pulse
logically satisfied in order to obtain data at the outputs. applied to the CE/PGM input programs the paralleled
Chip Enable (CE) is the power control and should be used 2716s.
for device selection. Output Enable (OE) is the output
PROGRAM INHIBIT
control and should be used to gate data to the output
pins, independent of device selection. Assuming that Programming of mUltiple 2716s in parallel with different
addresses are stable, address access time hACC) is equal to data is also easily accomplished. Except for CE/PGM, all
the delay from CE to output (tCE). Data is available at like inputs (including OE) of the parallel 2716s may be
the outputs 120 ns (tOE) after the falling edge of OE, common. A TTL level program pulse applied to a 2716's
assuming that CE has been low and addresses have been CE/PGM input with Vpp at 25V will program that 2716.
stable for at least tACC - tOE. A low level CE/PGM input inhibits the other 2716 from
STANDBY MODE being programmed.
The 2716 has a standby mode which reduces the active PROGRAM VERIFY
power dissipation by 75%, from 525 mW to 132 mW. The A verify should be performed on the programmed bits to
2716 is placed in the standby mode by applying a TTL high determine that they were correctly programmed. The verify
signal to the CE input. When in standby mode, the outputs may be performed wth Vpp at 25V. Except during pro-
are in a high impedence state, independent of the OE input. gramming and program verify, Vpp must be at 5V.
The Intel 2732 is a 32,768-bit ultraviolet erasable and electrically programmable read-only memory (EPROM I. The 2732
operates from a single 5-volt power supply, has a standby mode, and features an output enable control. The total program-
ming time for all bits is three and a half minutes. All these features make designing with the 2732 in microcomputer systems
faster, easier, and more economical.
An important 2732 feature is the separate output control, Output Enable (OE) from the Chip Enable control (CE). The
OE control eliminates bus contention in multiple bus microprocessor systems. Intel's Application Note AP-72
describes the microprocessor system implementation of the OE and CE controls on Intel's 2716 and 2732 EPROMs.
AP-72 is available from Intel's Literature Department.
The 2732 has a standby mode which reduces the power dissipation without increasing access time. The maximum active
current is 150mA, while the maximum standby current is only 30mA, an 80% savings. The standby mode is achieved by
applying a TTL-high signal to the CE input.
~
vee
CE OE/Vpp Vcc OUTPUTS
A7
MODE
(18) (20) (24) (911,13-17)
A6 As
Ar, Ag Read VIL V IL +5 DOUT
A4 All Standby VIH Don't Care +5 High Z
A3 OENpp Program V IL Vpp +5 DIN
A2 A 10
Program Verify V IL V IL +5 DOUT
Al CE
Program Inhibit VIH Vpp +5 High Z
Ao ~
00 06
1 Os
2 BLOCK DIAGRAM
GNO 03
DATA OUTPUTS
VCCO--- 00-07
GNDO---
PIN NAMES
YGATING
Ao-A" ADDRESSES AO-All
CE CHIP ENABLE ADDRE$S
INPUTS
OE OUTPUT ENABLE 32.768BIT
OUTPUTS CEll MATRIX
0-7
INTel CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE OF ANY CIRCUITRY OTHER THAN CIRCUITRY EMBODIED IN AN INTEL PRODUCT. NO OTHER CIRCUIT PATENT LICENSES ARE IMPLIED.
INTEL CORPORATION. 1980 7-234 FEBRUARY 1980
2732
PROGRAMMING
The programming specifications are described in the Data Catalog PROM/ROM Programming Instructions Section.
READ OPERATION
Limits
Symbol Parameter Min. Typ.i 1 1 Max. Unit Conditions
ILl1 Input Load Current (except OE/Vpp) 10 J.l.A VIN = 5.25V
1L12 OE/Vpp Input Load Current 10 J.l.A VIN = 5.25V
ILO Output Leakage Current 10 J.l.A VOUT = 5.25V
ICC1 Vcc Current (StandbYI 15 30 mA CE = VIH, OE = VIL
ICC2 Vce Current (Activel 85 150 mA OE = CE =- VIL
VIL Input Low Voltage -0.1 0.8 V
VIH Input High Voltage 2.0 Vec+1 V
VOL Output Low Voltage 0.45 V IOL=2.1mA
VOH Output High Voltage 2.4 V IOH = -400J.l.A
Note: 1. Typical values are for TA = 25C and nominal supply voltages.
TYPICAL CHARACTERISTICS
--
90
~
E
u
80
70
60
50
400
-;:;, 300
I--I--
~
-I--
-u
400
300
~ f.-
...-...- -- ~ ....
u ;:t
40 200
30 I---+--f-- ~~ ~I:ANDBY CURRENT)
200
20 I---+--f-- Vce = 5V 100
10 TA = 25 C Vce = 5V
0 100 1 L I I
0 10 20 30 40 50 60 70 80 o 100 200 300 400 500 600 700 800 00 10 20 30 40 50 60 70 80
TEMPERATURE ( C) CL (pFI
TEMPERATURE ( C)
7-235
2732
A.C. CHARACTERISTICS
5%
TA = OC to 70C, Vee = +5V
ADDRESSES
ADDRESSES
VALID
tDF
[4)
HIGH Z HIGH Z
OUTPUT --------.:;......;;.-----+.f-H~_<
NOTES:
1. THIS PARAMETER IS ONL Y SAMPLED AND IS NOT 100% TESTED.
2. ALL TIMES SHOWN IN PARENTHESES ARE MINIMUM TIMES AND ARE NSEC UNLESS OTHERWISE SPECI FlED.
3. DE MAY BE DELAYED U~O 33~ AFTER THE FALLING EDGE OF CEWITHOUT IMPACT ON tACC.
4. tDF IS SPECI FlED FROM OE OR CEo WHICHEVER OCCURS FIRST.
7236
2732
~
CE OENpp vee OUTPUTS
MODE (18) (20) (24) (911,1317) program pulse must be applied at each address location to
be programmed. You can program any location at any
Read V IL V IL +5 DOUT
time - either individually, sequentially, or at random. The
Standby V IH Don't Care +5 High Z
program pulse has a maximum width of 55msec. The 2732
Program V IL Vpp +5 DIN must not be programmed with a DC signal applied to the
- -
Program Verify V IL V IL +5 DOUT
CE input.
Program Inhibit V IH Vpp +5 High Z Programming of multiple 2732s in parallel with the same
data can be easily accomplished due to the simplicity of
the programming requirements. Like inputs of the
Read Mode paralleled 2732s may be connected together when they
The 2732 has two control functions, both of which must are programmed with the same data. A low level TTL pulse
be logically satisfied in order to obtain data at the out- applied to the CE input programs the paralleled 2732s.
puts. Chip Enable (CE) is the power control and should Program Inhibit
be used for device selection. Output Enable (OE) is the
output control and should be used to gate data to the Programming of multiple 2732s in parallel with different
output pins, independent of device selection. Assuming data is also easily accomplished. Except for CE, all like
inputs (including OE I of the parallel 2732s may be
that addresses are stable, address access time (tAcc) is
common. A TTL level program pulse applied to a 2732's
equal to the delay from CE to output (tCE)' Data is
CE input with OE/Vpp at 25V will program that 2732. A
available at theoutputs 120ns (tOE) after the falling edge
of OE, assuming that CE has been low and addresses high level CE input inhibits the other 2732s from being
programmed.
have been stable for at least tAcc -. tOE,
Standby Mode Program Verify
The 2732 has a standby mode which reduces the active A verify should be performed on the programmed bits to
power current by 80%, from 150mA to 30mA. The 2732 is determine that they were correctly programmed. The
placed i~ the standby mode by applying a TTL high verify is accomplished with OElVpp and CE at VIL. Data
signal to the CE input. When in standby mode, the out- should be verified tDv after the falling edge of CEo
7-237
2732A
32K (4K x 8) UV ERASABLE PROM
The Intel 2732A is a 5V only, 32,384 bit ultraviolet erasable and electrically programmable read-only memory (EPROM). It
is pin compatible to Intel's 450ns 2732. The standard 2732A's access time is 250ns with speed selection (2732A-2)
available at 200ns. The access time is compatible to high performance microprocessors, such as the 8mHz 8086-2. In
these systems, the 2732A allows the microprocessor to operate without the addition of WAIT states.
An important 2732A feature is the separate output control, Output Enable (OE), from the Chip Enable control (CE). The OE
control eliminates bus contention in multiple bus microprocessor systems. Intel's Application Note AP-72 describes the
microprocessor system implementation of the OE and CE controls on Intel's EPROMs. AP-72 is available from Intel's
Literature Department.
The 2732A has a standby mode which reduces the power dissipation without increasing access time. The maximum
active current is 150mA, while the maximum standby current is only 35mA, a 75% saving. The standby mode is achieved
by applying a TIL-high signal to the CE input.
The 2732A is fabricated with HMOS*-E technology, Intel's high speed N-channel MOS Silicon Gate Technology.
~
2732A CE OE/Vpp Vcc OUTPUTS
PIN CONFIGURATION Vpp VCC
MODE
(18) (20) (24) (9-11.1317)
A'2 PGM
A7 N.C.l 11 Read V IL VIL +5 DOUT
A6 AS Standby V IH Don't Care +5 High Z
AS Ag
Program V IL Vpp +5 DIN
A4 An
A3 DE Program Verify VIL VIL +5 DOUT
A2 A,a Program Inhibit V IH Vpp +5 High Z
Al CE
AO
00 06
0, 05
BLOCK DIAGRAM
02 04
GND 03
DATA OUTPUTS
111For total compatibility from VCC~ 00-07
2732A provide a trace to pin 26 GNO~
PIN NAMES
yGATING
Ao-A'l ADDRESSES AO-All
ADDRESS
CE CHIP ENABLE
INPUTS
OE OUTPUT ENABLE 32.7638IT
0 0 -07 OUTPUTS CELL MATRIX
7_,)~A
inter
2758
8K (1 K x 8) UV ERASABLE LOW POWER PROM
Single + 5V Power Supply Fast Access Time: 450 ns Max. in
Active and Standby Power Mode.
Simple Programming Requirements
- Single Location Programming
- Programs with One 50 ms Pulse
Inputs and Outputs TTL Compatible
during Read aoo Pr....m
The Intel@ 2758 is a 8192-bit ultraviolet erasable and electrically programmable read-only memOfy (~PAOM). The 2758
operates from a single 5-volt power supply, has a static standby mode, and features fast slAgle address location pro-
gramming. It makes designing with EPROMs faster, easier and more economical. The total pr.amming Hme fOf all
8192 bits is 50 seconds.
The 2758 has a static standby mode which reduces the power dissipation without increasj.nQ) aeoess time. TM maxi-
mum active power dissipation is 525mW, while the maximum standby power dissipati.fII is 04'My 132mW, a 75%
savings. Powerd<?wn is achieved by applying a TTL-high signal to the CE input.
A 2758 system may be designed for total upwards compatibility with Intel's 16K 2716 EPFitQM (see Applications Nota
72). The 2758 maintains the simplest and fastest method yet devised for programming EPRQMs - single pulse TTL-
level programming. There is no need for high voltage pulsing because all programming cQntrols are han cUed by TTL
signals. Program any location at any time - either individually, sequentially, or at random, with the single address
location programming.
I~
A7
A6 CE/PGM AJII @I \/pp Vee OUTPUTS
AS (18.) (19) (~ (2t) (34) (911.13.17)
A4 Vpp
MODE
A3 DE
A2
Al Read V IL V IL VIL +5 +5 DOUT
AO 07
Don't
00 06 Standby VIH VIL +5 +5 High Z
Care
AO-Ag
ADDRESS
INPUTS
INTEL CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE OF ANY CIRCUITRY OTHER THAN CIRCUITRY EMBODIED IN AN INTEL PROQUCT. NO OTHER CIRCUIT PATENT LICENSES ARE IMPLIED.
'INTEL CORPORATION. 1979 FESRUARY 1979
7-239
2758
PROGRAMMING
The programming specifications are described in the Data Catalog PROM/ROM Programming Instructions section.
Absolute Maximum Ratings*
Temperature Under Bias . . . . . . . . . . . . . -10C to +80C *COMMENT: Stresses above those listed under "Absolute Maxi-
Storage Temperature. . . . . . . . . . . -65C to +125C mum Ratings" may cause permanent damage to the device. This is a
All Input or Output Voltages with stress rating only and functional operation of the device at these or
any other conditions above those indicated in the operational sec-
Respect to Ground . . . . . . . . . . . . . . . +6V to -0.3V
tions of this specification is not implied. Exposure to absolute
Vpp Supply Voltage with Respect maximum rating conditions for extended periods may affect device
to Ground During Programming . . . . +26.5V to -0.3V reliability.
READ OPERATION
D.C. and Operating Characteristics
T A = OC to 70C, Vee[1,2] = +5V 5%, Vpp[2] = Vee
Limits
Symbol Parameter Unit Conditions
Min. Typ,l3J Max.
NOTES: 1. Vee must be applied simultaneously or before Vpp and removed simultaneously or after Vpp.
2. Vpp may be connected directly to Vee except during programming. The supply current would then be the sum of lee and IpP1.
3. Typical values are for TA = 25 e and nominal supply voltages.
4. AR is a reference voltage level which requires an input current of only 10 /-IA. The 2758 81865 is also available which has a reference
voltage level of VIH instead of VIL.
Typical Characteristics
~
60
50
~
r-- r--
-- i""- ~
ICC2 ACTIV CURRENT
CE= VIL
vcc = 5V
600
500
600
500
Vcc = 5V
--
40 400 ] 400
!
v v u
1l 30
20 ICC1 STA~BY
CEo VIH
CURR NT
300
200
V I--
u
;: 300
Vcc = 5V
10 100 100
o o
o 10 20 30 40 50 60 70 80 100 200 300 400 500 600 700 800 o 10 20 30 40 50 60 70 80
TEMPERATURE lOCI CL IpFI TEMPERATURE lOcI
7-240
2758
A.C. Characteristics
o
T A = OC to 70 e, VCC[1] = +5V 5%, Vpp[2] = Vee
Limits
Symbol Parameter Unit Test Conditions
Min. Typ.[31 Max.
A.C. Waveforms[51
ADDRESSES
ADDRESSES
VALID
CE----------------~~~
tCE
1+---(450 MAX.)
6E----------+-----~
\'---------+--. . . . . . . . . . (7)
~
(6)
tOF
tOE
(100 MAX.)
(120 MAX.)
[6)
tOH-
(0)
_-.~~r""'lr""'l....- .
HIGH Z HIGH Z
OUTPUT-------------------------------f-+-~~~~
"-.a..._ _ _.........._
NOTES: 1. Vec must be applied simultaneously or before Vpp and removed simultaneously or after Vpp.
2. Vpp may be connected directly to VCC except during programming. The supply current would then be the sum of ICC and IpP1.
3. Typical values are for TA = 25C and nominal supply voltages.
4. This parameter is only sampled and is not 100% tested.
5. All times shown in parentheses are minimum times and are nsec unless otherwise specified.
6. OE may be delayed up to 330 ns after the falling edge of CE without impact on tACC.
7. tDF is specified from DE or CE, whichever occurs first.
7-241
2758
ERASURE CHARACTERISTICS the outputs 120 ns (tOE) after the falling edge of OE,
The erasure characteristics of the 2758 are such that erasure assuming that CE has been low and addresses have been
begins to occur when exposed to light with wavelengths stable for at least tACC - tOE'
shorter than approximately 4000 Angstroms (A). It should
be noted that sunlight and certain types of fluorescent STANDBY MODE
lamps have wavelengths in the 3000-4000A range. Data The 2758 has a standby mode which reduces the active
show that constant exposure to room level fluorescent power dissipation by 75%, from 525 mW to 132 mW. The
lighting could erase the typical 2758 in approximately 3 2758 is placed in the standby mode by applying a TTL high
years, while it would take approximately 1 week to cause signal to CEinput. When in standby mode, the outputs
erasure when exposed to direct sunlight. If the 2758 is to are in a high impedence state, independent of the OE input.
be exposed to these types of lighting conditions for ex-
tended periods of time, opaque labels are available from
Intel which should be placed over the 2758 window to OUTPUT ORTIEING
prevent unintentional erasure. Because EPROMs are usually used in larger memory arrays,
Intel has provided a 2 line control function that accommo-
The recommended erasure procedure (see Data Catalog dates this use of multiple memory connections. The two line
Programming Section) for the 2758 is exposure to short- control function allows for:
wave ultraviolet light which has a wavelength of 2537
a) the lowest possible memory Power dissipation, and
Angstroms (A). The integrated does (i.e., UV intensity X
b) complete assurance that output bus contention will
exposure time) for erasure should be a minimum of 15
not occur.
W-sec/cm 2 . The erasure time with this dosage is approxi-
mately 15 to 20 minutes using an ultraviolet lamp with To most efficiently use these two control lines, it is recom
12,000 p.w /cm 2 power rating. The 2758 should be placed mended that CE (pin 18) be decoded and used as th~
within 1 inch of the lamp tubes during erasure. Some lamps primary device selecting function, while OE (pin 20) be
have a filter on their tubes which should be removed before made a common connection to all devices in the array and
erasure. connected to the READ line from the system control bus.
This assures that all deselected memory devices are in their
DEVICE OPERATION low power standby mode and that the output pins are only
The five modes of operation of the 2758 are listed in Table active when data is desired from a particular memory device.
1. It should be noted that all inputs for the five modes are
at TTL levels. The power supplied required are a +5V Vcc PROGRAMMING
and a Vpp . The Vpp power supply must be at 25V during
Initially, and after each erasure, all bits of the 2758 are in
the two programming modes, and must be at 5V in the
the "1" state. Data is introduced by selectively program-
other three modes. In all operational modes, AR must be
ming "O's" into the desired bit locations. Although only
at V I L (except for the 2758 S 1865 which has AR at V I H).
"O's" will be programmed, both "1 's" and "O's" can be
presented in the data word. The only way to change a "0"
TABLE I. MODE SELECTION to a "1" is by ultraviolet light erasure.
I~
The 2758 is in the programming mode when the Vpp
CE/PGM AR DE Vpp Vee OUTPUTS power supply is at 25V and OE is at V IH. The data to be
(18) (19) (20) (21) (24) (911,1317) programmed is applied 8 bits in parallel to the data output
MODE pins. The levels required for the address and data inputs are
TTL.
Read V IL VIL VIL +5 +5 DOUT
When the address and data are stable, a 50 msec,
Don't
Standby VIH VIL +5 +5 High Z active high, TTL program pulse is applied to the CE/PGM
Care
input. A program pulse must be applied at each address
Program Pulsed VIL to VIH VIL VIH +25 +5 DIN
location to be programmed. You can program any location
Program Verify VIL VIL VIL +25 +5 DOUT
at any time - either individually, sequentially, or at ran-
Program Inhibit VIL VIL VIH +25 +5 High Z
dom. The program pulse has a maximum width of 55 msec.
7242
2758
PROGRAM INHIBIT PROGRAM VERIFY
Programming of multiple 2758s in parallel with different A verify should be performed on the programmed bits to
data is also easily accomplished. Except for CE/PGM, all determine that they were correctly programmed. The verify
like inputs (including DE) of the parallel 2758s may be may be performed with Vpp at 25V. Except during pro-
common. A TTL level program pulse applied to a 2758's gramming and program verify, V pp must be at 5V.
CE/PGM input with Vpp at 25V will program that 2758.
A low level CE/PGM input inhibits the other 2758 from
being programmed.
7-243
I
CHAPTER 8
DEVELOPMENT SUPPORT TOOLS
The following are trademarks of Intel Corporation and may be used only to identify Intel products: BXP. Intellec. Multibus. i. iSBC. Multimodule. ICE. iSBX. PROMPT. iCS. Library
Manager. Promware. Insite. MCS. RMX. Intel. Megachassis. UPI. Intelevision. Micromap. ~Scope and the combination of ICE. iCS. iSBC. iSBX. MCS. or RMX and a numerical
suffix.
Intel Corporation 1980 121599-001 Rev. A
MODEL 225
!
8-LEVEL BAUD RATE
64K BYTES 4K BYTES SERIAL SERIAL
PRIORITY GENERATOR &
RAM ROM CHANNELO CHANNEL1
INTERRUPT REAL-TIME CLOCK
8251A 8251A
8259A 8253A
BUS
CONTROLLER PRIORITY SYSTEM 8080A-2 8085A-2 BIDIRECTIONAL
8219 RESOLUTION CLOCKS CPU CPU DRIVER
CABLE BUS
8228 . 8253
8K ROM SYSTEM INTERVAL
CONTROLLER TIMER
8041A
CPU
8271 8275
TAPE TAPE
FLOPPY CRT KEYBOARD PRINTER
PUNCH READER
CONTROLLER CONTROLLER
Figure 1. Intellec Series 11/85 Model 225 Microcomputer Development System Block Diagram
AFN-014?4R
MODEL225
Interrupts CHASSIS
8-level, maskable, nested priority interrupt net- Width -17.37 in. (44.12 cm)
work initiated from front panel or user selected Height -15.81 in. (40.16 cm)
devices. Depth -19.13 in. (48.59 cm)
Weight - 73 lb. (33 kg)
fVi AFN-014248
intJ MODEL225
ORDERING INFORMATION
Part
Number Description
8-n AFN-014248
INTELLEC SINGLE/DOUBLE DENSITY
FLEXIBLE DISK SYSTEM
The Intellec Flexible Disk System is a sophisticated, general purpose, bulk storage peripheral for use with the
Intellec Microcomputer Development System. The use of a flexible disk operating system significantly re-
duces program development time. The software system known as ISIS-11 (Intel System Implementation
Supervisor), provides the ability to edit, assemble, compile, link, relocate, execute and debug programs, and
performs all file management tasks for the user.
The following are trademarks of Intel Corporation and may be used only to identify Intel products: i. Intel. INTEL, INTELLEC, MCS, 1m , ICS. ICE, UPI, BXP. iSBC, iSBX, iNSITE, iRMX,
CREDIT, RMXl80, ILScope, Multibus, PROMPT, Promware, Megachassis, Library Manager, MAIN MULTI MODULE, and the combination of MCS, ICE, SBC, RMX or iCS and a numerical
suffix; e.g., iSBC-80.
Intel Corporation 1980
8-7
FLEXIBLE DISK SYSTEM
HARDWARE puter Set. This 8-bit processor includes four 3002 Cen-
tral Processing Elements (2-bit slice per CPE), a 3001
The Intellec@ flexible disk system provides direct Microprogram Control Unit, and 512 x 32 bits of 3604
access bulk storage, intelligent controller, and two flex- programmable-read-only-memory (PROM) which stores
ible disk drives. Each single density drive provides 1/4 the microprogram. It is the execution of the micro-
million bytes of storage with a data transfer rate of program by the microcomputer set which actually
250,000 bits/second. The double density drive provides effects the control capability of the Channel Board.
1/2 million bytes of storage with a data transfer rate of
500,000 bits/second. The controllers are implemented This board is the same for either single or double den-
with Intel's powerful Series 3000 Bipolar Microcomputer sity drives, except that the Series 3000 microcode is dif-
Set. The controllers provide interface to the Intellec ferent.
System bus. Each single density controller will support
two drives. Each double density controller will support INTERFACE BOARD
up to four drives. The flexible disk system records all The Interface Board provides the flexible disk controller
data in soft sector format. with a means of communication with the flexible disk
The single/double density flexible disk controllers each drives, as well as with the .lntellec system bus. Under
consists of two boards, the Channel Board and the Inter- control of the microprogram being executed on the
face Board. These two printed circuit boards reside in Channel Board, the Interface Board generates those
the Intellec System chaSSis. The boards are shown in signals which ca~se the read/write head on the selected
the photograph, and are described in more detail in the drive to be loaded (i.e., to come in contact with the flex-
following paragraphs. ible disk platter), cause the head to move to the proper
track and verify successllli operation. The Interface
Board accepts the data beirlg read off the flexible disk,
interprets synchronizing bii:patterns, checks the valid-
ity of the data using a cyclic redundancy check (CRC)
polynomial, and then transfers the data to the Channel
Board.
During write operations, the Interface Board outputs the
data and clock bits to the selected drive at the proper
times, and generates the CRC characters which are then
appended to the data.
When the flexible disk controller requires access to
SINGLEIDOUBLE DENSITY CHANNEL BOARD Intellec system memory, the Interface Board requests
the DMA master control of the system bus, and gener-
ates the appropriate memory command. The Interface
Board also acknowledges 'I/O commands as required by
the Intellec bus.
The Flexible Disk System is capable of performing
seven different operations: recalibrate, seek, format
track, write data, write deleted data, read data, and verify
CRC.
The channel board is different for single and double den-
sity drives, due to the different recording techniques
used. The single density controller boards support one
DOUBLE DENSITY INTERFACE BOARD
set of dual single density drives. The double density
(SINGLE DENSITY INTERFACE BOARD controller boards support up to two sets of dual double
IS SIMILAR TO THE ONE SHOWN ABOVE) density drives (four drives total).
The double density controller may co-reside with the
Intel single density controller to allow conversion of
CHANNEL BOARD
single density flexible disk to double denSity format,
The Channel Board is the primary control module within and provide up to 2.5M bytes of storage.
the flexible disk system. The Channel Board receives,
decodes, and responds to channel commands from the FLEXIBLE DISK DRIVE MODULES
Central Processor Unit (CPU) in the Intellec system. The
Each flexible disk drive consists of read/write and con-
Channel Board can access a block of Intellec system
memory to determine the particular flexible disk opera- trol electronics, drive mechanisms, read/write head,
tions to be performed and fetch the parameters required track positioning mechanism, and the removable flex-
for the successful completion of the specified opera- ible disk platter. These components interact to perform
tion. the following functions:
The control functions of the Channel Board have been Interpret and generate control signals
achieved with an 8-bit microprogrammed processor, Move read/write head to selected track
designed with Intel's Series 3000 Bipolar Microcom- Read and write data
8-8
FLEXIBLE DISK SYSTEM
CHASSIS Temperature:
DC Power Supplies Operating: 15.6C to 51.rC
Supplied Internal to the Cabinet NonOperating: 5C to 55C
AC Power Requirements Humidity:
3-wire input with center conductor (earth ground) tied Operating: 8 to 80% (Wet bulb 29.4 0c)
to chassis NonOperating: 8 to 90%
Singlephase, 115 VAC; 60 Hz; 1.2 Amp Maximum (For DRIVES AND CHASSIS
a Typical Unit) Temperature:
230 VAC; 50 Hz; 0.7 Amp Maximum (For Operating: 10C to 38C
a Typical Un)t) NonOperating: - 35C to 65C
FLEXIBLE DISK OPERATING SYSTEM CONTROLLER Humidity:
DC Power Requirements (All power supplied by Intellec Operating: 20% to 80% (Wet bulb 26.rC)
Development System) NonOperating: 5% to 9S%
CHANNEL BOARD CONTROLLER BOARDS
Single Density Double Density Temperature:
SV @ 3.7SA (typ), SA (max) SV @ 3.7SA (typ), SA (max) Operating: o to 55C
NonOperati ng: - SsoC to 8SoC
INTERFACE BOARD
Humidity:
Single Density Double Density
Operating: Up to 9S% relative humidity without
SV @ 1.SA (typ), 2.SA (max) SV @ 1.SA (typ), 2.SA (max) condensation
- 10V @ 0."1A (typ), NonOperati ng: All conditions without condensa
0.2A (max) tion of water or frost
89
FLEXIBLE DISK SYSTEM
EQUIPMENT SUPPLIED
SINGLE DENSITY DOUBLE DENSITY
Cabinet, Power Supplies, Line Cord, Two Drives Cabinet, Power Supplies, Line Cord, Two Drives
Single Density FDC Channel Board Double Density FDC Channel Board
Single Density FDC Interface Board Double Density FDC Interface Board
Dual Auxiliary Board Connector Dual Auxiliary Board Connector
Flexible Disk Controller Cable Flexible Disk Controller Cable
Flexible Disk Peripheral Cable Flexible Disk Peripheral Cable
Hardware Reference Manual Hardware Reference Manual
Reference Schematics\ Reference Schematics
ISIS-II Single Density System Disk ISIS-II Double Density System Disk
ISIS-II System User's Guide ISIS-II System User's Guide
OPTIONAL EQUIPMENT
MDS-BLD* 10 Blank Flexible Disks
MDS-730/731 * Second Drive Cabinet with two addi-
tional drives
ORDERING INFORMATION
Part Number Description
MDS-710/110V* Flexible Disk drive unit with two
711/220V drives, single density drive con-
troller, software, and cables.
M DS-720-11 OV* Flexible Disk drive unit with two
721/220V drives, double density drive con-
troller, software, and cables.
MDS-730/110V* Add-on drive unit with two drives
731/220V and double density cable, without
controller and software. Can be
used with double density con
troller.
MDS is an ordering cude 01J1y and is not used as a product name or trademark. MDS is a registered trademark of Mohawk Data Sciences
Corporation.
810
8051 SOFTWARE DEVELOPMENT PACKAGE
The 8051 software development package provides development system support for the powerful 8051 family of single
chip microcomputers. The package contains a symbolic macro assembler and MCS-48 source code converter.
The assembler produces absolute machine code from 8051 macro assembly language instructions. This object code
may be used to program the 8751 EPROM version of the chip. The assembler output may also be debugged using the
ICE-51TM in-circuit emulator.
The converter translates 8048 assembly language instructions into 8051 source instructions to provide software com-
patibility between the two families of microcontrollers.
This diskette-based software package runs under ISIS-II on an Intellec Microcomputer Development System with 64K
bytes of memory.
AFN01739A
8-11
8051 SOFTWARE DEVELOPMENT PACKAGE
The assembler supports macro definitions and calls. This is a convenient way to program a frequently used code
sequence only once. The assembler also provides conditional assembly capabilities.
Cross referencing is provided in the symbol table listing, showing the user the lines in which each symbol was
defined and referenced.
ASM51 provides symbolic access to the many useful addressing features of the 8051 architecture. These features
include referencing for bit and byte locations, and for providing 4-bit operations for BCD arithmetic. The assembler
also provides symbolic access to hardware registers, 1/0 ports, control bits, and RAM addresses.
If an 8051 program contains errors, the assembler provides a comprehensive set of error diagnostics, which are
included in the assembly listing or on another file. Program testing may be performed by using the Universal PROM
Programmer and 8751 personality card to program the 8751 EPROM version of the chip, or by using the ICE-51 in-circuit
emulator.
..,,,
4 ; Th . .., rout,nQo conI/torts BCD to b,nary and b,no.ry to BCD
BIBB
BIBB 7
BIB17SFB8A
81844BSA
I.
11
12
8186S4FB 13 ,HIL wuraH ; 'lQ:ok out low vrd~r d, 9 I t
a: IJ~
Dilhl Ci'
BIBB 54BF
1-14 I.
I'
IS
17
IS
:
SWAP A
,",,,,! t" P ~~L d ~~' t
::c H
'HIL
I R I
~1.
A.IOFH
by lIJ
,"'Olle h'Qn digIt ,nto low order
;
,
;
l'Iult,ply digIt by 13
n,bble of o,ccu .. ulo.tor
8-12 AFN01739A
8051 SOFTWARE DEVELOPMENT PACKAGE
CONV51
8048 TO 8051 ASSEMBLY LANGUAGE
CONVERTER UTILITY PROGRAM
Enables software written for the Preserves comments; translates 8048
MCS-48 family to be upgraded to macro definitions and calls
run on the 8051
Provides diagnostic information and
Maps each 8048 instruction to a warning messages embedded in the
corresponding 8051 instruction output listing
The 8048 to 8051 Assembly Language Converter is a utility to help users of the MCS-48 family of microcomputers
upgrade their designs with the high performance 8051 architecture. By converting 8048 source code to 8051 source
code, the software investment developed for the 8048 is maintained when the system is upgraded.
The goal of the converter (CONV51) is to attain functional equivalence with the 8048 code by mapping each 8048
instruction to a corresponding 8051 instruction. In some cases a different instruction is produced because of the
enhanced instruction set (e.g., bit CLR instead of ANL).
Although CONV51 tries to attain functional equivalence with each instruction, certain 8048 code sequences cannot be
automatically converted. For example, a delay routine which depends on 8048 execution speed would require manual
adjustment. A few instructions, in fact. have no 8051 equivalent (such as those involving P4-P7). Finally, there are a few
areas of possible intervention such as PSW manipulation and interrupt processing, which at least require the user to
confirm proper translation. The converter always warns the user when it cannot guarantee complete conversion.
CONV51 produces two files. The output file contains the ASM51 source program produced from the 8048 instructions.
The listing file produces correlated listings of the input and output files, with warning messages in the output file to
point out areas that may require users' intervention in the conversion.
Intellec Microcomputer Development System with ISIS-II Diskette Operating System (V3.4 or later)
Documentation Package:
64K Bytes of RAM
MCS-51 Macro Assembler User's Guide
Flexible Disk Drive(s)
MCS-51 Macro Assembly Language Pocket Reference
System Console
MCS-51 8048-to-8051 Assembly Language Converter
-CRT or hard copy device Operating Instructions for ISIS-II Users
ORDERING INFORMATION
Part Number Description
MCI-51-ASM 8051 Software Development
Package
8-13 AFN01739A
inter ICE51
8051 INCIRCUIT EMULATOR
The ICE-51 module resides in the Intellec Microcomputer Development System and interfaces to any
. user-designed 8051 system through a cable terminating in an 8051 emulator microprocessor and a pin-
compatible plug. The emulator processor, together with 8K bytes of user program RAM located in the
ICE-51 buffer box, replaces the 8051 device in the user system while maintaining the 8051 electrical and
timing characteristics. Powerful Intellec debugging functions are thus extended into the user system.
Using the ICE-51 module, the designer can emulate the system's 8051 in real-time or single-step mode.
Breakpoints allow the user to stop emulation on user-specified conditions, and a trace qualifier feature
allows the conditional collection of 1000 frames of trace data. Using the single-line 8051 assembler the
user may alter program memory using ASM51 mnemonics and symbolic references, without leaving the
emulator environment. Frequently used command sequences can be combined into compound com-
mands and identified as macros with user-defined names.
The following are trademarks of Intel Corporation and may be used only to describe Intel products: Intel, Intellec, MCS and ICE, and the combination of MCS or ICE and a
numerical suffix. Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are
implied.
815 AFN.n17Q1A
ICE51
The power of the development system can be ap- tinuously compares the values stored in the break-
plied to manufacturing testing as well as develop- point registers with the status of specified ad-
ment by writing test sequences as macros. The dress, opcode, operand, or port values, and halts
macros are stored on diskettes for use during emulation when this comparison is satisfied.
system test. When an instruction initiates a break, that instruc-
tion is executed completely before the break
COMPOUND COMMAND takes place. The ICE-51 emulator then regains
Compound commands provide conditional execu- control of the console and enters the Interroga-
tion of commands (IF command) and execution of tion Mode. With the breakpoint feature, the user
commands repeatedly until certain conditions are can request an emulation break when his pro-
met (COUNT, REPEAT commands). gram:
Compound commands may be nested any number Executes an instruction at a specific address or
of times, and may be used in macro commands. within a range of addresses.
Example: Executes a particular opcode.
* DEFINE .1 = a ; Define symbol .1 to a Receives a specific Signal on a port pin.
*COUNT 100H ; Repeat the following
Fetches a particular operand from the user pro-
commands 100H times.
gram memory.
.*IF.I AND 1 THEN ; Check if .1 is odd
,,*BYTE .1=.1 ; Fill the memory at location .1 Fetches an operand from a specific address in
to value .1 program memory.
,,*END
. *.1 =.1+ 1 ; Increment .1 by 1. Table 1. Major Emulation Commands
.*END ; Command executes upon
carriage-return after END Command Description
(The characters *, . *, and" * shown in this exam-
GO Begins real-time emulation and op-
ple are system prompts which include an indica- tionally specifies break conditions.
tion of the nesting level of compound commands.)
BRO, BR1, BR Sets or displays either or both
Breakpoint Registers used for stop-
Operating Modes ping real-time emulation.
The ICE-51 software is an Intellec RAM-based pro- STEP Performs Single-step emulation.
gram that provides the user with easy-to-use com- QRO, QR1 Specifies match conditions for qual-
mands for initiating emulation, defining break- ified trace.
points, controlling trace data collection, and dis- TR Specifies or displays trace-data col-
playing and controlling system parameters. lection conditions and optionally
sets Qualifier Register (ORO, OR1).
ICE-51 commands are configured with a broad
range of modifiers which provide the user with Synchroniza- Set and display status of synchroni-
tion Line zation line outputs or latched in-
maximum flexibility in describing the operation to
Commands puts. Used to allow real-time emula-
be performed. tion or trace to start and stop syn-
chronously with external events.
EMULATION
The ICE-51 module can emulate the operation of a
prototype 8051 system, at real-time speed (1.2 to Trace and Tracepoints
12 MHz) or in Single steps. Emulation commands Tracing is used with both real-time and single-
to the ICE-51 module control the process of set- step emulation to record diagnostic information in
ting up, running, and halting an emulation of the the trace buffer as a program is executed. The in-
user's 8051-based system. Breakpoints and trace- formation collected includes opcodes executed,
points enable the ICE-51 emulator to halt emula- port values, and memory addresses. The ICE-51
tion and provide a detailed trace of execution in emulator collects 1000 frames of trace data.
any part of the user's program. A summary of the
emulation commands is shown in Table 1. This information can be displayed as assembler
instruction mnemonics, if desired, for analysis
Breakpoints during interrogation or single-step mode. The
The ICE-51 hardware includes two breakpoint reg- trace-collection facility may be set to run condi-
isters that allow the user to halt emulation when tionally or unconditionally. Two unique trace qual-
specified conditions are met. The emulator con- ifier registers, specified in the same way as break-
8-16 A~N.n17Q1l1..
ICE51
point registers, govern conditional trace activity. Changes can be made in memory and in the 8051
The qualifiers can be used to condition trace data registers, flags, and port values. Commands are
collection to take place as follows: also provided for various utility operations such
as loading and saving program files, defining sym-
Under all conditions (forever). bols, displaying trace data, controlling system
Only while the trace qualifier is satisfied. synchronization and returning control to ISIS-II. A
For the frames or instructions preceding the summary of the basic interrogation and utility
time when a trace qualifier is first satisfied (pre- commands is shown in Table 3. Two time-saving
trigger trace). emulator features are discussed below.
For the frames or instructions after a trace qual-
ifier is first satisfied (post-triggered trace).
SINGLE-LINE ASSEMBLER/DISASSEMBLER -
Table 2 shows an example of a trace display. The single-line assembler/disassembler (ASM and
DASM commands) permits the designer to exam-
Table 2. Trace Display (Instruction Mode) ine and alter program memory using assembly
*r P[ l
language mnemonics, without leaving the emu-
FF~n I rc ep.l J~'~Trt'rT I('~' rJ F7 Fr Trl'F
lator environment or requiring time-consuming
rrrr: rrrn; Fe ,...('vy prrTF, f rrp F'Pf-1 IFf' r
r rr": rrrJII H r-'rv pr, r rr~ r'lPp fFf
program reassembly. When assembling new
PrJ I: rrr7P Ft eFl ~ rpp ~Pfl fFf
rrj': rrr31
rrJ c: rrrtp
1
"
"'r::('C'""
PlC
r-"(,V
f-
.r], ' . . n'
rrl'
prrl
PPII
prf 1
FFf'
FFI'
mnemonic instructions into program memory, pre-
P r 77: rr r7P r'
co
erp r reI' rPfl F FI' viously defined symbolic references (from the
rr'1: rrrn' ~l'" f l,Fr t'1'}1 f'pp FF I'
rr? r::.: rrrq: rrrr POF rrl' I'/P f'!'"Jf.' FF I original program assembly, or subsequently de-
('('1": r('rl-! ..., r ") /' (' ~
~rv ?t P, :/I. f T,.~~ ttf' ?,Pfl HI
rr'J: rn'n ('11:f"- f,'~r (,(rrfl
" t~ prl' III fined during the emulation session) may be used
in the instruction operand field. The emulator will
supply the absolute address or data values as
INTERROGATION AND UTILITY stored in the emulator symbol table. These fea-
Interrogation and utility commands give the user tures eliminate user time spent translating to and
convenient access to detailed information about from machine code and searching for absolute ad~
the user program and the state of the 8051 that is dresses, with a corresponding reduction in trans-
useful in debugging hardware and software. cription errors.
Command Description
HELP Displays help messages for ICE-51 emulator command-entry assistance.
LOAD Loads user object program (8051 code) into user program memory, and user symbols into
ICE-51 emulator symbol table.
SAVE Saves ICE-51 emulator symbol table andlor user object program in ISIS-II hexadecimal file.
LIST Copies all emulator console input and output to ISIS-II file.
EXIT Terminates ICE-51 emulator operation.
DEFINE Defines ICE-51 emulator symbol or macro.
REMOVE Removes ICE-51 emulator symbol or macro.
ASM Assembles mnemonic instructions into user program memory.
DASM Disassembles and displays user program memory contents.
ChangelDisplay Change or display value of symbolic reference in ICE-51 emulator symbol table, contents of
Commands key-word references (including registers, 1/0 ports, and status flags), or memory references.
EVALUATE Evaluates expression and displays resulting value.
MACRO Displays ICE-51 macro or macros.
INTERRUPT Displays serial, external, or timer interrupt register settings.
SECONDS Displays contents of emulation timer, in microseconds.
Trace Commands Position trace buffer pointer and select format for trace display.
PRINT Displays trace data pointed to by trace buffer pointer.
8-17 AI=I\.I_n17Q111
ICE51
HELP - The HELP fiie aiiows the user to dispiay Emulation Accuiacy
ICE-51 command syntax information at the Intel- The speed and interface demands of a high-
lee console. By typing "HELP", a listing of all performance single-chip microcomputer require
items for which help messages are available is extremely accurate emulation, including full-
displayed; typing "HELP < Item>" then displays speed, real-time operation with the full function of
relevant information about the item requested, in- the microcomputer. The ICE-51 emulator achieves
cluding typical usage examples. Table 4 shows accurate emulation with an 8051 bond-out chip, a
some sample HELP messages. special configuration of the 8051 microcomputer
family, as its emulation processor.
-HELP -HELP IF
Helo is aVC'lilf'ble for trf> follov.!rlo itE'l"1s. TyOfl Pflf' follo\o,'f'\."i ny IF - The .:onditiorlCll COrnfTIa!l~-t .allows ...:onditio!lel ex(>.:'ut i 0.""1 of onE:"
the itelTl rl?mt>. Tt"lE" t'elo items =Cl~I~lot te flb["lrE"vi('ltp ..i . (For fT'Iorf' or more C'ommClnds t-ased on the vi'lues of I:')oolean ..:onditiorlSa
i~tformCltio:l, tyoe t:F.lP PF[P or l'fLF rNFC".) IF (E"XDr> fTHF.f..'l <cr> <tru~~list'>: :=r<.:omlflond> <c!">lfl
Fl'lulc-tion: Trr':E' ('ollf>.:t!o~l: r-"is..:-: <a:d,-irf>ss'> <true!"list> <false!"list)::=r<corr.ffla!ld> <cr'>lP
CO en syr TR C'P C'pr (,P1 ~YJ RPf-F <(,PU~kf>y"ord> rOPIF <exer> <.:r> <.:ommand>: :=/lrl ICF-~l .... omlT'a~ld.
BR BRr PRJ f'lfPPLf <exec) (truetlist>l r
STEF Tril..:'p ['isol?y: FNAPLE <rCE~l~lq:'yword) r!'LSE <cr)
TRAC'r. ~(,"F' PRINi FRP0P <idf>~ltifif>r'> <fal se~ list> 1
OLrF~T' NEWEf;T FVAL.tt/'.1F <instruct ~Ofl'> ENV
tlFLP <rni'skf>d~":O~lstMlt> The <exor>s ere pVcluated in o:-der as Jr.-hit u'lsianed integprs.
Ch."ge/fli solay/[.e f i ~e/P.mov~: JNFC' <1"('It.:t-~=o~hi' If one is rf'acr.ed \o,'hos' vf'lue hi'S lO\o."-or.:Jer nit J (TRUE), all
<C~PNCE> RFN'VF CPYTF PPIT <LH~HTS> commands in ttE' <trueSlist,> follo .... i:lo that <E'XOr) Cl!'"E' thE'~1
<!'ISPLAY> SY~B(,L f'~YTE r".E~ I r~T <cart i t i.O!) executed and ~ll .:omma!lds in tt-~ otrer <true~list>s arid in thf'
RECISTER RFSE'T PEYTE PE'" l.CPC . <str ina) <fals(>~l!st> arc skiDoed. rf all <ext:'r>S ;'('"\'e value wit.h lo\..-
SFCCNDS I<RITF. PPYTE ~A~ SAVE < st!" i nq~ ':O~lstc! ~I t) order hit r (FJ'LSE), thE'fI elll coml1'C'~his irl ('"II <truetlist>s arp
DEF INE STPC XBYTF. EY SUFF'lX <~ymbol i.=~ rf' f> skipeed cHid, if FLSF is rrpSE'~lt, <,,11 commands i~1 t.hp <fil1se~list'>
SYl"fCLI(' (system~ sYlflhols> are exe.:utE'd.
fli'acro: C"omoouud < traceS re fe!" en..:e> (EX: IF. I00P=< T~f~'
VEF JNE DlR CommC"rlds: <unl im i ted~rr<?t.:'hS' cond> STEP
['ISABLE FNAPLE CrUl'IT <usf>rs$symnols,> EL!=F
INCLUDE PUT IF G0
<~ACRC"~DISPLP y> RFPEPT ENro)
<"PCRCf! "'VOC" TIC~'>
-
8-18 AFNQ1791A
ICE51
ORDERING INFORMATION
Part Number Description
MCI-51-ICE 8051 Microcontroller In-Circuit
Emulator, cable assembly and
interactive diskette software
8-19 AFN-01791A
UPP-103*
UNIVERSAL PROM PROGRAMMER
*Replaces UPP101, UPP102 Universal PROM Programmers
The UPP103 Universal PROM Programmer is an Intellec system peripheral capable of programming and verifying all of
the Intel programmable ROMs (PROMs). In addition, the UPP-103 programs the PROM memory portions of the 8748
microcomputer,8741 UPI, the 8755 PROM and 1/0 chip and the 2920 signal processor. Programming and verification
operations are initiated from the Intellec development system console and are controlled by the universal PROM map-
per (UPM) program.
8-20
UPP103
SPECIFICATIONS
Hardware Interface UPP-955: 8755A personality card with 40-pin adaptor
Data - Two 8-bit unidirectional buses socket
Commands - 3 write commands, 2 read commands, PROM Programming Sockets
one initiate command UPP-501: 16-pin/24-pin socket pair
Physical Characteristics UPP-502: 24-pin/24-pin socket pair
Width - 6 in. (14.7 cm) UPP-562: Socket adaptor for 3621, 3602, 3622, 3602A,
Height - 7 in. (17.2 cm) 3622A
Depth - 17 in. (41.7 cm) UPP-555: Socket adaptor for 3604AL, 36046-6, 3608,
3628, 3636
Weight - 18 Ib (8.2 kg)
UPP-566: Socket adaptor for 3605, 3625, 3605A, 3625A
Electrical Characteristics
AC Power Requirements - 50-60 Hz; 115/230V AC: 80W
Equipment Supplied
Environmental Characteristics
Operating Temperature - OC to 55C Cabinet
Power supplies
Optional Equipment
4040 intelligent controller module
Personality Cards
Specified zero insertion force socket pair
UPP-816: 2716 personality card Intellec development system interface cable
UPP-832: 2732 personality card
Universal PROM Mapper program (diskette-based ver-
UPP-848: 8748,8741 personality card with 40-pin adaptor sion)
socket
UPP-865: 3602, 3622, 3602A, 3622A, 3621, 3604, 3624,
3604A, 3624A, 3604AL, 36046-6, 3605, 3605A, 3625,
3625A, 3608, 3628, 3636 Reference Manuals
UPP-872: 8702A/1702A personality card 9800819 - Universal PROM Programmer User's Manual
UPP-878: 8708/8704/2708/2704 personality card (SUPPLIED)
ORDERING INFORMATION
Part Number Description
UPP-103 Universal PROM programmer with
16-pin/24-pin socket pair and
24-pin/24-pin socket pair.
8-21
SDK-51
MeS-51 SYSTEM DESIGN KIT
The SDK-51 MCS-51 System Design Kit contains all of the components required to assemble a complete
single-board microcomputer based on Intel's high-performance 8051 single-chip microcomputer. SDK-51
uses the external ROM version of the 8051 (8031). Once you have assembled the kit and supplied + 5V
power, you can enter programs in MCS-51 assembly language mnemonics, translate them into MCS-51 ob-
ject code, and run them under control of the system monitor. The kit supports optional memory and inter-
face configurations, including a serial terminal link, audio cassette storage, EPROM program memory,
and Intellec development system upload and download capability.
The following are trademarks of Intel Corporation and may be used only to describe Intel products: intel, Intellec, MCS and ICE, and the combination of MCS or ICE and a
numerical suffix, Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are
implied.
REFERENCE COUNTERS
I-
I
-t------------------ --l
I
I OSCILLATOR
4096 BYTES
PROGRAM 128 BYTES
TWO 16BIT I
& TIMER/EVENT
I TIMING
MEMORY
(8051 & 8751)
DATA MEMORY
COUNTERS I
I I
I I
I I
8051
I CPU
I I
I I
I PROGRAMMABLE I
SERIAL PORT
I 1 64KBYTE BUS
EXPANSION
PROGRAMMABLE FULL DUPLEX I
f_____
I/O USART
I SYNCHRONOUS I
SHIFTER I
I CON'""'
L __ ~ ____ J
INTERRUPTS
CONTROL PARALLEL PORTS, SERIAL SERIAL
ADDRESS/DATA BUS, IN OUT
& I/O PINS
8-23 AFN01792A
SDK51
USER
CONFIGURABLE
MEMORY
ADDRESS
& DATA BUSES
UPI
BUS
8-24 AFN01792A
SDK-51
INTELLEC SYTSTEM
An SDK-51 and an Intellec Model 800 or Series II
development system with ISIS-II can upload and
download files through the serial interface with-
out adding any software to the Intellec system.
Parallel 1/0
The kit includes an Intel 8155 parallel 1/0 device
which expands the 8031 1/0 capability by provid-
ing 22 dedicated parallel lines. Three 40-pin head-
ers between the 8031 and 8155 devices and the
wire-wrap area facilitate interconnections with the Figure 3. SDK-51 Assembled with Additional RAM
user's custom circuitry. and ROM Devices Installed
SPECIFICATIONS
RAM - 1K-byte static, expandable in 1K seg- Serial - RS-232 with user-selectable baud rate.
ments to 16K-byte with 2114 RAM devices; user- Printed circuitry for 110 baud 20 rnA current loop
configurable as program or data memory. interface. 8031 serial port.
ROM - Printed circuitry for 8K bytes of program Parallel - 22 lines, TTL compatible
memory in 4K segments using 2732A EPROM de-
vices. Cassette - Audio cassette tape storage interface
8-25 "1=1\1.n17Q?,,
SDK51
Eieciricai Characterisiics
System monitor preprogrammed in on-board ROM DC Power Requirement (supplied by user, cable
MCS-51 assembler and disassembler prepro- included with kit)
grammed in on-board ROM Voltage Current
Interface control software preprogrammed in + 5V 5% 3A
8041's on-chip ROM + 12V 5% * 100 mA
-12V 5% * 100 mA
Assembly and Test Equipment Required
12 volts required only for operation with serial interface.
Needle-nose pliers
Small Phillips screwdriver
Small diagonal wire cutters Environmental Characteristics
Soldering pencil, :::;30 watts, 1116" diameter tip
Operating Temperature - 0 to 40C
Rosin-core, 60-40 solder, 0.05" diameter
Relative Humidity - 10% to 90%, non-condens-
Volt-Ohm-Milliammeter, 1 meg-ohm input imped- ing
ance
Oscilloscope, 1 volt/division vertical sensitivity,
200 p.s/division sweep rate, single trace, internal Reference Manuals
and external triggering
SDK-51 User's Manual
Physical Characteristics SDK-51 Assembly Manual
Length - 13.5 in. (34.29 cm) SDK-51 Monitor Listing
Width - 12 in. (30.48 cm) MCS-51 Macro Assembler User's Guide
Height - 4 in. (10.16 cm) MCS-51 Macro Assembly Language Pocket Refer-
Weight - 3 Ib (1.36 kg) ence
ORDERING INFORMATION
8-26 AFN01792A
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
AFN01739A
A1
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
i SIM5i;
DO;
1* DEFINITIONS OF GLOBAL VARIABLES USED BY INDIVIDUAL
INSTRUCTION SIMULATION PROCEDURES; *1
AFN01739A
A-2
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
AFN-01739A
A-3
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
AFN-01739A
A-4
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EdECT
AFN01739A
A5
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
"::. RAM$ADDR=INT$RAMCREG$ADDR);
1 :52 :.~~ IF RAM$ADDR (= 7FH
THEN RETURN INT$RAM(RAM$ADDR);
1 ~)/.j. 2 ELSE DO;
155 :3 CALL INDSADDR$ERR(RAMSADDR);
1G6 ;-] RETURN OOH;
1 ~:?} :] END;
138 rl
r.:.. END FETCH$IND;
AFN01739A
A-6
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
A-7
AFN01739A
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
AFN01739A
A-a
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
AFN-01739A
A-9
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
1* THE FOLLOWING CODE PROVIDES A SINGLE ENTRY POINT FOR
AN EXTERNAL ROUTINE TO READ DATA FROM ALL SIMULATOR ADDRESS SF
THE FIRST CALLING PARAMETER GIVES UP TO 16 BITS OF ADDRESS;
THE SECOND SPECIFIES WHICH LOGICAL ADDRESS SPACE TO
READ, USING THE SCHEME:
0 = PROGRAM MEMORY
1 = WORKING REGISTER
2 = DIRECT ADDRESS (INPUTS FOR PORTS)
3 INDIRECT THROUGH REGISTER SPECIFIED
4 = DIRECT BIT ADDRESS (DATA RIGHT-JUSTIFIED)
5 = PAGED EXTERNAL MEMORY
6 = 64K EXTERNAL MEMORY (ALL WRITES CURRENTLY TO PAGE 0)
7 = TOP-OF-STACK (SP UPDATED)
o PROGRAM MEMORY
1 - WORKING REGISTER
2 - DIRECT ADDRESS (OUTPUT LATCHES FOR PORTS)
3 INDIRECT THROUGH REGISTER SPECIFIED
4 = DIRECT BIT ADDRESS (DATA RIGHT-JUSTIFIED)
5 - PAGED EXTERNAL MEMORY
6 64K EXTERNAL MEMORY CALL WRITTEN CURRENTLY TO PAGE 0)
7 TOP-OF-STACK (SP UPDATED)
277 2 DATA$ADDR$BYTE=DATA$ADDRl
278 2 DATA$VALUE$BYTE=DATA$VALUEi
279 2 DO CASE DATA$TYPEi
280 3 USER$CODECDATA$ADDR MOD ROM$SIZE)=DATA$VALUE$BYTEi
281 3 CALL STORE$REG(DATA$ADDR$BYTE,DATA$VALUE$BYTE)l
282 3 CALL STORE$DIR(DATA$ADDR$BYTE,DATA$VALUE$BYTE)i
283 3 CALL STORE$IND(DATA$ADDR$BYTE,DATA$VALUE$BYTE);
284 3 CALL STORE$BIT(DATA$ADDR$BYTE,DATA$VALUE$BYTE);
285 3 CALL STORE$PAGED$EXTERNALCDATA$ADDR$BYTE,DATA$VALUE$BYTE);
286 3 CALL STORE$LONG$EXTERNALCDATA$ADDR,DATA$VALUE$BYTE)i
287 3 CALL PUSH$STACKCDATA$VALUE$BYTE);
288 3 END;
289 2 END STORE$SIM;
AFN-01739A
A-11
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJE:CT
$INCLUDE (ISET~51. PLM)
= 1* INDIVIDUAL INSTRUCTION PROCEDURES: *1
=
= 1* "ACALL ad dr 16" INSTRUCT ION: *1
.-
290 1 = ACALLtADDR11: PROCEDURE;
291 2 = PAGEtCODE==(OPCODE AND 11100000B) I 32;
292 2 = PAGEtOFFSET=FETCHtPROGRAM(PC+1);
293 2 PC=PC+2i
294 2 CALL PUSHtSTACK(LOW(PC;
295 2 == CALL PUSHtSTACK(HIGH(PC;
296 2 ;:: PC=(PC AND OF800H) + (PAGE$CODE * 100H) + PAGE$OFFSET;
297 2 END ACALL$ADDR11;
--
1* "ADD A/Rn" INSTRUCTION: *1
AFN01739A
A-12
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
AFN01739A
A-13
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
'-
l* "ADDe A,#data" INSTRUCTION: it!
AFN01739A
A14
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
398 PC::;:PC-f'l ;
399 END ANL$ASIND;
416 2 PC:::::PC+3;
417 2 END ANL$D I R$ I MM;
433 2 DIR$ADDR=FETCHSPROGRAMCPC+l);
434 2 DIRSDATA=FETCH$DIR(DIR$ADDR);
435 2 - DISPLACEMENT=FETCHSPROGRAMCPC+2);
436 '"'
1':- IF Ace < DIR$DATA
THEN PSW=(PSW OR 100000000);
4~J8 2 ELSE PSW=(PSW AND 01111111B);
4:39 2 PC::::PC+3;
440 ...'"-' _. IF ACC () DIRSDATA
THEN PC=PC+SIGN$EXTENDEDCDISPLACEMENT);
442 '"I
t::. END C,)NE$ASD I R$REL;
THEN PC=PC+SIGN$EXTENDED(DISPLACEMENT);
464 2 END CJNE$REGSIMM$REL;
r-_ P(>::PC+3;
474 2 IF IND$DATA <> IMM$DATA
THEN PC=PC+SIGN$EXTENDEDCDISPLACEMENT);
476 2 END CJNE$IND$IMMSREL;
AFN-01739A
A16
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
".
:;::
1* "CPL bit" INSTRUCTION: *1
= THEN DO;
508 3 IF ACC >= OFAH THEN PSW=PSW OR 10000000B;
511 3 ACC=AeC+6;
512 3 == END;
513 2 IF ACC AND OFOH) > 90H) OR PSW AND 100000008) <> 0)
THEN DO)
515 3 == IF ACC >= OAOH THEN PSW=PSW OR 10000000B;
ACC=ACC+60H)
518 3 END;
519 2 PC=PC+l;
520 2 END DASA;
-
1* "DEC A" INSTRUCTION: *1
::::
AFN-01739A
A-18
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
1* "INC DPTR II
INSTRUCTION: *1
AFN01739A
A21
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
6!59 2 IF Ace _. 0
THEN PC=PC+SIGN$EXTENDED(DISPLACEMENT);
661 2 END JZ$REl.i
AFN-01739A
A-22
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
692 2 = PC~.::PC+2;
693 2 END MOV$A$IMM;
725 2 = SOURCE$ADDR=FETCH$PROGRAM(PC+l)i
726 2 = DEST$ADDR=FETCH$PROGRAM(PC+2);
727 2 = DIR$DATA=FETCH$DIR(SOURCE$ADDR);
728 2 = CALL STORE$DIR(DEST$ADDR,DIR$DATA);
729 2 = PC::::PC+3;
730 2 = END MOV$DIR$DIR;
AFN01739A
A-24
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
AFN01739A
A-25
PL/M-BO COMPILER 8051 INSTRUCTION SET SIMULATOR
795 2 = PC=PC+i;
796 2 = END MOVX$A$IND;
-
::::: 1* "ORL A,Rn" INSTRUCTION: 'Ifol
.. -
824 1 ::: ORL$A$REG: PROCEDUREi
825 2 ::: REG$ADDR=OPCODE AND 000OO111Bi
826 2 = REG$DATA=FETCH$REGCREG$ADDR);
827 2 == ACC=ACC OR REG$DATA,
AFN-01739A
A-26
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
AFN01739A
A-27
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
861 2 = BIT$ADDR=FETCH$PROGRAM(PC+1);
862 2 = BIT$DATA=FETCH$BIT(BIT$ADDR)i
863 2 = IF BIT$DATA = 1 THEN PSW=PSW OR 10000000B;
865 2 = PC=PC+2i
866 2 END ORL$C$BITi
:::
=
::: 1* IIORL C,/bit ll
INSTRUCTION: *1
=
867 1 = ORL$C$COMP$BIT: PROCEDUREi
868 2 BIT$ADDR=FETCH$PROGRAM(PC+l);
869 2 = BIT$DATA=FETCH$BIT(BIT$ADDR)i
870 2 = IF BIT$DATA = 0 THEN PSW=PSW OR lOOOOOOOBi
872 2 = PC=PC+2i
873 2 = END ORL$C$COMP$BITi
= 1* "RET II INSTRUCTION: *1
1* "RETIII INSTRUCTION: *1
::::
AFN-01739A
A29
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
= l* IIS,)MP reI Ii
INSTRUCTION: *1
AFN01739A
A-33
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$E,,}ECT
AFN01739A
A34
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
$EJECT
AFN01739A
A36
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
AFN01739A
A-37
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
AFN-01739A
A-38
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
AFN01739A
A-39
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EdECT
AFN01739A
A40
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EdECT
AFN-01739A
A-41
PL/M-80 COMPILER 8051 INSTRUCTION SET SIMULATOR
$EJECT
A42 AFN01739A
I
APPLICATIONS
P1.0 vee
P1.1 po.o
P1.2 PO.1
P1.3 PO.2
P1.4 PO.3
P1.S PO.4
P1.& PO.S
P1.7 PO.&
VPD/RST PO.7
P3.0/RXD VDD/EA
P3.1/TXD PROG/ALE
P3.2/INTO PSEN
P3.3.1NT1 P2.7 RXD
P3.4/TO P2.6
I
TXD
P3.S/T1 P2.S INTO
P3.6/WR P2.4 001
P3.7/RD P2.3 PORT 3 TO
XTAL2 P2.2 T1
XTAL1 P2.1 WR
VSS P2.0
Ro
Figure 1a. 8051 Microcomputer Pinout Diagram Figure 1b. 8051 Microcomputer Logic Symbol
B-1
APPLICATIONS
All three devices come in a standard 40-pin Dual In- ware application examples illustrate many of the concepts.
Line Package, vlith the same pin-out, the same timing, Several, isolated tasks (rather than one complete system
and the same electrical characteristics. The primary design example) are presented in the hope that some of
difference between the three is the on-chip program them will apply to the reader's experiences or needs.
memory-different types are offered to satisfy differing
A document this short cannot detail all of a computer
user requirements.
system's capabilities. By no means will all the 8051 instruc-
The 8751 provides 4K bytes of ultraviolet-Erasable, tions be demonstrated; the intent is to stress new or
Programmable Read Only Memory (EPROM) for unique MCS_5ITM operations and instructions generally
program development, prototyping, and limited pro- used in conjunction with each other. For additional hard-
duction runs. (By convention, 1K means 210 = 1024. ware information refer to the Intel MCS-5rM Family
lk-with a lower case "k"-equals 103 = 1000.) This part User's Manual, publication number 121517. The assembly
may be individually programmed for a specific applica- language and use of ASM51, the MCS_5ITM assembler,
tion using Intel's Universal PROM Programmer (UPP). are further described in the MCS-5J Macro Assembler
If software bugs are detected or design specifications User's Guide, publication number 9800937.
change the same part may be "erased" in a matter of The next section reviews some of the basic concepts
minutes by exposure to ultraviolet light and repro- of microcomputer design and use. Readers familiar
grammed with the modified code. This cycle may be with the 8048 may wish to skim through this section
repeated indefinitely during the design and development or skip directly to the next, "ARCHITECTURE AND
phase.
ORGANIZATION."
The final version of the software must be programmed
into a large number of production parts. The 8051 has Microcomputer Background Concepts
4K bytes of ROM which are mask-programmed with the Most digital computers use the binary (base 2) number
customer's order when the chip is built. This part is con- system internally. All variables. constants, alphanumeric
siderably less expensive, but cannot be erased or altered characters, program statements, etc., are represented by
after fabrication. groups of binary digits ("bits"), each of which has the
The 8031 does not have any program memory on-chip, value 0 or I. Computers are classified by how many bits
but may be used with up to 64K bytes of external standard they can move or process at a time.
or multiplexed ROMs, PROMs, or EPROMs. The 8031
fits well in applications requiring significantly larger or The MCS-5ITM microcomputers contain an eight-bit
smaller amounts of memory than the 4K bytes provided central processing unit (CPU). Most operations process
by its two siblings. variables eight bits wide. All internal RAM and ROM,
and virtually all other registers are also eight bits wide.
(The 8051 and 8751 automatically access external pro- An eight-bit ("byte") variable (shown in Figure 2) may
gram memory for all addresses greater than the 4096 bytes assume one of 28 = 256 distinct values, which usually
on-chip. The External Access input is an override for represent integers between 0 and 255. Other types of
all internal program memory-the 8051 and 8751 will numbers, instructions, and so forth are represented by
each emulate an 8031 when pin 31 is low.) one or more bytes using certain conventions.
Throughout this Note, "8051" is used as a generic term.
For example, to represent positive and negative values,
Unless specifically stated otherwise, the point applies
the most significant bit (07) indicates the sign of the other
equally to all three components. Table 1 summarizes the
seven bits-O if positive, I if negative-allowing integer
quantitative differences between the members of the
variables between -128 and +127. For integers with
MCS-48 and MCS-51TM families.
extremely large magnitudes, several bytes are manipu-
The remaind~r of this Note discusses the various M CS-51 lated together as "multiple precision" signed or unsigned
features and how they can be used. Software and/or hard- integers-16, 24, or more bits wide.
B2
APPLICATIONS
B3
APPLICATIONS
In addition, ASM51 can perform sophisticated mathe- assembly language by a series of ones and zeros
matical operations, computing addresses or evaluating (naiuraiiy), foHowed by the ietter "B" (for Binary); octal
arithmetic expressions to relieve the programmer from numbers as a series of octal digits (0-7) followed by the
this drudgery. However, these calculations can only use letter "0" (for Octal) or "Q" (which doesn't stand for any-
information known at "assembly time." thing, but looks sort of like an "0" and is less likely
to be confused with a zero).
For example, the 8051 performs arithmetic calculations
at run-time, eight bits at a time. ASM51 can do similar Hexadecimal numbers are represented by a series of hexa-
operations 16 bits at a time. The 8051 can only do one decimal digits (0-9,A-F), followed by (you guessed it) the
simple step per instruction, while ASM51 can perform letter "H." A "hex" number must begin with a decimal
complex calculations in each line of source code. How- digit; otherwise it would look like a user-defined symbol
ever, the operations performed by the assembler may only (to be discussed later). A "dummy" leading zero may be
use parameter values fixed at assembly-time, not variables inserted before the first digit to meet this constraint. The
whose values are unknown until program execution character string "BACH" could be a legal label for a
begins. Baroque music synthesis routine; the string "OBACH" is
the hexadecimal constant BAC I6 This is a case where
For example, when the assembly language source line,
adding 0 makes a big difference.
ADD A,#(LOOP_COUNT + I) *3
Decimal numbers are represented by a sequence of decimal
is assembled, AS M51 will find the value of the pre- digits, optionally followed by a "D." If a number has no
viously-defined constant "LOOP_COUNT" in an internal suffix, it is assumed to be decimal-so it had better not
symbol table, increment the value, multiply the sum by contain any non-decimal digits. "OBAC" is not a legal
three, and (assuming it is between -256 and 255 inclusive) representation for anything.
truncate the product to eight bits. When this instruction
When an ASCII code is needed in a program, enclose the
is executed, the 8051 ALU will just add that resulting
constant to the accumulator. desired character between two apostrophes (as in '#') and
the assembler will convert it to the appropriate code (in
Some similar differences exist to distinguish number this case 23H). A string of characters between apos-
system ("radix") specifications. The 8051 does all com- trophes is translated into a series of constants; 'BACH'
putations in binary (though there are provisions for then becomes 42H, 41 H, 43H, 48H.
converting the result to decimal form). In the course of
These same conventions are used throughout the asso-
writing a program, though, it may be more convenient
ciated Intel documentation. Table 2 illustrates some of the
to specify constants using some other radix, such as base
different number formats.
Hr. On other occasions, it is desirable to specify the ASCII
code for some character or string of characters without 2. ARCHITECTURE AND ORGANIZATION
refering to tables. ASM51 allows several representations Figure 3 blocks out the MCS_5ITM internal organization.
for constants, which are converted to binary as each
Each microcomputer combines a Central Processing
instruction is assembled.
Unit, two kinds of memory (data RAM plus program
For example, binary numbers are represented in the ROM or EPROM), Input/ Output ports, and the mode,
Hexa- Signed
Bit Pattern Binary Octal Decimal Decimal Decimal
00000000 OB OQ OOH 0 0
o0 0
0 000 1 IB IQ OIH I +1
............... .. . .. . .. ., ....
00000111 IIIB 7Q 07H 7 +7
o0 0 0 1 000 1000B IOQ 08H 8 +8
o000 100 1 lOOIB llQ 09H 9 +9
o0 0 0 1 0 1 0 10 lOB 12Q OAH 10 +10
............... .. . .. ... .. . ...
o0 0
0 1 1 1 1 I11IB 17Q OFH 15 +15
00010000 lOOOOB 20Q IOH 16 +16
........ ......
~ .. . .. ... .. . ...
o1111111 IIIIIIIB 177Q 7FH 127 +127
10000000 10000000B 200Q 80H 128 -128
10000001 1000000lB 20lQ 81H 129 -127
............... ........ ... . .. .. , '0'
TL1
TH1
TIMER
CONTROL
8-5
APPLICATIONS
(MSB) (LSB)
Symbol Position Name and Significance
I I
CY AC FO RS1 RSO OV
I Ip
OV PSW.2 Overflow flag.
Set/cleared by hardware during arith-
Symbol Position Name and Significance metic instructions to indicate overflow
CY PSW.7 Carry flag. conditions.
Set/cleared by hardware or software
during certain arithmetic and logical PSW.I (reserved)
instructions.
P PSW.O Parity flag.
AC PSW.6 Auxiliary Carry flag. Set/cleared by hardware each instruc-
Set/cleared by hardware during addition tion cycle to indicate an odd/even
or subtraction instructions to indicate number of "one" bits in the accumu-
carry or borrow out of bit 3. lator, i.e., even parity.
A significant side benefit of an instruction set more and rotates. The carry also serves as a "Boolean accumu-
powerful than those of previous single-chip microcom- lator" for one-bit logical operations anp bit manipulation
puters is that it is easier to generate applications-oriented instructions. The overflow flag (OV) detects when arith-
software. Generalized addressing modes for byte and bit metic overflow occurs on signed integer operands, making
instructions reduce the number of source code lines two's complement arithmetic possible. The parity flag
written and debugged for a given application. This leads (P) is updated after every instruction cycle with the even-
in turn to proportionately lower software costs, greater parity ()f the accumulator contents.
reliability, and faster design cycles.
The CPU does not control the two register-bank select
bits, RS I and RSO. Rather, they are manipulated by
Accumulator and PSW software to enable one of the four register banks. The
The 8051, like its 8048 predecessor, is primarily an usage of the PS W flags is demonstrated in the Instruc-
accumulator-based architecture: an eight-bit register tion Set chapter of this Note.
called the accumulator ("A") holds a source operand and Even though the architecture is accumulator-based, pro-
receives the result of the arithmetic instructions (addition, visions have been made to bypass the accumulator in
subtraction, multiplication, and division). The accumula- common instruction situations. Data may be moved from
tor can be the source or destination for logical operations any location on-chip to any register, address, or indirect
and a number of special data movement instructions, address (and vice versa), any register may be loaded with
including table look-ups and external RAM expansion. a constant, etc., all without affecting the accumulator.
Several functions apply exclusively to the accumulator: Logical operations may be performed against registers or
rotates, parity computation, testing for zero, and so on. variables to alter fields of bits-without using or affecting
Many instructions implicitly or explicitly affect (or are the accumulator. Variables may be incremented, decre-
affected by) several status flags, which are grouped mented, or tested without using the accumulator. Flags
together to form the Program Status Word shown in and control bits may be manipulated and tested without
FIgure 4. affecting anything else.
8-7
APPLICATIONS
passing parameters between routines, temporary variable are addressed using the Program Counter or instructions
storage, or saving status during interrupt service routines. which generate a sixit:t::n-bit address.
The Stack Pointer (SP) is an eight-bit pointer register
To stretch our analogy just a bit, data memory is like a
which indicates the address of the last byte pushed onto
mouse: it is smaller and therefore quicker than program
the stack. The stack pointer is automatically incremented
memory, and it goes into a random state when electrical
or decremented on all push or pop instructions and all
power is applied. On-chip data RAM is used for variables
subroutine calls and returns. In theory, the stack in the
which are determined or may change while the program
8051 may be up to a full 128 bytes deep. (In practice, even
is running.
simple programs would use a handful of RAM locations
for pointers, variables, and so forth-reducing the stack A computer spends most of its time manipulating vari-
depth by that number.) The stack pointer defaults to 7 on ables, not constants, and a relatively small number of
reset, so that the stack will start growing up from location variables at that. Since eight-bits is more than sufficient
8, just like in the 8048. By altering the pointer contents the to uniquely address 128 RAM locations, the on-chip
stack may be relocated anywhere within internal RAM. RAM address register is only one byte wide. In contrast
to the program memory, data memory accesses need a
Finally, a 16-bit register called the data pointer (DPTR) single eight-bit value-a constant or another variable-
serves as a base register in indirect jumps, table look-up to specify a unique location. Since this is the basic width
instructions, and external data transfers. The high- and of the ALU and the different memory types, those
low-order halves of the data pointer may be manipulated resources can be used by the addressing mechanisms,
as separate registers (DPH and DPL, respectively) or contributing greatly to the computer's operating efficiency.
together using special instructions to load or increment
all sixteen bits. Unlike the 8048, look-up tables can there- The partitioning of program and data memory is extended
fore start anywhere in program memory and be of to off-chip memory expansion. Each may be added
arbitrary length. independently, and each uses the same address and data
busses, but with different control signals. External pro-
gram memory is gated onto the external data bus by the
PSEN (Program Store Enable) control output, pin 29.
External data memory is read onto the bus by the RD
output, pin 17, and written with data supplied from the
microcomputer by the WR output, pin 16. (There is no
control pin to write external program ROM, which is by
definition Read Only.) While both types may be expanded
to up to 64K bytes, the external data memory may
optionally be expanded in 256 byte "pages" to preserve
the use of P2 as an I/O port. This is useful with a relatively
small expansion RAM (such as the Intel 8155) or for
addressing external peripherals.
Single-chip controller programs are finalized during the
project design cycle, and are not modified after produc-
tion. Intel's single-chip microcomputers are not "von
Neumann" architectures common among main-frame
and mini-computer systems: the MCS-5ITM processor
data memory-on-chip and external-may not be used
for program code. Just as there is no write-control signal
Memory Spaces for program memory, there is no way for the CPU to
Program memory is separate and distinct from data execute instructions out of RAM. In return, this con-
memory. Each memory type has a different addressing cession allows an architecture optimized for efficient
mechanism, different control signals, and a different controller applications: a large, fixed program located in
function. ROM, a hundred or so variables in RAM, and different
methods for efficiently addressing each.
The program memory array (ROM or EPROM), like an
elephant, is extremely large and never forgets informa- (Von Neumann machines are helpful for software develop-
tion, even when power is removed. Program memory is ment and debug. An 8051 system could be modified to
used for information needed each time power is applied: have a single off-chip memory space by gating together
initialization values, calibration constants, keyboard the two memory-read controls (PSEN and RD) with a
layout tables, etc., as well as the program itself. The pro- two-input AND gate (Figure 5). The CPU could then
gram memory has a sixteen-bit address bus; its elements write data into the common memory array using WR and
AFN-01S02A
8-8
APPLICATIONS
(Presumably, future microcomputers based on the The eight pins of Port 3 (P3) each have a special function.
MCS_5ITM architecture may have a different physical split, Two external interrupts, two counter inputs, two serial
with more or less of the 64K total implemented on-chip. data lines, and two timing control strobes use pins of P3
Using the MCS-48 family as a precedent, the 8048's 4K as described in Figure 6. Port 3 pins corresponding to
potential program address space was split I K/ 3K between functions not used are available for conventional I/O.
on- and off-chip arrays; the 8049's was split 2K/2K.)
Even within a single port, I/O functions may be combined
Why go into such tedious details about address spaces? in many ways: input and output may be performed using
The logical addressing modes are described in the Instruc- different pins at the same time, or the same pins at different
tion Set chapter in terms of physical address spaces. times; in parallel in some cases, and in serial in others; as
Understanding their differences now will payoff in under- test pins, or (in the case of Port 3) as additional special
standing and using the chips later. functio"ns.
AFN-01502A
B-9
APPLICATIONS
(MSB) (LSB)
8-10
APPLICATIONS
M1 MO Operating Mode
I I I
GATE CIT M1 MO I I I
GATE CIT M1 MO I o o MCS-48 Timer. "TLx" serves as five-
\~------., ~----"I\~---.. ~_ _----") bit prescaler.
TIMER 1 TIMER 0
(MSB) (lSB)
AFN01502A
8-11
APflLlCATIONS
(MSB) (LSB)
I I I I I I I I I
SMO SM1 SM2 REN TBB RBB TI RI
Symbol Position Name and Significance Symbol Position Name and Significance
SMO SCON.7 Serial port Mode control bit O. RB8 SCON.2 Receive Bit 8. Set/cleared by hardware
Set/cleared by software (see note). to indicate state of ninth data bit
received.
SMI SCON.6 Serial port Mode control bit I.
Set/cleared by software (see note). TI SCON.I Transmit Interrupt flag. Set by hard-
ware when byte transmitted. Cleared
SM2 SCON.S Serial poft Mode control bit 2. Set by by software after servicing.
software to disable reception of frames
for which bit 8 is zero. RI SCON.O Received Interrupt flag. Set by hard-
ware when byte received. Cleared by
REN SCON.4 Receiver Enable control bit. Set/cleared software after servicing.
by software to enable/disable serial
data reception. Note- the state of (SMO,SM I) selects:
(O,O)-Shift register I/O expansion.
TB8 SCON.3 Transmit Bit 8. Set/cleared by hard- (0,1)-8 bit VART, variable data rate.
ware to determine state of ninth data (1,0)-9 bit VART, fixed data rate.
bit transmitted in 9-bit UART mode. (1,1)-9 bit VART, variable data rate.
These peripheral functions allow special hardware to background task long enough to handle the appropriate
monitor real-time signal interfacing without bothering device, then return to the point where it left off.
the CPU. For example, imagine serial data is arriying from This is the basis of the third and generally optimal solu-
one CRT while being transmitted to another, and one tion, hardware interrupts. The 8051 has five interrupt
timer/counter is tallying high-speed input transitions sources: one from the serial port when a transmission or
while the other measures input pulse widths. During all reception is complete, two from the timers when over-
of this the CPU is thinking about something else. flows occur, and two from input pins INTO and INTI.
But how does the CPU know when a reception, transmis- Each source may be independently enabled or disabled
sion, count, or pulse is finished? The 8051 programmer to allow polling on some sources or at some times, and
can choose from three approaches. each may be. classified as high or low priority. A high
priority source can interrupt a low priority service
TCON and SCON contain status bits set by the hardware routine; the manager's boss can interrupt conferences
when a timer overflows or a serial port operation is com- with subordinates. These options are selected by the inter-
pleted. The first technique reads the control register into rupt enable and priority control registers, IE and IP
the accumulator, tests the appropriate bit, and does a (Figures 10 and II).
conditional branch based on the result. This "polling"
Each source has a particular program memory address
scheme (typically a three-instruction sequence though
associated with it (Table 3), starting at 0003H (as in the
additional instructions to save and restore the accu-
8048) and continuing at eight-byte intervals. When an
mulator may sometimes be needed) will surely be
event enabled for interrupts occurs the CPU automatically
familiar to programmers used to multi-chip microcom-
executes an internal subroutine call to the corresponding
puter systems and peripheral controller chips. This
process is rather cumbersome, especially when monitoring address. A user 'subroutine starting at this location (or
jumped to from this location) then performs the instruc-
multiple peripherals.
tions to service that particular source. After completing
As a second approach, the 8051 can perform conditional a the interrupt service routine, execution returns to the
branch based on the state of any control or status bit or background program.
input pin in a single instruction; a four instruction
sequence could poll the four simultaneous happenings Table 3. 8051 Interrupt Sources and Service Vectors
mentioned above in just eight microseconds.
Interrupt Service Routine
Unfortunately, the CPU must still drop what it's doing Source Starting Address
to test these bits. A manager cannot do his own work
(Reset) OOOOH
well if he is continuously monitoring his subordinates; External 0 0OO3H
they should interrupt him (or her) only when they need Timer/ Counter 0 OOOBH
attention or guidance. So it is with machines: ideally, the External I OOl3H
CPU would not have to worry about the peripherals until Timer/ Counter I OOIBH
Serial Port 0023H
they require servicing. At that time, it would postpone the
AFN01502A
8-12
APPLICATIONS
(MSB) (LSB)
Symbol Position Name and Significance Symbol Position Name and Significance
EA IE.7 Enable All control bit. Cleared by EXI IE.2 Enable External interrupt I control bit.
software to disable all interrupts, Set/cleared by software to enable/
independent of the state of IEA-IE.O. disable interrupts from INTI.
(MSB) (LSB)
Symbol Position Name and Significance Symbol Position Name and Significance
IP.7 (reserved) PX I IP.2 External interrupt I Priority control
IP.6 (reserved) bit. Set/cleared by software to specify
IP.5 (reserved) high/ low priority interrupts for INTI.
PS IPA Serial port Priority control bit. PTO IP.I Timer 0 Priority control bit.
Set/cleared by software to specify Set/cleared by software to specify
high/ low priority interrupts for Serial high/low priority interrupts for
port. timer/counter O.
PTI IP.3 Timer I Priority control bit. PXO IP.O External interrupt 0 Priority control
Set/cleared by software to specify bit. Set/cleared by software to specify
highjlow priority interrupts for highjlow priority interrupts for INTO.
timer/counter I.
AFN-01502A
B-13
APPLICATIONS
3. INSTRUCTION SET AND ADDRESSING MODES group, this chapter starts with the addressing mode
The 805 I instruction set is extremely regular, in the sense classes and builds to include the related instructions.
that most instructions can operate with variables from
several different physical or logical address spaces. Before Data Addressing Modes
getting deeply enmeshed in the instruction set proper, it MCS-51 assembly language instructions consist of an
is important to understand the details of the most operation mnemonic and zero to three operands separated
common data addressing modes. Whereas Table 4 sum- by commas. In two operand instructions the destination
marizes the instructions set broken down by functional is. specified first, then the source. Many byte-wide data
AFN-01502A
8-14
APPLICATIONS
operations (such as ADD or MOY) inherently use the hardware reset enables register bank 0; to select a
accumulator as a source operand and/or to receive the different bank the programmer modifies PSW bits 4 and
result. For the sake of clarity the letter "A" is specified in 3 accordingly.
the source or destination field in all such instructions.
Example 2 - Selecting Alternate Memory Banks
For example, the instruction,
MOV PSW.II00010000B SELECT BANK 2
ADD A,<source>
will add the variable<source>to the accumulator, leaving Register addressing in the 8051 is the same as in the 8048
the sum in the accumulator. family, with two enhancements: there are four banks
rather than one or two, and 16 instructions (rather than
The operand designated '~source>" above may use any
12) can access them.
of four common logical addressing modes:
Register-one of the working registers in the cur-
rently enabled bank. Direct Byte Addressing
Direct-an internal RAM location, I/O port, or Direct addressing can access anyon-chip variable or
special-function register. hardware register. An additional byte appended to the
Register-indirect-an internal RAM location, opcode specifies the location to be used (Figure 12.b).
pointed to by a working register.
Depending on the highest order bit of the direct address
Immediate data-an eight-bit constant incorporated
byte, one of two physical memory spaces is selected.
into the instruction.
When the direct address is between 0 and 127 (00H-7FH)
The first three modes provide access to the internal RAM one of the 128 low-order on-chip RAM locations is used.
and Hardware Register address spaces, and may therefore (Future microcomputers based on the MCS_5ITM archi-
be used as source or destination operands; the last mode tecture may incorporate more than 128 bytes of on-chip
accesses program memory and may be a source operand RAM. Even if this is the case, only the low-order 128
only. bytes will be directly addressable. The remainder would
(It is hard to show a "typical application" of any instruc- be accessed indirectly or via the stack pointer.)
tion without involving instructions not yet described. The Example 3 -Adding RAM Location Contents
following descriptions use only the self-explanatory ADD
and MOY instructions to demonstrate how the four ; DIRADR ADD CONTENTS OF RAM LOCATION 41H
TO CONTENTS OF RAM LOCATION 40H
addressing modes are specified and used. Subsequent DIRADR MOV A,40H
examples will become increasingly complex.) ADD
MOV
A,41H
40H, A
8-15
APPLICATIONS
The 8048 does not have or need any generalized direct Indirect addressing on the 8051 is the same as in the
addressing mode, since there are only five special registers 8048 family, except that all eight bits of the pointer register
(BUS, PI, P2, PSW, & T) rather than twenty. Instead, 16 contents are significant; if the contents point to a non-
special 8048 opcodes control output bits or read or write existent memory location (i.e., an address greater than
each register to the accumulator. These functions are all 7FH on the 8051) the result of the instruction is undefined.
subsumed by four of the 27 direct addressing instructions (Future microcomputers based on the MCS-5I archi-
of the 8051. tecture could implement additional memory in the
on-chip RAM logical address space at locations above
Table 5. 8051 Hardware Register Direct Addresses 7FH.) The 8051 uses register-indirect addressing for five
new instructions plus the 13 on the 8048.
Register Address Function
PO 80H* Port 0
SP 81H Stack Pointer
Immediate AddreSSing
DPL 82H Data Pointer (Low) When a source operand is a constant rather than a vari-
DPH 83H Data Pointer (High) able (i.e.-the instruction uses a value known at assembly
TCON 88H* Timer register
TMOD 89H Timer Mode register time), then the constant can be incorporated into the
TLO 8AH Timer 0 Low byte instruction. An additional instruction byte specifies the
TLI 8BH Timer I Low byte value used (Figure l2.d).
THO 8CH Timer 0 High byte
THI 8DH Timer I High byte The value used is fixed at the time of ROM manufacture
PI 90H* Port I or EPROM programming and may not be altered during
SCON 98H* Serial Port Control register program execution. In the assembly language immediate
SBUF 99H Serial Port data Buffer operands are preceded by a number sign ("#"). The
P2 OAOH* Port 2
operand may be either a numeric string, a symbolic
IE OA8H* Interrupt Enable register
P3 OBOH* Port 3 variable, or an arithmetic expression using constants.
IP OB8H* Interrupt Priority register
PSW ODOH* Program Status Word Example 6-Adding Constants Using Immediate
ACe OEOH* Accumulator (direct address) Addressing
B OFOH* B register i IMMADR ADD THE CONSTANT 12 (DECIMAL)
TO THE CONSTANT 34 (DECIMAL)
LEAVE SUM IN ACCUMULATOR
= bit addressable register.
IMMADR MOV A.1I12
ADD A.1I34
operand addresses are fixed at assembly time. ASMSUM: MOV A. II( 12+34)
Addressing Mode Combinations. Notice from Table 4 that the MCS-SITM instruction set has
relatively few instruction mnemonics (abbreviations) for
The above examples all demonstrated the use of the four
the programmer to memorize. Different data types or
data-addressing modes in two-operand instructions
addressing modes are determined by the operands
(MOV, ADD) which use the accumulator as one
specified, rather than variations on the mnemonic. For
operand. The operations ADDC, SUBB, ANL, ORL,
example, the mnemonic "MOV" is used by 18 different
and XRL (all to be discussed later) could be substituted
instructions to operate on three data types (bit, byte, and
for ADD in each example. The first three modes may be
address). The fifteen versions which move byte variables
also be used for the XCH operation or, in combination
between the logical address spaces are diagrammed in
with the Immediate Addressing mode (and an additional
Figure 13. Each arrow shows the direction of transfer
byte), loaded with a constant. The one-operand
from source to destination.
instructions INC and DEC, DJNZ, and C~NE may all
operate on the accumulator, or may specify the Register, Notice also that for most instructions allowing register
Direct, and Register-indirect addressing modes. addressing there is a corresponding direct addressing
Exception: as in the 8048, DJNZ cannot use the instruction and vice versa. This lets the programmer
accumulator or indirect addressing. (The PUSH and begin writing 80S I programs as if (s)he has access to 128
PO P operations cannot inherently address the different registers. When the program has evolved to the
accumulator as a special register either. However, all point where the programmer has a fairly accurate idea
three can directzv address the accumulator as one of the how often each variable is used, he / she may allocate th'e
twenty special-function registers by putting the symbol working registers in each bank to the most "popular"
"ACe" in the operand field.) variables. (The assembly cross-reference option will show
exactly how often- and where each symbol is referenced.)
If symbolic addressing is used in writing the source
Advantages of Symbolic Addressing program only the lines containing the symbol definition
Like most assembly or higher-level programming will need to be changed; the assembler will produce the
languages, ASMSI allows instructions or variables to be appropriate instructions even though the rest of the
given appropriate, user-defined symbolic names. This is program is left untouched. Editing only the first two lines
done for instruction lines by putting a label followed by a of Example 8 will shrink the six-byte code segment
colon (":") before the instruction proper, as in the above produced in half.
examples. Such symbols must start with an alphabetic
character (remember what distinguished BACH from How are instruction sets "counted"? There is
OBACH?), and may include any combination of letters, no standard practice; different people assess-
numbers, question marks ("T) and underscores ("_"). For ing the same CPU using differentconventions
very long names only the first 31 characters are relevant. may arrive at different totals.
Assembly language programs may intermix upper- and Each operation is then broken down according
lower-case letters arbitrarily, but AS M SI converts both to the different addressing modes (or com-
to upper-case. For example, ASMSI will internally binations of addressing modes) it can accom-
process an "I" for an "i" and, of course, "A_TOOTH" for modate. The "CLR" mnemonic is used by two
"a_tooth." instructions with respect to bit variables ("CLR
The underscore character makes symbols easier to read C" and "CLR bit") and once ("CLR A") with
and can eliminate potential ambiguity (as in the label for regards to bytes. This expansion yields the 111
a subroutine to switch two entires on a stack, separate instructions of Table 4.
"S_EXCHANGE"). The underscore is significant, and The method used for the MCS-51 instruction
would distinguish between otherwise-identical character set first breaks it down into "operations": a
strings. basic function applied to a single data type. For
AS M 51 allows all variables (registers, ports, internal or example, the four versions of the ADD instruc-
external RA M add resses, constants, etc;) to be assigned tion are grouped to form one operation -
labels according to these rules with the EQUate or SET addition of eight-bit variables. The six forms of
directives. the ANL instruction for byte variables make up
a different operation; the two forms of ANL
Example 8-Symbolic Addressing of Variables which operate on bits are considered still
Defined as RAM Locations another. The MOV mnemonic is used by three
VAR 0 SET 20H
VAR=I SET 21H different operation classes, depending on
i SYt1B_I ADD CONTENTS OF VAR I whether bit, byte; or 16-bit values are affected.
TO CONTENTS OF VAR. O'
Using this terminology the 8051 can perform
SYMB_I' MOV
ADD
A. VAR
A. VAR=I 51 different operations.
MOV VAR_O. A
AFN-01502A
B-17
APPLICATIONS
The SUBB (subtract with borrow) instruction subtracts SUBSTR' CL.R C ; BORROW= O.
SUBSl : MOV A.IRO
the byte variable indicated and the contents of the carry SUBB A. IR 1 ; SUBTRACT NEXT PL.ACE
MOV @RO.A
flag together from the accumulator, and puts the result INC RO ; BUMP POINTERS
INC Rl
back in the accumulator. The carry flag serves as a OJNZ R2. SUBSI ; L.OOP AS NEEDED
WHEN DONE. TEST IF OVERFLOW OCCURED
"Borrow Required" flag during subtraction operations; ON LAST ITERATION OF LOOP
JNB OV.OV OK
when a greater value is subtracted from a lesser value (as ; - (OVERFLOW RECOVERY ROUTINE>
OV_OK: RET ; RETURN
in subtracting 5 from I) requiring a borrow into the
highest order bit, the carry flag is set; otherwise it is
cleared.
Decimal addition is possible by using the DA instruction
When performing signed binary arithmetic, certain in conjunction with ADD and/or ADDC. The eight-bit
combinations of input variables can produce results binary value in the accumulator resulting from an earlier
which seem to violate the Laws of Mathematics. For addition of two variables (each a packed BCD digit-pair)
example, adding 7FH (127) to itself produces a sum of is adjusted to form two BCD digits of four bits each. If the
OFEH, which is the two's complement representation of contents of accumulator bits 3-0 are greater than nine
-2 (refer back to Table 2)! In "normal" arithmetic, two (xxxx 10 IO-xxxx 1111), or ifthe AC flag had been set, six
.positive values can't have a negative sum. Similarly, it js is added to the accumulator producing the proper BCD
normally impossible to subtract a positive value from a digit in the low-order nibble. (This addition might itself
negative value and leave a positive result - but in two's set - but would not clear - the carry flag.) Ifthe carry
complement there are instances where this too may flag is set, or if the four high-order bits now exceed nine
happen. Fundamentally, such anomolies occur when the (10 IOxxxx-IIII xxxx), these bits are incremented by six.
magnitude of the resulting value is too great to "fit" into The carry flag is left set if originally set or if either
the seven bits allowed for it; there is no one-byte two's addition of six produces a carry out of the highest-order
complement representation for 254, the true sum of 127 bit, indicating the sum of the original two BCD variables
and 127. is greater than or equal to decimal 100.
AFN-01S02A
R.1A
APPLICATIONS
Example II - Two Byte Decimal Add with Registers digits in the accumulator and returns the product of the
and Constants two individual digits in packed BCD format in the
; BCDADD ADD THE CONSTANT 1.234 (DECIMAl) TO THE accumulator.
CONTENTS OF REGISTER PAIR ':R3><R2>
(ALREADY A 4 BCD-DIGIT VARIABLE)
Example 13 -Implementing a BCD Multiply Using
BCDADD MOV A. R2
ADD A.4I34H MPYand DIV
DA A
MOV R2. A ; MULBCD UNPACK TWO BCD DIGITS RECEIVED IN ACC.
MOV A. R3 FIND THEIR PRODUCT. AND RETURN PRODUCT
ADDC A.4I12H IN PACKED BCD FORMAT IN ACC
DA A
MOV R3. A MULBCD' MOV B.III0H; DIVIDE INPUT 8Y 16
RET DIV AB ; A 8< B HOLD SEPARATED IiIGITS
; (EACH RIGHT JUSTIFIED IN REGISTER)
MUL ; A HOLDS PRODUCT IN BINARY FORMAT (0 -
; 99(DECIMAU = 0 - 63H)
MOV B.III0; DIVIDE PRODUCT BY 10
Multiplication and Division DIV
SWAP
AB
A
; A HOLDS II OF TENS. B HOLDS REMAINDER
the data by 16, leaving the high-nibble in the accumulator ANL P1. #data
In this example, low-order bits remaining high may destination at run-time by adding the signed eight-bit
"glitch" low for one machine cycle. If this is undesirabh:, dispiacemeni vaiue io ihe incremented P.c. Negative
use a slightly different approach. First, set all pins offset values will cause jumps up to 128 bytes backwards;
corresponding to accumulator one bits, then clear the positive values up to 127 bytes forwards. (SJ M P with
pins corresponding to zeroes in low-order accumulator OOH in the machine code offset byte will proceed with the
bits. Not all bits will change from original to final state at following instruction).
the same instant, but no bit makes an intermediate
transition. In keeping with the 8051 assembly language goal of
minimizing the number of instruction mnemonics, there
Example 15 - Reconfiguring I/O Port Size without is a "generic" form of the three jump instructions.
Glitching ASM51 recognizes the mnemonic JMP as a "pseudo-
ALT]X' ORL PI. A instruction," translating it into the machine instructions
ORL A 111000008
ANL PI. A LJMP, AJMP, or SJMP, depending on the destination
RET
address.
Operate-and-branch instructions - CJNE, DJNZ The dollar sign in this example is a special character
Two groups of instructions combine a byte operation meaning "the address of this instruction." It is useful in
with a conditional jump based on the results. eliminating instruction labels on the same or adjacent
source lines. CJNE and DJNZ (like all conditional
CJNE (Compare and Jump if Not Equal) compares two
jumps) use program-counter relative addressing for the
byte operands and executes a jump if they disagree. The
destination address.
carry flag is set following the rules for subtraction: if the
unsigned integer value of the first operand is less than
Stack Operations - PUSH, POP
that of the second it is set; otherwise, it is cleared.
However, neither operand is modified. The PUSH instruction increments the stack pointer by
one, then transfers the contents of the single byte variable
The CJNE instruction provides, in effect, a one-
indicated (direct addressing only) into the internal RAM
instruction "case" statement. This instruction may be
location addressed by the stack pointer. Conversely,
executed repeatedly, comparing the code variable to a list
POP copies the contents of the internal RAM location
of "special case" value: the code segment following the
addressed by the stack pointer to the byte variable
instruction (up to the destination label) will be executed
indicated, then decrements the stack pointer by one.
only if the operands match. Comparing the accumulator
or a register to a series of constants is a convenient way to (Stack Addressing follows the same rules, and addresses
check for special handling or error conditions; if none of the same locations as Register-indirect. Future micro-
the cases match the program will continue with "normal" computers based on the MCS-5ITM CPU could have up to
processing. 256 bytes of RA M for the stack.)
A typical example might be a word processing device Interrupt service routines must not change any variable
which receives ASCII characters through the serial port or hardware registers modified by the main program, or
and drives a thermal hard-copy printer. A standard else the program may not resume correctly. (Such a
routine translates "printing" characters to bit patterns, change might look like a spontaneous random error.)
but control characters DEL>, <CR>, <LF>, <BEL>, Resources used or altered by the service routine
<ESC>, or<SP must invoke corresponding special (Accumulator, PSW, etc.) must be saved and restored to
routines. Any other character with an ASCII code less their previous value before returning from the service
than 20H should be translated into the<NUL>value, routine. PUSH and POP provide an efficient and
OOH, and processed with the printing characters. convenient way to save register states on the stack.
Example 16-Case Statements Using CJNE Example 18 - Use of the Stack for Status Saving on
CHAR
;
E<lU R7 ; CHARACTER CODE VAR IABLE Interrupts
INTERP' CJNE CHAR, 117FH, INTP 1 LoC_TMP E<lU ; REMEMBER LoCAT I ON COUNTER
(SPECIAL ROUTINE FOR RUBOUT CODE)
RET oRG 0003H ; STARTING ADDRESS FOR INTERRUPT ROUTINE
INTP I CJNE CHAR, 1I07H, INTP 2 LJMP SERVER ; JUMP TO ACTUAL SERVICE ROUTINE LOCATED
- (SPEC I AL RoUTI NE FOR BELL CODE) ; ELSEWHERE
RET
INTP _2' CJNE CHAR, IIOAH, INTP 3 oRG LoC TMP ; RESTORE LoCAT ION COUNTER
(SPECIAL ROUTINE FOR LFEED CODE) SERVER PUSH PSW-
RET PUSH ACC ; SAVE ACCUMULATOR (NOTE DIRECT ADDRESSING
INTP _3: CJNE CHAR, IIODH, INTP 4 ; NOTATION)
(SPEC IAL ROUTINE FOR RETURN CODE) PUSH B ; SAVE B REGISTER
RET PUSH DPL ; SAVE DATA POINTER
INTP 4 CJNE CHAR, IIIBH, INTP ~ PUSH DPH ,
- (SPECIAL ROUTINE FOR ESCAPE CODE) MoV PSW, 110000 I OOOB SELEC T REG I STER BANK I
RET
INTP
-~ CJNE CHAR, 1120H, INTP 6
(SPECIAL ROUTINE FOR SPACE CODE) PDP DPH RESTORE REGISTERS IN REVERSE ORDER
RET PDP DPL
INTP _6' Jr. PRINTC ; JUMP IF CODE )0 20H PDP B
MoV CHAR. 110 ; REPLACE CONTROL CHARACTERS WITH PDP ACC
; NULL CODE PDP PSW ; RESTORE PSW AND RE-SELECT OR IGINAL
PRINTC ; PROCESS STANDARD PRINTING ; REG I STER BANK
; CHARACTER RETI ; RETURN TO MAIN PROGRAM AND RESTORE
RET ; INTERRUPT LOGIC
DJNZ (Decrement and Jump if Not Zero) decrements If the SP register held I FH when the interrupt was
the register or direct address indicated and jumps if the detected, then while the service routine was in progress
result is not zero, without affecting any flags. This the stack would hold the registers shown in Figure 16; SP
provides a simple means for executing a program loop a would contain 26H.
given number of times, or for adding a moderate time The example shows the most general situation; if the
delay (from 2 to 512 machine cycles) with a single service routine doesn't alter the B-register and data
instruction. For example, a 99-usec. software delay loop
pointer, for example, the instructions saving and
can be added to code forcing an I I 0 pin low with only restoring those registers would not be necessary.
two instructions.
The stack may also pass parameters to and from
Example 17 -Inserting a Software Delay with DJNZ subroutines. The subroutine can indirectly address the
CLR WR
MOV R2,1I49 parameters derived from the contents of the stack
DJNZ R2, S
SETB WR pointer.
AFN-01502A
8-21
APPLICATIONS
20H PC (LOW)
lFH
Data Pointer and Table look-up instructions -
MOV, INC, MOVC, JMP
OOH
The data pointer can be loaded with a 16-bit value using
the instruction MOV DPTR, #dataI6. The data used is
Figure 16. Stack contents during interrupt stored in the second and third instruction bytes, high-
order byte first. The data pointer is incremented by INC
DPTR. A 16-bit increment is performed; an overflow
One advantage here is simplicity. Variables need not be
from the low byte will carry into the high-order byte.
allocated for specific parameters, a potentially large
Neither instruction affects any flags.
number of parameters may be passed, and different
calling programs may use different techniques for The MOVC (Move Constant) instructions (MOVC
determining or handling the variables. A,@A+DPTR and MOVC A,@A+PC) read into the
For example, the following subroutine reads out a accumulator bytes of data from the program memory
parameter stored on the stack by the calling program, logical address space. Both use a form of indexed
uses the low order bits to access a local look-up table addressing: the former adds the unsigned eight-bit
holding bit patterns for driving the coils of a four phase accumulator contents with the sixteen-bit data pointer
stepper motor, and stores the appropriate bit pattern register, and uses the resulting sum as the address from
back in the same position on the stack before returning. which the byte is fetched. A sixteen-bit addition is
The accumulator contents are left unchanged. performed; a carry-out from the low-order eight bits may
propagate through higher-order bits, but the contents of
Example 19 - Passing Variable Parameters to Sub- the DPTR are not altered. The latter form uses the incre-
routines Using the Stack mented program counter as the "base" value instead of
NXTPOS MOV RO. SP the D PTR (figure 17). Again, neither version affects the
DEC RO ; ACCESS LOCATION PARAMETER PUSHED INTO
DEC RO flags.
XCH A. @RO ; READ I NPUT PARAMETER AND SAVE
; ACCUMULATOR
ANL A. 1I03H; MASK ALL BUT LO~-ORDER T~O BITS
ADD A. 112 ; ALLD~ FOR OFFSET FROM MoVC TO TABLE
MOVC
XCH
A.
A.
@A+PC
@RO
; READ LOOK-UP TABLE ENTRY
; PASS 8ACK TRANSLATED VALUE AND RESTORE
a.) MOVC A. @ A + PC
(LOCAL TABLE IS-BIT I P.C.
; ACC LOOK-UP)
STPTBL
RET
DB
; RETURN TO BACKGROUND PROGRAM
01101 I liB ; POSITION 0
~ACC
DB 0101 I 1118 ; POSITION 1
DB 100111118 POSITION 2
DB 10101111B ; POSITION 3
L -_ _ _l_6_-_B_
IT....J1 ~~~g~I~~RESS
The background program may reach this subroutine with
several different calling sequences, all of which PUSH a
b.) MOVC A.@ A+ DPTR
(GLOBAL TABLE
lS-BIT I DPTR
LOOK-UP)
value before calling the routine and POP the result after. ~ACC
A motor on Port I may be initialized by placing the
desired position (zero) on the stack before calling the L -_ _ _l_6_-_B_IT...j1 ~~~g~~~RESS
subroutine and outputing the results directly to a port
afterwards. c.) JMP @ A+ DPTR
(GLOBAL INDIRECT lS-BIT I DPTR
JUMP)
Example 20-Sending and Receiving Data Parameters ~ACC
Via the Stack
'--_ _ _l_S_-_B_IT...IILOADED INTO P.C.
CLR A
PUSH ACC
CALL NXTPOS
POP PI Figure 17. Operation of MOVC instructions
AFN-01502A
8-22
APPLICATIONS
Each can be part of a three step sequence to access look- There are several different means for branching to
up tables in ROM. To use the DPTR-relative version, sections of code determined or selected at run time. (The
load the Data Pointer with the starting address of a look- single destination addresses incorporated into
up table; load the accumulator with (or compute) the conditional and unconditional jumps are, of course,
index of the entry desired; and execute MOVC determined at assembly time). Each has advantages for
A,@A+DPTR. Unlike the similar MOVP3 instructions different applications.
in the 8048, the table may be located anywhere in The most common is an N-way conditional jump based
program memory. The data pointer may be loaded with a on some variable, with all of the potential destinations
constant for short tables. Or to allow more complicated known at assembly time. One of a number of small
data structures, or tables with more than 256 entries, the
routines is selected according to the value of an index
values for DPH and DPL may be computed or modified
variable determined while the program is running. The
with the standard arithmetic instruction set.
most efficient way to solve this problem is with the
The PC-relative version has the advantage of not MOVC and an indirect jump instruction, using a short
affecting the data pointer. Again, a look-up sequence table of one byte offset values in ROM to indicate the
takes three steps: load the accumulator with the index; relative starting addresses of the several routines.
compensate for the offset from the look-up instruction to
the start of the table by adding the number of bytes JMP @A+DPTR is an instruction which performs an
separating them to the accumulator; then execute the indirect jump to an address determined during program
MOVC A,@A+PC instruction. execution. The instruction adds the eight-bit unsigned
accumulator contents with the contents of the sixteen-bit
Let's look at a non-trivial situation where this instruction data pointer, just like MOVC A,@A+DPTR. The
would be used. Some applications store large multi- resulting sum is loaded into the program counter and is
dimensional look-up tables of dot matrix patterns, non- used as the address for subsequent instruction fetches.
linear calibration parameters, and so on in a linear (one- Again, a sixteen-bit addition is performed; a carry out
dimensional i) vector in program memory. To retrieve from the low-order eight bits may propagate through the
data from the tables, variables representing matrix higher-order bits. In this case, neither the accumulator
indices must be converted to the desired entry's memory contents nor the data pointer is altered.
address. For a matrix of dimensions (MDIMEN x
NDIMEN) starting at address BASE and respective The example subroutine below reads a byte of RAM into
indices INDEXI and INDEXJ, the address of element the accumulator from one of four alternate address
(lNDEXI, INDEXJ) is determined by the formula, spaces, as selected by the contents of the variable
MEMSEL. The address of the byte to be read is
Entry Address = BASE + (NDIMEN x INDEXI) +
determined by the contents of RO (and optionally R I). It
INDEXJ
might find use in a printing terminal application, where
The code shown below can access any array with less than
four different model printers all use the same ROM code
255 entries (i.e., an II x21 array with 231 elements). The
but use different types and sizes of buffer memory for
table entries are defined using the Data Byte ("DB")
different speeds and options.
dire~tive, and will be contained in the assembly object
code as part of the accessing subroutine itself. Example 23 -N-Way Branch and Computed Jump
Example 22 - Use of MPY and Data Pointer Instruc- Instructions via JMP @ ADPTR
tions to Access Entries from a Multi- MEMSEL EQU R3
8-23
APPLICATIONS
For applications where up to 128 destinations mustbe Prior to the introduction of the MCS-5I'M family, nice
selected, all of which reside in the same 2K pagt: of number-crunchers made bad bit-bangers and vice versa.
program memory which may be reached by the two-byte The 8051 is the industry's first single-chip' micro-
absolute jump instructions, the following technique may computer designed to crunch and bang. (In some circles,
be used. In the above mentioned printing terminal the latter technique is also referred to as "bit-twiddling".
example, this sequence could "parse" 128 different codes Either is correct.)
for ASCII characters arriving via the 8051 serial port.
Direct Bit AddreSSing
Example 24~N-Way Branch with 128 Optional
Destinations A number of instruction~ operate on Boolean (one-bit)
variables, using a direct bit addressing mode comparable
OPTION EQU R3
to direct byte addressing. An additional byte appended to
JMP 128 MDV A. OPTION the opcode specifies the Boolean variable, I/O pin, or
RL A i MULTIPLY BY 2 FOR 2 BYTE JUMP TAIiLE
MDV DPTR.IIINSTBL FIRST ENTRY IN JUMP TABI.E control bit used. The state of any of these bits may be
JMP @A+DPTR JUMP INTO JUMP TABLE
tested for "true" or "false" with the conditional branch
, INSTBL AJMP PROCOO i 128 CONSECUTI VE
AJMP PROCOI ; AJMP INSTRUCTIONS instructions JB (Jump on Bit) and JNB (Jump on Not
AJMP PROC02
Bit). The JBC (Jump on Bit and Clear) instruction
AJMP PROC7E combines a test-for-true with an unconditional clear.
AJMP PROC7F
The destinations in the jump table (PROCOO- As in direct byte addressing, bit 7 of the address byte
PROC7F) are not all necessarily unique routines. A large switches between two physical address spaces. Values
number of special control codes couldeach be processed between 0 and 127 (00H-7FH) define bits in internal
with their own unique routine, with the remaining RA M locations 20H to 7FH (Figure 18a); address bytes
printing characters all causing a branch to a common between 128 a,nd 255 (80H-OFFH) define bits in the 2 x
routine for entering the character into the output queue. "special-func'tion" register address space (Figure 18b). If
no 2 x "special-function" register corresponds to the
In those rare situations where even 128 options are direct bit address used the result of the instruction is
insufficient, or where the destination routines may cross a
undefined.
2K page boundary, the above approach may be modified
slightly as shown below. Bits so addressed have many wondrous properties. They
may be set, cleared, or complemented with the two byte
Example 25 -256-Way Branch Using Address Look- instructions SETB, CLR, or CPL. Bits may be moved to
Up Tables and from the carry flag with MOV. The logical ANL and
RTEMP EGU R7 ORL functions may be performed between the carry and
.JMP256 MOV
MOV
DPTR.IIADRTBL
A. OPTION
; FIRST ENTRY IN TABLE OF ADDRESSES either the addressed bit or its complement.
CLR C
RLC A MULTIPLY BY 2 FOR 2 BYTE JUMP TABLE
JNC LOWI28
INC DPH Bit Manipulation Instructions - MOV
LOWI28 MOV RTEMP. A ; SAVE ACC FOR HIGH BYTE READ
MOVC A. @A+DPTR ; READ LOW BYTE FROM JUMP TABLE
XCH. A. RTEMP The "MOV" mnemonic can be used to load an
INC A
MOVC A. @A+DPTR ; GET LOW-ORDER BYTE FROM TABLE addressable bit into the carry flag ("MOV C, bit") or to
PUSH ACC
MOV A. RTEMP copy the state of the carry to such a bit ("MOV bit, C").
MOVC A. @A+DPTR ; GET HIGH-ORDER BYTE FROM TABLE
PUSH ACC These instructions are often used for implementing serial
THE TWO ACC PUSHES HAVE PRODUCED
A "RETURN ADDRESS" ON THE STACK WHICH CORRESPONDS I/O algorithms via software or to adapt the standard I/O
TO THE DESIRED STARTING ADDRESS
IT MAY BE REACHED BY POPP ING THE STACK port structure.
INTO THE PC
RET
ADRTBL DW PROCOO ; UP TO 256 CONSECUTIVE DATA It is sometimes desirable to "re-arrange" the order of I/O
DW PROCOI ; WORDS INDICATING STARTING ADDRESSES
pins because of considerations in laying out printed
OW PROCFF
circuit boards. When interfacing the 8051 to an
DUMMY CODE ADDRESS DEFINITIONS NEEDED BY ABOVE immediately adjacent device with "weighted" input pins,
TWO EXAMPLES:
such as keyboard column decoder, the corresponding
PROCOO NOP
PROCOI NOP pins are likely to be not aligned (Figure 19).
PROC02 NOP
PROC7E NOP
PROC7F NOP There is a trade-off in "scrambling" the interconnections
PROCFF NOP
with either interwoven circuit board traces or through
software. This is extremely cumbersome (if not
4. BOOLEAN PROCESSING INSTRUCTIONS impossible) to do with. byte-oriented computer
The commonly accepted terms for tasks at either end of architectures. The 8051'5 unique set of Boolean
the computational vs. control application spectrum are, instructions makes it simple to move individual bits
respectively, "number-crunching" and "bit-banging". between arbitrary locations.
AFN-01502A
8-24
APPLICATIONS
1 I"'
1
.
OFFH
OFOH F7 1 F6 1 F5 1 F41F31F21 F1
1
FO B
2CH 67 66 65 64 63 62 61 60
2BH 5F 5E 50 5C 5B 5A 59 58
2AH 57 56 55 54 53 52 51 50 OB8H - 1 - 1 - 1 BC 1 BB 1 BA 1 B9 B8 IP
1
29H 4F 4E 40 4C 4B 4A 49 48
26H 37 36 35 34 33 32 31 30 OA8H AF I- 1 - 1 AC 1 AB I AA I A9 I A8 IE
25H 2F 2E 20 2C 2B 2A 29 28
24H 27 26 25 24 23 22 21 20 OAOH A7 I A6 I A5 I A4 I A3 I A2 I A1 I AO P2
23H 1F 1E 10 1C 1B 1A 19 18
21H OF OE 00 OC OB OA 09 08
8351 P2.5 A1
8751
P2.4 A2
DECODER
Solving Combinatorial Logic Equations - ANL, ORL
P2.3 A3
8-25
APPLICATIONS
a.) TTL
CR1
Q = (U (V+W) + (X. V) + Z
z
Figure 20 shows the logic diagram for an arbitrary INPUT, OUTPUT, LOAD, STORE, etc., instead of the
function of six variables named U through Z using universal MOV.
standard logic and relay logic symbols. Each is a solution
of the equation,
Q = (U (V + W + (X Y) + Z
(While this equation could be reduced using Karnaugh
Maps or algebraic techniques, that is not the purpose of
this example. Even a minor change to the function
equation would require re-reducing from scratch.)
Most digital computers can solve equations of this type
with standard word-wide logical instructions and
conditional jumps. Still, such software solutions seem
somewhat sloppy because of the many paths through the
program the computation can take.
8-26
APPLICATIONS
Example 27 - Software Solution to Logic Function of These instructions may be "strung together" to simulate a
Figure 20, Using only Byte-Wide Logical multiple input logic gate. When finished, the carry flag
Instructions contains the result, which may be moved directly to the
; BFUNCI SOLVE A RANDOM LOGIC FUNCTION OF 6 destination or output pin. No flow chart is needed - it is
VARIABLES BY LOADING AND MASKING THE APPROPRIATE
BITS IN THE ACCUMULATOR. THEN EXECUTING CONDITIONAL simple to code directly from the logic diagrams in Figure
JUMPS BASED ON ZERO CONDITION
(APPROACH USED BY BYTE-ORIENTED ARCHITECTURES ) 20.
BYTE AND MASK VALUES CORRESPOND TO RESPECTIVE
BYTE ADDRESS AND BIT POS IT I ON
Example 29-Scftware Solution to Logic Function of
OUTBUF EGU 22H ; OUTPUT PIN STATE MAP
;
Figure 20, Using the MCS-5l (TM)
TESTV MOV A. P2
ANL A.IIOOOOOIOOO Unique Logical Instructions on Boolean
JNZ TESTU
MOV A. TCON
Variables
ANL A.IIOOIOOOOOU ; OFUNC3 SOLVE A RANDOM LOGIC FUNCTION OF 6
JZ TEST X VARIABLES USING STRAIGHT-LINE LOGICAL INSTRUCTIONS
TESTU: MOV A. PI ON MCS-51 BOOLEAN VAR I ABLES
ANL A.IIOOOOO0100
JNZ SETG MOV C. V
TESTX: MOV A. TCON ORL C. W ; OUTPUT OF OR GATE
ANL A.IIOOOOIOOOO ANL C. U i OUTPUT OF TOP AND GATE
JZ TESTZ MOV FO. C i SAVE INTERMEDIATE STATE
MOV A.20H MOV C. X
ANL A.IIOOOOOOOIO ANL C./Y i OUTPUT OF BOTTOM AND GATE
JZ SETG ORL C. FO i I NCLUDE VALUE SAVED ABOVE
TESTZ: MOV A.2IH ORL C./Z i INCLUDE LAST INPUT VARIABLE
ANL A. 11000000100 MOV G. C i OUTPUT COMPUTED RESULT
JZ SETG
CLRG MOV A.OUTBUF
ANL A.llllll01110
JMP OUTG Simplicity itself. Fast, flexible, reliable, easy to design,
SETG MOV A.OUTOUF
ORL A.IIOOO010000 and easy to debug.
OUTG MOV OUTBUF. A
MOV P3. A
The Boolean features are useful and unique enough to
Cumbersome, to say the least, and error pron_ ,t would warrant a complete Application Note of their own.
be hard to prove the above example worked. ,11 cases Additional uses and ideas are presented in Application
without an exhaustive test. Note AP-70, Using the Intel MCS-Sl Boolean
Processing Capabilities, publication number 121519.
Each move/mask/conditional jump instruction
sequence may be replaced by a single bit-test instruction
thanks to direct bit addressing. But the algorithm would 5. ON-CHIP PERIPHERAL FUNCTION
be equally convoluted. OPERATION AND INTERFACING
BIT PI. 1
BIT P2.2 READ/MODIFY/
BIT TFO WRITE
BIT lEI
OIT 20H.0
OIT 21H. I
OIT P3.3
+5V +5V
TEST _v JO v. TEST_U
JNB W. TEST X
TEST_U JB U. SET 0
TEST_X' JNB x. TEST Z Q
JNB Y. SET_O INTERNAL
TEST _z JNB z. SET_G D
CLR - G' CLR G
BUS
JMP NXTTST
SET G SETB G D
NXTTST ; (CONTINUATION OF PROGRAM) FLIP
FLOP
8-27
APPLICATIONS
essentially open-collector outputs, For full electrical Example 30 - Mixing Parallel Output, Input, and
characteristics see the User's Manual.) Control Strobes on Port 2
; IN8243 INPUT DI\TA FROM AN 8243 I' 10 EXPANDER
CoNNECTElJ TO P23-P20
An output latch bit associated with each pin is updated by P25 ~{ P24 MIMIC CS
A
~: PROG
,/
destination. The latch state is buffered to the outside IN8243 ORI,. 1\, III l010000B
M(lV P;l. A ; OUTPUT INSTRUCTION CODE
world by R I and Q I, which may drive a standard TTL CLR p;, 4 ; FALLING EDGE OF PROG
orlL P2.1100001111B ; SET FOR INPUT
input., (In TTL terms, Q I and R I resemble an open- ~IOV (~, P2 ,READ INPUT DATA
SETH p;~ 4 RETURN PROG HIGH
collector output with a pull-up resistor to Vcc.) SETB P:1 5 ; DE-SELECT CHIP
R2 and Q2 represent an "active pull-up" device enabled Serial Port and Timer applications
momentarily when a 0 previously output changes to a I. Configuring the 8051's Serial Port for a given data rate
This "jerks" the output pin to a I level more quickly than and protocol requires essentially three short sections of
the passive pull-up, improving rise-time significantly if
software. On power-up or hardware reset the serial port
the pin is driving a capacitive load. Note that the active
and timer control words must be initialized to the
pull-up is only activated on O-to-I transitions at the
appropriate values. Additional software is also needed in
output latch (unlike the 8048, in which Q2 is activated
the transmit routine to load the serial port data register
whenever a I is written out).
and in the receive routine to unload the data as it arrives.
Operations using an input port or pin as the source This is best illustrated through an arbitrary example.
operand use the logic level ofthe pin itself, rather than the Assume the 8051 will communicate with a CRT
output latch contents. This level is affected by both the operating at 2400 baud (bits per second). Each character
microcomputer itself and whatever device the pin is is transmitted as seven data bits, odd parity, and one stop
connected to externally. The value read is essentially the bit. This results in a character rate of 2400/ 10=240
"0 R-tied" function of Q I and the external device. If the characters per second.
external device is high-impedence, such as a logic gate For the sake of clarity, the transmit and receive
input or a three state output in the third state, then subroutines are driven by simple-minded software status
reading a pin will reflect the logic level previously output. polling code rather than interrupts. (It might help to refer
To use a pin for input, the corresponding output latch back to Figures 7-9 showing the control word formats.)
must be set. The external device may then drive the pin The serial port must be initialized to 8-bit UART mode
with either a high or low logic signal. Thus the same port (MO, M 1=01), enabled to receive all messages (M2=0,
may be used as both input and output by writing ones to REN= I). The flag indicating that the transmit register is
all pins used as inputs on output operations, and ignoring free for more data will be artificially set in order to let the
all pins used as output on an input operation. output software know the output register is available.
This can all be set up with one instruction.
In one operand instructions (INC, DEC, DJNZ and the
Boolean CPL) the output latch rather than the input pin Example 31 - Serial Port Mode and Control Bits
level is used as the source data. Similarly, two operand ; SPINIT INITIALIZE SERIAL PORT
FOR 8-B IT UART MODE
instructions using the port as both one source and the 8< SET TRANSMIT READY FLAG
destination (ANL, ORL, XRL) use the output latches. SPINIT: MOil SCON.1I01010010B
B-28
APPLICATIONS
AFN-01S02A
8-29
,
;111
1. INTRODUCTION The CPU in each microcomputer is one of the industry's
The Intel microcontroller family now has three new fastest and most efficient for numerical calculations on
me~bers - the lntel 8031, 8051, and 8751 single-chip
byte operands. But controllers often deal with bits, not
microcomputers. These devices, shown in Figure I, will bytes: in the real world, switch contacts can only be open
allow whole new classes of products to benefit from recent or closed, indicators should be either lit or dark, motors
advances in Integrated Electronics. Thanks to Intel's new are either turned on or off, and so forth. For such control
H MOS technology, they provide larger program and situations the most significant aspect of the M CS-5 pM
data memory spaces, more flexible 110 and peripheral architecture is its complete hardware support for one-bit,
capabilities, greater speed, and lower system cost than any or Boolean variables (named in honor of Mathematician
previous-generation single-chip microcomputer. George Boole) as a separate data type.
- PO.4
bit-processing capabilities alone would be adequate to
- po.s solve many control applications, their true power comes
- PO.6 when they are used in conjunction with the microcompu-
- PO.7 ter's byte-processing and numerical capabilities.
- VDD/EA
- P2.4
assumed the reader has read Application Note AP-69, An
- P2.3
Introduction to the Intel MCS-SrM Single-Chip Micro-
computer Family, publication number 121518, or has
- P2.1 been exposed to Intel's single-chip microcomputer pro-
- P2.0 duct lines.
Figure 1. 8051 Family Pinout Diagram. For detailed information on these parts refer to the Intel
MCS-SrM Family User's Manual, publication number
Table 1 summarizes the quantitative differences between 121517. The instruction set, assembly language, and use of
the members of the MCS-48 and 8051 families. The 8751 the 8051 assembler (ASM51) are further described in the
contains 4K bytes of EPROM program memory fabri- MCS-SrM Macro Assembler User's Guide, publication
cated on-chip, while the 8051 replaces the EPROM with number 9800937.
4K bytes of lower-cost mask-programmed ROM. The
8031 has no program memory on-chip; instead, it accesses
up to 64K bytes of program memory from external 2. BOOLEAN PROCESSOR OPERATION
memory. Otherwise, the three new family members are The Boolean Processing capabilities of the 8051 are based
identical. Throughout this Note, the term "8051" will on concepts which have been around for some time. Dig-
represent all members of the 8051 Family, unless specifi- ital computer systems of widely varying designs all have
cally stated otherwise. four functional elements in common (Figure 2):
01489A
C-1
a central processor (CPU) with the control, timing, processors might first re-create Shakespeare's classics
and logic circuits needed to execute stored and this Application Note)! This fact offers little consola-
instructions; tion to product designers who want programs to run as
quickly as possible. By definition, a real-time control algo-
a memory to store the sequence of instructions rithm must proceed quickly enough to meet the preor-
making up a program or algorithm; dained speed constraints of other equipment.
data memory to store variables used by the program; One of the factors determining how long it will take a
and microcomputer to complete a given chore is the number of
instructions it must execute. What makes a given compu-
some means of communicating with the outside ter architecture particularly well-or poorly-suited for a
world. class of problems is how well its instruction set matches
the tasks to be performed. The better the "primative"
operations correspond to the steps taken by the control
algorithm, the lower the number of instructions needed,
and the quicker the program will run. All else being equal,
PROGRAM
a CPU supporting 64-bit arithmetic directly could clearly
L
MEMORY
Processing Elements
The introduction stated that the 8051 's bit-handling capa-
Figure 2. Block Diagram for Abstract Digital bilities alone would be sufficient to solve some control
Computer. applications. Let's see how the four basic elements of a
The CPU usually includes one or more accumulators or digital computer - a CPU with associated registers, pro-
special registers for computing or storing values during gram memory, addressable data RAM, and I/O capabil-
program execution. The instruction set of such a proces- ity - relate to Boolean variables.
sor generally includes, at a minimum, operation classes to
perform arithmetic or logical functions on program vari- cpu. The 8051 CPU incorporates special logic devoted to
ables, move variables from one place to another, cause executing several bit-wide operations. All told, there are
program execution to jump or conditionally branch based 17 such instructions, all listed in Table 2. Not shown are 94
on register or variable states, and instructions to call and other (mostly byte-oriented) 8051 instructions.
return from subroutines. The program and data memory
functions sometimes share a single memory space, but this Program Memory. Bit-processing instructions are fetched
is not always the case. When the address spaces are separ- from the same program memory as other arithmetic and
ated, program and data memory need not even have the logical operations. In addition to the instructions of Table
same basic word width. 2, several sophisticated program control features like mul-
tiple addressing modes, subroutine nesting, and a two-
A digital computer's flexibility comes in part from com- level interrupt structure are useful in structuring Boolean
bining simple fast operations to produce more complex Processor-based programs.
(albeit slower) ones, which in turn link together eventually
solving the problem at hand. A four-bit CPU executing Boolean instructions are one, two, or three bytes long,
multiple precision subroutines can, for example, perform depending on what function they perform. Those involv-
64-bit addition and subtraction. The subroutines could in ing only the carry flag have either a single-byte opcode or
turn be building blocks for floating-point mUltiplication an opcode followed by a conditional-branch destination
and division routines. Eventually, the four-bit CPU can byte (Figure 3.a). The more general instructions add a
simulate a far more complex "virtual" machine. "direct address" byte after the opcode to specify the bit
affected, yielding two or three byte encodings (Figure 3.b).
In fact, any digital computer with the above four func- Though this format allows potentially 256 directly addres-
tional elements can (given time) complete any algorithm sable bit locations, not all of them are implemented in the
(though the proverbial room full of chimpanzees at word 8051 family.
01489A
C-2
At"t"LI\,;A IIUN::
Data Memory. The instructions in Figure 3.b can operate Direct Bit Addressing
directly upon 144 general purpose bits forming the Boo- The most significant bit of the direct address byte selects
lean processor "RAM." These bits can be used as sofware one of two groups of bits. Values between 0 and 127 (00 H
flags or to store program variables. Two operand instruc- and 7FH) define bits in a block of 32 bytes of on-chip
tions use the CPU's carry flag ("C") as a special one-bit RAM, between RAM addresses 20H and 2FH (Figure
register; in a sense, the carry is a "Boolean accumulator" 4.a). They are numbered consecutively from the lowest-
for logical operations and data transfers. order byte's lowest-order bit through the highest-order
byte'S highest-order bit.
Input/ Output. All 32 I/O pins can be addressed as indi-
vidual inputs, outputs, or both, in any combination. Any Bit addresses between 128 and 255(80H and OFFH) cor-
pin can be a control strobe output, status (Test) input, or respond to bits in a number of special registers, mostly
serial I/O link implemented via software. An additional used for I/O or peripheral control. These positions are
33 individually addressable bits reconfigure, control, and numbered with a different scheme than RAM: the five
monitor the status of the CPU and all on-chip peripheral high-order address bits match those of the register's own
functions (timer/counters, serial port modes, interrupt address, while the three low-order bits identify the bit
logic, and so forth). position within that register (Figure 4.b).
01489A
C-3
,",r r "'1"''"'1 1"' .... 0.1
OFOH F7 FO B
2FH 7F 7E 70 7C 7B 7A 79 78
20H 6F 6E 60 6C 68 6A 69 68
2BH SF 5E 50 5C 5B SA 59 58
2AH 57 56 55 54 53 52 51 50 OB8H B8 IP
29H 4F 4E 40 4C 4B 4A 49 48
28H 47 46 45 44 43 42 41 40 OBOH B7 BO P3
27H 3F 3E 3D 3C 3B 3A 39 38
26H 37 36 35 34 33 32 31 30 OA8H AF A8 IE
25H 2F 2E 20 2C 2B 2A 29 28
24H 27 26 25 24 23 22 21 20 OAOH A7 AO P2
23H 1F 1E 10 1C 1B 1A 19 18
21H OF OE 00 OC OB OA 09 08
20H 07 06 05 04 03 02 01 00 90H 97 90 P1
1FH
18H Bank 3
17H
88H 8F 88 TCON
10H Bank 2
OFH
08H Bank 1
07H
80H 87 80 PO
Bank 0
00
a.) RAM Bit Addresses. b.) Special Function Register Bit Addresses.
Notice the column labeled "Symbol"in Figure 5. Bits with Figure 7 shows the last four bit addressable registers.
special meanings in the PSW and other registers have TCON (Timer Control) and SCON (Serial port Control)
corresponding symbolic names. General-purpose (as control and monitor the corresponding peripherals, while
opposed to carry-specific) instructions may access the IE (Interrupt Enable) and IP (Interrupt Priority) enable
carry like any other bit by using the mnemonic CY in place and prioritize the five hardware interrupt sources. Like the
of C, PO, PI, P2, and P3 are the 8051 's four I 10 ports; reserved hardware register addresses, the five bits not
secondary functions assigned to each of the eight pins of implemented in I E and I P should not be accessed; they can
P3 are shown in Figure 6. not be used as software flags.
01489A
C-4
At"'t"'LI "'''' I IVI"'~
(MSB) (LSB)
I I I I I I
Cy AC FO RSl RSO OV P
OV PSW.2 Overflow flag.
Symbol Position Name and significance Set/cleared by hardware during
CY PSW.7 Carry flag. arithmetic instructions to indicate
Set/cleared by hardware or soft- overflow conditions.
ware during certain arithmetic and
logical instructions. PSW.1 (reserved)
RS1 PSW.4 Register bank Select control bits (0,0) - Bank 0 (00H-07H)
RSO PSW.3 1 & O. Set/cleared by software to (0,1) - Bank 1 (OBH-OFH)
determine working register bank (1,0) - Bank 2 (10H-17H)
(see Note). (1,1)-Bank3 (1BH-1 FH)
(MSB) (LSB)
I I I T1
RO WR TO IINnllNTO I TXO I I
RXD
C-5
(MSB) (lSB)
(MSB) (lSB)
I I
SMO SMl SM21 I REN ITBBI RBBI TI
Symbol Position Name and significance
SMa SCON.? Serial port Mode control bit O.
RB8 SCON.2 Receive Bit 8.
Set/cleared by software (see
Set/cleared by hardware to indi-
note).
cate state of ninth data bit
received.
SM1 SCON.6 Serial port Mode control bit 1.
Set/cleared by software (see
TI SCON.1 Transmit Interrupt flag.
note).
Set by hardware when byte
transmitted. Cleared by software
SM2 SCON.5 Serial port Mode control bit 2.
after servicing.
Set by software to disable recep-
tion of frames for which bit 8 is
RI SCON.O Receive Interrupt flag.
zero.
Set by hardware when byte re-
ceived. Cleared by software after
REN SCON.4 Receiver Enable control bit.
servicing.
Set/cleared by software to
enable/disable serial data
Note - the state of (SMO,SM1) selects:
reception.
(O,O) - Shift register 110 expansion.
(0,1) - 8 bit UART, variable data rate.
TB8 SCON.3 Transmit Bit 8.
(1,0) - 9 bit UART, fixed data rate.
Set/cleared by hardware to deter-
(1,1) - 9 bit UART, variable data rate.
mine state of ninth data bit trans-
mitted in 9-bit UART mode.
b.) SCON - Serial Port Control/status register.
Figure 7. Peripheral Configuration Registers.
01489A
C6
APPLICATIONS
(MSB) (LSB)
(MSB) (LSB)
Symbol Position Name and significance PX1 IP.2 External interrupt 1 Priority
IP.? (reserved) control bit. Set/cleared by
IP.6 (reserved) software to specify high/low
IP.5 (reserved) priority interrupts for INT1.
PS IP.4 Serial port Priority control bit. PTO IP.1 Timer 0 Priority control bit.
Set/cleared by software to Set/cleared by software to
specify high/low priority specify high/lolt/ priority
interrupts for Serial port. interrupts for tirndr/counter O.
PT1 IP.3 Timer 1 Priority control bit. PXO IP.O External interrupt 0 Priority
Set/cleared by software to control bit. Set/cleared by
specify high/low priority software to specify high/low
interrupts for timer/counter 1. priority interrupts for INTO.
d.) IP - Interrupt Priority Control Register.
Figure 7. (continued)
Addressable Register Set. There are 20 special function
registers in the 8051, but the advantages of bit addressing
only relate to the II described below. Five potentially The accumulator and B registers (A and B) are normally
bit-addressable register addresses (OCOH, OC8H, OD8H, involved in byte-wide arithmetic, but their individual bits
OE8H, & OF8H) are being reserved for possible future can also be used as 16 general software flags. Added with
expansion in microcomputers based on the MCS-5 I'M the 128 flags in RAM, this gives 144 general purpose
architecture. Reading or writing non-existent registers in variables for bit-intensive programs. The program status
the 8051 series is pointless, and may cause unpredictable word (PSW) in Figure 5 is a collection of flags and
results. Byte-wide logical operations can be used to machine status bits including the carry flag itself. Byte
manipulate bits in all non-bit addressable registers and operations acting on the PSW can therefore affect the
RAM. carry.
01489A
C?
At't'LI\,;A IIUN~
Instruction Set
Having looked at the bit variables available to the Boolean
Processor, we wiii now iook at the four classes of instructions
that manipulate these bits. It may be helpful to refer back to
Table 2 while reading this section.
ca
APPLICATIONS
grammer would have quite a chore trying to compute rela- Table 3. Other Instructions Affecting the Carry
tive offset values from one instruction to another, AS M 51 Flag.
automatically computes the displacement needed given only
the destination address or label. An error message will alert Mnemonic Description Byte Cyc
the programmer if the destination is "out of range."
ADD A.Rn Add register to
Accumulator
(The so-called "Bit Test" instructions implemented on many ADD A.direct Add direct byte to
other microprocessors simply perform the logical-AND Accumulator
operation between a byte variable and a constant mask, and ADD A.@Ri Add indirect RAM to
set or clear a zero flag depending on the result. This is Accumulator
ADD A.#data Add immediate data to
essentially equivalent to the 8051 "MOY Cbit" instruction. Accumulator
A second instruction is then needed to conditionally branch ADDC A.Rn Add register to
based on the state of the zero flag. This does not constitute Accumulator with Carry
abstract bit-addressing in the MCS-5 I'M sense. A flag exists flag
only as a field within a register~ to reference a bit the pro- ADDC A. direct Add direct byte to
Accumulator with Carry
grammer must know and specify both the encompassing flag
register and the bit's position therein. This constraint ADDC A.@Ri Add indirect RAM to
severely limits the flexibility of symbolic bit addressing and Accumulator with Carry
reduces the machine's code-efficiency and speed.) flag
ADDC A.#data Add immediate data to
Acc with Carry flag
Interaction with Other Instructions. The carry flag is also
SUBB A.Rn Subtract register from
affected by the instructions listed in Table 3. It can be rotated Accumulator with
through the accumulator, and altered as a side effect of borrow
arithmetic instructions. Refer to the User's Manual for SUBB A.direct Subtract direct byte
details on how these instructions operate. from Acc with borrow
SUBB A.@Ri Subtract indirect RAM
from Acc with borrow
Simple Instruction Combinations SUBB A.#data Subtract immediate data
By combining general purpose bit operations with certain from Acc with borrow 1
MUL AB Multiply A & B 4
addressa ble bits, one can "custom build" several hundred
DIY AB Divide A by B 4
useful instructions. All eight bits of the PSW can be tested DA A Decimal Adjust
directly with conditional jump instructions to monitor Accumulator
(among other things) parity and overflow status. Pro-
grammers can take advantage of 128 software flags to keep RLC A Rotate Accumulator
Left through the Carry
track of operating modes, resource usage, and so forth.
flag
RRC A Rotate Accumulator
The Boolean instructions are also the most efficient way to Right through Carry flag
control or reconfigure peripheral and I/O registers. All 32
I/O lines become "test pins," for example, tested by condi- . CINE A.direct.relCompare direct byte to
Acc & Jump if Not
tional jump instructions. Any output pin can be toggled
Equal 2
(complemented) in a single instruction cycle. Setting or clear- CINE A.#data.rel Compare immediate to
ing the Timer Run flags (TRO and TR I) turn the timer- Acc & Jump if Not
/ counters on or off~ polling the same flags elsewhere lets the Equal
program determine if a timer is running. The respective CINE Rn.#data.rel Compare immed to
register & Jump if Not
overflow flags (TFO and TFI) can be tested to determine
Equal 2
when the desired period orcount has elapsed, then cleared in CINE @Ri.#data.reICompare immed to
preparation for the next repetition. (For the record, these indirect & Jump if Not
bits are all part of the TCON register, Figure 7.a. Thanks to Equal
symbolic bit addressing, the programmer only needs to
remember the mnemonic associated with each function. In
other words, don't bother memorizing control word layouts.)
01489A
C-g
AI-'I-'LI\,;A IIUN:)
CLR, CPL) with a direct bit address appended perform the using awkward sequences of other basic operations. As
same functions. Two test instructions (JB and JNB) can be mentioned earlier, any CPU can solve any problem given
combined with bit addresses to test the sofnvare flags, the enough time.
8048 110 pins TO, Tl, and INT, and the eight accumulator Quantitatively, the differences between a solution allowed
bits, replacing 15 more different instructions. by the 8051 and those required by previous architectures
are numerous. What the 8051 Family buys you is a faster,
Table 4.a shows how 8051 programs implement software cleaner, lower-cost solution to microcontroller
flag and machine control functions associated with special applications.
The opcode space freed by condensing many specific 8048
Table 4.a. Contrasting 8048 and 8051 Bit Control and Testing Instructions.
8048 8x51
Instruction Bytes Cycles uSec Instruction Bytes Cycles & uSec
Flag Control
CLR C I I 2.5 CLR C I I
CPL FO I I 2.5 CPL FO 2 I
Flag Testing
JNC offset 2 2 5.0 JNC reI 2 2
JFO offset 2 2 5.0 JB FO,rel 3 2
JB7 offset 2 2 5.0 JB ACC.7,rel 3 2
Peripheral Polling
JTO offset 2 2 5.0 JB TO,rel 3 2
JNI offset 2 2 5.0 JNB INTO,rel 3 2
JTF offset 2 2 5.0 JBC TFO,rel 3 2
Table 4.b. Replacing 8048 instruction sequences with single 8x51 Instructions.
8048 8051
Instructions Bytes Cycles uSec Instructions Bytes Cycles & uSec
Flag Control
Set carry:
CLR C
SETB C I I
CPL C = 2 2 5.0
01489A
C-10
APPLICATIONS
Table 4b (Continued)
8048 8x51
Instructions Bytes Cycles uSec Instructions Bytes Cycles & uS~c
Turn Off Output Pin:
ANL PI,#OFBH = 2 2 5.0 CLR PI.2 2 I
Flag Testing
Jump if Software Flag is 0:
JFO $+4
JMP offset = 4 4 10.0 JNB FO,rel 3 2
Peripheral Polling
Test if Input Pin is Grounded:
IN A,PI
CPL A
JB3 offset = 4 5 12.5 JNB PI.3,rel 3 2
simpler to write since the architecture correlates more Design Example #1 - Bit Permutation
closely with the problems being solved; First off, we'll use the bit-transfer instructions to permute
a lengthy pattern of bits.
easier to debug because more individual instructions
have no unexpected or undesirable side-effects; A steadily increasing number of data communication
products use encoding methods to protect the security of
more byte efficient due to direct bit addressing and sensitive information. By law, interstate financial transac-
program counter relative branching; tions involving the Federal banking system must be
transmitted using the Federal Information Processing
faster running because fewer bytes of instruction need Data Encryption Standard (DES).
to be fetched and fewer conditional jumps are
processed; Basically, the DES combines eight bytes of "plaintext"
data (in binary, ASCII, or any other format) with a 56-bit
lower cost because of the high level of system- "key", producing a 64-bit encrypted value for transmis-
intergration within one component. sion. At the receiving end the same algorithm is applied to
the incoming data using the same key, reproducing the
These rather unabashed claims of excellence shall not go original eight byte message. The algorithm used for these
unsubstantiated. The rest of this chapter examines less permutations is fixed; different user-defined keys ensure
trivial tasks simplified by the Boolean processor. The first data privacy.
01489A
C-11
At't'LI\iA IIUN~
It is not the purpose of this note to describe the DES in any The bit manipulation performed is typified by the Key
detail. Suffice it to say that encryption/ decryption is a Schedule Calculation represented in Figure 9. This step is
long, iterative piOCCSS consisting of rotations, exciusivt: repeated i6 tiIm:s fur t::a<.:h kt::y ust::d in ihe course of a
-OR operations, function table look-ups, and an extensive transmission. In essence, a seven-byte, 56-bit "Shifted Key
(and quite bizarre) sequence of bit permutation, packing, Buffer" is transformed into an eight-byte, "Permutation
and unpacking steps. (For further details refer to the June Buffer" without altering the shifted Key. The arrows in
21,1979 issue of Electronics magazine.) The bit manipula- Figure 9 indicate a few of the translation steps. Only six
tion steps are included, it is rumored, to impede a general bits of each byte of the Permutation Buffer are used; the
purpose digital supercomputer trying to "break" the code. two high-order bits of each byte are cleared. This means
Any algorithm implementing the DES with previous gen- only 48 of the 56 Shifted Key Buffer bits are used in anyone
eration microprocessors would spend virtually all of its iteration.
time diddling bits.
PERMUTED AND SHIFTED 56-BIT KEY BUFFER
~ ~
-------------------~-------------------- --------------------~-------------------
PERMUTATION BYTE 1 PERM BYTE 2 PERM BYTE 3 PERM BYTE 4 BYTE 5 BYTE 6 PERM BYTE 7 PERM BYTE 8
48-BIT KEY KI
REPEAT
FOR EACH Perform a conditional jump based on the carry or
BIT OF
SHIFTED zero flag if the Permutation Buffer default state is
KEY
BUFFER correct;
(43 TIMES)
SET PERMUTATION (LEAVE PERMUTATION
BUFFER BIT BUFFER BIT
PC2(I) CLEARED) Otherwise reverse the corresponding bit in the permu-
tation buffer with logical operations and mask bytes.
Figure 10.a. Flowchart for Key permutation attemp- Notice, though, that this flow chart looks a lot like Figure 8.
ted with a byte processor. The Boolean Processor can permute bits by simply moving
01489A
C12
APPLICATIONS
them from the source to the carry to the destination-a Worst-case execution time would be 112 microseconds,
total of two instructions taking four bytes and three since each instruction takes a single cycle. Routine length
microseconds per bit. Assume the Shifted Key Buffer and would also decrease, to 168 bytes. (Actually, in the context
Permutation Buffer both reside in bit-addressable RAM, of the complete encryption algorithm, each permuted byte
with the bits of the former assigned symbolic names S KB_1, would be processed as soon as it is assimilated-saving
SKB~, ... SKB-S6, and that the bytes of the latter are memory and cutting execution time by another 8 usec.)
named PB_I, ... PB_8. Then working from Figure 9, the
software for the permutation algorithm would be that of
Example I.a. The total routine length would be 192 bytes, Example I. DES Key Permutation Software.
requiring 144 microseconds. a.) "Brute Force" technique.
MOY C,SKB_I
The algorithm of Figure 10. b is just slightly more efficient MOY PB_l.1,C
in this time-critical application and illustrates the synergy MOY C,SKB~
of an integrated byte and bit processor. The bits needed for MOY PB_4.O,C
each byte of the Permutation Buffer are assimilated by MOY C,SKB.3
loading each bit into the carry (I usec.) and shifting it into MOY PB~.5,C
the accumulator (I usec.). Each byte is stored in RAM MOY C,SKB_4
when completed. Forty-eight bits thus need a total of 112 MOY PB_1.0,C
instructions, some of which are listed in Example 1.b.
MOY C,SKB-S5
MOY PB-S.O,C
MOY C,SKB-S6
MOY PB_7.2,C
MOY C,SKB-29
RLC A
MOY C,SKB_32
RLC A
MOY PB_8,A
C-13
At't'LIGAIIUNS
fourth of the on-chip program memory, with the remaining interrupt.) Data is received by testing an input pin, setting
bytes free for operating the banking terminal (or whatever) the carry to the same state, shifting the carry into a data buffer,
itself. and saving the partiai frame in internal RAM. Data is
transmitted by shifting an output buffer through the carry,
Moreover, since transmission and reception of data is and generating each bit on an output pin.
performed through the on-board UART, the unencrypted
data (plaintext) never even exists outside the micro-
computer! Naturally, this would afford a high degree of
security from data interception.
r- - -l
----~~~~--- I
I
I~~DEM
a.) Reception.
TO
8051
IMODEM
C-14
APPLICATIONS
RESULTS:
8 INSTRUCTIONS 7 INSTRUCTIONS 4 INSTRUCTIONS
14 BYTES 9 BYTES 7 BYTES
56 STATES 9 CYCLES 4 CYCLES
19 uSEe. 22.5 uSEe. 4 uSEe.
RESULTS:
10 INSTRUCTIONS 8 INSTRUCTIONS 4 INSTRUCTIONS
20 BYTES 13 BYTES 7 BYTES
72 STATES II CYCLES 5 CYCLES
24 uSEe. 27.5 uSEe. 5 uSEe.
C-15
AI-'I-'LIGA IIUNS
C-16
APPLICATIONS
When finished, the carry flag contains the result, which is CLRQ: MOV A,OUTBUF
simply copied out to the destination pin. No flow chart is ANL A,#IIIIOIII B
needed-code can be written directly from the logic dia- JMP OUTQ
grams in Figure 14. The result is simplicity itself: fast, SETQ: MOV A,OUTBUF
flexible, reliable, easy to design, and easy to debug. ORL A ,#0000 I000 B
OUTQ: MOV OUTBUF,A
An 8051 program can simulate an N-input AND or OR MOV P3,A
gate with at most N+ I lines of source program-one for
each input and one line to store the results. To simulate b.) Using only bit-test instructions.
N AND and NOR gates, complement the carry after com-
;BFUNC2 SOLVE A RANDOM LOGIC FUNCTION
puting the function. When some inputs to the gate have
OF 6 VARIABLES BY DIRECTLY
"inversion bubbles," perform the ANL or OR L operation
POLLING EACH BIT.
on inverted operands. When the first input is inverted,
(APPROACH USING MCS-51 UNIQUE
either load the operand into the carry and then complement
BIT-TEST INSTRUCTION CAPABILITY.)
it, or use DeMorgan's Theorem to convert the gate to a
SYMBOLS USED IN LOGIC DIAGRAM
different form.
ASSIGNED TO CORRESPONDING 8x51
BIT ADDRESSES.
C-17
AI'II'ILI\,;A IIUN~
An upper-limit can be placed on the complexity of software But we're not done yet. Each of the exterior turn signal
to simulate a large number of gates by summing the total (but not the dashboard) bulbs has a second, somewhat
number of inputs and outputs. The actual total should be dimmci filament fOi the parking lights. J7igure 15 shows
somewhat shorter, since calculations can be "chained," as TTL circuitry which could control all six bulbs. The
shown above. The output of one gate is often the first signals labeled "High Freq." and "Low Freq." represent
input to another, bypassing the intermediate variable to two square-wave inputs. Basically, when one of the turn
eliminate two lines of source. switches is closed or the emergency switch is activated the
low frequency signal (about I Hz) is gated through to the
appropriate dashboard indicator(s) and turn signal(s).
Design Example #4 - Automotive Dash- The rear signals are also activated when the brake pedal is
board Functions depressed provided a turn is not being made in the same
direction. When the parking light switch is closed the
N ow let's apply these techniques to designing the software higher frequency oscillator is gated to each front and rear
for a complete controller system. This application is turn signal, sustaining a low-intensity background level.
patterned after a familiar real-world application which (This is to eliminate the need for additional parking light
isn't nearly as trivial as it might first appear: automobile filaments.)
turn signals.
L. TURN ---p-----I-...,'-_~-...,.
Imagine the three positIOn turn lever on the steering EMERO --+--_---l~ }-.......- - - - L. DASH
column as a single-pole, triple-throw toggle switch. In its
central position all contacts are open. In the up or down L. FRNT
Two more turn signals blink in the front of the car, and R. TURN --~-+----r-""
1--__+ - - - - R. DASH
two others in the dashboard. All six bulbs flash when an
emergency switch is closed. A thermo-mechanical relay
R. FRNT
(accessible under the dashboard in case it wears out)
causes the blinking.
R. REAR
PARK ---------t---f---..,
Applying the brake pedal turns the taillight filaments on
constantly ... unless a turn is in progress, in which case the LO. HI.
FREQ. FREQ.
blinking taillight is not affected. (Of course, the front turn OSCILLATOR OSCILLATOR
C18
APPLICATIONS
In most cars, the switching logic to generate these func- Design Example #3 demonstrated that symbolic address-
tions requires a number of multiple-throw contacts. As ing with user-defined bit names makes code and documen-
many as 18 conductors thread the steering column of some tation easier to write and maintain. Accordingly, we'll
automobiles solely for turn-signal and emergency blinker assign these 110 pins names for use throughout the pro-
functions. (The author discovered this recently to his gram. (The format of this example will differ somewhat
astonishment and dismay when replacing the whole from the others. Segments of the overall program will be
assembly because of one burned contact.) presented in sequence as each is described.)
01489A 1
C-19
APPLICATIONS
Timer 0 (one of the two on-chip timer/counters) replaces DIM BIT PSW.I ; DECLARE TEMP.
the thermo-mechanical blinker relay in the dashboard STORAGE FLAG
controller. During system initialization it is configured as
a timer in mode 1 by setting the least significant bit of the MOV CPARK ; GATE PARKING
timer mode register (TMOD). In this configuration the LIGHT SWITCH
low-order byte (TLO) is incremented every machine cycle, ANL HLFREQ ; WITH HIGH
overflowing and incrementing the high-order byte (THO) FREQUENCY
every 2S6 J.lSec. Timer interrupt 0 is enabled so that a SIGNAL
hardware interrupt will occur each time THO overflows. MOV DIM.C ; AND SAVE IN
(For details of the numerous timer operating modes see TEMP. VARIABLE.
the MCS-SITM User's Manual.)
An eight-bit variable in the bit-addressable RAM array This simple three-line section of code illustrates a remark-
will be needed to further subdivide the interrupts via able point. The software indicates in very abstract terms
software. The lowest-order bit of this counter toggles very exactly what function is being performed, independent of
01489A-22
C-20
APPLICATIONS
the hardware configuration. The fact that these three bits MOV R_DASH,C ; AND OUTPUT TO
include an input pin, a bit within a program variable, and DASHBOARD.
a software flag in the PSW is totally invisible to the MOV FO,C ; SAVE FUNCTION
programmer. SO FAR.
ORL C,DIM ; ADD IN PARKING
Now generate and output the dashboard left turn signal. LIG HT FUNCTION
MOV R_FRNT,C ; AND OUTPUT TO
TURN SIGNAL.
; SET CARRY IF MOV C,BRAKE ; GATE BRAKE
TURN PEDAL SWITCH
ORL C,EMERG ; OR EMERGENCY ANL C,jR_TURN ; WITH TURN
SELECTED. LEVER.
; GATE IN I HZ ORL C,FO ; INCLUDE TEMP.
SIGNAL V ARIABLE FROM
; AND OUTPUT TO DASH
DASHBOARD. ORL C,DIM ; AND PARKING
To generate the left front turn signal we only need to add LIGHT FUNCTION
the parking light function in FO. But notice that the func- MOV R_REAR,C ; AND OUTPUT TO
tion in the carry will also be needed for the rear signal. We TURN SIGNAL.
can save effort later by saving its current state in FO.
(The perceptive reader may notice that simply rearranging
the steps could eliminate one instruction from each
MOV FO,C ; SAVE FUNCTION sequence.)
SO FAR.
ORL C,DIM ; ADD IN PARKING Now that all six bulbs are in the proper states, we can
LIGHT FUNCTION return from the interrupt routine, and the program is
; AND OUTPUT TO finished. This code essentially needs to reverse the status
TURN SIGNAL. saving steps at the beginning of the interrupt.
Finally, the rear left turn signal should also be on when the
brake pedal is depressed, provided a left turn is not in
progress. POP B ; RESTORE CPU
REGISTERS.
POP ACC
MOV C,BRAKE ; GATE BRAKE
POP PSW
PEDAL SWITCH
RET!
; WITH TURN
LEVER.
ORL C,FO ; INCLUDE TEMP. Program Refinements. The luminescence of an incan-
VARIABLE FROM descent light bulb filament is generally non-linear; the 50%
DASH duty cycle of HLFREQ may not produce the desired
ORL C,DIM ; AND PARKING intensity. If the application requires, duty cycles of 25%,
LIGHT FUNCTION 75%, etc. are easily achieved by ANDing and ORing in
; AND OUTPUT TO additional low-order bits ofSUB_DIV. For example, 30
TURN SIGNAL. Hz signals of seven different duty cycles could be pro-
duced by considering bits 2~0 as shown in Table 7. The
Now we have to go through a similar sequence for the only software change required would be to the code which
right-hand equivalents to all the left-turn lights. This also sets-up variable DIM:
gives us a chance to see how the code segments above look
when combined.
MOV C,SUB_DIV.I ; START WITH 50
PERCENT
; SET CARRY IF ANL C,SUB_DIV.O ; MASK DOWN TO 25
TURN PERCENT
ORL C,EMERG ; OR EMERGENCY ORL C,SUB_DIV.2 ; AND BUILD BACK TO
SELECTED. 62 PERCENT
; IF SO, GATE IN I MOV DIM,C ; DUTY CYCLE FOR
HZ SIGNAL PARKING LIGHTS.
01489A
C-21
r,,- r ... 1"1"'\ 1 IVI"~
L_FRNT BIT B.O : FRONT LEFT-TURN And since the system is much simpler it would be feasible
INDICATOR to implement redundancy and/ or fault detection on the
R_FRNT BIT B.I : FRONT RIGHT-TURN four main turn indicators. Each could still be a standard
INDICATOR double filament bulb, but with the filaments driven in
L_DASH BIT 8.2 : DASHBOARD LEFT-TURN parallel to tolerate single-element failures.
INDICATOR
R_DASH BIT 8.3 : DASHBOARD RIGHT-TURN Even with redundancy, the lights will eventually fail. To
INDICATOR handle this inescapable fact current or voltage sensing
01489A
C-22
At't'LI\.;A I IUN:::
circuits on each main drive wire can verify that each bulb CLR L_DASH
and its high-current driver is functioning properly. Figure JB TO,FAULT
18 shows one such circuit. SETB L_DASH
CLR L_REAR
WIRING +12V
HARNESS JB TO.FAULT
I
SETB L_REAR
CLR R_FRNT
JB TO.FAULT
SETB R_FRNT
CLR R_DASH
P1.7
JB TO.FAULT
SETB R_DASH
CLR R_REAR
P2.0
JB TO.FAULT
SETB R.~REAR
P2.1
C-23
Figure 19 shows a block diagram for a moderately com- The 8051 serial port can be configured to detect bytes with
plex programmable industrial controller with the follow- the address bit set, automatically ignoring all others. Pins
ing characteristics: INTO and INT! are interrupts configured respectively as
64 input variable sensors; high-priority, falling-edge triggered and low-priority, low-
level triggered. The remaining 12 I/O pins output TTL-
12 output signals;
Combinational and sequential logic computations; level control signals to 12 actuators.
Remote operation with communications to a host
processor via a high-speed full-duplex serial link; There are several ways to implement the sensor matrix
Two prioritized external interrupts; circuitry, all logically similar. Figure 20.a shows one possi-
Internal real-time and time-of-day clocks. bility. Each of the 64 sensors consists of a pair of simple
switch contacts in series with a diode to permit multiple
While many microprocessors could be programmed to contact closures throughout the matrix.
provide these capabilities with assorted peripheral sup-
port chips, an 8051 microcomputer needs no other inte-
grated circuits! The scan lines from Port I provide eight un-encoded
active-high scan signals for enabling columns of the
The 64 input sensors are logically arranged as an 8x8 matrix. The return lines on rows where a contact is closed
matrix. The pins of Port 1 sequentially enable each are pulled high and read as logic ones. Open return lines
column of the sensor matrix; as each is enabled Port 0 are pulled to ground by one of the 40 kohm resistors and
reads in the state of each sensor in that column. An are read as zeroes. (The resistor values must be chosen to
eight-byte block in bit-addressable RAM remembers the ensure all return lines are pulled above the 2.0 V logic
data as it is read in so that after each complete scan cycle threshold, even in the worst-case, where all contacts in an
there is an internal map of the current state of all sensors. enabled column are closed.) Since PO is provided open-
Logic functions can then directly address the elements of collector outputs and high-impedance MOS inputs its
the bit map. input loading may be considered negligible.
SERIAL
LINK
1 RXO iNTo 1 - - - - - I.
iNT1 1--_ _ _ j
ASYNCHRONANS
INTERRUPTS
The other circuits assume that input signals are already at
TTL levels. Figure 20.c uses octal three-state buffers
8051
enabled by active-low scan signals to gate eight signals
onto Port O. Port 0 is available for memory expansion or
PO.l peripheral chip interfacing between sensor matrix scans.
PO.2
Eight-to-one multiplexers in Figure 20.d select one of
eight inputs for each return line as determined by encoded
PO.5
PO.S
MACHINE address bits output on three pins of Port I. (Five more
P2.2 ACTUATORS
output pins are thus freed for more control functions.)
Each output can drive at least one standard TTL or up to
P2.6
10 low-power TTL loads without additional buffering.
P2.7
N.C.
Going back to the original matrix circuit, Figure 21 shows
ALE
PSEN N.C. the method used to scan the sensor matrix. Two complete
/
VSS EA bit maps are maintained in the bit-addressable region of
SCAN
LINES the RAM: one for the current state and one for the pre-
vious state read for each sensor. If the need arises, the
program could then sense input transitions and/ or
Figure 19. Block diagram of 64-input machine debounce contact closures by comparing each bit with its
controller. earlier value.
01489A
C-24
APPLIGA IIUN~
+8x4K +8x4K
r- r---
8051
~."56"
~O" ~"
"56"
~.I..*
RETURN
r
f-e---L-~ ,LINES RETURN
. "LlNES
pO.a pO.a
r9!'" ~t ~7"
"1" "9" "57"
~--'--
~ ~~
PO.l
r- PO.l
i 1--1
1 PO.2
1I - I PO.2
1 PO.3
1 PO.3
I I +-'-1- PO.4
PO.S 1 I Hi I PO.4
PO.S
1-1-1-+ I PO.S I+I-=+T PO.6
"15" "63"
I I
~3"
~~ f-e--l-~
PO.7 ~'M15"
i t
PO.7
8x40K 8x40K
= =
'------++------1 P1.0 L------++-------"1P1.0
'------++---....., P1.1 '----_ _ _-1-1---_ _--1 P1.1
'----_ _ _--1+-_ _-----, P1.2 L--_ _ _ _ ++-._ _ _- j Pl.2
'----------++--------1 P1.3 L-_ _ _ _-++--_ _--jP1.3
'----------++------"1 P1.' L - - - - - - - - H - - - - - i P 1 .
' - - - - - - - - - - - 1 1 + - - - - - - 1 P1.5 L - - - - - - - t t - - - - - 1 P1 .5
L - - - - - - - - - - + + - - - - - - " 1 P1 . L - - - - - - - - - - - t - 1 f - - - - - - - I P1 .
L - - - - - - - - - - - - - - H - - - - - 1 P1.7 L-------------+t-------jP1.7
SCAN' SCAN
LINES LINES
'8ii5,
1 CBA
D:41:~ 05 Os
V$
I~
071 100 01 02 07:1:~
II CBA
05 06 0 7 1
Ys
'------+-++--+-----H-+--+---- po.o
~
I
00 01 02 03 0 4 05 06
1' C
74151
BAY S
1-;1:
071
IL++
1-+-+-++-+_...1+-1
1-+-+-+-+---+_--<l>-+-+I-+--1-t-+-_ PO.1 l'---------+-+-+---4--_ PO.1
1'-+-+++-H---<10--++-t-+---t---I-----41-+--t-+-H,---.., PO.2
"--+-++-+-I---~+-+-+-I---+----+-f_t_+-+--! PO.3 l~I~II~==1j:t=.t=====-=: ::::
L.t
~+-+-+---_......+-+-+---I----+-I_+_+-----! po., 1L.1-::f-----+-Hf--+----l po.,
L+-+-+-----+-+-+-+-----+-f_t_--l PO.5
L+-I--------+--I---+------<>-+----I po. L.1~==1~=':==_:=====:; :~:
4------......-+-----4----i PO.7 '-------J PO.7
I I I I I
lllUllJ III III
~ ~
Pl.0 Pl.D
P1.1 llll 1111 11 Pl.1
\11 Pl.2
Pl.3
~ 1 1
G= Pl.2
I P1.4
Pl.S
Pl.7
'---- L--
C.) Using TTL three-state buffers. d.) Using TTL data selectors.
Example 3.
INPUT_SCAN: : SUBROUTINE TO READ
CURRENT STATE
; OF 64 SENSORS AND
The code in Example 3 implements the scanning algo- SAVE IN RAM 20H-27H.
rithm for the circuits in Figure 20.a. Each column is MOY RO,#20H : INITIALIZE
enabled by setting a single bit in a field of zeroes. The bit ; POINTERS
maps are positive logic; ones represent contacts that are MOY R L#28H : FOR BIT MAP
closed or isolators turned on. ; BASES.
01489A
C-25
MOV A,#80H ; SET FIRST BIT IN What happens after the sensors have been scanned
ACe. depends on the individual application. Rather than
SCAN: MOV PI.A . OUTPUT TO SCAN inventing some artificial design problem, softVv'are corres-
LINES. ponding to commonplace logic elements will be discussed.
RR A ; SHIFT TO ENABLE
NEXT COLUMN Combinatorial Output Variables. An output variable
NEXT. which is a simple (or not so simple) combinational func-
MOV R2,A ; REMEMBER CUR- tion of several input variables is computed in the spirit of
RENT SCAN Design Example 3. All 64 inputs are represented in the bit
POSITION. maps; in fact, the sensor numbers in Figure 20 correspond
MOV A,PO ; READ RETURN to the absolute bit addresses in RA M! The code in Exam-
LINES. ple 4 activates an actuator connected to P2.2 when sensors
XCH A,@RO ; SWITCH WITH 12, 23, and 34 are closed and sensors 45 and 56 are open.
PREVIOUS MAP Example 4.
BITS.
MOV @RI,A ; SAVE PREVIOUS Simple Combinatorial Output Variables.
STATE AS WELL.
INC RO ; BUMP POINTERS. ; SET P2.2 = (12) (23) (34) (j 45) (j 56)
INC RI MOV C,12
MOV A,R2 ; RELOAD SCAN LINE ANL C,23
MASK ANL C,34
JNB ACe.7,SCAN; LOOP UNTIL ALL ANL C,/45
EIGHT COLUMNS ANL C,/56
READ. MOV P2.2,C
RET Intermediate Variables. The examination of a typical
relay-logic ladder diagram will show that many of the
rungs control not outputs but rather relays whose con-
tacts figure into the computation of other functions. In
effect, these relays indicate the state of intermediate varia-
bles of a computation.
CALL INPUT-SCAN
MOV C,O
ORL C,I
ORL C,2
ORL C,3
MOV FO,C
Figure 21. Flowchart for reading in sensor matrix.
01489A-28
C-26
At't'LI\"A IIUI~i)
ANL C,/FO
MOY PI.2,C
Time Delay Relays. A time delay relay does not respond
to an input signal until it has been present (or absent) for
some predefined time. For example, a ballast or load
resistor may be switched in series with a D.C. motor when
it is first turned on, and shunted from the circuit after one
second. This sort of time delay may be simulated by an
interrupt routine driven by one of the two 8051 timer I
"2" counters. The procedure followed by the routine depends
heavily on the details of the exact function needed; time-
"3"
outs or time delays with resettable or non-resettable inputs
are possible. If the interrupt routine is executed every IO
milliseconds the code in Example 7 will clear an inter-
mediate variable set by the background program after it
has been active for two seconds.
JNB USR_FLG,NXTTST
DJNZ DLA Y_COUNT,NXTTST
CLR USR_FLG
MOY DLA Y_COUNT,#200
NXTTST:
C-2?
At"t"LI~A HUN:>
large number of "rungs" operating in parallel. A change in ~EXCLUSIVE-OR FUNCTION IMPOSEDON CARRY
input conditions will begin propagating through the sys- ~USING FO IS INPUT VARIABLE.
tem immediately, possibly affecting the output state XO!LFO: JNB FO.XORCNT ; ("J8" FOR X-NOR)
within milliseconds. CPL C
XORCNT: ...
Software, on the other hand, operates sequentially. A
change in input states will not be detected until the next XCH. The contents of the carry and some other bit may be
time an input scan is performed, and will not affect the exchanged (switched) by using the accumulator as tempo-
outputs until that section of the program is reached. For rary storage. Bits can be moved into and out of the accu-
that reason the raw speed of computing the logical func- mulator simultaneously using the Rotate-through-carry
tions is of extreme importance. instructions. though this would alter the accumulator
data.
Here the Boolean processor pays off. Every instruction
mentioned in this Note completes in one or two micro-
; EXCHANGE CARRY WITH USRFLG
seconds-the minimum instruction execution time for
XCHBIT: RLC A
many other microcontrollers! A ladder diagram contain-
MOV c'USR_FLG
ing a hundred rungs, with an average of four contacts per
RRC A
rung can be replaced by approximately five hundred lines
MOV USR_FLG.C
of software. A complete pass through the entire matrix
RLC A
scanning routine and all computations would require
about a millisecond~ less than the time it takes for most
relays to change state. Extended Bit Addressing. The 8051 can directly address
144 general-purpose bits for all instructions in Figure 3.b.
A programmed controller which simulates each Boolean Similar operations may be extended to any bit anywhere
function with a subroutine would be less efficient by at on the chip with some loss of efficiency.
least an order of magnitude. Extra software is needed for
the simulation routines, and each step takes longer to The logical operations AND, OR. and Exclusive-OR are
execute for three reasons: several byte-wide logical performed on byte variables using six different addressing
instructions are executed per user program step (rather modes. one of which lets the source be an immediate
than one Boolean operation)~ most of those instructions mask. and the destination any directly addressable byte.
take longer to execute with microprocessors performing Any bit may thus be set, cleared, or complemented with a
multiple off-chip accesses~ and calling and returning from three-byte. two-cycle instruction if the mask has all bits
the various subroutines requires overhead for stack but one set or cleared.
operations.
Byte variables, registers. and indirectly addressed RAM
In fact. the speed of the Boolean Processor solution is may be moved to a bit addressable register (usually the
likely to be much faster than the system requires. The accumulator) in one instruction. Once transferred, the bits
CPU might use the time left over to compute feedback may be tested with a conditional jump, allowing any bit to
parameters, collect and analyze execution statistics, per- be polled in 3 microseconds-still much faster than most
form system diagnostics, and so forth. architectures,-or used for logical calculations. (This
technique can also simulate additional bit addressing
modes with byte operations.)
Additional functions and uses.
Parity of bytes or bits. The parity of the current accumu-
lator contents is always available in the PSW, from
With the building-block basics mentioned above many whence it may be moved to the carry and further pro-
more operations may be synthesized by short instruction cessed. Error-correcting Hamming codes and similar
sequences. applications require computing parity on groups of iso-
lated bits. This can be dO,ne by conditionally complement-
ing the carry flag based on those bits or by gathering the
Exclusive-OR. There are no common mechanical devices
bits into the accumulator (as shown in the DES example)
or relays analogous to the Exclusive-OR operation, so this
and then testing the parallel parity flag.
instruction was omitted from the Boolean Processor.
However. the Exclusive-OR or Exclusive-NOR operation
Multiple byte sh((t and C RC codes.
may be performed in two instructions by conditionally
complementing the carry or a Boolean variable based on Though the 8051 serial port can accommodate eight- or
the state of any other testable bit. nine-bit data transmissions, some protocols involve much
01489A-30
C-28
APPLICATIONS
longer bit streams. The algorithms presented in Design This Application Note has detailed the information
Example 2 can be extended quite readily to 16 or more bits needed by a microcomputer system designer to make full
by using multi-byte input and output buffers. use of these capabilities. Five design examples were used
Many mass data storage peripherals and serial communi- to contrast the solutions allowed by the 8051 and those
cations protocols include Cyclic Redundancy (CRC) required by previous architectures. Depending on the
codes to verify data integrity. The function is generally individual application, the 8051 solution will be easier to
computed serially by hardware using shift registers and design, more reliable to implement, debug, and verify, use
Exclusive-OR gates, but it can be done with software. As less program memory, and run up to an order of magni-
each bit is received into the carry, appropriate bits in the tude faster than the same function implemented on pre-
multi-byte data buffer are conditionally complemented vious digital computer architectures.
based on the incoming data bit. When finished, the CRC
register contents may be checked for zero by ORing the Combining byte- and bit-handling capabilities in a single
two bytes in the accumulator. microcomputer has a strong synergistic effect: the power
of the result exceeds the power of byte- and bit-processors
4. SUMMARY laboring individually. Virtually all user applications will
A truly unique facet of the Intel MCS-5 I'M microcomputer benefit in some ways from this duality. Data intensive
family design is the collection of features optimized for the applications will use bit addressing for test pin monitoring
one-bit operations so often desired in real-world, real-time or program control flags; control applications will use
control applications. Included are 17 special instructions, byte manipulation for parallel I I 0 expansion or arith-
a Boolean accumulator, implicit and direct addressing metic calculations.
modes, program and mass data storage, and many 1/0
options. These are the world's first single-chip micro- It is hoped that these design examples give the reader an
computers able to efficiently manipulate, operate on, and appreciation of these unique features and suggest ways to
transfer either bytes or individual bits as data. exploit them in his or her own application.
01489A
r..?Q
ISIS-II MCS-51 MACRO ASSEMBLER Vl.O
l'~
0"
fOeD
OB~ECT MODULE PLACED IN :FO:AP70.HEX ill ;:,
ASSEMBLER INVOKED BY: : fl:asm51 ap70. src date(328) 39:
LOC OB~ LINE SOURCE r->C
~;t>
$XREF TITLE(AP-70 APPENDIX)
~J>
. c
2 i***************************************************** ***
3 o3
4 THE FOLLOWING PROGRAM USES THE BOOLEAN INSTRUCTION SET
5 OF THE INTEL 8051 MICROCOMPUTER TO PERFORM A NUMBER OF o
CT
6
7
AUTOMOTIVE DASHBOARD CONTROL FUNCTIONS RELATING TO
TURN SIGNAL CONTROL, EMERGENCY BLINKERS, BRAKE LIGHT
f
8 CONTROL, AND PARKING LIGHT OPERATION. '2
9
10
THE ALGORITHMS AND HARDWARE ARE DESCRIBED IN DESJGN
EXAMPLE #4 OF INTEL APPLICATION NOTE AP-70, ~
"USING THE INTEL MCS-51<TM) S-
11 o.
12 BOOLEAN PROCESSING CAPABILITIES" n
I
13
14 i***************************************************** **** ~
15
16 INPUT PIN DECLARATIONS: f}
17 (ALL INPUTS ARE POSITIVE-TRUE LOGIC. a. ))
18 INPUTS ARE HIGH WHEN RESPECTIVE SWITCH CONTACT IS CLOSED. ) 2- "tl
0090
19
20 BRAKE BIT PI.O BRAKE PEDAL DEPRESSED ..
CD "tl
r-
n
o 0091 21 EMERG BIT PI. 1 EMERGENCY BLINKER ACTIVATED
W
o
0092 22 PARK BIT PI. 2 PARKING LIGHTS ON
~
0093
0094
23
24
25
L_TURN
R_TURN
BIT
BIT
PI.
PI.
3
4
i TURN LEVER DOWN
TURN LEVER UP a2
26 OUTPUT PIN DECLARATIONS: CIl
27 (ALL OUTPUTS ARE POSITIVE TRUE LOGIC.
28 BULB IS TURNED ON WHEN OUTPUT PIN IS HIGH. )
29
0095 30 L_FRNT BIT Pl. 5 FRONT LEFT-TURN INDICATOR
0096 31 R_FRNT BIT PI. 6 i FRONT RIGHT-TURN INDICATOR
0097 32 L_DASH BIT PI. 7 DASHBOARD LEFT-TURN INDICATOR
OOAO 33 R_DASH BIT P2. 0 DASHBOARD RIGHT-TURN INDICATOR
OOAI 34 L_REAR BIT P2. 1 REAR LEFT-TURN INDICATOR
00A2 35 R_REAR BIT P2.2 REAR RIGHT-TURN INDICATOR
36
00A3 37 S_FAIL BIT P2. 3 ELECTRICAL SYSTEM FAULT INDICATOR
38
39 INTERNAL VARIABLE DEFINITIONS:
40
0020 41 SUB_DIV DATA 20H INTERRUPT RATE SUBDIVIDER
0000 42 HIJ'REG BIT SUB_DIV.O HIGH-FREGUENCY OSCILLATOR BIT
0007 43 LO_FREG BIT SUB_DIV. 7 LOW-FREGUENCY OSCILLATOR BIT
44
OODI 45 DIM BIT PSW.l PARKING LIGHTS ON FLAG
0 46
co 47 ;=======================================================
'" 48 +1 $E~ECT
LOC OBJ LINE SOURCE
~
u.s. AND CANADIAN SALES OFFICES
3065 Bowers Avenue
Santa Clara, California 95051
Tel: (408) 987-8080
TWX: 9103380026
TELEX: 34-6372
....... ~" ... A or. "' ... A I ft ....... "' ................ " , , , . . . . "' ... , , . . . . . . . . . . . ,, .... """
" " Il:;nl""II\,II""L. UI~lnIDUIVn~'nl:;,.nl:;~I:; ... I"llyC~