Professional Documents
Culture Documents
80C51-Based o
o
8-Bit Microcontrollers
. Signetics
PHILIPS
· I.
80C51·~Ba·s:ed>
.' .'.
.
.' .
a-Bit Micro·controllers .
Signefics
.~.
·PHILIPS
Signetics reserves the right to make changes, without notice, in the products, including
circuits, standard cell s, and/or software, described orcontained herein in orderto improve
design and/or performance. Signetics assumes no responsibility or liability for the use
of any of these products, conveys no license or title under any patent, copyright, or mask
work right to these products, and makes no representations or warranties that theso
products are free from patent, copyright, or mask work right infringement, unless
otherwise specified. Applications that are described herein for any of these products arc
for illustrative purposes only. Signetics makes no representation or warranty that such
applications will bo suitable for the specified use without further testing or modification.
There are undocumented characteristics of somo products specified in this databook.
Signetics will not be responsible for any operating differences between the ROM· based
and EPROM-based device of the same microcontroller.
LIFE SUPPORT APPLICATIONS
Signetics Products are not designed for use in life support appliances, dovicos, or
systems whero malfunction of a Signetics Product can reasonably bo expocted to result
in a personal injury. Signetics customers using or selling Signetics Products for use in
such applications do so at their own risk and agree to fully indemnify Signetics for any
damages resulting from such improper usc or sale.
80CS1-8ased
8-Bit Microcontrollers
80CS1-Based
8-Bit Microcontrollers
DEFINITIONS
Data Sheet
Product Status Definition
Identification
This data sheet contains the design target or goal
Objective Specificstion Fonnative or In Design specifications for product develc~m16nt. Specifications may
change in any manner without notice.
February 1992 iv
Signetics
Contents
8OC51-Based
8-81t Mlcrocontrollers
Preface........... ................ ....... ..... ............ ........... ..... ... .... .......... .. ... .. ............ iii
Product Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Ordering Information .......•.....•............................................................................. ix
8OC51 Mlcrocontroller Family Features Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
8051 Mlcrocontroller Cross-Reference Guide •...................................................................... xii
8OC51 Mlcrocontroller Development System Support ...•............................................................ xiii
Signelics Mlcrocontroller Bulletin Boards ........ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
CMOS and NMOS S-blt Mlcrocontroller Family ...................................................................... xv
CMOS 16-blt Mlcrocontroller Family. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. xxi
Philips 8-blt Mlcrocontroller Demonstration and Evaluation Boards .................................................... xxii
Section 1 -.80C51 Family .
80C51 Family Overview ...................................................................................... 3
80C51 Family ArchitecbJre .................................................................................... 8
80C51 Family Hardware Description. . .. .. . .. .. . . . . . . . .. . .. .. .. . .. . . .. . . . . . .. . . . .. . . . . . . . .. . .. . . .. . . . . . . .. .. .. . . . 23
80C51 Family Programmer's Guide and Instruction Set . .. . .. . . . . . . .. . .. . . .. . . . .. .. . .. .. .. . . . .. .. . . . . .. . . . . . .. .. .. . .. 48
80C51 Family EPROM Products ................................................ , ............................... 103
8031AH18051AH Data Sheet ............................................................ ,..................... 107
80031/80C51/87C51 Data Sheet ...................................................................... , ........ 116
February 1992 v
Signetics 8OC51-Based 8-Bit Microcontrollers
Contents (Continued)
February 1992 vi
Signetics BOC51-Based B-8it Microcontrollers
Contents (Continued)
Ordering Information
MICROCONTROLLER PRODUCTS
Example:
O;ROMLESS~
3; ROM
7; EPROMlOTP
PB X C~~ E
l
BP N
T S.oo.~ ,~""', Ood,
A; Plastic Leaded Chip Carrier (PLCC)
B ; Quad Flat Pack (QFP)
FA ; Hermetic Cerdip (window)
KA ; CerQuad (window)
N ; Plastic Dual In-Line
Exceptions:
PSOC32 ; ROMless Philips Package Code
PSOC52; ROM A; Plastic Leaded Chip Carrier (PLCC)
B ; Quad Flat Pack (QFP)
This can be 2 or 3 digits _ _ _---1 F ; Hennetic Cerdip (window)
L ; Cerquad (window)
p; Plastic Dual In-Line
'--_ _ _ Temperature
B; O°C to +70°C
F ; -40°C to +S5°C
' - - - - - - Speed
E; 16MHz
G;20MHz
Example: SC 8 X C X~ Bee N 40
0; ROMLESS _ _ _...;T
3;ROM
~ Pin Count
1L
Example: S 8 X C XXX -1 N 24
'~ROMLEssJ
Pin Count
Package Code
A ; Plastic Leaded Chip Carrier (PLCC)
B ; Quad Flat Pack (QFP)
F ; Ceramic Dual In-Line
K ; CerQuad
3;ROM
7 ; EPROM/OTP N ; Plastic Dual In-Line
l.-_ _ _ _ Speed / Temperature Range
-1 ; 12MHz, O°C to +70°C
-2 ; 12MHz, -40°C to +S5°C
-3; 0.5 to 12MHz, O°C to +70°C
-4; 16MHz, O°C to +70°C
-5; 16MHz, -40°C to +S5°C
-6; 12 or 16MHz, -55°C to +S5°C
February 1992 ix
Signetics 80C51-Based 8-Bit Microcontroliers
ROMless ROM EPROM ROM RAM TIMER PORT INTERFACES INTERRUPTS SPECIAL FEATURES
- 83C752 87C752 2k 64 1 (16-bit) 2-5/8 12C (Bit) 2 5-Channel 8-bit AID, PWM output
80C451 83C451 87C451 4k 128 2 7 UART 2 Extended 1/0, Processor bus interface
80C552 83C552 87C552 8k 256 3+ 6 UART, 12C 6 8-ChanneI10-bit AID, 2 PWM outputs
Watchdog
8OC652 83C652 87C652 8k 256 2 4 UART, 12C 2 8051 pin-for-pin compatible with twice
the memory
- 83C054 87C054 16k 192 2 (16-bit) 3-4/8 - 3 On-screen display, 9 PWM outputs,
3 software AID inputs
- 83C654 87C654 16k 256 2 4 UART,12C 2 8051 pin-for-pin compatible with four
times the ROM and twice the RAM
80C528 83C528 87C528 32k 512 3+ 4 UART,12C 2 The Ultimate Programming Machine
Watchdog (Bit)
February 1992
Signetics 80CS1-Based 8-Bit Microcontrollers
PART NO. 0.5-12 12 16 20/24 33 01070 -4010 +85 -55 to +125 PDIP CDIP PLCC CLCC QFP VSO
83/87C751 X X X X X X (-4010+125) 24 24 28
83/87C752 X X X X X X 28 28 28
8031151 X x (lSMHz) X X 40 44
8OC31/51187C51 X X X X X X X X 40 40 44 44 44
8OCL31/51 X (32kHz-16MHz) X 40 40
80/83CL410 X (32kHz-16M Hz) X 40 40
80/83/87C451 X X X X X X 64 64 68 68
80/83/87C550 X X X X X 40 40 44 44
80/83C851 X X X 40 44 44
83C852 X X
8032152 X X (lSMHz) X X 40 44
8OC32152187C52 X X X X X 40 40 44 44 44
80/83/87C575 X X X X 40 40 44 44 44
80/83/87C552 X X X X X 68 68 so
80/83C562 X X X 68
(-4010+125)
80/83/87C652 X X X X X 40 40 44 44 44
(-4010 +125)
83C053 X X 42
SDIP
83/87C054 X X 42
SDIP
83/87C654 X X X X X 40 40 44 44 44
(-40 10+125)
83CE654 X X X 44
80/83/87C592 X X 68 68
(-40 10+125)
80/83/87C528 X X X X X 40 40 44 44 44
(-40 10 +125)
NOTE:
All combinations of part type, speed, temperature, and package may not be available.
February 1992 xi
Signetics 80C51-Based 8-Bil Mlcroconlrollers
80C32 P80C32EB
80C32-1 P80C32GB
80C52 80C52T2 P80C52EB
80C52-1 P80C52GB
NOTES:
1, Siemens 8032A-16 = 16MHz 8032.
2. AMD 80C52T2 = 80C52 without T2.
3. 80XXAHL =80XX with low power standby pin; H = HMOS.
NOTE:
For more information on Development Support, see Section 6 of this book.
To better serve our customers, Signetics maintains a microcontroller bulletin board. This computer bulletin board system features a
microcontroller newsletter, application and demonstration programs for download, and the ability to send messages to microcontroller application
engineers. The system can be accessed with a modem at 2400, 1200, or 300 baud.
The telephone numbers are:
We also have a ROM code bulletin board through which you can submit ROM codes. This is a closed bulletin board for security reasons. To get
an 10, contact your local sales office. The system can be accessed with a 2400, 1200, or 300 baud modem, and is available 24 hours a day.
The telephone number is:
(408) 991-3459
February 1992 xv
Signetics 80C51-Based 8-Bit Microcontrollers
February 1992 xx
Signetics 80C51-Based 8-Bit Microcontrollers
16-BIT CONTROLLERS
TYPE (EP)ROM RAM SPEED FUNCTIONS REMARKS DEVELOPMENT TOOLS
(MHz)
68070 - - 17.5 2 DMA channels, MMU, UART, 16-bit 0M4160 Microcore
timer, 12C, 68000 bus interface, 0M4161 (SBE68070)
16Mb address range TRACE32-ICE68070 (Lauterbach)
0M4222 90C Development
system (planned)
93Cl0l 34k 512 15 Derivative with low power modes Low power
micro-
controller
OOC100 - 512 15 UART, 12C, 3 16-bit timers, 0M4160/3 Microcore 3
93Cl00 34k 512 15 80C51 interface, 68000 interface, OM4201WP (SBE90Cll0)
97Cl00 32k 512 15 40110 lines, 2Mb address range 0M4220 OOC Development system
(EPROM) TRACE32-ICE93Cll0
(Lauterbach)
80C51-Based
8-Bit Microcontrollers
CONTENTS
80C51 Family Overview ................................................. 3
8051.. ...... ...... ....... ....... ....... ..... ....... ....... ......... 3
80C51 ............................................................. 3
80CL51 ............................................................ 3
8052.. ... .. ... .. .. ... . ... ... .. ..... .. .. ... .. ....... . .... . ... . .. .. .. 4
80C52 ............................................................. 4
83C053 ............................................................ 4
83CL410 ........................................................... 4
83C451 ............................................................ 4
83C528 ............................................................ 4
83C550 ............................................................ 4
83C552 ............................................................ 4
83C562 ............................................................ 6
83C575 ............................................................ 6
87C592 ............................................................ 6
83C652 ............................................................ 6
83C654 ............................................................ 6
83C751 ............................................................ 6
83C752 ............................................................ 6
83C851 ............................................................ 6
83C852 ............................................................ 6
80C51 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Memory Organization ................................................. 8
Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Data Memory .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
80C51 Family Instruction Set ........................................... 11
Program Status Word. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Addressing Modes ................................................. 12
Direct Addressing ............................................... 12
Indirect Addressing . . .. . .. .. . . ... .... .. . . . ..... .. ... .. .. .. . . . .. .. 12
Register Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Register·Specific Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Immediate Constants ............................................ 12
Indexed Addressing ............................................. 12
Arithmetic Instructions .............................................. 12
Logicallnstructions ................................................ 13
Data Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Internal RAM.. .......... .. .. ..... ....... ....... ... .. ....... .. .. 13
External RAM .................................................. 14
Lookup Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Boolean Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Relative Offset ................................................. 15
Jump Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
CPU Timing ...................................................... 17
Machine Cycles ................................................... 17
Interrupt Structure ................................................. 18
Interrupt Enables ............................................... 18
Interrupt Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Simulating a Third Priority Level in Software .......................... 22
Hardware Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Special Function Registers ............................................. 24
Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
B Register ....................................................... 24
Program Status Word ............................ ..... ........... 24
Stack Pointer ..................................................... 24
Data Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Ports a to 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Serial Data Buffer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Timer Registers Basic to 80C51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Control Register for the 80C51 ....................................... 24
Signetics 80C51-Based 8-Bit Microcontrollers
CONTENTS (Continued)
Hardware Description (continued)
Port Structures and Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
I/O Configurations ................................................. 25
Writing to a Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Port Loading and Interfacing ......................................... 26
Read-Modify-Write Feature .......................................... 27
Accessing External Memory ............................................ 28
Timer/Counters ...... :........ ............. ..... ................ 28
Timer 0 and Timer 1 ................................................ 28
ModeO .......................................................... 28
~1 .......................................................... ~
Mode 2 ...................................................... .... 28
Mode3 .......................................................... 28
Standard Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Multiprocessor Communications ...................................... 31
Serial Port Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Baud Rates ...................................................... 31
Using Timer 1 to Generate Baud Rates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
More About Mode 0 ................................................ 32
More About Mode 1 ................................................ 33
More About Modes 2 and 3 .......................................... 33
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Priority Level Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
How Interrupts Are Handled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Extemallnterrupts ................................................. 40
Response Time ................................................... 40
Single-Step Operation ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Reset. ... .. ... .. . . ... .. .. . .. .. .. ... ...... . .. . . .. . ..... .. .... . .. .. .. 40
Power-on Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Power-Saving Modes of Operation ....................................... 41
CMOS Power Reduction Mode ....................................... 41
Idle Mode. .. .. . .. .. ... .. .... . . . . . ..... .. ... .. ... .... ... . . .. ... .. .. .. 41
Power-Down Mode ................................................... 42
ONCE Mode .......... ....................................... 42
The On-Chip Oscillators ............................................... 43
NMOS Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
CMOS Versions .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Internal Timing. , .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
80C51 Pin Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
SECTION 1
80C51 family overview 80C51 FAMILY
80C51 FAMILY OVERVIEW 8051 have on-chip ROM. The 8031 fetches all
The Philips 80C51 family of products is The 8051 is the original member of the family. instructions from external memory.
based on the industry standard for 8·bit high Among the features of the 8051 are:
performance microcontroliers. The • 8-bit CPU optimized for control applications 80C51
architecture for the family has been optimized The 80C51 is the CMOS version of the 8051.
for sequential real time control applications. • Extensive Boolean processing (single-bit
Functionally it is fully compatible with the
The 80C51 family of products are used in a logic) capabilities
8051, but being CMOS it draws less current
wide range of applications from those that are • 32 bidirectional and individually than its NMOS counterpart,
relatively simple to applications in medical addressable I/O lines
The ROMless version of the 80C51 is the
instrumentation and automobile control
• 128 bytes of on-chip data RAM 80C31. The EPROM version is the B7C51.
systems. All of the devices included in the
family are available in versions that have • Two 16-bit timer/counters
either internal ROM, EPROM, or CPU only. • Full duplex UART 80CL51
With the exception of the 83C751 and 752 The 80Cl51 is a low power version of the
(which are limited to on-board memory) all of • 5-source interrupt structure with 2 priority
BOC51. Functionally it is fully compatible with
the devices in the family can address up to levels
the BOC51 and B051. The part can be
64k bytes of both program and data memory. • On-Chip clock oscillator operated at voltages from I.BV to 6V and at
• 4k bytes of on-chip program memory oscillator frequencies from DC to 12MHz. The
The 80C51 family of microcontrollers includes
main benefit of this part is its ability to
the devices listed in Table 1. The basic o 64k bytes program memory address space significantly reduce the current consumption
architecture of these devices is shown in
• 64k bytes data memory address space in an application when it is operated at
Figure 1.
voltages and frequencies that are lower than
• 40-pin DIP and 44-pin PlCC packages
those which the BOC51 will operate.
The 8031 is a CPU only version of the 8051
and differs from the 8051 in that it does not
February 1992 3
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family overview 80C51 FAMILY
February 1992 4
Signetics 8OC51-Based a-Bit Microcontrollers
SECTION 1
80C51 family overview
80C51 FAMILY
r -,
32kROM
I I in8XC528
16k ROM
Timer 2
Capture/
Com_
I I In8XC054,
8XC592,
8XC654 512 RAM I
Array
(8XC552,
I- ::~ -L-
8XC592
Externaf
Interrupts BkROM 256 RAM
In 8052, In 11052,
I I
J1
8XC52, 8XC52, (8052,
8XC053, 8XC552, 8XC52,
8XC552 8XC562, 8XC528,
8XC562, 8SC575) -
8XC575.
8XC652
>' :~g:~~ Counter
InpUlll
t---}
128 8XC654
'Interrupt
Control 2kROM t--
Timer 1
in 83C751. RAM 64 RAM 1------1
83C752 In 830751,
830752
Timer 0 t--
256 EEPROM
83C651
AID
(8XC550,
CPU 8XC552,
l'v 8XC562,
aXC592,
8XC752)
Bua
-.., f+--- SCl j2c
Osc Control Four 1/0 Porta 110
Port
I Serial
Perta
~ SOA
Serial
Pert
t-IDI- !!
Watchdog
n~ ~ 1
TXO RXO
i i
limer
(8XC528, PWMSystem
8XC550. J\,~
L -________ ~:g~
8XC552, PO P2 PI P3 P4-P5-P6
8XC562, 8XC575,
8XC575. '----v---' 8XC592,
8XC592) I A AddresalData 8XC752)
I----KV~
I~
Fixed Rate
Timer
(83075112)
NOTES:
Po-P31or 8051,8052, 8XC52, BXCL410,
8XC528, 8XC551, BXC575, 8XC652, 8XC654
PO·P5Ior BXC552, axC562, BXC592
po-PSlor BXC451
Pari 01 PO, and PI, P3lor BXC751 and BXC752
February 1992 5
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family overview
80C51 FAMILY
February 1992 6
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family overview
80C51 FAMILY
February 1992 7
Signetics 80C51-8ased 8-811 Microconlrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
80C51 ARCHITECTURE the gate as the read strobe to the external 1000H through FFFFH are directed to
Program/Data memory. external ROM.
MEMORY ORGANIZATION Program Memory It the Eli pin is strapped to Vss, then all
All 80C51 devices have separate address program fetches are directed to extemal
Figure 3 shows a map of the lower part of the
spaces for program and data memory, as ROM. The.ROMless parts (80S1, 8OC31 ,
Program Memory. After reset, the CPU
shown in Figures 1 and 2. The logical etc.) must have this pin externally strapped to
begins execution from location ooooH. As
separation of program and data memory Vss to enable them to execute from external
shown in Figure S, each interrupt is assigned
allows the data memory to be accessed by Program Memory.
a fixed location in Program Memory. The
8-bit addresses, which can be quickly stored interrupt causes the CPU to jump to that The read strobe to external ROM, PSEN, is
and manipulated by an 8-bit CPU. location, where it commences execution of used for all external program fetches. PSEN
Nevertheless, 16-bit data memory addresses the service routine. External Interrupt a, for is not activated for internal program fetches.
can also be generated through the DPTR example, is assigned to location ooaSH. It
register. The hardware configuration ·for external
External Interrupt a is going to be used, its
program execution is shown in Figure 4. Note
Program memory (ROM, EPROM) can only service routine must begin at location ooaSH.
that 16 I/O lines (Ports 0 and 2) are dedicated
be read, not written to. There can be up to If the interrupt is not going to be used, its
to bus functions during external Program
64k bytes of program memory. In the 80C51 , service location is available as general
Memory fetches. Port 0 (PO in Figure 4)
the lowest 4k bytes of program are on-chip. purpose Program Memory.
serves as a multiplexed address/data bus. It
In the ROMless versions, all program The interrupt service locations are spaced at emits the low byte of the Program Counter
memory is external. The read strobe for
8-byte intervals: aaa3H for External Interrupt (PCl) as an address, and then goes into a
external program memory is the PSEN
a, aaaBH for TImer a, aa13H for External float state awaiting the arrival of the code
(program store enable).
Interrupt 1, 001 BH for TImer 1, etc. It an byte from the Program Memory. During the
Data Memory (RAM) occupies a separate interrupt service routine is short enough (as is time that the low byte of the Program Counter
address space from Program Memory. In the often the case in control applications), it.can is valid on Port a, the signal ALE (Address
8aC51, the lowest 128 bytes of data memory reside entirely within that 8-byte interval. Latch Enable) clocks this byte into an
are on-chip. Up to 64k bytes of external RAM longer service routines can use a jump address latch. Meanwhile, Port 2 (P2 in
can be addressed in the external Data instruction to skip over subsequent interrupt Figure 4) emits the high byte of the Program
Memory space. In the ROMless version, the locations, if other interrupts are in use. Counter (PCH). Then PSEN strobes the
lowest 128 bytes are on-chip. The CPU The lowest 4k bytes of Program Memory can EPROM and the code byte is read into the
generates read and write signals, RlJ and microcontroller.
either be in the on-chip ROM or in an external
WR, as needed during external Data Memory ROM. This selection is made by strapping the Program Memory addresses are always 16
accesses.
Eli (External Access) pin to either Vee, or bits wide, even though the actual amount of
External Program Memory and external Data Vss. In the 8aC51 , if the Eli pin is strapped to Program Memory used may be less than 64k
Memory may be combined if desired by Vee, then the program fetches to addresses bytes. External program execution sacrifices
applying the RD and PSEN signals to the aaaaH through OFFFH are directed to the two of the 8-bit ports, PO and P2, to the
inputs of an AND gate and using the output of internal ROM. Program fetches to addresses function of addressing the Program Memory.
External
Interrupts
Counter
Inputs
TXD RXD
PO P2 PI P3
L-.,----J
Address/Data
February 1992 8
Signetics BOC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
~OFFFH~ ,,
FFH: .-----~----~
Intem ..
,
,
B=O B=1 ,
External Internal
----f-------------------- -------------------f---r---
PSER RD WR
BOC51 EPROM
0023H
I
OO1BH
BBytes
0013H
OOOBH
Latch
P2
0003H
t-------v
PSEH t----------i tIE
OOOOH
Figure 3. 80C51 Program Memory Figure 4. Executing from External Program Memory
Data Memory accesses. There can be up to 64k bytes of Internal Data Memory is mapped in Rgure 6.
The right half of Figure 2 shows the internal external Data Memory. External Data The memory space is shown divided into
and external Data Memory spaces available Memory addresses can be either 1 or 2 bytes three blocks, which are generally referred to
to the 80C51 user. Figure 5 shows a wide. One-byte addresses are often used in as the Lower 128, the Upper 128, and SFR
hardware configuration for accessing up to 2k conjunction with one or more other 110 lines space.
bytes of external RAM. The CPU in this case to page the RAM, as shown in Rgure 5.
Internal Data Memory addresses are always
is executing from internal ROM. Pori 0 serves
Two-byte addresses can also be used, in one byte wide, which implies an address
as a multiplexed address/data bus to the
which case the high address byte is emitted space of only 256 bytes. However, the
RAM, and 3 lines of Pori 2 are being used to
at Pori 2. addressing modes for internal RAM can in
page the RAM. The CPU generates RU and
WR signals as needed during external RAM
February 1992 9
Signetics BOC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
fact accommodate 384 bytes, using a simple the Program Status Word (PSW) select which All of the bytes in the Lower 128 can be
trick. Direct addresses higher than 7FH register bank is in use. This allows more accessed by either direct or indirect
access one memory space, and indirect efficient use of code space, since register addressing. The Upper 128 (Figure 8) can
addresses higher than 7FHO access a instructions are shorter than instructions that only be accessed by indirect addressing.
different memory space. Thus Figure 6 shows use direct addressing.
Figure g gives a brief look at the Special
the Upper 128 and SFR space occupying the
The next 16 bytes above the register banks Function Register (SFR) space. SFRs include
same block of addresses, BOH through FFH,
form a block of bit-addressable memory the Port latches, timers, peripheral controls,
although they are physically separate entities.
space. The 80C51 instruction set indudes a etc. These registers can only be accessed by
The Lower 128 bytes of RAM are present in wide selection cif single-bit instructions, and direct addressing. Sixteen addresses in SFR
all BOC51 devices as mapped in Figure 7. the 128 bits in this area can be directly space are both byte- and bit-addressable.
The lowest 32 bytes are grouped into 4 banks addressed by these instructions. The bit The bit-addressable SFRs are those whose
of 8 registers. Program instructions call out addresses in this area are OOH through 7FH. address ends in OH or 8H.
these registers as RO through R7. Two bits in
Da..
FFH .--------r------,
I Accessible Accessible
FFH
80H • 80H
7FH r-----------t,.~---------J
Accessible
Lower by Direct Ports,
128 and Indirect Status and
Control Bits,
Addressing Special { limer,
o L-_ _ _ _- ' ::::: Registers,
Stack Pointer,
Accumulator
110 \ Page WE
(Etc.)
Bits
7FH FFH
}
Bank 2FH
Select
Bits In Bit-Addre888b1e Space No Bit-Addre88able
PSW (Bit Addressea 0-7F) Spaces
t 20H
11{ 18H
lFH
17H
10H 4 Banksol
8 Regi sters
OFH RO-A7
01
10
1
08H
07H Reset Value of
00 Stack Pointer
0 80H
Figure 7. Lower 128 Bytes oflnternal RAM Figure 8.. Upper 128 Bytes of Internal RAM
February 1992 10
Signetics 8OC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
FFH
RegI_-1IIppocI P _
BlH Ace
_ _ _ lnOHar
8Hore .....
bit_.
BOH Port 3
Port PI..
AOH Portz Accumul.tor
PSW
(Elc.)
OOH Port 1
80H PortO
Figure 9. SFRSpace
PSWO
PSW6 _ _ _--'
PSW1
AUXIliary carry Rag _ _ carry out from
U..._ l I a g
bit 3 01 adcItion opennd..
PSW5 _ _ _ _ _---J
pswz
GeneraI_ae ate... nog OVerIIow ••g ..t III'
_copenti_
PSW4 _ _ _ _ _ _ _ _ _ ~
PSW3
Reglater bank aeIect bit 1 Register _ aeIect bit 0
80C51 FAMILY INSTRUCTION SET state of the CPU. The PSW, shown in locations as RO through R7. The selection of
The 80C51 instruction set is optimized for Figure 10, resides in the SFR space. It which of the four is being referred to is made
B-bit control applications. It provides a variety contains the Carry bit, the Auxiliary Carry (for on the basis of the RSO and RS1 at execution
of fast addressing modes for accessing the BCD operations), the two register bank select time.
internal RAM to facilitate byte operations on bits, the Overflow flag, a Parity bit, and two
The Parity bit reflects the number of 1s in the
small data structures. The instruction set user-definable status flags.
Accumulator: P = 1 if the Accumulator
provides extensive support for one-bit The Carry bit, other than serving the function contains an odd number of 1s, and P = 0 if
variables as a separate data type. allowing of a Carry bit in arithmetic operations, also the Accumulator contains an even number of
direct bit manipulation in control and logic serves as the "Accumulator" for a number of 1s. Thus the number of 1s in the Accumulator
systems that require Boolean processing. Boolean operations. plus P is always even. Two bits in the PSW
Program Status Word are uncommitted and may be used as
The bits RSO and RS1 are used to select one
general purpose status flags.
The Program Status Word (PSW) contains of the four register banks shown in Figure 7.
several status bits that reflect the current A number of instructions refer to these RAM
February 1992 11
Signetics 8OC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 farnilyarchitecture
'80C51 FAMILY
Addressing Modes Immediate Constants instructions execute in 111S except the INC
The addressing modes in the 8OC51 The value of a constant can follow the DPTR instruction, which takes 211S, and the
instruction set are as follows: opcode in Program Memory. Forexample, Multiply and Divide instructions, which lake
411S.
Direct Addressing MeV A,#l00
In direct addressing the operand is specified Note that any byte in the internal Data
loads the Accumulator with the decimal
by an 8-bit address field in the instruction. Memory space can be incremented without
number.l00. The·same number could be
· Only internal Data RAM and SFRs can be going through the Accumulator.
specified in hex digits as 64H.
directly addressed. One 01 the INC instructions operates on the
Indexed Addressing 16-bit Data Pointer. The Data Pointer is used
Indirect Addressing Only program Memory can be accessed with to generate 16-bit addresses for external
In indirect addressing the instruction specifies indexed addressing, and it can only be read. memory, so being able to increment it in one
a register which contains the address of the This addressing mode is intended for reading 16-bit operation is a usefulleature.
operand. Both internal and external RAM can look-up tables in Program Memory A 16-bit
be indirectly addressed. base register (either DPTR or the Program The MUL AB instruction multiplies the
Counter) points to the base of the table, and Accumulator by the data in the B register and
The address register for 8-bit addresses can
the Accumulator is set up with the table entry puts the 16-bit product into the concatenated
be RO or Rl of the selected bank, or the
number. B and Accumulator registers.
Stack Pointer. The address register for 16-bit
addresses can only be the 16-bit "data The address of the table entry in Program The DIV AB instruction divides the
pointer" register, DPTR. Memory is formed by adding the Accumulator Accumulator by the data in the B register and
.. data to the base pointer. leaves the 8-bit quotient in the Accumulator,
Register Instructions and the 8-bit remainder in the B register.
The register banks, containing registers RO Another type of indexed addressing is used in
through R7, can be accessed by cerlain .the "case jump" instruction. In this case the Oddly enough, DIV AB finds less use in
instructions which carry a 3-bit register destination address of a jump instruction is arithmetic "divide" routines than in radix
specification within the opcode of the computed as the sum of the base pointer and conversions and programmable shift
instruction. Instructions that access the the Accumulator data. operations. An example 01 the use 01 DIV AB
registers this way are code efficient, since in a radix conversion will be given later. In'
this mode eliminates an address byte. When Arithmetic Instructions shift operations, dividing a number by 2n
the instruction is executed, one of the eight The menu of arithmetic instructions is listed in shifts its n bits to the right. Using DIV AB to
registers in the selected bank is accessed. Table 1. The table indicates the addressing perform the division completes the shift in
One of four banks is selected at execution modes that can be used with each instruction 411S and leaves the B register holding the bits
time by the two bank select bits in the PSW. to access the <byte> operand. For example, that were shifted out. The DA A instruction is
the ADD A,<byte> instruction can be written for BCD arithmetic operations. In BCD
Reglster-Specific Instructions as: arithmetic~ ADD and ADDC instructions
Some instructions are specific to a cerlain should always be followed by a DA A
· register. For example, some instructions ADD a, 7FH (direct addressing) operation, fo ensure that the result is also in
always operate on the Accumulator, or Data ADD A, @RO (indirect addressing)
BCD. Note that DA A will not convert a binary
· Pointer, etc., so no address byte is needed to ADD a, R7 (register addressing)
number to BCD. The DA A operation
point to it. The opcode itself does that. ADD .. A, #127 (immediate constant)
produces a meaninglul result only as the
Instructions that refer to the Accumulator as The execution times listed in Table 1 assume second step in the addition 01 two BCD bytes.
A assemble as accumulator specific opcodes. a 12MHz clock frequency. All of the arithmetic
February 1992 12
Signetics BOC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family architecture 80C51 FAMILY
Logical Instructions If the operation is in response to an interrupt, the internal memory spaces, and the
Table 2 shows the list of BOC51 logical not using the Accumulator saves the time and addressing modes that can be used with
instructions. The instructions that perform effort to push it onto the stack in the service each one. With a 12MHz clock, all of these
Boolean operations (AND, OR, Exclusive OR, routine. instructions execute in either 1 or 2~.
NOT) on bytes perform the operation on a The Rotate instructions (RL, A, RLC A, etc.) The MOV <des!>, <src> instruction allows
bit-by-bit basis. That is, if the Accumulator shift the Accumulator 1 bit to the left or right. data to be transferred between any two
contains 00110101 B and byte contains For a left rotation, the MSB rolls into the LSB internal RAM or SFR locations without going
0101OOllB, then: position. For a right rotation, the LSB rolls through the Accumulator. Remember, the
ANL A, <byte> into the MSB position. Upper 12B bytes of data RAM can be
accessed only by indirect addressing, and
will leave the Accumulator holding The SWAP A instruction interchanges the
SFR space only by direct addressing.
0001 0001 B. high and low nibbles within the Accumulator.
This is a useful operation in BCD Note that in BOC51 devices, the stack resides
The addressing modes that can be used to manipulations. For example, if the in on-chip RAM, and grows upwards. The
access the <byte> operand are listed in Accumulator contains a binary number which PUSH instruction first increments the Stack
Table 2. is known to be less than 100, it can be Pointer (SP), then copies the byte into the
The ANL A, <byte> instruction may take any quickly converted to BCD by the following stack. PUSH and POP use only direct
of the forms: code: addressing to identify the byte being saved or
restored, but the stack itself is accessed by
ANL A,7FH (direct addressing) MOVE B,#10
indirect addressing using the SP register.
ANL A,@Rl (indirect addressing) DIV AB
This means the stack can go into the Upper
ANL A,RS (register addressing) SWAP A
12B bytes of RAM, if they are implemented,
ANL A,#53H (immediate constant) ADD A,B
but not into SFR space.
All of the logical instructions that are Dividing the number by 10 leaves the tens
The Upper 12B bytes of RAM are not
Accumulator-specific execute in l~s (using a digit in the low nibble of the Accumulator, and
implemented in the BOC51 nor in its ROMless
12MHz clock). The others take 2~s. the ones digit in the B register. The SWAP
or EPROM counterparts. With these devices,
and ADD instructions move the tens digit to
Note that Boolean operations can be if the SP points to the Upper 12B, PUSHed
the high nibble of the Accumulator, and the
performed on any byte in the internal Data bytes are lost, and POPed bytes are
ones digit to the low nibble.
Memory space without going through the indeterminate.
Accumulator. The XRL <byte>, #data Data Transfers The Data Transfer instructions include a
instruction, for example, offers a quick and lS-bit MOV that can be used to initialize the
easy way to invert port bits, as in XRL P 1, Internal RAM
Data Pointer (DPTR) for look-up tables in
#OFFH. Table 3 shows the menu of instructions that
Program Memory, or for 16-bit external Data
are available for moving data around within
Memory accesses.
February 1992 13
Signetics 8OC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
Table 3. Data Transfer Instructions that Access Internal Data Memory Space
MNEMONIC OPERATION ADDRESSING MODES EXECUTION
DIR IND REG IMM TIME (!is)
MOV A,<src> A = <src> X X X X 1
MOV <dest>,A <dest> =A X X X 1
MOV <dest>,<src> <dest> = <src> X X X X 2·
MOV DPTA,#dataI6 DPTA = 16-bit immediate constant X 2
PUSH <src> INC SP:MOV"@SP",<src> X 2
POP <dest> MOV <deSI>,~@SP":DEC SP X 2
XCH A,<byte> ACC and <byte> exchange data X X X 1
XCHD A,@Ai ACC and @Ai exchange low nibbles X 1
The XCH A, <byte> instruction causes the To right-shift by an odd number of digits, a External RAM
Accumulator and addressed byte to one-digit shift must be executed. Table 4 shows a list of the Data Transfer
exchange data. The XCHD A, @Ri instructions that access external Data
Figure 12 shows a sample of code that will
instruction is similar, but only the low nibbles Memory. Only indirect addressing can be
right-shift a BCD number one digit, using the
are involved in the exchange. used. The choice is whether to use a
XCHD instruction. Again, the contents of the
one-byte address, @Ai, where Ai ca.n be
To see how XCH and XCHD can be used to registers holding the number and of the
either AO or AI of the selected register bank,
facilitate data manipulations, consider first the Accumulator are shown alongside each
or a two-byte address, @DPTR. The
problem of shifting an 8-digit BCD number instruction.
disadvantage to using 16-bit addresses if only
two digits to the right. Figure 11 shows how
First, pointers Rl and AO are set up to point a few k bytes of external RAM are involved is
this can be done using direct MOVs, and for
to the two bytes containing the last four BCD that IS-bit addresses use all 8 bits of Port 2
comparison how it can be done using XCH
digits. Then a loop is executed which leaves as address bus. On the other hand, 8-bit
instructions. To aid in understanding how the
the last byte, location 2EH, holding the last addresses allow one to address a few bytes
code works, the contents of the registers that
two digits of the shifted number. The pointers of AAM, as shown in Figure 5, witliout having
are holding the BCD number and the content
are decremented, and the loop is repeated for to sacrifice all of Port 2. All of these
of the Accumulator are shown alongside each
location 2DH. The CJNE instruction instructions execute in 2 11s, with a 12MHz
instruction to indicate their status after the
(Compare and Jump if. Not Equal) is a loop clock.
instruction has been executed.
control that will be described later. The loop
Note that in all external Data AAM accesses,
After the routine has been executed, the executed from LOOP to CJNE for AI = 2EH,
the Accumulator is always either the
Accumulator contains the two digits that were 2DH, 2CH, and 2BH. At that point the digit
destination or source of the data.
shifted out on the right. Doing the routine with that was originally shifted out on the right has
direct MOVs uses 14 code bytes and 911S of propagated to location 2AH. Since that The read and write strobes to external RAM
execution time (assuming a 12MHz clock). location should be left with Os, the lost digit is are activated only during the execution of a
The same operation with XCHs uses only 9 moved to the Accumulator. MOVX instruction. Normally these signals are
bytes and executes almost twice as fast. inactive, and in fact if they're not going to .be
used at all, their pins are available as extra
110 lines.
2A 28 2C 2D 2E ACC Ace
Figure 1,. Shifting a BCD Number Two Digits to the Right Figure 12. Shifting a BCD Number One Digit to the Right
February 1992 14
Signetics 8OC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
Table 4. 80C51 Data Transfer Instructions that Access External Data Memory Space
ADDRESS MNEMONIC OPERATION EXECUTION
WIDTH TIME (lUI)
8 bits MOVXA,@Ri Read extemal RAM @Ri 2
8 bits MOVX@Ri,A Write extemal RAM @ Ri 2
16 bits MOVX A,@DPTR Read extemal RAM @ DPTR 2
16 bits MOVX@DPTR,A Write extemal RAM @ DPTR 2
Lookup Tables contains 128 addressable bits, and the SFR C = bitl .xRL. bi12
Table 5 shows the two instructions that are space can support up to 128 addressable bits
The software to do that could be as follOWS:
available for reading lookup tables in as well. All of the port lines are
Program Memory. Since these instructions bit-addressable, and each one can be treated" MOV C,bit1
access only Program Memory, the lookup as a separate single-bit port. The instructions JNB bi12,OVER
tables can only be read, not updated. that access these bits are not just conditional CPL C
branches, but a complete menu of move, sel, OVER: (continue)
If the table access is to extemal Program
clear, complement, OR, and AND
Memory, then the read strobe is PSEJiI. Rrst, bitl is moved to the Carry. If bi12 = 0,
instructio"ns. These kinds of bit operations are
then C now contains the correct result. That
The mnemonic is MOVC for "move constant." not easily obtained in other architectures with
is, bit1 .XRL. bi12 = bil1 if bi12 = O. On the
The first MOVC instruction in Table 5 can any amount of byte-oriented software.
other hand, if bi12 = 1, C now contains the
accommodate a table of up to 256 entries
numbered 0 through 255. The number of the The instruction set lor the Boolean processor complement of the correct result. It need only
is shown in Table 6. All bit accesses are by be inverted (CPL C) to complete the
desired entry is loaded into the Accumulator,
direct addressing. operation.
and the Data Pointer is set up to point to the
beginning of the table. Then: Bit addresses OOH through 7FH are in the This code uses the JNB instruction, one of a
Lower 128, and bit addresses 80H through series of bit-test instructions which execute a
MOVC A,@A+DPTR
FFH are in SFR space. jump if the addressed bit is set (JC, JB, JBC)
copies the desired table entry into the or if the addressed bit is not set (JNC, JNB).
Accumulator. Note how easily an intemal flag can be
In the above case, bi12 is being tested, and if
moved to a port pin:
The other MOVC instruction works the same bi12 = 0, the CPL C instruction is jumped
way, except the Program Counter (PC) is MOV C,FLAG over.
used as the table base, and the table is MOV P1.0,C
JBC executes the jump if the addressed bit is
accessed through a subroutine. First the In this example, FLAG is the name of any set, and also clears the bit. Thus a flag can
number of the desired entry is loaded into the addressable bit in the Lower 128 or SFR be tested and cleared in one operation. All
Accumulator, imd the subro~tine is called: space. An 1/0 line (the LSB of Port 1, in this the PSW bits are directly addressable, so the
MOV A,ENTRY NUMBER case) is set or cleared depending on whether Parity bit, or the general purpose flags, for
CALL TABLE the flag bilis 1 or O. example, are also available to the bit-test
instructions.
The subroutine "TABLE" would look like this: The Carry bit in the PSW is used as the
single-bit Accumulator of the Boolean Relative Offset
TABLE: MOVC A,@A+PC processor. Bit instructions that refer to the The destination address for these jumps is
RET Carry bit as C assemble as Carry-specific specified to the assembler by a label or by an
The table itself immediately follows the RET instructions (CLR C, etc.). The Carry bit also actual address in Program memory. However,
(return) instruction in Program Memory. This has a direct address, since it resides in the the destination address assembles to a
type of table can have up to 255 entries, PSW register, which is bit-addressable. " relative offset byte. This is a signed (two's
numbered 1 through 255. Number 0 cannot Note that the Boolean instruction set inclUdes complement) offset byte which is added to
be used, because at the time the MOVC ANL and ORL operations, but not the XRL the PC in two's complement arithmetic if the
instruction is executed, the PC contains the (Exclusive OR) operation. An XRL operation jump is executed. The range of the jump is
address of the RET instruction. An entry is simple to implement in soltware. Suppose, therefore -128 to +127 Program Memory
numbered 0 would be the RET opcode itself. for example, it is required to form the bytes relative to the first byte following the
Exclusive OR of two bits: instruction.
Boolean Instructions
8OC51 devices contain a complete Boolean
(single-bit) processor. The internal RAM
February 1992 15
Signetics 8OC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
Jump Instructions is 3 bytes long, consisting of the opcode and address into the correct fonnat for the given
Table 7 shows the list of unconditional jumps two address bytes. The destination address instruction. If the fonnat required by the
with execution time for a 12MHz clock. ' can be anywhere in the 64k Program Memory instruction will not support the distance to the
space. specified destination address, a "Destination
The table lists a single "JMP addr" instruction, out of range" message is written into the list
but in fact there are three SJMP, WMP, and The AJMP instruction encodes the
file.
AJMP, which differ in the format olthe destination address as an II-bit constant.
destination address. JMP is a generic The instruction is 2 bytes long, consisting of The JMP @A+DPTR instruction supports
mnemonic which can be used if the the opcode, which itself contains 3 of the 11 case jumps. The destination address is
programmer does not care which way the address bits, followed by another byte computed at execution time as the sum of the
jump is encoded. containing the low 8 bits of the destination 16-bit DPTR register and the Accumulator.
address. When the instruction is executed, Typically, DPTR is set up with the address of
The SJMP instruction encodes the these 11 bits are simply substituted for the a jump table. In a 5-way branch, for example,
destination address as a relative offset, as low 11 bits in the PC. The high 5 bits stay the an integer 0 through 4 is loaded into the
described above. The instruction is 2 bytes same. Hence the destination has to be within Accumulator. The code to be executed might
long, consisting of the opcode and the the same 2k block as the instruction following be as follows:
relative offset byte. The jump distance is theAJMP,
limited to a range of-128to +127 bytes MOV DPTR,#JUMP TABLE
relative to the instruction following the SJMP, In all cases the programmer specifies the MOV A,INDEX_NUMBER
destination address to the assembler in the Rl A
The lJMP instruction encodes the destination same way: as a label or as a 16-bit constant. JMP @A+DPTR
address as a 16-bit constant. The instruction The assembler will put the destination
February 1992 16
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture 80C51 FAMILY
The RL A instruction converts the index destination address the same way as the Examples of how to drive the clock with an
number (0 through 4) to an even number on other jumps: as a label or a 16-bit constant. external oscillator are shown in Figure 14.
the range a through 8, because each entry in Note that in the NMOS devices (8051, etc.)
There is no Zero bit in the PSW. The JZ and
the jump table is 2 bytes long: the signal at the XTAL2 pin actually drives the
JNZ instructions test the Accumulator data for
internal clock generator. In the CMOS
JUMP TABLE: that condition.
devices (BOC51 , etc.), the signal at the
AJMP CASEO XTAL 1 pin drives the internal clock generator.
The DJNZ instruction (Decrement and Jump
AJMP CASE 1 The internal clock generator defines the
if Not Zero) is for loop control. To execute a
AJMP CASE 2 sequence of states that make up the BOC51
loop N times, load a counter byte with Nand
AJMP CASE3
terminate the loop with a DJNZ to the machine cycle.
AJMP CASE4
beginning of the loop, as shown below for N =
Table 7 shows a single "CALL addr" 10. Machine Cycles
instruction, but there are two of them, LCALL A machine cycle consists of a sequence of 6
MOV COUNTER,#10 states, numbered Sl through SS. Each state
and ACALL, which differ in the format in
LOOP: (begin loop) time lasts for two oscillator periods. Thus a
which the subroutine address is given to the
CPU. CALL is a generic mnemonic which can • machine cycle takes 12 oscillator periods or
be used if the programmer does not care • 11!s if the oscillator frequency is 12MHz.
which way the address is encoded. o Each state is divided into a Phase 1 half and
(end loop) a Phase 2 half. Figure 15 shows that
The LCALL instruction uses the 16-bit
DJNZ COUNTER,LOOP fetch/execute sequences in states and
address format, and the subroutine can be
(continue) phases for various kinds of instructions.
anywhere in the 64k Program Memory space.
The ACALL instruction uses the 11-bit format, The CJNE instruction (Compare and Jump if Normally two program fetches are generated
and the subroutine must be in the same 2k Not Equal) can also be used for loop control during each machine cycle, even if the
block as the instruction following the ACALL. as in Figure 12. Two bytes are specified in instruction being executed doesn't require it.
the operand field of the instruction. The jump If the instruction being executed doesn't need
In any case, the programmer specifies the more code bytes, the CPU simply ignores the
is executed only if the two bytes are not
subroutine address to the assembler in the extra fetch, and the Program Counter is not
equal. In the example of Figure 12, the two
same way: as a label or as a 16-bit constant. incremented.
bytes were data in R1 and the constant 2AH.
The assembler will put the address into the
The initial data in R1 was 2EH. Every time Execution of a one-cycle instruction
correct format for the given instructions.
the loop was executed, R1 was decremented, (Figures 15a and 15b) begins during State 1
Subroutines should end with a RET and the looping was to continue until the R1 of the machine cycle, when the opcode is
instruction, which returns execution to the data reached 2AH. latched into the Instruction Register. A
instruction following the CALL. second fetch occurs during S4 of the same
Another application of this instruction is in
RETI is used to return from an interrupt "greater than, less than" comparisons. The machine cycle. Execution is complete at the
service routine. The only difference between two bytes in the operand field are taken as end of State 6 of this machine cycle.
RET and RETI is that RETI tells the interrupt unsigned integers. If the first is less than the The MOVX instructions take two machine
control system that the interrupt in progress is second, then the Carry bit is set (1). If the first cycles to execute. No program fetch is
done. If there is no interrupt in progress at the is greater than or equal to the second, then generated during the second cycle of a
time RETI is executed, then the RETI is the Carry bit is cleared. MOVX instruction. This is the only time
functionally identical to RET. program fetches are skipped. The
CPU Timing fetch/execute sequence for MOVX
Table 8 shows the list of conditional jumps
All 80C51 microcontrollers have an on-chip instructions is shown in Figure 15d.
available to the 80C51 user. All of these
oscillator which can be used if desired as the
jumps specify the destination address by the The fetch/execute sequences are the same
clock source for the CPU. To use the on-chip
relative offset method, and so are limited to a whether the Program Memory is internal or
oscillator, connect a crystal or ceramic
jump distance of -128 to +127 bytes from the external to the chip. Execution times do not
resonator between the XTAL 1 and XTAL2
instruction following the conditional jump depend on whether the Program Memory is
pins of the microcontroller, and capacitors to
instruction. Important to note, however, the internal or external.
ground as shown in Figure 13.
user specifies to the assembler the actual
February 1992 17
Signetics 8OC51-Based S-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
HMOS or
CMOS
XTAL2
OUortzcry_
or ceramic
raeanator ........... Cl
XTAL1
Vas
~
XTAL2 clock XTAL2 INC)
oignol
ExternoI ExternoI
clock XTAL1 XTAL1 clock XTAL1
oignoJ oignol
Figure 16 shows the signals and timing latch the low address byte from PO into the What follows is an overview of the interrupt
involved in program fetches when the address latch. structure for the device. More detailed
Program Memory is external. " Program inlormation for specific members of the
When the CPU is executing from internal
Memory is external. then the Program 8OC51 derivative family is provided in later
Program Memory, PSEN is not activated, and
Memory read strobe !'SER is normally chapters of this user's guide.
program addresses are not emitted. However.
activated twice per machine cycle, as shown
ALE continues to be activated twice per Interrupt Enables
in Figure 16a. "an access to external Data
machine cycle and so it is available as a Each interrupt source can be individually
Memory occurs. as shown in Figure 16b, two
clock output signal. Note, however, that one enabled or disabled by selling or clearing a
!'SERs are skipped, because the address
ALE is skipped during the execution of the bit in tlie SFR named IE (Interrupt Enable).
and data bus are being used for the Data
MOVX instruction. This register also contains a global disable
Memory acCess.
bit, which can be cleared io disable all
Note that a Data Memory bus cycle takes Interrupt Structure interrupts at once. Figure 17 shows the IE
twice as much time as a Program Memory The 80C51 and its ROMless and EPROM register.
bus cycle. Figure 16 shows the relative timing versions have 5 interrupt sources: 2 external
of the addresses being emitted at Ports 0 and interrupts. 2 timer interrupts, and the serial
2, and of ALE and !'SER. ALE is used to port interrupt.
February 1992 18
Signetics BOC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
Osc.
(XTAl2)
ALE
+-----'----'----'----'----'---+- - - - - - -
I
a. 1-byte, 1-cycle Instr~ction, e.g., INC A
- - - - - --I-----~-~--'------'----'-----t_- - - - --
~----"-_-"-_-'-----'-_--'-_+-_'-----L_-'--_-'-----'-_+- _____ _
- - - - - - -f------'----'-_l--.---'-_-"--,--.l..-----1_---L_--'---_'---------'--_+_ _____ _
DATA
February 1992 19
Signetics 80CS1-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
ALE
PSEN
RD
P2 : PCHout
PO
L PCLout
Valid L PCLout
Valid L PCLout
Valid L PCLout
Valid L PCLout
Valid
a. Without a MOVX
ALE
PSEN
RD
--JflL...-----I
I
I
I
P2 ~ i PCHout DPH out or P2 out i PCHout
PO
L
I
L PCLout
Valid
ADDR out
Valid L PCLout
Valid
b. With a MOVX
Figure 16. Bus Cycles in 80C51 Family Devices Executing from External Program Memory
February 1992 20
Signetics BOC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
EX1 IE.2 Enables or disables External Interrupll. If EX, PTO IP.t Enables or disables the Timer 0 Interrupt prior~
::; 0, External Interrupt 1 i8 disabled.
ity level. PTO = 1 programs it to the higher prior~
itylevcl.
Figure 17. Interrupt Enable (IE) Register Figure 18. Interrupt Priority (IP) Register
High Priority
Interrupt
IP Register
~o--+----l~
I 0--1----~
I
I Interrupt
~~+---+-~~--~--~
Polling
Sequence
I
I
o-o-tO--+--1-O.
I
I
I
TFl ~O--+_---+--Q
I 0--4----~
I
I
RI
TI o-otO--+----lf---O.
I o---r------I
Individual
Enables Global
Disable Low Priority
Interrupt
February 1992 21
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family architecture
80C51 FAMILY
Interrupt Priorities equal or higher priority level is already in level. First, interrupts that are to have higher
Each interrupt source can also be individually progress. priority than I are assigned to priority I in the
programmed to one of two priority levels by Interrupt Priority (IP) register. The service
The hardware-generated LCALL causes the
setting or clearing a bit in the SFR named IP routines for priority 1 interrupts that are
contents of the Program Counter to be
(Interrupt Priority). Figure 18 shows the IP supposed to be interruptable by priority 2
pushed into the stack, and reloads the PC
register. A low-priority interrupt can be interrupts are written to include the following
with the beginning address of the service
interrupted by a high-priority interrupt, but not code:
routine. As previously noted (Figure 3), the
by another low-priority interrupt. A
service routine for each interrupt begins at a PUSH IE
high-priority interrupt can't be interrupted by
any other interrupt source.
fixed location. MOV IE,#MASK
CALL LABEL
Only the Program Counter is automatically
If two interrupt requests of different priority
pushed onto the stack, not the PSW or any
levels are received simultaneously, the (execute service routine)
other register. Having only the PC ** ••••••••••••• *** •••••••
request of higher priority is serviced. If
automatically saved allows the programmer
interrupt requests of the same priority level POP IE
to decide how much time should be spent
are received simultaneously, an internal RET
saving other registers. This enhances the
polling sequence determines which request is LABEL: RETI
interrupt response time, albeit at the expense
serviced. Thus within each priority level there
of increasing the programmer's burden of As soon as any priority interrupt is
is a second priority structure determined by
responsibility. As a result, many interrupt acknowledged, the Interrupt Enable (IE)
the polling sequence. Figure 19 shows how
iunctions that are typical in control register is redefined so as to disable all but
the IE and IP registers and the polling
applications toggling a port pin for example, priority 2 interrupts. Then a CALL to LABEL
sequence work to determine which if any
or reloading a timer, or unloading a serial executes the RETI instruction, which clears
interrupt will be serviced.
buffer can often be completed in less time the priority I interrupt-in-progress flip-flop. At
In operation, all the interrupt flags are latched than it takes other architectures to complete. this point any priority I interrupt that is
into the interrupt control system during enabled can be serviced, but only priority 2
State 5 of every machine cycle. The samples Simulating a Third Priority Level in interrupts are enabled.
are polled during the following machine cycle. Software
Some applications require more than two POPing IE restores the original enable byte.
If the flag for an enabled interrupt is found to
priority levels that are provided by on-chip Then a normal RET (rather than another
be set (1), the interrupt system generates an
LCALL to the appropriate location in Program hardware in 80C51 devices. In these cases, RETI) is used to terminate the service
relatively simple software can be written to routine. The additional software adds lOllS
Memory, unless some other condition blocks
produce the same effect as a third priority (at 12MHz) to priority I interrupts.
the interrupt. Several conditions can block an
interrupt, among them that an interrupt of
February 1992 22
Signetics 80C51-Based 8-Bit Mlcrocontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
PO.O-PO.7 P2.0-P2.7
(--- .1+1+1+1+------------------- 1
1
1
~ 1
Vss 1 1
-Ii
1
1
1
1
1,.......,::-=-:=--. 1
1
11.----,,..-_.... 1
1 1
1 1
1 1
1 1
1 1
1
1
1 1
1 1
1 1
1 1
I..----'~-...., 1
1 1
IL....------' 1
1 1
1 1
1 1
1 PCON SCON TMOD TCON 1
1 1
T2CON THO TLO TH1
1
1
TL1
1
SBUF IE IP
1
1 Interrupt, Serial
Port. and limer
1
Blocks
1
Instruction~====::::;:::::========~~===;=~==;~:::...:=:;
R_gislet" ~ ' -_ _ _....
1
1
__________.J1
P1.0·P1.7 P3.0·P3.7
February 1992 23
Signetics aOCSI-Based a-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
Special Function Registers incremented before data is stored during initiates the transmission.) When data is
A Map of the on-chip memory area called the PUSH and CALL executions. While the stack moved from SBUF, it comes from the receive
Special Function Register (SFR) space is may reside anywhere in on-chip RAM, the buffer.
shown in Figure 2. Stack Pointer is initialized to 07H after a
reset. This causes the stack to begin at Timer Registers Basic to BOC51
Note that in the SFRs not all of the addresses locations 08H. Register pairs (THO, TLO), and (THI, TLI)
are occupied. Unoccupied addresses are not
are the 16-bit Counting registers for
implemented on the chip. Read accesses to
Data Pointer Timer/Counters 0 and I, respectively.
these addresses will in general return random The Data Pointer (DPTR) consists of a high
data, and write accesses will have no effect. byte (DPH) and a low byte (DPL). Its Controf Register for the 80C51
User software should not write I s to these intended function is to hold a 16-bit address. Special Function Registers IP,IE, TMOD,
unimplemented locations, since they may be It may be manipulated as a 16-bit register or TCON, SCON, and PCON contain control
used in other BOCSI Family derivative as two independent a-bit registers. and status bits for the interrupt system, the
products to invoke new features. The Timer/Counters, and the serial port. They are
functions of the SFRs are described in the Ports 0 to 3 described in later sections.
text that follows. PO, PI, P2, and P3 are the SFR latches of
Ports 0, I, 2, and 3, respectively. Writing a
Accumulator
Port Structures and Operation
one to a bit of a port SFR (PO, PI, P2, or P3)
All four ports in the BOCSI are bidirectional.
ACC is the Accumulator register. The causes the corresponding port output pin to
mnemonics for Accumulator-Specific Each consists of a latch (Special Function
switch high. Writing a zero causes the port
Registers PO through P3), an output driver,
instructions, however, refer to the output pin to switch low. When used as an
and an input buffer.
Accumulator simply as A. input, the external state of a port pin will be
held in the port SFR (i.e., if the external state The output drivers of Ports 0 and 2, and the
B Register
of a pin is low, the corresponding port SFR bit input buffers of Port 0, are used in accesses
The B register is used during multiply and
will contain a 0; if it is high, the bitwill contain to external memory. In this application, Port 0
divide operations. For other instructions it can
a I). outputs the low byte of the external memory
be treated as another scratch pad register.
address, time-multiplexed with the byte being
Program StatusWord Serial Data Buffer written or read.
The PSW register contains program status The Serial Buffer is actually two separate
information as detailed in Figure 3. registers, a transmit buffer and a receive Port 2 outputs the high byte of the external
buffer. When data is moved to SBU F, it goes memory address when the address is 16 bits
Stack Pointer to the transmit buffer and is held for serial wide. Otherwise, the Port 2 pins continue to
The Stack Pointer register is a bits wide. It is transmission. (Moving a byte to SBUF is what emit the P2 SFR content.
8 Bytes
F8 FF
FO B F7
ED EF
EO ACC E7
08 DF
DO psw D7
CO CF
CO C7
B8 IP BF
SO P3 B7
AD IE AF
AO P2 A7
98 SCON SBUF 9F
90 Pl 97
L Bit Addressable
February 1992 24
Signetics 80C51-8ased 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
(MSB) (LSB)
CY AC Fe AS1 ASO ov
Symbol Position Nams aost Signifjcance Symbol Posijjon Name prtd Significance
(O.O)-Bank 0 (OOH.o7H)
(O,1)-Bank 1 (08H.oFH)
(1,O)-Bonl<2 (10H-17H)
(1,1)-Bank 3 (18H-17H)
All the Port 3 pins are multifunctional. They ADDR and ADDRIDATA bus by an internal Because Ports 1, 2, and 3 have fixed internal
are not only port pins, but also serve the CONTROL signal for use in external memory pullups, they are sometimes called
functions of various special features as listed accesses. During external memory accesses, "quasi-bidirectional" ports. When configured
below: the P2 SFR remains unchanged, but the PO as inputs they pull high and will source
SFR gets 1s written to it. current (IlL, in the data sheets) when
PorI
externally pulled low. Port 0, on the other
Pin Alternate Function
Also shown in Figure 4 is that if a P3 bit latch hand, is considered "true" bidirectional,
P3.0 RxD (serial input port)
contains aI, then the output level is because when configured as an input it
P3.1 TxD (serial output port)
floats.
P3.2 rnm (external interrupt) controlled by the signal labeled "alternate
P3.3 TNTf (external interrupt) output function." The actual P3.X pin level is All the port latches in the BOC51 have Is
P3.4 TO (Timer/Counter 0 external input) always available to the pin's alternate input written to them by the reset function. If a 0 is
P3.5 Tl (Timer/Counter 1 external input) function, if any. subsequen~y written to a port latch, it can be
P3.6 WR (external Data Memory write reconfigured as an input by writing a 1 to it.
strobe) Ports 1, 2, and 3 have internal pullups, and
P3.7 !=!U (external Data Memory read Port 0 has open drain outputs. Each I/O line Writing to a Port
strobe) can be independently used as an input or an In the execution of an instruction that
output. (Port 0 and 2 may not be used as changes the value in a port latch, the new
The alternate functions can only be activated general purpose 1/0 when being used as the value arrives at the latch during S6P2 of the
if the corresponding bit latch in the port SFR ADDRIDATA BUS for external memory during final cycle of the instruction. However, port
contains a 1. Otherwise the port pin remains normal operation.) To be used as an input, latches are in fact sampled by their output
atO. buffers only during Phase 1 of an clock
the port bit latch must contain aI, which
turns off the output driver FET. Then, for period. (During Phase 2 the output buffer
I/O Configurations holds the value it saw during the previous
Ports 1, 2, and 3, the pin is pulled high by a
Figure 4 shows a functional diagram of a Phase 1). Consequently, the new value in the
weak internal pullup, and can be pulled low
typical bit latch and I/O buffer in each of the port latch won't actually appear at the output
by an external source.
four ports. The billatch (one bit in the port's pin until the next Phase 1, which will be at
SFR) is represented as a Type D flip-flop, SI PI of the next machine cycle.
which will clock in a value from the internal Port 0 differs in that its internal pullups are
bus in response to a "write to latch" signal not active during normal port operation. The If the change requires a O-to-l transition in
from the CPU. The level of the port pin itself pullup FET in the PO output driver (see Port 1, 2, or 3, an additional pullup is turned
is placed on the internal bus in response to a Figure 4) is used only when the port is on during SI PI and SI P2 of the cycle in
"read pin" signal from the CPU. Some emitting 1s during external memory which the transition occurs. This is done to
instructions that read a port activate the "read accesses. Otherwise the pullup FET is off. increase the transition speed. The extra
latch" signal, and others activate the "read Consequently PO lines that are being used as pullup can source about 100 times the current
pin" signal. output port lines are open drain. Writing a 1 to that the normal pull up can. It should be noted
the bit latch leaves both output FETs off, so that the internal pullups are field-effect
As shown in Figure 4, the output drivers of the pin floats. In that condition it can be used transistors, not linear resistors. The pullup
Port 0 and 2 are switchable to an internal as a high-impedance input. arrangements are shown in Figure 5.
February 1992 25
Signetics OOC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
ADDRlData
Read Read
Pin Pin
ADDRJOata Alternate
Output
Control Vee Function
Vcc
Internal
Pull up.
Intemal
Pullup'
Write to Write to
Latch Latch
Read Read
Pin PIn Alternate
Input
FUIlCtion
In the NMOS 8051 part, the fixed part of the pFET1 in Figure 5 is the transistor that is NMOS versions can be driven in a normal
pullup is a depletion mode transistor with the turned on for 2 oscillator periods after a O-to-l manner by a TTL or NMOS circuit. Both
gate wired to the source. This transistor will transition in the port latch. While it's on, it NMOS and CMOS pins can be driven by
allow the pin to source about 0.25mA when turns on pFET3 (a weak pullup), through the open-collector and open-drain outputs, but
shorted to ground. In parallel with the fixed inverter. This inverter and pPET form a latch note that O-to-l transitions will not be fast.
pullup is an enhancement mode transistor, which holds the 1.
which is activated during Sl whenever the In the NMOS device, if the pin is driven by an
port bit does a O-to-l transition. During this Note that if the pin is emitting a 1, a negative
glitch on the pin from some external source open-collector output, a O-to-l transition will
interval, if the port pin is shorted to ground, have to be driven by the relatively weak
this extra transistor will allow the pin to can turn off pFET3, causing the pin to go into
depletion mode FET in Figure Sa. In the
source an additional 3OmA. a float state. pFET2 is a very weak pullup
CMOS device, an input 0 turns off pullup
which is on whenever the nFET is off, in
In the CMOS 80C51, the pullup consists of traditional CMOS style. II's only about 1/10 pFET3, leaving only the very weak pullup
three pFETs. It should be noted that an the strength of pFET1. Its function is to pFET2 to drive the transition.
n-channel FET (nFET) is turned on when a restore a 1 to the pin in the event the pin had
logical 1 is applied to its gate, and is turned a 1 and lost it to a glitch. Port 0 output buffers can each drive 8 LS TTL
off when a logical 0 is applied to its gate. A inputs. They do, however, require external
p-channel FET (pFET) is the opposite: it is on Port Loading and Interfacing pull ups to drive NMOS inputs, except when
when its gate sees a 0, and off when its gate The output buffers of Ports 1,2, and 3 can being used as the ADDRESS/DATA bus for
sees a 1. each drive 4 LS TTL inputs. These ports on external memory.
February 1992 26
Signetics OOCSI-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
vcc
a. NMOS Configuration.
The enhancement mode transistor is turned on for 2 oscillator periods aher a makes a I-to-O transition.
o
From Port
Latch
b. CMOS Configuration.
a
pFET1 Is turned on for 2 oscillator periods aher makes a 1-to-0 transition.
During this time, pFET1 also· turns on pFET3through the Inverter to form a latch which holds the 1. pFET21s also on.
Read-Modify-Write Feature INC (increment, e.g., INC P2) written to the bit, the tr'lnsistor is tumed on. If
Some instructions that read a port read the DEC (decrement, e.g., DEC P2) the CPU then reads the same port bit at the
latch and others read the pin. Which ones do DJNZ (decrement and jump if not pin rather than the latch, it will read the base
which? The instructions that read the latch zero, e.g., DJNZ P3,LABEL) voltage of the transistor and interpret it as a
rather than the pin are the ones that read a MOV,PX,Y,C (move carry bit to bit Y of O. Reading the latch rather than the pin will
value, possibly change it, and then rewrite it Port X) return the correct value of I.
to the latch. These are called CLR PX.Y (clear bit Y of Port X)
"read-modify-write" instructions. The SET PX Y (set bit Y of Port X)
instructions listed below are read-modify-write
instructions. When the destination operand is It is not obvious that the last three
a port, or a port bit, these instructions read instructions in this list are read-modify-write
the latch rather than the pin: instructions, but they are. They read the port
byte. all 8 bits, modify the addressed bit, then
ANL (logical AND, e.g., ANL PI ,A)
write the new byte back to the latch.
ORL (logic'll OR, e.g., ORL P2.A)
XRL (logical EX-OR, e.g., The reason that read-modify-write
XRL P3,A) instructions are directed to the latch rather
JBC (jump if bit = I and clear bit, than the pin is to avoid a possible
e.g., JBC PI.I,LABEL) misinterpretation of the voltage level at the
CPL (complement bit, e.g., pin. For example. a port bit might be used to
CPL P3.0) drive the base of a transistor. When a I is
February 1992 27
Signetics 8OC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
Accessing External Memory This require that the ROMless versions have Counter with a dividli-by-32 prescaler.
Accesses to external memory are of two EA wired low to enable the lower 4k program Figure 7 shows the Mode 0 operation as it
types: accesses to external Program Memory bytes to be fetched from external memory. applies to Timer 1.
and accesses to external Data Memory.
When the CPU is executing out or"external In this mode, the Timer register Is configured
Accesses to external Program Memory use
Program Memory, all 8 bits of Port 2 are as a 13-bit register. As the count rolls over
signal PSEfiI (program store enable) as the
dedicated to an output function and may not from allIs to aliOs, it sets the Timer interrupt
read strobe. Accesses to external Data
be used for general purpose 110. During ftag TFI. The counted input is enabled to the
Memory use JID" or WR (alternate functions 01
external program fetches they output the high Timer when TRI = 1 and either GATE = 0 or
P3.7 and P3.6) to strobe the memory.
Fetches from external Program Memory byte of the PC. During this time the Port 2 lNTI = 1. (Setting GATE = 1 allows the Timer
always use a 16-bit address. Accesses to drivers use the strong pullups to emit PC bits to be controlled by external input lNTI, to
that are Is. facilitate pulse width measurements). TRI is
external Data Memory can use either a 16-bit
address (MOVX @ DPTR) or an 8-bit a control bit in the Special Function Register
TCON (Figure 8). GATE is in TMOD.
address (MOVX @Ri). Timer/Counters
The BOC51 has two 16-bit Timer/Counter The 13-bit register consists of all 8 bits of
Whenever a 16-bit address is used, the high registers: Timer.O and Timer 1. Both can be TH 1 and the lower 5 bits of TL1. The upper 3
byte of the address comes out on Port 2, configured to operate either as timers or bits of TL1 are indeterminate and should be
where it is held for the duration of the read or event counters (see Figure 6). ignored. Setting the run flag (TR1) does not
write cycle. Note that the Port 2 drivers use clear the registers.
the strong pull ups during the entire time that In the "Timer" function, the register is
they are emitting address bits that are Is. incremented every machine cycle. Thus, one Mode 0 operation is the same for the Timer 0
This is during the execution of a MOVX can think of it as counting machine cycles. as for Timer 1. Substitute TRO, TFO, and
@DPTR instruction. During this time the Port Since a machine cycle consists of 12 rnTlI for the corresponding Timer 1 signals in
2 latch (the Special Function Register) does oscillator periods, the count rate is 1112 of the Figure 7. There are two different GATE bits,
not have to contain 1s, and the contents of oscillator frequency. one for Timer 1 (TMOD.7) and one for Timer
the Port 2 SFR are not modified. If the o(TMOD.3).
external memory cycle is not immediately In the "Counter" function, the register is
followed by another external memory cycle, incremented in response to a 1-10-0 transition Mode 1
the undisturbed contents of the Port 2 SFR at its corresponding external input pin, TO or Mode 1 is the same as Mode 0, except that
will reappear in the next cycle. Tl. In this function, the external input is the Timer register is being run with all 16 bits.
sampled during S5P2 of every machine
If an 8-bit address is being used (MOVX cycle. Mode 2
@Ri), the contents of the Port 2 SFR remain Mode 2 configures the Timer register as an
at the Port 2 pins throughout the external When the samples show a high in one cycle 8-bit Counter (TL1) with automatic reload, as
memory cycle. This will facilitate paging. and a low in the next cycle, the count is shown in Figure 9. OVerftow from TL1 not
incremented. The new count value appears in . only sets TF1, but also reloads TL1 with the
In any case, the low byte of the address is the register during saPl of the cycle cOntents of TH1, which is preset by software..
time-multiplexed with the data byte on Port O. following the one in which the transition was The reload leaves THI unchanged.
The ADDRIDATA signals drive both FETs in detected. Since it takes 2 machine cycles (24
the Port 0 output buffers. Thus, in this oscillator periods) to recognize a 1-10-0 Mode 2 operation is the same for
application the Port 0 pins are not open-cirain transition, the maximum count rate is 1/24 of Timer/Counter O.
outputs, and do not require external pullups. the oscillator frequency. There are no
restrictions on the duty cycle of the external Mode 3
ALE (Address Latch Enable) should be used
to capture the address byte into an external input signal, but to ensure that a given level is Timer 1 in Mode 3 simply holds its count The
latch. The address byte is valid at the sampled at least once before it changes, it effect is the same as setting TRI = O.
negative transition of ALE. Then, in a write should be held for aUeast one full cycle. In
addition to the "Timer" or 'Counter" selection, Timer 0 in Mode 3 establishes TLO and THO
cycle, the data byte to be written appears on as two separate counters. The logic for Mode
Port 0 just before WR is activated, and Timer 0 and Timer 1 have four operating
modes from which to select. 3 on Timer 0 is shown in Figure 10. TLO uses
remains there until after WR is deactivated. In the Timer 0 control bits: CIT, GATE, TRO,
a read cycle, the incoming byte is accepted at INTO, and TFO. THO is locked into a timer
Port 0 just before the read strobe is Timer 0 and Timer 1
function (counting machine cycles) and takes
deactivated. The "Timer" or "Counter" function is selected
over the use oi TR 1 and TF 1 from Timer 1.
by control bits CIT in the Special Function
Thus, THO now controls the "Timer I" .
During any access to external memory, the Register TMOD. These two Timer/Counters
interrupt.
CPU writes OFFH to the Port 0 latch (the have four operating modes, which are
Special Function Register), thus obliterating selected by bit-pairs (Ml, MO) in TMOD. Mode 3 is provided for applications requiring
whatever information the Port 0 SFR may Modes 0, I, and 2 are the Same for both an extra 8-bit timer on the counter. With
have been holding. Timers/Counters. Mode :3 is different. The Timer 0 in Mode 3, anBOC51can look like it
four operating modes are described in the has three Timer/Counters. When Timer 0 is in
External Program Memory is accessed under following text. Mode 3, Timer 1 can be turned on and off by
two conditions: Whenever signal EA is active; switching itoU! of and into its own Mode 3, or
or whenever the program counter (PC) Mode 0 can still be used by the serial port as a baud
contains a number that is larger than OFFFH Putting either Timer into Mode 0 makes it rate generator, or in fact, in any application
(in the 80C51). look like an 8048 Timer, which is an 8-bit not requiring an interrupt.
February 1992 28
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
(MSB) (LSB)
limer1 Timer 0
CIT =0
Interrupt
11 Pin
_ _--'1 CIT =1 Control
TR1 _ _ _ _ _ _-j
(MSB) (LS8)
Slfmbol Position Name and Significance Slfmbol Position Name and Significance
TFI TCON.7 Timer 1 overflow flag. Set by hardware on lEI TCON.3 Interrupt 1 Edge flag. Set by hardware when
Timer/Counter overflow. Cleared by hardware external interrupt edge detected. Cleared
when processor vectors to interrupt routine. when Interrupt processed.
TRI TCON.6 Timer 1 Run control bit. Sellcleared by 80tt- ITt TCON.2 Interrupt 1 Type conb'oI bit. Set/deared by
ware to turn Timer/Counter on/off. software to specify falling edgeJlow level trig-
gered external interrupts.
TFO TCON.5 Timer 0 overflow flag. Set by hardware on
Timer/Counter overflow. Cleared by hardware lEO TCON.1 Interrupt 0 Edge flag. Set by hardware when
when processor vectors to Interrupt routine. external interrupt edge detected. Cleared
when Interrupt processed.
TAO TCON.4 Timer 0 Run control biL Set/cleared by 80ft- ITO TCON.O Interrupt 0 Type control bit. Set/deared by
ware to turn Timer/Counter on/off. software to specify falling edgellow level trig-
gered external interrupts.
February 1992 29
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
CIT=O
j CIT = 1
Intem.Ipt
T1 Pin ------~
TRI -------I~
B----G-- 1/12fOSC
1I1210SC - - - - - - - - ,
TO Pin Control
TRo - - - - - - ,
TRI -----~
~trol
Figure 10. Timer/Counter 0 Mode 3: Two 8-8it Counters
February 1992 30
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
Standard Serial Interface In all four modes, transmission is initiated by Baud Rales
The serial port is full duplex, meaning it can any instruction that uses SBUF as a The baud rate in Mode 0 is fixed: Mode 0
transmit and receive simultaneously. It is also destination register. Reception is initiated in Baud Rate = Oscillator Frequency /12. The
receive-buffered, meaning it can commence Mode 0 by the condition RI = 0 and REN = 1. baud rate in Mode 2 depends on the value of
reception of a second byte before a Reception is initiated in the other modes by bit SMOD in Special Function Register
previously received byte has been read from the incoming start bit if REN = 1. PCON. If SMOD = 0 (which is the value on
the register. (However, if the first byte still reset), the baud rate is 1/64 the oscillator
hasn't been read by the time reception of the Multiprocessor Communications frequency. If SMOD = 1, the baud rate is 1/32
second byte is complete, one of the bytes will Modes 2 and 3 have a special provision for the oscillator frequency.
be lost.) The serial port receive and transmit multiprocessor communications. In these Mode 2 Baud Rate =
registers are both accessed at Special modes, 9 data bits are received. The 9th one
Function Register SBUF. Writing to SBUF 2 SMOD
goes into RB8. Then comes a stop bit. The
loads the transmit register, and reading SBUF
64 x (Oscillator Frequency)
port can be programmed such that when the
accesses a physically separate receive stop bit is received, the serial port interrupt
In the 80C51 , the baud rates in Modes 1 and
register. will be activated only if RB8 = 1 . This feature
3 are determined by the Timer 1 overflow
is enabled by setting bit SM2 in SCaN. A
The serial port can operate in 4 modes: rate.
way to use this feature in multiprocessor
Mode 0: Serial data enters and exits systems is as follows: Using Timer 1 10 Generale Baud Rales
through RxD. TxD outputs the shift clock. B When Timer 1 is used as the baud rate
bits are transmitted/received (LSB first). The When the master processor wants to transmit generator, the baud rates in Modes 1 and 3
baud rate is fixed at 1112 the oscillator a block of data to one of several slaves, it first
are determined by the Timer 1 overflow rate
frequency. sends out an address byte which identifies and the value of SMOD as follows:
the target slave. An address byte differs from
Mode 1: 10 bits are transmitted (through a data byte in that the 9th bit is 1 in an Mode 1, 3 Baud Rate =
TxD) or received (through RxD): a start bit address byte and 0 in a data byte. With SM2
2 SMOD
(0),8 data bits (LSB first), and a stop bit (1). = 1, no slave will be interrupted by a data 3 2 x (Timer 1 Overflow Rate)
On receive, the stop bit goes into RB8 in byte. An address byte, however, will interrupt
Special Function Register SCaN. The baud all slaves, so that each slave can examine The Timer 1 interrupt should be disabled in
rate is variable. the received byte and see if it is being this application. The Timer itself can be
addressed. The addressed slave will clear its configured for either "timer" or "counter"
Mode 2: 11 bits are transmitted (through
SM2 bit and prepare to receive the.data bytes operation, and in any of its 3 running modes.
TxD) or received (through RxD): start bit (0),
that will be coming. The slaves that weren't In the most typical applications, it is
B data bits (LSB first), a programmable 9th
being addressed leave their SM2s set and go configured for "timer" operation, in the
data bit, and a stop bit (1). On Transmit, the
on about their business, ignoring the coming auto-reload mode (high nibble of TMOD =
9th data bit (TB8 in SCaN) can be assigned
data bytes. 0010B). In that case the baud rate is given by
the value of 0 or 1. Or, for example, the parity
bit (P, in the PSW) could be moved into TB8. the formula:
SM2 has no effect in Mode 0, and in Mode 1
On receive, the 9th data bit goes into RB8 in Mode 1, 3 Baud Rate =
can be used to check the validity of the stop
Special Function Register SCaN, while the
bit. In a Mode 1 reception, if SM2 =1, the
stop bit is ignored. The baud rate is 2 SMOD x Oscillator Frequency
receive interrupt will not be activated unless a
programmable to either 1/32 or 1/64 the 32 12 x [256-(TH1)]
valid stop bit is received.
oscillator frequency.
One can achieve very low baud rates with
Mode 3: 11 bits are transmitted (through Serial Port Control Regisler Timer 1 by leaving the Timer 1 interrupt
TxD) or received (through RxD): a start bit The serial port control and status register is enabled, and configuring the Timer to run as
(0), B data bits (LSB first), a programmable the Special Function Register SCaN, shown a 16-bit timer (high nibble of TMOD = 0001 B),
9th data bit, and a stop bit (1). In fact, Mode 3 in Figure 11. This register contains not only and using the Timer 1 interrupt to do a 16-bit
is the same as Mode 2 in all respects except the mode selection bits, but also the 9th data software reload. Figure 12 lists various
baud rate. The baud rate in Mode 3 is bit for transmit and receive (TBB and RB8), commonly used baud rates and how they can
variable. and the serial port interrupt bits (TI and RI). be obtained from Timer 1.
February 1992 31
Signetics OOC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
(MSD) (LSD)
TImer 1
Reload
Baud Rate 10SC SMOO CIT Mode Value
More About Mode 0 ~clivation of SEND. deactivate SEND and set Tl. Both of these
Serial data enters and exits through RxD. actions occur at Sl Pl of the 10th machine
TxD outputs the shiftclock. 8 bits are SEND enables the output of the shift register
cycle after ''write to SBUF."
to the alternate output function line of P3.0
transmitted/received: 8 data bits (LSB first).
and also enable SHIFT CLOCK to the Reception is initiated by the condition
The baud rate is fixed a 1/12 the oscillator
frequency. alternate output function line of P3.1. SHIFT REN = 1 and Rl =O. At S6P2 of the next
CLOCK is low during S3, S4, and S5 of every machine cycle, the RX Control unit writes the
machine cycle, and high during S6, Sl, and bits 11111110 to the receive shift register, and
Figure 13 shows a simplified functional
S2. At S6P2 of every machine cycle in Which in the next clock phase activates RECEIVE.
diagram of the serial port in Mode 0, and
SEND is active, the contents of the transmit
associated timing. RECEIVE enable SHIFT CLOCK to the
shift are shifted to the right one position.
alternate output function line of P3.1. SHIFT
Transmission is initiated by any instruction As data bits shift out to the right, zeros come CLOCK makes transitions at S3P1 and S6Pl
that uses SBUF as a destination register. The in from the left. When the MSB of the data of every machine cycle. At S6P2 of every
''write to SBUF" signal at S6P2 also loads a 1 byte is at the output position of the shift machine cycle in which RECEIVE is active,
into the 9th position of the transmit shift register, then the 1 that was initially loaded the contents of the receive shift register are
register and tells the TX Control block to into the 9th position, is just to the left of the shifted to the left one pOSition. The value that
commence a transmission. The internal MSB, and all positions to the left of that comes in from the right is the value that was
timing is such that one full machine cycle will contain zeros. This condition flags the TX sampled at the P3.0 pin at S5P2 of the same
elapse between "write to SBUF" and Control block to do one last shift and then machine cycle.
February 1992 32
Signetics BOC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
As data bits come in from the right, 1s shift counter states of each bit time, the bit to the divide-by-16 counter, not to the "write
out to the left. When the 0 that was initially detector samples the value of RxD. The value to SBUF" signaL)
loaded into the rightmost position arrives at accepted is the value that was seen in at
the leftmost position in the shift register, it least 2 of the 3 samples. This is done for The transmission begins with activation of
flags the RX Control block to do one last shift noise rejection. If the value accepted during SEND, which puts the start bit at TxD. One
and load SBUF. At SlPl of the 10th machine the first bit time is not 0, the receive circuits bit time later, DATA is activated, which
cycle after the write to SCaN that cleared RI, are reset and the unit goes back to looking enables the output bit of the transmit shift
RECEIVE is cleared as RI is set. for another l-to-O transition. This is to provide register to TxD. The first shift pulse occurs
rejection of false start bits. If the start bit one bit time after that The first shift clocks a
proves valid, it is shifted into the input shift 1 (the stop bit) into the 9th bit position of the
More About Mode 1
register, and reception of the rest of the frame shift register. Thereafter, only zeros are
Ten bits are transmitted (through TxD), or
will proceed. clocked in. Thus, as data bits shift out to the
received (through RxD): a start bit (0), B data
right, zeros are clocked in from the left. When
bits (LSB first), and a stop bit (1). On receive,
As data bits come in from the right, 1s shift TBB is at the output position of the shift
the stop bit goes into RBB in SCaN. In the
out to the lefl When the start bit arrives at the register, then the stop bit is just to the left of
BOC51 the baud rate is determined by the
Timer 1 overflow rate. leftmost position in the shift register (which in TBB, and all positions to the left of that
mode 1 is a 9-bit register), it flags the RX contain zeros. This condition flags the TX
Figure 14 shows a simplified functional Control block to do one last shift, load SBUF Control unit to do one last shift and then
diagram of the serial port in Mode 1, and and RBB, and set RI. The signal to load deactivate SEND and set TI. This occurs at
associated timings for transmit receive. SBUF and RBB, and to set RI, will be the 11th divide-by-16 rollover after "write to
generated if, and only if, the following SUBF."
Transmission is initiated by any instruction conditions are met at the time the final shift
Reception is initiated by a detected l-to-O
that uses SBUF as a destination register. The pulse is generated.:
transition at RxD. For this purpose RxD is
"write to SBUF" signal also loads a 1 into the 1. R1 = 0, and
sampled at a rate of 16 times whatever baud
9th bit position of the transmit shift register 2. Either SM2 = 0,
rate has been established. When a transition
and flags the TX Control unit that a or the received stop bit = 1.
is detected, the divide-by-16 counter is
transmission is requested. Transmission
immediately reset, and 1FFH is written to the
actually commences at Sl Pl of the machine If either of these two conditions is not met,
input shift register.
cycle following the next rollover in the the received frame is irretrievably lost. If both
divide-by-16 counter. (Thus, the bit times are conditions are met, the stop bit goes into At the 7th, Bth, and 9th counter states of each
synchronized to the divide-by-16 counter, not RBB, the B data bits go into SBUF, and RI is bit time, the bit detector samples the value of
to the "write to SBUF" signaL) activated. At this time, whether the above R-D. The value accepted is the value that
conditions are met or not, the unit goes back was seen in at least 2 of the 3 samples. If the
The transmission begins with activation of to looking for a 1-10-0 transition in RxD. value accepted during the first bit time is not
SEND which puts the start bit at TxD. One bit
0, the receive circuits are reset and the unit
time later, DATA is activated, which enables
More About Modes 2 and 3 goes back to looking for another l-to-O
the output bit of the transmit shift register to
Eleven bits are transmitted (through TxD), or transition. If the start bit proves valid, it is
TxD. The first shift pulse occurs one bit time
received (through RxD): a start bit (0), B data shifted into the input shift register, and
after that.
bits (LSB first), a programmable 9th data bit, reception of the rest of the frame will
and a stop bit (1 ). On transmit, the 9th data proceed.
As data bits shift out to the right, zeros are
clocked in from the left. When the MSB of the bit (TBB) can be assigned the value of 0 or 1.
As data bits come in from the right, 1s shift
data byte is at the output position of the shift On receive, the 9the data bit goes into RBB in
out to the left. When the start bit arrives at the
register, then the 1 that was initially loaded SCON. The baud rate is programmable to
leftmost position in the shift register (which in
into the 9th position is just to the left of the either 1/32 or 1/64 the oscillator frequency in
Modes 2 and 3 is a 9-bit register), it flags the
MSB, and all positions to the left of that Mode 2. Mode 3 may have a variable baud
RX Control block to do one last shift, load
contain zeros. This condition flags the TX rate generated from Timer 1 .
SBUF and RBB, and set RI.
Control unit to do one last shift and then
deactivfate SEND and set TI. This occurs at Figures 15 and 16 show a functional diagram The signal to load SBUF and RBB, and to set
the 10th divide-by-16 rollover after "write to of the serial port in Modes 2 and 3. The RI, will be generated if, and only if, the
SBUF: receive portion is exactly the same as in following conditions are met at the time the
Mode 1. The transmit portion differs from final shift pulse is generated.
Reception is initiated by a detected l-to-O Mode 1 only in the 9th bit of the transmit shift 1. Rl=O,and
transition at RxD. For this purpose RxD is register. 2. Either SM2 = 0,
sampled at a rate of 16 times whatever baud or the received 9th data bit = 1.
rate has been established. When a transition Transmission is initiated by any instruction
is detected, the divide-by-16 counter is that uses SBUF as a destination register. The If either of these conditions is not met, the
immediately reset, and 1FFH is written into "write to SBUF' signal also loads TBB into the received frame is irretrievably lost, and RI is
the input shift register. Resetting the 9th bit position of the transmit shift register not set. If both conditions are met, the
divide-by-16 counter aligns its rollovers with and flags the TX Control unit that a received 9th data bit goes into RBB, and the
the boundaries of the incoming bit times. transmission is requested. Transmission first B data bits go into SBUF. One bit time
commences at Sl P1 of the machine cycle later, whether the above conditions were met
The 16 states of the counter divide each bit following the next rollover in the divide-by-16 or not, the unit goes back to looking for a
time into 16ths. At the 7th, Bth, and 9th counter. (Thus, the bit times are synchronized 1-10-0 transition at the RxD input.
February 1992 33
Signetics 80C51-Based B-Sit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
RID
P3.0AH
OUtput
function
TX Control
56 TXClock Tl Send
Serial
Port TxD
Interrupt P3.1AH
Output
RXClock Rl Receive Function
REN Start
1lI
RxD
P3.oAlt
Input
Function
Read
SBUF
~ WrltetoSBUF
Send SGP2 i
SIIHt Transmit
iii!
Receive
SIIHt Receive
RxD (Data In)
February 1992 34
Signetics 80C51-Based 8-Bil Microcontrollers
SECTION 1
80C51 family hardware description 80C51 FAMILY
Dmer1
Overflow
Wrlle
to
SBUF
TxD
+-----------~
Serial
+16r-----~~~~==~~--------~~
Por1
Intetrupt
Sample
Load
SBUF
RX Conlrol Shill 1-------,
I----t~ Star1
TxD
n
+ 16 Reset
III
February 1992 35
Signetics BOC51-Based B-Bit Microcontroilers
SECTION 1
80C51 family hardware description
80C51 FAMILY
T.D
Ph... 2 Clock
(11210 • .,)
_2 Stop Bit
Start Gen.
TX Control
Serial
Port
Interrupt
RXClock Rt Load
Sample
SBUF
RX Control Shift 1------,
Start
1FFH
Data
Transmit
Shift
+ 16 Reset
~Times
Shift
:ct~or
;;B:it::De.::,.. _____ ~~~~~-} Receive
RI
February 1992 36
Signetics 8OC51-Based 8-Bit Microcontroliers
SECTION 1
80C51 family hardware description 80C51 FAMILY
Timer 1
Overflow
Wrile
10
SBUF
TxD
Serial
Port
Interrupt
Load
Sample
SBUF
RX Control Shift \ - - - -
Start
lFFH
RxD
~ W,i1etoSBUF
.;.16 Reset
Sam leTimes
.!!:
Bi:!!!..'DeIe_CIO_'
Shift
RI
_---1L----lIL-...JL---1L_IL..-...JL---lL..--.-...J'---...JL-~:::=::!:==} Receive
February 1992 37
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
Interrupt
Sources
TFI
Interrupts is cleared by hardware when the service can't be interrupted by any other interrupt
The 80C51 provides 5 interrupt sources. routine is vectored to. In fact, the service source.
These are shown in Figure 17. The External routine will normally have to determine
If two request of different priority levels are
Interrupts lJiITO and INTI can each be either whether it was RI or TI that generated the
received simUltaneously, the request of
level-activated or transition-activated, interrupt, and the bit will have to be cleared in
higher priority level is serviced. If requests of
depending on bits ITO and ITI in Register software.
the same priority level are received
TCON. The flags that actually generate these
All of the bits that generate interrupts can be simultaneously, an internal polling sequence
interrupts are bits lEO and lEI in TCON.
set or cleared by software, with the same determines which request is serviced. Thus
When an external interrupt is generated, the
result as though it had been set or cleared by within each priority level there is a second
flag that generated it is cleared by the
hardware. That is, interrupts can be priority structure determined by the polling
hardware when. the service routine is
generated or pending interrupts can be sequence as follows:
vectored to only if the interrupt was
canceled in software.
transition-activated. If the interrupt was Source Priority Within Level
level-activated, then the external requesting Each of these interrupt sources can be 1. lEO (highest)
source is what controls the request flag, individually enabled or disabled by setting or 2. TFO
rather than the on-chip hardware. clearing a bit in Special Function Register IE 3. lEI
(Figure 18). IE also contains a global disable 4. TFI
The TImer 0 and TImer 1 Interrupts are
bit, EA, which disables all interrupts at once. 5. RI+TI (lowest)
generated by TFO and TF1, which are set by
a rollover in their respective TImer/Counter Note that the i'priority within level" structure is
Priority Level Structure
registers (except see TImer 0 in Mode 3). only used to resolve simultaneous requests
Each interrupt source can also be individually
When a timer interrupt is generated, the flag of the same priority level.
programmed to one of two priority levels by
that generated it is cleared by the on-chip
setting or clearing a bit in Special Function The IP register contains a number of
hardware when the service routine is
Register IP (Figure 19). A low-priority unimplemented bits. IP.7, IP.G, and IP.5 are
vectored to.
interrupt can itself be interrupted by a reserved in the 80C51. User software should
The Serial Port Interrupt is generated by the high-priority interrupt, but not by another not write 1s to these positions, since they
logical OR of RI and TI. Neither of these flags low-priority interrupt. A high-priority interrupt may be used in other 8051 Family products.
February 1992 38
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
ETa IE.. Enables or disables the Timer 0 Overflow inter- PTO IP.' Enables or disables the Timer 0 Interrupt prior-
rupt_ If ETO = 0, the limer 0 interrupt is dis-- ity level. PTO = 1 programs it to the higher prior-
• bled. itylevel.
Figure 18_ Interrupt Enable Register (IE) Figure 19, Interrupt Priority Register (IP)
How Interrupts Are Handled machine cycle, and the values polled are the external interrupt flag (lEO or IE1) only if it
The interrupt flags are sampled at S5P2 of values that were present at S5P2 of the was transition-activated. The
every machine cycle. The samples are polled previous machine cycle. Note that if an hardware-generated LCALL pushes the
during the following machine cycle. If one of interrupt flag is active but not being contents of the Program Counter on to the
the flags was in a set condition at SSP2 of the responded to for one oi the above conditions, stack (but it does not save the PSW) and
preceding cycle, the polling cycle will find it if the flag is not still active when the blocking reloads the PC with an address that depends
and the interrupt system will generate an condition is removed, the denied interrupt will on the source of the interrupt being vectored
LCALL to the appropriate service routine, not be serviced. In other words, the fact that to, as shown below:
provided this hardware-generated LCALL is the interrupt flag was once active but not
not blocked by any of the following serviced is not remembered. Every polling Source Vector Address
conditions: cycle is new. lEO 0OO3H
1. An interrupt of equal or higher priority TFO OOOBH
level is already in progress. The polling cycie/LCALL sequence is IEl 0013H
illustrated in Figure 20. TFl 00lBH
2. The current (polling) cycle is not the final
RI+TI 0023H
cycle in the execution of the instruction in Note that if an interrupt of higher priority level
progress. goes active prior to S5P2 of the machine Execution proceeds from that location until
3. The instruction in progress is RET I or any cycle labeled C3 in Figure 20, then in the RETI instruction is encountered. The
write to the IE or IP registers. accordance with the above rules it will be RETI instruction informs the processor that
vectored to during C5 and C6, without any this interrupt routine is no longer in progress,
Any of these three conditions will block the instruction of the lower priority routine having then pops the top two bytes from the stack
generation of the LCALL to the interrupt been executed. and reloads the Program Counter. Execution
service routine. Condition 2 ensures that the of the interrupted program continues from
Thus the processor acknowledges an where it left off.
instruction in progress will be completed
interrupt request by executing a
before vectoring to any service routine.
hardware-generated LCALL to the Note that a simple RET instruction would also
Condition 3 ensures that if the instruction in
appropriate servicing routine. In some cases have returned execution to the interrupted
progress is RETI or any access 10 IE or IP,
it also clears the flag that generated the program, but it would have left the interrupt
then at least one more instruction will be
interrupt, and in other cases it doesn't. It control system thinking an interrupt was still
executed before any interrupt is vectored to.
never clears the Serial Port flag. This has to in progress, making future interrupts
The polling cycle is repeated with each be done in the user's software. It clears an impossible.
February 1992 39
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
IS5P21 56 I
......... ~~'I-\-......L-----f\'...,,---'---l'I-,,--.....------
'---v------J ' - - - - - - - - - - ---------/ ~
r-~r Interrupts
Are Polled
long Call to
InIerrupI
Vector Add .....
InIerrupI Routine
Interrupt IntelTupt
Goes latched
Active
This is the fastest possible response when C2is the final cycle of an Instruction other than REll or an access to IE or IP.
External Interrupts Thus, a minimum of three complete machine routine for the interrupt will terminate with the
The external sources can be programmed to cycles elapse between activation of an following code:
be level-activated or transition-activated by external interrupt request and the beginning
setting or clearing bit ITl or ITO in Register JNB P3.2,$ ;Wait Till INTO" Goes High
of execution of the first instruction of the
TCON. If ITx ~ 0, external interrupt x is JB P3.2,$ ;Wait Till INTO" Goes Low
service routine. Figure 20 shows interrupt
triggered by a detected low at the INTx pin. If RETI ;Go Back and Execute One
response timings.
ITx ~ 1, external interrupt x is edge triggered. Instruction
In this mode if successive samples of the A longer response time would result if the Now if the INTO pin, which is also the P3.2
INTx pin show a high in one cycle and a low request is blocked by one of the 3 previously pin, is held normally low, the CPU will go right
in the next cycle, interrupt request flag lEx in listed conditions. If an interrupt of equal or into the External Interrupt 0 routine and stay
TCON is set. Flag bit lEx then requests the higher priority level is already in progress, the there until INTO is pulsed (from low to high to
interrupt. additional wait time obviously depends on the low). Then it will execute RETI, go back to
nature of the other interrupt's service routine. the task program, execute one instruction,
Since the external interrupt pins are sampled If the instruction in progress is not in its final and immediately re-enter the External
once each machine cycle, an input high or cycle, the additional wait time cannot be more Interrupt 0 routine to await the next pulsing of
low should hold for at least 12 oscillator the 3 cycles, since the longest instructions P3.2. One step of the task program is
periods to ensure sampling. If the external (MUL and DIV) are only 4 cycles long, and if executed each time P3.2 is pulsed.
interrupt is transition-activated, the external the instruction in progress is RETI or an
source has to hold the request pin high for at access to IE or IP, the additional wait time Reset
least one cycle, and then hold it low for at cannot be more than 5 cycles (a maximum of The reset input is the RST pin, which is the
least one cycle. This is done to ensure that one more cycle to complete the instruction in input to a Schmitt Trigger. A reset is
the transition is seen so that interrupt request progress, plus 4 cycles to complete the next accomplished by holding the RST pin high for
flag lEx will be set. lEx will be automatically instruction if the instruction is MUL or DIV). at least two machine cycles (24 oscillator
cleared by the CPU when the service routine periods), while the oscillator is running. The
is called. CPU responds by generating an internal
Thus, in a single-interrupt system, the
response time is always more than 3 cycles reset. with the timing shown in Figure 21.
If the external interrupt is level-activated, the
and less than 9 cycles. The external reset signal is asynchronous to
Elxternal source has to hold the request active
until the requested interrupt is actually the internal clock. The RST pin is sampled
generated. Then it has to deactivate the during State 5 Phase 2 of every machine
Single-Step Operation cycle. The port pitts will maintain their current
request before the interrupt service routine is
The 80C51 interrupt structure allows
completed, or else another interrupt will be activities for 19 oscillator periods after a logic
single-step execution with very little software
generated. 1 has been sampled at the RST pin; that is,
overhead. As previously noted, an interrupt
for 19 to 31 oscillator periods after the
request will not be responded to while an
external reset signal has been applied to the
Response Time interrupt of equal priority level is still in
RSTpin.
The INTO" and rnTf levels are inverted and progress, nor will it be responded to after
latched into lEO and IEl at S5P2 of every RETI until at least one other instruction has The internal reset algorithm writes Os to all
machine cycle. The values are not actually been executed. Thus, once an interrupt the SFRs except the port latches, the Stack
polled by the circuitry until the next machine routine has been entered, it cannot be Pointer, and SBUF. The port latches are
cycle. If a request is active and conditions are re-entered until at least one instruction of the initialized to FFH. the Stack Pointer to 07H,
right for it to be acknowledged, a hardware interrupted program is executed. One way to and SBUF is indeterminate. Table 1 lists the
subroutine call to the requested service use this feature for single-step operation is to SFR reset values. The internal RAM is not
routine will be the next instruction to be program one of the external interrupts (e.g., affected by reset. On power up the RAM
executed. The call itself takes two cycles. INTO) to be level-activated. The service content is indeterminate.
February 1992 40
Signetics BOC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
ALE:
l'SER:
PO:
Table 1. 80C51 SFR Reset Values rate at which it charges. To ensure a good In the NMOS devices the PCON register only
reset, the RST pin must be high long enough contains SMOD. The other four bits are
REGISTER RESET VALUE
to allow the oscillator time to start-up implemented only in the CMOS devices. User
PC OOOH (normally a few ms) plus two machine cycles. software should never write 1s to
ACC OOH unimplemented bits, since they may be used
B OOH Note that the port pins will be in a random in other BOC51 Family products.
PSW OOH state until the oscillator has started and the
SP 07H
internal reset algorithm has written 1s to Idle Mode
DPTR OOOOH
them. An instruction that sets PCON.O causes that
to be the last instruction executed before
PO-P3 FFH
With this circuit, reducing Vee quickly to 0 going into the Idle mode, the internal clock
IP XXXOOOOOB
causes the RST pin voltage to momentarily signal is gated off to the CPU but not to the
IE OXXOOOOOB
fall below OV. However, this voltage is Interrupt, Timer, and Serial Port functions.
TMOD OOH internally limited, and will not harm the The CPU status is preserved in its entirety;
TCON OOH device. the Stack Pointer, Program Counter, Program
THO OOH Status Word, Accumulator, and all other
TLO OOH registers maintain their data during Idle. The
TH1 OOH Power-Saving Modes of
port pins hold the logical states they had at
TL1 OOH Operation the time Idle was activated. ALE and PSrn
SCON OOH For applications where power consumption is hold at logic high levels.
SBUF Indeterminate critical the CMOS version provides power
reduced modes of operation as a standard There are two ways to terminate the Idle.
PCON(NMOS) OXXXXXXXB
feature. The power down mode in NMOS Activation of any enabled interrupt will cause
PCON(CMOS) OXXXOOOOB
devices is no longer a standard feature. PCON.O to be cleared by hardware,
terminating the Idle mode. The interrupt will
be serviced, and following RETI, the next
CMOS Power Reduction Mode
instruction to be executed will be the one
Power-on Reset CMOS versions have two power reducing
following the instruction that put the device
An automatic reset can be obtained when modes, Idle and Power Down. The input
into Idle.
Vee is turned on by connecting the RST pin through which backup power is supplied
to Vee through a 10).1f capacitor and to V55 during these operations is Vee. Figure 23 The flag bits GFO and GF1 can be used to
through an B.2k resistor, providing the Vee shows the internal circuitry which implements give an indication if an interrupt occurred
rise time does not exceed 1 millisecond and these features. In the Idle modes (IDL = 1), during normal operation or during an Idle. For
the oscillator start-up time does not exceed the oscillator continues to run and the example, an instruction that activates Idle can
10 milliseconds. This power-on reset circuit is Interrupt, Serial Port, and Timer blocks also set one or both flag bits. When Idle is
shown in Figure 22. The CMOS devices do continue to be clocked, but the clock signal is terminated by an interrupt, the interrupt
not require the B.2k pulldown resistor. gated off to the CPU. In Power Down (PD = service routine can examine the flag bits. The
although its presence does no harm. 1), the oscillator is frozen. The Idle and other way of terminating the Idle mode is with
Power Down Modes are activated by setting a hardware reset. Since the clock oscillator is
When power is turned on, the circuit holds bits in Special Function Register PCON. The still running, the hardware reset needs to be
the RST pin high for an amount of time that address of this register is B7H. Figure 24 held active for only two machine cycles (24
depends on the value of the capacitor and the details its contents. oscillator periods) to complete the reset.
February 1992 41
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
vcc
vccU
0",
XTAl2 XTALI
BOC51
RST
Interrupt,
Serial Pori,
Timer Blocka
8.2kn
vss PO cPU
=
Figure 22. Power-On Reset Circuit Figure 23. Idle and Power Down Hardware
(MSB) (LSB)
SMOD PCON.7 Double Baud rate bit. When eel to • 1 and TImer 1 I. uaed to gen.
erate baud rate, and the Serial Pon ia used In modes 1. 2. or 3.
PCON.6 Reserved.
PCON.5 Reserved.
PCON.4 Reserved.
GFI PCON.3 General-purpose flag bit.
GFO PCON.2 General-purpoae flag bit.
PD PCON.I Power-Down bit Setting this bit activates power-down operation.
IDL PCON.O Jdle mode bit. Setting this bit activates JdIe mode operation.
If I. a... writ1en to PO and IDL at the same lime. PO takes precedence. The ...sel value of PCON Is (OXXXOOOO).ln the NMOS
deYlce~ the PeON register only contains SMOD. The other four bits are Implemented only in the CMOS devices. User software
ahouId never write 1. to unimplemented bits, since they may be used In future products.
The signal at the RST pin clears the IDL bit stopped. With the clock frozen. all functions allow the oscillator to restart and slabilize
directly and asynchronously. At this time the are stopped. the contents of the on-chip RAM (normally less than 10ms).
CPU resumes program execution from where and Special Function Registers are
it left off; that is. at the instruction following maintained. The port pins output the values ONCE Mode
the one that invoked the Idle Mode. As shown held by their respective SFRs. The ALE and The ONCE ("on-circuit emulation") mode
in Figure 21. two or three machine cycles of PSEJiI output are held low. facililates testing and debugging of systems
program execution may lake place before the using the device without the device having to
intemal reset algorithm lakes control. On-chip The only exit from Power Down is a hardware be removed from the circuil. The ONCE
hardware inhibits access to the intemal RAM reset. Reset redefines all the SFRs. but does mode is invoked by:
during this time, but access to the port pins is not change the on-chip RAM. 1. Pull ALE low while the device in in reset
not inhibited. To eliminate the possibility of and PSEJiI is high;
In the Power Down mode of operation, Vee
unexpected outputs at the port pins. the can be reduced to as low as 2V. Care must 2. Hold ALE low as RST is deactivated.
instruction following the one that invokes Idle be taken. however, to ensure that Vee is not
should not be one that writes to aport pin or reduced before the Power Down mode is While the device is in the ONCE mode, the
to external Data RAM. invoked, and that Vee is restored to its Port 0 pins go into a float slate, and the other
normal operating level. before the Power port pins and ALE. and PSEJiI are weakly
Power-Down Mode Down mode is terminated. The reset that pulled high. The oscillator circuit remains
An instruction that sets PCON.1 causes that terminates Power Down also frees the active. While the device is in this mode, an
to be the last instruction executed before oscillator. The reset should not be activated emulator or test CPU can be used to drive
going into the Power Down mode. In the before Vee is restored to its normal operating the circuit. Normal operation is restored after
Power Down mode, the on-Chip oscillator is level, and must be held active long enough to a normal reset is applied.
February 1992 42
Signetics BOC51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description 80C51 FAMILY
The On-Chip Oscillators To drive the NMOS parts with an external The feedback resistor At in Figure 28
clock source, apply the external clock signal consists of paralleled n- and p-channel FETs
NMOS Version to XTAL2, and ground XTAL1, as shown in controlled by the PO bit, such that At is
The on-chip oscillator circuitry for the Figure 27. A pullup resistor may be used (to opened when PO = 1. The diodes 01 and 02,
NMOSmembers of the BOC51 family is a increase noise margin), but is optional if VOH which act as clamps to Vee and Vss, are
single stage linear inverter (Figure 25), of the driving gate exceeds the VIH minimum parasitic to the At FETs. The oscillator can be
intended for use as a crystal-controlled, specification of XTAL. used with the same external components as
positive reactance oscillator (Figure 26). In the NMOS versions, as shown in Figure 29.
this application the crystal is operated in its Typically, Cl = C2 =30pF when the feedback
CMOS Versions
fundamental response mode as an inductive element is a quartz crystal, and Cl = C2 =
The on-chip oscillator circuitry for the 80C51 ,
reactance in parallel resonance with 47pF when a ceramic resonator is used.
shown in Figure 28, consists of a single stage
capacitance external to the crystal.
linear inverter intended for use as a
The crystal specifications and capacitance crystal-controlled, positive reactance To drive the CMOS parts with an external
values (Cl and C2 in Figure 26) are not oscillator in the same manner as the NMOS clock source, apply the external clock signal
critical. 30pF can be used in these positions parts. However, there are some important to XTAL I, and leave XTAL2 float, as shown
at any frequency with good quality crystals. A differences. in Figure 30.
ceramic resonator can be used in place of the
crystal in cost-sensitive applications. When a One difference is that the 80C51 is able to The reason for this change from the way the
ceramic resonator is used, C 1 and C2 are turn off its oscillator under software control NMOS part is driven can be seen by
normally selected to be of somewhat higher (by writing a 1 to the PO bit in PCON). comparing Figures 26 and 28. In the NMOS
values, typically, 47pF. The manufacturer of Another difference is that, in the BOC51 , the devices the internal timing circuits are driven
the ceramic resonator should be consulted for internal clocking circuitry is driven by the by the signal at XTAL2. In the CMOS devices
recommendation on the values of these signal at XTAL I, whereas in the NMOS the internal timing circuits are driven by the
capacitors. versions it is by the signal at XTAL2. signal at XTAL 1.
Vcc
Tointemal
timing circuits
XTAL2
02
XTAL1
01
Subst
Figure 25. On-Chip Oscillator in the NMOS Version of the 8051 Family
02 To internal
timing circuits
Vss
8051 - - - - - - - - XTAL1 XTAL2 - -
Quartz Crystal or
Ceramic Resonator
C1 C2
February 1992 43
Signetics 80C51-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
Vcc
8051
Ex_mar XTAl2
Oscillator
Signal
XTAL1
Figure 27. Driving the NMOS 8051 Family Parts with an External Clock
Internal TIming external Data Memory.) This pin is also the application it uses strong internal pull ups
Figures 31 through 34 show when the various program pulse input (PROG) during EPROM when emitting ls. PortO emits code bytes
strobe and port signals are clocked internally. programming. during program verification. In this
The figures do not show rise and fall times of application, external pull ups are required.
PSEN: Program Store Enable is the read
the signals, nor do they show propagation Pori 1 : Port 1 is an 8-bit bidirectional 1/0 port
strobe to external Program Memory. When
delays between the XTAL2 signal and events with internal pullups. Port 1 pins that have 1s
the device is executing out of external
at other pins. written to them are pulled high by the internal
Program Memory, l'SEfiI'is activated twice
Rise and fall times are dependent on the each machine cycle (except that two.l'SEfiI' pullups, and in that state can be used as
external loading that each pin must drive. activations are skipped during accesses to inputs. As inputs, port 1 pins that are
They are often taken to be something in the external Data Memory). PSEN is not externally being pulled low will source current
neighborhood of 10ns, measured between activated when the device is executing out of because of the internal pullups.
0.8V and 2.0V. internal Program Memory. Pori 2: Port 2 is an 8-bit bidirectional 1/0 port
Propagation delays are different for different gNpp: When g is held high the CPU with internal pull ups. Port 2 emits the
pins. For a given pin they vary with pin executes out of internal Program Memory high-order address byte during accesses to
loading, temperature, Vee, and (unless the Program Counter exceeds OFFFH external memory that use 16-bit addresses.
manufacturing 101. If the XTAL2 waveform is in the 80C51). Holding EA low forces the In this application, it uses the strong internal
taken as the timing reference, prop delays CPU to execute out of external memory pullups when emitting 1s.
may vary up to ±200%. regardless of the Program Counter value. In Pori 3: Port 3 is an 8-bit bidirectional 1/0 port
the 80C31 , g must be externally wired low. with internal pullups. It also serves the
The AC TImings section of the data sheets do In the EPROM devices, this pin also receives functions of various special features of the
not reference any timing to the XTAL2 the programming supply voltage (Vpp) during 8OC51 Family as follows:
waveform. Rather, they relate the critical EPROM programming.
edges of control and input signals to each Pori Pin Alternate Function
other. The timings published in the data XTAL 1: Input to the inverting oscillator P3.0 RxD (serial input port)
sheets include the effects of propagation amplifier. P3.1 TxD (serial output POri)
delays under the specified test conditions. XTAL2: Output from the inverting oscillator P3.2 INTO (external interrupt 0)
amplifier. P3.3 lNTT (external interrupt 1)
80C51 Pin Descriptions P3.4 TO (timer 0 external input)
ALEIPROG: Address Latch Enable output Port 0: Port 0 is an 8-bit open drain P3.5 Tl (timer 1 external input)
pulse for latching the low byte of the address bidirectional port. As an open drain output P3.S WR (external data memory
during accesses to external memory. ALE is port, it can sink eight LS TIL loads. Port 0 write strobe)
emitted at a constant rate of liS of the pins that have 1s written to them float, and in P3.7 flU (external deta memory
oscillator frequency, for external timing or that state will function as high impedance read strobe)
clocking purposes, even when there are no inputs. Port 0 is also the multiplexed
accesses to external memory. (However, one Vcc: Supply voltage
low-order address and data bus during
ALE pulse is skipped during each access to accesses to external memory. In this Vss: Circuit ground potential
February 1992 44
Signetics BOC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
To internal vcc
timing circuits
01
4IlOn
R,
XTAL1 XTAl2
02
-----1\
n Q4
vss
Figure 2B. On-Chip Oscillator Circuitry in the CMOS Version of the BOC51 Family
VCC
To internal
timing circuits
Quartz Crystal or
Ceramic Resonator
C1 C2
8OC51
HC - XTAl2
External
Oscillator XTAL1
Signal
vss
CMOS Gate
Figure 30. Driving the CMOS Family Parts with an External Clock Source
February 1992 45
Signetics 80CS1-Based 8-Bit Microcontrollers
SECTION 1
80C51 family hardware description
80C51 FAMILY
I State 1
Pl1p2
IState 2
Pl1p2
I State 3
PllP2
I Stale 4
PllP2
I State 5
Pl1p2
I State 6
PllP2
I State 1
PllP2
I State 2
PllP2
I
XTA12:
ALE:
L
PSER:
L
PO:
I State 4
PI I P2
I State 5
PI I P2
I Stale 6
PI I P2
I State 1
PI I P2
I SIale 2
PI I P2
I State 3
PI I P2
I State 4
PI I P2
I State 5
PI I P2
I
XTAL2:
ALE:
L
5
lIU:
PCL Out if Program
DPLor AI r-_______A_o_~-t--r--i~----A-O-O.---
PO: Out
February 1992 46
Signetics SOC51-Based B-Bit Microcontrollers
SECTION 1
80C51 family hardware description 80C51 FAMILY
I S""'4
PllP2
I s.... s I
PI 1P2
S.... 6
PllP2
I S.... 1
Pll P2
I S.... 2
Pll P2
I S.... 3
PI I P2
I 5 .... 4
Pll P2
I s.... s I
Pll P2
XTAL2:
ALE:
L
WR:
PClOUt II Program
PO:
DPlor RI
Out
D... Out l;t-'~-
P2: PCHor DPH or P2 SFR Out PCHor
P2SFR P2SFR
I S""'4
Pl1p2
I S.... S
PllP2
I S.... 6
Pl1p2
I 5 .... 1
Pl1p2
I S.... 2
Pl1p2
I S.... 3
Pl1p2
I S.... 4
PllP2
I S..teS
PllP2
I
XTAL2:
~PO.P1 PO.Pl~
Inputs Sampled:
~P2,P3.RST P2,P3.RST~
SerlBlPort
Shift Clock
(Mode 0):
February 1992 47
Signetica SOC51-Based 8-Bit Mlcrocontrollers
PROGRAMMER'S GUIDE AND Direct and Indirect Address Area Each one of the 128 bits of this segment
INSTRUCTION SET The 128 bytes of RAM whic~can be can be direcUy addressed (0-7FH). The
accessed by both direct and indirect bits can be. referred to in two ways, both
Memory Organization addressing can be divided into three of which are acceptable by most
segments as listed below and shown In assemblers. One way is to refer to their
Program Memory Figure 3. address (i.e., 0-7FH). The other way is
The SOC51 has separate address spaces for 1. Register Banks 0-3: Locations 0 through with reference io bytes 20H to 2FH. Thus,
program and data memory. The Program 1FH (32 bytes). The device after reset bits 0-7 can also be referred to as bits
memory can be up to 64k bytes long. The defaults to register bank O. To use the 20.0-20.7, and bits 8-FH are the same as
lower 4k can reside on-chip. Figure 1 shows other register banks, the user must select 21.0-21.7, and so on. Each of the 16
a map of the 80C51 program memory. them in software. Each register bank bytes in this segment can also be
contains eight1-byte registers 0 through addressed as a byte.
The 80C51 can address up to 64k bytes of
7. Reset initializes the stack pointer to
data memory to the chip. The MOVX 3. Scratch Pad Area: 30H through 7FH are
instruction is used to access the external data location 07H, and it is incremented once
available to the user as data RAM.
to start from location 08H, which is the
memory. However, if the stack pointer has been
first register (RO) of the second register
initialized to this area, enough bytes
The SOC51 has,128 bytes of on-chip RAM, bank. Thus, in order to use more than one
should be left aside to prevent SP data
plus a number of Special Function Registers register bank, the SP should be initialized
(SFRs). The lower 128 bytes of RAM can be destruction.
to a diHerentlocation of the RAM where it
accessed either by direct addressing (MOV is not used for data storage (I.e., the
Figure 2 shows the diHerent segments of the
data addr) or by indirect addressing (MOV higher part of the RAM).
on-chip RAM. '
@Ri). Figure 2 shows the Data Memory
2. Bit Addressable Area: 16 bytes have been
organization.
assigned for this segment, 20H-2FH.
FFFF FFFF
&Ok
Byte.
External
641<
__ Or _ Byte.
External
1000
And
.1~
::: ________ ~_I~_B_r.:_~
________ ~ 0000
February 1992 48
Signetics 8OC51-BasOO B-Bit Microcontrollers
OFFF
Inlernal
&4k
FF Bytes
El!temll
SFRs
Direct Addreoo/ng
Only
80
- - And-
7F
Direct and Indirect
Addrenlng
00 0000
I- s Bytes
-I
78 7F
70 77
i;a SF
&0 67
58 5F s.ralCh
Pad
50 57 Area
48 4F
40 47
38 3F
30 37
28 ... 7F 2F Bit
Addrenablo
20 0_. 27 Segment
18 IF
10 17 Register
Banke
08 OF
00 0 07
February 1992 49
Signetics 80C51-Based 8-Bit Microcontrollers
87 86 85 84 83 82 81 80
PO' PortO 80H AD7 I AD6 I ADS I AD4 I AD3 I AD2 I ADI I ADO FFH
97 96 95 94 93 92 91 90
PI' Port 1 90H - I - I - I - I - I - I T2EX I T2 FFH
A7 A6 AS A4 A3 A2 Al AO
P2' Port 2 AOH A15 I A14 I A13 I A12 I All I Al0 I A9 I A8 FFH
B7 B6 B5 B4 B3 B2 Bl 80
P3' Port 3 80H RIT I WR I Tt I TO I rrm I INW I TxD I Rxd FFH
PCON1 Power control 87H SMOD I - I - I - I GFI I GFO I PD I IDL OxxxxxxxB
D7 D6 D5 D4 D3 D2 Dl DO
PSW' Program status word DOH CY I AC I FO I RS1 I RSO I ov I - I P OOH
SBUF Serial data buffer 99H xxxxxxxxB
9F 9E 9D 9C 9B 9A 99 98
SCOW Serial controller 98H SMO I SMI I SM2 I REN I TB8 I RB8· I TI I RI OOH
SP Stack pointer 81H 07H
8F 8E 8D 8C 8B 8A 89 88
TCOW Timer control 88H TF1 I TRI l TFO I TRO I lEI I ITt I lEO I ITO
THO Timer high 0 8CH OOH
THI Timer high 1 8DH OOH
TLO Timer low 0 8AH OOH
TL1 Timer low 1 8BH OOH
TMOD Timer mode 89H GATE I CIT I Ml I MO J GATE! CIT .L Ml J MO OOH
NOTES:
Bit addressable
1. Bits GF1, GFO, PD, and IDL of the PCON register are not implemented on the NMOS 8051/8031.
February 1992 50
Signetics BOC51-Based B-Bit Microcontrollers
B Bytes
Fa FF
FO B F7
Ea EF
EO Aee E7
oa OF
DO PSW 07
ca CF
co C7
B8 IP BF
BO P3 B7
Aa IE AF
AO P2 A7
99 seON SBUF 9F
90 Pl 97
t
Bit Addressable
February 1992 51
Signetics 8OC51-Based B-Bit Microcontrollers
Those SFRsthat have their bits assigned for various functions are listed in this section. A brief description of each bit is
provided for quick reference. For more detailed information refer to the Architecture Chapter of this book.
CY AC FO I RSI RSO OV P
SMOD Double baud rate bit. If Timer 1 is used to generate baud rate and SMOD = I, the baud rate is doubled when the Serial
Port is used in modes I, 2, or 3.
Not implemented, reserved for future use:
Not implemented reserved for future use.'
Not implemented reserved for future use.'
GFI General purpose flag bit.
GFO General purpose flag bit.
PD Power Down Bit. Setting this bit activates Power Down operation in the SOCS1. (Available only in CMOS.)
IDL Idle mode bit. Setting this bit activates Idle Mode operation in the BOCSI. (Available only in CMOS.)
If 1s are written to PD and IDL at the same time, PD takes precedence.
• User software should not write 1s to reserved bits. These bits may be used in future B051 products to invoke new features.
February 1992 52
Signetics SOC51-Based S-Bit Microcontroilers
INTERRUPTS:
To use any of the interrupts in the BOC51 Family, the following three steps must be taken.
1. Set the EA (enable all) bit in the IE register to 1.
2. Set the corresponding individual Interrupt enable bit in the IE register to 1_
3. Begin the Interrupt service routine at the corresponding Vector Address of that Interrupt. See Table below.
lEO 0003H
TFO OOOBH
lEI 0013H
TFI 001BH
RI& TI 0023H
In addition, for external interrupts, pins INTO and INTl (P3.2 and P3.3) must be set to 1, and depending on whether the interrupt
is to be level or transition activated, bits ITO or ITl in the TCON register may need to be set to 1.
ITx = 0 level activated
ITx = 1 transition activated
February 1992 53
Signetics 80CS1-Based 8-Bit Microcontrollers
February 1992 54
Signetics 80C51-Based 8-Bit Microcontrollers
TF1 TCON.7 Timer 1 overflow flag. Set by hardware when the Timer/Counter 1 overflows. Cleared by hardware as
processor vectors to the interrupt service routine.
TR1 TCON.6 Timer 1 run control bit. Set/cleared by software to turn Timer/Counter 1 ON/OFF.
TFO TCON.5 Timer 0 overflow flag. Set by hardware when the Timer/Counter 0 overflows. Cleared by hardware as
processor vectors to the service routine.
TRO TCONA Timer 0 run control bit. Set/cleared by software to turn Timer/Counter 0 ON/OFF.
IE1 TCON.3 External Interrupt 1 edge flag. Set by hardware when External Interrupt edge is detected. Cleared by
hardware when interrupt is processed.
IT1 TCON.2 Interrupt 1 type control bit. Set/cleared by software to specify falling edge/low level triggered External
Interrupt.
lEo TCON.1 External Interrupt 0 edge flag. Set by hardware when External Interrupt edge detected. Cleared by
hardware when interrupt is processed.
ITO TCON.o Interrupt 0 type control bit. Set/cleared by software to specify falling edge/low level triggered External
Interrupt.
GATE When TRx (in TCON) is set and GATE = 1, TIMER/COUNTERx will run only while INTx pin is high (hardware control).
When GATE = 0, TIMER/COUNTERx will run only while TRx = 1 (software control).
CIT Timer or Counter selector. Cleared for Timer operation (input from internal system clock). Set for Counter operation
(input from Tx input pin).
M1 Mode selector bit. (NOTE 1)
MO Mode selector bit. (NOTE 1)
NOTE 1:
Ml MO Operating Mode
o o o 13-bit Timer (B048 compatible)
o 1 1 16-bit Timer/Counter
1 o 2 B-bit Auto-Reload Timer/Counter
1 1 3 (Timer 0) TLO is an 8-bit Timer/Counter controlled by the standart Timer 0
control bits. THO is anB-bit Timer and is controlled by Timer 1 control bits.
3 (Timer 1) Timer/Counter 1 stopped.
February 1992 55
Signetics 80CS1-Based 8-Bit Microcontrollers
TIMER SET-UP
Tables 2 through 5 give some values for TMOD which can be used to set up TImer 0 indifferent modes.
It is assumed that only one timer is being used at a time. If it is desired to run TImers 0 and 1 simultaneously. in any mode, the
value in TMOD for TImer 0 must be ORed with the value shown for TImer 1 (TablesS and 6).
For example, if it is desired to run TImer 0 in mode 1 GATE (external control), and TImer 1 in mode 2 COUNTER. then the value
that must be loaded into TMOD is 69H (09H from Table 3 ORed with 60H from Table 6).
Moreover, it is assumed that the user, at this point. is not ready to turn the timers on and will do that at a different point in the
program by setting bit TRx (in TeON) to 1.
TIMER/COUNTER 0
Table 2. As a Timer:
TMOD
MODE TIMER 0 INTERNAL EXTERNAL
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-bit Timer OOH 08H
1 16-bit Timer 01H 09H
2 8-bit Auto-Reload 02H OAH
3 Two 8-bit Timers 03H OBH
Table 3, As a Counter:
TMOD
MODE COUNTER 0 INTERNAL EXTERNAL
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-bit Timer 04H OCH
1 16-bit Timer 05H ODH
2 8-bit Auto-Reload 06H OEH
3 One 8-bit Counter 07H OFH
NOTES:
1. The timer is turned ON/OFF by setting/clearing bit TRO in the software.
2. The Timer is turned ON/OFF by the 1-10-0 transition on l'f'rrn (P3.2) when TRO = 1 (hardware control).
February 1992 56
Signetics 80C51-Based 8-Bit Microcontrollers
TIMER/COUNTER 1
Table 4. As a Timer:
moo
MODE TIMER 1 INTERNAL EXTERNAL
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-bitTimer OOH SOH
1 16-bitTimer 10H SOH
2 8-bit Auto-Reload 20H AOH
3 Does not run 30H BOH
Table 5. As a Counter:
moo
MODE COUNTER 1 INTERNAL EXTERNAL
FUNCTION CONTROL CONTROL
(NOTE 1) (NOTE 2)
0 13-bitTimer 40H COH
1 16-bitTimer SOH DOH
2 8-bit Auto-Reload SOH EOH
3 Not available - -
NOTES:
1. The timer is tumed ON/OFF by setting/clearing bit TR 1 in the software.
2. The Timer is turned ONIOFF by the l-to-O transition on J1IITT (P3.2) when TRl =1 (hardware control).
February 1992 57
Signetics 80C51-Based 8-Bit Microconb'ollers
NOTE 1:
February 1992 58
Signetics aOC51-Based 8-Bit Microcontrollers
If SMOD = 0, then K = 1.
If SMOD = 1, then K = 2 (SMOD is in the PCON register).
Most of the time the user knows the baud rate and needs to know the reload value for TH 1.
TH1 must be an integer value. Rounding off TH1 to the nearest integer may not produce the desired baud rate. In this case, the
user may have to choose another crystal frequency.
Since the PCON register is not bit addressable, one way to set the bit is logical ORing the PCON register (Le., ORL
PCON,#80H). The address of PCON is 87H.
February 1992 59
Signetics 80C51-Based 8-Bit Microcontrollers
February 1992 60
Signetics 80C51-Based B-Bit Microcontrollers
February 1992 61
Signetics SOC51-Based 8-Bit Microcontrollers
February 1992 62
Signetics 80C51-Based 8-Bit Microcontrollers
February 1992 63
Signetics 80CS1-Based 8-Bit Microcontrollers
INSTRUCTION DEFINITIONS
ACALL addr11
Function: Absolute Call
Description: ACALL unconditionally calls a subroutine located at the indicated address. The instruction increments the
PC twice to obtain the address of the following instruction, then pushes the IS-bit result onto the stack
(low-order byte first) and increments the Stack Pointer twice. The destination address is obtained by
successively concatenating the five high-order bits of the incremented PC, opcode bits 7-S, and the
second byte of the instruction. The subroutine called must therefore start within the same 2k block of the
program memory as the first byte of the instruction following ACALL. No flags are affected.
Example: Initially SP equals 07H. The label "SUBRTN" is at program memory location 0345 H. After executing the
instruction,
ACALL SUBRTN
at location 0123H, SP will contain 09H, internal RAM locations 08H and 09H will contain 25H and 01H,
respectively, and the PC will contain 034SH.
By1es: 2
Cycles: 2
ADD A,<src-byte>
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 of bit 6 but not out of bit 7, or a carry-out of bit 7 but not bit 6; otherwise OV
is cleared. When adding signed integers, OV indicates a negative number 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 (11000011 B) and register 0 holds OAAH (1010101 OB). The instruction,
ADD A,RO
will leave 6DH (01101101 B) in the Accumulator with the AC flag cleared and both the Carry flag and OV
set to 1.
ADD A,Rn
Bytes:
Cycles:
Operation: ADD
(A) ~ (A) + (Rn)
ADD A,direct
Bytes: 2
Cycles:
ADD A,@Ri
Bytes:
Cycles:
Encoding: 10 0 1 0 I0
Operation: ADD
(A) ~ (A) + ((Ri))
ADD A,#data
Bytes: 2
Cycles:
February 1992 65
Signetics 80C51-Based 8-Bit Microcontrollers
ADDC A,<src-byte>
Function: Add with Carry
Description: ADDC simu~aneously adds the byte variable indicated, the carry flag and the Accumulator contents,
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 of bit 6 but not out of bit 7, or a carry-out of bit 7 but not out of bit 6;
otherwise OV is cleared. When adding signed integers, OV indicates a negative number produced as the
sum of two positive operands, or a positive sum from two negative operands.
Four source operand addressing modes are allowed: register, direct, register-indirect, or immediate.
Example: The Accumulator holds OC3H (11000011 B) and register 0 holds OAAH (10101010B) with the carry flag set.
The instruction,
ADDC A,RO
will leave 6EH (0110111 OB) in the Accumulator with AC cleared and both the Carry flag and OV set to 1.
AD DC A,Rn
Bytes:
Cycles:
Encoding: 10 0 1 1 11 r r
Operation: ADDC
(A) (- (A) + (C) + (Rn)
ADDC A,direct
Bytes: 2
Cycles:
ADDC A,@RI
Bytes:
Cycles:
Encoding: 10 0 1 1 10
Operation: ADDC
(A) (- (A) + (C) + «Ri))
ADDC A,#data
Bytes: 2
Cycles:
February 1992 66
Signetics 80C51-Based 8-Bit Microcontrollers
AJMP addr11
Function: Absolute Jump
Description: AJMP transfers program execution to the indicated address, which is formed at run-time by concatenating
the high-order five bits of the PC (after incrementing the PC twice), opcode bits 7-5, and the second byte
of the instruction. The destination must therefore be within the same 2k block of program memory as the
first byte of the instruction following AJMP.
Example: The label "JMPADR" is at program memory location 0123H. The instruction,
AJMP JMPADR
is at location 0345H and will load the PC with 0123H.
Bytes: 2
Cycles: 2
Operation: AJMP
(PC) (- (PC) + 2
(PC, ().o) (- page address
ANL <dest-byte>,<src-byte>
Function: Logical-AND for byte variables
Description: ANL performs the bitwise logical-AND operation between the variables indicated and stores the results in
the destination variable. No flags are affected.
The two operands allow six addressing mode combinations. When the destination is the Accumulator, 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 (110000118) and register 0 holds 55H (010101018) then the instruction,
ANL A,RO
will leave 41 H (010000018) 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 Pl,#0111001B
will clear bits 7, 3, and 2 of output port 1.
February 1992 67
Signetics 80C51-Based 8-Bit Microcontrollers
ANL A,Rn
Bytes:
Cycles:
Encoding: 0 1 11 r r
10
Operation: ANL
(A) (- (A) A (Rn)
ANL A,dlrect
Bytes: 2
Cycles:
Encoding: 10 0 1 I 0 0 1 I
direct address I
Operation: ANL
(A) (- (A) A (direct)
ANL A,@RI
Bytes:
Cycles:
Encoding: 1 0 1
10 10
Operation: ANL
(A) (- (A) A «Ri»
ANL A,#data
Bytes: 2
Cycles:
Encoding: 10 0 1
10
0 0 I
immediate data I
Operation: ANL
(A) (- (A) A #data
ANL direct,A
Bytes: 2
Cycles:
Encoding: 10 0 1
10 0 1 0 I
direct address I
Operation: ANL
(A) (-(direct) A (A)
ANL direct,#data
Bytes: 3
Cycles: 2
Encoding: 10 0 1
10 0 1 I direct address I
immediate data I
Operation: ANL
(direct) (-(direct) A #data
February 1992 68
Signetics 80C5l-Based 8-Bit Microcontrollers
ANL C,<src.bll>
Function: Logical-AND for bit variables
Description: If the Boolean value of the source bit is a logical 0 then clear the carry flag; otherwise leave the carry flag
in tts current state. A slash ("f') preceding the operand in the assembly language indicates that the logical
complement of the addressed bit is used as the source value, but the source bit itself is not affected. No
other flags are affected.
Only direct addressing is allowed for the source operand.
Example: Set the carry flag if, and only if, Pl.O ~ I, ACC.7 ~ I, and OV ~ 0:
MOV C,Pl.0 ;LOAD CARRY WITH INPUT PIN STATE
ANL C,ACC.7;AND CARRY WITH ACCUM. BIT 7
ANL C,IOV ;AND WITH INVERSE OF OVERFLOW FLAG
ANL C,bit
Bytes: 2
Cycles: 2
Operation: ANL
(C) (- (C) 1\ (bit)
ANL C,lbit
Bytes: 2
Cycles: 2
Operation: ANL
(C) (- (C) 1\ 1(bit)
February 1992 69
Signetics 80C51-Based 8-Bit Microcontrollers
CJNE <dest-byte>,<src-byte>,rel
Function: Compare and Jump if Not Equal
Description: CJNE compares the magnitudes of Ihe first two operands, and branches if their values are not equal. The
branch destination is computed by adding the signed relative-displacement in the last instruction byte to
n
the PC, after incrementing the PC to the start of the next instruction. The carry flag is set the unsigned
integer value of <dest-byte> is less than the unsigned integer value of <src-byte>; otherwise, the carry is
cleared. Neither operand is affected.
The first two operands allow four addressing mode combinations: the Accumulator may be compared with
any directly addressed byte or immediate data, and any indirect RAM location or working 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_EO
R7= 60H.
IF R7 <60H.
R7> 60H.
sets the carry flag and branches to the instruction at label NOT_Ea. 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,Pl,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.)
CJNE A,direct,rel
Bytes: 3
Cycles: 2
February 1992 70
Signetics BOC51-Based B-Bit Microcontrollers
CJNE A,#data,rel
Bytes: 3
Cycles: 2
CJNE Rn,#data,rel
Bytes: 3
Cycles: 2
CJNE @Ri,#data,rel
Bytes: 3
Cycles: 2
February 1992 71
Signetics 80CS1-Based 8-Bil Microcontrollers
CLR A
Function: Clear Accumulator
Description: The Accumulator is cleared (all bits reset to zero). No flags are affected.
Example: The Accumulator contains 5CH (010111006). The instruction,
CLR A
will leave the Accumulator set to OOH (000000006).
Bytes:
Cycles:
CLR bit
Function: Clear bit
Description: The indicated bit is cleared (reset to zero). No other flags are affected. CLR can operate on the carry flag
or any directly addressable bit.
Example: Port 1 has previously been written with 5DH (010111016). The instruction,
CLR Pl.2
will leave the port set to 59H (010110016).
CLR C
Bytes:
Cycles:
Encoding:
Operation:
11
CLR
° ° I° ° 1 1
(C) f- °
CLR bit
Bytes: 2
Cycles:
bit address
Encoding:
Operation:
11
CLR
°° 10
° °
1
(bit) f- °
February 1992 72
Signetics 80CS1-Based 8-Bit Microcontrollers
CPL A
Function: Complement Accumulator
Description: Each bit of the Accumulator is logically complemented (one's complement). Bits which previously
contained a one are changed to a zero and vice-versa. No flags are affected.
Example: The Accumulator contains 5CH (01011100B). The instruction,
CPL A
will leave the Accumulator set to OA3H (10100011 B).
Bytes: 1
Cycles:
Encoding: I 0 o 0
Operation: CPL
(A) f- 1 (A)
CPL bit
Function: Complement bit
Description: The bit variable specified is complemented. A bit which had been a one is changed to zero and vice-versa.
No other flags are affected. CLR can operate on the carry or any directly addressable 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 50H (01011101 B). The instruction sequence,
CPL P1.1
CPL P1.2
will leave the port set to 5BH (01011011 B).
CPL C
Bytes:
Cycles:
Encoding: 11 0 1 1 10 0 1 1
Operation: CPL
(C) f- 1 (C)
CPL bit
Bytes: 2
Cycles:
February 1992 73
Signetics 80C51-Based 8-8il Microcontrollers
DA A
Function: Decimal-adjust Accumulator for Addition
Description: DA A adjusts the eight-bit value in the Accumulator resulting from the earlier addition of two variable (each
in packed-BCD format), producing two four-bit digits. Any ADD or ADDC instruction may have been used
to perform the addition.
If Accumulator bits 3-0 are greater than nine (XXXI 01 O-xxxllll), 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 addition 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 (101 Oxxx-Ill xxxx), these
high-order bits are incremented by six, producing the proper BCD digit in the high-order nibble. Again, this
would set the carry flag if there was a carry-out of the high-order bits, but wouldn't clear the carry. The
carry flag thus indicates if the sum of the original two BCD variables is greater than 100, allowing mUltiple
precision decimal addition. OV is not affected.
All of this occurs during the one instruction cycle. Essentially, this instruction performs the decimal
conversion by adding OOH, 06H, 60H, or 66H to the Accumulator, depending on initial Accumulator and
PSW conditions.
Note: DA A cannot simply convert a hexadecimal number in the Accumulator to BCD notation, nor does
DA A apply to decimal subtraction.
Example: The Accumulator holds the value 56H (0101011 OB) 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 two's-complement binary addition, resulting in the value OBEH (10111110B) 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 (001001 OOB), indicating 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, indicating that a decimal overflow
occurred. The true sum 56, 67, and 1 is 124.
BCD variables can be incremented or decremented by adding 01 H or 99H. If the Accumulator initially
holds 30H (representing the digits of 30 decimal), the the instruction sequence,
ADD A,#99H
DA A
will leave the carry set and 29H in the Accumulator, since 30 + 99 = 129. The low-order byte of the sum
can be interpreted to mean 30 - 1 = 29.
Bytes:
Cycles:
Encoding: L.ll_ _ _o
__l --1.1_0_ _ _0_0---1
Operation: DA
-contents of Accumulator are BCD
IF ([(A3.0 ) > 9] v [(AC) = I]]
THEN(A3.o) ~ (A3-o) + 6
AND
IF ([(A7-4) > 9] v [(C) = I]]
THEN(A7-4) ~ (A7-4) + 6
February 1992 74
Signetics 80C51-Based 8-Bit Microcontrollers
DEC byte
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 data will be
read from the output data latch, notthe input pin.
Example: Register 0 contains 7FH (01111111 B). 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: 10 0 0 1 10 o 0
Operation: DEC
(A) f- (A)-1
DEC Rn
Bytes:
Cycles:
Encoding: 10 0 0 1 r r
Operation: DEC
(Rn) f- (Rn) - 1
DEC direct
Bytes: 2
Cycles:
DEC @Ri
Bytes:
Cycles:
Encoding: I0 0 0 1 I 0
Operation: DEC
((Ri)) f- ((Ri)) - 1
February 1992 75
Signetics 80CSI-Based 8-Bit Microcontrollers
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 DOH, 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 Accurnulator contains 251 (OFBH or 11111011 B) and B contains 18 (12H or 0001001 DB). The
instruction,
DIV AB
will leave 13 in the Accumulator (ODH or 00001101 B) and the value 17 (11 H or 00010001 B) in B, since 251
= (13 x 18) + 17. Carry and OV will both be cleared.
Bytes: 1
Cycles: 4
Encoding: 11 0 0 0 I0 0 0
Operation: DIV
(A)lS.S (- (A)/(B)
(Bh-o
February 1992 76
Signetics BOC5t-Based 8-Bil Microcontrollers
DJNZ <byte>,<rel-addr>
Function: Decrement and Jump if Not Zero
Description: DJNZ decrements the location indicated by I, and branches to the address indicated by the second
operand if the resulting value is not zero. An original value of OOH will underflow to OFFH. No flags are
affected. The branch destination would be computed by adding the signed relative-displacement value in
the last instruction byte to the PC, after incrementing the PC to the first byte of the following instruction.
The location decremented may be a register or directly addressed byte.
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 SOH contain the values 01 H, 70H, and 15H, respectively. The
instruction sequence,
DJNZ 40H,LABEL 1
DJNZ 50H,LABEL-2
DJNZ SOH,LABE()
will cause a jump to the instruction at LABEL_2 with the values OOh, SFH, and 15H in the three RAM
locations. The first jump was not taken because the result was zero.
This instruction provides a simple was of executing a program loop a given number of times, or for adding
a moderate time delay (from 2 to 512 machine cycles) with a single instruction. The instruction sequence,
MOV R2,#8
TOGGLE: CPL Pl.7
DJNZ R2,TOGGLE
will toggle Pl.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 aker 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
Operation: DJNZ
(PC) ~ (PC) + 2
(direct) ~ (direct)-1
IF (direct) > 0 or (direct) < 0
THEN
(PC) ~ (PC) + rei
Signetics 80C51-Based 8-Bit Microcontrollers
INC <byte>
Function: Increment
Description: INC increments the indicated variable by 1. 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 (0111111 OB). 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: 10 0 0 0 I0 o 0
Operation: INC
(A)~ (A) + 1
INC Rn
Bytes:
Cycles:
Encoding: 10 0 0 0 r r
Operation: INC
(Rn) ~ (Rn) + 1
INC direct
Bytes: 2
Cycles:
INC @Ri
Bytes:
Cycles:
Encoding: 10 0 0 0 10
Operation: INC
((Ri)) ~ ((Ri)) + 1
February 1992 78
Signetics 80C51-Based 8-Sil Microcontrollers
INC DPTR
Function: Increment Data Pointer
Description: Increment the 16-bit data pointer by 1. A 16-bit increment (modulo 216 ) is performed; an overflow of the
low-order byte of the data pointer (DPL) from OFFH to OOH will increment the high-order byte (DPH). No
flags are affected.
This is the only 16-bit register which can be incremented.
Example: Registers DPH and DPL contain 12H and OFEH, respectively. The instruction sequence,
INC DPTR
INC DPTR
INC DPTR
will change DPH and DPL to 13H and 01 H.
Bytes: 1
Cycles: 2
Encoding: lL-l__0___0_.J...1_0__0__
1_1--1
Operation: INC
(DPTR) ~ (DPTR) + 1
JB blt,rel
Function: Jump if Bit set
Description: If the indicated bit is a one, jump to the address indicated; otherwise proceed with the next instruction. The
branch destination is computed by adding the signed relative-displacement in the third instruction byte to
the PC, alter incrementing the PC to the first byte of the next instruction. The bit tested is not modified. No
lIags are affected.
Example: The data present at input port 1 is 11001010B. The Accumulator holds 56 (01010110B). The instruction
sequence,
JB P1.2,LABEL1
JB ACC.2,LABEL2
will cause program execution to branch to the instruction at label LABEL2.
Bytes: 3
Cycles: 2
Operation: JB
(PC) ~ (PC) + 3
IF (bit) = 1
THEN
(PC) ~ (PC) + rei
February 1992 79
Signetics 80CS1-Based 8-Bit Microcontrollers
JBC bit,rel
Function: Jump if Bit is set and Clear bit
Description: If the indicated bit is a one, branch to the address indicated; otherwise proceed with the next instruction.
The bit will not be cleared if it is already a zero. The branch destination is computed by adding the signed
relative-displacement in the third instruction byte to the PC, after incrementing the PC to the first byte of
the next instruction. No flags are affected.
Note: When this instruction is used to test an output pin, the value used as the original data will read from
the output data latch, not the input pin.
Example: The Accumulator holds 56H (0101011 OB). The instruction sequence,
JBC ACC.3,LABEL1
JBC ACC.2,LABEL2
will cause program execution to continue at the instruction identified by the LABEL2, with the Accumulator
modified to 52H (0101001 OB).
Bytes: 3
Cycles: 2
Operation: JBC
(PC) f- (PC) + 3
IF (bit) = 1
THEN
(bit)f- °
(PC) f- (PC) + rei
JC rei
Function: Jump if Carry is set
Description: If the carry flag is set, branch to the address indicated; otherwise proceed with the next instruction. The
branch destination is computed by adding the signed relative-displacement in the second instruction byte
to the PC, after incrementing the PC twice. No flags are affected.
Example: The carry flag is cleared. The instruction sequence,
JC LABELl
CPL C
JC LABEL2
will set the carry and cause program execution to continue at the instruction identified by the label
LABEL2.
Bytes: 2
Cycles: 2
Encoding: 10
..._ _ _0_0--1.1_0_0_ _
0_0--, reI. address
Operation: JC
(PC) f- (PC) + 2
IF (C) = 1
THEN
(PC) f- (PC) + rei
February 1992 80
Signetics 80C51-Based 8-Bit Microcontrollers
JMP @A+DPTR
Function: Jump indirect
Description: Add the eight-bit unsigned contents of the Accumulator with the sixteen-bit data pointer, and load the
resulting sum to the program counter. This will be the address lor subsequent instruction fetches.
Sixteen-bit addition is performed (modulo 216 ): a carry-out from the low-order eight bits propagates through
the higher-order bits. Neither the Accumulator nor the Data Pointer is altered. No flags are affected.
Example: An even number from 0 to 6 is in the Accumulator. The following sequence of instructions will branch to
one of four AJMP instructions in a jump table starting at JMP_ TBl:
MOV DPTR,#JMP TBl
JMP @A+DPTR -
JMP_TBl: AJMP lABElO
AJMP lABEL1
AJMP lABEl2
AJMP lABEl3
If the Accumulator equals 04H when starting this sequence, execution will jump to label lABEL2.
Remember that AJMP is a two-byte instruction, so the jump instructions start at every other address.
Bytes:
Cycles: 2
Encoding: 10
..._ _ _1_1---.J1L-0
__0__
1_1---.J
Operation: JMP
(PC) f- (A) + (DPTR)
JNB blt,rel
Function: Jump if Bit Not set
Description: If the indicated bit is a zero, branch to the indicated address; otherwise proceed with the next instruction.
The branch destination is computed by adding the signed relative-displacement in the third instruction byte
to the PC, after incrementing the PC to the first byte of the next instruction. The bit tested is not modified.
No flags are affected.
Example: The data present at input port 1 is 1100101 OB. The Accumulator holds 56H (01 010110B). The instruction
sequence,
JNB P1.3,lABEl1
JNB ACC.3,lABEL2
will cause program execution to continue at the instruction at label lABEl2.
Bytes: 3
Cycles: 2
Operation: JNB
(PC) f- (PC) + 3
IF (bit) = 0
THEN
(PC) f- (PC) + rei
February 1992 81
Signetics 80C51-Based 8-Bit Microcontrollers
JNC reI
Function: Jump if Carry Not set
Description: If the carry flag is a zero, branch to the address indicated; otherwise proceed with the next instruction. The
branch destination is computed by adding the signed relative-{jisplacement in the second instruction byte
to the PC, after incrementing the PC twice to point to the next instruction. The carry flag is not modified.
Example: The carry flag is set. The instruction sequence,
JNC LABEL1
CPL C
JNC LABEL2
will clear the carry and cause program execution to continue at the instruction identified by the label
LABEL2. .
Bytes: 2
Cycles: 2
Operatfon: JNC
(PC) (- (PC) + 2
IF(C)=O
THEN
(PC) (- (PC) + rei
JNZ reI
Functfon: Jump if Accumulator Not Zero
Description: If any bit of the Accumulator is a one, branch to the indicated address; otherwise proceed with the next
instruction. The branch destination is computed by adding the signed relative-displacement in the second
instruction byte to the PC, after incrementing the PC twice. The Accumulator is not modified. No flags are
affected.
Example: The Accumulator originally holds OOH. The instruction sequence,
JNZ LABEL1
INC A
JNZ LABEL2
will set the Accumulator to 01 H and continue at label LABEL2.
Bytes: 2
Cycles: 2
Operation: JNZ
(PC) (- (PC) + 2
IFA",O
THEN (PC) (- (PC) + rei
Signetics 80C51-Based 8-Bit Microcontrollers
JZ rei
Function: Jump if Accumulator Zero
Description: If all bits of the Accumulator are zero, branch to the indicated address; otherwise proceed with the next
instruction. The branch destination is computed by adding the signed relative-displacement in the second
instruction byte to the PC, after incrementing the PC twice. The Accumulator is not modified. No flags are
affected.
Example: The Accumulator originally holds 01 H. The instruction sequence,
JZ LABELl
DEC A
JZ LABEL2
will change the Accumulator to OOH and cause program execution to continue at the instruction identified
by the label LABEL2.
Bytes: 2
Cycles: 2
Operation: JZ
(PC) (- (PC) + 2
IFA=O
THEN (PC) (- (PC) + rei
LCALL addr16
Function: Long Call
Description: LCALL calls a subroutine located at the indicated address. The instruction adds three to the program
counter to generate the address of the next instruction and then pushes the 16-bit result onto the stack
(low byte first), incrementing the Stack Pointer by two. The high-order and low-order bytes of the PC are
then loaded, respectively, with the second and third bytes of the LCALL instruction. Program execution
continues with the instruction at this address. The subroutine may therefore begin anywhere in the full
64k-byte program memory address space. No flags are affected.
Example: Initially the Stack Pointer equals 07H. The label "SUBRTN" is assigned to program memory location
1234H. After executing the instruction,
LCALL SUBRTN
at location 0123H, the Stack Pointer will contain 09H, internal RAM locations OSH and 09H will contain
26H and 01 H, and the PC will contain 1235H.
Bytes: 3
Cycles: 2
0
Encoding: 10 °1 10
° 1 0 addrl5-addrS addr7-addrO
Operation: LCALL
(PC) (- (PC) + 3
(SP) (- (SP) + 1
((SP)) (- (PC7.())
(SP) (- (SP) + 1
((SP)) (- (PC 15.S)
(PC) (- addr15.o
February 1992 83
Signetics BOC51-Based B-Bit Microconlroilers
LJMP addr16 (Implemented In 87C751 and 87C752 for In-clrcuit emulation only.)
Function: Long Jump
Description: WMP causes an unconditional branch to the indicated address, by loading the high-order and low-order
bytes of the PC (respectively) with the second and third instruction bytes. The destination may therefore be
anywhere in the full 64k program memory address space. No flags are affected.
Example: The label "JMPADR" is assigned to the instruction at program memory location 1234H. The instruction,
WMP JMPADR
at location 0123H will load the program counter with 1234H.
Bytes: 3
Cycles: 2
Operation: WMP
(SP» f- addr15_s
MOV <dest-bytb,<src-byte>
Function: Move byte variable
Description: The byte variable indicated by the second operand is copied into the location specified by the first operand.
The source byte is not affected. No other register or flag is affected.
This is by far the most flexible operation. Fifteen combinations of source and destination addressing
modes are allowed.
Example: Internal RAM location 30H holds 40H. The value of RAM location 40H is 1OH. The data present at input
port 1 is 1100101 OB (OCAH). The instruction sequence,
MaV RO,#30H ;RO < = 30H
MaV A,@RO ;A < = 40H
MaV Rl",A ;Rl < = 40H
MaV B,@Rl ;B < = 10H
MaV @Rl ,PI ;RAM (40H) < = OCAH
MaV P2,Pl ;P2 #OCAH
leaves the value 30H in register 0, 40H in both the Accumulator and register 1, 10H in register B, and
OCAH (1100101 OB) both in RAM location 40H and output on port 2.
MOV A,Rn
Bytes:
Cycles:
Encoding: Il
..._ _ _l_o--,-I_l_ _ _
r _r----l
Operation: MaV
(A) f- (Rn)
Signetics 80C51-Based 8-Bit Microcontrollers
'MOV A,direct
Bytes: 2
Cycles:
Encoding: 11 1 0
10 0 1 direct address I
Operation: MOV
(A) ~ (direct)
MOV A,@Ri
Bytes:
Cycles:
Encoding: 11 0 I 0
Operation: MOV
(A)~ (Ri)
MOV A,#data
Bytes: 2
Cycles:
Encoding: 10 1 1
10
0 0 Iimmediate datal
Operation: MOV
(A) ~ #data
MOV Rn,A
Bytes:
Cycles:
Encoding: 11 r r
Operation: MOV
(Rn) ~ (A)
MOV Rn,direct
Bytes: 2
Cycles: 2
Encoding: 11 0 1 0 11 r r I
direct address
Operation: MOV
(Rn)~ (direct)
MOV Rn,#data
Bytes: 2
Cycles:
February 1992 85
Signetics 80C51-Based 8-Bit Microcontrollers
MOV dlrect,A
Bytes: 2
Cycles:
Encoding: 11 1 1 I 0 0 1 I
direct address
Operation: MOV
(direct) ~ (A)
MOV direct,Rn
Bytes: 2
Cycles: 2
Encoding: 11 0 0 0 11 r r I
direct address
Operation: MOV
(direct) ~ (Rn)
MOV direct,dlrect
Bytes: 3
Cycles: 2
MOV direct,@Ri
Bytes: 2
Cycles: 2
Encoding: 11 0 0 0
10 I
direct address
Operation: MOV
(direct) ~ (Ri)
MOV direct,#data
Bytes: 3
Cycles: 2
Encoding: 10 1 1
10 0 1 direct address II immediate data I
Operation: MOV
(direct) ~ #data
MOV @Ri,A
Bytes:
Cycles:
Encoding: 11 1 1 I 0
Operation: MOV
((Ri))~ (A)
February 1992 86
Signetics 80CS1-Based 8-Bit Microcontrollers
MOV @RI,dlrect
Bytes: 2
Cycles: 2
MOV @RI,#data
Bytes: 2
Cycles:
MOV cdest-blb,<src-blt>
Function: Move bit data
Description: The Boolean variable indicated by the second operand is copied into the location specified by the first
operand. One of the operands must be the carry flag; the other may be any directly addressable bit. No
other register or flag is affected.
Example: The carry flag is originally set. The data present at input Port 3 is 11000101 B. The data previously written
to output Port 1 is 35H (00110101 B). The instruction sequence,
MOV Pl.3,C
MOV C,P3.3
MOV Pl.2,C
will leave the carry cleared and change Port 1 to 39H (00111001 B).
MOV C,bit
Bytes: 2
Cycles:
MOV bit,C
Bytes: 2
Cycles: 2
February 1992 87
Signetics 80C51-8ased 8-8it Microcontrollers
MOV DPTR,#data16
Function: Load Data Pointer with a 16-bit constant
Description: The Data Pointer is loaded with the 16-bit constant indicated. The 16-bit constant is loaded into the second
and third bytes of the instruction. The second byte (DPH) is the high-order byte, while the third byte (DPL)
holds the low-order byte. No flags are affected.
This is the only instruction which moves 16 bits of data at once.
Example: The instruction,
MOV DPTR,#1234H
will load the value 1234H into the Data Pointer: DPH will hold 12H and DPL will hold 34H.
Bytes: 3
Cycles: 2
Operation: MOV
(DPTR) (- (#data15.0)
DPH 0 DPL (- #data15.B O#data7.o
MOVC A,@A+<base-reg>
Function: Move Code byte
Description: The MOVC instructions load the Accumulator with a code byte, or constant from program memory. The
address of the byte fetched is the sum of the original unsigned eight-bit Accumulator contents and the
contents of a sixteen-bit base register, which may be either the Data Pointer or the PC. In the latter case,
the PC is incremented to the address of the following instruction before being added with the Accumulator;
otherwise the base register is not altered. Sixteen-bit addition is performed so a carry-out from the
low-order eight bits may propagate through higher-order bits. No flags are affected.
Example: A value between 0 and 3 is in the Accumulator. The following instructions will translate the value in the
Accumulator to one of four values defined by the DB (define byte) directive:
REL_PC: INC A
MOVC A,@A+PC
RET
DB 66H
DB 77H
DB aaH
DB 99H
If the subroutine is called with the Accumulator equal to 01 H, it will return with 77H in the Accumulator. The
INC A before the MOVC instruction is needed to "get around" the RET instruction above the table. If
several bytes of code separated the MOVC from the table, the corresponding number would be added to
the Accumulator instead.
MOVC A,@A+DPTR
Bytes:
Cycles: 2
Encoding: 11 0 0 1 I0 0 1 1
Operation: MOVC
(A) (- ((A) + (DPTR))
Signetics BOCSt-Based 8-Bil Microcontrollers
MOVC A,@A+PC
Bytes:
Cycles: 2
Encoding: 11 0 0 0 I0 0 1 1
Operation: MOVC
(PC) t- (PC) + 1
(A) t- «A) + (PC))
MOVX A,@Ri
Bytes:
Cycles: 2
Encoding:
Operation:
l'
MOVX
1 0
10 0
(A) t- «Ri))
MOVX A,@DPTR
Bytes:
Cycles: 2
Encoding:
Operation:
l'
MOVX
1 0
10 0 0 0
(A) t- «DPTR))
February 1992 B9
Signetics 8OC51-Ba5OO 8-Bit Microcontrollers
MOVX @RI,A
Bytes:
Cycles: 2
Encoding: 11 1 1 10 0 1
Operation: MOVX
{(Ri» +- (AI
MOVX @DPTR,A
Bytes:
Cycles: 2
Encoding: 11 1 1 10 0 0 0
Operation: MOVX
«OPTR)) +- (AI
MUL AB
Function: Multiply·
Description: MUL AB multiplies the unsigned eight-bit integers in the Accumulator and register B. The low-order byte
of the sixteen-b~ product is left in the Accumulator, and the high-order byte in B. If the product is greater
than 255 (OFFH) the overflow flag is set; otherwise it is cleared. The carry flag is always cleared.
Example: Originally the Accumulator holds the value 80 (SOH). Register B holds the value 160 (OAOH).The
instruction,
MUL AB
will give the product 12,800 (3200H), so B is changed to 32H (0011001 OB) and the Accumulator is cleared.
The overflow flag is set, carry is cleared.
Bytes:
Cycles: 4
Encoding: 11 0 1 0 I0 0 0
Operation: MUL
(Ah·o +- (AI x (B)
(B)15-8
Signetics 80C51-Based 8-Bit Microcontrollers
NOP
Function: No Operation
Description: Execution continues at the following instruction. Other than the PC, no registers or flags are affected.
Example: It is desired to produce a low-going output pulse on bit 7 of Port 2 lasting exactly 5 cycles. A simple
SETB/CLR sequence would generate a one-cycle pulse, so four additional cycles must be inserted. This
may be done (assuming are enabled) with the instruction sequence,
CLR P2.7
NOP
NOP
NOP
NOP
SETB P2.7
Bytes:
Cycles:
Encoding: I0 0 0 0 I0 0 0 0
Operation: NOP
(PC) ~ (PC) + 1
ORL <dest-byte>,<src-byte>
Function: Logical-OR for by1e variables
Description: ORL performs the bitwise logical-OR operation between the indicated variables, storing the results in the
destination by1e. No flags are affected.
The two operands allow six addressing mode combinations. When the destination is the Accumulator, 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 (11000011 B) and RO holds 55H (01010101 B) then the instruction,
ORL A,RO
will leave the Accumulator holding the value OD7H (11010111 B).
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,#OOII 001 OB
will set bits 5, 4, and 1 of output Port 1.
ORL A,Rn
Bytes:
Cycles:
Encoding: Io___o_o_.1-___r__r--l
L
Operation: ORL
(A) ~ (A) v (Rn)
February 1992 91
Signetics aOCS1-Based 8-Bil Microcontrollers
ORl A,dlrect
Bytes: 2
Cycles:
Encoding: 10 0 0 I 0 0 1 I
direct address
Operation: ORL
(A) (- (A) v (direct)
ORl A,@RI
Bytes:
Cycles:
Encoding: 0 0
10 10
Operation: ORL
(A) (- (A) v «R I))
ORl A,#data
Bytes: 2
Cycles:
Encoding: 10
0 0
10
0 0 I
immediate data I
Operation: ORL
(A) (- (A) v #data
ORl direct,A
Bytes: 2
Cycles:
Encoding: 10 0 0
10
0 1 0 I
direct address
Operation: ORL
(direct) (- (direct) v (A)
ORL direct,#data
Bytes: 3
Cycles: 2
February 1992 92
Signetics BOC51-Based B-Bil Microcontrollers
ORL C,<src-blt>
Function: Logical-OR for bit variables
Description: Set the carry flag if the Boolean value is a logical 1; leave the carry in its current state otherwise. A slash
('"r) preceding the operand in the assembly language indicates that the logical complement of the
addressed bit is used as the source value, but the source bit itself is not affected. No other flags are
affected.
Example: Set the carry flag if and only if P t.o = 1, ACC.7 = 1, or OV = 0:
ORL C,P1.0 ;LOAD CARRY WITH INPUT PIN P10
ORL C,ACC.7 ;OR CARRY WITH THE ACC. BIT 7
ORL C,tOV ;OR CARRY WITH THE INVERSE OF OV.
ORL C,blt
Bytes: 2
Cycles: 2
Operation: ORL
(C) ~ (C) v (bil)
ORL C,Ibit
Bytes: 2
Cycles: 2
Operation: ORL
(C) ~ (C) v (!iii)
February 1992 93
Signetics 80CS1-Based 8-Bit Microcontrollers
POP direct
Function: Pop from stack
Description: The contents of the internal RAM location addressed by the Stack Pointer is read, and the Stack Pointer is
decremented by one. The value read is then transferred to the directly addressed byte indicated. No flags
are affected.
Example: The Stack Pointer originally contains the value 32H, and internal RAM locations 30H through 32H contain
the values 20H, 23H, and 01 H, respectively. The Instruction sequence,
POP DPH
POP DPL
will leave the Stack Pointer equal to the value 30H and the Data Pointer set to 0123H. At this point the
instruction,
POP SP
will leave the Stack Pointer set to 20H. Note that in this special case the Stack Pointer was decremented
to 2FH before being loaded with the value popped (20H).
Bytes: 2
Cycles: 2
Encoding: 1
....1_ _ _0_1_...
1_0__
0_0__
0--, 1direct address
Operation: POP
(direct) f- ((SP))
(SP) f- (SP) - 1
PUSH direct
Function: Push onto stack
Description: The Stack Pointer is incremented by one. The contents of the indicated variable is then copied into the
internal RAM location addressed by the Stack Pointer. Otherwise no flags are affected.
Example: On entering an interrupt routine the Stack Pointer contains 09H. The Data Pointer holds the value 0123H.
The instruction sequence,
PUSH DPL
PUSH DPH
will leave the Stack Pointer set to OBH and store 23H and 01 H in internal RAM locations OAH and OBH,
respectively.
Encoding: 11
...._ _ _0_0_.....
1_0_0__0_0--' 1direct address
Operation: PUSH
(SP) f- (SP) + 1
((SP)) f- (direct)
February 1992 94
Signetics BOC51-Based B-Bit Microcontrollers
RET
Function: Return from subroutine
Description: RET pops the high- and low-order bytes of the PC successively from the stack, decrementing the Stack
Pointer by two. Program execution continues at the resulting address, generally the instruction
immediately following an ACALL or LCALL. No flags are affected.
Example: The Stack Pointer originally contains the value OSH. Internal RAM locations OAH and OSH contain the
values 23H and 01 H, respectively. The instruction,
RET
will leave the Stack Pointer equal to the value 09H. Program execution will continue at location 0123H.
Bytes:
Cycles: 2
Encoding: I 0 0 1 0 o 0 1 0
Operation: RET
(PC 1S. B) ~ ((SP))
(SP) ~ (SP) - 1
(PC7.0) ~ ((SP))
(SP) ~ (SP)-1
RETI
Function: Return from interrupt
Description: RETI pops the high- and low-order bytes of the PC successively from the stack, and restores the interrupt
logic to accept additional interrupts at the same priority level as the one just processed. The Stack Pointer
is left decremented by two. No other registers are affected; the PSW is not automatically restored to its
pre-interrupt status. Program execution continues at the resulting address, which is generally the
instruction immediately after the point at which the interrupt request was detected. If a lower- or same-level
interrupt has been pending when the RETI instruction is executed, that one instruction will be executed
before the pending interrupt is processed.
Example: The Stack Pointer originally contains the value OSH. An interrupt was detected during the instruction
ending at location 0122H. Internal RAM locations OAH and OSH contain the values 23H and 01H,
respectively. The instruction,
RETI
will leave the Stack Pointer equal to 09H and return program execution to location 0123H.
Bytes:
Cycles: 2
Encod ing: I0 0 1 1 I 0 0 1 0
Operation: RETI
(PC 1S-S) ~ ((SP))
(SP) ~ (SP) - 1
(PC7-0 ) ~ ((SP))
(SP) ~ (SP) - 1
Signetics 80C51-Based 8-Bit Microcontrollers
RL A
Function: Aotate Accumulator left
Description: The eight b~s in the Accumulator are rotated one bit to the left. Bit 7 is rotated into the b~ 0 position. No
flags are affected.
Example: The Accumulator holds the value OC5H (11000101 B). The instruction,
Al A
leaves the Accumulator holding the value BBH (10001011 B) with the carry unaffected.
Bytes:
Cycles:
Encoding: I0 0 1 0 I0 0 1 1
Operation: Al
(An+1) ~ (An), n = 0 - 6
(AO)~(A7)
RLC A
Function: Aotate Accumulator left through the Carry flag
Description: The eight bits in the Accumulator and the carry flag are together rotated one bit to the left. Bit 7 moves into
the carry flag; the original state of the carry flag moves into the bit 0 pos~ion. No other flags are affected.
Example: The Accumulator holds the value OC5H (11000101 B), and the carry is zero. The instruction,
AlC A
leaves the Accumulator holding the value BBH (1000101 OB) with the carry set.
Bytes:
Cycles:
Encoding: I0 0 1 1 I0 0 1 1
Operation: AlC
(An+1) ~ (An), n = 0 - 6
(AO)~(C)
(C)~(A7)
Signetics 80C51-Based 8-Bit Microcontrollers
RR A
Function: Rotate Accumulator Right
Description: The eight bits in the Accumulator are rotated one bit to the right. Bit 0 is rotated into the bit 7 position. No
flags are affected.
Example: The Accumulator holds the value OC5H (11000101 B). The instruction,
RR A
leaves the Accumulator holding the value OE2H (1110001 OB) with the carry unaffected.
Bytes:
Cycles:
Encoding: I 0 0 0 0 I 0 0 1 1
Operation: RR
(An) f-- (A n+,), n ~ 0 - 6
(A7) f-- (AO)
RRC A
Function: Rotate Accumulator Right through the 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 state of the carry flag moves into the bit 7 position. No other flags are
affected.
Example: The Accumulator holds the value OC5H (11000101 B), and the carry is zero. The instruction,
RRC A
leaves the Accumulator holding the value 62 (0110001 OB) with the carry set.
Bytes:
Cycles:
Encoding: I0 0 0 1 I 0 0 1 1
Operation: RRC
(An) f-- (A n+1), n ~ 0 - 6
(A7) f-- (C)
(C) f-- (AO)
February 1992 97
Signetics 8OCS1-Based 8-Bit Microcontrollers
SETB cbit>
Function: Set BH
Description: SETB sets the indicated bH to one. SETB can operate on the carry flag or any directly addressable bit. No
other flags are affected.
Example: The carry flag is cleared. Output Port 1 has been written with the value 34H (001101 OOB). The instructions,
SETB C
SETB Pl.0
will leave the carry flag set to 1 and change the data output on Port 1 to 3SH (00110101B).
SETB C
Bytes:
Cycles:
Encoding:
Operation:
l'
SETB
0 1
10 0 1 1
(C)(-1
SETB bit
Bytes: 2
Cycles:
Encoding:
l' 0
10 0 1 0
I bit address
Operation: SETB
(bit) (-1
SJMP rei
Function: Short Jump
Description: Program control branches unconditionally to the address indicated. The branch destination is computed by
adding the signed displacement in the second instruction byte to the PC, after incrementing the PC twice.
Therefore, the range of destinations allowed is from 128 bytes preceding this instruction to 127 bytes
following H.
Example: The label "RELADR" is assigned to an instruction at program memory location 0123H. The instruction,
SJMP RELADR
will assemble into location 01 OOH. After the instruction is executed, the PC will contain the value 0123H.
(Note: Under the above conditions the instruction following SJMP will be at 102H. Therefore, the
displacement byte of the instruction will be the relative offset (0123H-Ol 02H) = 21 H. Put another way, an
SJMP with a displacement of OFEH would be a one-instruction infinite loop.)
Bytes: 2
Cycles: 2
Operation: SJMP
(PC) (- (PC) + 2
(PC) (- (PC) + rei
Signetics 80C51-Based 8-Bit Microcontrollers
SUBS A, <src-byte>
Function: Subtract with borrow
Description: SUBB subtracts the indicated variable and the carry flag together from the Accumulator, leaving the resuh
in the Accumulator. SUBB sets the carry (borrow) flag if a borrow is needed for bit 7, and clears e
otherwise. (If e was set before executing a SUBB instruction, this indicates that a borrow was needed for
the previous step in a multiple precision subtraction, so the carry is subtracted from the Accumulator along
with the source operand.) Ae is set if a borrow is needed for bit 3, and cleared otherwise. OV is set if a
borrow is needed into bit 6, but not into bit 7, or into bit 7, but not bit 6.
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 Oe9H (11001001 B), register 2 holds 54H (010101 OOB), and the carry flag is set.
The instruction,
SUBB A,R2
will leave the value 74H (011101 OOB) in the Accumulator, with the carry flag and Ae cleared but OV set.
Notice that Oe9H minus 54H is 75H The difference between this and the above result is due to the carry
(borrow) flag being set before the operation. If the state of the carry is not known before starting a single or
multiple-precision subtraction, it should be explicitly cleared by a eLR e instruction
SUSB A,Rn
Bytes:
Cycles:
Encoding: 11 0 0 1 r r
Operation: SUBB
(A) f- (A) - (e) - (Rn)
SUBB A,direct
Bytes: 2
Cycles:
SUBB A,@Ri
Bytes:
Cycles:
Encoding: 11 0 0 1 0
Operation: SUBB
(A) f- (A) - (e) - (Ri)
SUBB A,#data
Bytes:
Cycles:
Encoding: 11 0 0 1
~------~--------~
o o 0 I immediate data I
Operation: SUBB
(A) f- (A) - (e) - (#data)
February 1992 99
Signetics 80C51-Based 8-Bit Microcontrollers
SWAP A
Function: Swap nibbles within the Accumulator
Description: SWAP A interchanges the low- and high-order nibbles (four-bit fields) of the Accumulator (bits 3-0 and bits
7-4). The operation can also be thought of as a four-bit rotate instruction. No flags are affected.
Example: The Accumulator holds the value OC5H (11000101 B). The instruction,
SWAP A
leaves the Accumulator holding the value 5CH (010111 OOB).
Bytes: 1
Cycles: 1
Encoding: 1
..._1___
o_o_1,--0___0_0--,
Operation: SWAP
(A3.o) ¢ (A7-4)
XCH A,<byte>
Function: Exchange Accumulator with byte variable
Description: XCH loads the Accumulator with the contents of the indicated variable, at the same time writing the original
Accumulator contents to the indicated variable. The source/destination operand can use register, direct, or
register-indirect addressing.
Example: RO contains the address 20H. The Accumulator holds the value 3FH (00111111 B). Internal RAM location
20H holds the value 75H (01110101B). The instruction,
XCH A,@RO
will leave the RAM location 20H holding the values 3FH (00111111 B) and 75H (01110101 B) in the
Accumulator.
XCH A,Rn
Bytes:
Cycles:
Encoding: I_l
... ___o_o_-'-_ _ _r _r--,
Operation: XCH
(A) ¢(Rn)
XCH A,dlrect
Bytes: 2
Cycles:
Encoding: 11
..._ _ _0_0--,1,--0___0_1--, 1direct address
Operation: XCH
(A) ¢ (direct)
XCH A,@RI
Bytes:
Cycles:
XCHD A,@RI
Function: Exchange Digit
Description: XCHD exchanges the low-order nibble of the Accumulator (bits 3-0), generally representing a hexadecimal
or BCD digit, with that of the internal RAM location indirectly addressed by the specified register. The
high-order nibbles (bits 7-4) of each register are not affected. No flags are affected.
Example: RO contains the address 20H. The Accumulator holds the value 36H (00110110B). Internal RAM location
20H holds the value 75H (01110101 B). The instruction,
XCHD A,@RO
will leave RAM location 20H holding the value 76H (01110110B) and 35H (00110101B) in the Accumulator.
Bytes:
Cycles:
Encoding: ..
1_1___0_1_..L1_0_ _ _1_i---l
Operation: XCHD
(A3.o) P ((Rb.o))
XRL <dest-byte>,<src-byte>
Function: Logical Exclusive-OR for byte variables
Description: XRL performs the bitwise logical Exclusive-OR operation between the indicated variables, storing the
results in the destination. No flags are affected.
The two operands allow six addressing mode combinations. When the destination is the Accumulator, 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 (11000011 B) and register 0 holds OAAH (1010101 DB) then the instruction,
XRL A,RO
will leave the Accumulator holding the value 69H (01101001B).
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,#0011 0001 B
will complement bits 5, 4, and 0 of output Port 1.
XRL A,Rn
Bytes:
Cycles:
Encoding: 10 1 0 11 .r r r
Operation: XRL
(A) ~ (A) 'f (Rn)
XRL A,direct
Bytes: 2
Cycles:
Encoding: [0 1 0
10 0 1 I
direct address
Operation: XRL
(A) ~ (A) ' f (direct)
XRL A,@RI
Bytes:
Cycles:
Encoding: 10 1 0
10
Operation: XRL
(A) ~ (A) ' f (Ri)
XRL A,#data
Bytes: 2
Cycles:
Encoding: 10 1 0
10 0 0 I
immediate data I
Operation: XRL
(A) ~ (A) 'f #data
XRL direct,A
Bytes: 2
Cycles:
Encoding: 10 1 0 I 0 0 1 0 I
direct address
Operation: XRL
(direct) ~ (direct) ' f (A)
XRL direct,#data
Bytes: 3
Cycles: 2
Encoding: 10 1 0
10 C direct address II immediate data I
Operation: XRL
(direct) ~ (direct) ' f #data
SECTION 1
80C51 family EPROM products
80C51 FAMILY
EPROM PRODUCTS Programming the 87C51 eighteenth with the second, etc. and on in
Most of the BOCSI derivative products offered The setup for programming the sixteen-byte groups.
by Philips are supported with an EPROM microcontrolier is shown in Figure 1. Note After the Encryption table has been
version. Currently available EPROM parts are that the part is running with a 4 to 6 MHz programmed the user has to know its
the 87C51 , 87C451, 87C552, 87C52, oscillator. The clock must be running because contents in order to correctly decode the
87C752, and the 87C751. EPROM versions the device is executing internal address and program code data. The encryption table
of the 87C550, 87C652, 87C654, and program data transfers during the itself cannot be read out.
87C528 are now in development. programming.
The encryption table is programmed in the
All EPROM products are available in both To program the 87C51, the address of the same manner as the program memory, but
windowed DIP and OTP package EPROM location to be programmed is using the "Pgm Encryption Table" levels
configurations. The windowed 01 P package applied to ports 1 and 2 as shown in Figure 1. specified in Table 1. After the encryption table
allows the EPROM to be erased under a The code byte to be programmed into this is programmed, verification cycles will
strong UV light source, making program location is applied to port O. RST, PSE1{ and produce only encrypted information.
development easier and faster. The OTP the pins of ports 2 and 3 specified in Table 1
(One lime Programmable) version cannot be are held at the "Program Code Data" levels Lock BI1
erased because there is no window through specified in the table. The ALEIPROO is then There are two lock bits on the 87C51 that,
which the die could be exposed to UV light. pulsed low 25 times to program the when set, prevent the program data memory
While the EPROM can only be programmed addressed location. from being read out or programmed further.
once in the OTP package, the part costs less To program the lock bits, repeat the
than in windowed DIP and therefore offers an Encryption Table programming sequence using the "Pgm Lock
advantage for those not desiring to use the The encryption table is a feature of the Bit" levels specified in Table 1.
masked ROM version of the part. 87C51, and its derivatives, that protects the
code from being easily read by anyone other After the first lock bit is programmed, further
The EPROM products are fully supported on than the programmer. The encryption table is programming of the code memory or the
the industry standard EPROM programmers. 16 to 64 bytes of code, depending on the encryption table is disabled. The other lock
microcontrolier, that are exclusive NORed bit can of course still be programmed. With
with the program code data as it is read out. only lock bit one programmed, the memory
The first byte is XNORed with the first can stili be read out for program verification.
location read, the second with the second After the second lock bit is programmed, it is
read, etc. through the sixteenth byte read. no longer possible to read out (verify) the
The seventeenth byte is XNORed with the program memory.
first byte of the encryption table, the
+sv
-
vcc r--
.l'- A
AO-A7 _ PI PO PGM Data
v
"
1 RST +12.75V
El\JVPP
25 l00}1S Pulses
1 P3.6 ALEiPROO to Ground
a7CSl
1 P3.7 l'SER 0
XTAL2 P2.7 1
~
T 1-
4-6MHz P2.6 0
T XTAL1
P2.0 AS-A11
-P2.3
'--- VSS
-=
Figure \, Programming Configuration
SECTION 1
80C51 family EPROM products
80C51 FAMILY
+Sv
vee
AO-A7 p, PO PGMData
RST EJWpp
P3.6 AlEfl'ROG"
87C51
Pl.7 PSEli o
XTAl2 P2.7
4-6MHz P2.6
XTAll
P2.O AS-All
-P2.3
vss
=
Figure 2. Program Verification
Program Verification NOR of the program byte with a byte from the (030H) ; 15H indicates the part is made by
If lock bit 2 has not been programmed the encryption table. Philips
on-chip program memory can be read out for (031 H) ; 90H 87C451 97H 87C52
Signature Byles 92H 87C51 99H 87C654
program verification. To verify the contents of
The 87C51 contains two signature bytes that 93H 87C652 9AH 80C52
the program memory, the address of the
can be read and used by an EPROM 94H 87C552 9BH 87C528
location to be read is applied to ports 1 and 2
programming system tD identify the device. 96H 87C550 9CH 87C592
as shown in Figure 2. The other pins are held
The signature bytes identify the device as an
at the "Verify Code Data" levels indicated in
87C51 manufactured by Philips.
Table 1. The centents of the addressed
location will appear on port o. For this The signature bytes are read by the same
operation external pull-ups are required on prDcedure as a nDrmal verificatiDn of
port 0 as shown in Figure 2. Note that if the IDcatiDns 030H and 031 H, except that P3.6
encryption table has been programmed the and P3.7 need tD be pulled to a logic low. The
data presented at port 0 will be the exclusive values are:
SECTION 1
80C51 family EPROM products
80C51 FAMILY
EPROM Erasure stream is used to place the 87C751 in the To program the B7C751 the part must be put
Erasure of the EPROM occurs when the chip programming mode. into the programming mode by presenting the
is exposed to light with wavelengths shorter proper serial code (see Table 2) to the
Figure 3 shows a block diagram of the
than 4000 angstroms. Sunlight and RESET pin. To do this RESET should be held
programming configuration for the B7C751.
fluorescent lighting have wavelengths in this high for at least two machine cycles. Port
Port pin PO.2 is used for the programming
range, so exposure to these light sources pins PO.1 and PO.2 will be at VOH as a result
voltage supply input (Vpp signal). Port pin
over an extended period of time (about 1 of this, but they must be driven high prior to
PO. 1 is used for the program (PGM) signal.
week in sunlight, or 3 years in room level sending the serial data stream on the RESET
fluorescent lighting) could cause inadvertent Port 3 accepts the address input for the pin. The serial data bits can now be
erasure. It is recommended, for this reason, EP ROM location to be programmed. Both the transmitted over the RESET pin placing the
that an opaque label be placed over the high and low components of the eleven-bit 87C751 into one of the programming modes.
window. If the part is subject to elevated address are presented to the part through Following the transmission of the last data bit,
temperatures or an environment where port 3. Multiplexing of the address the reset pin should be held low.
solvents are used, Kapton tape (Fluorglas components is performed using ASEL (PO.O).
Next the address information for the location
part number 2345-5 or its equivalent) can be Port 1 is used as a bidirectional data bus to be programmed is placed on Port 3 and
used.
during programming and verify operations. ASEL is used to perform the address
The recommended erasure procedure is to During the programming mode, it accepts the multiplexing. ASEL should be driven high and
expose the chip to ultraviolet light (at 2537 byte to be programmed. In the verify mode, it then Port 3 driven with the high-order address
angstroms) to an integrated dose of at least returns the contents of the specified address bits. ASEL is then driven low, latching the
15W-sec/cm2. Exposing the EPROM to an location. high-order bits internally. Port 3 can now be
ultraviolet lamp of 12,000flW/cm2 rating for driven with the low B bits of the address,
The X 1 pin is the oscillator input and receives
20 to 40 minutes, at a distance of 1 inch. is completing the addressing of the location to
the master system dock. This clock should
adequate. be programmed.
be between 1.2 and SMHz.
A high-voltage Vpp level is now applied to the
Programming the 87C751 and The RESET pin is used to accept the serial
Vpp input. This sets Port 1 as an input port.
87C752 data stream that places the 87C751 into
The data to be programmed to the EPROM
The 87C751 and 87C752 are programmed various programming modes. This pattern
array should be placed on Port 1. A series of
using a Quick-pulse programming algorithm consists of a 10-bit code with the LSB send
25 programming pulses is now applied to the
that is similar to that used for the B7C51. It first. Each bit is synchronized to the clock
PGM pin (PO.1) to program the addressed
differs from the 87C51 in that a serial data input XI.
EPROM location.
87C751
Vcc
VppNIH~~~: PO.2
Clock Source XTALI
Reset
~ Control
Logic
f------I Reset
SECTION 1
80C51 family EPROM products
80C51 FAMILY
Program Verification placing a 10-bit serial data stream on the Programming Features
The EPROM array can be verified by placing Reset pin. The proper code and the The 87C751 has all of the special
the part in the programming mode as conditions of PO.1 and PO.2, for this mode, programming features incorporated within its
described above and forCing the Vpp pin to are shown in Table 2. EPROM array that the 87C51 has. It has an
the VOH level. Four machine cycles after encryption key table and \\Yo security bits
Once the part has been placed into the
addressing a location the contents of the (lock bits). These function exactly as they do
Signature Byte Read Mode, the signature
addressed location will appear on Port 1. in the 87C51. They are programmed or
bytes can be read by the same procedure as
verified by sending the proper code over the
87C75l and 87C752 Signature Bytes a normal verification of locations 01 EH and
RESET pin (see Table 2) and then following
The signature bytes for the 87C751 and 01 FH. The values are:
the 87C751 programming procedure as
87C752 are read differently and are in 01EH 15H indicates the part is made by described previously.
different locations than those on the 87C51. Philips
Due to its reduced pin count, the part has to 01 FH 91 H - 87C751 Erasure Characteristics
be put into "Signature Byte Read Mode" by 01 FH 95H - 87C752 The erasure procedure is exactly the same
as that described for the 87C5l.
'8"
44% one-byte, 41% two-byte, and 15%
three-byte instructions. With a 12MHz crystal,
56% of the instructions execute in l~s, 40% Lec
in 2~s and multiply and divide require only
17 29
4~s.
18 28
LOGIC SYMBOL
Vcc Vss
RST
Ell
PlIER
~l
~ TxO_ Rxo-+ALE{
'"lie 1RTf-+
IHTII-+ .....
~ 10-+ a:
~ Tl-+2
l WR_
~ R1J_
III
BLOCK DIAGRAM
PO.~.7
r---------------
I
----------------1
r'..J.l............,
I
I
~
r,
I
SBUF IE IP
INTERRUPT, SERIAL
PORT AND TIMER BLOCKS
l'SEH
ALE
a:
RST
_ _ _ _ _ _ _ _ _ _ _ --1
Pl.O-P1.7 P3.D-P3.7
PIN DESCRIPTIONS
PIN NO.
MNEMONIC DIP LCC TYPE NAME AND FUNCTION
Vss 20 22 I Ground: OV reference.
Vee 40 44 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.O--O.7 39-32 43-36 110 Port 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 pins that have 1s written to them float
and can be used as high-impedance inputs. Port 0 is also the multiplexed Iow-order address and
data bus during accesses to external program and data memory. In this application, it uses strong
internal pull-ups when emitting 1s.
Pl.O-Pl.7 1-8 2-9 110 Port 1: Port 1 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 1 pins that have 1s written
to them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 1 pins
that are externally pulled low will source current because of the internal pull-ups. (See DC
Electrical Characteristics: IILl.
P2.O-P2.7 21-28 24-31 110 Port 2: Port 2 is an 8-bit bidirectional 110 port with internal pull-ups. Port 2 pins that have ls written
to them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins
that are externally being pulled low will source current because of the internal pull-ups. (See DC
Electrical Characteristics: IILl. Port 2 emits the high-order address byte during fetches from
external program memory and during accesses to external data memory that use 16-bit addresses
(MOVX@DPTR). In this application, it uses strong internal pull-ups when emitting ls. During
accesses to external data memory that use 8-bit addresses (MOV @Ri), port 2 emits the contents
of the P2 special function register.
P3.O-P3.7 10-17 11, 110 Port 3: Port 3 is an 8-bit oidirectionalllO port with internal pull-ups. Port 3 pins that have ls written
13-19 to them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins
that are externally being pulled low will source current because of the pull-ups. (See DC Electrical
Characteristics: IILl. Port 3 also serves the special features of the 8OC51 family, as listed below:
10 11 I RxD (P3.0): Serial input port
11 13 0 TxD (P3.1): Serial output port
12 14 I nrrn (P3.2): External interrupt
13 15 I INTl (P3.3): External interrupt
14 16 I TO (P3.4): Timer 0 external input
15 17 I T1 (P3.S): Timer 1 external input
16 18 0 WR (P3.6): External data memory write strobe
17 19 0 RU (P3.7): External data memory read strobe
RST 9 10 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the device.
An internal diffused resistor to Vss permits a power-on reset using only an external capacitor to
Vee.
ALE 30 33 110 Address Latch Enable: Output pulse for latching the low byte of the address during an access to
external memory. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and can be used for external timing or clocking. Note that one ALE pulse is skipped
during each access to external data memory.
l'SER 29 32 0 Program Store Enable: The read strobe to external program memory. When the device is
executing code from the external program memory, l'SER is activated twice each machine cycle,
except that two P'SEl'l' activations are skipped during each access to external data memory. P'SEl'l'
is not activated during fetches from internal program memory.
~ 31 35 I External Access Enable: ~ must be externally held low to enable the device to fetch code from
external program memory locations OOOOH to OFFFH. If ~ is held high, the device executes from
internal program memory unless the program counter contains an address greater than OFFFH.
XTALl 19 21 I Cryslal1: Input 10 Ihe inverting oscillator amplifier.
XTAL2 18 20 0 Crystal 2: Output from the inverting oscillator amplifier and input to the internal clock generator
circuits.
OSCILLATOR To drive the device from an external clock high and low times specified in the data sheet
CHARACTERISTICS source, XTAL 1 should be driven while XTAL2 must be observed.
XTAL 1 and XTAl2 are the input and output, is left unconnected. There are no
respectively, of an inverting amplifier. The requirements on the duty cycle of the external
clock signal, because the input to the internal DESIGN CONSIDERATIONS
pins can be configured for use as an on-chip At power-on, the voltage on Vee and RST
oscillator, as shown in the logic symbol. clock circuitry is through a divide-by-two
flip-flop. However, minimum and maximum should come up at the same time for a proper
start-up.
DC ELECTRICAL CHARACTERISTICS
TalTb = O°C to +70°C Vce -- 5V ±10% Vss -- OV4, 5
TEST LIMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
VIL Input low voltage -{l.5 O.B V
VOHI Output high voltage; port 0, ALE, PSEl'fI IOH =-400uA 2.4 V
IlL Logical 0 input current; ports I, 2, 3 VIN =0.45V -500 J.IA
IIHI Input high current to RST for reset VIN< Vcc-1.5V 500 J.IA
III Input leakage current; port 0, EA 0.45 < VIN < Vce ±10 J.IA
11L2 Logical 0 input current for XTAL2 XTAL1 = Vss, VIN = 0.45V -3.2 rnA
Icc Power supply current All outputs disconnected 125 mA
and "EA = Vee
CIO Pin capacitance 10 pF
Tamb = -40OC to +85°C, Vcc = 5V ±10%, Vss = OV
TEST LIMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
VIH Input high voltage; except XTAL2, RST 2.1 Vee+0.5 V
V IH1 Input high voltage to RST and XTAL2 XTALI =Vss 2.S Vcc+0.5 V
11L2 Logical 0 input current for XTAL2 XTAL1 = Vss , VIN = 0.45V -4.0 rnA
Icc Power supply current All outputs disconnected 135 rnA
and"EA= Vcc
NOTES:
1. Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the device. This is a stress rating only and
functional operation of the device at these or any conditions other than those described in the AC and DC Electrical Characteristics section
of this specification is not implied.
2. For operating at elevated temperatures, the device must be derated based on + 150°C maximum junction temperature.
3. This product includes circuitry specifically designed for the protection of its internal devices from the damaging effects of excessive static
charge. Nonetheless, it is suggested that conventional precautions be taken to avoid applying greater than the rated maxima.
4. Parameters are valid over operating temperature range unless othelWise specified. All voltages are with respect to Vss unless othelWise
noted.
S. All voltage measurements are referenced to ground. For testing, all input signals swing between 0.4SV and 2.4V with a transition time of
20ns maximum. All time measurements are referenced at input voltages of O.BV and 2.0V and at output voltages of 0.8V and 2.0V as
appropriate.
S. VOL is derated when the device rapidly discharges external capacitance. This AC noise is most pronounced during emission of address data.
When using external memory, locate the latch or buffer as close as possible to the device.
Emitting Degraded
Datum Ports 110 Lines VOL (Peak Max)
Address P2, PO PI, P3 O.BV
Write Data PO Pl, p3, ALE O.BV
7. CL = 100pF for port 0, ALE and Pm:N outputs: CL = BOpF for all other ports.
AC ELECTRICAL CHARACTERISTICS
Tarrb = O°C to +70°C or --40°C to +85°C VCC = 5V -
+20% V ss = OV 1,2
12MHzCLOCK VARIABLE CLOCK
tWHLH 2,3 RU ar WR high to. ALE high 43 123 IcLCL-40 IcLCL +40 ns
External Clack ..
tcHCX 5 High time 20 20 ns
ALE
PSER
PORTO AD-A7
PORT 2 A8-AtS
ALE
tWHLH
i+-----tLLDV -----+l~1
tLLWL --+l~---tRLRH - - - - + I
~-------------4--------~
tRLDV-
PORTO
INSTRIN
...
ALE V
"-
I--IWHLH -
~tllWL tWlWH
WI!
"
IAVlL
tlLAX
- lovwx
IOVWH
--- I- IWHOX
PORTO
=>---< AD-A7
FROM RI OR OPl
I+--- IAVWl
><
-
OATAOUT
K AO-A7 FROM PCl INSTRIN
PORT 2
)< P2.D-P2.7 OR A8-A15 FROM OPH AD-A15 FROM PCH
INSTRUCTION
ALE
CLOCK
IOVXH H r-
,OUTPUTOATA _ _ _ _--...,.-_ _ _""'"
tXHOX
~ _ _,
I ,,_ _-... ~ _ _, ,,_ _........ , -_ _, .;'_ _-.... ~ _ _-..
t
WRITE TO SBUF
INPUTOATA
"---t'
CLEAR RI
t
SETRI
----.~I
>C
FLOAT
~4V ---,J ir----UV
~4V-V::: UV ~ov
Vcc-O.5
o,7Vcc
RST
O.4SV O.2VCc-O·1
(NC)
tcLCL
In addition, the device has two software • Five speed ranges at VCC = 5V
selectable modes of power reduction - idle - 12MHz
mode and power-down mode. The idle mode - 16MHz
freezes the CPU while allowing the RAM, - 24MHz
timers, serial port, and interrupt system to
- 30MHz
continue functioning. The power-down mode
saves the RAM contents but freezes the - 33MHz
XTAL2
oscillator, causing all other chip functions to • Five package styles
be inoperative. XTALI
• Extended temperature ranges
• OTP package available
17
44 34
33
11 23
12 22
n n 0
~
44 34
7[ ::J 39 33
LCC
H[ ::J 29 11 23
'1i it 12 22
LOGIC SYMBOL
VCC Vss
BLOCK DIAGRAM
PQ.D-PO.7 P2.0-P2.7
.---------------
1 ~~~ ~uu~
----------------l1
1 1
1 1
~ 1
1 1
D=1
1
1
1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 seON TMOD TCON 1
1 THO TLD THI 1
1 1
1 SBUF IE IP 1
1 INTERRUPT, SERIAL 1
1 PORT AND TIMER BLOCKS 1
1
1
1
1
ALEIPROO
ElWpp
RST
1
1
1
1
1
1 _ _ _ _ _ _ _ _ _ _ _ ...J
L~Ll __ _ XTAL2
Pl.0-P1.7 P3.0-P3.7
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP lCC QFP TYPE NAME AND FUNCTION
OSCILLATOR (24 oscillator periods), while the oscillator is interrupt (at which time the process is picked
CHARACTERISTICS running. To insure a good power-up reset, the up at the interrupt service routine and
XTAL 1 and XTAL2 are the input and output, RST pin must be high long enough to allow continued), or by a hardware reset which
respectively, of an inverting amplifier. The the oscillator time to start up (normally a few starts the processor in the same manner as a
pins can be configured for use as an on-chip milliseconds) plus two machine cycles. At power-on reset.
oscillator, as shown in the logic symbol. power-up, the voltage on Vee and RST must
come up at the same time for a proper
To drive the device from an external clock start-up. POWER·DOWN MODE
source, XTAL 1 should be driven while XTAL2 In the power-down mode, the oscillator is
is left unconnected. There are no stopped and the instruction to invoke
requirements on the duty cycle of the external IDLE MODE power-down is the last instruction execuled.
clock signal, because the input to the internal In idle mode, the CPU puts itself to sleep Only the contents of the on-chip RAM are
clock circuitry is through a divide-bY-two while all of the on-chip peripherals stay preserved. A hardware reset is the only way
flip-flop. However, minimum and maximum active. The instruction to invoke the idle to terminate the power-down mode. the
high and low times specified in the data sheet mode is the last instruction executed in the control bits for the reduced power modes are
must be observed. normal operating mode before the idle mode in the special function register PCON.
is activated. The CPU contents, the on-chip
Table 1 shows the state of 1/0 ports during
RAM, and all of the special function registers
RESET low current operating modes.
remain intact during this mode. The idle mode
A reset is accomplished by holding the RST can be terminated either by any enabled
pin high for at least two machine cycles
Security Bit 1: When programmed, this bit has two effects on masked ROM parts:
1. External MOVC is disabled, and
2. EA# is latched on Reset.
Security Bit 2: When programmed, this bit inhibits Verify User ROM.
Electrical Deviations from Commercial Specifications for Extended Temperature Range (87C51)
DC andAC parameters not included here are the same as in the 'commercial temperature range table.
DC ELECTRICAL CHARACTERISTICS
Tarrb = -40°C to +85°C, Vee = 5V ±1 0%, Vss = OV (Signetics Parts Only)
Tarrll =-40°C to +125°C, Vee = 5V±10% Vss = OV (Philips Parts Only)
TEST UMITS
' .
SYMBOL PARAMETER CONDITIONS MIN MA~ UNIT
•
Vil Input low voitage, exceptEA (Signetics) -0.5 0.2Vec-O·15 V
Vil Input low voltage, except EA (Philips) -0.5 0.2Vec-O·25 V
Vill Input low voltage to EA -0.5 0.2Vec-O.45 V
ViH Input high voltage, except XTAL1, RST 0.2Vee+1 Vee+0.5 V
VIH1 Input high voltage to XTAL 1, RST 0. 7Vee+0.1 Vee+0.5 V
III Logical 0 input current, ports 1, 2, 3 VIN =0.45V -75 f'A
ITl Logical l-to-O transition current, ports 1, 2, 3 VIN = 2.0V -750 f'A
Icc Power supply current: Vec = 4.5-5.5V
Active model @ 16MHz (Philips) 25 mA
Active mode@ 12MHz (Signetics) 20 mA
Idle mode2 @ 16MHz (Philips) 6.5 mA
Idle mode @ 12MHz (Signetics) 5 mA
Power-down modeS (Philips) 75 f'A
Power-down mode (Signetics) 50 f'A
NOTES:
1. The operating supply current is measured with all output pins disconnected; XTAL 1 driven with tf = ~ = IOns; Vil = Vss + 0.5V;
VIH = Vee - 0.5V; XTAL2 not connected; EA = RST = Port 0 = Vee.
2. The idle mode supply current is measured with all output pins disconnected; XTAL 1 driven with t, = ~ = IOns; Vil = Vss + 0.5V;
VIH = Vee - 0.5V; XTAL2 not connected; EA = Port 0 = Vee; RST = Vss.
3. The power-down current is measured with all output pins disconnected, XTAL2 not connected, EA = Port 0 =Vee; RST = Vss.
DC ELECTRICAL CHARACTERISTICS
Tarrl>; O°C to +70°C or -40°C to +85°C, Vcc ; 5V ±20%, Vss ; OV {80C31/51}
T arrI>; O°C to +70°C or -40°C to +85°C Vec; SV +10%
- Vss; OV (87CS1)
TEST LIMITS
VOHl Output high voltage (port 0 in external bus mode) IOH;-SOO~, 2.4 V
IOH ;-300flA 0.7SVee V
IOH; -S01lA 0.9Vee V
IlL Logical 0 input current, ports 1,2,37 VIN; 0.4SV -50 IlA
IlL Logical 1-10-0 transition current, ports 1, 2, 37 See note 4 -650 ~
III Input leakage current, port 0 VIN ; V IL or V IH ±10 ~
Icc Power supply current:? See note 6
Active mode @ 12MHz 8 (Philips) 18 mA
Active mode @ 12MHz 5 {Signetics} 11.5 19 mA
Idle mode @ 12MHz9 (Philips) 4.4 mA
Idle mode@ 12MHz (Signetics) 1.3 4 mA
Power-down mode 10 (Philips and Signetics) 3 50 IlA
RRSl Internal reset pull-down resistor {Signetics} 50 300 kn
(Philips) 50 150 kQ
Data Memory
ALE
PORTO AO-A7
PORT 2 A8-A15
ALE
tWHLH
i4-----ILLDV ------I-I
ILLWL --+lI+----tRLRH - - - - + \
~------------~--------~
ALE
V
" +-IWHlH - . -
IllAX
~ ...-- IWHOX
IAVU ~ tovwx
PORTO
=>--< Ao-A7
FROM RI OR 0 Pl
~tAVWl-
>< DATA OUT
~ AO-A 7 FROM PCl INSTRIN
PORT 2
)< P2.0-P2.7 OR AS-A15 FROM DPH Al>-A,5 FROM PCH
Vcc-{l·5
O.7VCC
D.4SV o. 2VSS-O·l
IClCl
vcc-o.
O.45V
NOTE:
5
=x 0.2vcc..o.e
. O'..;,2;;.V.::C.::;c-lI.....;..;.I_ _ _ __
....
x= VlOAD,----<
NOlE:
TIMING
REFERENCE
POINTS VOl..o.1V
AC Inputs during testing are drtven at Vee -0.5 'or a logic '1' and O.45V for a logic '0', For timing purposes, a pan Is no longer floating when a l00mV change from load
TIming measurements are made a1 VIH min for a logic '1' and VIL for a logic '0', voltage occurs, and begins to float when a l00mV change from the loaded VoH'
VOL level occurs.IoH'bL>.±,20mA.
Figure 5. AC Testing InpuVOutput Figure 6. Float Waveform
45
/ ~CCMAX = 1.43 freq + 1.9)
40
/
35
V
30
V
25
/ V
TYP ACTIVE MODE
ICCmA 20
V
/ /
15
./ /'
/'
V V
/
--
10
/
~/ - ~ MAX IDLE MODE
e-
/
4MHz
-- BMHz
-I-"
12MHz 16MHz
FREQ AT XTAL1
20MHz 24MHz 30MHz
TYP IDLE MODE
33MHz
Vcc
Vcc
Vcc RST
pO
RST
- EA
(NC) XTAL2 (NC) XTAL2
CLOCK SIGNAL XTAL 1 CLOCK SIGNAL XTALl -
Vss Vss
Figure 8. Icc Test Condition, Active Mode Figure 9. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
VCc-O·5
o. 7V cc
0,45V O.2VCc-O· 1
tCLcL
Figure 10. Clock Signal Waveform for Icc Tests In Active and Idle Modes
=
tCLcH tCHCL 5ns =
RST
pO
- EA
(NC)--- XTAL2
XTAl1 -
Vss
EPROM CHARACTERISTICS addresses 0 through lFH, using the 'Pgm Reading the Signature Bytes
The 87CSI is programmed by using a Encryption Table' levels. Do not forget that The signature bytes are read by the same
modified Quick-Pulse Programming'" after the encryption table is programmed, procedure as a normal verification of
algorithm. It differs from older methods in the verification cycles will produce only encrypted locations 030H and 031 H, except that P3.S
value used for Vpp (programming supply data. and P3.7 need to be pulled to a logic low. The
voltage) and in the width and number of the values are:
To program the security bits, repeat the 25
ALEIPl=lOG pulses. (030H) = ISH indicates manufactured by
pulse programming sequence using the 'Pgm
Philips
The 87CSI contains two signature bytes that Security Sir levels. After one security bit is
(031H) = 92H indicates 87CSI
can be read and used by an EPROM programmed, further programming of the
programming system to identify the device. code memory and encryption table is ProgramlVerify Algorithms
The signature bytes identify the device as an .. disabled. However, the other secrity bit can Any algorithm in agreement with the
87CSI manufactured by Philips Corporation. still be programmed. conditions listed in Table 2, and which
Note that the FANpp pin must not be allowed satisfies the timing specifications, is suitable.
Table 2 shows the logic levels for reading the
signature bytes, and for programming the to go above the maximum specified Vpp level
program memory, the encryption table, and for any amount of time. Even a narrow glitch Erasure Characteristics
above that voltage can cause permanent Erasure of the EPROM begins to occur when
the security bits. The circuit configuration and
damage to the device. The Vpp source the chip is exposed to light with wavelengths
waveforms for quick-pulse programming are
should be well regulated and free of glitches shorter than approximately 4,000 angstroms.
shown in Figures 12 and 13. Figure 14 shows
and overshoot. Since sunlight and fluorescent lighting have
the circuit configuration for normal program
wavelengths in this range, exposure to these
memory verification.
light sources over an extended time (about 1
week in sunlight, or 3 years in room level
QUick-Pulse Programming PROGRAM VERIFICATION
fluorescent lighting) could cause inadvertent
The setup for microcontroller quick-pulse If security bit 2 has not been programmed,
erasure. For this and secondary effects, It
programming is shown in Figure 12. Note that the on-chip program memory can be read out
is recommended that an opaque label be
the 87CSI is running with a 4 to SMHz for program verification. The address of the
placed over the window. For elevated
oscillator. The reason the oscillator needs to program memory locations to be read is
temperature or environments where solvents
be running is that the device is executing applied to ports 1 and 2 as shown in
are being used, apply Kapton tape Fluorglas
internal address and program data transfers. Figure 14. The other pins are held at the
part number 234S-5, or equivalent.
'Verify Code Data' levels indicated in Table 2.
The address of the EPROM location to be
The contents of the address location will be The recommended erasure procedure is
programmed is applied to ports 1 and 2, as
emitted on port o. External pull-ups are exposure to ultraviolet light (at 2S37
shown in Figure 12. The code byte to be
required on port 0 for this operation. angstroms) to an integrated dose of at least
programmed into that location is applied to
port O. RST, PSEN and pins of ports 2 and 3 15W-seclcrn2. Exposing the EPROM to an
If the encryption table has been programmed,
specified in Table 2 are held at the 'Program ultraviolet lamp of 12,OOOuW/cm2 rating for
the data presented at port 0 will be the
Code Data' levels indicated in lable 2. The 20 to 39 minutes, at a distance of about 1
exclusive NOR of the program byte with one
ALEIP"ROO is pulsed low 25 times as shown inch, shOUld be sufficient.
of the encryption bytes. The user will have to
in Figure 13. know the encryption table contents in order to Erasure leaves the array in an aliI s state.
correctly decode the verification data. The
To program the encryption table, repeat the
encryption table itself cannot be read out.
25 pulse programming sequence for
5V
Vcc
f\. A
AD-A7 PI PO PGMDATA
'I
1 RST ElWpp +12.75V
XTAL2 P2.7 1
T T XTAl1 P2.O-P2.3
A
A&-A11
'I
>-- VSS
-:"-
-
~1·------------------------25PU~~ --------------------------~.I
ALEII'IIOl>:
...-----
ALEII'IIOl>: o~1____________~11~__________~11~___
Vee
Ao-A7 PI PO PGMDATA
RST ElWpp
P3 .• ALEIPJRlG'
vss
PROGRAMMlNG* VERIRCATION*
P1.O-P1.7 ADDRESS ADDRESS
"
P2.O-P2.4
PORTO DATA IN
- ~ IAVOV
DATA OUT
/
ALEII'ROlI
tDVGL
- -
IAVGL .......:.-
~ ~ IGHDX
I--> IGHAX
t\~ ..
h
IoLGH .... tGHGL
tSHGL I- IGHSL
/v ~ LOGIC 1 LOGIC 1
LOGIC 0
------------ ----------------------------- ----------- ------------
tEHSH
IEL~ IEHOZ
P2.7
DIl{B[E
"FOR PROGRAMMING VERIFICATION SEE FIGURE 12. I I
FOR VERIFICATION CONDITIONS SEE FIGURE 14.
8OC51-Based
8-Bit Microcontrollers
CONTENTS
PREFACE
This specification is an updated version including the following latest modifications:
- Programming of a slave address by software has been omitted. The realization of this
feature is rather complicated and has not been used.
- The 'low-speed mode' has been omitted. This mode is, in fact, a subset of the total
12C-bus specification and need not be specified explicitly.
- The 'fast-mode' is added. This allows a fourfold increase of bit rate up to 400 kbiVs.
Fast-mode devices are downwards compatible i.e. they can be used in a 0 to
100 kbitls 12C-bus system.
- 10-bit addressing is added. This allows 1024 additional slave addresses.
- Slope control and input filtering for fast-mode devices is specified to improve the EMC
behaviour.
NOTE
Neither the 100 kbitls 12 C-bus system nor the 100 kbitls devices have been
changed.
1.0 INTRODUCTION which device will be in control of memory can both receive and
For a-bit applications, such as the bus and when. And, if different transmit data. In addition to
those requiring single-chip devices with different clock speeds transmitters and receivers, devices
microcontrollers, certain design are connected to the bus, the bus can also be considered as
criteria can be established: clock source must be defined. All masters or slaves when
• A complete system usually these criteria are involved in the performing data transfers (see
consists of at least one specification of the 12C-bus. Table 1). A master is the device
microcontroller and other which initiates a data transfer on
peripheral devices such as 2.0 THE 12C-BUS the bus and generates the clock
memories and I/O expanders. CONCEPT signals to permit that transfer. At
• The cost of connecting the Any IC fabrication process that time, any device addressed is
various devices within the (NMOS, CMOS, bipolar) can be considered a slave.
system must be minimized. supported by the fC-bus. Two The 12C-bus is a multi-master
• Such a system usually wires, serial data (SDA) and serial bus. This means that more than
performs a control function and clock (SCl), carry information one device capable of controlling
doesn't require high-speed data between the devices connected to the bus can be connected to it. As
transfer. the bus. Each device is masters are usually micro-
• Overall efficiency depends on recognised by a unique address - controllers, let's consider the case
the devices chosen and the whether it's a microcontroller, LCD of a data transfer between two
interconnecting bus structure. driver, memory or keyboard microcontrollers connected to the
interface - and can operate as 12C-bus (Fig.1). This highlights the
In order to produce a system to either a transmitter or receiver, master-slave and receiver-
satisfy these criteria, a serial bus depending on the function of the transmitter relationships to be
structure is needed. Although device. Obviously an LCD driver is found on the 12C-bus. It should be
serial buses don't have the only a receiver, whereas a noted that these relationships are
throughput capability of parallel
Table 1 Definition of 12 C-bus terminology
buses, they do require less wiring
and fewer connecting pins. Term Description
However, a bus is not merely an
Transmitter The device which sends the data to the bus
interconnecting wire, it embodies
all the formats and procedures for Receiver The device which receives the data from the bus
communication within the system.
Devices communicating with Master The device which initiates a transfer, generates clock
each other on a serial bus must signals and terminates a transfer
have some form· of protocol which Slave The device addressed by a master
avoids all possibilities of
confusion, data loss and blockage MUlti-master More than one master can attempt to control the bus at
of information. Fast devices must the same time without corrupting the message
be able to communicate with slow
Arbitration. Procedure to ensure that, if more than one master
devices. The system must not be
dependent on the devices simultaneously tries to control the bus, only one is
connected to it, otherwise allowed to do so and the message is not corrupted
modifications or improvements Synchronization Procedure to synchronize the clock signals of two or
would be impossible. A procedure
more devices
has also to be devised to decide
-1--1_----JX't.....-...-.f~~
clock pulse is generated for each
data bit transferred.
\,:- :~r~
SOA
of the data line can only change Fig.3 Billransfer on the /2C-bus
when the clock signal on the SCL
line is LOW (Fig.3).
the SDA line while SCL is HIGH is FigA START and STOP conditions
~
--.
, '
, '
Acknowledgment
, '
I
Signal from Receiver : I
. 5.2 Acknowledge When a slave-receiver doesn't was clocked out of the slave. The
Data transfer with acknowledge is acknowledge on the slave address slave-transmitter must release the
obUgatory. The acknowledge- (for example, it's unable to receive data line to allow the master 10
related clock pulse is generated because it's performing some generate the STOP condition.
by the master. The transmitter real-time function), the data line
releases the SDA line (HIGH) has to be left HIGH by the slave. 6.0 ARBITRATION AND
during the acknowledge clock The master can then generate a CLOCK GENERAll0N
pulse. STOP condition to abort the 6.1 Synchronization
The receiver has to pull down transfer. All masters generate their own
the SDA line during the If a slave-receiver does clock on the SCL line to transfer
acknowledge clock pulse so that it acknowledge the slave address messages on the 12C-bus. Data is
remains stable LOW during the but, some time later In the transfer only valid during the clock HIGH
high period of this clock pulse cannot receive any more data period. A defined clock is
(Fig.6). Of course, set-up and hold bytes, the master must again therefore needed for the bit-by-bit
times musl also be taken into abort the transfer. This is arbitration procedure to take
account and these will be indicated by the slave generating place.
described in Section 15.0. the not acknowledge on the first Clock synchronization is
Usually, a receiver which has byte to follow. The slave leaves performed using the wired-AND
been addressed is obliged to the data line HIGH and the master connection of 12C interfaces to the
generate an acknowledge after generates the STOP condition. SCL line. This means that a HIGH
each byte has been received If a master-receiver is involved to LOW transition on the SCL line
(except when the message starts in a transfer, it must signal the will cause the devices concemed
with a CBUS address - see end of data to the slave- to start counting off their LOW
section 8.1.3). transmitter by not generating an period and, once a device clock
acknowledge on the last byte that has gone LOW, it will hold the
SCL line in that state until the
clock HIGH state is reached
(Fig.7). However, the LOW to
HIGH transition of this clock may
not change the state of the SCL
line if another clock is still within
its LOW period. Therefore, the
SCL line will be held LOW by the
SCLfrDm~"
. ~ device with the longest LOW
. Mas..,:: 1 . 2 8 t 9 period. Devices with shorter LOW
periods enter a HIGH wait-state
: -~; . during this time.
Start Condition Clock Pulse for
AcknoWledgment When all devices concemed
have counted off their LOW
Fig.6 Acknowledge on the /2C-bus period, the clock line will be
released and go HIGH. There will
then be no difference between the
device clocks and the state of the
SCL line and all the devices will
start counting their HIGH periods.
CLK1 - - -
The first device to complete its
HIGH period will again pull the
CLK
2
-1----, SCL line LOW.
In this way, a synchronised
SCL clock is generated with its
SCL LOW period determined by the
device with the longest clock LOW
period, and its HIGH period
Fig.7 CIoc/c synchronization during the arbitration procedura
determined by the one with the If a master also incorporates a allowed between:
shortest clock HIGH period. slave function and it loses - A repeated START condition
arbitration during the addressing and a data bit
6.2 Arbitration stage, it's possible that the - A STOP condition and a
A master may start a transfer only winning master is trying to data bit
if the bus is free. Two or more address it. The losing master must - A repeated START condition
masters may generate a START therefore switch over immediately and a STOP condition.
condition within the minimum hold to its slave-receiver mode.
time (tHO;STA) of the START Figure 8 shows the arbitration 6.3 Use of the clock
condition which results in a procedure for two masters. Of synchronising mechanism as a
defined START condition to the course, more may be involved handshake
bus. (depending on how many masters In addition to being used during
Arbitration takes place on the are connected to the bus). The the arbitration procedure, the clock
SDA line, while the SCL line is at moment there is a difference synchronization mechanism can
the HIGH level, in such a way that between the internal data level of be used to enable receivers to
the master which transmits a the master generating DATA 1 cope with fast data transfers, on
HIGH level, while another master and the actual level on the SDA either a byte level or a bit level.
is transmitting a LOW level will line, its data output is switched off, On the byte level, a device may
switch off its DATA output stage which means that a HIGH output be able to receive bytes of data at
because the level on the bus level is then connected to the bus. a fast rate, but needs more time
doesn't correspond to its own This will not affect the data to store a received byte or
level. transfer initiated by the winning prepare another byte to be
Arbitration can continue for master. Since control of the 12 C_ transmitted. Slaves can then hold
many bits. Its first stage is bus is decided solely on the the SCL line LOW after reception
comparison of the address bits address and data sent by and acknowledgement of a byte to
(addressing information is in competing masters, there is no force the master into a wait state
Sections 8.0 and 12.0). If the central master, nor any order of until the slave is ready for the next
masters are each trying to priority on the bus. byte transfer in a type of
address the same device, Special attention must be paid handshake procedure.
arbitration continues with if, during a serial transfer, the On the bit level, a device such
comparison of the data. Because arbitration procedure is still in as a microcontroller without, or
address and data information on progress at the moment when a with only a limited hardware 12 C
the 12C-bus is used for arbitration, repeated START condition or a interface on-chip can slow down
no information is lost during this STOP condition is transmitted to the bus clock by extending each
process. the 12 C-bus. If it's possible for clock LOW period. In this way, the
A master which loses the such a situation to occur, the speed of any master is adapted to
arbitration can generate clock masters involved must send this the internal operating rate of this
pulses until the end of the byte in repeated START condition or device.
which it loses the arbitration. STOP condition at the same
position in the format frame. In
other words, arbitration isn't
Data
2
SDA
SCL
-
• transfor dlrectl.," of maychanga
generated by the slave. The data and acknowledge bets Sr. _atod START condition at this point.
depends on Rffl bets.
STOP condition is generated by
Fig.12 Combined fonnat
the master.
NOTES:
- Combined format (Fig.12).
1) Combined formats can be used, for 3) Each byte is followed by an
During a change of direction example, to control a serial acknowledgement bit as indicated
within a transfer, the START memory. During the first data byte, by the A or A blocks in the
condition and the slave address the intemal memory location has to sequence.
are both repeated, but with the be written. After the START 4) 12 C-bus compatible devices must
R/W bij reversed. condition and slave address is reset their bus logic on receipt of a
repeated, data can be transferred. START or repeated START
2) All decisions on auto-increment or condition such that they all
decrement of previously accessed anticipate the sending of a slave
memory locations etc. are taken by address.
the designer of the device.
8.0 7-BIT ADDRESSING device has 4 fixed and 3 representatives listed on the back
(see section 13 for 10-bit programmable address bits, a total cover. Two groups of eight
addressing) of 8 identical devices can be addresses (OOOOXXX and
The addressing procedure for the connected to the same bus. 1111 XXX) are reserved for the
12 C-bus is such that the first byte The 12C-bus committee purposes shown in Table 2. The
after the START condition usually coordinates allocation of 12C bit combination 1111 OXX of the
determines which slave will be addresses. Further information can slave address is reserved for 10-
selected by the master. The be obtained fom the Philips bit addressing (see Section 13.0).
exception is the 'general call' Table 2 Definition of bits in the first byte
address which can address all
devices. When this address is Slave RfWbit Description
used, all devices should, in theory, address
respond with an acknowledge.
0000000 0 General call address
However, devices can be made to
ignore this address. The second 0000000 1 START byte
byte of the general call address
then defines the action to be 0000001 X CBUS address
taken. This procedure is explained
0000010 X Address reserved for different bus format
in more detail in Section 8.1.1.
0000011 X
8.1 Definition of bits in the
first byte 00001XX X
Reserved for future purposes
The first seven bits of the first
lllllXX X
byte make up the slave address
(Fig.13). The eighth bit is the LSB 1111 OXX X 10-bit slave addressing
(least significant bit). It determines
the direction of the message. A
'zero' in the least significant
position of the lirst byte means NOTES:
that the master will write 1) No device is allowed to 3) The address reserved for a different
information to a selected slave. A acknowledge at the reception of the bus format is included to enable 12 C
START byte. and other protocols to be mixed.
'one' in this position means that
2) The CBUS address has been Only 12 C-bus compatible devices
the master will read information
reserved to enable the inter-mixing that can work with such formats
from the slave. of CBUS compatible and 12c-bus and protocols are allowed to
When an address is sent, each compatible devices in the same respond to this address.
device in a system compares the system. 12C-bus compatible devices
first 7 bits after the START are not allowed to respond on
condition with its address. 11 they reception of this address.
match, the device considers itself
addressed by the master as a
slave-receiver or sla~transmitter,
depending on the RlW bit.
A slave address can be made-
up of a fixed and a programmable
part. Since it's likely that there will
be several identical devices in a MSB LSB
8.1.1 General call address slave address by hardware. On The remaining codes have not
The general call address should receiving this 2-byte sequence, been fixed and devices must
be used to address every device all devices designed to respond ignore them.
connected to the 12C-bus. to the general call address will
However, if a device doesn't need reset and take in the When B is a 'one'; the 2-byte
any of the data supplied within the programmable part of their sequence is a 'hardware general
general call structure, it can ignore address. Precautions have to call'. This means that the
this address by not be taken to ensure that a sequence is transmitted by a
acknowledging. If a device does device is not pulling down the hardware master device, such as
require data from a general call SDA or SCL line after applying a keyboard scanner, which cannot
address, it will acknowledge this the supply voltage, since these be programmed to transmit a
address and behave as a slave- low levels would block the bus desired slave address. Since a
receiver. The second and hardware master doesn't know in
following bytes will be - 00000100 (H'04'). Write advance to which device the
acknowledged by every slave- programmable part of slave message has to be transferred, it
receiver capable of handling this address by hardware. All can only generate this hardware
data. A slave which cannot devices which define the general call and its own address -
process one of these bytes must programmable part of their identifying itself to the system
ignore it by not acknowledging. address by hardware (and (Fig.1S).
The meaning of the general call which respond to the general The seven bits remaining in the
address is always specified in the call address) will latch this second byte contain the address
second byte (Fig.14). programmable part at the of the hardware master. This
There are two cases to reception of this two byte address is recognised by an
consider. sequence. The device will not intelligent device, such as a
• When the least significant bit B reset. microcontroller, connected to the
is a 'zero'. bus which will then direct the
• When the least significant bit B - 00000000 (H'OO'). This code is information from the hardware
is a 'one'. not allowed to be used as the master. If the hardware master
second byte. can also act as a slave,the slave
When B is a 'zero'; the second address is identical to the master
byte has the following definition: Sequences of programming address.
- 00000110 (H'06'). Reset and procedure are published in the In some systems, an alternative
write programmable part of appropriate device data sheets. could be that the hardware master
LSB
I
(BJ
I
Is oooooooo A
I Master Address 1
I I
A Data A I Data
I A P
I
'-----v----J
, /
II
(in Bytes + Acknowtedge)
General Call Address Second Byte
Write
(a) Configuring Master Sends Oump Address to Hardware Master
L-------------~I~I--------------~
Write (n Bytes + Acknowledge)
transmitter is set in the slave- carrying out its intended function. sampling rate until one of the
receiver mode after the system There is therefore a speed seven zeros in the START byte is
reset. In this way, a system difference between fast hardware detected. After detection of this
configuring master can tell the devices and a relatively slow LOW level on the SDA line, the
hardware master-transmitter microcontroller which relies on microcontroller can switch to a
(which is now in slave-receiver software polling. higher sampling rate to find the
mode) to which address data must In this case, data transfer can repeated START condition Sr
be sent (Fig.16). After this be preceded by a start procedure which is then used for
programming procedure, the which is much longer than normal synchronization.
hardware master remains in the (Fig.17). The start procedure A hardware receiver will reset
master-transmitter mode. consists of: on receipt of the repeated START
- A START condition (S) condition Sr and will therefore
8.1.2 START byte - A START byte (00000001) ignore the START byte.
Microcontrollers can be connected - An acknowledge clock pulse An acknowledge-related clock
to the 12C-bus in two ways. A (ACK) pulse is generated after the
microcontroller with an on-chip - A repeated START condition START byte. This is present only
hardware 12C-bus interface can be (Sr). to conform with the byte handling
programmed to be only interrupted format used on the bus. No device
by requests from the bus. When After the START condition S has is allowed to acknowledge the
the device doesn't have such an been transmitted by a master START byte.
interface, it must constantly which requires bus access, the
monitor the bus via software. START byte (00000001) is
Obviously, the more times the transmitted. Another
microcontroller monitors, or polls, microcontroller can therefore
the bus the less time it can spend sample the SDA line at a low
r-l
I I
SDA-r\~I~___________
I I
-----II dummy
acknowledge
(HIGH)
:\L
I I
I I I I
TI\ r;\ r;\
SCL
I iV' v ' L __ ACK
L:J
1...- - - start byte 00000001 MBC633
Fig. 17 STARTbyteprocedure
8.1.3 CBUS compatibility the CBUS message. For this Master-transmitters can send
CBUS receivers can be connected reason, a special CBUS address CBUS formats after sending the
to the 12C-bus. However, a third (0000001 X) to which no 12C-bus CBUS address. The transmission
line called OLEN must then be compatible device will respond, is ended by a STOP condition,
connected and the acknowledge has been reserved. After recognised by all devices.
bit omitted. Normally, 12C transmission of the CBUS
NOTE: If the CBUS configuration is
transmissions are sequences of address, the OLEN line can be
known, and expansion with CBUS
8·bit bytes; CBUS compatible made active and a CBUS-format compatible devices isn't foreseen, the
devices have different formats. transmission (Fig. 18) sent. After designer is allowed to adapt the hold
In a mixed bus structure, 12C- the STOP condition, all devices time to the specific requirements of the
bus devices must not respond to are again ready to accept data. device(s) used.
SCL I
\.....I\.-..I'-..Il.-I~,--'~~
~
/I
O~N : /
~~----------~
, S "~ ____ ~ ___ ~Jy'-,-l -~ ______ ~ _ _ _ _ _ _- ' y , P'
Start
CBUS ~'Y: I n Data Bits i~~: Stop
Address Condition
Condition ACK Related Pulse
Clock Pulse
9.0 ELECTRICAL
CHARACTERISTICS FOR 12 c_ VDD2 _4 aro dovice dopandonl (e.g. 12 V)
BUS DEVICES
VDDI- 5V ±10% VDD2 VDD3 VDD4
The electrical specifications for the
II0s of 12 C-bus devices and the
characteristics of the bus lines
connected to them are given in Rp Rp
Tables 3 and 4 in Section 15.
SDA
12 C-bus devices with fixed input
SCL
levels of 1.5 V and 3 V can each
",BC810
have their own appropriate supply
voltage. Pull-up resistors must be
Fig.19 Fixed input level devices connected to the 12 C-bus
connected to a 5 V ± 10% supply
(Fig.19). 12 C-bus devices with
input levels related to V DO must
have one common supply line to
which the pull-up resistor is also
connected (Fig.20).
When .devices with fixed input
levels are mixed with devices with
input levels related to VDD , the
latter devices must be connected
to one common supply line of 5 V
± 10% and must have pull-up
resistors connected to their SDA
and SCl pins as shown in Fig.21. Fig.20 Devices with wide supply voltage range connected to the 12 C-bus
Input levels are defined in such
a way that:
- The noise margin on the lOW VDD2,3 are device dopanoont (e.g. 12 V)
level is 0.1 Voo VDD1=
- The noise margin on the HIGH 5V±10% VDD2 VDD3
1
level is 0.2 Voo
- Series resistors (Rs) of e.g. I I I I
300 n can be used for Rp Rp 1 CMOS 1 CMOS .1 1 NMOS 1 1BIPOLAR I
protection against high voltage 1
spikes on the SDA and SCl
SDA I I I I I I
line due to flash-over of a TV SCL I I I I
MBC626
picture tube, for example
(Fig.22). Fig.21 Devices with inpUllevels related to Voo (supply V!.l0l) mixed with fixed
inpUllevel devices (supply V002. :;J on the I C-bus
9.1 Maximum and minimum
values of resistors Rp and R.
In a standard-mode 12C-bus Voo Voo
system the values of resistors Rp
and Rs in Fig.22 depend on the
following parameters:
1) Supply voltage
2) Bus capacitance
3) Number of connected devices
RS Rs Rp Rp
(input current + leakage
current) SOA ------~----r-------~--t--------+--_+-------
SCL
--
--~P
20
Ie
I
, \
\
\
\
\
-
" ,\
:\ \r'-..Voo-tSV
\. I" r- F
'\ "- ~r-
"- I-
- SV
2.5V
o
o 40 80 120 tOO 200
tout ~ 1Iwe6" wrr.tt fIlA)
Fig.26 Total HIGH level input current as a function of the maximum value
of Rp with supply voltage as a parameter
- Master-transmitter transmits
to slave-receiver with a 10-bit
slave address. The transfer
direction is not changed ~~ =~~ .IDAT'~ ]D'T'~
(Fig.27). When a 10-bit fJM:f) ....."
address follows a START
condition, each slave compares
the first 7 bits of the first byte
of the slave address (11110XX) Fig.29 Combined format. A master addresses a slave with a 1a-bit address,
with its own address and tests then transmits data to this slave and reads data from this slave
if the eighth bit (RlW direction own addresses, but only one - Master-receiver reads slave-
bit) is O. It is possible that more slave will find a match and transmitter with a 10-bit siave
than one device will find a generate an acknowledge (A2). address. The transfer
match and generate an The matching slave will remain direction is changed after the
acknowledge (Al). All slaves addressed by the master until it second RlW bit (Fig.28). Up
that found a match will receives a STOP condition (P) to and including acknowledge
compare the 8 bits of the or a repeated START condition bit A2, the procedure is the
second byte of the slave (Sr) followed by a different same as that described above
address (XXXXXXXX) with their slave address. for a master-transmitter
-[;:%1-' ]~~.~j
1 1 1 lOX X 0
NOTES:
1) Combined formats can be used, for
example, to control a serial
memory. During the first data byte,
the intemal memory location has to
be written. After \he START
condition and slave address is
repeated, data can be transferred.
2) All decisions on auto-increment or
decrement of previously accessed
memory locations etc. are taken by
\he designer of \he device.
3) Each byte is followed by an
acknowledgement bit as indicated
Fig.31 Combined format. A master transmits data to two slaves, one with
by \he A or A blocks in the
a 7-bit address, and one with a 10-bit address
sequence.
addressing a slave-receiver. 4) 12C-bus compatible devices must
devices will also compare the
reset their bus logic on receipt of a
After the repeated START first 7 bits of the first byte of
START or repeated START
condition (Sr), a matching slave the slave address (1111 OXX) condition such that they all
remembers that it was with their own addresses and anticipate \he sending of a slave
addressed before. This slave test the eighth (R/W) bit. address.
then checks if the first 7 bits of However, none of them will be
the first byte of the slave addressed because R/W = 1 13.0 GENERAL CALL
address following Sr are the (for 10-bit devices), or the ADDRESS AND START BYTE
same as before after the 11110XX slave address (for 7- The 10-bit addressing procedure
START condition (S), and tests bit devices) does not matCh) for the 12C-bus is such that the
if the eighth (RiiN) bit is 1. If - Combined format. A master first two bytes after the START
there is a match, the slave transmits data to a slave and condition (S) usually determine
considers that it has been then reads data from the which slave will be selected by the
addressed as a transmitter and same slave (Fig.29). The master. The exception is the
generates acknowledge A3. same master occupies the bus 'general call' address 00000000
The slave-transmitter remains all the time. The transfer (H'OO'). Slave devices with 10-bit
addressed until it receives a direction is...£hanged after the addressing will react to a 'general
STOP condition (P) or until it second R/W bit call' in the same way as slave
receives another repeated - Combined format. A master devices with 7 -bit addressing (see
START condition (Sr) followed transmits data to one slave Section B.l.l).
by a different slave address. and then transmits data to Hardware masters can transmit
After Sr, all the other slave another slave (Fig.30). The their 10-bit address after a
'general call'. In this case, the 14.0 APPLICATION the rising/falling edges, the
'general call' address byte is INFORMATION FOR FAST- bilateral switch in the HCT4066
followed by two successive bytes MODE 12 C-BUS DEVICES switches pull-up resistor Rp2 on/off
containing the 10-bit address of 14.1 Output stage with slope at bus levels between 0.8 V and
the master-transmitter. The format control 2.0 V. Combined resistors Rp 1
is as shown in Fig. 15 where the The electrical specifications for the and Rp2 can pull-up the bus line
first DATA byte contains the eight II0s of 12C-bus devices and the within the maximum specified rise
least-significant bits of the master characteristics of the bus lines time (tR) of 300 ns. The maximum
address. connected to them are given in sink current for the driving 12C-bus
The START byte 00000001 Tables 3 and 4 in Section 15. device will not exceed 6 rnA at
(H'Ol') can precede the 10-bit Figures 32 and 33 show VOL2 = 0.6 V, and 3 mA at VOLl
addressing in the same way as for examples of output stages with = 0.4 V.
7-bit addressing (see Section slope control in CMOS and bipolar Series resistors Rs are optional.
8.1.2). technology. The slope of the They protect the 1/0 stages of the
falling edge is defined by a Miller 12C-bus devices from high-voltage
capacitor (Cl) and a resistor (Rl). spikes on the bus lines, and
The typical values for C 1 and R1 minimize crosstalk and undershoot
are indicated on the diagrams. of the bus line signals. The
The wide tolerance for output fall maximum value of Rs is
time 'oF given in Table 3 means determined by the maximum
that the design is not critical. The permitted voltage drop across this
fall time is only slightly influenced resistor when the bus line is
by the ex1emal bus load (C b ) and switched to the LOW level in order
ex1emal pull-up resistor (Rp). to switch off Rp2.
However, the rise time (tR)
specified in Table 4 is mainly 14.3 Wiring pattern of the
determined by the bus load bus lines
capacitance and the value of the In general, the wiring must be so
pull-up resistor. chosen that crosstalk and
interference to/from the bus lines
14.2 Switched pull-up circuit is minimized. The bus lines are
The supply voltage (VDO) and the most susceptible to crosstalk and
maximum output LOW level interference at the HIGH level
determine the minimum value of because of the relatively high
pull-up resistor Rp (see Section impedance of the pull-up devices.
9.1). For example, with a supply If the length of the bus lines on
voltage of Voo = 5 V ± 10% and a PCB or ribbon cable. exceeds
VOL max. = 0.4 V at 3 mA, Rp min. 10 cm and includes the Voo and
= (5.5 - 0.4)/0.003 = 1.7 kn. As Vss lines, the wiring pattem must
shown in Fig.35, this value of Rp be:
limits the· maximum bus
capacitance to about 200 pF to SDA _ _ _ _ _ _ _ __
meet the maximum tR requirement Voo
of 300 ns. If the bus has a higher Vss
capacitance than this, a switched SCL _ _ _ _ _ _ _ __
pull-up circuit as shown in Fig.34
can be used.
The switched pull-up circuit in
Fig.34 is for a supply voltage of If only the Vss line is included,
Voo = 5 V ± 10 % and a the wiring pattern must be:
maximum capacitive load of
400 pF. Since it is controlled by SDA _ _ _ _ _ _ _ __
the bus levels, it needs no Vss
additional control signals. During SCL
'.5
\\
\\
'\ vRs·o
3.0
~
1.5 I-""",.RS ~I:,..
@VOO·5V -=::::: F= 1=
o I
o 100 200 300 400
bus capadlance (pF)
15.0 ELECTRICAL the bus lines for fast-mode must be able to follow transfers at
SPECIFICATIONS AND devices are the same as those their own maximum bit rates,
TIMING FOR 110 STAGES specified in Section 9.0 for either by being able to transmit or
AND BUS LINES standard-mode 12C-bus devices. receive at that speed or by
The 1/0 levels, 1/0 current, spike The minimum HIGH and LOW applying the clock synchronization
suppression, output slope control periods of the SCL clock specified procedure described in Section 6
and pin capacitance for 12C-bus in Table 4 determine the which will force the master into a
devices are given in Table 3. The maximum bit transfer rates of wait state and stretch the LOW
12C-bus timing is given in Table 4. 100 kbiVs for standard-mode period of the SCL signal. Of
Figure 36 shows the timing devices and 400 kbiVs for fast course, in the latter case the bit
definitions for the 12C-bus. mode devices. Standard-mode transfer rate is reduced.
The noise margin for levels on and fast-mode 12C-bus devices
Table 3 Characteristics of the SDA and SCL VO stages for 12 C-bus devices
Output fall time from VIH min. to VIL max. with IoF ns
a bus capacitance from 10 pF to 400 pF:
with up to 3 rnA sink current at Vou - 2502) 20 + 0.lCb2 ) 250
with up to 6 rnA sink current at VOl2 nla nla 20 + 0.ICb2) 2503 )
Input current each 1/0 pin with an input Ii -10 10 _10 3) 103) JlA
voltage between 0.4 V and 0.9Voo max.
Table 4 Characteristics of the SDA and SCL bus lines for 12C-bus devices
Standard-mode Fast-mode
Parameter Symbol 12C-bus 12C-bus Unit
Bus free time between a STOP and START condition 1aUF 4.7 - 1.3 - Ils
Hold time (repeated) START condition. After this period, 4iD;STA 4_0 0.6 Il s
the first clock pulse is generated
Set-up time for a repeated START condition lsU;STA 4.7 - 0.6 IlS
Rise time of both SDA and SCL signals ~ - 1000 20+ 300 ns
0.IC b4 )
Fall time of both SDA and SCL signals - 300 20+ 300 ns
All values referred to V1H min. and V1L max. levels (see Table 3).
') A device must internally provide a hold time of at least 300 ns for the SDA signal (referred to the V 1H min of the SCL signal) in
order to bridge the undefined region of the falling edge of SCL.
2)The maximum 4iD;DAT has only to be met if the device does not stretch the LOW period (~ow) of the SCL signal.
3) A fast-mode 12C-bus device can be used in a standard-mode 12C-bus system, but the requirement tSU;DAT ;,250 ns must then
be met. This will automatically be the case if the device does not stretch the LOW period of the SCL signal. If such a device does
stretch the LOW period of the SCL signal, it must ou1put the next data bit to the SDA line ~ max. + tSU;DAT ~ 1000 + 250 ~ 1250 ns
(according to the standard-mode 12C-bus specification) before the SCL line is released.
4) Cb ~ total capacitance of one bus line in pF.
- Reserved addresses 1 1 1 1 X X X
X = Don t care.
A = Can be connected high or low by the user.
FOR FURTHER INFORMATION ON THESE DEVICES, REFER TO PC·PERIPHERALS FOR MICROCONTROLLERS DATA HANDBOOK,
AVAILABLE FROM YOUR LOCAL SIGNETICS SALES OFFICE (SEE SECTION 9 OF THIS BOOK).
SOC51-Based
8-BH Mlcrocontrollers
CONTENTS
Notice to prospective developers: ................................•....... 159
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • . . . . 159
What is ACCESS.bus? ...............................................• 159
ACCESS.bus Hardware ......................................•.....•.. 160
ACCESS.bus Protocols. . . . . . . . . . . • . . . • . . . . . . . . . . . . . . . . . . . . . . . • . . . . . . . • 161
Specifications for this open interconnect are offered by Digital Equipment Corporation and Philips/Signetics
Notice to prospective developers: desktop system, such as a workstation, endorse the ACCESS.bus as a standard and
This document is provided for developers personal computer, or terminal. The to guide its future development.
who are interested in leaming about a new appropriate devices include both interactive
Forthcoming Digital workstation products,
technology available to the open computing peripherals - keyboards, locators, hand held
both host systems and appropriate peripheral
marketplace. The information is subject to scanners, bar code readers, and magnetic
devices, will include ACCESS.bus as a
change because it is based on specifications card readers - and non interactive
built-in feature.
that are being completed for availability in the peripherals - printers, plotters, and signal
Fall of 1991. In particular, this document transducers in real-time control applications. ACCESS.bus offers a number of advantages
contains preliminary protocol information that Further, the ACCESS.bus protocol is general both to end users and to the developers of
may not be implemented as described in this enough to accommodate a wide range of systems and peripheral devices. It is an
version of the Overview. Vendors developing unusual peripheral types (Figure 1). advantage that a host computer needs only
devices based on the ACCESS. bus or one hardware port to connect to a number of
ACCESS. bus has the topology of a bus. A
integrating it into host systems should check devices. The commonality in communication
single ACCESS. bus on the host can
their version of documentation with the methods for a number of device types leads
accommodate up to 14 peripheral devices (or
TRlfADD Program (see "Development to economy in software and hardware
more when devices can share a common
Support") before beginning any design work. development. As an open industry standard,
controller). The total length of the cable
ACCESS. bus will stimulate development of
connecting the devices on a common
diverse peripheral devices, each usable with
ACCESS.bus may be up to eight meters.
INTRODUCTION a number of different types of host system.
ACCESS. bus supports a maximum
ACCESS.busTY (a BUS for connecting Further advantages of low cost, ease of
aggregate data throughput of approximately
ACCESSory devices to a host system) is a implementation, and ease of use are
80 Kbitsfsec.
peripheral interconnect system defined and consequences of particular features of the
developed by Digital Equipment Corporation Digital and PhilipsfSignetics have made the ACCESS.bus design presented in this
in partnership with PhilipsfSignetics and ACCESS. bus an open specification, enabling Overview.
offered to the computer industry as an open any vendor to implement it on host systems
The idea of a bus-topology interconnect for
standard. This overview aims to introduce the or in peripheral devices, without fee or
desktop interactive peripherals is fairly new in
prospective developer of ACCESS. bus royalty. The two companies are working
the computer industry. ACCESS.bus
systems or peripherals to the essential together to promote ACCESS. bus as an
incorporates more sophisticated technology
technical features of this interconnect. industry standard. The Advanced Computing
and offers higher performance than any other
Environment (ACE) initiative has designated
such system. Moreover, it is the first system
What Is ACCESS.bus? ACCESS. bus as an option in the Advanced
of this kind to be offered as an open
ACCESS.bus is a system for connecting a RISC Computer (ARC) specification. Digital
standard.
number of relatively low-speed peripheral plans to organize a committee of vendors to
devices to a host computer, typically a
Figure 1. ACCESS bus connects keyboards, locators, and text-type devices to a system.
ACCESS.bus Hardware these components are given in the section ACCESS.bus-based systems conform to
At the hardware level, ACCESS. bus is based entitled "MICROCONTROllERS". FCC radiation requirements. A typical
on the well-established Inter-Integrated ACCESS.bus device will have two
Devices are usually identified with their
Circuit (12C) serial bus developed and connectors so that devices may be chained
microcontrollers. However, the ACCESS.bus
patented by Philips. The serial bus on the single bus; hand-held devices may
system includes provisions for controlling up
architecture, in which a single data line caries have a captive cable joined to the bus trunk
to four subdevices with a single
one bit of information at a time, entails lower with a "T" connector.
microcontroller. The subdevices may be of
costs for cabling, connectors and controller diverse functional types. The term "Interface The way that the serial data and serial clock
circuitry than parallel bus architectures. As its Part" refers to the unique controller of a lines work together to define the information
name indicated, the 12C serial bus was device, and the term "Application Part" refers carried on the bus is described in the section
developed primarily as a means of to the application-specific functionality. A entitled "Synchronization". The +12V power
connecting integrated circuits. device has one Interface part and up to four line provides up to 500mA to supply the
Standard low-cost IC components available Application Parts (Figure 2). peripheral devices.
from Philips handle the logical complications The physical medium for ACCESS.bus is a The 12C technology can support clock rates
of the bit-level handshaking. For shielded cable containing four wires: serial up to 100kHz. The maximum ACCESS.bus
ACCESS.bus, the relevant components are data (SDA), serial clock (SCl), power (+ 12V), data transfer rate of approximately
the microcontrollers of the 8OC51 family, and ground. It uses standard low-cost 80 Kbits/sec is derived from the top clock rate
which provide the intelligence for executing shielded modular connectors available from by subtracting the overheads imposed by the
the ACCESS.bus protocol in peripheral AMP and Molex (Figure 3). Shielding of the ACCESS.bus communication protocols for
devices and in host systems. More detail on cables and connectors facilitates making handshaking, addressing, and error control.
Application part
sub-addrO
4 pins only
+12
SCl
GND
SDA
Figure 3. A shielded modular connector with only four pins for connecting the ACCESS.bus cable to a system
ACCESS.bus Protocols all the devices are both master/senders and keys. The locator device is defined broadly
The ACCESS. bus communication protocol is slave/receivers at different times. enough to include not only the most common
composed of three levels: 120 Protocol, Base pointer devices - mice, tablets, trackballs -
The ACCESS. bus Base Protocol defines the
Protocol, and Application Protocols. but also valuator sets (such as dial boxes)
format of an ACCESS.bus message
with up to 15 valuators and function button
At the lowest level, nearest the hardware, the envelope, which is an 12C bus transaction
boxes with up to 16 buttons. The text device
basic discipline of the ACCESS. bus is with additional semantics, including
represents essentially any character stream
defined as a subset of the Philips checksum reliability control. Further, the Base
device, such as card readers, scanners, bar
Inter-Integrated Circuit (12C) bus protocol. Protocol defines a set of seven control and
code readers, or low speed modems and
The simple and efficient 12C Protocol defines status message types which are used in the
printers. The predefined Application Protocols
a symmetric multi-master bus on which configuration process.
are discussed in greater detail in the section
arbitration among contending masters is Two of the unique features of this entitled "APPLICATION DEVICE TYPES".
effected without losing data. 12C provides for configuration process are auto-addressing
cooperative synchronization of the serial A major advantage in designing devices that
and hot plugging. Auto-addressing refers to
dock for exchange of data between bus conform to these general device-type
the way that devices are assigned unique bus
partners with different maximum clock rates. semantics is that they may share
addresses in the configuration process,
The 12C Protocol defines a bus transaction device-specific software levels in common,
without the need for setting jumpers or
scheme with addressing, framing of bits into both in the device-resident firmware and in
switches on the devices. Hot plugging refers
bytes, and byte-acknowledgement by the the driver software needed in the host
to the ability for attaching or detaching
receiver. More detail on the 12C Protocol level operating system to allow application
devices while the system is running, without
is given in the section entitled "HOW programs to access the devices.
the need for rebooting the host. The means
ACCESS.bus WORKS". by which the ACCESS.bus protocol provides We anticipate that further device-specific
The next ACCESS.bus protocol level is the these feature is discussed in the section Application Protocols will be defined in the
Base Protocol. This level, common to all entitled "HOW ACCESS.bus WORKS". future, as industry standards under the aegis
types of ACCESS.bus devices, establishes of the planned ACCESS. bus committee.
The highest level of the ACCESS.bus
the nature of ACCESS.bus as an Further, any device vendor may implement a
protocol, the Application Protocol, defines
asymmetrical interconnect between a host special device protocol within the general
message semantics that are specific to
computer and a number of peripheral message envelope defined by the Base
particular functional types of devices.
devices. The host plays a special role as a Protocol.
Different device types require differenl
manager of the ACCESS.bus. Data Application Protocols. Application Protocols Participation in all three of the protocol levels
Communication is always between host and have been defined so far for three device requires intelligence at the device. The same
peripheral device and never between two classes: keyboards, locators, and general . microcontroller supplies this intelligence at all
peripherals. While the 12C Protocol provides text devices. Each of these predefined levels through appropriate firmware. The
for mastership by either the sender or the classes is fairly broad. Thus, the keyboard lower levels of this firmware are likely to be
receiver of a bus transaction, in the device protocol provides for communicating common to many devices. Higher levels of
ACCESS.bus protocol masters are essentially all conceivably relevant state the firmware are expected to be more specific
exclusively senders and slaves are information about a keyboard with up to 255 to the device and the application (Figure 4).
exclusively receivers. Of course, the host and
Application protocols
Software protocols
Hardware protocols
HOW ACCESS.bus WORKS when SCl is high is a stop condition; it stretching", is not the normal means of data
signals the end of a bus transaction. A stream flow control. The ACCESS.bus
Electrical master generates a stop condition when it protocol provides another mechanism for this
The host and devices are connected to both relinquishes mastership (Figure 7). purpose. (See the section entitled "Text
the serial data (SDA) and serial clock (SCl) Devices".)
lines in an 'wired-AND" logic configuration. Synchronization
The wired-AND may be implemented by When a bus partner wishes to assert Byte Framing and
connecting the data and clock output stages mastership of a free bus, it generates a start Acknowledgement
of each bus partner to the SDA and SCl lines condition by pulling the data SDA low. When During this synchronized exchange the
respectively through open-collector or SDA is low the new master begins the clock master/transmitter puts data on the SDA, one
open-drain transistors. The standard 12C cycle, pulling the SCl low. All bus partners bit for each clock pulse. Eight successive bits
components include such output stages must be able to sense these events, and they comprise a byte, the most significant bit going
on-chip. The significance of the wired-AND respond by pulling all their SCl outputs low first.
logic is that any attached bus partner may and beginning to count off their low periodS.
When each bus partner has reached the end As the new master puts the first byte on the
force either of these lines to low (the ground
of its low period, it lets its SCl output go high. bus, all the other bus partners participate in
level). When there is no output from any bus
Thus the SCl line will remain low for the the synchronization. The first byte olthe
partner, the lines are held high by pull-up
duration of the longest low clock period transaction contains the address of the
current sources in the host. And of course,
among the bus partners. intended slavelreceiver of the transaction.
every bus partner can sense the level on both
Each non-master can check the address bits
of these lines (Figure 5). When all the bus partners have reached the as they appear and cease participating in the
end of their low periods and let their SCl synchronization as soon as the address bit
Bus Transactions outputs go high, then the SCl goes high. All on SDA fails to match the corresponding bit
During a bus transaction, there is one clock
bus partners must be able to sense this of its own address.
pulse on SCl for each bit transferred on
event, and they begin counting their high
SDA. The SDA information is valid when SCl At the end of the first byte, the
period. The first bus partner to reach the end
is high. During a transaction, the SDA must masterltransmitter lets its data output go high
of its high period pulls the SCl low again. In
be stable between the rising and falling edges for the next clock pulse and the
this way, all the bus partners simultaneously
of the SCl pulse; SDA may change state slave/receiver whose address matches the
communicating on the bus are synchronized
only when SCl is low (Figure 6). SDA transmitted address is obliged 10
by a clock pulse whose low is as long as the
transitions when the SCl is high are signals acknowledge receipl of the byte by pulling the
longest of the low periods and whose high is
that delimit the bus transaction. When the SDA low for this pulse. This 1-bil Ack
as long as the shortest of the high periods.
ACCESS.bus is free, both SCl and SDA are continues after each byte of the bus
This synchronization persists until the master
high. A high-to-Iow SDA transition when SCl transaction; the master leIs its SDA output go
relinquishes the bus by generating a stop
is high is a start condition; it signals the high and the receiver must pull the SCl low.
condition. The cooperative synchronization is
beginning of a bus transaction. A bus partner Failure of the receiver to acknowledge a byte
a mechanism by which devices with slower
asserts mastership by pulling SDA low when is an exception condition, which requires the
clocks can regulate the operating rate of the
the bus is free. A low-to-high SDA transition master 10 terminate the transaction.
bus. However, this mechanism, called "clock
Pull-up
Resistors Rp Rp
r------------------------- r-------------------------
SCLK SCLK
SCJ:Kl
Out
DATA"1
Out
=Out DATA"2
Out
-= =
SCLK DATA SCLK DATA
In In In In
SDA
SCL
---~i
~/
Data Une Change
Stable: ofO.t.
Data Valid Allowed
SDA SDA
SCL
-~': ~':-
,
I
,
I
I
I
I
I
SCL
I , I I
: S : I p I
Addressing device. When several Application Part as long as bus addresses are unique, the
The slave/receiver of the bus transaction is subdevices share a controller, they are mastership of the bus will be resolved by the
determined by the address contained in the distinguished by a subaddress field in the end of the second byte of the transaction.
first byte. 12C uses the seven high-order bits third byte of the message, discussed in the However, if two devices have the same
of the first byte for addressing, and bit 0 to section entitled "Message Format address and are trying to send identical
indicate whether the master is transmitting or (Preliminary)". messages to a common address, then they
receiving data. In ACCESS.bus, the master is will both send the entire message in unison.
always the transmitter, so bit 0 of the first Arbitration this situation can happen only during the
byte of a transaction is always O. Of the 12B What happens when two devices configuration process before devices have all
7-bit addresses, the 12C protocol reserves simultaneously assert mastership? While been assigned unique addresses; it is
various ranges for specific kinds of integrated pulling data on the SOA, each transmitting discussed further in the section entitled
circuit devices. The ACCESS.bus uses only master is, of course, independently sensing "Configuration".
16 addresses for general microcontrollers. the state of SOA. Whenever a contending
Note that this arbitration mechanism never
Thus, considered as B-bit bytes, the valid master detects that the state of the SOA is
different from the data value it is putting out causes lost data or wasted transmissions,
ACCESS.bus addresses are the even since the addresses of the receiver and
numbers between 50 hexidecimal and 6E during a clock high, the contending master
transmitter are necessary overhead, in any
hexidecimal, inclusive (80 and 110 decimal, backs off, and waits for the stop condition
before trying again, Thus, two contending case, for any sensible bus protocol. Note that
inclusive).
bus priOrities during arbitration are fixed by
masters will both put data on the bus as long
The host computer address is always SOh. In the device addresses, first by the address of
as they are putting out the same data. The
the configuration process to be described the receiver, and then, for messages
first bit where they differ will cause the
below, each peripheral device is assigned a addressed to a common receiver, by the
contender that put out a 1 to back off.
unique address from the set of even numbers address of the transmitter. Lower addresses
between 52h and 6Ch. 6Eh is used as a Thus, contending masters trying to send to have priority over higher addresses. Lockouts
default address for devices before they have different bus addresses will resolve the of devices with high addresses are prevented
been assigned a unique address. contention by the end of the first byte of the by a rule of the Base Protocol that requires
bus transaction. In the ACCESS.bus Base partners to wait a minimum time after
A device address designates the device Protocol, the second byte of a transaction is relinquishing mastership before asserting it
controller, or Interface Part, of a peripheral the address of the transmitting master. Thus, again.
716151413121 1 0
3 P I sub
I length
Protocol flag, subaddress (<h1),
length (1-31 bytes; 0=32 bytes)
•
4 + lENGTH
·•
checksum
Message Format (Preliminary) Control/Status Messages The Base Protocol also defines three
An ACCESS. bus message comprises one (Preliminary) Application Part control/status messages,
12C bus transaction. It consists of a string of applicable to all device types:
The ACCESS. bus Base Protocol defines a
bytes sent by a masterltransmitter, each byte number of control/status messages that AppHardSiga Provision for a subdevice to
acknowledged by a one bit SCL-Iow Ack from pertain to the Interface Parts of devices. generate an interrupt of the
the slave/receiver. The entire transaction is These controVstatus messages are used for host system
delimited by start and stop conditions the configuration process, in which devices AppTest A message from the host to
generated by the master. are assigned unique bus addresses and a peripheral device
The first byte in the message is the 'receiver's connected with the appropriate drivers in the commanding it to test the
unique address, as described above in host. The configuration process is described Application Part subdevice
"Addressing". The second byte contains the in detail later. In a control/status message, AppTestReply A message by which a
transmitter's unique address. the message type is indicated by an device replies to an AppTest
operation code contained in the first byte of command.
The third byte of an ACCESS. bus message the message body. The various Interface Part
comprises three fields. The low order 5 bits In addition, the Application Protocols define
control/status messages are as follows:
provide a byte count for the body of the further control/status messages that are
message, which follows the third byte. A Computer -+ Device specific to particular device types. Some of
value of zero in this field specifies 32 bytes. ResetO Force device to these are discussed in the section entiHed
Thus, a message body can have 1 to 32 power-up state, "APPLICATION DEVICE TYPES" on the
bytes. The message body is followed by a default address predefined device types.
checksum byte, for error control. The IdRequestO Ask device for its
checksum is the bitwise XOR of all the identification string Configuration
preceding bytes of the message. AssignAddress(ID,addr)Teil device with The ACCESS.bus features auto-address and
matching ID its hot-plugging. These features are supported
Bits 5 and 6 of the third byte of the message unique bus address by the ACCESS.bus configuration and
comprise a subaddress, which can CapRequest(offset) Ask device to send process, which uses the seven types of
distinguish among up to four Application Part part of its capabilities control/status messages. Configuration
subdevices sharing a common consists of assigning unique bus addresses
microcontroller, and so a common bus Device -+ Computer
to the attached devices and connecting them
address. Attention(status) Inform computer of
with the appropriate drivers to provide
device presence and
The high order bit of the third byte is a host-resident application programs with
result of power-up
Protocol Flag P to distinguish between data access to the devices.
reset test
stream messages (p=0) and controVstatus IdReply(ID) Send device ID string Configuration occurs when the device is
messages (p= 1). The data stream messages to computer powered-up or when it receives a Reset
carry the application information being CapReply(offset,str) Send part of message. When the system is powered up,
exchanges between the device and the host. capability information so are devices attached to the ACCESS.bus.
The control/status messages are used to to computer Otherwise, devices are powered-up when
manage the ACCESS. bus protocol
(FigureS).
they are hot-plugged into the bus. A device Base Protocol specifies that, in the IDReply Device Capabilities Information
may have a power source other than the message, unique serial numbers be sent as (Preliminary)
+ 12V power line of the ACCESS. bus, but is positive integers and randomly generated In order that a device be accessible to
must also be able to sense this line voltage numbers be sent as negative integers, in the application programs running on the host, it
and enter the power-up state when attached two's complement sense. must be connected to an appropriate
to the ACCESS. bus power source. When the software driver. Establishing this association
In the random number case, it is possible that
system completes its boot up, the host sends is the last phase of configuration.
different devices of the same type may come
a Reset message to all 14 legal device
up with the same 32-bit discriminator. In this The appropriate driver will depend on the
addresses to put all devices in the power-up
case the different devices will be assigned device type. There may be further
state.
the s~me bus address, an undesirable parameters that characterize the device and
Usually, when a device is powered up, it situation. The ACCESS.bus specification which affect the choice of driver, or which at
performs its specific self-testing. At the suggests a guideline to help avoid identical least must be furnished as arguments to the
conclusion of self-test the device must random identifiers: use the number of cycles selected driver. Moreover, the application
assume the default address 6Eh and send an of the device's own clock between power up program may also need to be infonmed of
Attention message to announce its presence and the time the IDRequest message is these device parameters. The device
to the host. This message contains a single received. then natural dispersion of the Capabilities Infonmation feature of the
status byte to inform the host of the results of frequencies of these oscillators is likely to ACCESS. bus protocol allows a measure of
the power-up self-testing; zero indicates provide unique numbers. device independence in the selection of
normal results and non-zero values indicate drivers and provides for informing the host
The Base Protocol includes a provision to
exception conditions that are specific to the software of the device characteristics.
ensure against the unlikely circumstance that
device type.
different interactive devices of the same type Device Capabilities Information is an explicit
On receiving an Attention message, the host and without unique serial numbers will statement of a device's functional
sends an IDRequest message to the default generate the same random number. Namely, characteristics that are only implicit in the
address. Each device at this address replies each such device must send a Reset device type designation contained in the 10
with an IDReply message containing a unique message to its own assigned address. This string, or that may even vary among
28-byte 10 string described in the next self-addressed Reset is sent only once individual devices of a given type. For
section. The host is then able to assign between power-ups or external Resets, just example, the Capabilities Information about a
unique ACCESS. bus addresses to each of before the device sends the first message keyboard might include the national alphabet
the devices at the default address, by instigated by a user action. Of course, the
used, or the Capabilities Information about a
sending AssignAddress messages to the transmitting device will ignore the locator might include its resolution or units.
default address. Each AssignAddress self-addressed Reset, but other devices
message contains in its body the assigned possibly at the same address will be reset The Capabilities Infonmation for each device
address and the unique 10 string of the and will go through configuration again. The is contained in a single human-readable
corresponding device. Base Protocol specifies that a device using a ASCII-encoded text string stored on the
random number in its 10 string shall change device ROM. The ACCESS.bus Base
Device Identifiers (Preliminary) that random number after receiving a Reset Protocol defines a simple and compact
During configuration, before address message. In this way, all interactive devices grammar for building the capabilities string.
assignment, each device can be identified by are guaranteed assignment of unique This grammar provides for hierarchical
a 28-byte unique 10 string, which may be addresses before sending their first organization of the Capabilities Information
partly or entirely encoded in the device ROM. data-carrying messages. and for the inclusion of subdevice-specific
The first 24 bytes of the 10 string are information.
understood as ASC II-encoded information If several non interactive devices of the same
type are to be attached to a single The semantics of the Capabilities Information
characterizing the device type:
ACCESS. bus, then they must have hardwired is carried by keywords. The Base Protocol
• Model revision designation (8 bytes), unique serial numbers. defines some keywords that can apply to all
e.g., "REV XO.2" sorts of devices. Then each Application
During normal operation, the host periodically Protocol will define further keywords that are
• Vendor name (8 bytes), e.g., "DEC" checks the configuration by sending meaningful only for certain types of devices.
• Module name (8 bytes), e.g., "LK401". IDRequest messages to inactive devices.
To date, the ACCESS. bus Application
The host also sends IDRequest messages to Protocols define semantics for the
The first 24 bytes characterize the device's all assigned addresses whenever it receives
Capabilities Information for generic
firmware and are encoded in the device an Attention message from a device seeking
keyboards, locators, and general text
ROM. configuration. The purpose of these .
devices. The grammar allows for easy
I DRequest messages is to verify the current
The remaining 4 bytes of the device 10 string extension of the Capabilities Information
state of the ACCESS.bus - what devices are
are understood as a 32-bit two's complement specification.
still connected and which devices are no
integer that uniquely identifies the device
longer present.
among devices of the same type. This integer
may be provided as a unique serial number
contained in the device ROM. Or, in the
absence of such a serial number, interactive
devices may use a random or arbitrarily
determined number for this part of the 10
string. As an aid to the host software, the
An example of a simple mouse Capabilities Keyboard Devices relative devices. The locator report message
string might be as follows: The keyboard device protocol is designed to is sent either on a regular sampling interval or
implement the full functionality of a user on receipt of an AppPoll message from the
(
interface style like that of the standard Digital host.
protocol(locator)
type(mouse) LK501 keyboard, while minimizing the The locator-specific Application Protocol
usage(main) amount of state information that must be control/status messages are from the host to
buttons( 1(l) 2(M) 4(R) ) modeled in both the host and the keyboard, the device:
dim(2) and minimizing also the memory required in
the keyboard. AppPoll Requests the device to
rei
res(200 inch) report its state
The protocol allows for up to 255 keys. The
range( -127 127) Capabilities Information semantics provide for AppSamplinglnterval Sets the device
dO(dname(X» specifying the existence of special keypads sampling interval or
dl(dname(Y» - numeric, arrows, editing, function keys - instructs the device to
) the national alphabet, and the parameters of report only when polled
This would specify that the device is a mouse feedback features such as key clicks, bells, More detailed information can be found in the
using the standard locator protocol; that it is a and LEDs. . ACCESS. bus Locator Device Protocol
primary device to be used during system There is just one device data stream Specification.
startup [usage(main)); that is has three message, a keyboard state report, which the
buttons designated left, middle and right keyboard sends on every key transition (key Text Devices
coded with the respective mask values 1, 2, up or key down) and which reports the full The ACCESS. bus text device protocol is a
and 4; that it has two degrees of freedom, state of the keyboard, as a list of all the keys simple model for handling devices that
designated 'X' and 'Y", using inches as units that are down (assumed to be no more than transmit and/or receive messages consisting
with 200 counts per inch; that it reports ten). of strings of characters in some fixed
relative values (displacement since last character set. The text device data stream
report) in the range -127 to 127 counts. Device-specific control/status messages from message body simply contains 1 fo 32 byles
the host include an AppPoll poll command of text, and has no other assumed structure.
After assigning a unique address to a device, asking the keyboard to report its present The text device protocol also includes a
the host sends it a Cap Request message to state, and commands to produce clicks, bells, provision for high-level flow control.
command it to send its Capabilities and to control the LEDs.
Information in a Cap Reply message. Of The defined capabilities information includes
course, the device Capabilities string may More detailed information can be found in the the device type (for example, "barcode",
well exceed the 31-byte capacity of the ACCESS. bus Keyboard Device Protocol "magcode", "smartcard", "port", 'printer"),
message body of a control/status message, Specification. whether the device is for input, output, or
so several exchanges of both, character set ('ASCII' or "ISO Latin-l "),
CapRequestlCapReply messages are Locator Devices and the flow control ("input" or 'output").
needed. The two-byte 'offset' argument of The ACCESS.bus Locator Device
Specification provides for a device that has Flow control provides for the case that a data
each Cap Request specifies where in the
up to 15 degrees of freedom (with 16-bit stream receiver cannot handle data as fast as
Capabilities Information string the fragment
precision) and up to 16 binary keys or the transmitter can send it, as when a printer
should start. This 'offset' value is repeated n
buttons. Thus, in addition to such with limited buffer capacity receives
the Cap Reply message, to be used as a
conventional pointerllocator devices as voluminous data from the host. Flow control
check by the host in reassembling the
mouse, tablet, trackball. The ACCESS. bus uses two text-device-specific Application
Capabilities string. Thus each CapReply
locator protocol is suitable for valuator sets, Protocol control/status messages from the
message can contain up to 29 characters of
such as dial boxes, and function key boxes data stream receiver to the data stream
Capabilities Information.
with up to 16 function keys. sender:
The locator capabilities information provides AppPoll Tells the sender to hold
APPLICATION DEVICE TYPES for specifying the number of switches and transmission of data
The initial ACCESS.bus specification defines their designations (for example, 'left", 'right", stream messages until
Application Protocols for three kinds of 'middle", etc.), whether the locator values are requested to resume
devices: keyboards, locators, and text relative (like a mouse) or absolute (like a AppResume(count) Tells the sender it may
devices. An important advantage of tablet or dial box), the resolution (counts per resume transmitting up
developing devices that conform to these unit, and units), the dynamic range, and the to 'count' characters; if
defined protocols is the availability of names of the locator axes (for example, "x", 'count' is zero, then the
pre-existing software to implement them, in "y", etc.). sender may continue
particular, the drivers in the operating transmitting until
The first 2-byte word of the event report
software of the host system through which receiving an AppHold.
message body contains a mask giving the
application programs gain access to the
state of the switches; the remaining words More detailed information can be found in the
devices.
contain the value of each of the locator axes, ACCESS. bus Text Device Protocol
either the absolute values or the change Specification.
since the previous report in the case of
TIMING RULES numbers for the components discussed in components offer only bit-level 12C interface
To ensure good interactive response and to this section: support in hardware. For example, in the
ensure that all devices will have access to the 8XC528 the hardware performs the following
8XCL410
bus, the ACCESS. bus specifies some rules functions:
8XC524
on transaction timing. Further, specific 8XC528 • Generates an interrupt on receiving an 12C
timeouts are needed to avoid hanging up the BXC552 start condition
interconnect when devices fail or are 8XC652 • Recognizes a stop condition and indicates
removed. 8XC654 bus-busy or bus-free status
BXC751
Transaction Timing Rules 8XC752 • Latches a received serial bit
The ACCESS.bus is designed primarily for
interactive devices. A basic objective of the Where X is 0, 3, or 7. • Generates serial clock pulses
definition of the ACCESS.bus specification is
Each of these microcontrollers include an • Detects bit-level arbitration loss
that every interactive device should be able
8-bit CPU with a clock oscillator, interrupt
to update the host on its state at least once in But some of the components, such as the
structure, and a number of I/O lines. All come
every display video frame time. To help meed 8XCL410, offer byte-level support forthe 12C
in versions with some ROM program memory
this criterion, the Base Protocol imposes protocol, including byte framing with Ack
and a small amount of RAM data memory. In
some rules on the timing of a device's generation and address comparison and
most cases the ROM may be either mask
interaction with the bus. detection. The choice of any of these
programmable (X=3) or EPROM (X=7). Most
of these parts also support up to 64K each of components as the peripheral component
Response Timeouts considerably simplifies the development of
external program and data memories, but
In order that a dead or unplugged device will device firmware and also enables better
accessing external memory requires using
not hang up the system indefinitely, there run-time performance.
some I/O lines as address/data lines. Some
must be time limits for responding to
of these parts have ROMless versions (X=O), Table 1 summarizes some of the relevant
commands that require a response. The
and so would have to make use of external parameters and features of each of these
ACCESS.bus protocol specifies that devices
data memory. microcontrollers, by part number. For detailed
shall complete the Reset command within
250ms. Further, a device shall respond to any Each of these parts contains at least one descriptions of these components, as well as
command requiring a response within 40ms, 16-bit timer/counter, needed for participation the complete definition of the 8051
or, in the case of commands that can be in the 12C bus synchronization; some contain architecture, see the Data Handbook for
answered by several devices, within 40ms as many as three timer/counters, plus a BOC51 and Derivative Microcontrol/ers,
after the last device to respond. watchdog timer. available from Philips/Signetics. This manual
also contains a complete specification of the
Some of these part have analog input pins 12C protocol, and provides application notes
and on-board AID convertors as well as on 12C implementations, including sample
MICROCONTROLLERS pulse-width-modulation (PWM) outputs, both source code for some of the necessary
Participation in the several levels of the
usable for communication with the firmware.
ACCESS.bus protocol requires intelligence at
application-specific circuitry of an
the devices as well as at the host. Philips In addition to these intelligent
ACCESS. bus peripheral device.
produces a number of 8-bit CMOS microcontrollers, Philips offers the PCD8584
microcontrollers, of the 80C51 architecture All of these components offer open-drain 12C bus controller. This is a non-intelligent
family, featuring some level of 12C interface output pins that can be connected to the SDA component that serves to convert between
support on-chip. The use of these low-cost, and SCL lines of the 12C bus. In addition they byte-parallel data and the 12C serial data. It
low pin count, low power-draw components may contain special registers for controlling may be used to provide a general
greatly facilitates the design of ACCESS.bus the 12C interface functions. Some of these microprocessor with an 12C interface.
devices. The following are Philips part
SOFTWARE ARCHITECTURE Of course, each device vendor will have to interface level. The software at this level
develop substantial firmware specific to his or takes care of the host's responsibilities in the
AND DEVELOPMENT
her device. Philips and several third party ACCESS.bus configuration process. II
An ACCESS. bus peripheral requires software
vendors offer a range of tools to support performs the mapping between bus
at both ends of the bus transaction for
firmware development for the standard addresses and the device handles by which
managing all levels of the peripheral
components of the 8OC51 family. These iools devices are known to applications. It caches
inleraction: the 12C interface, the
include cross assemblers and cross device Capabilities Information and makes it
ACCESS.bus Base Protocol, and the
compilers for C and PUM, in-circuit emulators available to clients.
ACCESS.bus Application Protocol. Further,
with symbolic debugging and real-time trace
the peripheral device requires software to At the next level, there are Application
support, and EPROM programming
support communication between the device Protocol drivers for the predefined device
equipment Generally, these software and
microcontroller and the application-specific types, providing the bridge between the
hardware tools are for use with IBM ACCESS. bus Services layer and the window
110 transducer circuitry. Finally, the host
PC-compatibles as the development
system operating software must provide system services by which applications
platforms.
interfaces by which application programs can normally access the common interactive
access both the ACCESS.bus devices and devices. This level should also provide a
Host Software Architecture
the ACCESS.bus itself. An important general-purpose interface by which
Vendors of host systems supporting
advantage of the ACCESS. bus approach is user-process software may access the bus.
ACCESS. bus will have to supply drivers and
that the lower levels of the interaction are This interface may be used for debugging
other kernel modules to provide access to the
common to diverse device types, so they can purposes, for access to interactive
ACCESS.bus port, both for application
be supported by the same or similar software peripherals independent of the window
program clients and for other system
modules. system, and to accommodate unusual device
software, such as the interactive I/O handlers
of the window system. In this context, an types.
Device Flnnware Development
The microcontroller in the device provides the X Window System server is itself a client of Of course, all these software levels will
the ACCESS. bus services (Figure 9). generally be specific to the host operating
intelligence for managing the device's
participation in all the levels of the system or window system. Digital will be
At the lower levels, the 12C level and the
ACCESS.bus protocol. Use of the providing timely ACCESS. bus support in
ACCESS. bus Base Protocol level, the host is
components 'with hardware 12C interface each of its operating systems as hardware
much like a peripheral device; its
functionality, described in interfaces and ACCESS.bus devices are
ACCESS. bus port is based on one of the
"MICROCONTROLLERS", can simplify the introduced as Digital products. II is expected
microcontrollers previously discussed, and its
development of the lowest level of this that standard support for ACCESS. bus will be
low-level software requirements are similar.
software. Moreover, because theyconcem The low-level host software is responsible for available for the standard ACE operating
only thl! bus communication methods that are systems. Therefore, developers of
framing and deframing the ACCESS. bus
commori to all sorts of peripheral devices, the ACCESS.bus peripherals that conform to the
messages coming from and going to the
12C interface and the ACCESS.bus Base defined standard device type specifications
higher levels.
Protocol may well be implemented by reusing can expect that their product will
software previously developed for some of The heart of the ACCESS. bus access will be automatically be compatible with any of the
in an ACCESS.bus Services layer, which target systems, even in the hot-pluggable
these components. And devices conforming
to the samantics of the predefined standard manages the mUltiplexing of the sense. Developers of unusual ACCESS. bus
Application Protocols may also benefit from ACCESS. bus interface resource among the peripheral devices will have also to develop
the availability of some off-the-shelf code at various clients making use of it. This level is the appropriate driver software and to deal
the top level. responsible for the semantics of the with the problems of having it installed on
ACCESS. bus messages exchanged with the customers' computers.
I User-level
bus devices
II Keyboard
driver
II Locator
driver
II Text
driver
II Toaster
driver
II Brand X
driver
I
1 ~_'---I-J L..-1r---J 1 - - -...----1
1 L..-1r---J I--I"'---.J
1
I Services layer
1
1
I 1
Built-in TURBOchannel
option
hardWare
interface (brand X)
interface
I I
I Physical bus I
DEVELOPMENT SUPPORT Technical services available to TRI/ADD information on the activities of the planned
Both Digital and PhilipslSignetics offer members include free consultation on ACCESS. bus standards committee.
technical support and assistance to hardware and software issues, necessary
For further information on the TRI/ADD
developers of ACCESS.bus devices and host documentation and updates, technical
Program and its support of the ACCESS.bus,
systems. development seminars, and newsletters. The
contact
products of TRI/ADD members are listed in
Digital's TRIIADD Program Digital's hardware catalogs and can enjoy TRI/ADD Program
Digital's TRIIADD Program provides support further marketing support. Further, TRI/ADD Digital Equipment Corporation
to third party vendors of hardware products products can be supported by Digital's 100 Hamilton Avenue
compatible with all of Digital's open buses world-wide field service organization. The Palo Alto, CA 94301
and interconnects, including ACCESS.bus. TRI/ADD Program will also be a source of
8OC51-8ased
8-BIt Mlcrocontrollers CONTENTS
80Cl31/80CL510verview ................................................ 173
Differences from the 60C51 . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . .. 173
Special Function Registers ........................................... 173
The Interrupt Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 175
Power-Down Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 176
Low Power Consumption .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 176
80CL31/80CL51 Data Sheet ............................................... 177
8XC52 Overview ........................................................ 196
Differences from the 60C51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 196
Program Memory .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 196
Special Function Registers ........................................... 196
Timer/Counters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 196
Serial Port ........................................................ 197
Timer/Counter 2 Set-up .................................. . . . . . . . . . . .. 201
Using Timer/Counter 2 to Generate Baud Rates . . . . . . . . . . . . . . . . . . . . . . . . . .. 20 1
Interrupts ......................................................... 201
Port Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 20 1
8032AH/8052AH Data Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 206
80C32180C52/87C52 Data Sheet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 215
8XC053/54 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 230
The 6XC053/54 On-Screen Display (OSD) Block ............................. 231
Differences from the 60C51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 232
Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 232
Special Function Registers ........................................... 232
Reduced Power Modes .............................................. 232
Interrupts ......................................................... 232
83C053/83C054/87C054 Data Sheet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 234
8XCL410 Overview ...................................................... 250
Differences from the 80C51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 250
Special Function Registers ........................................... 250
12C Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 250
The Interrupt Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 253
Power-Down Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 254
Low Power Consumption .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 254
80CL410/83CL410 Data Sheet ............................................. 256
8XC451 Overview ....................................................... 277
Differences from the 60C51 . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . ... 277
Special Function Registers ........................................... 277
110 Port Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 277
Processor Bus Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 277
Standard Quasi-bidirectional 110 Port ................................... 277
Parallel Printer Port ................................................. 277
80C451/83C451/87C451 Data Sheet ........................................ ' 260
8XC524/8XC528 Overview ................................................ 297
Differences from the 80C51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 297
Data Memory .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 297
Special Function Registers ........................................... 296
Watchdog Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . .. . . . . . ... 298
12C Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 300
Interrupts ...................................................... 301
Idle Mode ......................................................... 301
Power-Down Mode .................................................. 301
83C524/87C524 Data Sheet ............................................... 302
80C528/83C528/87C528 Data Sheet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 320
8XC550 Overview ....................................................... 340
Differences from the 80C51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 340
Special Function Registers ........................................... 340
110 Port Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 340
AID Converter ..................................................... 340
Sample AID Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 342
Watchdog Timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 342
Interrupts ......................................................... 344
Interrupt Control Registers ......................................... ' " 344
Power-Down and Idle Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 344
80C550/83C550/87C550 Data Sheet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 345
Signetics OOC51-Based 8-Bit Microcontrollers
SECTION 4
Contents (Continued)
80C51 FAMILY DERIVATIVES
8OCL31/80CL51 OVERVIEW The BOCL51 can be operated from a single devices because their internal nodes must be
The BOCL31/BOCL51 (hereafter generically battery supply which can vary between I.BV constantly refreshed. The static design of the
referred to as BOCL51) is socket compatible and 6V, and for an AC supply the part BOCL51 offers the user the ultimate in
with the BOC51 and has many of the same requires only a simple voltage regulator. In power-down modes, because the part can be
features, but at a much lower power and some cases the part can be operated from an stopped until it is needed and then started
dock frequency. unstabilized supply, eliminating altogether the from where it was at when it was stopped,
need for a regulator. with no loss of internal states or data. The
The BOCL51 is a member of the family of power consumption of the BOCL51 when the
low-power BOC51 derivative parts. The The power consumption of the part is much
clock is stopped is less than lIlA.
features of the BOCL51 include: lower than that of a standard BOC51.
Operating at 3.5MHz from a 3V supply, the Differences from the 8OC51
• 4k xB ROM (BOCL51) BOCL51 typically draws less than 1rnA of
.12BxB RAM current. The power consumption of the part is Special Function Registers
directly related to the supply voltage and The BOCL51 contains most of the special
• Two IS-bit timer/counters clock frequency. As the supply voltage or function registers found in the BOC51 as well
clock frequency are increased, the power as four additional SFRs that have been
• A two level nested priOrity interrupt
consumption also increases. At 12MHz and a added to handle the eight additional external
structure
supply voltage of 5V, the BOCL51 will draw interrupts.
• Full duplex serial channel about lOrnA of current, which is slightly less
The interrupt structure on the BOCL51 has
than the current that an BOC51 would require.
• Thirteen interrupt sources (with eight been upgraded to include eight additional
additional external interrupts) The advantage that the BOCL51 has over the external interrupts. The I E and IP registers on
BOC51 is in its ability to operate at very low the BOC51 have had their names changed on
• Idle and power-down modes frequencies and supply Voltages. This makes the BOCL51 to IENO and IPO. In addition, two
the part an ideal choice for applications SFRs have been added to handle the
• Interrupt or reset return from power-down
where power is supplied from batteries, or additional external interrupts. The registers
• Six oscillator configurations where low supply voltages or clock frequency are lEN 1 and IPI.
are necessary. The BOCL51 features a fully
- Quartz crystal Two more SFRs are added to allow the user
static design. Using the on-chip oscillator, the
- Ceramic resonator to set the polarity of the additional external
clock frequency is limited to a minimum of
interrupts and to hold the interrupt request
- RC 32kHz, but using an external oscillator the
flags for those added interrupts. The SFRs
- LC part can be operated down to DC. This
are the interrupt polarity register (IX 1) and the
means that the dock can be turned off, and
- External interrupt request flag register (IRQ1).
when it is started again the microcontroller
• Input supply range from I.BV to 6V will continue with the action that it was Table 1 shows the special function registers,
performing when the dock was stopped. This their locations, and their reset values for the
• Operating frequency from DC to 16MHz is something that is impossible with dynamic BOCL51.
AF AE AO AC AB AA A9 AS
IENO·# Interrupt enable 0 ASH EA I - I - I ES I ETl I EXl I ETO J EXO OOH
EF EE ED EC EB EA E9 E8
IEN1'# Interrupt enable 1 E8H EX9 I EX8 I EX7 I EX6 1 EX5 1 EX4 1 EX3 1 EX2 OOH
C7 C6 C5 C4 C3 C2 Cl co
IR01'# Interrupt request flag COH 109 I 108 I 107 I lOS I 105 1 104 1 103 1 102 OOH
IX1# Interrupt polarity E9H OOH
PO· PortO 80H 87 86 85 84 83 82 81 80 FFH
Pl' Port 1 90H 97 96 95 94 93 92 91 90 FFH
P2' Port 2 AOH A7 AS A5 A4 A3 A2 Al AO FFH
P3' Port 3 BOH B7 B6 B5 B4 B3 B2 Bl BO FFH
D7 06 05 04 03 02 01 00
PSW' Program status word OOH CY I AC I FO I RSl I RSO I ov I - I P OOH
particular section of code. To tie the EA - General Enable/Disable control IPI (D8H)
asynchronous activities of these functions to o = All interrupts disabled.
nonnal program execution, a multiple-source, 1 = Interrupts can be individually
two-priority level, nested interrupt system is 765432tO
enabled or disabled.
provided. The BOCL51 acknowledges ES - Serial port interrupt enable. I~I~I~I~I~I~I~I~I
interrupt requests from 13 sources as follows: (1 = enabled, 0 = disabled)
ETI - Timer 1 interrupt enable.
Priority Source Vector Function (1 = enabled, 0 = disabled) PX9-PX2-Extemal interrupt priority lor
Address EXI - External interruptI enable. external interrupts 2 - 9. (0 = low, 1 = high)
Highest INTO 0003H External (1 = enabled, 0 = disabled)
interrupt 0 ETO - Timer 0 interrupt enable. lXI-Interrupt Polarity register. This register
(1 = enabled, 0 = disabled) allows the programmer to detennine the
SO 0023H UART EXO - External interrupt 0 enable.
interrupt polarity 01 external interrupts 2 - 9 that will be
(t = enabled, 0 = disabled) sensed lor the interrupt. II the bit lor an
INT5 0053H External
IPO-Interrupt Priority register zero. This interrupt is set to 1, then the interrupt will be
interrupt 5
register has the same function as the IP triggered by a high input on that external
TO 0006H Timer 0 register on the 80C51. interrupt. If the bit is cleared to 0, then the
interrupt interrupt will be triggered by a low on that
INT6 0056H External IPO(68H) external interrupt.
interrupt 6 4 3 2 1 0
INT1 0013H External
interrupt 1
I- I - I - I I I I I I
ps PTt PXt PTO PXO IXI (E9H)
Power-Down Mode associated with the two methods of waking dissipation is reduced by lowering the clock
In addition to being able to reduce the power the part up from the power.<fown mode. frequency andlor reducing the supply voltage.
consumption by stopping the clock, there are A standard Philips BOC51 will operate down
both idle and power-down modes available. Low Power Consumption to a clock frequency of 0.5MHz and a supply
These operate exacUy the same as the idle The BOC151 is targeted toward low power voltage of 4V. The advantage of the
and power-down modes on the BOCSI. There applications in indusbial control, portable low-power BOCL51 is that it can be run at
is only one difference and that is that it is instrumentation, intelligent computer frequencies as low as 32kHz with the internal
possible to tenninate a power.<fown condition peripherals, portable consumer products, and oscillator (DC when an external oscillator
with either a reset or an external interrupt. smart cards. Working from a single supply circuit is used), and that the voltage supply
which can varY between I.BV and 6V, the levels can be reduced down to I.BV. To
To be able to wake up the part from the BOCL51 requires only a simple voltage obtain maximum power reduction, the part
power.<fown state with an external interrupt, regulator. In many cases it can be operated can be operated with both reduced clock
both the PO and IOL bits of the PCON from an unstabilized supply, eliminating frequency and reduced voltage supply. .
register must be set when entering the altogether the need for a regulator. A typical
power.<fown mode. If only the PO bit is set, BOCLSI device draws lmA from a 3V supply
the power-down mode will only be tenninated when running at a 3.SMHz clock frequency. The low voltage operation of the BOC151 is
by a hardware reselWith both bits set, an Current consumption in the idle and due in part to the Philips SACMOS process.
interrupt on any of the additional external power-down modes is reduced further to less This is a self aligned contact CMOS process
interrupts,INT2-INT9, will cause the part to than O.SmA and I/IA, respectively. in which the isolation regions between the
wake up. To ensure that the oscillator is contacts and the edge of the isolation have
stable before the controller restarts, the The BOC151 can be operated at clock been eliminated. This significanUy reduces
internal clock will remain inactive for 1536 frequencies up to 16MHz. At these the size of the die, which in turn reduces the
oscillator periods after the interrupt is frequencies and a 5V supply voltage, the part paraSitic capacitances and drain resistance.
detected. After this, the PO flag will be reset, will draw current similar to that of a standard This means that for a given clock speed,
and the part will be in the idle mode, and the BOC51. For the BOCL51, the reduction in parts fabricated in the SACMOS process will
interrupt will be handled in the nonnal way. power is a function of both the clock require less power, and this is most apparent
Figure I shows the different oscillator delays frequency and the supply voltage. Power at low frequenCies and voltage supply levels.
Power-Down
ExtemallnlerrUpl
-- - -------
Jf\.
- - - - - - - - -- -
t.o""
Oocillolar
1'0. I "...... ...-
Deloy Counter
1536 PerIods
- > 24 Periods
NOTE:
1. The currenUy available product is guaranteed up to 12MHz at 4.5V. A 16MHz device will be made available during 1992.
ORDERING CODE
PHIUPS PART ORDER NUMBER
PART MARKING SIGNETICS PART ORDER NUMBERl
TEMPERATURE (OC)
ROMless ROM ROMless ROM AND PACKAGE FREQUENCY
PSOC131HFP P80CL51HFP PSOC131HFP N PSOCL51HFP N -40 to +85, plastic DIP 32kHZ to 12MHz
PSOCL31HFT P80CL51HFT PSOC131HFT D PSOCL51 HFT D -40 to +85, plastic VSO 32kHZ to 12MHz
NOTE:
1. Parts ordered by the Signetics part number will be marked with the Philips part marl<ing.
For emulation purposes, the PS5CLOOO (Piggyback version) with 256 bytes of RAM is recommended.
LOGIC SYMBOL
VDD Vss
ALE
~
i TxD_
e J'RI1I-+
.rIlRxD-+
fNTf~ ~
l! 10-+
I ~~ ..
0
C RD_
BLOCK DIAGRAM
FREQUENCY
REFERENCE COUNTER (I)
r-'----1 r-'----1
XTAL2 . XTAl1 10 T1
---I
PROGRAM
I
OSCILLATOR
AND MEMORY
DATA
MEMORY
lWOI6-BIT
nMERIEVENT
I
nMiNG (4KK8ROM) (1118 K8 RAM) COUNTERS I
(aocL51 ONLy)
I
I
I
I
I
CPU
10
INTERNAL
INTERRUPTS
SERIAL UART PORT
______ .-1
PIN DESCRIPTION
MNEMONIC PINNa. TYPE NAME AND FUNCTION
Pl.0-Pl.7 HI 1/0 PorI 1 : Port 1 is an B-bit bidirectional 110 port with internal pull-ups. Port 1 pins that have 1s written to
them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 1 pins that are
externally pulled low will source current because of the internal pull-ups. {See DC Electrical
Characteristics: 'ILl. Additional functions indude:
1-8 I INT2-1NT9 (Pl.D-Pl.7): Additional external interrupts.
P2.D-P2.7 21-2B 1/0 PorI 2: Port 2 is an B-bit bidirectional 1/0 port with internal pull-ups. Port 2 pins that have 1s written to
them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins that are
externally being pulled low will source current because of the internal pull-ups. {See DC Electrical
Characteristics: IILl. Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that use 16-bit addresses (MOVX @DPTR). In
this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data
memory that use B-bit addresses (MOV @Ri), port 2 emits the contents of the P2 special function
register.
P3.O-P3.7 10-17 1/0 PorI 3: Port 3 is an B-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins that have ls written to
them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins that are
externally being pulled low will source current because of the pull-ups. (See DC Electrical
Characteristics: 'lL). Port 3 also serves the special features of the BOC51 family, as listed below:
10 I RxD (P3.0): Serial input port
11 0 TxD (P3.1): Serial output port
12 I lRTl! (P3.2): External interrupt a
13 I lNTf (P3.3): External interrupt 1
14 I TO (P3.4): Timer a external input
15 I T1 (P3.S): Timer 1 external input
16 0 WR (p3.S): External data memory write strobe
17 0 RU (P3.7): External data memory read strobe
RST 9 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the device. An
internal diffused resistor to Vss permits a power-on reset using only an external capacitor to VDD •
ALE 30 0 Address Latch Enable: Output pulse for latching the low byte of the address during an access to
external memory. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency,
and can be used for external timing or docking. Note that one ALE pulse is skipped during each access
to external data memory.
PSrn 29 0 Program Store Enable: The read strobe to external program memory. When the device is executing
code from the external program memory, PSEN is activated twice each machine cyde, except that two
PSrn activations are skipped during each access to external data memory. PSrn is not activated
during fetches from internal program memory.
E!." 31 I External Access Enable: E!." must be externally held low to enable the device to fetch code from
external program memory locations OOOOH to lFFFH. IfE!." is held high, the device executes from
internal program memory unless the program counter contains an address greater than OFFFH.
XTAL1 19 I Crystal 1 : Input to the inverting oscillator amplifier and input for an external clock source.
XTAL2 lB 0 Crystal 2: Output from the inverting oscillator amplifier.
PORT OPTIONS Two cases have to be examined. First, Option 2: Open drain-quasi-bidirectional VO
The pins of port 1, port 2, and port 3 may be accesses to extemal memory (Ell; = 0 or with n-channel open drain output.
individually configured with one of the access above the built-in memory boundary), Use as 'an output requires the
following port options (see Figure 1): and second, 110 accesses. connection of an external pull-up
resistor. See Figure 1(c).
Option 1: Standard Port- External Memory Accesses
quasi-bicirectionaillO with pull-up. Option 3: Push-Pull-output with drive
The strong booster pull-up p1 is Option 1: True 0 and 1 are written as capability in both polarities. Under
turned on for two oscillator periods address to the external memory this option, pins can only be used
after a 0-10-1 lransition in the port (strong pull-up is used). as outputs.
latch. See Figure 1(a). Option 2: An external pull-up resistor is Individual mask selection of the post-reset
Option 2: Open Draln-quasi-bidirectional needed for external accesSes. , state is availilble on any of the above pins.
110 with n-channel open drain Option 3: True 0 and 1 are written as Make your selection by appending ·S· or "R'
output. Use as an output requires address to the external memory to option 1, 2, or 3 above (e.g., lS for a
the connection of an external (strong pull-up is used). standard 110 to be set alter RESET or 2R for
pull-up resistor. See Figure 1(b). an open-drain 1/0 to be reset alter RESET.
Option 3: Push-Pull-output with drive 1/0 Accesses Option S: Set-alter reset, this pin will be
capability in both polarities. Under Option 1: When writing a 1 to the port latch, initialized High.
this option, pins can only be used the strong pull-up pl will be on for
two oscillator periods. No weak Option R: Reset-after reset, this pin will be
as outputs. See Figure 1(c). initialized Low.
pull-up exists. Without an external
The definition of port options for port 0 is pull-up, this option can be used as
slightly different. a high-impedance input.
P2
"Q
FROM PORT
LATCH
INPUT DATA
INPUT
BUFFER
READ PORT PIN
(8)
.sv
EXlERNAL
PULL-UP
FROIIPORT
LATCH
"Q .. 11,'
INPUT DATA
(b)
.sv
STRONG PULL-UP
. 1 8
1
"Q
FROM PORT
LATCH
(C)
Figure 1. Pons
POWER-DOWN MODE before the controller restarts, the internal cause PCON to be cleared by hardware;
The instruction selling PCON.1 is the last clock will remain inactive for 1536 oscillator terminating idle mode. The interrupt is
executed prior to going into the power-down periods after the interrupt is detected. After serviced, and following the instruction REn,
mode. In power-down mode, the oscillator is this, the PO flag will be reset, the controller is the next instruction to be executed will be the
stopped. The contents of the the on-chip now in the Idle mode and the interrupt will be one following the instruction that put the
RAM and SFRs are preserved. The port pins handled in the normal way. device in the the idle mode.
output the values held by their respective Flag bits GFO and GF1 can be used to
SFRs. ALE and PSER are held low. Reset Mode
Setting only the PO bit in the PCON register determine whether the interrupt was received
Power-down operates in wake-up mode and during normal execution or idle mode. For
reset mode. again forces the controller into the
power-down mode, but in this case it can only example, the instruction that writes to
In the power-down mode, Vee may be be restored to normal operation with a direct PCON.O can also set or clear one or both flag
reduced to minimize power consumption. reset operation. bits. When idle mode is terminated by an
However, the supply voltage must not be interrupt, the service routine can examine the
reduced until the power-down mode is active, status of the flag bits.
and must be restored before the hardware IDLE MODE The second method of tenninating the idle
reset is applied and frees the oscillator. Reset The instruction that sets PCON.O is the last mode is with an external hardware reset.
must be held active until the oscillator has instruction executed before going into idle Since the oscillator is still running, the
restarted and stabilized. mode. In idle mode, the internal clock is . hardware reset is required to be active for
stopped for the CPU, but not for the interrupt, only two machine cycles to complete the
Wake-Up Mode timer, and serial port functions. The CPU reset operation. Reset redefines all SFRs, but
Selling both PO and IDL flags in the PCON status is preserved along with the stack does not affect the on-chip RAM.
register forces the controller into the pointer, program counter, program status
power-down mode. Selling both flags enable word and accumulator. The RAM and all The status of the external pins during idle and
the controller to be woken-up from the other registers maintain their data during idle power-down mode is shown in Table 1. If the
power-down mcide with either the external mode. The port pins retain the logical states power-down mode is activated while
interrupts INT2-INT9, or a reset operation. they held at idle mode activation. ALE and accessing external memory, port data held in
PSER hold at the logic high level. the special function register P2 is restored to
An external interrupt INT2-1NT9 at port 1 port 2. If the data is a logic 1, the port pin is
releases both the oscillator and the delay There are two methods used to terminate the held high during the power-down mode.
counter. To ensure that the oscillator is stable idle mode. Activation of any interrupt will
I~I~I~I~I~I~I~I~I I~I~I~I~I~I~I~I~I
CPU asynchronous to the execution of any
particular section of code. To tie the
asynchronous activities of these functions to
normal program execution, a multiple-source, Bit Symbol Function Bit Symbol Function
two-priority level, nested interrupt system is IP1.7 PX9 External interrupt 9 priority IR01.7 109 External interrupt 9 request
provided. The 8OCL51 acknowledges level flag
interrupt requests from thirteen sources, as IP1.6 PX8 External interrupt 8 priority IR01.6 lOB External interrupt 8 request
follows: level flag
- INTO and INTl IP1.S PX7 External interrupt 7 priority IR01.S 107 External interrupt 7 request
- Timer 0 and timer 1 level flag
- UART serial 1/0 interrupt IP1.4 PX6 External interrupt 6 priority IR01.4 106 External interrupt 6 request
- INT2 to INT9 (port 1) level flag
IP1.3 PXS External interrupt S priority IR01.3 lOS External interruptS request
Each interrupt vectors to a separate location level flag
in program memory for its service routine. IP1.2 PX4 External interrupt 4 priority IR01.2 104 External interrupt 4 request
Each source can be individually enabled or level flag
disabled by corresponding bits in the internal IP1.1 PX3 External interrupt 3 priority IR01.1 103 External interrupt 3 request
enable registers (IE NO, lEN 1) The priority level flag
level is selected via the interrupt priority IP1.0 PX2 External interrupt 2 priority IR01.0 102 External interrupt 2 request
register (IPO, IP1). All enabled sources can level flag
be globally disabled or enabled.
Interrupt priority is as follows: Priority Vector Source
External Interrupts INT2-INT9 0- low priority XO (highest) 0OO3H External 0
Port 1 lines serve an alternative purpose as 1 - high priority SO 0023H UART
eight additional interrupts INT2-INT9. When XS OOS3H ExternalS
IX1 (E9H)
enabled, each of these lines can "wake-up" TO OOOBH Timer 0
Interrupt polarity register
the device from power-down mode. Using the 'X6 OOSBH External 6
IX 1 register, each pin may be initialized to 76543210 Xl 0013H External 1
either active high or low. IROl is the interrupt
request flag register. Each flag, if the interrupt
1~1~1~IMI~lul~I~1 X2
X7
003BH
0063H
External 2
External 7
is enabled, will be set on an interrupt request Tl 00lBH Timer 1
but it must be cleared by software. Bit Symbol Function X3 0043H External 3
IX1.7 IL9 External interrupt 9 polarity X8 006BH External 8
IENl (E8H) level X4 004BH External 4
Interrupt enable register IX1.6 ILa External interrupt 8 polarity X9 (lowest) 0073H External 9
level
IX1.S IL7 External interrupt 7 polarity SFR
level Register Function Address
IX1.4 IL6 External interrupt 6 polarity IXl Interrupt polarity register E9H
level IROl Interrupt request flag COH
Bit Symbol Function
IX1.3 1L5 External interrupt S polarity register
IEN1.7 EX9 Enable external interrupt 9
level IENO Interrupt enable register A8H
IEN1.6 EX8 Enable external interrupt 8
IX1.2 IL4 External interrupt 4 polarity IENl Interrupt enable register E8H
IEN1.S EX7 Enable external interrupt 7
level (INT2-lNT9)
IEN1.4 EX6 Enable external interrupt 6
IX1.l IL3 External interrupt 3 polarity IPO Interrupt priority register BaH
IEN1.3 EXS Enable external interrupt S
IEN1.2 EX4 level IPl I nterrupt priority register F8H
Enable external interrupt 4
IEN1.1 EX3 IX1.0 1L2 External interrupt 2 polarity (INT2-lNT9)
Enable external interrupt 3
IEN1.0 EX2 level
Enable external interrupt 2
Writing either a "1" or "0" to an IXl register bit
where 0 = interrupt disabled
sets the priority level of the corresponding
1 = interrupt enabled
external interrupt to active High or Low,
respectively.
OSCILLATOR CIRCUITRY The following options are provided for Power-on Reset
The on-chip oscillator circuitry of the 8OCL51 optimum on-chip oscillator performance. The 8OCL51 contains on-chip circuitry which
is a single stage inverting amplifier biased by Please state option when ordering: switch the port pins to the customer-defined
an internal feedback resistor. (See Figure 2.) 32kHz: Figure 3(c). An option for 32kHz logic level as soon as Voo exceeds 1.3V.
The oscillatorcan be operated with a quartz clock applications with external (See Rgures 6 and 7.) As soon as the
crystal, ceramic resonator, LC network or RC trimmer for frequency adjustment. minimum supply voltage is reached, the
network. See Figure 3 for different oscillator will start up. However, to ensure
configurations. When ordering parts, it is A 4.7MQ bias resistor must be that the oscillator is stable before the
necessary to specify an oscillator option. The connected in parallel with the crystal. controller starts, the clock signals are gated
options are: RC when an RC network will be Osc.2: Figure 3(e). An option for low-power, away from the CPU for a further 1536
used, OSC 2 for oscillator operation below low-frequency operations using LC oscillator periods.
4MHz, OSC 3 for oscillator operation from components or quartz. An hysteresis of approximatelylOOmV at a
4MHz to IOMHz, OSC 4 for oscillator
Osc.3: An option for medium frequency typical power-on switching level of 1.3V will
operation above IOMHz, and 32kHz if 32kHz
range applications. ensure correct operation.
to 400kHz operation is desired.
Osc.4: An option for high frequency range An automatic reset can be obtained at
For operation as a standard quartz oscillator,
applications. power-on by connecting the RST pin to Voo
no external components are needed (except
via a IO~F capacitor. At power-on, the
at 32KHz). When using external capacitors, RC: Figure 3(g). An option for an RC voltage on the RST pin is equal to Voo minus
ceramic resonators, coils, and RC networks oscillator. the capacitor voltage. and decreases from
to drive the oscillator, five different
The equivalent circuit data of the internal Voo as the capacitor discharges through the
configurations are supported (see Figure 3
oscillator compares with that of matched internal resistor RRST to ground. The larger
and Table 2).
crystals. the capacitor. the more slowly VRST
In the power-down mode the oscillator is decreases. VRST must remain above the
stopped and XTAL 1 is pulled high. The The externally adjustable RC oscillator has a lower threshold of the Schmitt trigger long
oscillator inverter is switched off to ensure no frequency range from 100kHz to 500kHz. enough to efleet a complete reset. The time
current will flow. To drive the device with an (See Figure 5.) required is the oscillator start-up time. plus 2
external clock source, apply the external machine cycles.
clock signal to XTAL I, and leave XTAL2to
float, as shown in Figure 3(f). There are no
requirements on the duty cycle of the external
clock, since the input to the internal clocking
circuitry is split using a flip-flop.
Voo
Tointemal
timing drculta
voo Voo
Rbis.
T C2;
XTAL1 XTAL2
CJ
~--------~Dr---------~
Figure 2. Oscillator
I I
I
I I
XTAL.
71! 4.711EG
+
(a) Oscillator Configuration for (c) Configuration for
I
+
rr
Quartz Crystal 32kHz Operation
I (d) Configuration for I
Ceramic Resonator
--------------- -------------- ---------------
XTALHXTAL2 I XTAL. XTAL2 I XTAL~XTAL2
l l!
(e) Configuration for -.L I
~!
(f) External Clock -.L 1
=",,1
(g) RC Network
LC Network Configuration Configuration
--------------- -------------- ---------------
Figure 3. Oscillator Configurations
R,
X~Lt ----~---c==~----_.----------~~------------~~--- XTA1.2
C11 gm
600
400 1\
10SC
(kHz)
\
200 ~
~ r--
o
RC(jJ.II)
SUPPLY VOLTAGE
POWER·ON RESET
~NTERNALl
.....
OSCILLATOR
k r-.. I
CPU RUNNING
I
• .1
START-UP 1536 OSCILLATOR
TIME PERIODS DELAY
Vcc
J
1D~F t RST
aocL51
vcc
~-
Figure 7. Recommended Power-on Reset Circuitry
DC ELECTRICAL CHARACTERISTICS
Tarrb -- -4Q°C to +8S0C vss -- OV
TEST LIMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
1.8
1.6
lA L
1.2 /
1.0 /
100 (mA)
0.8
1.2MHz V
0.6 L
V
/v
OA
0.2
0
0 1
V
2
!,.---!-- ~
3 4
32kHz
r-
-- 5
l--V
Voo (V)
AC ELECTRICAL CHARACTERISTICS
Tamb = --40"C to +85"C vss = OV1, 2
12MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
Program Memory
1ltcLCL Oscillator frequency 0 20 MHz
ILL 8 ALE pulse width 127 2leLcL--40 . ns
IAL 8 Address valid to ALE low 43 IeLCL--40 ns
Iu 8 Address hold after ALE low 48 IeLCL--'35 ns
ItIV 8 ALE low to valid instruction in 233 41eLCL-100 ns
Itc 8 ALE low to PSEN low 58 IeLCL--25 ns
Icc 8 PSEN pulse width 215 3lcLcL--'35 ns
IeIV 8 PSEN low to valid instruction in 125 31eLCL-125 ns
lei 8 Input instruction hold after PSEN 0 0 ns
IeIF 8 Input instruction float after PSEN 63 IcLCL-2O ns
t,WI 8 Address to valid instniction in 302 51eLcL-115 ns
tAFC 8 PSEN low to address float 0 0 ns
Data Memory
tRR 9 RO pulse width 400 61eLCL-100 ns
tww 10 WR pulse width 400 6tcLCL7100 ns
ItA 9,10 Address hold time after ALE 48 - tcLCL--'35 - ns
tRD 9 RO low to valid data in 250 51eLcL-165 ns
toFR 9 Data float after RO 97 2tcLCL-70 ns
lt~ 9 ALE low to valid data in 517 81eLcL-150 ns
tAD 9 Address to valid data in 585 91eLCL-165 ns
Itw 9,10 ALE low to RO or WR low 200 300 31cLcL-50 3IeLCL+50 ns
tAW 9,10 Address valid to WR low or RO low 203 41eLCL-130 ns
towx 10 Data valid to WR transition 23 IeLCL~O ns
tow 9 Data valid to WR 433 - 71eLCL-150 - ns
two 10 Data hold after WR 33 IeLCL-50 ns
tAFR 9 RO low to address float 3 12 12 ns
tWHLH 9, 10 RO or WR high to ALE high 43 123 tCLcL--40 !cLCL+40 ns
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. load capacitance for port 0, ALE, and PSEN = 5OpF, load capacitance for all other outputs =4OpF.
3. Interfacing the 80CL51 to devices with float time up to 75ns is permitted. This limited bus connection will not cause damage to port 0 drivers.
ALE
PORTO AO-A7
PORT 2 A8-A,S
ALE
"- V
-tWHlH-
tlD
~I
i'<---tlW tRR
"-
tAL jtDFR'"
~-tLA-~
PORTO ~ AO-A7
FROM AI OR DPL
'\.
/1 DATA IN ",' ,
///
/ AO-A7 FROM PCl INSTRIN
tAW tRD-
tAD
PORT 2
)< P2.0-P2.7 OR A8-A'S FROM DPH A8-A'S FROM PCH
ALE
tWHlH -
--t----tww ---~
WR ____________~--------~
t c - - - I - - - tow ----~
0.9VDO
OAVDO
______--'x:=:: Test points
:::jx(~----~----
O.3VDO 0.3VOD
lmA
-Ill
l00jlA
o VDI)f2 VOD
100 16
I
10 V 12
/1
./
16 H z / /
'(MHz) 1 100 (mA) 8 / /
12MHz
./
/
/
V
0.1
8Mu /'
".."
V
3.58 Hz"'"
0.111
o 2 2 4
Yoo(V)
YoolY)
NOTE: Below 32kHz. clock has to be supplied externally.
Figure 14. Typical Operating Current as a Function of
Figure 13. Frequency Operating Range Frequency and Voo• Tami> 25D C =
5
J 8
/
4
/
//
3
1 M.! V
~OLE
(mA)
12. Hz
/ V/ IPO
lIlA)
4
2 / /
~/ / V
~/ /
8M
/ .....
1
V ~
./ V
3.jM.k
~
0
0 1 2 3 4 5 6 o 4
Yoo(V) YooM
Figure 15. Typical Idle Current as a Function of Figure 16. Typical Power-Down Current Vs.
Frequency and Voo. T ami> 25"C = =
Frequency and Voo• T.mb 25°C
STANDARD PIGGYBACK
Types: P85CLOOOHFZ
Emulation for: P83CL410, P80CL51
Ust of differences between masked microcontroller and corresponding piggyback·
PARAMETER MASKED CONTROLLER PIGGYBACK
RAM size 128 256
ROM size 4k EPROM size dependent (max 16k)
Ponoption 1,2,3 1
Oscillator option 32kHz, Osc, 2, 3, 4, RC Osc.4
Mach. dimensions Standard Dualln-Une, Small Outline See Figure 17
Current cons. 100 100 (OSC. 4) + IEPROM
Voltage range full full, limil!l!:! bl( EeBQM
ESD specification not tested (different package)
--
T ~
~-
1
15 N @ I @ & 14
@ I @
@ I @ EPROM
I
@ I @ 64k 8k Bytes
@ I @ 128k 16k Bytes
I
@ I @
@ @
I @
@
@ : @
I @
@ I
J
@ I @
I @
@ I
@ @
2B @ I @
,.+.,
\8i \8i
@ I @
..
)(
::E @
I
I @
E
E @ I @
I
5 @ I @
I
-.L ~ @ ,;, @
I I
I
w
z
:3
Q.
"
Z
~
!II
FFFF FFFF
56k
Byles
External
64k
__ Or _ ByleS
Extemal
And
1FFF
Ok Bytes
Internal
0000 0000
Intemol FFFF
Indirect
Addressing Only
8OHto FFH
FF
I 64k
Bytea
External
SFRo
Direct_ng
Only
- - And---
80
7F
Direct and Indirect
Add......lng
00 0000
In the Capture Mode there are two options transition at external input T2EX will also Now, the baud rates in Modes 1 and 3 are
which are selected by bit EXEN2 in T2CON. trigger the 16-bit reload and set EXF2. The determined by limer 2's overflow rate as
If EXEN2 = 0, then limer 2 is a 16-bit timer or auto-reload mode is illustrated in Figure 5. follows:
counter which upon overflowing sets bit TF2,
The baud rate generation mode is selected
the limer 2 overflow bit, which can be used limer 2 Overflow Rate
by RCLK = 1 and/or TCLK = 1. It will be Modes 1, 3
to generate an interrupt. If EXEN2 = 1, then Baud Rate
described in conjunction with the serial port. 16
limer 2 still does the above, but with the
added feature that a 1-to-O transition at Serial Port The timer can be configured for either "timer"
external input T2EX causes the current value The serial port of the 8XC52 is identical to or ·counter" operation. In the most typical
in the limer 2 registers, TL2 and TH2, to be that of the 80C51 except that counter/timer 2 applications, it is configured for "timer"
captured into registers RCAP2L and can be used to generate baud rates. operation (C1T2 = 0). "limer" operation is a
RCAP2H, respectively. (RCAP2L and little different for limer 2 when it's being used
RCAP2H are new special function registers in In the 80C52, limer 2 is selected as the baud
as a baud rate generator. Normally, as a timer
the 8OC52.) In addition, the transition at rate generator by setting TCLK and/or RCLK
it would increment every machine cycle (thus
T2EX causes bit EXF2 in T2CON to be set, in T2CON (see Figure 3). Note that the baud at1/12the oscillator frequency). As a baud
and EXF2like TF2 can generate an interrupt. rate for transmit and receive can be rate generator, however, it increments every
The Capture Mode is illustrated in Figure 4. simultaneously different. Setting RCLK and/or state time (thus at 1/2 the oscillator
TCLK puts limer into its baud rate generator frequency). In that case the baud rate is
In the auto-reload mode, there are again two mode, as shown in Figure 6.
options, which are selected by bit EXEN2 in given by the formula:
T2CON. If EXEN2 = 0, then when limer 2 The baud rate generator mode is similar to
rolls over it not only sets TF2 but also causes the auto-reload mode, in that a rollover in Modes 1, 3 Oscillator Frequency
the limer 2 registers to be reloaded with the TH2 causes the limer 2 registers to be Baud Rate 32x[65536 - (RCAP2H, RCAP2L[
16-bit value in registers RCAP2L and reloaded with the 16-bit value in registers
RCAP2H and RCAP2L, which are preset by where (RCAP2H, RCAP2L) is the content of
RCAP2H, which are preset by software. If
software. RCAP2H and RCAP2L taken as a 16-bit
EXEN2 =1, then limer 2 still does the above,
unsigned integer.
but with the added feature that a 1-10-0
(MSB) (LSB)
TF2 T2CON.7 Timer 2 overflow ftag set by. Timer 2 overflow and must be cleared by
software. TF2 will not be set when either RCLK or TCLK = 1.
EXF2 T2CON.6 llmer 2 external flag _1 when either. capture or reload ia caused by •
negative transition on T2EX and EXEN2 = 1. When llmer 2 Interrupt i. enabled,
EXF2 = 1 will cause 100 CPU to vector to the nmer 2 interrupt routine. EXF2
must be cleared by software.
RCu( T2CON.5 Receive clock nag. When set, causes the aerial port to use Timer 2 overflow
pulses for tta receive clock in modes 1 and 3. RCLK = 0 causes TImer 1
overflow to be ueed for the receive clock.
TCLK T2CON.4 Transmit clock flag. When set. causes the aerial port to use 11mer 2 overflow
pulse. for ita 1r.,.mit clock In modes 1 and 3, TCLK =0 causes Timer 1
overflows to be used for the transmit clock.
EXEN2 T2CON.3 Timer 2 external enabte flag. When set, allows. capture or reload 10 occur 88 a
reault of a negative transition on T2EX If TImer 2 i. not being used to clock the
serial port EXEN2 = 0 causes Timer 2 to Ignore events at T2EX.
TR2 T2CON.2 Startlatop control for TImer 2. A logic 1 starts the timer.
cm T2CON.l Timer or counter select. (Timer 2)
0= Internal timer (OSC/12)
1 = External event counter (falling edge triggered).
CPiRl:2 T2CON.O CaptureiReload nag. When set, captures will occw on negative transitions at
T2EX if EXEN2 = 1. When cleared. auto....eloads will occur either With Timer 2
overflows or negative b'anaitiona at T2EX when EXEN2 = 1. When either RCLK
= 1 or TCLK = 1, thia bit Is ignored and the timer ia forced to auto-reload on
Timer 2 overflow.
cm.o
Tl2 TH2
________~t
("bits) (8.iJilo)
Cm.l
T2Pin Control
TR2 Capture
Timer 2
ln1errupl
Transition
Detector
T2EX Pin
Control
EXEN2
Tl2 TH2
(G-IliIO) (B-biIO)
TR2
Transition
Detector
limer2
Intenupt
T2EX Pin
Control
EXEN2
Timer 1
Overflow
____--'t em: = 1
T2 Pin - Control
TR2
Transition
Detector
~ limer 2
• r;;;l
~ Interrupt
EXEN2
87 86 8S 84 83 82 81 80
PO' PortO 80H AD7 I AD6 I AD5 I AD4 I AD3 I AD2 I ADl I ADO FFH
97 96 95 94 93 92 91 90
Pl' Port 1 90H - I - I - I -
I - I - I T2EX I T2 FFH
A7 A6 AS A4 A3 A2 Al AO
P2' Port 2 AOH A15 I A14 I A13 I A12 I All I Al0 I A9 I A8 FFH
B7 88 B5 B4 B3 B2 Bl BO
P3' Port 3 BOH RITIWRI Tl I TO I rnTI I fI\ITO I TxD I RxD FFH
PCON1 Power control 87H SMOD I - I - I - I GFl I GFO I PD I IDL OxxxxxxxB
D7 D6 D5 D4 D3 D2 Dl DO
PSW' Program status word DOH CY I AC I FO I RSl I RSO I ov I - I P OOH
RCAP2H# Capture high CBH OOH
RCAPL# Capture low CAH OOH
SBUF Serial data buffer 99H xxxxxxxxB
9F 9E 9D 9C 9B 9A 99 98
SCaN" Serial controller 98H SMO I SMl I SM2 J REN I T88 I R88 J TI I RI OOH
SP Stack pointer 81H 07H
8F 8E 8D 8C 8B 8A 89 88
TCON" Timer control 88H TFl I TRl I TFO l TRO I IEl I ITl I lEO I ITO OOH
CF CE CD CC CB CA C9 C8
T2CON"# Timer 2 control C8H TF2 I EXF2 I RCLK I TCLK I EXEN2 I TR2 I cm I CPfR[2" OOH
THO Timer high 0 8CH OOH
THl Timer high 1 8DH OOH
TH2# Timer high 2 CDH OOH
TLO Timer low 0 8AH OOH
TLl Timer low 1 8BH OOH
TL2# Timer low 2 CCH OOH
,
TMOD Timer mode 89H GATE J CIT IMl I
MO I
GATE I CIT I Ml I MO OOH
Bit addressable
# SFRs are modified from or added to the 80C5l SFRs.
1 Bits GF1, GFO, PD, and IDL of the PCON register are not implemented in the NMOS 8XCS2.
0 0 1 16-bit Auto-reload
0 1 1 16-bit Capture
1 X 1 Baud rate generator
X X 0 (off)
Timer 2 as a baud rate generator is shown in Using TlmerlCounter 2 to Generate Baud have to determine whether it was TF2 or
Figure 6. This figure is valid only if RCLK + Rates EXF2 that generated the interrupt, and the bit
TCLK ~ 1 in T2CON. Note that a rollover in For this purpose, Timer 2 must be used in the will have to be cleared in soffware.
TH2 does not set TF2, and will not generate baud rate generating mode. If Timer 2 is
All of the bits that generate interrupts can be
an interrupt. Therefore, the Timer 2 interrupt being clocked through pin T2 (P1.0) the baud
set or cleared by soffware, with the same
does not have to be disabled when Timer 2 is rate is:
result as though it has been set or cleared by
in the baud rate generator mode. Note too,
hardware. That is, interrupts can be
that if EXEN2 is set, a 1-10-0 transition in Timer 2 Overflow Rate
Baud Rate generated or pending interrupts can be
T2EX will set EXF2 but will not cause a
16 canceled in soffware.
reload from (RCAP2H, RCAP2L) to (TH2,
TL2). Thus when Timer 2 is in use as a baud And if it is being clocked internally, the baud The interrupt vector addresses and the
rate generator, T2EX can be used as an extra rate is: interrupt priority for requests in the same
external interrupt, if desired. priority level are given in the following:
It should be noted that when Timer 2 is Baud Oscillator Frequency Source Vector Priority Within
running (TR2 ~ 1) in "timer" function in the Rate 32x[65536 - (RCAP2H, RCA2PLll Address level
baud rate generator mode, one should not try 1. lEO 0003H (highest)
To obtain the reload value for RCAP2H and
to read or write TH2 or TL2. Under these 2. TFO OOOBH
RCA02L, the above equation can be rewritten
conditions the timer is being incremented 3. IE1 0013H
as:
every state time, and the results of a read or 4. TF1 001BH
write may not be accurate. The RCAP 5. RI+TI 0023H
registers may be read, but should not be RCAP2H, 65536 _ Oscillator Frequency 6. TF2 + EXF2 002BH (lowest)
RCAP2L 32 x Baud Rate
written to, because a write might overlap a
Note that they are identical to those in the
reload and cause write anellor reload errors.
Interrupts 8OC51 except for the addition of the Timer 2
Turn the timer off (clear TR2) before
The SOC52 has 6 interrupt sources as shown (TF1 and EXF2) interrupt at 002BH and at
accessing the Timer 2 or RCAP registers, in
in Figure 9. All except TF2 and EXF2 are the lowest priority within a level.
this case.
identical sources to those in the 8OC51.
The serial port in Modes 1 and 3 with the Pori Structures
The Interrupt Enable Register and the The port structures are identical in both parts,
timer 2 baud rate interface is shown in
Interrupt Priority Register are modified to except that on the BXC52, ports P1.0 and
Figures 7 and S.
include the additional SOC52 interrupt P 1.1 include the Timer 2 alternate functions
TlmerlCounter 2 Set-up sources. The operation of these registers is as follows:
Except for the baud rate generator mode, the identical to the SOC51. The registers are
detailed in Figures 10, 11, and 12. P 1.0 . T2 (TImerlcounter 2 external input)
values given for T2CON do not include the
setting of the TR2 bit. Therefore, bit TR2 In the BOC52, the Timer 2 Interrupt is P1.1 T2EX (TImerlcounter 2 capturel
must be set, separately, to turn the timer on. reload trigger)
generated by the log ical OR of TF2 and
See Table 3 for set-up of timer 2 as a timer. EXF2. Neither of these flags is cleared by As with the SOC51 , these alternate functions
See Table 4 for set-up of timer 2 as a counter. hardware when the service routine is can only be activated if the corresponding bit
vectored to. In fact, the service routine may latch in the port SFR contains a 1.
nmer1 nmer2
OwrIIow O\llelflow
TxD
RXClock R1 Load
SBUF
RX Control Shift 1---,
n Write to SBUF
Data
Trlrlsmit
Shift o
TxD Stop Bit
of. 16 Reset
}-
RxD
Bit Detector Sample limes
Shift
RI
Timer 1 limer2
Overflow Overflow
Sample
Wri1e to SBUF
Data
Transmit
Shift o
TxD DO 01 Stop Bit
n
Stop Bit Generator
~ 16 Reset
RxD
StopBit }
Bit Detector SM'Ip&e Times Receive
Shift
III
nu --------------------_
Interrupt
Sources
TFl
~ D>--------------""·~
TF2~
a~~>--------------~·~
I-igh Priority
IP Register
r--...J.--------, Interrupt
()---()"(,o--I----+~
I a-~----~
I
I Interrupt
Polling
o-ofO--+----+-<l- Sequence
I o---~---+~
I
~o--t-------t----<l-
I o---~---+~
I
I
TFI Jo---I------'I----O
I
I
I
At
TI
040---1-------11----0
I
I
TF2
EXF2
0-40---1-------11----0
L-~r---------t---r___1
Individual
Low Priority
Global Interrupt
Enables Disable
ETI EXI I I
ETO EXO
I I X X PT2 PS PTI PXI I IPTO PXD
ET2 1E.5 Enables or disables the limer 2 Overflow or PS IP.4 Defines the Serial Port interrupt priority level.
capture IntenupLlf ET2 := D, the Timer 2 PS = 1 programs it to the higher priority level.
Interrupt is di ••bled.
PTI IP.3 Defines thenmer 1 interrupt priority level. PT1 =
ES 1E.4 Enables or disables the Serial Port interrupt If 1 programs it to the higher priority level.
E5 = D. the Serial Port Interrupt is disabled.
PXI IP.2 Defines the Extemallnterrupt 1 priority level.
ETI IE.3 Enables or disables the limer 1 Overflow =
PX1 1 programs It to the higher priority level.
inwrrupLlf Elt = 0, the Timer 1 interrupt is
di..bIed.
PTD IP.I Enables or disables the Timer 0 Interrupt
EXI 1E.2 Enables or disables ExternallnterrupL 1.lf EXt priority level. PTO = 1 programs It to the higher
= D, Enemallnterrupt 1 is disabled. priority level.
ETD lE.I Enables or disables the Timer 0 Overflow PXD IP.D Defines the Extemallnterrupt 0 priority level.
intemJpl..lf ETa = D. the TmerO interrupt I. PXO = 1 programs it to the higher priority level.
diaabled.
Figure 11. 8OC52 Interrupt Enable (IE) Register Figure 12. 80C52 Interrupt Priority (IP) Register
The 8032AH18052AH contains 256 bytes of • Programmable full-duplex serial channel PO.6/ADS
readlwrite data memory, 32 I/O lines
- Variable transmiVreceive baud rate PO.7/AD7
configured as four 8-bit ports, three IS-bit
capability
counterltimers, a six-source, two-priority-Ievel
nested interrupt structure, a programmable • TImer 2 capture capability
serial I/O port and on-chip oscillator and
clock circuitry. The 8052AH has all of these • External memory
features plus 8k bytes of non-volatile - 64k ROM and 64k RAM P2.7/AIS
read-only program memory. Both • Boolean processor P2.6/AI4
microcontrollers have memory expansion
P2.5/AI3
capabilities of up to 64k bytes of data storage • 128 user bit-addressable locations
and 64k bytes of program memory that can P2.41AI2
• Upward compatible with 8031 AH/8051 AH
be attained with standard TTL compatible P2.31AI1
memories.
XTAL2 P2.21Al0
Because of its extensive BCDlbinary
XTALI P2.1/A9
arithmetic and bit-handling facilities, the
8032AH/8052AH microcontroller is efficient at vss P2.O/Aa
both computational and control-oriented
tasks. Efficient use of program memory is
also achieved by using the familiar compact
instruction setofthe8031AHl8051AH.
Forty-four percent of the instructions are 6 1 40
one-byte, 41% two-byte, and 15% three-byte
instructions. With a 12MHz crystal, the
majority of the instructions execute in just
1.0118. The longest instructions, multiply and
divide, require only 4118 at 12MHz. 17 '[J 18
LCC
28
29
LOGIC SYMBOL
~
a:_
EJADDRESS
DATA BUSAND
~-
-
-...
~~:=~
I[~~~ _L__I....----,~~~t-~
~ RD_, -iJ
BLOCK DIAGRAM
PO.~.7 P2.0-P2.7
I
r---------------
~~~ ~~~~
----------------1,
I
I
~
,
D
"=",
I
,
I
I
,
I
,
I
I
I
I
,
I
SCON TMOD TCON
I TIll TLD THI
I TL1 TH2 T1.2 RCAP2H
I RCAP2 SBUF IE IP
I
I P~~Yf~~'t"JE~E:~~KS
I
I
I
I
PSER
ALE
n
RST
I
I
I
,
I
I
LXT~L1 __ _ XTA1.2 _ _ _ _ _ _ _ _ _ _ _ --1
------+f-H+·I+I
Pl.D-P1.7 P3.0-P3.7
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC TYPE NAME AND FUNCTION
DC ELECTRICAL CHARACTERISTICS
Tarril = O°C to +70°C or -40°C to +85°C Vee - 5V +10%
- Vss = OV4, 5
TEST LIMITS
VIH1 Input high voltage to RST for reset, XTAL2 XTAl1 to Vss 2.5 Vee+0.5 V
VOLl Output low voltage; port 0, ALE, PSEi(6 IOL = 3.2mA 0.45 V
VOH Output high voltage; ports 1, 2, 3 10H =-80uA 2.4 V
VOH1 Output high voltage; port 0 in external bus mode, ALE, 10H =-400uA 2.4 V
l'SEffl
IlL Logical 0 input current; ports 1, 2, 3 VIN=0.45V -800 uA
IIH1 Input high current to RST for reset VIN = Vee -1.5V SOO uA
III Input leakage current; port 0, EA 0.45 < VIN < Vee ±10 uA
1112 Logical 0 input current for XTAL2 XTAl1 = Vss , VIN = 0.45V --3.2 mA
VIH1 Input high voltage to RST for reset, XTAL2 XTAl1 to Vss 2.7 V
1112 Logical 0 input current lor XTAL2 XTAl1 = Vss. Yin = 0.45V --3.5 mA
NOTES.
1. Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the device. This is a stress rating only and
functional operation of the device at these or any conditions other than those described in the AC and DC Electrical Characteristics section
of this specification is not implied.
2. For operating at elevated temperatures, the device must be derated based on + 150°C maximum junction temperature.
3. This product includes circuitry specifically designed for the protection of its internal devices from the damaging effects of excessive static
charge. Nonetheless, it is suggested that conventional precautions be taken to avoid applying greater than the rated maxima.
4. Parameters are valid over operating temperature range unless otherwise specified. All voltages are with respect to Vss unless otherwise
noted.
5. All voltage measurements are referenced to ground. For testing, all input signals swing between 0.45V and 2.4V with a transition time of
20ns maximum. All time measurements are referenced at input voltages of O.BV and 2.0V and at output voltages of 0.8V and 2.0Vas
appropriate.
6. VOL is derated when the device rapidly discharges external capacitance. This AC noise is most pronounced during emission of address data.
When using external memory, locate the latch or buffer as close as possible to the device.
Emitting Degraded
Datum Ports I/O Lines VOL (Peak Max)
Address P2, PO Pl, P3 0.8V
Write Data PO Pl, p3, ALE O.BV
7. CL = 1OOpF for port 0, ALE and PSElir outputs: CL = BOpF for all other ports.
AC ELECTRICAL CHARACTERISTICS
= O°C to +70°C or -40°C to +85°C, Vcc = 5V ±10%, Vss = OV1.2
Tarrb
12MHzCLOCK VARIABLE CLOCK
ALE
PORTO AO-A7
PORT 2 A8-A15
ALE
tWHLH
~-------tuDv--------~·1
tUWL - -.....'------tRLRH -------+I
~-------------+--------~
tRLDV-
PORTO INSTRIN
ALE '\ V
~IWHLH-
-ILLWL IWLWH
WR
'\
----
ILLAX
IAVLL lovwx -00 +- IWHOX
IOVWH
~ )(
PORTO AO-A7
FROM Rt OR DPL >< DATA OUT AO-A7 FROM PCl INSTRIN
-IAVWL~
PORT 2
)< P2.0-P2.7 OR A8-A.S FROM DPH Aa-A15 FROM PCH
INSTRUC110N
ALE
CLOCK
taVXH H r-
OUTPUT DATA _ _ _ _ _~-------...
IXHOX I
't'
RtTETO SBUF
I I ....11- tXHDX
INPUT DATA
IXHDV r-----1 I SET 11
'---t
CLEAR Rt
t
SETRI
FLOAT ----~~I
2.
O.4SV
4V
=X 2.0V
O.8V
....;;.:.;..:.-.-----
>C 2.4V
O.4SV - - -......,
2.0V
O.8V
2.0V
O.8V
j r o - - - 2.4V
,'----O.45V
NOTE: NOTE:
AC Inputs during testing are driven at 2.4V lor a logic '1' and 0,45V for a logic 'a', For timing purposes, the float state is defined as the point al which a PO pin
lirring measurements are made at 2.0V min for a logic '1' and O.BV for a logic '0', sinks 2:4mA or sources 400JLA, at the voltage test levels.
XTAL1 P2.lIA9
PART NUMBER SELECTION P2.01AB
ROMless ROM EPROM TEMPERATURE °C FREQ.
AND PACKAGE (MHz)
P80C32EBP N P80C52EBP N P87C52EBP N o to +70, plastic DIP 16
P80C32EBA A P80C52EBA A P87C52EBA A o to +70, plastic LCC 16 40
n h
0
~
44 34
7[ P39 33
Lee
17[ P29 11 23
';; '2j
12 22
LOGIC SYMBOL
Vcc Vss
-g~~::~ADDRESSAND
a._
_
--
-~rT2
~_ DATA BUS
~~ =
~i~.-~'~
BLOCK DIAGRAM
PO~.7 P2.0-P2.7
I
r--------------- rU~~
I
I
~
I
D
=,,
,
I
I
I
I
I
I
I
I
,I
I
I
I
L~L1 __ _ XTAL2
------------'
P1.~1.7 ~7
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC QFP TYPE NAME AND FUNCTION
Vss 20 22 16 I Ground: OV reference.
Vee 40 44 38 I Power Supply: This is the power supply voltage for normal, idle, and power-down
operation.
PO.()...{).7 39-32 43-36 37-30 I/O Port 0: Port 0 is an open-drain, bidirectional I/O port. Port 0 pins that have 1s written to
them float and can be used as high-impedance inputs. Port 0 is also the multiplexed
low-order address and data bus during accesses to external program and data memory. In
this application, it uses strong internal pull-ups when emitting 1s. Port 0 also outputs the
code bytes during program verification in the 87C52. External pull-ups are required during
program verification.
Pl.O-Pl.7 1-8 2-9 40-44 I/O Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. Port 1 pins that have 1s
1-3 written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 1 pins that are externally pulled low will source current because of the internal pull-ups.
(See DC Electrical Characteristics: IILl. Pins Pl.0 and Pl.l also. Port 1 also receives the
low-order address byte during program memory verification. Port 1 also serves alternate
functions for timer 2:
1 2 40 I T2 (Pl.0): Timer/counter 2 external count input.
2 3 41 I T2EX (Pl.1): Timer/counter 2 trigger input.
P2.O-P2.7 21-28 24-31 18-25 110 Port 2: Port 2 is an 8-bit bidirectional 1/0 port with internal pUll-Ups. Port 2 pins that have 1s
written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 2 pins that are externally being pulled low will source current because of the internal
pUll-Ups. (See DC Electrical Characteristics: IlL). Port 2 emits the high-order address byte
during fetches from external program memory and during accesses to external data
memory'that use IS-bit addresses (MOVX@DPTR). In this application, it uses strong
internal pull-ups when emitting 1s. During accesses to external data memory that use a-bit
addresses (MOV @Ri), port 2 emits the contents of the P2 special function register.
P3.O-P3.7 10-17 II, 5, 1/0 Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins that have 1s
13-19 7-13 written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 3 pins that are externally being pulled low will source current because of the pull-ups.
(See DC Electrical Characteristics: IILl. Port 3 also serves the special features of the BOC51
family, as listed below:
10 11 5 I RxD (P3.0): Serial input port
11 13 7 0 TxD (P3.1): Serial output port
12 14 8 I INTG (P3.2): External interrupt
13 15 9 I INTi (P3.3): External interrupt
14 16 10 I TO (P3.4): Timer 0 external input
15 17 11 I 11 (P3.S): Timer 1 external input
16 18 12 0 WR (P3.6): External data memory write strobe
17 19 13 0 Jm (P3.7): External data memory read strobe
RST 9 10 4 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the
device. An internal diffused resistor to Vss permits a power-on reset using only an external
capacitorto Vee.
ALEIPROG 30 33 27 I/O Address Latch EnablelProgram Pulse: Output pulse for latching the low byte of the
address during an access to external memory. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency, and can be used for external timing or clocking.
Note that one ALE pulse is skipped during each access to external data memory. This pin is
also the program pulse input (PROO) during EPROM programming.
'PS'EN 29 32 26 0 Program Store Enable: The read strobe to external program memory. When the device is
executing code from the external program memory, 'PS'EN is activated twice each machine
cycle, except that two 'PS'EN activations are skipped during each access to external data
memory. 'PS'EN is not activated during fetches from internal program memory.
EAlVpp 31 35 29 I External Access Enable/Programming Supply Voltage: ~ must be externally held low
to enable the device to fetch code from external program memory locations OOOOH to
lFFFH. If~is held high, the device executes from internal program memory unless the
program counter contains an address greater than 1FFFH. This pin also receives the
12.75V programming supply voltage (V pp) during EPROM programming.
XTAL1 19 21 15 I Crystal 1 : Input to the inverting oscillator amplifier and input to the internal clock generator
circuits.
XTAL2 18 20 14 0 Crystal 2: Output from the inverting oscillator amplifier.
OSCILLATOR RST pin must be high long enough to allow POWER-DOWN MODE
the oscillator time to start up (normally a few In the power-down mode, the oscillator is
CHARACTERISTICS
milliseconds) plus two machine cycles. At stopped and the instruction to invoke
XTAL 1 and XTAL2 are the input and output,
power-up, the voltage on Vee and RST must power-down is the last instruction executed.
respectively, of an inverting amplifier. The
come up at the same time for a proper Only the contents of the on-chip RAM are
pins can be configured for use as an on-chip
start-up. preserved. A hardware reset is the only way
oscillator, as shown in the Logic Symbol,
page 216. to terminate the power-down mode. the
control bits for the reduced power modes are
To drive the device from an external clock IDLE MODE in the special function register PCON.
source, XTAL1 should be driven while XTAL2 In idle mode, the CPU puts itself to sleep
is left unconnected. There are no while all of the on-chip peripherals stay
requirements on the duty cycle of the external active. The instruction to invoke the idle DESIGN CONSIDERATIONS
clock signal, because the input to the inlernal mode is the last instruction executed in the At power-on, the voltage on Vee and RST
clock circuitry is through a divide-by-two normal operating mode before the idle mode must come up at the same time for a proper
flip-flop. However, minimum and maximum is activated. The CPU contents, the on-chip start-up.
high and low times specified in the data sheet RAM, and all of the special function registers
must be observed. remain intact during this mode. The idle mode Table 1 shows the state of I/O ports during
can be terminated either by any enabled low current operating modes.
interrupt (at which time the process is picked
RESET up at the interrupt service routine and
A reset is accomplished by holding the RST continued), or by a hardware reset which
pin high for at least two machine cycles (24 starts the processor in the same manner as a
oscillator periods), while the oscillator is power-on reset.
running. To insure a good power-up reset, the
Security Bit 1: When programmed, this bit has two effects on masked ROM parts:
1. External MOVC is disabled, and
2. EA# is latched on Reset.
Security Bit 2: When programmed, this bit inhibits Verify User ROM.
Electrical Deviations from Commercial Specifications for Extended Temperature Range (87C52)
DC and AC parameters nol included here are the same as in the commercia' temperature range table.
DC ELECTRICAL CHARACTERISTICS
Ta mb -- -40°C to +85°C Vee - 5V ±10% V55 - OV
TEST UM'TS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
DC ELECTRICAL CHARACTERISTICS
Tarrt>=ODC to +70DC or-40 DC to +8SDC, vcc = SV±10%, Vss = ov (87CS2)
Tarrt> = ODC to +70 DC or -40 DC to +8S DC Vcc = SV -+20% Vss = ov (80C32180CS2)
TEST LIMITS
SYMBOL PARAMETER CONDITIONS MIN TYpl MAX UNIT
VIL Input low voltage, except ~ ~.S 0.2V~.1 V
VILl Input low voltage to ~ a 0.2V~.3 V
VIH Input high voltage, except XTAL 1, RS"(1 0. 2Vcc+0.9 Vcc+O·S V
VIHl Input high voltage, XTAL1, RST7 0.7Vcc Vcc+O.S V
VOL Output low voltage, ports 1, 2, 39 IOL= 1.6mA2 0.45 V
VOLl Output low voltage, port 0, ALE, PSEI'J9 IOL= 3.2mA2 0.4S V
VOH Output high voltage, ports 1,2,3, ALE, J'SEN3 IOH = -GOllA, 2.4 V
IOH = -2SIlA 0.7SVcc V
IOH = -101lA 0.9Vcc V
VOHl Output high voltage (port 0 in external bus mode) IOH = --800IlA, 2.4 V
IOH = -3001lA 0.7SVcc V
IOH = -BOllA 0.9Vcc V
IlL Logical a input curren~ ports 1, 2, 37 VIN =0.4SV -50 IlA
In Logical l-to-O transition current, ports 1, 2, 37 See note 4 --850 IlA
III Input leakage current, port a VIN = VIL or VIH ±10 IlA
Icc Power supply current:1 See note 6
Active mode @ 12MHz5 11.S 19 rnA
Idle mode @ 12MHz 1.3 4 rnA
Power-down mode 3 50 IlA
RRST Internal reset pull-down resistor 50 300 kohm
CIO Pin capacitance 10 pF
NOTES.
1. Typical ratings are not guaranteed. The values listed are at room temperature, SV.
2. Capacitive loading on ports a and 2 may cause spurious noise to be superimposed on the VOLs of ALE and ports 1 and 3. The noise is due
to external bus capacitance discharging into the port 0 and port 2 pins when these pins make l-to-O transitions during bus operations. In the
worst cases (capacitive loading> l00pF), the noise pulse on the ALE pin may exceed 0.8V. In such cases, it may be desirable to qualify ALE
with a Schmitt Trigger, or use an address latch with a Schmitt Trigger STROBE input. IOL can exceed these conditions provided that no
single output sinks more than SmA and no more than two outputs exceed the test conditions.
3. Capacitive loading on ports a and 2 may cause the VOH on ALE and I'SEJil to momentarily fall below the 0.9Vcc specification when the
address bits are stabilizing.
4. Pins of ports 1, 2 and 3 source a transition current when they are being externally driven from 1 to O. The transition current reaches its
maximum value when VIN is approximately 2V.
S. IccMAX at other frequencies is given by: Active mode: IccMAX = 1.43 X FREO + 1.9: Idle mode: IccMAX = 0.14 X FREO +2.31,
where FREO is the external oscillator frequency in MHz. IccMAX is given in rnA. See Figure 8.
6. See Figures 9 through 12 for Icc test conditions.
7. These values apply only to Tarrt> = ODC to +70 DC. For Tarro = -40 DC to +8SDC, see table on previous page.
8. load capacitance for port 0, ALE, and !'SEN = 100pF, load capacitance for all other outputs = 80pF.
9. Under steady state (non-transient) conditions, IOL must be externally limited as follows:
Maximum IOL per port pin: lSmA (ONOTE: This is 8S"C speCification.)
Maximum IOL per 8-bit port: 26mA
Maximum totailOL for all outputs: 67mA
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed
test conditions.
AC ELECTRICAL CHARACTERISTICS
Tarrb =O"C to +70"C or--40"C to +85"C Vee =5V +10%
- Vss =OV (87C52)" 2, 3
ALE
PORTO AD-A7
PORT 2 AB-At5
ALE
" /
~tWHLH-
I->--tLLWL
tLLDV
-,
tRLRH
RD
" /
PORTO
~
tAVLL
Ao-A7
FROM R1 OR DPL
;:-. i--tRLDV-
tRLAZ tRHDX -
DATA IN
~
"""
IRHDZ
~tAVWL-
'I ///
"
tAVDV
PORT 2
)< P2.D-P2.7 OR AB-At5 FROM DPF Ao-At5 FROM PCH
ALE
tWHLH -
WR -------+----.. . . . 1
Iovwx
PORTO
DATA OUT AO-A7 FROM PCL INSTRIN
PORT 2
P2.0-P2.7 OR A8-A15 FROM DPF AO-A 15 FROM PCH
INSTRUCTION 4
ALE
~tXLXL --1
CLOCK
-------,
. , tavxH H
OUTPUT DATA _ _ _ _- . , - -_ _ _"""\.
'
r- ItXHax
WRITE TO SBUF
INPUT DATA
'---f
CLEAR RI
t
SETRI
VCc-O·5
D.7Vcc
O.45V D.2VSS-4.1
tcLCL
Vcc-4.5
o.45V
=x D.2VCC..o·9
._D.;;;;2;;.;V..:cc-O;::...;.;..1'--_ _ __
>C lllaNG
REFERENCE
POINlS VOI...o.1V
NOTE: NOTE:
At; irl>uts during testing are driven at Vee -0.5 for a Iogic"l" and O.45V for a logic '0'. For timing purposes, a port is no longer floating when a l00mV change from load
lImng measurements are made at VIH min lor a logic '1' and Vil for a iogic'Q'. voltage occurs. and begins to float when a fOOmV changofromtheloadod VoH'
VOL level cccurs.IOH/IoL>.±.20mA.
fCCmA 15 I---I---+~-+--:~--l
Vee
RST
CLOCK SIGNAL
Vss Vss
Figure 9. lee Test Condition, Active Mode Figure 10. lee Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
VCc;-O.5 - - - -'-O.7Y-ee""'"
O.45V o.2VCc;-O.l "---"
teLCL
Figure 11. Clock Signal Waveform for Icc Tests In Active and Idle Modes
teLcH = teHCL = Sns
Vcc
RST
PO
- Ell'
(NC) XTAL2
XTALI -
vss
EPROM CHARACTERISTICS To program the encryption table, repeat the Reading the Signature Bytes
The 87C52 is programmed by using a 25 pulse programming sequence for The signature bytes are read by the same
modified Quick-Pulse ProgrammingT" addresses 0 through 1FH, using the 'Pgm procedure as a normal verification of
algorithm. It differs from older methods in the Encryption Table' levels. Do not forget that locations 030H and 031 H, except that P3.6
value used for Vpp (programming supply after the encryption table is programmed, and P3.7 need to be pulled to a logic low. The
voltage) and in the width and number of the verification cycles will produce only encrypted values are:
ALEiPfIDG pulses. data. (030H) = 15H indicates manufactured by
Philips
The 87C52 contains two signature bytes that To program the security bits, repeat the 25
(031 H) = 97H indicates 87C52
can be read and used by an EPROM pulse programming sequence using the 'Pgm
programming system to identify the device. Security Bit' levels. After one security bit is ProgramNerify Algorithms
The signature bytes identify the device as an programmed, further programming of the Any algorithm in agreement with the
87C52 manufactured by Philips. code memory and encryption table is conditions listed in Table 2, and which
disabled. However, the other security bit can satisfies the timing specifications, is suitable.
Table 2 shows the logic levels for reading the still be programmed.
signature byte, and for programming the
program memory, the encryption table, and Note that the FANpp pin must not be allowed Erasure Characteristics
to go above the maximum specified Vpp level Erasure of the EPROM begins to occur when
the secuity bits. The circuit configuration and
for any amount of time. Even a narrow glitch the chip is exposed to light with wavelengths
waveforms for quick-pulse programming are
above that voltage can cause permanent shorter than approximately 4,000 angstroms.
shown in Figures 13 and 14. Figure 15 shows
damage to the device. The Vpp source Since sunlight and fluorescent lighting have
the circuit configuration for normal program
should be well regulated and free of glitches wavelengths in this range, exposure to these
memory verification.
and overshoot. light sources over an extended time (about 1
Quick-Pulse Programming week in sunlight, or 3 years in room level
The setup for microcontroller quick-pulse Program Verification fluorescent lighting) could cause inadvertent
programming is shown in Figure 13. Note that If security bit 2 has not been programmed, erasure. For this and secondary effects, It
the 87C52 is running with a 4 to 6MHz the on-chip program memory can be read out is recommended that an opaque label be
oscillator. The reason the oscillator needs to for program verification. The address of the placed over the window. For elevated
be running is that the device is executing program memory locations to be read is temperature or environments where solvents
internal address and program data transfers. applied to ports 1 and 2 as shown in are being used, apply Kapton tape Fluorglas
Figure 15. The other pins are held at the part number 2345-5, or equivalent.
The address of the EPROM location to be 'Verify Code Data' levels indicated in Table 2.
programmed is applied to ports 1 and 2, as The recommended erasure procedure is
The contents of the address location will be exposure to ultraviolet light (at 2537
shown in Figure 13. The code byte to be emitted on port o. External pull-ups are
programmed into that location is applied to angstroms) to an integrated dose of at least
required on port 0 for this operation. 15W-s/cm2. Exposing the EPROM to an
port O. RST, PSEN and pins of ports 2 and 3
specified in Table 2 are held at the 'Program If the encryption table has been programmed, ultraviolet lamp of 12,000l1W/cm2 rating for
Code Data' levels indicated in Table 2. The the data presented at port 0 will be the 20 to 39 minutes, at a distance of about 1
ALEiPROO is pulsed low 25 times as shown exclusive NOR of the program byte with one inch, should be sufficient.
in Figure 14. of the encryption bytes. The user will have to Erasure leaves the array in an all 1s state.
know the encryption table contents in order to
correctly decode the verification data. The
encryption table itself cannot be read out.
Vee
P1 PO PGMDATA
1'2.& o
XTAU 1'2.D-P2.4 A&-A12
Vss
c:
,1 10""IIN -+II 1ooI0>------1o""±101-----.l·1
~----~0~1__~__________~rl~ ______________~rl~___
Figure 14. PROG Waveform
_7 P1
Vcc
PO PGMDATA
AST EXlVpp
P3.6 :ALEIPROG
P3.7 87CS2 PSER o
XTAL2 1'2.7 o 'EIIQ'[E
'1'2.& o
XTAL1 P2.O-P2.4 All-A12
Vss
-
Rgure 15. Program Verlflcallon
PROGRAMf.lNG* VERIACATlON'
P1.O-Pl.7 ADDRESS ADDRESS '-
-
P2.O-P2.4
/
f4- tAVQV
ALEII'IRlC
IDVGL
tAVGL - - ---
-- I- 'aHDX
'aHAX
r'\~ h
IaLGH ....
ISHGL ...... ~ ... .- IaHGL
IaHSL
~
/
/ LOGIC 1 LOGIC.
LOGIC 0
------------ ----------------------------- ----------- ------------
IEHSH IEHQZ
IELQt:
8XC053/54 OVERVIEW The basic features of the 8XC053154 are: microcontroller would perform the following
The 8XC053/54 is an 8OC51 derivalive • 80C51 based architecture functions:
microcontroller thai is designed 10 control and • Interface with the Remote control and
display text information on raster scanned • 192 bytes of on-chip RAM
keypad, receive and carry out the user's
video displays, such as televisions and video • OSD functional block (described in detail commands.
monitors. later) • Perform the OSD function to display all
The part consists of: - Inputs to the OSD are: available control options and settings of
• An 8OC51 microcontrollercore Horizontal Sync (HSYNC), Vertical Sync user.-controllable functions such as channel
(VSYNC), and a Dot, or Pixel, clock from selection, brightness, volume, hue, tint,
• An On-Screen Display (OSD) function an external oscillator (locked to HSYNC). frequency settings (for mUlti-sync
block monitors), etc.
- Outputs from the OSD are:
• Pulse-Width Modulators and an Three digital video outputs (RGB), a • Generate, via the on-chip PWMs; control
Analog-to-Digital converter Video Multiplexing .signal to select voltages for the user-controllable functions
• High voltage (12V) and LED drive outputs between 8XC053/54 and base video and to execute user commands.
(lOrnA) a Foreground/Background output to
• Perform test and diagnostic functions.
control overlay background.
The part is available with either 8k (83C053) For a standard NTSC TV signal with an
• A Character Generator Memory with 60
or 16k (83C054) bytes of ROM Program HSYNC frequency of 15,750kHz and a
character bit-maps, each 18 (vertical) x 14
Memory, or with 16k bytes of EPROM VSYNC of nominally 60Hz, there are roughly
(horizontal).
Program Memory. The parts are functionally 50 microseconds of active horizontal scan
identical except for the Program Memory .128 x 10 Display RAM. This memory is line available. The maximum pixel clock
differences and are collectively referred to as written into by the 80C51 CPU and read by frequency is 8MHz, and therefore roughly 400
the 8XC053/54. the OSD to fetch the pixel data to display pixels of resolution can be obtained .. At 14
from the Character Generator Memory. dots per character, this means 28 character
The EPROM version, the 87C054, is used for
product development and for initial and lower • Eight 6-bit Pulse Width Modulators (PWM) times per horizontal scan. "the 12 dot per
volume production quantities. Note that, and one 14-bit high-precision PWM. character display mode is used, that means
owing to requirements for 1/0 pins, the parts 33 character times per horizontal scan.
• 4-bit D/A converter and comparator with a Allowing for edge effects, 26 characters (14
are not designed to execute programs from
3-input multiplexer allowing implementation across) or 31 characters (12 across) can be
external memory.
. of an AID in software. displayed.
The parts are available in a 42-pin Plastic
• Four high-current (10mA) open drain Note that VGA rates and higher can be used.
Shrink Dual In-Line package as ROM
outputs. The minimum character dot size will be a
(83C053 and 83C054) and
One-Time-Programmable versions (87C054). • Twelve high voltage (+ 12V) open drain function of the VGA frequency used. For a
outputs. 640 x 480 display, running at 33kHz, the
Development systems and EPROM equivalent 8XC053/54 pixel resolution is
Programmers for the product are available A typical application of the 8XC053154 would about 160 across (because of the 8MHz
from several sources (see section on be as the central microcohtroller in a clock and allOWing for overscan). This means
Development Systems and EPROM television set of video monitor. The that status and diagnostic information can be
Programmers). displayed on video monitors.
-
character and display control functions
RGB
(4-bits). Timing for the OSO is controlled by DIGITAL
the HSYNC, VSYNC, and dot clock inputs. VIDEO OUT
CHARACTER CHARACTER
The 8XC053154 features an advanced OSO GENERATOR
ADDRESS ~ GENERATOR
function with some unique features: LOGIC 6OX18X14
1. User-definable display format: The OSO
does not restrict the user to a fixed
number of lines with a fixed number of
characters per line as other'competing Figure 1. On-Screen Display (OSO) Block
alternatives do.
Using a fixed number of lines restricts the
generation of displays that can be 3. 'Colors selectable by character: 6. Short Rows: This mode only displays 4
differentiated from others that use the Characters can be displayed on a horizontal lines. it is used for generating
same chip and places limits on screen background of the base video or a underlines.
content programmable background color. The
7. Programmable polarities: Inputs to the
background color is selectable by word
Using a fixed number of characters per OSO can be programmed to be
and the choice of background (base
line wastes display RAM if a line has less recognized as Active-LOW or
video/user programmed color) by
than the full number of displayable Active-HIGH, al,so the outputs from the
character.
characters (it has to be padded with OSD. Coupled with the 12V outputs, this
non-visible characters). 4. Programmable character size: Normal allows direct interfacing to most video
characters are displayed as 18 x 14 signal processing circuits.
The OSD on the 8XC053/54 defines a bit-maps. In an interlaced display, 2 fields
control character (New Une) that has the 8. Programmable horizontal and vertical
are displayed so that one actually sees a
same function as a Carriage Return and positions: A pair of registers allow defining
36 x 14 pixel size character. The part has
Line Feed. When the OSO circuitry the starting point of the display.
a double height and width mode which
fetches this character from display RAM it displays 36 x 28 pixel size bit maps per 9. HSYNC locked dot-clock oscillator: The
stops displaying further characters, waits field. For use in non-interlaced systems, chip is designed to use an L-C oscillator
for the next horizontal scan line, and the part has a double height mode so that circuit that is started at the trailing edge of
starts displaying the next character in the displayed characters have the same HSYNC and stopped at its leading edge.
display RAM after the New Line character pixel size (36 x 14) as on an interlaced In practice, this gives a highly consistent
was received. The number of lines is thus display. delay from HSYNC to oscillator start and
up to the user, within the limits of the is stable from scan line to scan line so
display and memory, as are the number of 5. Character shadowing: When characters,
that no left margin effects are seen.
characters per line. This allows far better are displayed overlaid on a background of
control of the appearance of the On base video, a black border around the 10. Character Generator memory in EPROM:
Screen Display. characters makes them highly legible. On the 87C054, the Character Generator ,
This feature is called shadowing. The memory is in EPROM. This feature allows
2. Dual-Ported Display RAM: The OSD has 8XC053154 has 8 shadowing modes to quick and inexpensive font development
a true display RAM instead of a character allow the user to select various partial and refinement against the alternative of
line buffer. This display RAM is dual shadow modes as well as full surround doing a masked ROM version to see how
ported to allow updating the display RAM shadow. the final fonts will appear.
at any time instead of having to wait for a
vertical retrace. Vertical Sync interrupts
are supported if flicker-free updates are
required.
Differences from the 80C51 OSDT: Contains the 8-bit address of the The ten SFRs that control the PWMs contain
character in the 60 x lB x 14 values and enable bits for the 8 6-bit PWMs
Memory Organization Character Generator bit-map (PWMO--PWM7) and values and enable bits
The BXCOS3IS4 differs from the BOCSI in that memory. for the 14-bit PWM (TDACL and TDACH).
it has either Bk or 16k or on-chip program .
memory, and it is not externally expandable. Writing into OSDT causes the The DIA function is controlled by the SAD
The size of the on-chip data RAM also differs contents of OSDT to .be register which allows a successive
in that it is 192 bytes. concatenated with the contents of approximations AID function to be performed
OSAT to form a 10-bit word that is in software.
The display RAM, where the contents of the then written into the 128 x 10
screen to be displayed are wrtten by the display RAM at the address pointed Reduced Power Modes
BOCS1 CPU, and read out and displayed by at by OSAD. OSAD is There is no Idle Mode in the 8XC053154.
the OSD, is 128 deep by 10 bits wide. The 10 auto-incremented after the write. Power Down is supported, but because oi'a
bits are composed of 6 address bits and 4 Thus, for a series of sequential resistor ladder in the AID, the power.oown
attributs bits; the 6 address bits form the writes, the CPU does not need to current is only reduced to SmA (over Vee
address of the character in the 60 x 1B x 14 increment OSAD. If the attribute from 2 tli 6V).
bit-map Character Generator memory, the 4 values do not change, this can be Interrupts
bits are used to control the attributes of that left unchanged too. To enable flick-free updating of the display, a
character and of the display.
OSCON: Contains the \tSYNC interrupt flag, VSYNC interrupt is implemented that can be
Special Function Reglalars (SFRs) programmable polarity bits, double used by the DPU to update the display RAM
The BXC053154 contains 17 additional SFRs height and background flag output during the vertical retrace. Since the part
in addition to those found on the BOCSI. Six control. does not have a UART, that interrupt is
of the additional registers control the OSD removed. Also, all interrupts have equal
OSORG: Contains the horizontal and vertical priority on this part, so there is no IP register.
block, ten control the PWMs, and one
starting positions for the display in Note that to facilitate PUlse-Width
controls the DIA and voltage comparator.
terms of multiples of horizontal and measurement, one of the external interrupts
The six registers that control the OSD block vertical scan lines. (Externallnt 1) will generate an interrupt, if
are: enabled, on both edges to allow easy
OSMOD: Contains bits specifying 12/14
OSAD: Specifies the 7-bit address of the column display and shadowing software pluse width measurement.
display RAM that the CPU uses to mod9s. Also has bits contrtling OSD
write into. enablingldisabling.
OSAT: Contains the 4 attribute bits for
character and display control.
97 96 9S 94 93 92 91 90
P1" Port 1 90H - I - I - I - IPWMO I AOl2 I AOl1 I AOIO FFH
B7 B6 BS B4 83 B2 B1 so
P3" Port3 BOH - I - I - I - ITfITOI m I INTI I - FFH
PCON Power control 87H - I - I - I - I GF1 I GFO I PO I OxxxxxxxB
07 OS OS 04 03 02 01 DO
PSW" Program status word DOH CY I AC I FO I RS1 I RSO I OV I - I P OOH
PWMO La-res pulse width 04
modulators
PWM1 La-res pulse width OS
modulators
PWM2 La-res pulse width OS
modulators
PWM3 La-res pulse width 07
modulators
PWM4 La-res pulse width OC
modulators
PWMS La-res pulse width DO
modulators
PWMG La-res pulse width DE
modulators
PWM7 La-res pulse width OF
modulators
SAD OIA and voltage DB
comparator
SP Stack pointer 81H 07H
TOACH Hi-res pulse width 03
modulators
TDACL Hi-res pulse width 02
modulators
BF BE BO BC BB BA 69 BB
TCON" limer control BBH TF1 I TR1 I TFO I TRO I IE1 I IT1 I lEO I ITO
THO limer high 0 8CH OOH
TH1 limer high 1 BOH OOH
TLO limer low 0 8AH OOH
TL1 limerlow 1 8BH OOH
TMOO limermode 89H - I - J - I T1M I - J CTol - I TOM OOH
" Bit addressable
• Flexible formatting with OSD New Une • High-speed CMOS technology Vss
Option
• 5V ± 10% operation
• 128 x 10 display RAM
BLOCK DIAGRAM
1 (EP)ROM 1
I
8192x&
RXED INTERNAL or TIMER 1
REGISTlERS RAM 16384x8 TIMER 0
INTERRUPT A, B, PSW, 192x8
LOGIC
PC,DP,SP
CPU DISPLAY
RAM
129x10
r INTERRUPT
LOGIC
I 1/0 PORT
LATCHES,
DRIVERS,
RECEIVERS
PULSE WIDTH
MODULATORS:
ONE 14-mT
EIGHTS-BIT
SOFTWARE
CONTROLLER
AID
ON-SCREEN
DISPLAY
FACIUTY
1-
CHARACTER
GENROM
6OX18x14
1
I PORT
MULTIPLEXING
I
t
PIN DESCRIPTIONS
PIN NO.
MNEMONIC DIP TYPE NAME AND FUNCTION
VCLKI 28 I Video Clock 1: Input for the horizontal timing reference for the On Screen Display facility. VCLKI
and VCLK2 are intended to be used with an external LC circuit to provide an on-chip oscillator.
The period of the video clock is determined such that the width of a pixel in the On Screen Display
is equal to the inter-line separation of the raster.
VSYNC 27 I Vertical Sync: A dedicated input for a TIL-level version of the vertical sync pulse. The polarity of
this pulse is programmable, and either edge can serve as the reference for vertical timing.
VID2:0 22-24 0 Digital Video bus: Three totem pole outputs comprising digital RGB (or other color encoding)
from the On Screen Display facility. The polarity of these outputs is controlled by a programmable
register bit.
VCTRL 25 0 Video Control: A totem-pole output indicating whether the On Screen Display facility is currently
presenting active video on the VID2:0 outputs. This signal should be used to control an external
multiplexer (mixer) between normal video and the video derived from VID2:0. The polarity of this
outputs is controlled by a programmable register bit.
Seplember27,1991 236
Signetics Microcontroller Products Product specification
XTALI 31 I Crystal 1 : Input to the inverting oscillator amplifier and clock generator circuit that provides the timing
reference for all MTV logic other than the OSD facility. XTAL 1 and XTAL2 can be used with a quartz
crystal or ceramic resonator to provide an on-chip oscillator. Alternatively, XTAL 1 can be conncected
to an external clock, and XTAL2 left unconnected.
XTAL2 32 0 Crystal 2: Output from the inverting oscillator amplifier.
Vee I Power Supply: This is the power supply for normal and power-down modes.
ROM CODE SUBMISSION PROGRAMMING THE OSD The LOWER section of the character is
When submitting a ROM code for the 83C053 EPROM programmed when the LSB of the program
or 83C054, the following must be specified: address equals 0, and the UPPER section
1. The 8k byte (83C053). or 16k byte Overview when the LSB equals 1.
(83C054) user ROM program. The OSD EPROM space starts at location
COOOH and ends at location CFFFH.
Character Programming
2. The OSD ROM space. An example of an OSD character bit map,
However, not all locations within this space
are used, due to the addressing scheme of and the program DATA to obtain that
This information can be submitted in an character is shown in Table 1.
theOSD.
87C054, or in two EPROMs (2764), or
electronically on the ROM Code Bulletin The start location of the next character can OSD EPROM Bit Map
Board (see your local sales office for the be calculated by adding 40H to the start The mapping for the full OSD EPROM is
number). location of the previous character. For shown in Table 2.
example, character #1 starts at COOOH; then
characters 2, 3, and 4 start at C040H, Example
ROM CODE SUBMITTAL C080H, and COCOH, respectively. To program the character given above into
REQUIREMENTS the first character location of the OSD
Character Description EPROM would require the following
ADDRESS CONTENT COMMENT Each character is 14 bits wide by 18 lines address/DATA sequence:
high.
OOOOHto User ROM data COOO/OOH; COO1/00H; COO2/00H;
lFFFH A character is split about a vertical axis into C003/00H; COO4/0CH; COO5/1EH;
(83C053)
DATA two sections, UPPER and LOWER. Each C006/0CH; COO7/1EH; COO8/0CH;
OOOHto
section contains 7 bits of the character, such C009/1EH; COOAlOCH; COOBI1EH;
3FFFH
(83C054) that the LOWER section contains 1-7 and COOC/OCH; COOD/1EH; COOE/OCH;
the UPPER section contains bits 8-14. COOF/1EH; C01017CH; COll/1FH;
On-Screen C012/7CH; COI3/1FH; C014/7CH;
COOOH to NOTE: During programming and verification,
OSD Display
CFFFH COI5/1FH; COI6/0CH; C017I1EH;
character table each section is programmed using
COI8/0CH; COI9/1EH; C01A10CH;
bytes of DATA. The MSB of the
C01B11EH; COIC/OCH; COlD/lEH;
DATA is not used; however, the MSB
COIE/OCH; C01FI1EH; C020/00H;
location physically exists, and so will
C021/00H; C022/00H; C023/00H
program and verify.
· ·· ··
··
C022
C023
18
18
· ·
Lower byte
Upper byte
C024-C03F Unused
2 C040-C063 1-18
C064-C07F Unused
3 C080-COM 1-18
COA4--COBF Unused
·· ·· ·· ··
62
· ·
CFCO-CFE3
·
1-18
·
NEWLINE
CFE4--CFFF Unused
63 CFCO-CFE3 1-18 BSPACE
CFE4--CFFF Unused
64 CFCO-CFE3 1-18 SPLlTBSPACE
CFE4--CFFF Unused
NOTE:
Locations 62, 63, and 64 should be programmed to O's.
COMPARISON TO THE 8OC51 2. The VSYNC input used by the On Screen 14-Bit PWM DAC (TDAC)
The elements of the MTV are shown in the Display facility can generate an interrupt. This feature was partially described in the
Block Diagram. The features of the MTV are The active polarity of the pulse is preceding section. As shown in Figure 3, the
identical to those of the SOC51, except as programmable, as described in a later G-bit counter used for the lower precision
noted herein. section. The interrupt occurs at the PWMs is in fact the least significant part of a
leading edge of the pulse. 14-bit counter used for this facility. The nature
Pinout and Testing of the counter is such that it can achieve a
3. External Interrupt 1 is modified so that an
Since neither data nor program memory is stable output value through its MSB, and the
interrupt is generated when the input value can propagate through logic like that
extemally expandable on the MTV, the SOC51
switches in either direction (on the 8051, shown in Figure 3, and the logic output can
pins ALE, EA, and PSEN are not
there is a programmable choice between be stable within one period of the PWM
implemented on the MTV.
interrupt on a negative edge or a low level counter clock (e.g., 250 ns) if edge-triggered
on INT1). This facility allows for software logic is used to capture the logic output, or
1/0 Ports
pulse-width measurement handling of a within one phase of the PWM counter clock
On both the BOC51 and the MTV, port 0 is
remote control. (e.g., 125 ns) if a phase of the PWM counter
open-drain, but on the SOC51 it can be used
clock is used to capture the logic output. For
for external memory expansion while on the 4. The I P register is not used, and the IE
cost and die-size reasons, it is preferable that
MTV its alternate use is for Pulse Width register is similar to that on the 80C51:
the TDAC counter be a ripple counter.
Modulated outputs.
IE This feature is controlled by two special
On the SOC51, port 1 is S bits, is mostly 4 3 2 function registers:
unallocated (general purpose), and is
quasi-bidirectional (that is, having a weak 1EA 1 - 1 - 1EVS 1Ell IEXl 1ETa 1EXO 1 TOACL
76543210
pullup transistor that can be overdriven). On
the MTV it is a 4-bit open-drain port, and Six-Bit PWM DACs I~I~I=I~I~I~I~I~I
includes alternate uses for analog inputs and The structure of these modules is shown in
aPWMoutput. Figure 2. First, the basic MCU clock is TOACH
7 543210
divided by 4 to get a waveform that clocks a
On the SOC51 , port 2 is quasi-bidirectional G-bit counter which is common to all the 1TOE 1 - 1TOll 1T0121 T011 IT010 1T09 1TOO 1
and can be used for external memory PWMs, including the 14-bit one. This divided
expansion; on the MTV, port 2 is open-drain When software wishes to change the 14-bit
clock is hereafter called the PWM counter
and unallocated. value (TOO - TD13), it should first write
clock.
TDACL and then write TDACH. Alternatively,
On the SOC51 , port 3 is quasi-bidirectional Each PWM block has a special function if the required precision of the duty cycle is
and all eight bits have alternate uses. On the register PWMn arranged as follows: satisfied by 6 bits or less, software can simply
MTV, three port 3 bits have some of the same write TDACH. Note from Figure 3 that this
alternate uses as on the SOC51 but not
PWIoll-PWM7 block includes an "extra" 14-bit latch between
necessarily on the same pins, while five pins
76543210 TDACUH and the comparator and other
are open-drain and unallocated. IPWE 1 - 1PV5 1PV4 1PV3 1PV2 1PVl 1PVO 1 logic. The programmed value is clocked into
the operative latch when the 7 low-order bits
If the PWE bit for a particular PWM block is
Idle Mode of the counter roll over to zero, provided that
1, the block is active and controls its
The idle mode is not implemented on the the software is not in the midst of loading a
assigned port pin; if PWE is 0 the new 14-bit value (that is, it is not between
MTV.
corresponding port pin is controlled by the writing TDACL and writing TDACH).
Power-Down Mode port. The "Value" field (PV5 ... PVO) of each
PWM register is compared to (the LS G bits In a similar fashion to the lower-precision
The power-down mode is not implemented on PWMs, this facility has an output FF that is
of) the common counter. When the value
the MTV. The PCON register has the set when the lower 7 bits of the counter
matches, the output FF is cleared, so that the
following format: overflowlwrap. The more significant 7 bits of
output pin is driven low. When the value rolls
PCON the operative latch's programmed value are
over to zero, the output FF is set, so that the
3 2 compared for equality against the less
output pin is released. Thus the output
significant 7 bits of the counter, and the
1 - 1 - 1 - 1 - 1GFl 1GAl 1 - - 1 waveform has a fixed period of 64 PWM
output FF is cleared when they match. Thus
counter clocks; its duty cycle is determined
this output has a fixed period of 12S PWM
Interrupts by PWMn.5:0. counter clocks, and the duty cycle is
The interrupt facilities of the MTV differ from determined by the programmed value.
Three of the nine total PWMs operate as
those of the SOC51 as follows:
described above; for three others, both the For the higher-precision aspect of this
1. Since there is not a serial port, there are
riSing and falling edges of the output are feature, the 7 more-significant bits of the
no interrupts nor control bits relating to
delayed by one PWM clock; for the remaining counter are used in a logic block with the 7
this interrupt. The interrupts and their
three, both edges are delayed by two PWM less-significant bits of the programmed value.
vector addresses are as follows:
clocks. This feature reduces the The 7th LSB (binary value 64) of the
Program Memory
Event radio-frequency emission that would programmed value is ANDed with the 7th
Address
Reset 000 otherwise occur when the counter rolled over MSB (12S) of the counter, the 6th LSB of the
External INTO 003 to zero and all nine open-drain outputs were value is ANDed with the counter's 6th and 7th
Timer 0 OOB released. MSBs being 10, and so on through the LSB
ExternallNTl 013
Timer 1 01B
VSync Start 023
of the programmed value being ANDed with Assuming the external integrator can handle 1. The 14-bit value is functionally composed
the counter's 7MSBs being 100000. Then all this, the net effect is a PWM DAC that has of major and minor portions of.7 bits each.
these 7 ANDed terms are ORed. If the result the period of a 7-bit design (which makes the
2. The 14-bit value is programmed as a
is truell at the time the 7 lSBs of the counter integrator easier and more feasible to design)
contiguous multi-register value that can
match the MSBs of the programmed value, with the accuracy of a 14-bit one. There is
be manipulated straight-forwardly via
the output is forced high for 1 (additional) some question whether all of the least
arithmetic instructions.
PWM counter clock. significant bits can be effectively integrated,
or whether they simply act as asource of 3. As discussed for the G-bit DACs, both of
The result is that, if the value-64 bit of the
ripple in the integrated voltage. An obvious the preceding parts had a feature
14-bit value is programmed to I, every other
prerequisite for such precision is that the load whereby the PWM output could be
cycle of 128 PWM counter clocks has its duty
on the voltage must be very light, like a single inverted, redundanfly with complementing
cycle stretched by one counter clock; if the
op amp or comparator. the 14-bit value. This feature has been
value-32 bit is programmed to I, every 4th
eliminated.
cycle is stretched, and so on through, if the The TDAC feature differs from the
value-l bit is programmed to I, one cycle out corresponding features of predecessor parts
of each 128 is stretched. in several ways:
ADDRESS TYPE
DIRECT BIT REGISTER USE
00-07 RO-R7 On-chip RAM (RO~7 if PSW.4-3 ~ 00)
08-OF RO-R7 On-chip RAM (RO-7 if PSW.4-3 ~ 01)
10-17 RO-R7 On-chip RAM (RO-7 if PSW.4-3 ~ 10)
DATA 18-1F RO-R7 On-chip RAM (RO-7 if PSW.4-3 ~ 11)
MEMORY 07-00
20 On-chip RAM
21-2E 77-08 On-chip RAM
2F 7F-78 On-chip RAM
3O-7F On-chip RAM
80 87-80 PO PortO
81 SP Stack Pointer
82 DPl Data Pointer LSBYTE
83 DPH Data Pointer MSBYTE
87 PCON Power Control
88 8F-88 TCON Timer Control
89 TMOD Timer Mode QN-CIIPRAM
SA TlO Timer 0 lSBYTE IF ACCESSED
INDIRECTlY.
8B Tll Timer 1 lSBYTE
8C THO Timer 0 MSBYTE
8D THI Timer 1 MSBYTE
90 97-90 PI Port 1
SPECIAL 98 9F-98 OSAT On Screen Attributes
FUNCTION 99 OSDT On Screen Data
REGISTERS 9A OSAD On Screen Address
AO A7-AO P2 Port 2
A8 AF-AS IE Interrupt Enable
80 B7-BO P3 Port 3
CO C7-CO OSCON On Screen Display Control
Cl OSMOD On Screen Display Mode
C2 OSORG On Screen Display Origin
C3 RAMCHR For Test Use Only
C4 RAMAn For Test Use Only
DO D7-DO PSW Program Status Word
D2 TDACl Hi-Res Pulse Width Modulator
D3 TDACH Hi-Res Pulse Width Modulator
D4-D7 PWM0-3 la-Res Pulse Width Modulators
D8 DF-D8 SAD D/A and Voltage Comparator
DC-DF PWM4-7 lo-Res Pulse Width Modulators
EO E7-EO A Accumulator
FO F7-FO B B Register
•••
........... ...............
LS 6 BITS
, - - - - -;;;;~T-- - - - - - - - - - - - - - - - - - - - - ,
,
r--~r--
~ ~
, I r--
!IB~~DV:~ r- - !ZE~0o-
,
I, PWU 4=~~l~1
:, Y=
t
,I
0.7
,,
&-BIT COMPARE
II
I, ,'
,
, OCCURS IN 6
Of 9 MODULES
t
,
I
,
OCCURSIN3 I PWIlll.5:O
II
I MCU Bue
Of9MODUlES
t ,
L __________ .J ~~M~l: _ _ _ _ _ _ _ _ _ _ _ _
,-------------------1-
,
L __________ ~~~~ ____________
,-------------------"1-
,
L __________ ..lBIU'"(tIl.llWllll& _ _ _ _ _ _ _ _ _ _ I
ETC.
Software AID Facility 12MHz), before the instruction that accesses The overall aso block has four input pins:
This facility is shown in Figure 4. It represents and tests VHi. two for a video clock, plus the horizontal and
an alternate use whereby any of the PLO vertical sync signals. The video clock pins are
The chan field controls which pin, if any, is
through P 1.2 pins can be selected as one used to connect an lC circuit to an on-chip
connected to this facility:
input of a linear voltage comparator. The video oscillator that is independent of the
CH1 CHO pin
block includes one special function register: normal MCU clock. The land C values are
o 0 none
chosen so that a video pulse, of a duration
SAD o 1 Pl~
equal to the VClK period, will produce a
76543210 1 0 PI. 1
more-or-Iess square dot on the screen, that
'VII 'CH1 'CHO , St 'SAD3' SAD2' SAD1' SADO , 1 1 Pl.2
is, a dot having a width approximately equal
Port 1 has open-drain drivers which will not to the vertical distance between consecutive
As shown in Figure 4 the other input of the
materially affect an analog voltage as long as scan lines.
comparator is connected to a 4-bit O/A that is
controlled by the 4 lSBs of the SAD register,
any and all pins used for software NO
The video oscillator is stopped (with VClK2
measurement have corresponding ones in
producing a reference voltage nominally low) while horizontal sync is asserted, and is
the port register.
O.I5625V to 4.84375V by steps of O.3125V. released to operate at the trailing edge of
The output of the comparator (higMow) can horizontal sync. This technique helps provide
On Screen Display (050) Module
be read by the program as the MSB of the uniform horizontal positioning of
This block is the largest of the additions that
register, which is bit addressable. characters/dots from one scan line to the
are specific to this product. Its basic function
is to superimpose text on the television video next.
The St bit should be written as 1 in order to
initiate a voltage comparison. After writing image, to indicate various parameters and The block has four outputs, three color video
St=l, the program should include intervening settings of the receiver or tuner. External signals, and a control signal. Since this block
instructions totalling at least six machine circuitry handles the mixing (multiplexing) of is the major feature of the part, its main
cycles (72 ClK periods or 6 microseconds at the text and the TV video. inputs and outputs are dedicated pins,
without alternate port bits.
"0 PORT
~U
BUS
VOLTAGE
COMPARATOR
Display RAM OSAD ("On Screen ADress") contains the occurs halfway through the character
The OSD 01 the MTV differs from that in address at which data will next be written into horizontally. The normal Space character
preceding devices in one major way: It does display RAM, while the ten active bits in (111100) has no effect on the BColor value.
not fix the number and size 01 displayed rows OSDT ("On Screen DaTa") plus OSAT ("On
BColor values 000 and 111 minimize the
01 text. Several predecessor parts allowed Screen ATtributes") correspond exactly to the
occurrence of transient states among the
two displayed rows 0116 characters each. 10 bits in each display RAM location. FColor
VID2:0 outputs.
The MTV simply has 128 locations 01 display indicates the color of foreground (1) pixels in
RAM, each 01 which can contain a displayed the ROM bit map for this character, while B The background color defined by the most
character or a New Line character that indicates whether background (0) pixels recently encountered BSpace or SplitBSpace
indicates the end 01 a row. A variant 01 the should show the current background color character is maintained on the VID2:0 pins
New Line character is used to indicate the (B= 1) or television video (B=O). Thus, for the except at the following times:
end 01 displayed data. 1 bits in a character's bit map, the VID2:0 1. During the active time of HSYNC,
pins are driven with (FColor) and VCTRL is
The three major elements 01 the OSD lacility 2. During the active time of VSYNC,
driven active, while for 0 bits VID2:0 are
are shown in the Block Diagram. Each driven with the background color (except for 3. During those pixels of an active character
display RAM location includes 6 data bits and shadow bits) and VCTRL is driven with the B that correspond to a 1 in the character's
4 attribute bits. The 6 data bits from display bit. bitmap,
RAM, along with a line-within-row count, act
as addresses into the character generator Writing OSAT simply latches the attribute bits 4. During a ·shadow" bit.
ROM, which contains 60 displayable bit maps into a register, while writing OSDT causes the
(64 minus one for each of New Line and three data bus information, plus the contents of the The BColor value is not cleared between
Space characters). Each bit map includes 18 OSAT register, to be written into display vertical scans, so that if a single background
scan lines by 14 dots. The character RAM. Thus, for a given display RAM location, color is all that is needed in an application, it
generator ROM is maskable or OSAT should be written before OSDT.lf can be set via a single BSpace character
programmable along with the program ROM successive characters are to be written into during program initialization, and never
to allow for various character sets and display RAM with the same attributes, OSAT changed thereafter. In order for such a
languages. need not be rewritten for each character, only BSpace to actually affect the MTV's internal
prior to writing OSDT for the first character BColor register the Mode field of the OSMOD
The programming interface to display RAM is with those particular attributes. register must be set to 01 (or higher) so that
provided by three spedal function registers: the OSD hardware is operating.
In reality, there is a potential conflict between
OSAD
the timing of a write to OSDT and an access With a New Line character, if the E bit is I, no
76543210
to display RAM by the OSD logic for data further rows are displayed on the screen. If E
1-!OSAD6IOSAD30SA+AD3§AD2IosAD1IOSA~ display. This is resolved by the use of a true is 0 and D is I, all of the characters in the
dual-ported RAM for display memory. following row are displayed with Double
height and width. If E is 0 and Sh is 1, all of
OSDT OSAD is automatically incremented by one
the characters in the following row are
765 4 3 2 1 0 after each time OSDT and display RAM are
displayed with shadowing, as described in a
written. Except in special test modes that are
1-1-losDT5IosDT4IOSDT3losDT2IosDT1losDTOI later section. If E is 0 and SR is I, the next
beyond the scope of this spec release,
row is a "short row": It is only 4 or 8 scan
display RAM cannot be read by the MCU
lines high rather than 18 or 36. Short rows
OSAT (with OSDT = New Une) program.
can be used for underlined text.
5 The OSAT attribute bits assodated with the
The latches in which the E, D, Sh, and SR
- 1 - - 1 E -ISR 0 Sh BSpace (data=111110), SplitBSpace (111111),
bits are captured are cleared to zero at the
and New Line (111101) characters are
start of each vertical scan. This means that if
interpreted differently from those that
the first text line on the screen is a short row,
OSAT (with OSDT = BSpece 0, SplitBSpace) accompany other data characters. With
or if it contains either double size or
76543210 BSpace and SplitBSpace, B is interpreted as
shadowing, the text must be preceded by a
1 - 1 - 1 - I B 1 -IBC2IBC1IBCOI described above, but the 3 color bits spedfy
New Line character. Like all such characters,
the Background color (BColor) for
this initial New Line advances the vertical
subsequent characters. For BSpace, a
screen position; the VStart value (see below)
OSAT (with OSDT = any 0_) change in Band BColor becomes effective at
should take this fact into account.
7654 210 the left edge of the character's bit map. For
SplitBSpace, a change in Band BColor
-1- -IBI-IFC2IFC1I Fco l
Other OSO Registers A 0 (1) in Pc designates that a high (low) on If the mode bits (Mode I, Mode 0) are 00, the
A number of changes in the OSD architecture the VCTRL output means "show the color on OSD feature is disabled. The VCLK oscillator
have reduced the number of other special VID2:0". is disabled, VID2:0 are set to black, and
function registers involved in the feature, VCTRL is held inactive. This is the mode to
A 0 (1) in Po designates that a 0 (1) internal
below the number needed with predecessor which the MTV OSD logic is reset. A direct
to the MTV corresponds to a low on one of
devices: transition from this mode to active display
the VID2:0 pins. This control bit is needed
1. The elimination of certain options such as (IX) would result in undefined operation and
only because the Shadowing feature needs to
4, 6, orax character sizes and alternate generate black pixels without reference to a
visual effects for the duration of the current
use of two of the video outputs. video field (until the next VSYNC).
register value: Internally, the 3-bit code 000
2. The moving of certain other options from always designates black. If the mode is 01, the VCLK oscillator is
central registers to display RAM, such as enabled and the OSD logic operates normally
If DH is I, character sizes are doubled
foreground color codes and background internally, but VID2:0 are set to black and
vertically but not horizontally. This feature
selection. VCTRL is held inactive. The OSD feature can
allows the MTV to be used in "improved
be toggled between this state and 1x as
definition" systems that are not interlaced.
OSCON desired to achieve real-time special effects
The vertical doubling imposed by DH does
1 0 such as "vertical wiping."
not affect the VStart logic described below: It
Lv 1 Ph operates in HSync units regardless of DH or Mode 10 represents normal OSD operation.
D. Active characters can be shown against TV
The IV bit is the interrupt flag for the OSD
video (for characters with B=O) or (for
feature. It is set by the leading edge of the If BFe is I, the BF output tracks whether
characters with B=I) against a background of
VSYNC pulse, and is cleared by the each bit in displayed characters is a
the color defined as an attribute of BSpace
hardware when the VSYNC interrupt routine foreground bit (low) or a background bit
and SplitBSpace characters.
is vectored to. It can also be set or cleared by (high). If BFe is 0, the BF pin remains high.
software writing a 1 or 0 to this bit. OSORG In mode 11, characters can be displayed but
all of the receiver's normal video is inhibited
NOTE 76543210
by holding VCTRL asserted throughout the
It is theoretically possible that a VSYNC I~I~I~I~I~I~I~I~I active portion of each scan line. Since VID2:0
interrupt could be missed, or an extra one
generated, if OSCON is read, then The HStart field (HS4 - HSO) defines the left are driven with the current background color
modified internally (e.g., in Ac), and the end (start) of all of the on-screen character during this time, except during the foreground
result written back to OSCON. However, rows, as a multiple of four VCLKs. Active portion of displayed characters, this produces
none of the other bits in OSCON are display begins 4(HStart)+ 1 VCLKs plus one text against a solid background. This mode is
reasonable candidates for dynamic single-sized character width after the trailing useful for extensive displays that require user
edge of HSYNC. Counting variations in Wc, concentration.
change. Special provisions are included in
the MTV 100gic so that IV will not be there may be 17 to 143 VCLKs from the end If Wc is I, then each displayed character is
changed by a single "read-modify-write" of HSYNC to the start of the first character of horizontally terminated after 12 bits have
instruction such as SETB or CLR, unless each row. been output, as opposed to after 14 bits if Wc
the instruction specifically changes IV. is O. This allows text to be 'packed" more
The VStart field (VS2 - VSO) defines the top
A 0 (1) in Pv designates that the VSYNC (start) of the first on-screen character row, as tightly so that more characters can be
input is high-active (low-active). One effect of a multiple of four HSYNC pulses. Active displayed per line. In effect, the 2 bits out of
this bit is that the VID2:0 and VCTRL outputs display begins 4(VStart)-1 HSYNCs after the the display ROM, which would otherwise be
are blocked (held at black/inactive) during the field's time reference point, a range of 3 to the rightmost 2 of the 14, are ignored when
active time of VSYNC. The IV bit is set on the 31. Subsequent character rows occur directly Wc is 1. Clearly, if this feature is to be used, it
leading edge of the VSYNC pulse; thus Pv below the first, such that the last scan line of must be accounted for in the design of the bit
controls whether the OSD interrupt occurs in one row is directly followed by the first scan maps in the display ROM.
response to a high-to-Iow or low-to-high line of the next row. Successive New Line The 3-bit ShMode field (SHM2 - SHMO)
transition on VSYNC. characters (with or without the Short Row determines how characters are shadowed in
designation) can be used to vertically rows for which the SH row attribute is 1. As
A 0 (1) in Lv designates that the leading edge
separate text rows on the screen. shown in Figure 5, the values 000-110
(active level) of VSYNC, as defined by Pv,
clears the state counter that is used to Neither the HStart nor VStart parameter is indicate an apparent light source position
determine the vertical start of on-screen data. affected by the D line attribute that is used to ranging from the lower left clockwise to llie
In effect, Lv=O(I) says that the leading display double-sized characters. lower right, while the value 111 indicates
(trailing) edge of VSYNC is the time full-surround shadowing.
OSMOD
reference for the video field.
76543210
A 0 (1) in Ph designates that the HSYNC
input is high-active (low-active).
-I
1We 1 Mode1 1ModeO 1 - 1SHM21 SHM1 1SHMO 1
September27,1991 244
Signetics Microcontroller Products Product specification
DC ELECTRICAL CHARACTERISTICS
Vee = 5V ±10% Tamb = O°C to +70°C
TEST UMITS
Vll1 Input low voltage (VSYNC) Neg. HSYNC polarity ---{).5 0. 16xVee V 5
(OSPH = 1)
V IH1 Input high voltage (Pl.2:0, P2.7:0, P3.6:5, P3.3:1, 0.2Vee+0.9 Vee+0.5 V
VSYNC, HSYNC)
VIH2 Input high voltage (port 0, Pl.3, P3.7, P3.4, P3.0) IIH =2mA 0.2Vee+0.9 12.6 V
V IH3 Input high voltage (VSYNC) 0.6 x Vee Vee +0.5V V
VIH_ Vee Input high voltage (port 0, Pl.3, P3.7, P3.4, P3.0) with 8 V t
respect to Vee
liN Input current (VSYNC) Neg. HSYNC polarity -80 +120 IlA 5
(OSPH = 1)
AC ELECTRICAL CHARACTERISTICS
vce- 5V±10"lo , Tamb= O°Cto +70°C
TENTATIVE UMITS
SYMBOL PARAMETER MIN MAX UNIT NOTES
1/teLCL XTAL Frequency 6 12 MHz 1
teHCX XTAL 1 Clock high time 20 ns 2
teleX XTAL 1 Clock low time 20 ns 2
teLCH XTAL1 Clock rise time 20 ns 2
teLCL XTAL 1 Clock fall time 5 20 ns 2
1ltVCLCL VCLK Frequency 5 8 MHz
kVCOf;"tVCOL i Rise vs. fall time skew on anyone of V1D2:0, VCTRL, BF 40 ns 3
kVCOH1-tVCOH2i Rise time skew between any two of VID2:0, VCTRL, BF 30 ns 3
kVCOL1-tvcoL2 i Fall time skew between any two of VID2:0, VCTRL, BF 30 ns 3
NOTES:
1. The MTV is tested at its maximum XTAL frequency, but not at any other (lower) rate.
2. These parameters apply only when an external clock signal is used. ..
3. These parameters assume equal loading at CL = 100pF, for all the referenced outputs. These parameters are specified but not tested.
PROGRAMMING pulsed high only to change the high byte of time that the clock is low. Following
CONSIDERATIONS the address. transmission of the last data bit, the RESET
pin should be held low.
Port 3 is used as a bidirectional data bus
EPROM Characteristics during programming and verify operations. Next the address information for the location
The 87C054 is programmed by using a During programming mode, it accepts the to be programmed is placed on port 2 and
modified Quick-Pulse Programming algorithm byte to be programmed. During verify mode, ASEL is used to perform the address
similar to that used for devices such as the it provides the contents of the EP ROM mUltiplexing, as previously described. At this
87C51. It differs from these devices in that a location specified by the address which has time, port 1 functions as an output.
serial data stream is used to place the been supplied to Port 2.
87C751 in the programming mode. A high voltage Vpp level is then applied to the
The XTAL 1 pin is the oscillator input and Vpp input (PO.O). (This sets Port 1 as an input
Figure 6 shows a block diagram of the receives the master system clock. This clock port). The data to be programmed into the
programming configuration for the 87C054. should be between 1.2 and 6MHz. EPROM array is then placed on Port 3. This
Port pin PO.O is used as the programming is followed by a series of programming pulses
voltage supply input (Vpp signal). Port pin The RESET pin is used to accept the serial
applied to the PGMI pin (PO.l). These pulses
PO.l is used as the program (PGMI) signal. data stream that places the 87C054 into
are created by driving PO.l low and then
This pin is used for the 25 programming various programming modes. This pattern
high. This pulse is repeated until a total of 25
pulses. consists of a 10-bit code with the LSB sent
programming pulses have occurred. At the
first. Each bit is synchronized to the clock
Port 2 is used as the address input for the conclusion of the last pulse, the PGMI signal
input, Xl.
byte to be programmed and accepts both the should remain high.
high and low components of the eleven bit Programming Operation The Vpp signal may now be driven to the VOH
address. Multiplexing of these address Figures 7 and 8 show the timing diagrams for level, placing the 87C054 in the verify mode.
components is performed using the ASEL the programlverify cycle. RESET should (Port 3 is now used as an output port). After
input. The user should drive the ASEL input initially be held high for at least two machine four machine cycles (48 clock periods), the
high and then drive port 2 with the high order cycles. PO.l (PGMI) and PO.O (Vpp) will be at contents of the addressed location in the
bits of the address. ASEL should remain high VOH as a result of the RESET operation. At EPROM array will appear on Port 3.
for at least 13 clock cycles. ASEL may then this point, these pins function as normal
be driven low which latches the high order quasi-bidirectional 110 ports and the The next programming cycle may now be
bits of the address internally. The high programming equipment may pull these lines initiated by placing the address information at
address should remain on port 2 for at least low. However, prior to sending the lO-bit code the inputs of the multiplexed buffers, driving
two clock cycles after ASEL is driven low. on the RESET pin, the programming the Vpp pin to the Vpp voltage level, providing
Port 2 may then be driven with the low byte of equipment should drive these pins high (VIH). the byte to be programmed to Port 3 and
the address. The low address will be The RESET pin may now be used as the issuing the 26 programming pulses on the
internally stable 13 clock cycles later. The serial data input for the data stream which PGMI pin, bringing Vpp back down to the VOH
address will remain stable provided that the places the 87C054 in the programming mode. level and verifying the byte. (See Table 3.)
low byte placed on port 2 is held stable and Data bits are sampled during the clock high
ASEL is kept low. Note: ASEL needs to be time and thus should only change during the
Erasure Characteristics erasure. For this and secondary effects, It, angstroms) to an integrated dose of at least
Erasure of the EPROM begins 10 occur when Is recommended thaI an opaque label be 15W-s/cm2. Exposing the EPROM 10 an
the chip is exposed 10 light with wavelengths placed over the wIndow. For elevated ultraviolet lamp of 12,OOOIlW/cm2 rating for
shorter than approximately 4,000 angstroms. temperature or environments where solvents 20 10 39 minutes, at a distance of about 1
Since sunlight and fluorescent lighting have are being used, apply Kaplon tape Flourless inch, should be sufficient.
wavelengths in this range, exposure to these part number 2345-5 or equivalent.
Erasure leaves the array in an aliI s state.
light sources over an extended time (about 1 The recommended erasure procedure is
week in sunlight, or 3 years in room level exposure to ultraviolet light (at 2537
fluorescent lighting) could cause inadvertent
87C1l54
PROGRAMIoiNG
l-
PO.I
PULSES
CLKSOURCE XTAL1
Y RESET
CONTROl.
LOGIC
I
I
RESET
XTALI
IoIN2MACitNE
I_ CYCLES _I. TEN-BIT SERIAL CODE _I
RESET -..JI l 1~~~~~~~~~1~~1~~~~1___
_BIT D BIT I BIT 2 BIT 3 BlU BIT 5 BIT 6 BIT 7 BIT 8 BIT 9
PO.D UNDERNED I
PO.I UNDER NED I
Figure 7. Enlry Inlo ProgramlVerify Modes
12,75V
PO.D (Ypp)
/
r-
5V \5V
~ ISHGL
25 PULSES
-1 ~ 'GHSL
1 1
PO.I (PGJI)
LJLJLJU
I· -IIMASEL 'GLGHH -1
ID~.
~ IGHGL
MIN
~J
98IU'IoiN
PO.2 (ASEL) \
IHASE,I· -I -IIHAHLD
PORT 2
=-x ItGH ADDRESS
X LOW ADDRESS
PORT 3 INVAUDDATA
H 'DVGL
DATA TO BE PROGRAMMED
'GHDxl"
+ IAVQV--+j
Sep\ember27.1991 249
Signetics BOC51-Based 8-Blt Microcontrollers
8XCL410 OVERVIEW consumption also increases. At 12MHz and a additiomll external interrupts. The registers
The 80CL410 (ROMless version) and supply voltage of 5V, the 8XCL410 will draw are IENI and IPI.
83CL410 (ROM version) are referred to about 1OmA of current, which is slightly less
Two more SFRs are added to allow the user
collectively in this overview as the 8XCL41 o. than the current that an BOC51 would require.
to set the polarity of the additional external
The 8XCL41 0 is socket compatible with the interrupts and to hold the interrupt request
BOC51 and has many of the same features, The advantage that the 8XCL41 0 has over
the 80C51 is in its ability to operate at very flags for those added interrupts. The SFRs
but at a much lower power and clock are the interrupt polarity register (IX1) and the
frequency. low frequencies and supply Voltages. This
makes the part an ideal choice for interrUpt request flag register (IR01).
The 8XCL41 0 is the first member of a family applications where power is supplied from Table 1 shows the special function registers,
of low-power BOC51 derivative parts. The batteries, or where low supply voltages or their locations, and their reset values for the
features of the 8XCL410 include: clock frequency are necessary. The 8XCL41 0 8XCL410.
·4kx8ROM features a fully static design. Using the
on-chip oscillator, the clock frequency is 12<: Serial Interface
• 128x8RAM limited to a minimum of 32kHz, but using an The serial port supports the two-wire 12C bus.
external oscillator the part can be operated The 12C bus consists of a data line (SOA) and
• Two 16-bit timer/counters
down to DC. This means that the clock can a clock line (SCL). These lines are
• A two level nested priOrity interrupt be turned off, and when it is started again the multiplexed functions of I/O port pins Pl.7
structure microcontroller will continue with the action and Pl.G, respectively. The main features of
that it was performing when the clock was the bus are:
• An 12C serial interface
stopped. This is something that is impossible • Bidirectional data transfer between masters
• Thirteen interrupt sources (with eight with dynamic devices because their internal and slaves
additional external interrupts) nodes must be constantly refreshed. The
static design of the 8XCL41 0 offers the user • Truemultimaster bus
• Idle and power-down modes
the Ultimate in power-down modes, because • Arbitration between simultaneously
• Interrupt or reset return from power-down the part can be stopped until it is needed and
transmitting masters without loss or
then started from where it was at when it was corruption of the serial data" on the bus
• Six oscillator configurations stopped, with no loss of internal states or
- Ouar12 crystal data. The power consumption of the • Synchronized clock allows devices with
- Ceramic resonator 8XCL410 when the clock is stopped is less different bit rates to communicate
- RC than lIlA. • The serial clock synchronization can be
- LC used as a handshake mechanism to
- External Differences from the 80C51 suspend and resume serial transfer.
• Input supply range from 1.8V to 6V Special Function Registers The CPU of the 8XCL410 interfaces to the
The 8XCL41 0 contains most of the special 12C logic via four special function registers.
• Operating frequency from DC to 16MHz The registers are S 1CON (12C control
function registers found in the 80C51 as well
The 8XCL410 can be operated from a single as eight additional SFRs that have been register), SlOAT (data register), SISTA
battery supply which can vary between 1.8V added to handle the 12C serial interface and (status register), and SIADR (slave address
and 6V, and for an AC supply the part eight additional external interrupts. The register).
requires only a simple voltage regulator. In standard UART found on the 80C51 has A detailed discussion of the 12C bus is given
some cases the part can be operated from an been replaced with an 12C serial interface, so in section 2 of this users' guide. The 12C
un stabilized supply, eliminating altogether the the SFRs SCON and SBUF have been interface used on the 8XCL410 is functionally
need for a regulator. removed. Four SFRs have been added to identical to the one on the 8XC552. A
handle the 12C interface; they are: SICON, detailed discussion of this 12C hardware is
The power consumption of the part is much SlOAT, SISTA, and SIADR.
lower than that of a standard BOC51 . given in the 8XC552 section, so the
Operating at 3.5MHz from a 3V supply, the discussion here will be limited to a review of
The interrupt structure on the 8XCL410 has
8XCL410 typically draws less than 1mA of each ofthefour 12C special function registers.
been upgraded to include eight additional
current. The power consumption of the part is A block diagram of the 12C serial intenace is
external interrupts. The IE and IP registers on
direcHy related to the supply voltage and shown in Figure 1.
the 80C51 have had their names changed on
clock frequency. As the supply voltage or the 8XCL410 to IENO and IPO. In addition, The functions of the 12C interface are
clock frequency are increased, the power two SFRs have been added to handle the controlled by the SI CON register.
AF AE AD AC AB AA A9 AS
IENO"# Interrupt enable 0 ASH EA I - I ESI I - I ETI I EXI I ETO I EXO OOH
EF EE ED EC EB EA E9 E8
IEN1"# Interrupt enable 1 E8H EX9 I EX8 I EX7 I EX6 I EX5 I EX4 I EX3 I EX2 OOH
C7 C6 C5 C4 C3 C2 Cl CO
1R01"# Interrupt request flag COH 109 I 108 I 107 I 106 I 105 I 104 I 103 I 102 OOH
IX1# Interrupt polarity E9H OOH
PO" PortO 80H 87 86 85 84 83 82 81 80 FFH
PI" Port 1 90H 97 96 95 94 93 92 91 90 FFH
P2" Port 2 AOH A7 A6 AS A4 A3 A2 AI AO FFH
P3" Port 3 BOH B7 B6 B5 B4 B3 B2 Bl BO FFH
D7 D6 D5 D4 D3 D2 Dl DO
PSW" Program status word DOH CY I AC I FO I RSI I RSO I OV I - I P OOH
S1CON(D8H) own slave address or the general call ENS1-Enable 12C Serial Port. When ESNl
76543210 address (even is SlADR is set), nor will it is low, the part will not respond to its address
or any activity on the 12C bus. The SDA and
I - IENSll STA ISTO I S/ I AA ICRI ICAD I acknowledge received bytes.
SCl outputs are in a high impedance state.
SI-Seriallnterrupt flag SI is set by hardware P1.6 and P1.7 can be used as open drain
CRO and CR1-Clock Rate bits. These bits when one of 25 of the 26 possible 12C
determine the serial clock (SCl) frequency port pins. When ENSl is set (1), the 12C
hardware states on the 8XCl410 is entered. serial port is enabled. Port latches Pl.6 and
when the 8XCl410 is in the master mode. The only state that does not cause SI to be
The various SCl serial clock rates that can P1.7 must be set (1).
set is F8H, which indicates that no relevant
be achieved are shown in Table 2. state information is available. An interrupt will ENS1 should not be used to temporarily
The SCl rate generated when both CRO and only be requested while SI is set (1) and the release the bus, because the 12C bus status
CRl are low is usually used when the 12C serial interrupt is enabled in the IENO Sl STA is cleared and the part's bus status
interface on other parts are software driven (interrupt enable) SFR. When SI is set, the lost when ESN 1 is reset (0). To temporarily
and slow. The maximum SCl rate is 100kHz low period of the 12C clock (SCl) is stretched idle the bus, the AA flag should be used.
and can be derived from either a 12MHz or (that is, held low) until SI is cleared. SI can
6MHz oscillator. A variable bit rate can be only be cleared by software. The data to be transmitted to or received
used if timer 1 is not required for another from the 12C bus is written into or read from
STO-STOp flag. When the 8XCL410 is in
purpose while the 8XCl410 is in the master the Sl DAT register.
the master mode and STO is set (1), a stop
mode. condition will be forced on the 12C bus by the
part. When the stop is detected on the bus by S1DAT(DAH)
The CRO and CRl bits have no effect when
the 8XCl410's hardware, it will clear the STO 76543210
the part is in the slave mode, because SCl is
generated only by the bus master. In the
flag. l~l~l~l~l~l~l~l~l
slave mode, the part will automatically STA--5TArt flag. When the 8XCl41 0 is set
synchronize with the 12C bus clock frequency. to enter the master mode and STA is set (1), SD7-SDO-Serial Data bits. A byte to be
the part will check the status of the 12C bus transmitted is written into this register, and a
AA-Assert Acknowledge. When the AA bit is and generate a START condition if the bus is byte received is read from this register. A 1 in
set (1), an acknowledge will be returned free. "the bus is not free, the 8XCl410 will the register corresponds to a high level on the
when the 8XCl41 0 recognizes its own slave wait for a STOP condition on the 12C bus and bus, and a 0 corresponds to a low level. Data
address, recognizes the general call address then after a half period delay (of SCl) it will shifts into or out of the register from left to
if SlADR.O is set (1), or receives a data byte generate a START right.
while it is either the bus master or the
selected slave. "AA is not set (0), then no If both STA and STO are set, and the part is The status of the bus can be determined at
acknowledge will be retumed for any in the master mode, a STOP will be forced on any time by reading the SlSTA register. This
condition. The 12C bus hardware is not the bus, and then following that with the is a read only register in which the three least
disabled, but the part will not respond to its appropriate delays, a START will be forced. significant bits are always zero (0).
Slave Address
SIADR r--------,
SISTA
Figure 1. Serial va
S1STA(D9H) 80H - Received own slave address and two-priority level, nested interrupt system is
7 6 4 0 data byte, acknowledge returned. provided. The 8XCL410 acknowledges
1SC41 seal 5021 sell seal 0 I 0 0 I 88H - Received own slave address and
data byte, acknowledge not returned.
interrupt requests from 13 sources as follows:
SC4-SCO--Status Code bits. These bits hold 90H - Received general call and data byte, Priority Source Vector Function
a status code that indicates the current status acknowledge returned. Address
of the bus. The contents of these bits can be 98H - Received general call and data byte,
Highest INTO 0OO3H External
used to vector to a service routine, which acknowledge not returned. interrupt 0
optimizes the response time of the software AOH - Stop or repeated start received while
and consequently that of the 12C bus. still addressed as slave transmitter or SI 002BH 12C serial
interrupt
receiver.
The following is a list of the status codes for
INT5 0053H External
each SlSTA value. Slave Transmitter Mode interrupt 5
A8H - Own slave address and read bit
Master Transmitter Mode TO OOOBH Timer 0
received, acknowledge returned. interrupt
08H - A START condition has been
BOH - Arbitration lost. Own slave address
transmitted. INT6 005BH External
and read bit received, acknowledge
10H - A repeated START condition has interrupt 6
returned.
been transmitted.
BaH - Data byte transmitted, acknowledge INTI 0013H External
18H - Slave address and write bit interrupt 1
received.
transmitted, acknowledge received.
COH - Data byte transmitted, acknowledge INT2 003BH External
20H - Slave address and write bit
not received. interrupt 2
transmitted, acknowledge not
C8H - Last data byte transmitted,
received. INT7 0063H External
acknowledge received. interrupt 7
28H - Data transmitted, acknowledge
received. All Modes Tl 001BH Timer 1
30H - Data transmitted, acknowledge not OOH - Bus error due to an erroneous start or interrupt
received. stop condition INT3 0043H External
38H - Arbitration lost while transmitting interrupt 3
slave address, RIW bit, or data. The slave address that the part is to respond
to is put into the SlADR special function INT8 006BH External
Master Receiver Mode register. interrupt 8
38H - Arbitration lost while returning INT4 004BH External
acknowledge. SlADR(DBH) interrupt 4
40H - Slave address and read bit 76543210
Lowest INT9 0073H External
transmitted, acknowledge returned. I~I~I~I~I~I~I~I~I interrupt 9
48H - Slave address and read bit
SA7-SA I-Slave Address bits. The 7-bit
transmitted, acknowledge not There are six special function registers
slave addresses that the part is to respond to
returned. associated with the interrupt portion of the
is loaded into these seven bits.
50H - Data received, acknowledge returned. 8XCL410. They are IENO, IPO, IEN1, IP1,
58H - Data received, acknowledge not SAO--This bit can be set so that the part will lXI, and IRQ1. Following is a detailed
returned. respond to a general call address on the Fc description of each.
bus. Clearing (0) this bit will prevent the part
Slave Receiver Mode from responding to a general call address. IENO-Interrupt Enable register zero. This
SOH - Own slave address and write bit register has the same function as the IE
received, acknowledge returned. The Interrupt Structure register found on the 80C51. The only
68H - Arbitration lost. Own slave address External events and the real-time-driven difference between the two is that the bit that
and write bit received, acknowledge on-chip peripherals require service by the controls the serial interface interrupt has been
returned. CPU asynchronous to the execution of any moved from bit 4 to bit 5. This has been done
70H - General call received, acknowledge particular section of code. To tie the because the 8XCL410 has an 12C serial
returned. asynchronous activities of these functions to interface and bit 5 is used on other parts for
78H - Arbitration lost. General call received. normal program execution, a multiple-source, the 12C interrupt enable bit.
IENO(ABH) IP1 (DaH) internal clock will remain inactive for 1536
78543210 76543210 oscillator periods after the interrupt is
lEA 1 - 1ES11 - 1ET1IEX1IElDl EXOI I~I~I~I~I~I~J~I~I detected. After this, the PO flag will be reset,
and the part will be in the idle mode, and the
EA- Glineral Enable/Disable control, PX9-PX2-External interrupt priority for interrupt will be handled in the normal way.
o= All interrupts disabled. external interrupts 2 - 9. (0 = low, 1 = high) Figure 2 shows the different oscillator delays
1 = Interrupts can be individually
associated with the two methods of waking
enabled or disabled. IX1-'-lntetTupt Polarity register. This register
the part up from the power-down mode.
ESI -' 12C interrupt enable. allows the programmer to determine the
(1 = enabled, 0 = disabled) polarity of external interrupts 2 - 9 that will be Low Power Consumption
ETI - Timer 1 interrupt enable. sensed for the interrupt. If the bit for an The aXCL41 0 is targeted toward low power
(1 = enabled, 0 = disabled) interrupt is set to 1, then the interrupt will be applications in industrial control, portable'
EXI - External interruptI enable. triggered by a high input on that extemal instrumentation, intelligent computer
(1 = enabled, 0 = disabled) interrupt. If the bit is cleared to 0, then the peripherals, portable consumer products, and
ETO - Timer 0 interrupt enable. interrupt will be triggered by a low on that
external interrUpt.
a
smart cards. Working from single supply
(1 = enabled, 0 = disabled) which can vary between I.BV and 6V, the
EXO - External interrupt 0 enable. aXCL410 requires only a simple voltage
(1 = enabled, 0 = disabled) IX1 (E9H) regulator. In many cases it can be operated
76543210
from an un stabilized supply, eliminating
IPO-Interrupt Priority register zero. This I~I~I~I~I~IMI~I~I altogether the need for a regulator. A!ypical
register has the same function as the IP aXCL410 device draws lmA from a 3f.;
register on the 8OC51. The only difference is Il9-Il2-External Interrupt polaiity bits
supply when running at a 3.SMHzclock
that the serial interface priority is set on bit 5. corresponding to external interrupts 9 - 2.
frequency. Current consumption in the'idle
(1 = high trigger, 0 = low trigger)
and power-<lown modes is reduCed further to
IPO(B8H) IR01-Interrupt Request flag register. This less than O.SmA and IlIA, res'pectively. '
7 • 5 4 3 2 ,1 0 register contains flags that are set when one
The aXCL41 0 can be operated at clock
1- 1 - 1ps11 -I PT1lpX11PlDl pxol of the external interrupts 2 - 9 are requested.
The flags will only be set if the corresponding
frequencies up to 16MHz. At these
PSI - 12C interrupt priority. frequencies and a 5V supply voltage, the part
interrupt is enabled in the lEI register. The
(1 = high, 0 = low) will draw current similar to that of a standard
flags must be cleared by software.
PTI - Timer 1 interrupt priority. 8OCSI. For the BXCL410, the reduction in
(1 = high, 0 = low) IR01 (COH) power is a function of both the clock
PXl - External interrupt 1 priority. 76543210 frequency and the supply voltage. Power
(1 = high, 0 = low) dissipation is reduced by lowering the clock
PTO - Timer 0 interrupt priority. 1~1~1~1~1~1~lql~1 frequency and/or reducing the supply voltage.
(1 =high, 0 =low) IQ9-I02-Extemal interrupt request flags for A standard Philips aOC51 will operate down
PXO - EXternal interrupt 0 priority. external interrupts 9 - 2. to a clock frequency of O.SMHz and a supply
(1 = high, 0 = low) voltage of 4V. The advantage of the
Power-Down Mode low-power aXCL410 is that it can be run at
lEN I-Interrupt Enable register one. This In addition to being able to reduce the power frequencies as low as 32kHz with the intemal
register contains the interrupt enables for the consumption by stopping the clock, there are oscillator (DC when an external oscillator
eight external interrupts that have been both idle and power-<lown modes available. circuit is used), and that the voltage supply
added to the aXCL410. Clearing (0) the bit in These operate exactly the same as the idle levels can be reduced down to l.aV. To
the IENI register disables all olthe interrupts and power-<lown rnodes on the 8OC51. There obtain maximum power reduction, the part
in this register as well as those in the IENO is only one difference and that is that it is can be operated with both reduced clock
register. possible to terminate a power-down condition frequency and reduced voltage supply.
with either a reset or an external interrupt.
The low voltage operation of the aXCl,410 is
IEN1 (E8H)
To be able to wake up the part from the due in part to the Philips SACMOS process.
78S43210 power-<lown state with an external interrupt, This is a self aligned contact CMOS process
1~1~1~1~1~1~1~lwl both the PO and IDL bits of the PCON in which the isolation regions between the
register must be set when entering the contacts and the edge of the isolation have
EX9-EX2-Extemal interrupt enables for power-<lown mode. If only the PO bit is set, been eliminated. This significantly reduces
external interrupts 2 - 9. (0 =disabled, 1 = the power-<lown mode will only be terminated the size of the die, which in tum reduces the
enabled) by a hardware reset. With both bits set, an parasitic capacitances and drain resistance.
interrupt on any of the additional external This means that for a given clock speed,
IP1-Jnterrupt priority register one. This interrupts, INT2-INT9, will cause the part to parts fabricated in the SACMOS process will
register allows the priority level of each of the wake up. To ensure that the oscillator is require less power, and this is most apparent
additional external interrupt enables to be set. stable before the controller restarts, the at low frequencies and voltage supply levels.
Power-Down
The 8XCL41 0 has two reduced power modes • 12C Serial Interface
that are the same as those on the standard • Two power control modes
BOC51. The special reduced power feature of
- Idle mode
this part is that it can be stopped and then
- Power-down mode - can be terminated P2.71A15
restarted. Running from an external clock
source, the clock can be stopped and after a by reset or external interrupt P2.6IA14
period of time restarted. The 8XCL41 0 will • Wake-up via external interrupts at port 1 P2.SJA13
resume operation from where it was when the
code stopped with no loss of internal state, • On-chip oscillator (quartz crystal, ceramic P2.41A12
RAM contents, or Special Function Register resonator, RC, LC)
P2.31A11
contents. If the internal oscillator is used the
• Very low power consumption P2.2IA10
part cannot be stopped and started, but the
power-down mode, which can be terminated • Operating temperature range: XTAL1 P2.11A9
via an interrupt, can be used to achieve -40 to +85°C
vss P2.01A9
similar power savings and then restart
without loss of on-chip RAM and Special
Function Register values.
NOTE:
1. The currently available product is guaranteed up to 12MHz at 4.5V. A 16MHz device will be made available during 1992.
ORDERING CODE
PHILIPS PART ORDER NUMBER
PART MARKING SIGNETICS PART ORDER NUMBER' TEMPERATURE (DC)
Foremulation purposes, the P85CLOOO (Piggyback version) with 256 bytes of RAM is recommended.
LOGIC SYMBOL
g}
VDD Vss
Q Addre.. and
~~ Oat.Bus
0.-.
-. 4-+
~ :~:
..- INT2
. . - INT3
;;:=
~ ___ INT6
. . - 1NT7
. - . INTB/scL
. - . INT9JSDA
~jm-~
BLOCK DIAGRAM
FREQUENCY
REFERENCE COUNTER (1)
,.--L--, ,.--L--,
XTAL2 XTAL1 TO T1
CPU
10
INTERNAL
INTERRUPTS
12 C.BUS SERIAL 110
I
I
I
L __ ______ .J
PIN DESCRIPTION
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
Vee 40 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.O-O.7 39-32 110 Port 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 pins that have 1s written to them float and
can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and data bus
during accesses to external program and data memory. In this application, it uses strong internal
pull-ups when emitting 1s.
Pl.0-P1.7 1--8 110 Port 1: Port 1 is an 8-bit bidirectional 110 port with internal pull-ups. Port 1 pins that have 1s written to
them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 1 pins that are
externally pulled low will source current because of the internal pull-ups. (See DC Electrical
Characteristics: lid. Additional functions include:
7 110 SCL (Pl.6): 12C serial bus clock.
8 110 SDA (Pl.7): 12C serial bus data.
1--8 I INT2-fNT9 (Pl.G-Pl.7): Additional external interrupts.
P2.O-P2.7 21-28 110 Port 2: Port 2 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 2 pins that have 1s written to
them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins that are
externally being pulled low will source current because of the internal pUll-Ups. (See DC Electrical
Characteristics: lid. Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that use 16-bit addresses (MOVX @DPTR). In
this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data
memory that use 8-bit addresses (MOV @Ri), port 2 emits the contents of the P2 special function
register.
P3.O-P3.7 10-17 1/0 Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins that have 1s written to
them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins that are
externally being pulled low will source current because of the pull-ups. (See DC Electrical
Characteristics: 11ll. Port 3 also serves the special features of the 80C51 family, as listed below:
12 I Tm1I (P3.2): External interrupt 0
13 I lfITf (P3.3): External interrupt 1
14 I TO (P3.4): Timer 0 external input
15 I T1 (P3.5): Timer 1 external input
16 0 WR (P3.6): Extemal data memory write strobe
17 0 lID" (P3.7): External data memory read strobe
RST 9 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the device. An
internal diffused resistor to Vss permits a power-on reset using only an external capacitor to Vee.
ALE 30 0 Address Latch Enable: Output pulse for latching the low byte of the address during an access to
external memory. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency,
and can be used for external timing or clocking. Note that one ALE pulse is skipped during each access
to external data memory.
PSEN 29 0 Program Store Enable: The read strobe to external program memory. When the device is executing
code from the external program memory, PSEN is activated twice each machine cycle, except that two
PSEN activations are skipped during each access to external data memory. PSEN is not activated
during fetches from internal program memory.
D: 31 I Exlernal Access Enable: EA must be externally held low 10 enable the device 10 fetch code from
exlernal program memory locations OOOOH to 1FFFH. If EA is held high, the device executes from
internal program memory unless the program counter contains an address greater than OFFFH.
XTAL1 19 I Crystal 1 : Input to the inverting oscillator amplifier and inpulfor an external clock source.
XTAL2 18 0 Crystal 2: Output from the inverting oscillator amplifier.
PORT OPTIONS Two cases have to be examined. First, Option 2: Open drain-quasi-bidirectionaII/O
The pins of port I (not PI.Slsel or accesses to external memory (EA ~ 0 or with n-channel open drain output
PI.7/SDA), port 2, and port 3 may be access above the built-in memory boundary), Use as an output requires the
individually configured with one of the and second, 1/0 accesses. connection of an external pull-up
following port options (see Figure I): resistor. See Figure l(c).
External Memory Accesses
Option 1: Standard Por\- Option 3: Push-Pull-output with drive
quasi-bidirectional 110 with pull-up. Option 1: True 0 and 1 are written as capability in both polarities. Under
The strong booster pull-up p1 is address to the external memory this option, pins can only be used
turned on for two oscillator periods (strong pull-up is used). as outputs.
after a O-t0-1 transition in the port Option 2: An external pull-up resistor is Individual mask selection of the post-reset
latch. See Figure 1(a). needed for external accesses. state is available on any of the above pins.
Option 2: Open Draln-quasi-bidirectional Make your selection by appending "SO or "R"
Option 3: True 0 and 1 are written as
1/0 with n-channel open drain address to the external memory to option 1, 2, or 3 above (e.g., 1S for a
output. Use as an output requires standard 1/0 to be set after RESET or 2R for
(strong pull-up is used).
the connection of an external an open-drain 1/0 to be reset after RESET.
pull-up resistor. See Figure 1(b). I/O Accesses Option S: Set-after reset, this pin will be
Option 3: Push-Pull-output with drive Option 1: When writing a 1 to the port latch, initialized High.
the strong pull-up p1 will be on for
capability in both polarities. Under Option R: Reset-after reset, this pin will be
two oscillator periods. No weak
this option, pins can only be used initialized low.
pull-up exists. Without an external
as outputs. See Figure I (c).
pull-up, this option can be used as
The definition of port options for port 0 is a high-impedance input.
slightly different.
+5V
P2
1
0
FROM PORT
LATCH
INPUT DATA
INPUT
BUFFER
(8)
+5V
EXTER-
NAL
PULL-UP
0
FROM PORT
LATCH
. I~"
INPUT DATA ..
READ PORT PIN
(b)
+5V
STRONG PULL-UP
..
], [3
1
0
FROM PORT
LATCH
(e)
Figure 1. Ports
POWER-DOWN MODE before the controller restarts, the internal cause PCON to be cleared by hardware;
The instruction setting PCON.1 is the last clock will remain inactive for 1536 oscillator terminating idle mode. The interrupt is
executed prior to going into the power-down periods after the interrupt is detected. After serviced, and following the instruction RETI,
mode. In power-<!own mode, the oscillator is this, the PD flag will be reset, the controller is the next instruction to be executed will be the
stopped. The contents of the the on-chip now in the Idle mode and the interrupt will be one following the instruction that put the
RAM and SFRs are preserved. The port pins handled in the normal way. device in the the idle mode.
output the values held by their respective Flag bits GFO and GF1 can be used to
SFRs. ALE and PSElir are held low. Reset Mode
determine whether the interrupt was received
Power-<!own operates in wake-up mode and Setting only the PD bit in the PCON register
during normal execution or idle mode. For
reset mode. again forces the controller into the
example, the instruction that writes to
power-down mode, but in this case it can only
In the power-down mode, VDD may be PCON.O can also set or clear one or both flag
be restored to normal operation with a direct
reduced to minimize power consumption. bits. When idle mode is terminated by an
reset operation.
However, the supply voltage must not be interrupt, the service routine can examine the
reduced until the power-<!own mode is active, status of the flag bits.
and must be restored before the hardware IDLE MODE The second method of terminating the idle
reset is applied and frees the oscillator. Reset The instruction that sets PCON.O is the last mode is with an external hardware reset.
must be held active until the oscillator has instruction executed before going into idle
Since the oscillator is still running, the
restarted and stabilized. mode. In idle mode, the internal clock is hardware reset is required to be active for
stopped for the CPU, but not for the interrupt,
only two machine cycles to complete the
Wake-Up Mode timer, and serial port functions. The CPU reset operation. Reset redefines all SFRs, but
Setting both PD and IDL flags in the PCON status is preserved along with the stack
does not affect the on-chip RAM.
register forces the controller into the pointer, program counter, program status
power-<!own mode. Setting both flags enable word and accumulator. The RAM and all The status of the external pins during idle and
the controller to be woken-up from the other registers maintain their data during idle power-down mode is shown in Table 1. If the
power-<!own mode with either the external mode. The port pins retain the logical states power-down mode is activated while
interrupts INT2-INT9, or a reset operation. they held at idle mode activation. ALE and accessing external memory, port data held in
PSEJII hold at the logic high level. the special function register P2 is restored to
An external interrupt INT2-1NT9 at port 1
port 2. If the data is a logic 1, the port pin is
releases both the oscillator and the delay There are two methods used to terminate the
held high during the power-down mode.
counter. To ensure that the oscillator is stable idle mode. Activation of any interrupt will
I SLAVE ADDRESS I
S1ADR
Figure 2. SerialliO
12C-8US SERIAL 1/0 AA Assert acknowledge bit. When STO STOP flag. With this bit set while
The serial port supports the twin line 12C-bus. the AA flag is set, an in master mode, a STOP
The 12C-bus consists of a data line (SDA) and acknowledge (low level to SDA) condition is generated. When a
a clock line (SCl). These lines also function will be returned during the STOP condition is detected on
as 110 port lines P1.7 and P1.6 respectively. acknowledge clock pulse on the the bus, the SIO hardware clears
The system is unique because data transport, SCl line when: the STO flag. In the slave mode,
clock generation, address recognition and - own slave address is received the STO flag may also be set to
bus control arbitration are all controlled by - general call address is recover from an error condition.
hardware. The 12C-bus serial 110 has received (S1ADR.O: 1) In this case, no STOP condition
complete autonomy in byte handling and - data byte received while is transmitted to the 12C-bus.
operates in four modes: device is programmed as However, the SIO hardware
- Master transmitter master behaves as if a STOP condition
- Master receiver - data byte received while has been received and releases
device is selected slave SDA and SCL. The SIO then
- Slave transmitter
switches to the "not addressed"
- Slave receiver Withe AA : 0, no acknowledge
slave receiver mode. The STO
will be returned. Consequently,
These functions are controlled by the S1 CON flag is automatically cleared by
no interrupt is requested when
register. S1STA is the status register whose hardware.
the "own slave address· or
contents may also be used as a vector to general call address is receiVed. STA START flag. When the STA bit is
various service routines. S1 DAT is the data set in slave mode, the SIO
shift register and S1ADR the slave address SI SIO interrupt flag. When the SI
hardware checks the status of
register. Slave address recognition is flag is set, an acknowledge is
the 12C-bus and generates a
performed by hardware. returned after anyone of the
START condition if the bus is
following conditions:
free. If STA is set while the SIO
SlCON (DSH) - a start condition is generated
is in master mode, SIO transmits
Serial control register in master mode
a repeated START condition.
- own slave address received
duringAA: 1 ENSl When ENS1 : 0, the SIO is
- general call address received disabled. The SDA and SCl
while S1ADR.O and AA : 1 outputs are in a high-impedance
- data byte received or state; P1.6 and P 1.7 function as
CRD, CRl These two bits determine the
transmitted in master mode open drain ports.
serial clock frequency when SIO
(even if arbitration is lost)
is in a master mode. When ENS1 : 1, the SIO is
- data byte received or
enabled. The P1.6 and P1.7 port
transmitted as selected slave
latches must be set to logic 1.
- stop or start condition received
as selected slave receiver or
transmitter
I~I~I~I~I~I~I~I~I
IXl.S IL7 Extemal interrupt 7 polarity SFR
level Register Function Address
IXl.4 IL6 Extemal interrupt S polarity IXI Interrupt polarity register E9H
Bit Symbol Function level IROI Interrupt request flag COH
IEN1.? EX9 Enable external interrupt 9 IX1.3 ILS External interruptS polarity register
IEN1.S EXS Enable external interrupt S level IENO Interrupt enable register ASH
IEN1.S EX7 Enable external interrupt 7 IX1.2 IL4 External interrupt 4 polarity IENI Interrupt enable register ESH
IEN1.4 EXS Enable external interrupt S level (INT2-1NT9)
lEN 1.3 EXS Enable external interruptS IX1.l IL3 External interrupt 3 polarity IPO Interrupt priority register BSH
IEN1.2 EX4 Enable external interrupt 4 level IPI Interrupt priority register FSH
IEN1.l EX3 Enable external interrupt 3 IXl.O 1L2 External interrupt 2 polarity (I NT2-1NT9)
IEN1.0 EX2 Enable external interrupt 2 level
where 0 = interrupt disabled Writing either a "1" or "0" to an IXI register bit
1 = interrupt enabled sets the priority level of the corresponding
external interrupt to active High or Low,
respectively.
OSCILLATOR CIRCUITRY The following options are provided for Power-on Reset
The on-dlip oscillator circuitry of the optimum on-chip oscillator performance. The eXCL41 0 contains on-Chip circuitry
8XCL410 is a single stage inverting amplifier Please state option when ordering: which switch the port pins to the
biased by an internal feedback resistor. (See 32kHz: Figure 4(c). An option for 32kHz customer-defined logic level as soon as VDD
Figure 3.) The oscillator can be operated with clock applications with external exceeds 1.3V. (See Figures 7 and e.) As
a quartz crystal, ceramic resonator, LC trimmer for frequency adjustment. soon as the minimum supply voltage is
network or RC network. See Figure 4 for reached, the oscillator will start up. However,
different configurations. When ordering parts, A 4.7MQ bias resistor must be to ensure that the oscillator is stable before
it is necessary to specify an oscillator option. connected in parallel with the crystal. the controller starts. the clock signals are
The options are: RC when an RC network will Osc.2: Figure 4(e). An option for low-power, gated away from the CPU for a further 1536
be used, OSC 2 for oscillator operation below low-frequency operations using LC oscillator periods.
4MHz, OSC 3 for oscillator operation from components or quartz. An hysteresis of approximately 100mV at a
4MHz to 10MHz, OSC 4 for oscillator
Osc.3: An option for medium frequency typical power-on switching level of 1.3V will
operation above 10MHz, and 32kHz if 32kHz
range applications. ensure correct operation.
to 400kHz operation is desired.
Osc.4: An option for high frequency range An automatic reset can be obtained at
For operation as a standard quartz oscillator,
applications. power-on by connecting the RST pin to VDD
no external components are needed (except
via a 10flF capacitor. At power-on, the
at 32KHz). When using external capacitors, RC: Figure 4(g). An option for an RC voltage on the RST pin is equal to VDD minus
ceramic resonators, coils, and RC networks oscillator. the capacitor voltage, and decreases from
to drive the oscillator, five different
The equivalent circuit data of the internal VDD as the capacitor discharges through the
configurations are supported (see Figure 4
oscillator compares with that of matched internal resistor RRST to ground. The larger
and Table 2).
crystals. the capacitor, the more slowly VRST
In the power-down mode the oscillator is decreases. VRST must remain above the
stopped and XTAL 1 is pulled high. The The externally adjustable RC oscillator has a lower threshold of the Schmitt trigger long
oscillator inverter is switched off to ensure no frequency range from 100kHz to 500kHz. enough to effect a complete reset. The time
current will flow. To drive the device with an (See Figure 6.) required is the oscillator start-up tirne, plus 2
external clock source, apply the external machine cycles.
clock signal to XTAL 1, and leave XTAL2 to
float, as shown in Figure 4(f). There are no
requirements on the duty cycle of the external
clock, since the input to the internal clocking
circuitry is split using a flip-flop.
Yee
To internal
timing circuits
vee vee
Cl i
61 XTALI XTAL2
T
o
C2j
~--------~Dr---------~
Figure 3. Oscillator
Quartz Crystal
--XTAl2 -- ---rr--
--XTALR-- -----
+
(a) Oscillator Configuration for
+
External Capacito~s
---=L~----XTA:-
XTAll XTAL2 I
I
I
I
J J! ~!
(e) Configuration for
I
~ (f) External Clock
I
~
~'''l
(g) RC Network
LC Network Configuration Configuration
-------------- -------------- --------------
Figure 4. Oscillator Configurations
LC Osc.2 20 90 20 90 10flH = 10
l00flH =5Q
lmH = 75Q
NOTE:
1. 32kHz quartz crystals with a series resistance higher than 15k.Q will reduce the guaranteed supply voltage range to 2.5 to 3.5V.
R,
nAL1 ----~--~==J------.----------~~------------~~--
600
400 \
lose
(kHz)
\
200
"" ~ r--
o RC([JS)
SUPPLY VOlTAGE
POWER-ON RESET
~NTERNALJ
OSCILLATOR
k "
...... I
CPU RUNNING
I I
•
START-UP 1536 OSCILLATOR
./
TIME PERIODS DELAY
vcc
vccJ
10~F T+
RST
8XCL410
[) RRST
DC ELECTRICAL CHARACTERISTICS
Tant> = -40 a c to +8Sa C, Vss = OV
TEST LIMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
Vee Supply voltage lelK (see Figure 12) 1.8 6.0 V
RAM retention voltage in power-down mode 1.0 - V
lee Power supply current:
Operating1
OSC 1 option feLK = 32kHz, Vee = I.BV, Tant> = +2S aC - 50 JlA
OSC20ption felK = 3.58MHz, Vee = 3V - 2.5 rnA
OSC20ption felK = 10MHz, Vee = SV - 14 rnA
OSC30ption felK = 16MHz, Vee = SV - IB rnA
OSC 4 option felK = 16MHz, Vee = SV - 22 rnA
Idlemode2
OSC 1 option felK = 32kHz, Vee = 1.8V, Tant> = +2SaC - 25 JlA
OSC 2 option felK = 3.58MHz, Vee = 3V - 1.0 rnA
OSC20ption felK = 10MHz, Vee = SV - 5.0 rnA
OSC30ption felK = 16MHz, Vee = SV - 7.5 rnA
OSC 4 option felK = 16MHz, Vee = SV - 9.0 rnA
Power-down mode!! Vee = I.BV, Tant> = +2S aC - 10 JlA
Vil Input low voltage Vss 0.3Vee V
VIH Input high voltage 0.7Vee Vee V
IOl Output sink current, except SDA, SCl Vee = SV, VOL = 0.4V 1.6 rnA
Vee = 2.SV, VOL = 0.4V 0.7 rnA
lou Output sink curren~ SDA, SCl Vee = SV, VOL = O.4V 3.0 rnA
IOH Output source current (push-pull options only) Vee = SV, VOH = Vee - 0.4V 1.6 rnA
Vee = 2.SV, VOH = Vee - 0.4V 0.7 rnA
III logical 0 input curren~ ports I, 2, 3 Vee = SV,VIN = 0.4V -100 JlA
Vee = 2.SV,VIN = 0.4V -50 JlA
ITL Logical 1-to-0 transition current, ports I, 2, 3 Vee = SV, VIN = Veol2 -1.0 rnA
Vee = 2.SV, VIN = Veol2 -500 JlA
III Input leakage current, port 0, 81:, SCl, SDA Vss < VI< Vee ±10 JlA
RRST Internal reset pull-down resistor 10 200 k.Q
NOTES:
I. The operating supply current is measured with all output pins disconnected; XTAll driven with t,. = tf = IOns; VIL = Vss, VIH = Vee; XTAL2
not connected; 81: = RST = Port 0 = Vee; all open drain outputs connected to Vss.
2. The idle supply current is measured with all output pins disconnected; XTAll driven with t, = ~ = IOns; VIL = Vss, VIH = Vee; XTAL2 not
connected; 81: = Port 0 = Vee; RST = Vss; all open drain outputs connected to Vss.
3. The power-down current is measured with all output pins disconnected; XTAll not connected; 81: = port 0 = Vee; RST = Vss; all open-drain
outputs connected to Vss. .
4. The RC-oscillator is not implemented in this version.
5. Circuits with option "no power-on reset" are tested at VeeMIN = 1.8V, with option POR = 1.3V at VeeMIN = 2.SV.
1.8
1.8
1A L
1.2 L
1.0 /
100 (mA)
0.8
1.2MHz /
V
0.6 ,..... L
V
--
OA
V V ~
-
32kHz
0.2
-I'"'"
~
r-
0
0 1 2 3 4 5 6
AC ELECTRICAL CHARACTERISTICS
vss; OV'. 2
T anD; -4O·C to +85·C
12MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
Program Memory
It.w 10,11 ALE low to flU or WR low 200 300 3lcLcL-50 3lcLCL+5O ns
ALE
PORTO
PORT 2 A8-A15
ALE
tWHLH -
14------tLD - - - -.. ~I
--+!oot-----tRR ---~
RD _ _ _ _ _ _ + ____,
---f4--tRD - -
k---~---~D----~
ALE
tWHlH -
---I----tww ---~
WR------f----"'
-~--4---- tow-----~
PORT 2
P2.~7 OR A8-A'5 FROM DPH A8-A15 FROM PCH
O.7VDD O.7Voo
UVoo
Teatpolnta
OAVDD
O.3VOD O.3VOO
'mA ITl
-Ill
,OOj!A
o VDI)I2 VDD
100 16
I
10 V 12 II
./
16MIfz /
/
f (MHz) 1
'" lOU (mA) 8 / J
12MIfz
./
/
4 ./
V
0.1
8M ... ,/"
~
V
3.58 Ifz ........
0.01 o
Voo (V)
Vou (V)
NOTE: Below 32kHz, clock has to be supplied externally.
Figure 15. Typical Operating Current as a Function of
Figure 14. Frequency Operating Range Frequency and Vou • T.mb = 25°C
5
J 8
/
4
/
//
3
16MIfz/ V
~OLE
(mA.) / V/
12~ Ifz
2 / /
)/ / /
/
8M
lz/
/ V
1
V
0
0 1
3'jMIfz
2
.- 3
./
4 5 6 o ---
:,....-'""
/
Voo(V) Vuu(V)
Figure 16. Typical Idle Current as a Function of Figure 17. Typical Power-Down Current Vs.
Frequency and Voo , Tomb 25"C = Frequency and Vuo. Tomb = 25°C
PIGGYBACK SPECIFICATION • 8-bit CPU, RAM, I/O in a single • Enhanced architecture with:
The diHerences between the masked version 4Q-lead DIP - non-page oriented instructions
and the piggyback are described herein.
• Socket for up to 16k external EPROM - direct addressing
General Description - four eight byte RAM register banks
• 256 bytes RAM, expandable externally to
The P85CLOOOHFZ is a piggy-back version 64Kbytes - stack depth up to 128 bytes
with 256 bytes of RAM used for emulation of - multiply, divide, subtract and compare
the P83CL410 microcontroller. The • Four 8-bit ports, 32 I/O lines instructions
P85CLOOOHFZ is manufactured in an
• Two 16-bit timer/event counters • STOP and IDLE instructions
advanced CMOS technology. The instruction
set of the P85CLOOOHFZ is based on that of • External memory expandable up to 128K, • Wake-up via external interrupts at port 1
the 8051. The device has low power external ROM up to 64K and/or RAM up to
consumption and a wide supply voltage 64K • Single supply voltage of 1.8V to 6.0V
range. The P85CLOOOHFZ has two software
• Thirteen source, thirteen vector interrupt • On-chip oscillator (option: oscillator 4)
selectable modes of reduced activity for
further power reduction: Idle and structure with two priority levels
• Very low current consumption
Power-down. For timing and AC/DC • Full duplex serial port (UART)
characteristics, please refer to the P83CL410 • Operating temperature range:
specifications. • 12C-bus interface for serial transfer on two -40 to +85°C
lines
Features
• Full static 8OC51 CPU
STANDARD PIGGYBACK
Types: P85CLOOOHFZ
Emulation for: P83CL410, P80CL51
Ust of differences between masked microcontroller and corresponding piggyback:
PARAMETER MASKED CONTROLLER PIGGYBACK
RAM size 128 256
ROM size 4k EPROM size dependent (max 16k)
Portoplion 1,2,3 1
Oscillator option 32kHz, Osc, 2, 3, 4, RC Osc.4
Mech. dimensions Standard Dual In-Line, Small OuUine See Figure 18
Current cons. 100 100 (OSC. 4) + IEPROM
Voltage range full full,limited b~ E~BOM
ESD specification not tested (different package)
..:::
==rr
- )(
~
H
~~
)(
c
:11
..g
E
E
E
1 ~ l:!
0
EE
EE
@ I @
@ I @ EPROM
)(
c I
:11 @ I @ 64k Bk Bytes
E
E @ I @ 12Bk 16k Bytes
:1!0 I
@ I @
~ @ @
t @ I @
~
@ II @
@ I @
~
J
@ I @
~ I
@ I @
@ @
28 @ I @
~
)(
@
~
:I \g1
@
c @ @
:11 I
E
E @ I @
I
~ @ I @
~ ~ @ @
I A,
I
I
w
z
:s
0..
"zF'=
ill
(I)
8XC451 OVERVIEW Differences From the 80C51 Buffer Full (OBF) flag, input a
The SOC451,the 83C451 , and the 87C451 register select signal (SEL), or
(hereafter referred to collectively as the Special Function Registers output a high or low logic level.
8XC451) are 110 expanded versions of the The SFRs are identical to those of the
Port 6 can be used in a number of different
SOC51. Three I/O ports have been added to standard 80C51 with the exception of four
registers that have been added to allow ways to facilitate data communication. It can
the basic 80C51 architecture for a total of7 be used as a processor bus interface, as a
on-chip 110 ports. The LCC version has a control of the three additional 110 ports P4,
standard quasi-bidirectional 110 port, or as a
total of 68 pins. The DIP version has 64 pins. P5, and P6. The additional registers are P4,
P5, P6, and GSA. Registers P4, P5, and P6 parallel printer port (either polled or interrupt
Port 6 has 4 control lines to facilitate driven).
high-speed asynchronous 110 functions. function as port latches lor ports 4, 5, and 6,
respectively. These registers operate Processor Bus Interface
identically to those for ports 0 through 3 of Port 6 allows the use of an 8XC451 as an
The 83C451/87C451 includes a 4k x 8 the 80C51. element on a microprocessor type bus. The
ROM/EPROM, a 128 x 8 RAM, 56 (LCC) or host processor could be a general purpose
The Control Status Register (CSR) is used to
52 (DIP) 110 lines, two 16-bit timer/counters MPU or the data bus of a microcontroller like
a five source, two priority, level nested ' control the mode of operation of port 6 and
indicates the current status of port 6. All the 8XG451 itself. Setting up the 8XC451 as
interrupt structure, a serial 110 port for either a processor bus interface allows single or
control status register bits can be read and
full duplex UART, 110 expansion, or mUltiple microcontrollers to be used on a bus
written by the CPU except bits 0 and 1, which
multiprocessor communications, and an as flexible peripheral processing elements.
are read only. A Reset writes ones to bits 2-7
on-chip oscillator and clock circuits. The Applications can include: keyboard scanners
and zeros to bits 0 and 1. See Table 1 for the
SOC451 includes all of the 83C451 features serial 110 controllers, servo controllers, etc. '
specific function of each bit in the Control
except the on-board 4k x 8 ROM.
Status register. On rese~ port 6 is programmed correctiy (that
is, Special Function registers CSR and P6)
The 8XC451 has two software selectable 110 Port Structure for use as a bus interface. This prevents the
modes of reduced activity lor further power The 8XC451 has a total of seven parallel 110 interface from disrupting data on the bus of a
reduction: idle mode and power-down mode. ports. The first four ports, PO through P3, are host processor during power-up.
Idle mode freezes the CPU while allowing the identical in function to those present on the
80C51 family. The added ports 4 and 5 are Standard auasi-bidireclionalliO Port
RAM, timers, serial port, and interrupt system
identical in function to port 1; that is, they are To use port 6 as a common I/O port, all of the
to continue functioning. Power-tlown mode
standard quasi-bidirectional ports with no control pins should be tied to ground. On
freez~s the oscillator, causing all other chip
al~rnate functions and the standard output hardware reset, bits 2-7 of the GSR are set to
functlons to be inoperative while maintaining
dnve characteristics. Note that on the 68-pin one. With the control pins grounded, the
the RAM contents.
LCC packages, port 4 is an 8-bit port, while port's operation and electrical characteristics
on the 64-pin DIP packages, only the lower will be identical to port 1 on the SOC51. No
The 8XC451 features include: four bits of port 4 are available. Port 6 is a further software initialization is required.
• SOC51 based architecture specialized 8-bit bidirectional 110 port with Parallel Printer Port
internal pullups. This special port can The 8XC451 has the capacity to permit all of
• 68-pin LCC and 64-pin DIP packages sink/source three LS TTL inputs and drive the intelligent features of a common printer to
CMOS inputs without external pullups. The be handled by a single chip. The features of
• Seven 8-bit 110 ports (LCC version) flexibility of this port facilitates high-speed port 6 allow a parallel port to be designed
parallel data communications. Port 6 with only line driving and receiving chips
• Six 8-bit ports and one 4-bit port (DIP operating modes are controlled by the port 6 required as additional hardware. The onboard
version) Control Status Register (CSR). Port 6 and the UART allows RS232 interfacing with only
CSR are addressed at the Special Function level shifting chips added. The 8-bit parallel
• 4k x 8 ROM or EPROM Addresses shown in Table 2. Port 6 can be ports 0 to 6 are ample to drive onboard
used as a standard I/O port, or in strobed control functions, even when ports are used
.128x8 RAM modes of operation in conjunction with the lor external memory access, interrupts, and
four port 6 control lines listed below: other functions. The RAM addressing ability
• Two 16-bit counterltimers of ports 0 to 2 can be used to address up to
ODS Output data strobe (active low)
64k bytes of a hardware buffer/spooler.
• Two external interrupts IDS Input data strobe (active low)
In addition, either end of a parallel interface
BFLAG Bidirectional VO pin. Can be
• External memory addressing capability can be implemented using port 6, and the
programmed to output the Input
interfaces can be interrupt driven or polled in
- 64k ROM and 64k RAM Buffer Full IIag (IBF), input an
either case. For more detailed information on
active low Port Enable (PE)
port 6 usage, reter to the application notes
• Low power consumption signal, or output a high or low
contained in Section 4, entitled "SOC451
logic level.
- Idle mode Operation of Port 6" and "256k Centronics
AFLAG Bidirectional 110 pin. Can be Printer Buffer Using the SC87G451
- Power-down mode programmed to output the Output Microcontroller. "
Output Buffer
Input Data Output Buffer Input Buffer
BFLAG Mode Select AFLAG Mode Select Flag Clear
Strobe Mode Full Flag Full Flag
Mode
0/0 = Logic 0 output" 0/0 = Logic 0 output 0= Negative 0= Positive o = Output 0= Input
011 = Logic 1 output" 011 = Logic 1 output edgeolOOS edgeolTUS data buffer data buffer
1/0 = IBF output 1/0 = OBF output" empty empty
111 = PE input 111 = SEL input 'I = Positive 'I = Low level 1 = Output 1 = Input
(0 = Select) (0 = Data) edgeolOOS olTUS data buffer data buffer
(1 = Disable I/O) (1 = Control/status) full full
NOTE:
" Output-always mode: MBI = 0, MA 1 = 1, AND MAO = O. In this mode, pert 6 is always enabled lor output. 'ODS" only clears the OBF flag.
EF EE ED EC EB EA E9 E8
CSR'# Port 6 command/status E8H MBl I MBO I MAl I MAO IOBFC IIOSM I OBF I IBF FCH
OPTR Data pointer (2 bytes)
OPH Data pointer high 83H OOH
OPL Data pointer low 82H OOH
BF BE BO BC BB BA B9 B8
IP' Interrupt priority BBH - I
-
I
- I
PS
I
PTl I PXl I PTO I PXO xxxOOOOOB
AF AE AD AC AB AA A9 A8
IE' Interrupt enable ASH EA
1 - I - 1 ES 1 ETl 1 EXl 1 ETO 1 EXO OxxOOOOOB
PO' PortO 80H B7 86 85 84 83 B2 81 80 FFH
Pl' Port 1 90H 97 96 95 94 93 92 91 90 FFH
P2' Port 2 AOH A7 AS AS A4 A3 A2 Al AO FFH
P3' Port 3 BOH B7 B6 BS B4 B3 B2 Bl SO FFH
P4'# Port 4 COH C7 CS C5 C4 C3 C2 Cl CO FFH
PS'# PortS CBH CF CE CD CC CB CA C9 C8 FFH
PS'# PortS 08H OF DE DO DC DB OA 09 08 FFH
07 OS 05 04 03 02 01 DO
PSW' Program status word DOH CY
1 AC I
FO I RSl I RSO I OV
I
- I
P OOH
SBUF Serial data buffer 99H xxxxxxxxB
9F 9E 90 9C 9B 9A 99 98
SCON' Serial port control 98H SMO 1 SMl J SM2 .1 REN 1 TBB 1 RBB 1 TI 1 RI OOH
SP Stack pointer B1H 07H
8F BE 80 8C 8B 8A 89 88
TCON' Timer/counter control B8H TFl I TRl I TFO I TAO I IEl
l ITl
J lEO
1 ITO OOH
P1.6
5 Pa3i1RTf
Pa2IIImJ
PaOlRxD ......_ _ _->--3 PalfTxD
10
26
88
27
LCC
:.
61
43
60
44
"0"
Vcc Vss
Lee
EjADDRESSAND
-
o
H 44 Ii:_ DATA BUS
~-
27 43
........
Pin function PIn function
1 FJWpp 35 RST
2 P2.OIA8 36 P3'o/RxD
3 P2.1/A9 37 P3.11TxD
4 P2.21Al0 as P3.211111111
5 P2.3/A11 39 1'3.3IINTl
6 P2.41A12 40 P3A/T0
7 P2.51A13 41 P3.5IT1
8 P2.6/A14 42 P3.6IWR
9 P2.7/A15 43 P3.7/RU
10 PO.7/AD7 44 1'5.0
11 PO.6/AOS 45 P5.1
12 PO.51A05 46 P52
13 PO.41AD4 47 P5.3
14 PO.3/A03 48 P5A
15 PO.21AD2 49 P5.5
16 PO.l/ADl 50 P5.6
17 PO.OIAOO 51 P5.7
18 Veo 52 XTAl2
19 P4.7 53 XTALl
20 P4.6 54 V..
21 P4.5 55 UIJS"
22 P4A 56 lOS
23 P4.3 57 BFLAG
24 P4.2 58 AFLAG
25 P4.1 59 P6.0
26 P4.0 60 P6.1
27 Pl.0 61 P62
2B Pl.l 62 P6.3
29 Pl.2 63 P6.4
30 Pl.3 64 P6.5
31 P1A 65 P6.6
32 Pl.5 66 P6.7
33 Pl.6 67 !'lIEN
34 Pl.7 6B ALEIPRCG
BLOCK DIAGRAM
r-------------,-1LLU.ltu..,
I ,..uLUJ"*-L, .-J-1'u..u.u.., ,-UJu:u.u..,
-------------,
I
I
!££t
vssl
f1
SBUF IE IP
INTERRUPT, SERIAL
PORT AND TIMER BLOCKS
I'SEJiI
ALEII'ROU
El\VPP
RST
XTAL2
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC TYPE NAME AND FUNCTION
Vss 50 54 I Ground: OV reference.
Vee IS IS I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.O-O.7 17-10 17-10 110 Pori 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 is also the multiplexed data and low-order
address bus during accesses to extemal memory. Extemal pull-ups are required during program
verification. Port 0 can sink/source eight LS TIL inputs.
Pl.O--Pl.7 23-30 27-34 110 Pori 1: Port 1 is an S-bit bidirectional 110 port with internal pUll-ups. Port 1 receives the low-order
address bytes during program memory verification. Port 1 can sink/source three LS TIL inputs, and
drive CMOS inputs without external pull-ups.
P2.O--P2.7 2-9 2-9 110 Pori 2: Port 2 is an 6-bit bidirectional 110 port with internal pull-ups. Port 2 emits the high-order
address bytes during access to external memory and receives the high-order address bits and control
signals during program verification. Port 2 can sink/source three LS TIL inputs, and drive CMOS
inputs without external pull-ups.
P3.O--P3.7 32-39 36-43 110 Pori 3: Port 3 is an S-bit bidirectional 110 port with internal pull-ups. Port 3 can sink/source three LS
TIL inputs, and drive CMOS inputs without external pull-ups. Port 3 also serves the special functions
listed below:
32 36 I RxD (P3.0): Serial input port
33 37 0 TxD (P3.1): Serial output port
34 38 I 1JIITlJ (P3.2): External interrupt
35 39 I JIilT1 (P3.3): External interrupt
36 40 I TO (P3.4): limer 0 external input
37 41 I T1 (P3.S): limer 1 external input
38 42 0 WR (P3.6): External data memory write strobe
39 43 0 1m (P3.7): External data memory read strobe
P4.O--P4.3 22-19 I/O Pori 4: Port 4 is a 4/6-bit (DIP/LCC) bidirectional 110 port with internal pull-ups. Port 4 can sink/source
P4.O--P4.7 26-19 110 three LS TIL inputs and drive CMOS inputs without external pul~ups.
PS.O--P5.7 40-47 44-51 I/O Pori 5: Port 5 is a 4/S-bit (DIP/LCC) bidirectional 110 port with internal pull-ups. Port 5 can sink/source
three LS TIL inputs and drive CMOS inputs without external pull-ups.
P6.o-P6.7 55-62 59-66 110 Pori 6: Port 6 is a specialized S-bit bidirectional I/O port with internal pull-ups. This special port can
sink/source three LS TIL inputs and drive CMOS inputs without external pull-ups. Port 6 can be used
in a strobed or non-strobed mode of operation. Port 6 works in conjunction with four control pins that
serve the functions listed below:
ODS 51 55 I ODS: Output data strobe
IDS 52 56 I IDS: Input data strobe'
BFLAG 53 57 110 BFLAG: Bidirectional I/O pin with internal pull-ups
AFLAG 54 58 110 AFLAG: Bidirectional 110 pin with internal pull-ups
RST 31 35 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the device. An
internal pull-down resistor permits a power-on reset using only an external capacitor connected to Vee.
ALEIPROO 64 68 110 Address Latch Enable/Program Pulse: Output pulse for latching the low byte of the address during
an access to external memory. ALE is activated at a constant rate of 1/6 the oscillator frequency
except during an external data memory access, at which time one ALE is skipped. ALE can
sink/source three LS TIL inputs and drive CMOS inputs without external pUll-Ups. This pin is also the
program pulse during EPROM programming.
l'SEN 63 67 0 Program Store Enable: The read strobe to external program memory. PS"EN is activated twice each
machine cycle during fetches from external program memory. However, when executing out of external
program memory. two activations of PSEliI are skipped during each access to external program
memory.l'SEN is not activated during fetches from internal program memory. PS"EN can sink/source
eight LS TIL inputs and drive CMOS inputs without W1 external pull-up. This pin should be tied low
during programming.
T:lVVpp 1 1 I Instruction Execution Control/Programming Supply Voltage: When EA is held high, the CPU
executes out of internal program memory, unless the program counter exceeds OFFFH. When EA is
held low, the CPU executes out of external program memory. EA must never be allowed to float. This
pin also receives the 12.75V programming supply voltage (Vpp) during EPROM programming.
XTALl 49 53 I Crystal 1: Input to the inverting oscillator amplifier that forms the oscillator. This input receives the
external oscillator when an external oscillator is used.
XTAL2 48 52 0 Crystal 2: An output of the inverting amplifier that forms the oscillator. This pin should be floated when
an external oscillator is used.
PORTS 4 AND 5 the output buffer, or the contents of the port 6 buffer is transparent when lOS i!;low, and
Ports 4 and 5 are bidirectional 1/0 ports with control status register will output on port 6. latched when lOS is high.
internal pull-ups. Port 4 is an 8-bit port (lCC This feature grants complete port 6 status to
CSR.3 Output Buffer Full Flag Clear Mode
version) or a 4-bit port (DIP version). Port 4 external devices.
(OBFC) - When CSR.3 =1, the positive
and port 5 pins with ones written to them, are BFLAG - BFLAG is a bidirectional 110 pin edge of the ~ input clears the OBF flag.
pulled high by the internal pull-ups, and in which can be programmed to be an output, When CSR.3 = 0, the negative edge of the
that state can be used as inputs. Port 4 and 5 set high or low under program control, or to ~ input clears the OBF flag.
are addressed at the special function register output the state of the input buffer full flag.
addresses shown in Table 1. CSR.4, CSR.S AFLAG Mode Select (MAO,
BFLAG can also be programmed to input an
MAl) - Bits 4 and 5 select the mode of
enable signal for port 6. When BFLAG is
PORT 6 used as an enable input, port 6 output drivers
operation for the AFLAG pin as follows:
Port 6 is a special 8-bit bidirectional 1/0 port MA1 MAO AFLAG Function
are in the high-impedance state, and the
with internal pull-ups (see Figure 1). This port o 0 Logic 0 output
input latch does not respond to the lOS
cen be used as a standard 110 port, or in o 1 logic 1 output
strobe when BFLAG is high. Both features
strobed modes of operation in conjunction are enabled when BFLAG is low. This feature 1 0 OBF flag output (CSR.l)
with four special controllines:~,IUS, facilitates the use of the SC8XC451 in bused 1 1 Select (SEl) input mode
AFLAG, and BFLAG. Port 6 operating modes
multiprocessor systems.
are controlled by the port 6 control status The select (SEl) input mode is used 10
register (CSR). Port 6 and the CSR are CONTROL STATUS REGISTER determine whether the port 6 data register or
addressed at the special function register The control status register (CSR) establishes the control status register is output on port 6.
addresses shown in Table 1. The following the mode of operation for port 6 and indicates When the select feature is enabled, the
four control pins are used in conjunction with the current status of port 6110 registers. All AFLAG input controls the source of port 6
port 6: control status register bits can be read and output data. A logic 0 on AFLAG input selects
written by the CPU, except bits 0 and 1, the port 6 data register, and a logic 1 on
ODS - Output data strobe for port 6. ~
which are read only. Reset writes ones to bits AFLAG input selects the control status
cen be programmed to control the port 6 register.
output drivers and the output buffer full flag 2 through 7, and writes zeros to bits 0 and 1
(OBF), or to clear only the OBF flag bit in the (see Table 2). CSR.6, CSR.7 BFLAG Mode Select (MBO,
CSR (output-always mode). ~ is active CSR.O Input Buffer Full Flag (IBF) (Read MB1) - Bits 6 and 7 select the mode
low for output driver control. the OBF flag can Only) - The IBF bit is set to a logic 1 when operation as follows:
be programmed to be cleared on the negative port 6 data is loaded into the input buffer MB1 MBO BFlAG Function
or positive edge of~. under control of lOS. This can occur on the 0 0 logic 0 output
11m - Input data strobe lor port 6. IUS is used negative or positive edge of lOS, as 0 1 Logic 1 output
to control the port 6 input latch and input detennined by CSR.2 IBF is cleared when 1 0 IBF flag output (CSR.O)
buffer full flag (IBF) bit in the CSR. The input the CPU reads the input buffer register. 1 1 Port enable (PEl
data latch can be programmed to be CSR.l Output Buffer Full Flag (OBF) In the port enable mode, lOS and ~ inputs
transparent when IUS is low and latched on (Read Only) - The OBF flag is set to a logic are disabled when BFLAG input is high.
the positive transition of IUS, or to latch only 1 when the CPU writes to the port 6 output When the BFLAG input is low, the port is
on the positive transition of IUS. data buffer. OBF is cleared by the positive or enabled for 110.
Correspondingly, the IBF flag is set on the negative edge of~, as detennined by
negative or positive transition of lOS. CSR.3. SPECIAL FUNCTION REGISTER
AFLAG - AFLAG is a bidirectional 110 pin CSR.2IDS Mode Select (IOSM) - When ADDRESSES
which can be programmed to be an output CSR.2 = 0, a Iow-to-high transition on the Special function register addresses for the
set high or low under program control, or to lOS pin sets the IBF flag. The Port 6 input device are identical to those of the 80C51 ,
output the state of the output buffer full flag. buffer is loaded on the lOS positive edge. except for the additional registers listed in
AFLAG can also be programmed to be an When CSR.2 = 1, a high-ta-Iow transition on Table 1.
input which selects whether the contents 6f the lOS pin sets the IBF flag. Port 6 input
MB1
I MBO MA1
I MAO OBFe IDSM OBF IBF
BFLAG Mode Select AFLAG Mode Select Output Buffer Input Data Output Buffer Input Buffer
Flag Clear Strobe Mode Flag Full Flag Full
Mode
0/0 ; Logic 0 output" 0/0; Logic 0 output" 0; Negative 0; Positive o ; Output o ; Input data
0/1 ; Logic 1 output" 0/1 ;Logic 1 output" edgeofOUS edge of IDS data buffer buffer empty
1/0; IBF output 1/0 ; OBF output 1; Positive 1; Low level empty 1 ; Input data
1/1 ; fIE input 1/1 ;SEL input edgeoOUS of IDS 1; Output buffer full
(O;Select) (0 ; Select) data buffer full
(1 ; Disable 1/0) (1 ; Control/status)
NOTE:
" Output-always mode: MB1 ; 0, MA 1 ; 1, and MAO ; O. In this mode, port 6 is always enabled for output. OUS only clears the OBF Hag.
DC ELECTRICAL CHARACTERISTICS
Tarn ~ O°C to +70°C or--40°C to +85°C, Vcc ~ 5V ±20%, Vss ~ OV (80C451, 83C451)
Tarn ~ O°C to +70°C or-40°C to +85°C, Vcc ~ 5V ±10%, Vss ~ OV (87C451)
TEST UMITS
SYMBOL PARAMETER CONDITIONS MIN TYPICAL' MAX UNIT
V IL Input low voltage; except EJI: -0.5 0. 2Vcc-O· 1 V
Vill Input low voltage to EJI: 0 0. 2Vcc-O·3 V
AC ELECTRICAL CHARACTERISTICS
Tatri> =o·c to +70·C or-40·C to +85·C, Vee =5V ±2Oo/., Vss =OV (80C451, 83C451)1,2
Tatri> - O·C to +70·C or-40·C to +85·C , Vee
. - 5V±10o/. Vss - OV (87C451)
12MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
ALE
PORTO AO-A7
PORT 2 A8-A15
ALE
tWHLH
1+-----tlLDV ------.j·1
tlLWL - - I - - - - t R L R H - - - - + I
~------------~--------~
PORTO
INSTRIN
PORT 2
P2.D-P2.7 OR A8-A15 FROM DPH AO-A15 FROM PCH
ALE
tWHLH -+
WR -------+-------..1
Iovwx
INSTRUCTION o 4 8
ALE
CLOCK
------, r- txLXL ~
IovXH
OUTPUT DATA
! , '
WRITE TO SBUF
INPUT DATA
~
CLEAR RI
t
SETRI
"'l
oeF(AFLAG)
H IovFV !+--llovFV
'"
V
PE'(BFLAG)
IoLOH
V
PORT 6 --
!+--tFLDV -
tOLDV ~loHDZ
/I
/
I
·I IoHFH
SEL(AFLAG)
' - - tFVDV
" tFVDV
______~IL~---------t~FH-----------.II,_--------------------
PE(BFLAG)
______,~I~-------liuH---------+I~----------------
IBF(BFLAG) I'f li
ms ______C2_li_VFV
__________________ ~~-t-'V-F-V-------------
Vcc-'l.5
O.7VCC
O.45V 0.2VCc-O·l
VCc-O·
0A5V~
5
==x 0.2VCC+D.9
.O_._2V-'C;,:c-O:......1_ _ _ __
>C VLOAD'----<
VLOAO-o·1V
TIMING
REFERENCE
POINTS
V~.1V
NOTE: NOTE:
AC Inputs during tasting are drlven at Vee -0.5 fora logic '1' and O.45Vfor a logic '0', For timing purposes, a port Is no longer floating when a 1OOmV change from load
TIming measurements are made at VIH min for a logic '1' and Vil for a logic '0'. voltage occurs, and begins to float when a l00mV change from the loaded VoH'
VOL level occurs. IOHIIOL ~±..2OmA.
30
MAX ACTIVE MODE
25
V
20
/
/
V
ICCmA 15 ,- TYP ACTIVE MODE
10
//
/'
/'
',/ :..--- MAX IDLE MODE
Vcc
Vee
Vee RST
PO
RST
E(
Figure 14. Icc Test Condition, Active Mode Figure 15. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
Vcc-O· 5 - - - - ~O-.7V-C-C~
0.45V O.2VCc-O. 1 , ' - - _.... ,
IcLCL
Figure 16. Clock Signal Waveform for Icc Tests in Active and Idle Modes
IcLCH =IcHCL =5ns
RST
PO
Ell"
(NC) XTAL2
vcc
XTALl
vss IDS
OIl!!
EPROM CHARACTERISTICS To program the encryption table, repeat the Reading the Signature Bytes
The 87C451 is programmed by using a 25 pulse programming sequence for The signature bytes are read by the same
modified Quick-Pulse Programming'· addresses 0 through 1FH, using the 'Pgm procedure as a normal verification of
algorithm. It differs from older methods in the Encryption Table' levels. Do not forget that locations 030H and 031 H, except that P3.S
value used for Vpp (programming supply after the encryption table is programmed, and P3.7 need to be pulled to a logic low. The
voltage) and in the width and number of the verification cycles will produce only encrypted values are:
ALEIPROG pulses. data. (030H) = 15H indicates manufactured by
Philips
The 87C451 contains two signature bytes To program the lock bits, repeat the 25 pulse
(031H) = 90H indicates 87C451
that can be read and used by an EPROM programming sequence using the 'Pgm Lock
programming system to identify the device. Bit' levels. After one lock bit is programmed, ProgramlVerify Algorithms
The signature bytes identify the device as an further programming of the code memory and Any algorithm in agreement with the
87C451 manufactured by Philips encryption table is disabled. However, the conditions listed in Table 3, and which
Semiconductors. other lock bit can still be programmed. satisfies the timing specifications, is suitable.
Table 3 shows the logic levels for reading the Note that the FliJV pp pin must not be allowed
signature byte, and for programming the to go above the maximum specified Vpp level Erasure Characteristics
for any amount of time. Even a narrow glitch Erasure of the EPROM begins to occur when
program memory, the encryption table, and
above that voltage can cause permanent the chip is exposed to light with wavelengths
the lock bits. The circuit configuration and
damage to the device. The Vpp source shorter than approximately 4,000 angstroms.
waveforms for quick-pulse programming are
should be well regulated and free of glitches Since sunlight and fluorescent lighting have
shown in Figures 18 and 19. Figure 20 shows
and overshoot. wavelengths in this range, exposure to these
the circuit configuration for normal program
light sources over an extended time (about
memory verification.
Program Verification 1 week in sunlight, or 3 years in room level
Quick-Pulse Programming If lock bit 2 has not been programmed, the fluorescent lighting) could cause inadvertent
on-chip program memory can be read out for erasure. For this and secondary effects, It
The setup for microcontroller quick-pulse
program verification. The address of the is recommended that an opaque label be
programming is shown in Figure 18. Note that
the 87C451 is running with a 4 to SMHz program memory locations to be read is placed over the window. For elevated
applied to ports 1 and 2 as shown in temperature or environments where solvents
oscillator. The reason the oscillator needs to
be running is that the device is executing Figure 20. The other pins are held at the are being used, apply Kapton tape Fluorglas
'Verify Code Data' levels indicated in Table 3. part number 2345-5, or equivalent.
internal address and program data transfers.
The contents of the address location will be
The recommended erasure procedure is
The address of the EPROM location to be emitted on port o. External pull-ups are
programmed is applied to ports 1 and 2, as exposure to ultraviolet light (at 2537
required on port 0 for this operation.
shown in Figure 18. The code byte to be angstroms) to an integrated dose of at least
If the encryption table has been programmed, 15W-sec/cm2. Exposing the EPROM to an
programmed into that location is applied to
port O. RST, l'SEJiI and pins of ports 2 and 3
the data presented at port 0 will be the ultraviolet lamp of 12,OoouW/cm2 rating for
exclusive NOR of the program byte with one 20 to 39 minutes, at a distance of about 1
specified in Table 3 are held at the 'Program
of the encryption bytes. The user will have to inch, should be sufficient.
Code Data' levels indicated in Table 3. The
know the encryption table contents in order to
ALEIPROG is pulsed low 25 times as shown Erasure leaves the array in an all 1s state.
in Figure 19. correctly decode the verification data. The
encryption table itself cannot be read out.
.5V
--
Vcc A
XTAl2 P2.7
4-6MHz ~ £- P2.6
T T XTALI P2.G-P2.4
A
A8-A12
'J
>-- VSS
- '-
~1·~----------------------25PU~6--------------------------~~1
...----
I
Vcc
AG-A7 PI PO PGMDATA
RST EJIIVpp
P3.6 AlEII'ROO
P3.7 87C451 PSEII
°
XTAl2 P2.7 ° "EIIJIB[E
P2.6
vss
PROGRAMMING" VERlACAllON
P1.CI-P1.7 ADDRESS ADDRESS ""-
P2.CI-P2.4
PORTO DATA IN
- f.-- tAVQV
DATA OUT
AlEIPROC
tDVGL
tAVGl ~ - - ~ tGHDX
I-- tGHAX
tGlGH -.
tSHGl fc--oo
"'--- "
ol- ...
~ taHGl
taHsl
V
EJWPP
P2.7
EIinI:E
/
lOGIC a
------------ -----------------------------
tEHSH "
----------- ------------
tElQ~
I
lOGIC 1
I
tEHQZ
8XC524/8XC528 OVERVIEW 7FFFH. Locations 8000H to FFFFH are bytes of RAM, a second 128 bytes of RAM, a
The 8XC524/8XC528 are high-performance fetched from external program memory. 256-byte auxiliary RAM (AUX-RAM), and the
single-chip microcontrollers manulactured in When the EA pin is held low, all instruction 128-byte special function registar (SFR)
an advanced CMOS process and are fetches are from external memory. space.
derivatives of the 80C51 microcontroller By selling a mask programmable security bit, The lower 128 bytes of RAM (addresses 0 to
family. With the exception of open-<lrain the internal ROM contents are protected and 7FH) are directly and indirecdy addressable
outputs on two port pins, they are fully cannot be read with the help of test modes or and correspond to the 128 bytes of RAM in
compatible with the industry standard 80C51 by execution of MOVC instructions from the 80C51. The second 128 bytes of RAM
and in dude a number of additional external program memory. The operation of and the special function registers share the
enhancements. They are well suited for the MOVC instructions in internal and same address space but are accessed
applications requiring large amounts of external program memory with the security bit through different addressing modes.
on-chip ROM and RAM. Additional special is as follows:
function registers are incorporated to control RAM locations 80H to FFH are only indirectly
the on-chip peripherals. FUNCTION ACCESS TO ACCESS TO addressable while the special function
INTERNAL EXTERNAL registers are only directly addressable. This
The 8XC52418XC528 contains a non-volatile PROGRAM PROGRAM is the same addressing method used in the
16k (8XC524) or 32k (8XC528) x 8 read-only MEMORY MEMORY 80C52.
program memory, a volatile 512 x 8
MOVCin The 256-byte AUX-RAM, while physically
read/write data memory, four 8-bit I/O ports,
internal
two 16-bil timer/counters (identical to those in Yes Yes located on-chip, logically occupies the first
program
the 8OC51), a 16-bit timer coupled to capture memory 256 bytes of external data memory. As such,
and compare registers (identical to T2 of the it is indirectly addressed in the ,ame way as
8OC52), a multi source two-priority level MOVCin external data memory USillg the MOVX
external instructions in combination with any of the
nested interrupt structure, two serial No Yes
program
interfaces (a standard UART and 12C bus), a registers RO, R1, or DPTR. Accesses to
memory
watchdog timer with separate oscillator, and a AUX-RAM locations (0 to FFH) will not affect
master oscillator. The 8XC52418XC528 also ports PO, P2, or pins P3.6 or P3.7.
indude ROM code protection and enhanced There are no restrictions on the operation of
Access to external data memory locations
recovery from power-down mode. MOVC instructions if the security bit is
100H to FFFFH will perform normally. The
cleared (logic zero). The state of the EA pin is
stack may be located anywhere in the
Differences from the 8OC51 latched during reset, and its status following
internal data memory by loading the 8-bit
The 8XC524/8XC528 contains 16 (8XC524) reset is ignored. This prevents reading from
stack pointer and has a maximum depth of
or 32 (8XC528) kbytes of on-chip program internal program memory by switching from
256 bytes. The stack may not be located in
memory which can be extended to 64 kbytes external to internal mode during the execution
AUX-RAM. Figure 16 shows the data
with external memories (see Figure 1). of a MOVC instruction.
memory map of the 8XC528 along with a
When the EA pin is held high, the Dala Memory summary of accessing modes.
8XC524/8XC528 fetches instructions from The internal data memory is divided into four
internal ROM unless the address exceeds physically separate sections: the lower 128
64k
External
32768 (8XC528)
16384 (8XC524)
1
32767 (8XC528) 32767
16383 (8XC524)
Extemal
Internal (EX =0)
(EX = 1)
Program Memory
Special Function Registers noise or RFI). When enabled, the watchdog prescaler and timer T3. Any value stored in
The special function registers contain all of circuitry will generate a system reset if the WOCaN other than ASH will enable the
the 8XCS24/8XCS28 registers except the user program fails to reload the watchdog watchdog timer.
program counter and the four register banks. timer prior to the timer overflowing.
Timer T3 can be read on the fly. Timer T3 can
Most of the 31 special function registers are
The watchdog timer consists of an 11-bit only be written if WOCaN contains the value
used to control on-chip peripheral hardware.
prescaler and an 8-bit timer, T3, shown in SAH. A successful write operation to T3 will
Other registers include arithmetic registers
Figure 3. The prescaler is incremented by a clear the prescaler and WOCaN, leaving the
(ACC, B, PSW), stack pointer (SP), and data
dedicated on-chip oscillator with a fixed watchdog enabled and preventing inadvertent
pointer registers (OPH, OPL). Thirteen of the
frequency of 1MHz with a tolerance of +100% changes of T3.
SFRs are bit addressable. Table 1 lists the
and -50%. The 8-bit timer, T3, increments
8XCS24/8XCS28 special function registers. During a read or write operation to T3, the
every 2048 cycles of this dedicated oscillator.
output of the dedicated oscillator is inhibited
The standard 80CS2 SFRs are present and
to prevent timing problems due to
function identically in the 8XCS24/8XCS28.
When a timer overflow occurs, the asynchronous increments of T3. To prevent
SFRs SCON and SBUF of the 8OC51 have
8XC524/8XC528 is reset, and a reset pulse an overflow of the watchdog timer, the user
been renamed SOCON and SOBUF,
of 16 x 2048 cycles of the dedicated oscillator program has to reload the watchdog timer
respectively.
is generated at the reset pin. within periods that are shorter than the
Watchdog Timer programmed watchdog interval. This time
The internal reset signal is not inhibited when
In addition to timers TO, T1, and T2, the interval is determined by the 8-bit value
the external reset pin is held low by an
8XCS24/8XCS28 also includes a watchdog loaded into T3.
external circuit. The watchdog timer is
timer, T3. The purpose of a watchdog timer is controlled by the special function register
to reset the microcontroller within a WOCaN. After a reset signal, WOCaN will [256 - (T3)] x 2048
reasonable time should it enter an erroneous Watchdog interval =
contain the value ASH, which halts the dedicated osc freq
processor state (possibly caused by electrical dedicated oscillator and clears both the
FF FF FF FFFF
U_ Specl.,
128 Bytes Function
Internal Registers
RAM
AUX-RAM 80 80 External
256 Bytes DB'"
Memory
7F
lower
128 Bytes
Inlernal
RAM
00 00 0100
87 B6 B5 B4 B3 82 81 80
PO' PortO 80H AD7 AD6 AD5 AD4 AD3 AD2 ADl ADO FFH
97 96 95 94 93 92 91 90
Pl' Port 1 90H SDA SEL - - - - T2EX T2 FFH
A7 A6 A5 A4 A3 A2 Al AO
P2' Port 2 AOH A15 A14 A13 A12 All Al0 A9 AB FFH
87 B6 B5 B4 B3 B2 Bl BO
P3' Port 3 BOH RD WR Tl TO INTl INTO TxD RxD FFH
PCON Power control 87H SMOD - - - GFl GFO PD IDL OxxxOODOB
07 D6 D5 D4 D3 02 Dl DO
PSW' Program status word DOH CY AC FO RSl RSO OV Fl P DOH
RCAP2H# Capture high CBH DOH
RCAP2L# Capture low CAH DOH
SBUF Serial data buffer 99H xxxxxxxxB
9F 9E 90 9C 9B 9A 99 98
SCON' Serial controller 9BH SMO SMl SM2 REN TB8 RBS TI RI DOH
SlBIT# Serial1 2C data D9H/RD SDI 0 0 0 0 0 0 0 xDODODOOB
WR SDO X X X X X X X OxxxxxxxB
SlINT# Serial1 2C interrupt DAH INT X X X X X X X OxxxxxxxB
DF DE DD DC DB DA D9 D8
SlSCS'# Serial 12C control DBH/RD SOl SCI CLH BB RBF WBF STR ENS xxxxDODOB
WR SDO SCQ CLH X X X STR ENS DOxxxxDOB
SP Stack pointer B1H 07H
BF 8E BD BC 8B BA 89 88
TCON' Timer control 8BH TFl TRl TFO I TRO I IEl ITl lEO ITO DOH
CF CE CD CC CB CA C9 CB
T2CON'# Timer 2 control CBH TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CPJRL2 DOH
THO Timer high 0 8CH DOH
THl Timer high 1 8DH DOH
TH2# Timer high 2 CDH DOH
TLO Timer low 0 BAH COH
TL1 Timer low 1 BBH DOH
TL2# Timer low 2 CCH DOH
T3# Watchdog timer FFH DOH
TMOD Timer mode 89H GATE CIT Ml MO GATE CIT Ml MO DOH
WDCON# Watchdog control A5H A5H
• SFRs are bit addressable.
# SFRs are modified from or added to the 80C51 SFRs.
InlemalBus
AND
OR On-Chip
Oscinator
AND
Halt
WR-T3
RD-T3 VSS
12<: Interface The 12C interface on the 8XC524/8XC528 The three SFRs used for 12C are:
Support of the 12C bus on the 8XC5241 performs the following functions:
8XC528 is provided by a bit-level serial SllNT
• Generates an interrupt on reception of a
interface. This interface is supported by 7 6 S 4 0
START condition
registers S1INT, S181T, and SlSCS in
• Recognizes a STOP condition and
liNT I X x x xI xI x I x
conjunction with pins Pl.6/sCL and
Pl.7/SDA. These latter two pins meet the 12C indicates busy or free status of bus
bus specifications for input and output drive Sl BIT (READj)
• Latches a received serial bit
levels and consequently have open drain 7 6 0
• Generates a single serial clock pulse on
outputs. All four modes of the 12C bus are
SCLpin
I SOl I 0 oI 0
I oI 0
I 0 0
I
supported: master transmitter, master
receiver, slave transmitter, and slave receiver. • Performs serial clock synchronization
A 100kbps data rate can be achieved in slave (WRITE)
• Detects bit-level arbitration loss
mode with a master oscillator frequency of 7 6 0
12MHz. In Master mode with a 12MHz clock I SOD I x x I x I x x I x I X
a muximum data rate of 70k bps can be
achieVed.
SlSCS (READ)
7 & S 4 3 2 1 0
I SOl I sal CLHI BB I RBF I WBFI STRI ENS I
(WRITE)
7 6 S 2 1 0
Table 2. Status of the External Pins During Idle and Power-Down Modes
MODE MEMORY ALE PSEN PORTO PORT 1 PORT 2 PORT 3
Idle Internal 1 1 Port data Port data Port data Port data
Idle External 1 1 Floating Port data Address Port data
Power-down Internal 0 0 Port data Port data Port data Port data
Power-down External 0 0 Floating Port data Port data Port data
LOGIC SYMBOL
17 29
.8 28
44 34
33
II 23
.2 22
n
34
~ ~ R B
7[
0
P39 1= 0 1== 33
LCC OFP
1== 23
17[ P29 11=
';-j ~ tl tl
12 22
BLOCK DIAGRAM
FREQUENCY
REFERENCE
, COUNTERS
r-'---1
lD Tt T2 T2EX RST
INTERNAL
INTERRUPTS
I
L
--
-
Vss GROUND
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC QFP TYPE NAME AND FUNCTION
Vss 20 22 16 I Ground: OV reference.
Vee 40 44 38 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.O-O.7 39-'12 43-'l6 37-'10 110 Port 0: Port 0 is an open-drain, bidirectional 1/0 port. Port 0 pins that have 1s written to them
1I0at and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order
address and data bus during accesses to external program and data memory. In this
application, it uses strong internal pull-ups when emitting 1s. Port 0 also outputs the code
bytes during program verification in the PB7C524. External pull-ups are required during
program verification.
P 1.0-P 1.7 1-8 2-9 40-44, 110 Port 1: Port 1 is an B-bit bidirectional 1/0 port with internal pull-ups, except P1.6 and Pl.7
1-'1 which are open drain. Port 1 pins that have 1s written to them are pulled high by the internal
pull-ups and can be used as inputs. As inputs, port 1 pins that are externally pulled low will
source current because of the internal pull-ups. (See DC Electrical Characteristics: ItLl.
Port 1 can sink/source one TIL (4LSTIL) inputs. Port 1 receives the low-order address byte
during program memory verification. Port 1 also serves alternate lunctions for timer 2:
1 2 40 I T2 (Pl.0): Tlmer/counter 2 external count input.
2 3 41 I T2EX (Pl.l): Tlmer/counter 2 trigger input.
7 B 2 1/0 SCL (Pl.6): 12C serial port clock line.
8 9 3 1/0 SDA (Pl.7): 12C serial port data line.
P2.O-P2.7 21-28 24-'11 lB-25 1/0 Port 2: Port 2 is an B-bit bidirectional 110 port with internal pull-ups. Port 2 pins that have 1s
written to them are pulled high by the internal pull-ups and can 00 used as inputs. As inputs,
port 2 pins that are externally being pulled low will source current because of the internal
pull-ups. (See DC Electrical Characteristics: ltd. Port 2 emits the high-order address byte
during fetches from external program memory and during accesses to external data memory
that use 16-bit addresses (MOVX@DPTR). In this application, it uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that use B-bit
addresses (MOV @Ri), port 2 emits the contents of the P2 special function register.
P3.O-P3.7 10-17 11, 5, 110 Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins that have 1s
13-19 7-13 written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 3 pins that are externally being pulled low will source current because of the pull-ups.
(See DC Electrical Characteristics: lid. Port 3 also serves the special features of the
SCBOC51 family, as listed below:
10 11 5 I RxD (P3.0): Serial input port
11 13 7 0 TxD (P3.l): Serial output port
12 14 8 I INTlI (P3.2): External interrupt
13 15 9 I JIilTi (P3.3): External interrupt
14 16 10 I TO (P3.4): Timer 0 external input
15 17 11 I T1 (P3.S): Timer 1 external input
16 18 12 0 WR (P3.6): External data memory write strobe
17 19 13 0 RO (P3.7): External data memory read strobe
RST 9 10 4 1/0 Reset: A high on this pin for two machine cycles while the oscillator is running, resets the
device. An internal diffused resistor to Vss permits a power-on reset using only an external
capacitor to Vee. After a watchdog timer overflow, this pin is pulled high while the internal
reset signal is active.
ALEIPROO 30 33 27 1/0 Address Latch EnablelProgram Pulse: Output pulse for latching the low byte of the
address during an access to external memory. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency, and can be used for external timing or clocking.
Note that one ALE pulse is ski~uring each access to external data memory. This pin is
also the program pulse input ( ) during EPROM programming.
PSrn 29 32 26 0 Program Store Enable: The read strobe to external program memory. When the device is
executing code Irom the external program memory, PSrn is activated twice each machine
cycle, except that two PSrn activations are skipped during each access to external data
memory. PSrn is not activated during fetches from internal program memory.
EJ\Npp 31 35 29 I External Access EnablelProgramming Supply Voltage: EA must be externally held low to
enable the device to fetch code from external program memory locations OOOOH to 7FFFH. If
EA is held high, the device executes from internal program memory unless the program
counter contains an address greater than 7FFFH. This pin also receives the 12.75V
programming supply voltage (V pp) during EPROM programming.
XTALl 19 21 15 I Crystal 1 : Input to the inverting oscillator amplifier and input to the internal clock generator
circuits.
XTAL2 18 20 14 0 Crystal 2: Output from the inverting oscillator amplifier.
Table 1. Internal and External Program Memory Access with Security Bit Set
ACCESS TO INTERNAL ACCESS TO EXTERNAL
INSTRUCTION
PROGRAM MEMORY PROGRAM MEMORY
ROM CODE PROTECTION TIMER 2 reload the watchdog timer within periods that
By setting a mask programmable security bit, Timer 2 is functionally equal to the Timer 2 of are shorter than the programmed watchdog
the ROM content in the 83C528 is protected, the 8052AH. Timer 2 is a 16-bit timer/counter. timer internal. This time interval is determined
i.e., it cannot be read out by any test mode or These 16 bits are formed by two special by an 8-bit value that has to be loaded in
by any instruction in the external program function registers TL2 and TH2. Another pair register T3 while at the same time the
memory space. The MOVC instructions are of special function register RCAP2l and prescaler is cleared by hardware.
the only ones which have access to program RCAP2H form a 16-bit capture register or a Watchdog timer interval =
code in the internal or external program 16-bit reload register. Uke Timer 0 and I, it
memory. The"EA input is latched during can operate either as a timer or as an event [256-(T3)] x 2048
RESET and is 'don't care' after RESET. This counter. This is selected by bit CIT2N in the on - chip oscillator frequency
implementation prevents reading from special function register T2CON. It has three
internal program code by switching from operating modes: capture, autoload, and
external program memory to internal program baud rate generator mode which are selected
memory during MOVC instruction or an by bits in T2CON.
BIT-LEVEL 12C INTERFACE
instruction that handles immediate data. This bit-level serial 1/0 interface supports the
Table 1 lists the access to the internal and 12C-bus. Pl.6/SCl and PI.7/S0A are the
WATCHDOG TIMER T3 serial 110 pins. These two pins meet the 12C
external program memory by the MOVC
The watchdog timer consists of an II-bit specification concerning the input levels and
instructions when the security bit has been
prescaler and an 8-bit timer formed by special output drive capability. Consequently, these
set to logical one. If the security bit has been
function register T3. The prescaler is pins have an open drain output configuration.
set to a logical 0 there are no restrictions for
incremented by an on-chip oscillator with a All the four modes of the 12C-bus are
the MOVC instructions.
fixed frequency of I MHz. The maximum supported:
tolerance on this frequency is -50% and - master transmitter
INTERNAL DATA MEMORY +100%. The 8-bit timer increments every - master receiver
The internal data memory is divided into three 2048 cycles of the on-chip oscillator. When a
- slave transmitter
physically separated segments: 256 bytes of timer overflow occurs, the microcontroller is
RAM, 256 bytes of AUX-RAM, and a 128 reset and a reset output pulse of 16 x 2048 - slave receiver
bytes special function area. These can be cycles of the on-chip oscillator is generated at The advantages of the bit-level 12C hardware
addressed each in a different way. pin RST. The internal RESET signal is not compared with a full software 12C
- RAM 0 to 127 can be addressed directly inhibited when the external RST pin is kept implementation are:
and indirectly as in the 80C51. Address low by, for example, an external reset circuit. - the hardware can generate the SCl pulse
pointers are RO and Rl of the selected The RESET signal drives port I, 2, 3 into the
- Testing a single bit (RBF respectively,
register bank. high state and port 0 into the high impedance
WBF) is sufficient as a check for error free
- RAM 128 to 255 can only be addressed state.
transmission.
indirectly as in the 80C51. Address The watchdog timer is controlled by one
pointers are RO and Rl of the selected The bit-level 12C hardware operates on serial
special function register WOCON with the
register bank. bit level and performs the following functions:
direct address location A5H. WOCON can be
- AUX-RAM 0 to 255 is indirectly addressed - filtering the incoming serial data and clock
read and written by software. A value of A5H
in the same way as extemal data memory signals
in WOCON halts the on-chip oscillator and
with the MOVX instructions. Address clears both the prescaler and timer T3. After - recognizing the START condition
pointers are RO, Rl of the selected register the RESET signal, WOCON contains A5H. - generating a serial interrupt request SI after
bank and OPTR. An access to AUX-RAM 0 Every value other than A5H in WOCON reception of a START condition and the
to 255 will not affect ports PO, P2, P3.6 and enables the watchdog timer. When the first falling edge of the serial clock
P3.7. watchdog timer is enabled, it runs - recognizing the STOP condition
independently of the XTAl -clock. - recognizing a serial clock pulse on the SCl
An access to external data memory locations
line
higher than 255 will be performed with the, Timer T3 can be read on the fly. Timer T3 can
MOVX OPTR instructions in the same way as only be written if WOCON contains the value - latching a serial bit on the SOA line (SOl)
in the 8051 structure, so with PO and P2 as 5AH. A successful write operation to T3 will - stretching the SCl lOW period of the
data/address bus and P3.6 and P3.7 as write clear the prescaler and WOCON, leaving the serial clock to suspend the transfer of the
and read timing signals. Note that these watchdog enabled and preventing inadvertent next serial data bit
external data memory cannot be accessed changes of T3. To prevent an overflow of the - setting Read Bit Finished (RBF) when the
with RO and Rl as address pointer. watchdog timer, the user program has to SCl clock pulse has finished and Write Bit
Finished (WBF) if there is no arbitration is left unconnected. There are no a RESET in the same way as in the BOC51 or
loss detected (i.e., SDA =0 while SDO = 1) requirements on the duty cycle of the external in addition by one of two external interrupts,
- setting a serial dock low-ta-High detected clock signal, because the input to the internal INTO or INTI. A termination with an external
(ClH) flag clock circuitry is through a divide-by-two interrupt does not affect the internal data
- setting a Bus Busy (BB) flag on a START flip-flop. However, minimum and maximum memory and does not affect the special
condition and clearing this flag on a STOP high and low times specified in the data sheet function registers. This makes it possible to
condition must be observed. exit power-down without changing the port
- releasing the SCl line and clearing the output levels. To terminate the power-down
mode with an external interrupt JJilTlj or 1NTT
ClH, RBF and WBF flags to resume RESET
transfer of the next serial data bit must be switched to level-sensitive and must
A reset is accomplished by holding the RST
be enabled. The external interrupt input
- generating an automatic clock if the single pin high for at least two machine cycles (24
signal T"I'ITO and 1NTT must be kept low until
bit data register S 1BIT is used in master oscillator periods), while the oscillator is
the oscillator has restarted and stabilized. An
mode. running. To insure a good power-up reset, the
instruction following the instruction that puts
RST pin must be high long enough to allow
The following functions must be done in the device in the power-down mode will be
the oscillator time to start up (normally a few
software: executed. A reset generated by the watchdog
milliseconds) plus two machine cycles. At
- handling the 12C START interrupts timer terminates the power-down mode in the
power-up, the voltage on Vee and RST must
- converting serial to parallel data when same way as an external RESET. and only
come up at the same time for a proper
receiving the contents of the on-chip RAM are
start-up.
preserved. The control bits for the reduced
- converting parallel to serial data when
power modes are in the special function
transmitting
register PCON.
- comparing the received slave address with IDLE MODE
its own In idle mode, the CPU puts itself to sleep
- interpreting the acknowledge information while all of the on-chip peripherals stay
active. The instruction to invoke the idle
DESIGN CONSIDERATIONS
- guarding the 12C status if RBF or WBF = O. At power-on, the voltage on Vee and RST
mode is the last instruction executed in the
must come up at the same time for a proper
Additionally, if acting as master: normal operating mode before the idle mode
start-up.
- generating START and STOP conditions is activated. The CPU contents, the on-chip
- handling bus arbitration RAM, and all of the special function registers When the idle mode is terminated by a
remain intact during this mode. The idle mode hardware reset, the device normally resumes
- generating serial clock pulses if Sl BIT is
can be terminated either by any enabled program execution, from where it left off, up
not used.
interrupt (at which time the process is picked to two machine cycles before the internal
Three SFRs control the bit-level1 2C interface: up at the interrupt service routine and reset algorithm takes control. On-chip
SllNT, SlBIT and SlSCS. continued), or by a hardware reset which hardware inhibits access to internal RAM in
starts the processor in the same manner as a this event, but access to the port pins is not
power-on reset. inhibited. To eliminate the possibility of an
OSCILLATOR unexpected write when idle is terminated by
CHARACTERISTICS reset, the instruction following the one that
XTAll and XTAL2 are the input and output, POWER-DOWN MODE invokes idle should not be one that writes to a
respectively, of an inverting amplifier. The In the power-down mode, the oscillator is port pin or to external memory.
pins can be configured for use as an on-chip stopped and the instruction to invoke
oscillator, as shown in the logic symbol, Table 2 shows the state of 1/0 ports during
power-down is the last instruction executed.
page 302. low current operating modes.
The power-down mode can be terminated by
To drive the device from an external clock
source, XTAll should be driven while XTAl2
Security Bill: When programmed, this bit has two effects on masked ROM parts:
1. External MOVC is disabled, and
2. EA# is latched on Reset.
Security B112: When programmed, this bit inhibits Verify User ROM.
Security Bit 3: When programmed, external execution is disabled. Internal data RAM is not accessable.
DC ELECTRICAL CHARACTERISTICS
Tarrl> = O°C to +70°C or-40°C to +BSoC Vee = SV -
+10% Vss = OV
PART TEST UMITS
SYMBOL PARAMETER TYPE CONDITIONS MIN MAX UNIT
VOH1 Output high voltage, Port 0 in external bus mode, IOH = -800;LA 2.4 V
ALE,PSEN, RST IOH = -300;LA 0.75Vec V
IOH = --60;LA 0.9Vee V
III Logical 0 input current, ports 1, 2, 3, o to +70°C VIN = 0.4SV -50 ;LA
except Pl.61SCL, P1.7SDA -40 to +B5°C -75 ;LA
ITL Logicall-to-O transition current, ports 1, 2, 3, o to +70°C See Note 3 --650 ;LA
except P1.6/SCL, P1.7/SDA -40 to +B5°C -750 ;LA
1L1 Input leakage current, port 0 VIN = Vil or VIH ±10 ;LA
1L2 Input leakage current, Pl.6/SCL, Pl. 7/SDA OV <VI < 6V ±10 ;LA
OV < Vee < 5.5V
CIO Pi n capacitance 10 pF
NOTES:
1. Capacitive loading on ports 0 and 2 may cause spurious noise to be superimposed on the VOlS of ALE and ports 1 and 3. The noise is due
to external bus capacitance discharging into the port 0 and port 2 pins when these pins make 1-to-0 transitions during bus operations. In the
worst cases (capaCitive loading> l00pF), the noise pulse on the ALE pin may exceed O.BV. In such cases, it may be desirable to qualify ALE
with a Schmitt Trigger, or use an address latch with a Schmitt Trigger STROBE input. Under steady state (non-transient) conditions, IOl must
be externally limited as follows: 10mA per port pin, port 0 total (all bits) 26mA, ports 1, 2, and total each (all bits) lSmA.
2. Capacitive loading on ports 0 and 2 may cause the VOH on ALE and PSEN to momentarily fall below the 0.9Vee specification when the
address bits are stabilizing.
3. Pins of ports 1, 2 and 3 source a transition current when they are being externally driven from 1 to O. The transition current reaches its
maximum value when VIN is approximately 2V.
4. See Figures 10 through 13 for Icc test conditions.
5. The input threshold voltage of Pl.6 and Pl. 7 (SI01) meets the 12C specification, so an input voltage below 1.5V will be recognized as a
logic 0 while an input voltage above 3.0V will be recognized as a logic 1.
AC ELECTRICAL CHARACTERISTICS
TarTi> = O°C to +70°C or-40°C to +85°C Vee = 5V ±10% Vss = OV1,2
16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
1/lcLCL 1 Oscillator frequency: Speed Versions
8XC524 E 3.5 16 MHz
8XC524 G 3.5 20 MHz
ALE
PORTO A~7
PORT 2 A8-A15
ALE
tWHLH
~----tLLDV ----.,·1
tLLWL --+Iof----IRLRH - - - - + I
~-------------+--------~
tRLDV-
ALE
lavwx
INSTRUCTION
ALE
-------,
r-- --1
tXLXL
CLOCK
,OUTPUTt DATA !
WRITE TO SBUF
INPUT DATA
t-'
CLEAR RI
+
SETRI
Figure 4. Shift Register Mode Timing
SCL
(INPUT/OUTPUT)
--+--#-....,
tHD;STA !Low tHIGH tSU;DATI tHD;DAT tSU;DAT2
VC~·5
O·7Vee
o.45V 0.2Vee-O. 1
Vcc-O.5
0.45V
NOTE:
=>< o. 2Vcc..o.S
>C
....;O':;;2:;V.::cc-O.:::..;:;.;1:.....____.
VLOAD
NOTE:
VLOA~·lV
VLOAI)-O.lV
11M1NG
REFERENCE
POINTS
V~.lV
VOL..o·1V
AC Inputs during testing are driven at Vee -0.5 for a logic '1' and O.45V for a logic '0'. For timing purposes, a pon Is no longer f1oa!ing when a 1OOmV change from load
lining measurements are made at VIH min for a logic '1' and VIL fora logic '0'. voltage occurs, and begins to float when a 1OOmV change from the loaded Vol+'
VOL level occurs. IOH'bL. ± 2OmA.
35
25
/
ICCmA 20
/
/V ./ TVP ACTIVE MODE
15
/ ,/
10 / V
~
.,/
e. -
/
4MHz 8MHz
- ~
12MHz
FREQATXTALI
16MHz 20MHz
MAX IDLE MODE
Vcc Vee
Vcc Vcc
Vcc RST
PO PO
RST
El(
Vss Vss
Figure 10. Icc Test Condition, Active Mode Figure 11. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
Vec
Vcc
Vcc-O.5 - - - - o.7Vee RST
O.45V O.2Vcc-O.1 El(
PO
lcHCL -
(NC) XTAL2 Pl.6
lcLCL
XTALI Pl.7
vss
EPROM CHARACTERISTICS Encryption Table' lewis. Dii not forget that Erasing the EPROM also erases the .
The 87C524 is programmed by using a after the encryption table is programmed, encryption array and the program lock bits,
modified Quick-Pulse ProgrammingT• verification cycles will produce only encrypted returning the part to full functionality.
algorithm. "differs from older methods in the data.
Reading Ihe Signature Bylea
value used for Vpp (programming supply To program the lock bits, repeat the 25 pulse
voltage) and in the width and number of the The signature bytes are read by the same
programming sequence using the 'Pgm Lock procedure as a normal verification of
ALEIPROG pulses. Sir levels. After one lock bit is programmed, locations 030H and 031H, exceptthat P3.6
The 87C524 contains two signature bytes further programming of the code memory and and P3.7 need to be pulled to a logic low. The
that can be read and used by an EPROM encryption table is disabled. However, the values are:
programming system to identify the device. other lock bit can still be programmed.
(030H) = ISH indicates manufactured by
The signature bytes identify the device as an
87C524 manufactured by Philips.
Note that the cm pp pin must not be allowed Philips
to go above the maximum specified Vpp level
(031 H) = 9DH indicates 87C524
Table 3 shows the logic levels for reading the for any amount of time. Even a narrow glitch
signature byte, and for programming the above that voltage can cause permanent ProgramNerlfy Algorithms
program memory, the encryption table, and damage to the device. The Vpp source Any algorithm in agreement with the
the lock bits. The circuit configuration and should be well regulated and free of glitches conditions listed in Table 3, and which
waveforms for quick-pulse programming are and overshoot. satisfies the timing specifications, is suitable.
shown in Figures 14 and 15. Figure 16 shows
Program Verification
the circu~ conflQuration for normal program Erasure Characteristics
memory verification. If lock bit 2 has not been programmed, the
on-chip program memory can be read out for Erasure of the EPROM begins to occur when
program verification. The address of the the chip is exposed to light with wavelengths
Quick-Pulse Programming shorter than approximately 4,000 angstroms.
The setup for microcontroller quick-pulse program memory locations to be read is
applied to ports I, 2 and 3 as shown in Since sunlight and fluorescent lighting have
programming is shown in Figure 14. Note that wavelengths in this range, exposure to these
the 87C524 is running with a 4 to 6MHz Figure 16. The other pins are held at the
'Verify Code Data' levels indicated in Table 3. light sources over an extended time (about 1
oscillator. The reason the oscillator needs to week in sunlight, or 3 years in room level
be running is that the device is executing The contents of the address location will be
emitted on port o. External pull-ups are fluorescent lighting) could cause inadvertent
internal address and program data transfers. erasure. For this and secondary effects, II
required on port 0 for this operation.
The address of the EPROM location to be Is recommended Ihat an opaque label be
programmed is applied to ports I, 2 and 3, as If the encryption table has been programmed, placed over Ihe window. For elevated
shown in Figure 14. The code byte to be the data presented at port 0 will be the temperature or environments where solvents
programmed into that location is applied to exclusive NOR of the program byte with one are being used, apply Kapton tape Fluorglas
port O. RST, PSEN and pins of ports 2 and 3 of the encryption bytes. The user will have to part number 2345-5, or equivalent.
specified in Table 3 are held at the 'Program know the encryption table contents in order to
correctly decode the verification data. The The recommended erasure procedure is
Code Data' levels indicated in Table 3. The exposure to ultraviolet light (at 2537
ALEIPROG is pulsed low 25 times as shown encryption table itself cannot be read out
angstroms) to an integrated dose of at least
in Figure 15. Program Lock Bits 15W-seclcrn2• ExpoSing the EPROM to an
To program the encryption table, repeat the The 87C524 has 3 programmable lock bits ultraviolet lamp of 12,OOOuW/cm2 rating for
25 pulse programming sequence for that will provide different levels of protection 20 to 39 minutes, at a distance of about 1
addresses 0 through 3FH, using llie 'Pgm for the on-chip code and data. (See Table 4.) inch, should be sufficient.
Erasure leaves the array in an all 1s state.
Table 4.
PROGRAM LOCK BITS',2
.±§Y
Vcc
A
AG-A7 - PI PO PGMDATA
V ~
XTAL2 P2.7 1
~_ck t- P2.6 0
T T XTALI P2.G-P2.5
A
.~
A8-A13
!I4C------------25PULSES -------------~
ALEII'IlllG:
Vcc
AG-A7 PI PO PGMDATA
RST ElI)Vpp
P3.6 ALEIPIIOG
P3.7 87C524 PSEII
PROGRAMMING· VERIACATlON*
Pl.O-Pl.7
P2.O-P2.5 ADDRESS ADDRESS "-
Pl.4 /
-lO
- IAvav
ALElI'ROO
IDVGL
IAVGL ~
--.. I -
~~ Vi
-lO
~- IGHDX
IGHAX
/'
EJWpp
P2.7
Em'iBI:E
/
IEHSH '"
------------ ----------------------------- ----- .. _---- -----_._----
LOGIC 0
IELa~
I
LOGIC 1
I
IEHaz
44 34
33
11 23
12 22
P87C528EBF FA
o to +70, 16MHz
Ceramic DIP with window
P80C528FBA P83C528FBAlxxx P80C528FBA A P83C528FBA A P87C528EBA A o to +70, Plastic PLCC 16MHz
P87C528EBL KA
o to +70, 16MHz
Ceramic CLCC with window
P80C528FBB P83C528FBBlxxx P80C528FBB B P83C528FBB B P87C528EBB B o to +70, Plastic OFP 16MHz
P80C528FFP P83C528FFP/xxx P80C528FFP N P83C528FFP N P87C528EFP N -40 to +85, Plastic DIP 16MHz
-40 to +85,
P87C528EFF FA 16MHz
Ceramic DIP with window
P80C528FFA P83C528FFAlxxx P80C528FFA A P83C528FFA A P87C528EFA A -40 to +85, Plastic PLCC 16MHz
-40 to +85,
P87C528EFL KA 16MHz
Ceramic CLCC with window
P80C528FFB P83C528FFBlxxx P80C528FFB B P83C528FFB B P87C528EFB B -40 to +85, Plastic OFP 16MHz
P80C528FHP P83C528FHP/xxx P80C528FHP N P83C528FHP N -40 to +125, Plastic DIP 16MHz
-40 to +125,
16MHz
Ceramic DIP with window
P80C528FHA P83C528FHAlxxx P80C528FHA A P83C528FHA A -40 to + 125, Plastic PLCC 16MHz
-40 to +125,
16MHz
Ceramic CLCC with window
P80C528FHB P83C528FHBlxxx P80C528FHB B P83C528FHB B -40 to + 125, Plastic OFP 16MHz
P87C528GBP N o to +70, Plastic DIP 20MHz
P87C528GBF FA
o to +70, 20MHz
Ceramic DIP with window
P87C528GBA A
o to +70, 20MHz
Plastic PLCC
, P87C528GBL KA
o to +70, 20MHz
Ceramic CLCC with window
P87C528GBB B o to +70, Plastic OFP 20MHz
P87C528GFP N -40 to +85, Plastic DIP 20MHz
-40 to +85,
P87C528GFF FA 20MHz
Ceramic DIP with window
P87C528GFA A -40 to +85, Plastic PLCC 20MHz
-40 to +85,
P87C528GFL KA 20MHz
Ceramic CLCC with window
P87C528GFB B -40 to +85, Plastic OFP 20MHz
NOTE:
1. xxx denotes the ROM code number.
7[
h h
0
~ ii R
P39
1= 0 1=33
LCC OFP
17[ 11= 1= 23
P29
~ .~ ~ ~
12 22
LOGIC SYMBOL
Vcc VSS
~
N-+
~~ ADDRESS BUS
BLOCK DIAGRAM
FREOUEHCY
REFERENCE eOUNTERS
,
I r-'-----1
XTA1.2 XTAL1 TO 11
I
I
I
I
I
I
L
--
POWER { --
SUPPLY Vss GROUND
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC QFP TYPE NAME AND FUNCTION
Vss 20 22 16 I Ground: OV reference.
Vee 40 44 38 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.O-O.7 39-32 43-36 37-30 110 Port 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 pins that have ls written to them
float and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order
address and data bus during accesses to external program and data memory. In this
application, it uses strong internal pull-ups when emitting 1s. Port 0 also outputs the code
bytes during program verification in the P87C528. External pull-ups are required during
program verification.
Pl.O-Pl.7 1~ 2-9 40-44 110 Port 1: Port 1 is an 8-bit bidirectional 1/0 port with internal pull-ups, except Pl.6 and Pl.7
1-3 which have open drain. Port 1 pins that have 1s written to them are pulled high by the
internal pull-ups and can be used as inputs. As inputs, port 1 pins that are externally pulled
low will source current because of the internal pull-ups. (See DC Electrical Characteristics:
Ill). Port 1 can sink/source one TTL (4 LSTTL) inputs. Port 1 receives the low-order address
byte during program memory verification. Port 1 also serves alternate functions for timer 2:
1 2 40 I T2 (Pl.0): Timerlcounter 2 external count input.
2 3 41 I T2EX (Pl.l): TImerlcounter 2 trigger input.
7 8 2 I/O SCL (Pl.6): 12C serial port clock line.
8 9 3 I/O SOA (Pl.7): 12C serial port data line.
P2.O-P2.7 21-28 24-31 18-25 110 Port 2: Port 2 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 2 pins that have 1s
written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 2 pins that are externally being pulled low will source current because of the internal
pUll-Ups. (See DC Electrical Characteristics: IILl. Port 2 emits the high-order address byte
during fetches from external program memory and during accesses to external data memory
that use 16-bit addresses (MOVX @DPTR). In this application, it uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that use 8-bit
addresses (MOV @Ri), port 2 emits the contents of the P2 special function register.
P3.O-P3.7 10-17 11, 5, 1/0 Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins that have 1s
13-19 7-13 written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 3 pins that are externally being pulled low will source current because of the pull-ups.
(See DC Electrical Characteristics: 11ll. Port 3 also serves the special features of the
SC80C51 family, as listed below:
10 11 5 I RxD (P3.0): Serial input port
11 13 7 0 TxD (P3.l): Serial output port
12 14 8 I INTIJ (P3.2): External interrupt
13 15 9 I mTf (P3.3): External interrupt
14 16 10 I TO (P3.4): Timer 0 external input
15 17 11 I T1 (P3.5): TImer 1 external input
16 18 12 0 WR (P3.6): External data memory write strobe
17 19 13 0 lTD (P3.7): External data memory read strobe
RST 9 10 4 1/0 Reset: A high on this pin for two machine cycles while the oscillator is running, resets the
device. An internal diffused resistor to Vss permits a power-on reset using only an external
capacitor to Vee. After a watchdog timer overflow, this pin is pulled high while the internal
reset signal is active.
ALEIPROG 30 33 27 1/0 Address Latch Enable/Program Pulse: Output pulse for latching the low byte of the
address during an access to external memory. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency, and can be used for external timing or clocking.
Note that one ALE pulse is skipped during each access to external data memory. This pin is
also the program pulse input (POOG") during EPROM programming.
PSER 29 32 26 0 Program Store Enable: The read strobe to external program memory. When the device is
executing code from the external program memory, l'SEN is activated twice each machine
cycle, except that two l'SEN activations are skipped during each access to external data
memory. l'SEN is not activated during fetches from internal program memory.
~pp 31 35 29 I External Access EnablelProgrammlng Supply Voltage: E1\ must be externally held low to
enable the device to fetch code from external program memory locations OOOOH to 7FFFH. If
E1\ is held high, the device executes from internal program memory unless the program
counter contains an address greater than 7FFFH. This pin also receives the 12.75V
programming supply voltage (Vpp) during EPROM programming.
XTAL1 19 21 15 I Crystal 1 : Input to the inverting oscillator amplifier and input to the internal clock generator
circuits.
XTAL2 18 20 14 0 Crystal 2: Output from the inverting oscillator amplifier.
Table 1. Internal and External Program Memory Access with Security Bit Set
ACCESS TO INTERNAL ACCESS TO EXTERNAL
INSTRUCTION PROGRAM MEMORY PROGRAM MEMORY
MOVC in intemal program memory YES YES
MOVC in extemal program memory NO YES
ROM CODE PROTECTION TIMER 2 program has to reload the watchdog timer
By setting a mask programmable security bit, Timer 2 is functionally equal to the Timer 2 of within periods that are shorter than the
the ROM content in the 83CS28 is protected, the 80S2AH. Timer 2 is a 16-bit timer/counter. programmed watchdog timer intemal. This
i.e., it cannot be read out by any test mode or These 16 bits are formed by two special time interval is determined by an 8-bit value
by any instruction in the extemal program function registers TL2 and TH2. Another pair that has to be loaded in register T3 while at
memory space. The MOVC instructions are of special function register RCAP2L and the same time the prescaler is cleared by
the only ones which have access to program RCAP2H form a 1S-bit capture register or a hardware.
code in the intemal or extemal program 16-bit reload register. Uke Timer 0 and 1, it Watchdog timer interval =
memory. The EA input is latched during can operate either as a timer or as an event
RESET and is 'don't care' alter RESET. This counter. This is selected by bit CIT2N in the [256 - (T3)] x 2048
implementation prevents reading Irom special function register T2CON. It has three on - chip oscillator frequency
intemal program code by switching Irom operating modes: capture, autoload, and
extemal program memory to internal program baud rate generator mode which are selected
memory during MOVC instruction or an by bits in T2CON. BIT-LEVEL 12C INTERFACE
instruction that handles immediate data. This bit-level serial 110 interface supports the
Table 1 lists the access to tho intemal and 12C-bus. Pl.6/SCl and P1.7/S0A are the
WATCHDOG TIMER T3
external program memory by the MOVC serial 110 pins. These two pins meet the 12C
The watchdog timer consists of an 11-bit
instructions when the security bit has been specification conceming the input levels and
prescaler and an 8-bit timer formed by special
set to logical one. If the security bit has been output drive capability. Consequently, these
function register T3. The prescaler is
set to a logical 0 there are no restrictions for pins have an open drain output configuration.
incremented by an on-chip oscillator with a
the MOVC instructions. All the four modes of the 12C-bus are
fixed frequency of1 MHz. The maximum
supported:
tolerance on this frequency is -50% and
- master transmitter
INTERNAL DATA MEMORY + 100%. The 8-bit timer increments every
The intemal data memory is divided into three 2048 cycles of the on-chip oscillator. When a - master receiver
physically separated segments: 256 bytes of timer overflow occurs, the microcontroller is - slave transmitter
RAM, 256 bytes of AUX-RAM, and a 128 reset and a reset output pulse of 16 x 2048 - slave receiver
bytes special function area. These can be cycles of the on-chip oscillator is generated at The advantages of the bit-level1 2C hardware
addressed each in a different way. pin RST. The internal RESET signal is not
compared with a full software 12C
- RAM 0 to 127 can be addressed directly inhibited when the extemal RST pin is kept
implementation are:
and incirectly as in the 8OCSI. Address low by, for example, an external reset circuit.
- the hardware can generate the SCl pulse
pointers are RO and Rl of the selected The RESET signal drives port 1, 2, 3 into the
register bank. high state and port 0 into the high impedance - Testing a single bit (RBF respectively,
state. WBF) is sufficient as a check for error free
- RAM 128 to 255 can only be addressed
transmission.
indirectly as in the 80CSI. Address The watchdog timer is controlled by one
pointers are RO and Rl of the selected special function register WOCON with the The bit-level 12C hardware operates on serial
register bank. direct address location ASH. WOCON can be bit level and performs the following functions:
- AUX-RAM 0 to 255 is indirectly addressed read and written by software. A value of ASH - filtering the incoming serial data and clock
in the same way as extemal data memory in WOCON halts the on-chip oscillator and signals
with the MOVX instructions. Address clears both the prescaler and timer T3. Alter - recognizing the START condition
pointers are RO, Rl of the selected register the RESET signal, WOCON contains ASH. - generating a serial interrupt request SI alter
bank and OPTR. An access to AUX-RAM 0 Every value other than ASH in WOCON reception of a START condition and the
to 255 will not affect ports PO, P2, P3.6 and enables the watchdog timer. When the first falling edge of the serial clock
P3.7. watchdog timer is enabled, it runs - recognizing the STOP condition
independently of the XTAl-clock. - recognizing a serial clock pulse on the SCl
An access to extemal data memory locations
higher than 255 will be performed with the Timer T3 can be read on the fly. Timer T3 line
MOVX OPTR instructions in the same way as can only be written if WOCON contains the - latching a serial bit on the SOA line (SOl)
in the 8051 structure, so with PO and P2 as value SAH. A successful write operation to - stretching the SCl lOW period of the
data/address bus and P3.6 and P3.7 as write T3 will clear the prescaler and WOCON, serial clock to suspend the transfer of the
and read timing signals. Note that these leaving the watchdog enabled and preventing next serial data bit
external data memory cannot be accessed inadvertent changes of T3. To prevent an - setting Read Bit Finished (RBF) when the
with RO and Rl as address pointer. overflow of the watchdog timer, the user SCl clock pulse has finished and Write Bit
Finished (WBF) if there is no arbitration is left unconnected. There are nO a RESET in the same way as in the 8OC51 or
loss detected (i.e., SDA = 0 while SDO = 1) requirements on the duty cycle of the external in addition by one of two external interrupts,
- setting a serial clock low-to-High detected clock signal, because the input to the internal INTO or INT1. A termination with an external
(ClH) flag clock circuitry is through a divide-by-two interrupt does not affect the intemal data
- setting a Bus Busy (BB) flag on a START flip-flop. However, minimum and maximum memory and does not affect the special
condition and clearing this flag on a STOP high and low times specified in the data sheet function registers. This makes it possible to
condition must be observed. exit power.<fown without changing the port
- releasing the SCl line and clearing the output levels. To terminate the power.<fown
ClH, RBF and WBF flags to resume RESET mode with an external interruptl'flm or 11iITT
transfer of the next serial data bit A reset is accomplished by holding the RST must be switched to level-sensitive and must
- generating an automatic clock if the single pin high for at least two machine cycles (24 be enabled. The external interrupt input
bit data register S 1BIT is used in master oscillator periods), while the oscillator is signal JNrn and 11iITT must be kept low until
mode. running. To insure a good power-up reset, the the oscillator has restarted and stabmzed. An
RST pin must be high long enough to allow . instruction following the instruction that puts
The following functions must be done in the oscillator time to start up (normally a few the device in the power-down mode will be
software: milliseconds) plus two machine cycles. At executed. A reset generated by the watchdog
- handling the 12C START interrupts power-up, the voltage on Vee and RST must timer terminates the power-down mode in the
- converting serial to parallel data when come up at the same time for a proper same way as an external RESET, and only
receiving start-up. the contents of the on-chip RAM are
- converting parallel to serial data when preserved. The control bits for the reduced
transmitting power modes are in the special function
register PCON.
- comparing the received slave address with IDLE MODE
its own In idle mode, the CPU puts itself to sleep
- interpreting the acknowledge information while all of the on-chip peripherals stay
active. The instruction to invoke the idle DESIGN CONSIDERATIONS
- guarding the 12C status if RBF or WBF = O. At power-on, the voltage on Vee and RST
mode is the last instruction executed in the
Additionally, if acting as master: normal operating mode before the idle mode must come up at the same time for a proper
- generating START and STOP conditions is activated. The CPU contents, the on-chip start-up.
- handling bus arbitration RAM, and all of the special function registers When the idle mode is terminated by a
- generating serial clock pulses if Sl BIT is remain intact during this mode. The idle mode hardware reset, the device normally resumes
not used. can be terminated either by any enabled program execution, from where it left off, up
interrupt (at which time the process is picked to two machine cycles before the internal
Three SFRs control the bit-level1 2C interface: up attha interrupt service routine and reset algorithm takes control. On-chip
SlINT, SlBITandS1SCS. continued), or by a hardware reset which hardware inhibits access to intemal RAM in
starts the processor in the same manner as a this event, but access, to the port pins is not
power-on resel. inhibited. To eliminate the possibility of an
OSCILLATOR
unexpected write when idle is terminated by
CHARACTERISTICS reset, the instruction following the one that
XTAll and XTAl2 are the input and output,
POWER-DOWN MODE invokes idle should not be one that writes to a
respectively, of an inverting amplifier. The
In the power-down mode, the oscillator is port pin or to external memory.
pins can be configured for use as an on-chip
stopped and the instruction to invoke
oscillator, as shown in the logic Symbol. Table 2 shows the state of I/O ports during
power.<fown is the last instruction executed.
low current operating modes.
To drive the device from an external clock The power.<fown mode can be terminated by
source, XTAll should be driven while XTAl2
If 10L exceeds the test condition. VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed
test conditions.
5. Pins of ports 1. 2. and 3 source a transition current when they are being externally driven from 1 to O. The transition current reaches its
maximum value when VIN is approximately 2V.
S. See Figures 9 through 12 for Icc test conditions.
7. ICCMAX at other frequencies can be derived from the figure below. where FREQ is the extemal oscillator frequency in MHz.
ICCMAX is given in mAo
30
/
2S
/
20
/
8 15
/ /'"
TYP ACTlVE MODE
10
/
V MAX IDLE MODE
o
7" - TYP IDLE MODE
8 12 16
FREO. AT XTAL1 (MHz)
VALID ONLY WITHIN FREQUENCY SPECIFICATIONS OF DEVICE UNDER TEST.
Icc va. FREQUENCY
VIHI Input high voltage, XTAL1, RST ODC to 70DC 0.7Vee Vee+O·5 V
-40 DC to +85 DC 0·7Vee+O.1 Vee+O.5 V
AC ELECTRICAL CHARACTERISTICS 1, 2
16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
It.lWL 2,3 ALE low to lID or WR low 13B 23B 3tcLCl-50 3tcLCL+50 ns
tAVWL 2,3 Address valid to WR low or lID low 120 4teLCl-130 ns
lavwx 2,3 Data valid to WR transition 3 tclCL-60 ns
tWHQX 2,3 Data hold after WR 13 tcLCL-50 ns
tRlAZ 2,3 lID low to address float 0 0 ns
tWHLH 2,3 lID or WR high to ALE high 23 103 tCLCL-40 tcLCL+40 ns
External Clock
ALE
PORTO
PORT 2 _15
ALE
tWHlJI
i-----tLLDv ----~·I
tLLWl - - + f - - - t R l R H ---~
w ____________ ~--------~
14------tAVDV -----~
ALE
V
"
-tWHLH-
~tLLWL tWlWH
WR
tAVLl
tLLAX
--. tovwx .... -4- tWHQX
f 4 - - tAV W L -
PORT 2
)< P2.1I-P2.7 OR AlI-A.S FROM DPF AS-A.S FROM PCH
INSTRUCT10N
ALE
CLOCK
! t
OUTPUT DATA
.----""T----h. r----.. ~--.... r----.. ~--.... r---.. . r----, ,-----"7
WRITE TO SBUF
INPUT DATA
~
CLEAR RI
SDA
SCL
(INPUT/OUTPUT)
--I---ti'---'I
Vcc-O.5 - - - - ,-O'-7V-CC-....'
D.45V 0.2Vcc-d 1 ~--....,
IcLCL
Vcc-d5
o.45V
~ o.2Vcc.o.8
~..;o.;;;2;,,;V.::cc-d::..;;;,;.I_ _ _ _~.
>C' VLOAD
VLOAI)<O.1V
VLOAo-O·1V
nMING
REFERENCE
POINTS
V()H-G.1V
VOI..o.1V
NOTE: NOTE:
fJC Inputs during testing are driven at Vee -0.5 for a logic '1' and O.45V for a logic '0'. For timing purposes, a port Is no longer floating when a 100mV change from road
l1ning measurements are made at VIH min for a logic '1' and V,l for a logic '0'. voltage occurs, and begins to float when a l00mV change from the loaded VOH'
VOL level occurs. IOH/bL ~ ± 2OmA.
25
/
20
/
/
ICCrnA 15
/ ..,- TYP AcnVE MODE
V /'
10 / /
/ /V
e - :...- -
/ MAX IDLE MODE
Vcc
vcc
RST
PO pO
RST
Ell"
(NC) XTAL2 PI.6 (NC) XTAL2 Pl.6
CLOCK SIGNAL XTALI CLOCK SIGNAL XTAL1
Pl.7 Pl.7
Vss Vss
Figure 10. Icc Test Condition, Active Mode Figure 11. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
VCC
vcc
VCc-O·5 - - - - "'O-.7V-c-c"""" RST
O.45V O.2VCc-O. 1 "---.-';
Ell"
PO
IcHCL-
vss
EPROM CHARACTERISTICS aller the encryption table is programmed, (030H) =15H incflCBtes manufactured by
The 87C528 is programmed by using a verification cycles will produce only encrypted Philips
modified Quick-Pulse ProgrammingTM data.
(031 H) = 97H indicates 87C528
algorithm. /I differs from older methods in the To program the lock bits, repeat the 25 pulse
value used for Vpp (programming supply programming sequence using the 'Pgm Lock Program Lock Bits
voltage) and in the width and number of the Bir levels. After one lock bit is programmed, The 87C524 has 3 programmable lock bits
ALEIPROG pulses. further programming of the code memory and that will provide different levels of protection
The 87C528 contains two signature bytes encryption table is disabled. However, the for the on-chip code and data (see Table 4).
that can be read and used by an EPROM other lock bit can still be programmed. Erasing the EPROM also erases the
programming system to identify the device. Note that the ~pp pin must not be allowed encryption array and the program lock bits,
The signature bytes identify the device as an to go above the maximum specified Vpp level returning the part to full functionality.
87C528 manufactured by Philips. for any amount of time. Even a narrow glitch
Table 3 shows the logic lewis for reading the above that voltage can cause permanent ProgramNerlfy Algorithms
signature byte, and for programming the damage to the device. The Vpp source Any algorithm in agreement with the
program memmy, the encryption table, and should be well regulated and free of glitches conditions listed in Table 3, and which
the lock bits. The circuit configuration and and overshoot. satisfies the timing specifications, is suitable.
waveforms for quick-pulse programming are
shown in Figures 14 and 15. Figure 16 shows Program Verification Erasure Characteristics
II lock bit 2 has not been programmed, the .Erasure of the EPROM begins to occur when
the circuit configuration for normal program
on-chip program memory can be read out for the chip is exposed to light with wavelengths
memory verification.
program verification. The address of the shorter than approximately 4,000 angstroms.
Qulck·Pulse Programming program memory locations to be read is Since sunlight and fluorescent lighting have
The setup for microcontroller quick-pulse applied to ports 1, 2 and 3 as shown in wavelengths in this range, exposure to these
programming is shown in Figure 14. Note that Figure 16. The other pins are held at the light sources over an extended time (about 1
the 87C528 is running with a 4 to 6MHz 'Verify Code Data' levels indicated in Table 3. week in sunlight, or 3 years in room level
oscillator. The reason the oscillator needs to The contents of the address location will be ffuorescentlighting) could cause inadvertent
be running is that the device is executing emitted on port o. External pull-ups are erasure. For this and secondary effects,lt
internal address and program data transfers. required on port 0 for this operation. Is recommended that an opaque label be
placed over the window. For elevated
The address of the EPROM location to be II the encryption table has been programmed, temperature or environments where solvents
programmed is applied to ports I, 2 and 3, as the data presented at port 0 will be the are being used, apply Kapton tape Fluorglas
shown in Figure 14. The code byte to be exclusive NOR of the program byte with one part number 2345..0, or equivalent.
programmed into that location is applied to of the encryption bytes. The user will have to
port O. RST, I'SER and pins of ports 2 and 3 know the encryption table contents in order to The recommended erasure procedure is
specified in Table 3 are held at the 'Program corillcUy decode the verification data. The exposure to ultraviolet light (at 2537
Code Data' lewis indicated in Table 3. The encryption table itsell cannot be read out. angstroms) to an integrated dose of at least
ALEIPROG is pulsed low 25 limes as shown 15W-seclcm2 . Exposing the EPROM to an
in Figure 15. Reading the Signature By1es ultraviolet lamp of 12,OoouW/cm2 rating for
The signature bytes are read by the same 20 to 39 minutes, at a distance of about 1
To program the encryption table, repeat the procedure as a normal verification of inch, should be sufficient.
25 pulse programming sequence for locations 030H and 031 H, except that P3.6
addresses 0 through 3FH, using the"Pgm and P3.7 need to be pulled to a logic low. The Erasure leaves the array in an all 1s state.
Encryption Table' levels. Do not forget that values are:
Table 4.
PROGRAM LOCK BITS', 2
LBI LB2 LB3 PROTECTION DESCRIPTION
1 U U U No Program Lock features enabled. (Code verify will still be encrypted by the Encryption Array if
programmed.)
2 P U U MOVC instructions executed from external program memory are disabled from fetching code bytes
from internal memory, EA is jumped and latched on Reset, and further programming of the EPROM
is disabled.
3 p P U Same as 2, also verify is disabled.
4 P P P Same as 3, external execution is disabled. Internal data RAM is not accessable.
NOTES:
1. P - programmed. U - unprogrammed.
2. Any other combination of the lock bits is not defined.
Vee
P1 PO PGMDATA
1'2.8 o
1 1~·----------~---------25Pu~e~~----------------~~
.----
I
ALI1II'Rllm o~1____________~Il~____________~rl~__
Vee
_7 P1 PO PGMDATA
RST EXlVpp
1'3.8 AlEJI'IIOG
XTAL1 ~5 A8-A13
-
FIgure 16. Program Verification
PROGRAMMING VEmRcAlloN
P1.O-Pl.7
P2.0-P2.4
ADDRESS
-0
ADDRESS
"
/
- IAVQV
IDVGl f-
~ -----
-0 :4"- IGHDX
IAVGl IGHAX
AlEil'ROG"
~~ h .
IGlGH ... I<- -+ IGHGl
ISHGl I- IGHSl
V
/
1'2.7
""
lQGICO
------------ -----------.----------------- ----------- ------------
IEHSH
lOGIC 1
IEl~
lOGIC 1
IEHQZ
EmIBl:E
'FOR PROGRAMMING VERIFICATION SEE FIGURE 14. I I
FOR VERIFICATION CONDITIONS SEE FIGURE 16.
•
Purchase of Philips' 12C components conveys a license under the
Philips' 12C patent to use the components In the 12C-system
provided the system conforms to the 12C specifications defined by Philips.
8XC550 OVERVIEW • 24 I/O lines + a input only lines on the LCC I/O Port Structu re
The Signetics aXC550 is a single-chip control package (24 I/O lines + 6 input only lines The aXC550 has the same I/O ports as the
oriented microcontroller in the aOC51 family. on the DIP package), port 1 is input only standard aOC51 with the following
The axcsso has the same basic architecture exceptions: the port 1 pins are shared with
and instruction set as the industry standard • Two 16-bit counter/timers the AID converter inputs and are input only
SOC51 , with the addition of an eight-channel pins even when the AID is not being used;
• Two extemal interrupts port 1 has only 6 pins on the DIP version of
multiplexed a-bit AID converter and a
versatile watchdog timer. • External memory addressing capability of the part.
64k program memory and 64k data
The part is available in three versions, AID Converter
memory
collectively referred to as the aXC550: the The LCC packaged versions of the aXC550
83CSSO with 4k bytes of masked ROM • Full duplex UART contain an eight-channel multiplexed a-bit
program memory; the a7CSSO with 4k bytes AID converter, while the DIP versions
of EPROM program memory; and the • Low power consumption implement only six channels. The conversion
SOCSSO with no on-chip program memory. - Idle mode requires 40 machine cycles (40l1s at 12MHz
The EPROM version of this device is - Power-down mode oscillator frequency).
available in both quartz-lid erasable and
The AID converter is controlled by the AID
one-time programmable (OTP) packages.
Differences From the 80C51 control register, ADCON. Input channels are
Once the EPROM array of the a7C550 is
selected by the analog multiplexer by bits
programmed, the part will generally be
Special Function Registers ADCON.O through ADCON.2. The ADCON
functionally equivalent to the masked ROM
The aXC550 contains all of the special register is not bit addressable.
83CSSO. The watchdog timer setup, however,
is accomplished in a different manner on the function registers (SFRs) that are present on The completion of the a-bit ADC conversion
ROM part than it is on the EPROM and the standard aOC51. There are several SFRs is flagged by ADCI in the ADCON register,
ROMless parts. Refer to the description of that have been added as well as several and the result is stored in the special function
the watchdog timer for details. others that have been modified somewhat in register ADAT.
order to accommodate the additional
The axcsso supports two power reduction functions of this chip. An ADC conversion in progress is unaffected
modes of operation referred to as the idle by an ADC start. The result of a completed
mode and the power-down mode. The Table 1 contains a summary of all of the conversion remains unaffected provided
aXC550 features include: SFRs and their addresses. ADCI remains at a logic 1. While ADCS is a
• SOC51 based architecture logic 1 or ADCI is a logic 1, a new ADC
The AID control register (ADCON) and the START will be blocked and consequendy lost.
• Eight-channel multiplexed a-bit AID AID data register (ADAT) have been added to An ADC conversion in progress is aborted
converter in the LCC package (six allow access to the on-chip AID converter. when the idle or power-down mode is
channels on the DIP package) ADCON contains all of the control and status entered. The result of a completed
bits required to operate the A/D converter. conversion (ADCI = logic 1) remains
• 4O-microsecond AID conversion time
unaffected when entering the idle mode. See
(when used with a 12MHz oscillator) Four other registers have been added to
Figure 1 for an AID input equivalent circuit.
allow control of the watchdog timer function.
• Separate AID power supply and references The WDCON register controls watchdog The analog input pins ADCO-ADC7 may still
(LCC part only) timer operation, and WDL holds the watchdog be used as digital inputs. The analog input
• Watchdog timer timer reload value. The WFEED1 and channel that is selected by the
WFEED2 registers, when properly ADDR2-ADDRO bits in AD CON cannot be
• 4k byte ROM or EPROM program memory manipUlated, cause the watchdog timer to be used as a digital input. Reading the selected
• 12a-byte RAM reloaded from WDL. The current watchdog AID channel as a digital input will always
counter value may also be read back from return a 1. The unselected AID inputs may
• 4O-pin DIP and 44-pin LCC packages the WDL register address. always be used as digital inputs.
AF AE AD AC AB AA A9 AB
IE'# Interrupt enable ABH EA I EWD I EAD I ES I En I EXI I ETO I EXO OOH
PO' PortO SOH 87 86 8S B4 83 82 81 BO FFH
PI' Port 1 90H 97 96 9S 94 93 92 91 90 FFH
P2' Port 2 AOH A7 A6 AS A4 A3 A2 Al AO FFH
P3' Port 3 BOH B7 B6 BS B4 B3 B2 Bl BO FFH
PCON# Power control B7H SMOD I SIDL I - I - I GFI I GFO I PD I IDL OOxxOOOOB
D7 D6 DS D4 D3 D2 Dl DO
PSW' Program status word DOH CY I AC I FO I ASI I ASO I OV I - I P OOH
SBUF Serial data buffer ggH xxH
9F 9E 9D 9C 9B 9A 99 98
SCOW Serial port control 98H SMO I SMI I SM2 I AEN I TBB I AB8 I TI I AI OOH
SP Stack pointer 81H 07H
8F 8E 80 BC 8B 8A B9 BB OOH
TCOW limer counter/control BBH TFI I TAl I TFO I TAO I lEI I ITI I lEO I ITO OOH
ADCON Register AADR2 ADCON.2 Analog input selects .. StartAD: MOV A,#Oah ;Basic AID
AADRl ADCON.l Binary coded address ;start
IISB LSB
AADRO ADCON.O selects one of the five ;command.
I X I x I x IADClI ADCS IAADR21 AADR.I AADRO I analog input port pins ORL A,R? ;Add channel
of P 1 to be input to the ;# to be read.
ADCI ADCS Operation converter. It can only MOV ADCON,A ;StartAlD.
o o ADC not busy, a be changed when RET
conversion can be ADCI and ADCS are
started. both low. AADR2 is the
o ADC busy, start of a new most significant bit.
conversion is blocked. ORG 2Bh ;AlD interrupt
o Conversion completed, Sample AID Routines ;address.
start of a new is blocked. The following routines demonstrate two ADln!: MOV RS,ADAT ;Get
Not possible. methods of operating the AID converter. The ;conversion
first method uses polling to determine when ;result.
INPUT CHANNEL SELECTION the AID conversion is complete. The second MOV ADCON,#O ;Clear ADCI.
method uses the AID interrupt to flag the end RETI
ADDR2 ADDRl ADDRO INPUT
PIN of conversion.
Watchdog Timer
0 0 0 PLO The routine ReadAD will start a read of the The purpose of the watchdog timer is to reset
0 0 1 Pl.l AID channel identified by R?, and wait for the the microcontroller within a reasonable
0 1 0 Pl.2 conversion to complete, polling the AID amount of time if it enters an erroneous state,
0 1 1 Pl.3 interrupt flag. The result is returned in the possibly due to a programming error,
1 0 0 Pl.4 accumulator. electrical noise, or RFI. When enabled, the
1 0 1 Pl.S
1 Pl.S· ReadAD:MOV A,#08h ;Basic AID watchdog circuit will generate a system reset
1 0
. 1 1 1 Pl.?"
Not present on 40-pln DIP versIons.
;start
;command.
if the user program fails to "feed" (or reload)
the watchdog within a predetermined amount
of time.
Symbol Position Function ORL A,R? ;Add channel
;# to be read. The watchdog timer implemented on the
ADCI ADCON.4 ADC interrupt flag.
MOV ADCON,A; ;Start AID. 8XC550 has a programmable interval and
This flag is set when
ADLoop: MOV A,ADCON ;Get AID can thus be fine tuned to a particular
an ADC conversion is
;status. application. If the watchdog function is not
complete. If IE.S ; 1,
JNB ACC.4,ADLoop;Wait for used, the timer may still be used as a
an interrupt is
;ADCI versatile general purpose timer.
requested when
ADCI ; 1. The ADCI ;(AlD The watchdog function consists of a
flag must be cleared ;finished). programmable 13-bit prescaler, and an a-bit
by software after AID MOV A,ADAT ;Get main timer. The main timer is clocked by a
data is read, before the ;conversion tap taken from one of the top 8 bits of the
next conversion can ;result prescaler. The prescaler is incremented once
begin. MOV ADCON,#O ;ClearADCI. every machine cycle, or 1/12 of the oscillator
ADCS ADCON.3 ADC start and status. RET frequency. Thus, the main counter can be
Setting this bit starts The routine StartAD will start a read of the clocked as often as once every S4 machine
an AID conversion. AID channel identified by R? and exit back to cycles or as seldom as once every 8192
Once set, ADCS the calling program. When the conversion is machine cycles.
remains high complete, the AID interrupt occurs, calling the When clocked, the main counter decrements.
throughout the AID interrupt service routine. The result of the If the main watchdog counter reaches zero, a
conversion cycle. On conversion is returned in register RS. system reset will occur. To prevent the
completion of the watchdog timer from under-flowing, the
conversion, it is reset watchdog must be fed before it counts down
at the same time the to zero. When the watchdog is fed, the
ADCI interrupt flag is contents of the WDL register are loaded into
set. ADCS cannot be the main watchdog counter and the prescaler
reset by software. is cleared.
r-------,
• I • • I
• I • • I
• I • • I
I SmN+. RmN+. I
IN+. I /' I
I
I
I SmN RmN
II To Comparator
IN i --------
IL _ _ _ _ _ _ _ .JI
RS~
Multiplexer
.J.. Cc
I
VANALOG INPUT
Rm = 0.5 - 3 kohms
CS + CC = 15pF maximum
RS = Recommended < 9.6 kohms for 1 lSB @ 12MHz
NOTE:
Because the analog to digital converter has a sampled-data comparator, the input looks capacitive to a source. When a conversion is
initiated, switch Sm closes for 8tcy (8fJ.S @ 12MHz crystal frequency) during which time capacitance Cs + Cc is charged. It should be
noted that the sampling causes the analog input to present a varying load to an analog source.
WDCON Register WDCON.l WDTOF limeout flag (read apply to all versions of the 8XC550 except
USB LSB
!write). This bit is set the ROM part when running from internal
when the watchdog program memory.
/PRE2/ PRE./PRED/ x / x /WDRUN/WDTOF/WDMOD/ timer underflows. It is
Symbol Position Function cleared by an external This routine sets up and starts the watchdog
WDCON.7 PRE2 Prescaler select reset and can be timer. This is not necessary for internal ROM
(readfwrite). cleared by software. operation, because setup of the watchdog
WDCON.6 PREI These bits select the WDCON.O WDMOD Mode selection (read! timer on masked ROM parts is accomplished
WDCON.5 PREO pre scaler divide ratio write). When WDMOD directly via ROM mask options.
according to the = 1, the watchdog is
selected; when SetWD: MOV WDl,#OFFh ;Setwatch-
following table:
WDMOD = 0, the timer ;dog
PRE2 PRE1 PREO DIVISOR is selected. Selecting ;reload value.
(FROM fose) the watchdog mode MOV WDCON,#OE5;Set up timer
automatically disables ;prescaler,
0 0 0 12 x64
0 0 1 12x64x2 power-down mode. ;mode, and
0 1 0 12x64x4 WDMOD is cleared by ;run bits.
0 1 1 12x64x8 external reset. Once ACALl FeedWD ;Start watch-
1 0 0 12x64x16 the watchdog mode is ;dog with a
1 0 1 12x64x32 selected, this bit can ;feed
1 1 0 12x64x64 only be cleared by ;operation.
1 1 1 12x64x128 RET
writing a 0 to this bit
WDCON.4 - Not used and then performing a
WDCON.3 - Not used feed operation. This routine executes a watchdog timer feed
WDCON.2 WDRUN Run control (read! operation, causing the timer to reload from
write). This bit turns A very specific sequence of events must take WDl. Interrupts must be disabled during this
the timer on (WDRUN place to feed the watchdog timer; it cannot be operation due to the fact that the two feed
= 1) or off (WDRUN = fed accidentally by a runaway program. The registers must be loaded on consecutive
0) if the timer mode following routines demonstrate setting up and instruction cycles, or a system reset will occur
has been selected. feeding the watchdog timer. These routines immediately.
low power attributes of CMOS. Philips - Eight channels of B-bit AID PO.lIADI
epitaxial substrate minimizes latch-up - Two 16-bitcounter/timers Pl.1/ADC1 4 7 PO.21AD2
sensitivity. The CMOS BXC550 has the same - Watchdog timer PO.31AD3
instruction set as the BOC51.
- Full duplex serial channel 5 PO.4/AD4
The BXC550 contains a 4k x B EPROM - Boolean processor
PO.51AD5
(B7C550)/ROM (B3C550)/ROMless (BOC550
has no program memory on-<:hip), a 12B x B • Memory addressing capability PO.6/AD6
RAM B channels of B-bit AID, four B-bit ports - 64k ROM and 64k RAM
(port'1 is input only), a watchdog timer, two • Power control modes: 1 EfNpp
16-bit counter/timers, a seven-source, - Idle mode
two-priority level nested interrupt structure, a ALEIPROO
- Power-down mode
serial I/O port for either multi-processor
communications, I/O expansion or full duplex • CMOS and TTL compatible P2.7/A15
UART, and an on-chip oscillator and clock • One speed range at 7 P2.6/AI4
circuits. Vee = 5V±10%
In addition, the BXC550 has two software - 3.5 to 16MHz
selectable modes of power reduction - idle • Four package styles
mode and power-down mode. The idle mode
freezes the CPU while allowing the RAM, • Extended temperature ranges
timers, serial port, and interrupt system to • OTP package available
continue functioning. The power-down mode
saves the RAM contents but freezes the 1 P2.0/AS
oscillator, causing all other chip functions to
be inoperative.
6 1 40
'G"
17
Pin Function
18
Pin
28
Function
29
Pin F\.I1Ction
1 AV.. 16 P3.2lIIm! 31 P2.61AI4
2 Vref. 17 P3.3IIIl1T 32 P2.7/A15
3 Vref- 18 P3.4iTO 33 P5EliI
4 AVss 19 P3.5iTl 34 ALEII'ROO
5 Pl.n'ADCo 20 P3.6iWR 35 ElWpp
6 Pl.lIADCl 21 P3.7/RO 36 PO.7/A07
7 Pl.21ADC2 22 XTAL2 37 PO.61AIl6
8 Pl.31ADC3 23 XTAL1 38 PO.51A05
9 P1A1ADC4 24 V... 39 PO.41AD4
10 Pl.5'ADC5 25 P2.DlAS 40 PO.31A03
11 P1.61ADC6 26 P2.lIAB 41 PO.21AD2
12 P1.7/ADC7 27 P2.21Al0 42 PO.lIAOI
13 RST 28 P2.31AI1 43 PO.DlAOO
14 P3.n'RxD 29 P2.4/A12 44 Vee
15 P3.11TxD 30 P2.51AI3
BLOCK DIAGRAM
,---------------;.:ruElllIl:; ,:lli:lliii;----------------.
I
I I
v££.J I
Vss I I
~ I
I
I I
I I
I I
I I
I
I
I
I
I
I
I
I
I
l'SER
I
Al.EJI'ROG:
ElWpp
RESET
P1.O-P1.7
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC TYPE NAME AND FUNCTION
Vss 20 24 I Ground: OV relerence.
Vec 40 44 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
AVec 1 1 I Analog Power Supply: Analog supply voltage.
AVss 2 4 I Analog Ground: Analog OV reference.
Vref+ 2 I Vref: AID converter reference level inputs. Note that these references are combined with AVee and
Vref- 3 I AVss in the 40-pin DIP package.
PO.O-O.7 39-32 43-36 I/O Port 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 pins that have 1s written to them float
and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and
data bus during accesses to external program and data memory. In this application, it uses strong
internal pull-ups when emitting 1s. Port 0 also outputs the code bytes during program verification in
the 887C550. External pull-ups are required during program verification.
PI.D-P1.7 3-8 5-12 I Port 1: Port 1 is an 8-bit input only port (S-bit in the DIP package; bits P1.6 and P1.7 are not
implemented). Port 1 digital input can be read out any time.
ADCD-ADC7 3-8 5-12 ADCx: Inputs to the analog multiplexer ioput at the 8-bit AID. There are only six A/D inputs in the
DIP package.
P2.D-P2.7 21-28 25-32 1/0 Port 2: Port 2 is an 8-bit bidirectional 110 port with internal pull-ups. Port 2 pins that have 1s written
to them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins that
are externally being pulled low will source current because of the internal pull-ups. (See DC
Electrical Characteristics: I,Ll. Pert 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that use IS-bit addresses (MOVX
@DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that use 8-bit addresses (MOV @Ri), port 2 emits the contents of the P2
special function register.
P3.D-P3.7 10-17 14-21 110 Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins that have 1s written
to them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins that
are externally being pulled low will source current because of the pull-ups. (See DC Electrical
Characteristics: I,Ll. Port 3 also serves the special features of the SC80C51 family, as listed below:
10 14 I RxD (P3.0): Serial input port
11 15 0 TxD (P3.1): Serial output port
12 16 I IN"rn (P3.2): External interrupt
13 17 I mIT (P3.3): External interrupt
14 18 I TO (P3.4): Timer 0 external input
15 19 I Tl (P3,S): Timer 1 external input
16 20 0 Wff (P3.S): External data memory write strobe
17 21 0 m1 (P3.7): External data memory read strobe
RST 9 13 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the device. An
internal diffused resistor to Vss permits a power-on reset using only an external capacitor to Vee.
ALEiPROG 30 34 110 Address Latch Enable/Program Pulse: Output pulse for latching the low byte of the address
during an access to external memory. In normal operation, ALE is emitted at a constant rate of 1/6
the oscillator frequency, and can be used for external timing or clOCking. Note that one ALE pulse is
skipped during each access to external data memory. This pin is also the program pulse input
(P"ROG) during EPROM programming.
PSEN 29 33 0 Program Store Enable: The read strobe to external program memory. When the device is
executing code from the external program memory, PSEN is activated twice each machine cycle,
except that two PSEN activations are skipped during each access to external data memory. PSEN is
not activated during fetches from internal program memory.
El'JVpp 31 35 I External Access EnablelProgramming Supply Voltage: 81: must be externally held low to enable
the device to fetch code from external program memory locations OOOOH to OFFFH. If 81: is held
high, the device executes from internal program memory unless the program counter contains an
address greater than OFFFH. For the 80C550 ROMless part, loA must be held low for the part to
operate properly. This pin also receives the 12.75V programming supply voltage (Vpp) during
EPROM programming.
XTAL1 19 23 I Crystal 1 : Input to the inverting oscillator amplifier and input to the internal clock generator circuits.
XTAL2 18 22 0 Crystal 2: Output from the inverting oscillator amplifier.
INTERRUPTS AID CONVERTER register ADAT. The functions of the ADCI and
The interrupt structure is a seven source, two The analog input circuitry consists of an ADCS are:
level interrupt system similar to that of the 8-input analog multiplexer and an ADCI ADCS Operation
8OC51. The interrupt sources are listed in analog-te-digital converter with 8-bit o 0 ADC not busy. A conver-
Table 1 in order of polling sequence priority resolution. In the LCC package, the analog sion can be started.
(highest to lowest). Note that the watchdog reference voltage and analog power supplies o ADC busy. Start of a new
timer function is available only if the are connected via separate input pins; in the conversion is blocked.
watchdog timer function is disabled and the DIP package, Vref+ is combined with AVcc o Conversion completed.
watchdog timer is used as a general purpose and Vref- is combined with AVss. The analog start of new conversion
timer. inputs are alternate functions to port 1, which is blocked.
is an input only port. Digital input to port 1 Not possible.
Interrupt Control Registers can be read any time during an AID
The interrupt enable and the interrupt priority conversion. Care should be exercised in
registers have been modified to take into mixing analog and digital signals on port 1, An ADC conversion in progress is unaffected
account the different interrupt sources of the because cross talk from the digital input by a software ADC start. The result of a
8XC550. In all other respects, their operation signals can degrade the AID conversion completed conversion remains unaffected
is identical to that of the 8OC51. Setting a bit accuracy of the analog input. An AID provided ADCI remains at a logic 1. While
in the I E register enables the interrupt; conversion requires 40 machine cycles. ADCS is a logic 1 or ADCI is a logic 1, a new
clearing the bit disables the interrupt. All bits ADC START will be blocked and
are cleared by reset. See Figure 1 for The AID converter is controlled by the consequently lost. An AID conversion in
interrupt register formats. ADCON special function register. The input progress will be aborted when the idle or
channel to be converted is selected by the power-down mode is entered. The result of a
analog mUltiplexer by setting ADCON register =
completed conversion (ADCI logic 1)
bits, ADDR2-ADDRO (see Figure 3). These remains unaffected when entering the idle
SERIAL COMMUNICATIONS bits can only be changed when ADCI and
The serial port operation is identical to that of mode, but will be lost if power-down mode is
ADCS are both low. entered.
the 8OC51. In order to conserve power,
another bit (SIDL) has been added to the The completion of the 8-bit ADC conversion
PCON register that idles the serial port when is flagged by ADCI in the ADCON register
it is not being used. This bit is cleared by and the result is stored in the special function
reset. See Figure 2.
MSB INTERRUPT ENABLE REGISTER (IE) LSB MSB INTERRUPT PRIORITY REGISTER (IP) LSB
EA I I I I I I
EWD EAD ES ETl EXl ETO EXO I x I I I I I I
PWD PAD PS PTl PXl PTO PXO
LSB LSB
NOTE:
, ,
a ADC6
ADC7
The PCON register Is at SFR byte oodress B7H.lts contents following
a reset are OOXXOOOO. BIT SYMBOL FUNCTION
ADCON.7 - NOT USED
ADCON.6 - NOT USED
ADCON.S - NOT USED
ADCON.4 ADCI AOC INTERRUPT FLAG. This flag is set when an ADC conversion
f:;~~~~¥t;~~= ~~i t; bn~~~~~ ~~~.ifttt~~ ib!,er~pt
ADCON.3 ADCS ~~~~Wt AND STATUS. Sening this flag starts an AID convers-
ion. The ADC logic insurus that this signal IS high while the ADC is
busy. On completion of the conversion, ADCS IS reset at the same
ADCON.2 ADDR2
~mt~'~~~.f ~~~~I~S set. ADeS cannot be reset by sohware.
ADCON.' ADDR, ANALOG INPUT SELECT,
ADCON.O ADORa ANALOG INPUT SELECT a
Figure 2. Power Control Register (PCON) Figure 3. AID Control Register (ADCON)
WATCHDOG TIMER The watchdog timer subsystem consists of a changes from EPROM prototyping to ROM
The watchdog timer is not directly loadable prescaler and a main counter. The prescaler coded production parts.
by the user. Instead, the value to be loaded has 8 selectable taps off the final stages and
into the main timer is held in an autoload the output of a selected tap provides the Watchdog Detailed Operation
register or is part of the mask ROM clock to the main counter. The main counter
EPROM Device (and ROMless Operation:
programming. In order to cause the main is the section that is loaded as a result of the
timer to be loaded with the appropriate value, software feeding the watchdog and it is the =
EA 0)
In the ROMless operation (ROM part, EA = 0)
a special sequence of software action must section that causes the system reset
and in the EPROM device, the watchdog
take place. This operation is referred to as (watchdog mode) or time-out flag to be set
operates in the following manner.
feeding the watchdog timer. (timer mode) if allowed to reach its terminal
count. Whether the watchdog is in the watchdog or
To feed the watchdog, two instructions must
timer mode, when external RESET is applied,
be sequentially executed successfully. No Programming the Watchdog Timer the following takes place:
intervening instruction fetches are allowed, so Both the EPROM and ROM devices have a
interrupts should be disabled before feeding • Watchdog mode bit set to timer mode.
set of SFRs for holding the watchdog
the watchdog. The instructions should move autoload values and the control bits. The • Watchdog run control bit set to OFF.
A5H to the WFEED1 register and then 5AH watChdog time-out flag is present in the • Autoload register set to FF (max count).
to the WFEED2 register. If WFEED1 is watchdog control register and operates the
correctly loaded and WFEED2 is not correctly same in all versions. In the EPROM device, • Watchdog time-out flag cleared.
loaded, then an immediate underflow will the watchdog parameters (autoload value • Prescaler is cleared.
occur. and control) are always taken from the SFRs.
• Prescaler tap set to the highest divide.
The watchdog timer subsystem has two In the ROM dt'lvice, the watchdog parameters
can be mask programmed or taken from the • Autoload takes place.
modes of operation. Its principal function is a
watchdog timer. In this mode it protects the SFRs. The selection to take the watchdog
The watchdog can be fed even though it is in
system from incorrect code execution by parameters from the SFRs or from the mask
the timer mode.
causing a system reset when the watchdog programmed values is controlled by EA
timer underflows as a result of a failure of (external access). When EA is high (internal Note that the operational concept is for the
software to feed the timer prior to the timer ROM access), the watchdog parameters are watchdog mode of operation, when coming
reaching its terminal count. If the user does taken from the mask programmed values. If out of a hardware reset, the software should
not employ the watchdog function, the the watchdog is masked programmed to the load the autoload registers, set the mode to
watchdog subsystem can be used as a timer. timer mode, then the autoload values and the watchdog, and then feed the watchdog
In this mode, reaching the terminal count sets pre-scaler taps are taken from the SFRs. (cause an autoload). The watchdog will now
a flag which can be used to generate an When EA is low (external access), the be starting at a known point.
watChdog parameters are taken from the
interrupt. In most other respects, the timer If the watchdog is in the watchdog mode and
mode possesses the characteristics of the SFRs. The user should be able to leave code
running and happens to underflow at the time
in his program which initializes the watchdog
watchdog mode. This is done to protect the the external RESET is applied, the watchdog
integrity of the watchdog function. SFRs even though he has migrated to the
time-out flag will be cleared.
mask ROM part. This allows no code
When the watchdog is in the watchdog mode followed by a 13 stage counter with taps from bits are taken from mask coded bits and are
and the watchdog underflows, the following stage 6 through stage 13. The tap selection is not readable by the program. WDRUN is read
action takes place: programmable. The watchdog main counter only in the ROM part when EA is high and
• Autoload takes place. is a down counter clocked (decremented) WDMOD is in the watchdog mode. When
each time the programmable prescaler WDMOD is in the timer mode, WDRUN
• Watchdog time-out flag is set functions normally (see Figure 4).
underflows. The watchdog generates an
• TImer mode intenupt flag unchanged. underflow signal (and is autoloaded) when
The parameters written into WDMOD, PREO,
the watchdog is at count 0 and the clock to
• Mode bit unchanged. PRE1, and PRE2 by the program are not
decrement the watchdog occurs. The
• Watchdog run bit unchanged. applied directly to the watchdog timer
watchdog is 8 bits long and the autoload
subsystem. The watchdog timer subsystem is
• Autoload register unchanged. value can range from 0 to FFH. (The
directly controlled by a second register which
autoload value of 0 is permissible since the
• Prescaler tap unchanged. stores these bits. The transfer of these bits
prescaler is cleared upon autoload).
from the user register (WDMOD) to the
• All other device action same as external
This leads to the following user design second control register takes place when the
reset.
equations. Definitions :Iosc is the oscillator watchdog is fed. This prevents random code
Note that if the watchdog underflows, the period, N is the selected prescaler tap value, execution from directly foiling the watchdog
program counter will start from OOH as in the W is the main counter autoload value, tMIN is function. This does not affect the operation
case of an external reset. The watchdog the minimum watchdog time-out value (when where these bits are taken from mask coded
time-out flag can be examined to determine if the autoload value is 0), tMAX is the maximum values.
the watchdog has caused the reset condition. time-out value (when the autoload value is
The watchdog time-out flag bit can be cleared FFH), tD is the design time-out value.
by software.
tMIN = lose x 12x64
OSCILLATOR
When the watchdog is in the timer mode and CHARACTERISTICS
!MAX = tMIN X 128 x 256 XTAL 1 and XTAL2 are .the input and output,
the timer software underflows, the following
action takes place: 10 = tMIN x 2PRESCALER X W respectively, of an inverting amplifier. The
(where prescaler = 0, 1, 2, 3, 4, 5, 6, or 7) pins can be configured for use as an on-chip
• Autoload takes place.
oscillator, as shown in the Block Diagram,
• Watchdog time-out flag is set Note that the design procedure is anticipated page 346).
to be as follows. A tMAX will be chosen either
• Mode bit unchanged. from equipment or operation considerations To drive the device from an external clock
• Watchdog run bit unchanged. and will most likely be the next convenient source, XTAL 1 should be driven while XTAL2
value higher than to. (If the watchdog were is left unconnected. There are no
• Autoload register unchanged.
inadvertently to start from FFH, an overflow requirements on the duty cycle of the external
• Prescaler tap unchanged. would be guaranteed, barring other clock Signal, because the input to the internal
anomalies, to occur within tMAX)' Then the clock circuitry is through a divide-by-two
The timer mode interrupt flag is cleared when
value for the prescaler would be chosen from: flip-flop. However, minimum and maximum
the interrupt routine is invoked. This bit can
high and low times specified in the data sheet
also be cleared directly by software without a prescaler = log2 (tMAX I (Iosc x 12 x 256)) - 6 must be observed.
software feed operation.
This then also fixes tMIN. An autoload value
Mask ROM Device (EA 1) = would then be chosen from:
In the mask ROM device, the watchdog mode IDLE MODE
W = tDItMIN-l
bit (WDMOD) is mask programmed and the In idle mode, the CPU puts itself to sleep
bit in the watchdog command register is read The software must be written so that a feed while all of the on-chip peripherals stay
only and reflects the mask programmed operation takes place every 10 seconds from active. the instruction to invoke the idle mode
selection. If the mask programmed mode bit the last feed operation. Some tradeoffs may is the last instruction executed in the normal
selects the timer mode, then the watchdog need to be made. It is not advisable to operating mode before the idle mode is
run bit (WDRUN) operates as described include feed operations in minor loops or in activated. An AID conversion in progress will
under EPROM Device. If the mask subroutines unless the feed operation is a be aborted when idle mode is entered. The
programmed bit selects the watchdog mode, specific subroutine. CPU contents, the on-chip RAM, and all of
then the watchdog run bit has no effect on the the special function registers remain intact
Watchdog Control Register (WDCON) during this mode. The idle mode can be
timer operation.
(Bit Addressable) Address CO
terminated either by any enabled intenupt (at
Watchdog Function The following bits of this register are read which time the process is picked up at .the
The watchdog consists of a programmable only in the ROM part when EA is high: interrupt service routine and continued), or by
prescaler and the main timer. The prescaler WDMOD, PREO, PRE1, and PRE2. That is, a hardware reset which starts the processor
derives its clock from the on-chip oscillator. the register will reflect the mask programmed in the same manner as a power-on reset.
The prescaler consists of a divide by 12 values. In the ROM part with EA high, these
MSB LSB
DIVISOR
PRE2 PRE1 PREO (FROM fooc)
0 0 0 12 X 64
0 0 1 12X64X2
0 1 0 12 X 64 X 4
0 1 1 12 X 64 X 8
1 0 0 12X64X16
1 0 1 12 X 64 X32
1 1 0 12X64X64
1 1 1 12X64X 128
Programmable Idle Modes POWER-DOWN MODE When the idle mode is terminated by a
The programmable idle modes have been In the power-down mode, the oscillator is hardware reset, the device normally resumes
dispersed throughout the functional blocks. stopped and the instruction to invoke program execution, from where it left off, up
Each block has its own ability to be disabled. power-down is the last instruction executed. to two machine cycles before the internal
For example, if timer 0 is not commanded to The power-down mode can be terminated by reset algorithm takes control. On-chip
be running (TR = 0), then the clock to the a Reset in the same way as in the 80C51. hardware inhibits access to internal RAM in
timer is disabled resulting in an idle mode The control bits for the reduced power modes this event, but access to the port pins is not
power saving. An additional idle control bit are in the special function register peON. inhibited. To eliminate the possibility of an
has been added to the serial communications unexpected write when idle is terminated by
port. reset, the instruction following the one that
DESIGN CONSIDERATIONS invokes idle should not be one that writes to a
AID Operation in Idle Mode At power-on, the voltage on Vcc and RST port pin or to external memory. Table 2 shows
When in the idle mode, the AID converter will must come up at the same time for a proper the state of I/O ports during low current
be disabled. However, the current through the start-up. operating modes.
Vref pins will be present and will not be
reduced internally in either the idle or the
power-down modes. It is the responsibility of
the user to disconnect Vref to reduce power
supply current.
Encryption Table programmed, verification cycles will produce possible to read out (verify) the program
The encryption table is a feature of the only encrypted information. memory.
83C550 and 87C550 that protects the code For the ROM part (83C550) the encryption To program the lock bits for the 87C550,
from being easily read by anyone other than table information is submitted with the ROM repeat the programming sequence using the
the programmer. The encryption table is 32 code as shown in Table 3. ·Pgm Lock Bit" levels specified in Table 4. For
bytes of code that are exclusive NORed with the masked ROM 83C550 the lock bit
the program code data as it is read out. The Lock Bits information is submitted with the ROM code
first byte is XNORed with the first location There are two lock bits on the 83C550 and as shown in Table 3.
read, the second with the second read, etc. 87C550 that, when set, prevent the program
After the encryption table has been data memory from being read out or ROM Code Submission
programmed, the user has to know its programmed further. When submitting a ROM code for the
contents in order to correctly decode the 83C550, the following must be specified:
After the first lock bit is programmer, the
program code data. The encryption table 1. The 4k byte user ROM program.
external MOVC instruction is disabled, and
itself cannot be read out. for the 87C550, further programming of the 2. The 32 byte ROM encryption key.
For the EPROM (87C550) part, the code memory or the encryption table is
3. The ROM lock bits.
encryption table is programmed in the same disabled. The other lock bit can of course still
manner as the program memory, but using be programmed. With only lock bit one 4. The watchdog timer parameters.
the ·Pgm Encryption Table" levels specified in programmed, the memory can still be read
Table 4. After the encryption table is out for program verification. After the second This information can be submitted in an
lock bit is programmed, it is no longer EPROM (2764) or hex file with tile format
specified in Table 3.
DC ELECTRICAL CHARACTERISTICS
Tarrb =-40°C to +85°C, Vee = 5V±10% (87C550), Vee = 5V ±20% (80/83C550), Vss = ov
TEST LIMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
DC ELECTRICAL CHARACTERISTICS
-
Tamb =O°C to +70°C or-40°C to +B5°C, Vcc = 5V+l0% (B7C550) Vee = 5V+20%
- (BO/B3C550) Vss = ov
TEST UMITS
SYMBOL PARAMETER CONDITIONS MIN TYPICAL' MAX UNIT
V IL Input low voltage, except £AI --{).5 0.2V~.1 V
V IL1 I nput low voltage to £AI 0 0.2Vec-O·3 V
V IH Input high voltage, except XTAL 1, RST7 0.2Vcc+0.9 Vee+0.5 V
AC ELECTRICAL CHARACTERISTICS
Tarrb =O'C to +70'C or--40'C to +85'C, Vee =5V +10%
- (87C550) Vcc =5V ±20% (80/83C550) Vss =OV1, 2
16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
ALE
,,'-------
PORTD AD-A7
PORT 2 AB-A15
ALE
tWHLH
1+-----tLlDV -----.!_,
tLLWL --+\o---tRLRH -.,---~
~--------------r---------~
PORTD
ALE
tWHLH -
PORTO
DATA OUT A~7FROMPCL INSTRIH
PORT 2
P2.D-P2.7 OR AS-A15 FROM DPF Ao-A15 FROM PCH
INSTRUCTION
ALE
CLOCK
taVXH
,OUTpUT DATA ------.0------.
WRITE TO SBUF
IHPUTDATA
'-t'
CLEAR AI
SETAl
VCC-O. S
0.7Vcc
0.4SV 0.2VSS-O·l
Vcc-D.S
0.4SV
NOTE:
=x 0.2vcciO·9
._O':.;.2;:.;V..::c:::c-O..;.:.·I;....._ _ __
>C VLOAD
NOTE:
liming
Reference
Points
V~.IV
VOL..o·1V
AC Inputs during testing are driven at Vee -0.5 for a logic '1' and O.45Vlor a logic '0', For timing purposes. a port Is no bngsr floating when a l00mV change from load
TIning measurements are made ar: VIH min for a logic '1' and VIL for a logic '0', voltage occurs, and begins to float when a l00mV change from the loaded VaH'
VOL level occurs. IOH/'oL ,,~mA.
30
25 r----1----_+----~----~MAxAcnVEMODE
ICCmA 20
10
Vcc Vcc
Vcc
Vcc RST
PO
RST
Ell:
Vss Vss
1
Figure 13. Icc Test Condition, Active Mode Figure 14. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
Vcc-O·5 - - - - r-O.7""'V-CC~
O.45V O.2Vcc-O.1 "-----'"
Figure 15. Clock Signal Waveform for Icc Tests in Active and Idle Modes
tCLcH = IcHCL = 5ns
RST
(NC) XTAL2
XTALl
Vss
EPROM CHARACTERISTICS To program the encryption table, repeat the Reading the Signature Bytes
The 87C550 is programmed by using a 25 pulse programming sequence for The signature bytes are read by the same
modified Quick-Pulse Programming'· addresses 0 through lFH, using the 'Pgm procedure as a normal verification of
algorithm. It differs from older methods in the Encryption Table' levels. Do not forget that locations 030H and 031 H, except that Pl.0
value used for Vpp (programming supply after the encryption table is programmed, and Pl.l need to be pulled to a logic low. The
voltage) and in the width and number of the verification cycles will produce only encrypted values are:
ALEII'ROG' pulses. data. (030H) = 15H indicates manufactured by
Philips
The 87C550 contains two signature bytes To program the security bits, repeat the 25
(031 H) = 96H indicates S87C550
that can be read and used by an EPROM pulse programming sequence using the 'Pgm
programming system to identify the device. Security Bit' levels. After one security bit is ProgramNerlfy AlgorHhms
The signature bytes identify the device as an programmed, further programming of the Any algorithm in agreement with the
S87C550 manufactured by Philips. code memory and encryption table is conditions listed in Table 4, and which
disabled. However, the other security bit can satisfies the timing specifications, is suitable.
Table 4 shows the logic levels for reading the still be programmed.
signature byte, and for programming the
program memory, the encryption table, and Note that the F1.Npp pin must not be allowed Erasure Characteristics
to go above the maximum specified Vpp level Erasure of the EPROM begins to occur when
the lock bits. The circuit configuration and
for any amount of time. Even a narrow glitch the chip is exposed to light with wavelengths
waveforms for quick-pulse programming are
above that voltage can cause permanent shorter than approximately 4,000 angstroms.
shown in Figures 17 and 18. Figure 19 shows
damage to the device. The Vpp source Since sunlight and fluorescent lighting have
the circuit configuration for normal program
should be well regulated and free of glitches wavelengths in this range, exposure to these
memory verification.
and overshoot. light sources over an extended time (about 1
Qulck·Pulse Programming week in sunlight, or 3 years in room level
The setup for microcontroller quick-pulse Program Verification fluorescent lighting) could cause inadvertent
programming is shown in Figure 17. Note that If security bit 2 has not been programmed, erasure. For this and secondary effects, it
the 87C550 is running with a 4 to 6MHz the on-chip program memory can be read out Is recommended thai an opaque label be
oscillator. The reason the oscillator needs to for program verification. The address of the placed over the window. For elevated
be running is that the device is executing program memory locations to be read is temperature or environments where solvents
intemal address and program data transfers. applied to ports 2 and 3 as shown in are being used, apply Kapton tape Fluorglas
Figure 19. The other pins are held at the part number 2345--5, or equivalent.
The address of the EP ROM location to be 'Verify Code Data' levels indicated in Table 4.
programmed is applied to ports 2 and 3, as The recommended erasure procedure is
The contents of the address location will be exposure to ultraviolet light (at 2537
shown in Figure 17. The code byte to be emitted on port O. Extemal pull-ups are
programmed into that location is applied to angstroms) to an integrated dose of at least
required on port 0 for this operation. 15W-sec/cm2 . Exposing the EPROM to an
port O. RST, I'SE'N and pins of ports 1 and 2
specified in Table 4 are held at the 'Program If the encryption table has been programmed, ultraviolet lamp of 12,OOOuWfcm2 rating for
Code Data' levels indicated in Table 4. The the data presented at port 0 will be the 20 to 39 minutes, at a distance of about 1
ALElI'ROG'is pulsed low 25 times as shown exclusive NOR of the program byte with one inch, should be sufficient.
in Figure 18. of the encryption bytes. The user will have to Erasure leaves the array in an all 1s state.
know the encryption table contents in order to
correclly decode the verification data. The
encryption table itself cannot be read out.
+5V
AVec
Vcc
M-A7 P3 PO PGMDATA
XTAL2 P2.7
P2.6
~14~---------------------25PU~5 ------------------------~.~I_________
ALEIPIIlllr:
+5V
AVec
Vcc
M-A7 P3 PO PGMData
RST EJINpp
Pl.0 ALEIPIIOG"
P2.6 o
-
Figure 19. Program Verification
PROGRAMMING VERIRCAnON
ADDRESS ADDRESS
'\..
/
--00 I+-- tAVQV
ALEI1'ROG
tDVGL
tAVGL ---
I--
I+--
---I+--->
I+-- IGHDX
IGHAX
~~ lrI .
IGLGH ~ ~ -+ IGHGL
tSHGL .- IGHSL
//
~PP
P2.7
EfOOI[E
tEHSH
'"
---------.-. ----------------------------- --.-------- ------------
LOGIe a
tELQ~
I
LOGiC 1
I
tEHQZ
(fFFfH) 641<
(FFFFH) 64k
External
(2000H) 8.92
A overt.pped
Space
( \
('FFFH) 8.9.
(FFH)2S5
I
Speclol
Internal
(EX=')
External
(Ell" =0)
(7FH) .27 -------
Fmction
Registers
J
1-
(OOOOH)O D... RAM
(OOH) 0 (OOOOH)O
\. / \. / '------y---J
--v- '"V'"
Program Memory Internal Extemal
D... Memory D... Memory
T1merT2 has a programmable division factor of I, 2. 4, interrupt, bits ET2 (IEN1.7, enable overflow
Timer T2 is a IS-bit timer consisting of two or 8 and is cleared if its division factor or interrupt. see Figure 2) and T21SO
registers TMH2 (HIGH byte) and TML2 (LOW input source is changed, or if the (TM2CON.6, byte overflow interrupt select)
byte). The 16-bit timer/counter can be timer/counter is reset. must be set. Bit TWBO (TM2CON.4) is the
switched off or clocked via a prescaler from Timer T2 byte overflow flag.
Timer T2 may be read ·on the fly" but
one of two sources: foSC/12 or an external
possesses no extra read latches, and
signal. When Timer T2 is configured as a To enable the 16-bit overflow interrupt, bits
software precautions may have to be taken to
counter, the prescaler is clocked by an ET2 (lEI .7, enable overflow interrupt) and
avoid misinterpretation in the event of an
external signal on T2 (Pl.4). A rising edge on T21S1 (TM2CON.7, IS-bit overflow interrupt
overflow from least to most significant byte
T2 increments the prescaler, and the select) must be set. Bit T20V (TM21R. 7) is
while Timer T2 is being read. Timer T2 is not
maximum repetition rate is one count per the Timer T2 16-bit overflow flag. All interrupt
loadable and is reset by the RST signal or by
machine cycle (1 MHz with a 12MHz flags must be reset by software. To enable
oscillator). a rising edge on the input signal RT2, if
both byte and 16-bit overflow, T21SO and
enabled. RT2 is enabled by selling bit T2ER
T21S 1 must be set and two interrupt service
(TM2CON.5).
The maximum repetition rate for Timer T2 is routines are required. A test on the overflow
twice the maximum repetition rate for Timer 0 When the least significant byte of the timer flags indicates which routine must be
and Timer 1. T2 (Pl.4) is sampled atS2Pl overflows or when a 16-bit overflow occurs, executed. For each routine, only the
and again at SSPI (i.e., twice per machine an interrupt request may be generated. Either corresponding overflow flag must be cleared.
cycle). A rising edge is detected when T2 is or both of these overflows can be
LOW during one sample and HIGH during the programmed 10 request an interrupt. In both Timer T2 may be reset by a rising edge on
next sample. To ensure that a rising edge is cases, the interrupt vector will be the same. RT2 (P 1.5) if the Timer T2 external reset
detected, the input signal must be LOW for at When the lower byte (TML2) overflows, flag enable bit (T2ER) in T2CON is set. This reset
lea5tl/2 cycle and then HIGH for at least 1/2 T2BO (TM2CON) is set and flag T20V also clears the prescaler. In the idle mode,
cycle. If a rising edge is detected before the (TM2IR) is set when TMH2 overflows. These the timer/counter and prescaler are reset and
end of S2P I, the timer will be incremented flags are set one cycle after an overflow halted. Timer T2 is controlled by the
during the following cycle; otherwise it will be occurs. Note that when T20V is set, T2BO will TM2CON special function register (see
incremented one cycle later. The prescaler also be set. To enable the byte overflow Figure 3).
4 0
IEN1 (EaH E12 ECM21 ECM11 ECMO IECT3 EC121 ECT1 I ECTO
(MSB) (LSB)
TM2CON
(EAH)
12IS1 12150 1'2ER I I 1'280 1'2PI 1'21'0 I I I
T2MSI T2MSO
(MSB) (LSB)
0 0 Clock 8OWC8
0 1 Clock eowcel2
1 0 Clock 8owcel4
1 1 Clock IOlrceJ8
TM2CON.I 1'2MSI}
1'2MSO 11mer 1'2 _ _ ..teet
--
TM2CON.2
1'2MSI 1'2MSO
llmer T2 Extension: When a 12MHz INC TIMEX2 ;increment second The combination of Timer T2 and the capture
oscillator is used, a 16-bit overflow on llmer ;byte and compare logic is very powerful in
T2 occurs every 65.5, 131,262, or 524 ms, MOV A,TIMEX2 applications involving rotating machinery,
depending on the prescaler division ratio; i.e., JNZ INTEX ;jump to INTEX if automotive injection systems, etc. Timer T2
the maximum cycle time is approximately 0.5 ;there is no and the capture and compare logic are shown
seconds. In applications where cycle times ;overflow in Figure 4.
are greater than 0.5 seconds, it is necessary INC TlMEX3 ;increment third
to extend llmer T2. This is achieved by ;byte (high order) Capture logic: The lour 16-bit capture
selecting foSC/12 as the clock source (set registers that Timer T2 is connected to are:
T2MSO, reset T2MS 1), setting the prescaler CTO, CTl, CT2, and CT3. These registers
INTEX: CLR T20V ;reset interrupt
division ration to 1/8 (set T2PO, set T2Pl), are loaded with the contents of llmer T2, and
;flag
disabling the byte overflow interrupt (reset an interrupt is requested upon receipt of the
POP PSW ;restore status
T2ISO) and enabling the 16-bit overflow input signals CTOI, CTlI, CT21, or CT31.
POP ACC ;restore
interrupt (set T2IS1). The following software These input signals are shared with port 1.
accumulator
routine is written for a three-byte extension The four interrupt flags are in the Timer T2
RETI ;return from
which gives a maximum cycle time of interrupt register (TM2IR special function
;interrupt
approximately 2400 hours. register). If the capture facility is not required,
these inputs can be regarded as additional
OVINT: PUSH ACC ;save accumulator llmer T2, Capture and Compare logic: external interrupt inputs.
PUSH PSW ;save status Timer T2 is connected to four 16-bit capture
INC TIMEXl ;increment first registers and three 16-bit compare registers. USing the capture control register CTCON
;byte (low order) A capture register may be used to capture (see Figure 5), these inputs may capture on a
;of extended timer the contents 01 Timer T2 when a transition rising edge, a falling edge, or on either a
MOV A,TIMEXl occurs on its corresponding input pin. A rising or falling edge. The inputs are sampled
JNZ INTEX 3ump to INTEX if compare register may be used to set, reset, during SlPl of each cycle. When a selected
;there is no or toggle port 4 output pins at certain edge is detected, the contents of Timer T2
;overflow pre-programmable time intervals. are captured at the end of the cycle.
off
T2
RT2
T2ER
Enemal reset
t
enable
INT
5 R P4.o
S R P4.1
5 R P4.2
1/0 port 4
S R P4.3
S R P4A
5 :: set T2 SFR addJeaa: TM12 = lower 8 bite
5 R P4.5 TMH2= higher 8 bit.
R =reae1:
TG T P4.6 T = toggle
TG = toggle status
TG T P4.7
STE RTE
Measuring TIme Intervals Using Capture Timer T2. When a match is found, the chip RESET will set the port latch. The
Registers: When a recurring external event corresponding interrupt flag in TM21R is set at contents of these two flip-flops can be read at
is represented in the form of rising or falling the end of the following cycle. When a match STE.6 and STE. 7 (corresponding to P4.6 and
edges on one of the four capture pins. the with CMO occurs, the controller sets bits O-S P4.7, respectively). Bits STE.6 and STE.7
time between two events can be measured of port 4 if the corresponding bits of the set are read only (see Figure 7 for STE register
using Timer T2 and a capture register. When enable register STE are at logic 1. function). A logic 1 indicates that the next
an event occurs. the contents of Timer T2 are toggle will set the port latch; a logic 0
When a match with CMl occurs, the
copied into the relevant capture register and indicates that the next toggle will reset the
controller resets bits O-S of port 4 if the
an interrupt request is generated. The port latch. CMO, GM1, and GM2 are reset by
corresponding bits of the reset/toggle enable
interrupt service routine may then compute the RST signal.
register RTE are at logic 1 (see Figure 6 for
the interval time if it knows the previous
RTE register function). If RTE is "0", then
contents of Timer T2 when the last event The modified port latch information appears
P4.n is not affected by a match between CMl
occurred. With a 12MHz oscillator, Timer T2 at the port pin during SSPI of the cycle
or CM2 and Timer 2. When a match with
can be programmed to overllow every following the cycle in which a match
CM2 occurs, the controller "toggles" bits 6
S24ms. When event interval times are shorter occurred. If the port is modified by software,
and 7 of port 4 if the corresponding bits of the
than this, computing the interval time is the outputs change during SIPl of the
RTE are at logic 1. The port latches of bits 6
simple, and the interrupt service routine is following cycle. Each port 4 bit can be set or
and 7 are not toggled. Two additional
short. For longer interval times, the TImer T2 reset by software at any time. A hardware
extension routine may be used. flip-flops store the last operation, and it is
modification resulting from a comparator
these flip-flops that are toggled.
match takes precedence over a software
Compare Logic: Each time TImer T2 is Thus, if the current operation is "set," the next modification in the same cycle. When the
incremented, the contents of the three 16-bit operation will be "reset" even if the port latch comparator results require a "set" and a
compare registers GMO, GM1, and GM2 are is reset by software before the "reset" "reset" at the same time, the port latch will be
compared with the new counter value of operation occurs. The first "toggle" after a reset.
Timer T21nterrupt Flag RegIster TM2IR: flags are polled, a transition at CTOI or CTll overflow flag (T28O) are set during S6 of the
Eight of the nine Timer T2 interrupt flags are will be recognized one cycle before a cycle in which the overflow occurs. These
located in special function register TM21R transition on CT21 or CT31 since registers are flags are recognized by the interrupt logic
(see Figure 8). The ninth flag is TM2CON.4. read during S5. The CMIO, CMll, and CMI2 during the next cycle.
flags are set during S6 of the cyde following
The CTOI and CTll flags are set during S4 of
a match. CMIO is scanned by the interrupt
the cycle in which the contents of Timer T2 Special function register IPl (Figure 8) is
logic during S2; CMll andCMI2 are scanned
are captured. CTOI is scanned by the used to determine the Timer T2 interrupt
during S3 and S4. A match will be recognized
interrupt logic during S2, and cnl is priority. Setting a bit high gives that function a
by the interrupt logic (or by polling the flags)
scanned during S3. CT21 and CT31 are set high priority, and setting a bit low gives the
two cycles after the match takes place.
during S6 and are scanned during S4 and S5. function a low priority. The functions
The associated interrupt requests are controlled by the various bits of the IPl
recognized during the following cycle. If these The 16-bit overflow flag (T20V) and the byte register are shown in Figure 8.
7 • 0
~~~ I CTN31 CTP31 CTN21 CTP2! CTN.! CTP.! cn~1 CTPO! :~I~!~!~!~I~!~!R~!~!
(MSB) (LSB) (MSB) (LSB)
CTCON.7 CTN3 Cap1ure Regia"" 3 triggered by. falling edge on CT3I RTE.7 TP47 If ","then P4.7 toggles on a match between CM2 and TImerT2
CTCON.6 CTP3 Capture Regia"" 3 triggered by a rialng edge on CT3I RTE.6 TP46 If "," then P4.6 toggle. on • match between CM2 and TimerT2
CTCON.5 CTN2 Cap1ure Register 2 triggered by a 'ailing edge on CT2I RTE.5 RP45 If "1" then P4.S i. reset on • match between CMt and Timer T2
CTCON.4 CTP2 Capture Regls.er 2 triggered by a rialng edge on CT2I RTE.4 RP44 If "1" then P4.4 is reset on a match between CMt and Timer T2
CTCON.3 CTN. Capture Register 1 triggered by. falling edge on eT11 RTE.3 RP43 II "1" then P4.3 ia reset on a match between CMt and Timer T2
CTCON.2 CTP. Cap1ure Regls.er • triggered by • rialng edge on CTtI RTE.2 RP42 If "1" then P4.2 i. reset on • match between CM, and Timer T2
CTCON.. CTJ«) Capture Register 0 triggered by a 'ailing edge on CTlH RTE.1 RP41 If "l"then P4.1 i. reset on a match between CM1 and TimerT2
CTCON.O CTPO Capture Register 0 triggered by a rising edge on CTDI RTE.O RP40 If "," then P4.0 is reset on Q match between CM1 .nd limer T2
Figure 5. Capture Control Register (CTCON) Figure 6. Reset/Toggle Enable Register (RTE)
o
STE (EEH)
(MSB) (LSB)
76543210
TM2IR (C8H) I T20V I CM21 CMl I CYO I CTI31 CTI21 CTII I ClIO I
(MSB) (LSB)
Symbol Function
6543210
IPI (FSH) I PT2 I PCM21 PCMll PCMOI PCT31 PCT21 pcT11 PCTO I
(MSB) (LSB)
Figure 8. Interrupt Flag Register (TM2IR) and Timer T21nterrupt Priority Register (IP1)
11mer T3, The Watchdog 11mer If the 8-bit timer overflows, a short internal programmable between lms and 255ms.
In addition to Timer T2 and the standard reset pulse is generated which will reset the In order to prepare software for watchdog
timers, a watchdog timer is also incorporated 8XC552. A short output reset pulse is also operation, a programmer should first
on the 8XC552. The purpose of a watchdog generated at the AST pin. This short output determine how long his system can sustain
timer is to reset the microcontroller if it enters pulse (3 machine cycles) may be destroyed if an erroneous processor state. The result will
erroneous processor states (possibly caused the AST pin is connected to a capacitor. This be the maximum watchdog interval. As the
by electrical noise or AFI) within a reasonable would not, however, affect the internal reset maximum watchdog interval becomes
period of time. An analogy is the "dead man's operation. shorter, it becomes more difficult for the
handle" in railway locomotives. When programmer to ensure that the user program
enabled, the watchdog circuitry will generate Watchdog operation is activated when
always reloads the watchdog timer within the
a system reset if the user program fails to external pin "EW is tied low. When EW is tied
watchdog interval, and thus it becomes more
reload the watchdog timer within a specified low, it is impossible to disable the watchdog
difficult to implement watchdog operation.
length of time known as the "watchdog operation by software.
interval." The programmer must now partition the
How to Operate the Watchdog Timer: The software in such a way that reloading of the
watchdog timer has to be reloaded within watchdog is carried out in accordance with
Watchdog Circuit Description: The the above requirements. The programmer
periods that are shorter than the programmed
watchdog timer (Timer T3) consists of an must determine the execution times of all
watchdog interval; otherwise the watchdog
8-bit timer with an l1-bit prescaler as shown software modules. The effect of possible
timer will overflow and a system reset will be
in Figure 9. The prescaler is fed with a signal conditional branches, subroutines, external
generated. The user program must therefore
whose frequency is 1112 the oscillator and internal interrupts must all be taken into
continually execute sections of code which
frequency (IMHz with a 12MHz oscillator). account. Since it may be very difficult to
reload the watchdog timer. The period of time
The 8-bit timer is incremented every "t" evaluate the execution times of some
elapsed between execution of these sections
seconds, where:
of code must never exceed the watchdog sections of code, the programmer should use
interval. When using a 16MHz oscillator, the worst case estimations. In any event, the
t = 12 x 2048 x l/fosc watchdog interval is programmable between programmer must make sure that the
(= 1.5ms at fosc = 16MHz; 1.5ms and 392ms. When using a 24MHz watchdog is not activated during normal
=1ms at Iosc =24MHz) oscillator, the watchdog interval is operation.
VDD
OverfloW
fOSCl12--"--"
Preacater (11-biI) Timer T3 (8-bit)
LOAD LOADEN
Internal
reset
WrI"'T3
RRST
~L- ____________ ~
'--------'-
_______________________
~~_
~ ~ L~~EN PCON.l
=
Internal Bus 1
The watchdog timer is reloaded in two stages ;at the program start: SIOO: 5100 is a full duplex serial 1/0 port
in order to prevent erroneous software from identical to that on the 8OC51. Its operation is
T3 EOU OFFH ;address of
reloading the watchdog. First PCON.4 (WLE) the same, inclUding the use of timer 1 as a
;watchdog
must be set. The T3 may be loaded. When baud rate generator.
;timerT3
T3 is loaded, PCON.4 (WLE) is automatically
PCON EOU OB7H ;address of S101, 12C Serial I/O: The 12C bus uses two
reset. T3 cannot be loaded if PCON.4 (WLE)
;PCON SFR wires (SDA and SCL) to transfer information
is reset. Reload code may be put in a
WATCH-INTV EOU 156 ;watchdog between devices connected to the bus. The
subroutine as it is called frequently. Since
;interval main features of the bus are:
Timer T3 is an up-counter, a reload value of
;(e.g., 2xl00ms) - Bidirectional data transfer between masters
OOH gives the maximum watchdog interval
(51 Oms with a 12MHz oscillator), and a and slaves
;to be inserted at each watchdog reload
reload value of OFFH gives the minimum ;Iocation within the user program: - Multimaster bus (no central master)
watchdog interval (2ms with a 12MHz - Arbitration between simultaneously
LCALL WATCHDOG
oscillator). transmitting masters without corruption of
;watchdog service routine: serial data on the bus
In the idle mode, the watchdog circuitry WATCHDOG: ORL PCON,#10H ;set - Serial clock synchronization allows devices
remains active. When watchdog operation is ;condition with different bit rates to communicate via
implemented, the power-down mode cannot one serial bus
;flag
be used since both states are contradictory. (PCON.4) - Serial clock synchronization can be used
Thus, when watchdog operation is enabled MOV T3,WATCH-INV ;loadT3 as a handshake mechanism to suspend
by tying external pin EW low, it is impossible ;with and resume serial transfer
to enter the power-down mode, and an ;watchdog
attempt to set the power-down bit (PCON.l) - The 12C bus may be used for test and
;interval
will have no effect. PCON.l will remain at diagnostic purposes
RET
10gicO.
If it is possible for this subroutine to be called The output latches of Pl.6 and Pl.7 must be
in an erroneous state, then the condition flag set to logic 1 in order to enable 5101.
During the early stages of software
WLE should be set at different parts of the
development/debugging, the watchdog may The BXC552 on-Chip 12C logic provides a
main program.
be disabled by tying the EW pin high. At a serial interface that meets the 12C bus
later stage, EW may be tied low to complete Serial VO specification and supports all transfer modes
the debugging process. The BXC552 is equipped with two (other than the low-speed mode) from and to
independent serial ports: 5100 and 5101. the 12C bus. The 5101 logic handles bytes
Watchdog Software Example: The follOWing 5100 i's a full duplex UART port and is transfer autonomously. It also keeps track of
example shows how watchdog operation identical to the BOC51 serial port. 5101 serial transfers, and a status register (51 STA)
might be handled in a user program. accommodates the 12C bus. reflects the status of 5101 and the 12C bus.
The CPU interlaces to the 12C logic via the conditions are output to indicate the 8101 Implementation and Operation:
following four special function registers: beginning and the end of a serial transfer. Figure 12 shows how the on-chip 12C bus
SlCON (SIOl control register), SlSTA (SIOl interlace is implemented, and the following
2. Master Receiver Mode:
status register), SlOAT (SIOl data register), text describes the individual blocks.
and SlADR (SIOl slave address register). The first byte transmitted contains the
Input Filters and Output Stages
The SIOl logic interlaces to the extemall2C slave address of the transmitting device (7
bus via two port 1 pins: Pl.SISCl (serial bits) and the data direction bit. In this case The input filters have 12C compatible input
clock line) and Pl.7ISDA (serial data line). the data direction bit (RIW) will be logic 1, levels. It the input voltage is less than 1.5V,
A typical1 2C bus configuration is shown in and we say that an "R" is transmitted. the input logic level is interpreted as 0; if the
Figure 10, and Figure 11 shows how a data Thus the first byte transmitted is SLA+R. input voltage is greater than 3.0V, the input
transfer is accomplished on the bus. Serial data is received via Pl.7ISDA while logic level is interpreted as 1. Input signals
Depending on the state of the direction bit Pl.SlSCl outputs the serial clock. Serial are synchronized with the internal clock
(RIW), two types of data transfers are data is received 8 bits at a time. After (foSC/4), and spikes shorter than three
possible on the 12C bus: each byte is received, an acknowledge bit oscillator periods are filtered out.
1. Data transfer from a master transmitter to is transmitted. START and STOP
conditions are output to indicate the The output stages consist of open drain
a slave receiver. The first byte transmitted transistors that can sink 3mA at VOUT < O.4V.
by the master is the slave address. Next beginning and end of a serial transfer.
These open drain outputs do not have
follows a number of data bytes. The slave 3. Slave Receiver Mode: clamping diodes to Voo. Thus, if the device is
returns an acknowledge bit after each connected to the 12C bus and Voo is switched
received byte. Serial data and the serial clock are
off, the 12C bus is not affected.
received through P1.7/SDA and
2. Data transfer from a slave transmitter to a Pl.SlSCl. After each byte is received, an Address Register, SlADR
master receiver. The first byte (the slave acknowledge bit is transmitted. START
address) is transmitted by the master. The and STOP conditions are recognized as This 8-bil special function register may be
slave then returns an acknowledge bit. the beginning and end of a serial transfer. loaded with the 7-bil slave address (7 most
Next follows the data bytes transmitted by Address recognition is performed by significant bits) to which SIOI will respond
the slave to the master. The master hardware after reception of the slave when programmed as a slave transmitter or
returns an acknowledge bit after all address and direction bit. receiver. The lSB (GC) is used to enable
received bytes other than the last byte. At general call address (OOH) recognition.
the end of the last received byte, a "not 4. Slave Transmitter Mode:
acknowledge" is returned. Comparator
The first byte is received and handled as
in the slave receiver mode. However, in The comparator compares the received 7-bit
The master device generates all of the serial slave address with its own slave address (7
this mode, the direction bit will indicate
clock pulses and the START and STOP most significant bits in SlADR). It also
that the transfer direction is reversed.
conditions. A transfer is ended with a STOP compares the first received 8-bit byte with the
Serial data is transmitted via P1.7/SDA
condition or with a repeated START general call address (OOH). If an equality is
while the serial clock is input through
condition. Since a repeated START condition found, the appropriate status b~s are set and
Pl.S/SCl. START and STOP conditions
is also the beginning of the next serial an interrupt is requested.
are recognized as the beginning and end
transfer, the 12C bus will not be released.
of a serial transfer.
Shift Register, S1DAT
Modes of Operation: The on-chip SIOl logic
may operate in the following four modes: In a given application, SIOI may operate as a This 8-bit special function register contains a
master and as a slave. In the slave mode, the byte of serial data to be transmitted or a byte
1. Master Transmitter Mode:
SIOI hardware looks for its own slave which has just been received. Data in SlOAT
Serial data output through Pl.7ISDA While address and the general call address. It one is always shifted from right to left; the first bit
Pl.S/SCl outputs the serial clock. The of these addresses is detected, an interrupt is to be transmitted is the MSB (bit 7) and, after
first byte transmitted contains the slave requested. When the microcontroller wishes a byte has been received, the first bit of
address of the receiving device (7 bits) to become the bus master, the hardware received data is located at the MSB of
and the data direction bit. In this case the waits until the bus is free before the master SlOAT. While data is being shifted out, data
data direction bit (RIW) will be logic 0, and mode is entered so that a possible slave on the bus is simultaneously being shifted in;
we say that a "W" is transmitted. Thus the action is not interrupted. It bus arbitration is SlOAT always contains the last byte present
first byte transmitted is SLA+W. Serial lost in the master mode, SIOI switches to the on the bus. Thus, in the event of lost
data is transmitted 8 bits at a time. After slave mode immediately and can detect its arbitration, the transition from master
each byte is transmitted, an acknowledge own slave address in the same serial transmitter to slave receiver is made with the
bit is received. START and STOP transfer. correct data in SlOAT.
VOO
[] Rp !) Rp
SOA
12c ..... {
SCL
P1.71S0A P1.6ISCL
Stop
Concition
Repeated
Start
Condtion
Acknowledgment
Signal from Receiver Clock Une Held Low While
1n1errupta Are Serviced
SIAOR
,. - .... P1.7
Input
Rher
P1.7/S0A
SlOAT
0u1pUl
Stage
Input
Riter
foscJ4
Pl.7lSCl
0u1pUl InlemJPI
Stage
TImer 1
Overflow
I
L - ., P1.6
Status {
Bits
*(')
SDA 1 ____. .
seL
... JaLJ-L ACK
,. An_devl............. IdenIIC8Iseri.ldalL
2.. An_ device O"",",1ee o logic , (dotted line) transmitted by 510' (maaler) by pulling !hi! SDA line low. Arbitration laloo\ and 510' enten !hi! slave
rec:ei_roode. .
3. 6101 Ia In the ..ave receiver mode but edll generates clock pulses until the cwrent byte hu been transmitted. Sl01 will not generate dock pulses for
the next byte. Data on SDA ariglutee from the new maater once it has won arbitration.
seL
~
(2) _
I- Duntion
llark SpoceDwotion
,. An_ aarvice pulia the seL line low bela... the 510' ·'mark" .u.tion ia complete. The seri.1 cI_ gener.tor ia immedi.tely reset and
c o m _ with the ··apace·· duntlon by pulling seL low.
2.. :'=vlce otill pulla the seL line low after SlO, releooea SCL The aerI.1 cI_ gener.tor Ia forced intolhe wait otate until the SCL line
3. Tho seL line Ia _ . and !he seri.1 .. _ generator conmencea with !he mark duration.
Arbitration and Synchronization Logic generates and detects start and stop condition. A logic 1 in SIAOR corresponds to
conditions, receives and transmits a high level on the 12C bus, and a logic 0
In the master transmitter mode, the acknowledge bits, controls the master and corresponds to a low level on the bus.
mbitration logic checks that every transmitted slave modes, contains interrupt request logic,
logic 1 actually appears as a logic 1 on the and monitors the 1i!C bus status. The Data Register, SlOAT: SlOAT contains
1i!C bus. If another device on the bus a byte of serial data to be transmitted or a
overrules a logic 1 and pulls the SOA line low, Control Register, SICON byte which has just been received. The CPU
mbitration is lost, and SIOI immediately can read from and write to this a-bit, cfirecdy
changes from master transmitter to slave This 7-bit special function register is used by addressable SFR while it is not in the process
receiver. SIOI will continue to output clock the microcontroller to control the following of shifting a byte. This occurs when SIOI is in
pulses (on SCl) until transmission of the SIOI functions: start and restart of a serial a defined state and the serial interrupt flag is
current serial byte is complete. transfer, termination of a serial transfer, bit set Data in SlOAT remains stable as long as
rate, address recognition, and SI is set. Data in SlOAT is always shifted
Arbitration may also be lost in the master acknowledgment from right to left: the first bit to be transmitted
receiver mode. loss of mbitration in this is the MSB (bil7), and, after a byte has been
mode can only occur while SIOI is retuming Status Decoder and Status Register
received, the first bit of received data is
a "not acknowledge: (logic 1) to the bus. located at the MSB of SlOAT. While data is
Arbitration is lost when another device on the The status decoder takes all of the intemal
status bits and compresses them into a 5-bit being shifted out, data on the bus is
bus pulls this signal lOW. Since this can simultaneously being shifted in; SlOAT
occur only at the end of a serial byte, SIOI code. This code is unique for each 12C bus
status. The 5-bit code may be used to always contains the last data byte present on
generates no further clock pulses. Figure 13 the bus. Thus, in the event of lost mbitration,
shows the mbitration procedure. generate vector addresses for fast
processing of the various service routines. the transition from master transmitter to slave
Each service routine processes, a particular receiver is made with the correct data in
The synchronization logic will synchronize the
bus status. There are 26 possible bus states SlOAT.
serial crOck generator with the clock pulses
on the SCl line from another device. If two or if all four modes of SIOI are used. The 5-bit
status code is latched into the five most 7 6 5 4'3 21 0
more master devices generate clock pulses,
the "mark" duration is determined by the significant bits of the status register when the SIDAT (DAHl ISD7lsii6I sll5I SD4ISD31 SiI2ISD11SDOJ
device that generates the shortest "marks,' serial interrupt flag is set (by hardware) and
and the "space" duration is determined by the remains stable until the interrupt flag is
device that generates the longest "spaces." cleared by software. The three least
Figure 14 shows the synchronization significant bits of the status register are
S07-S00:
procedure. always zero. If the status code is used as a
vector to service routines, then the routines Eight bits to be transmitted Dr just received. A
A slave may stretch the space duration to are displaced by eight address locations. logic 1 in SlOAT corresponds to a high level
slow down the bus master. The space Eight bytes of code is sufficient for most of on the 1i!C bus, and a logic 0 corresponds to
duration may also be stretched for the service routines (see the software a low level Dn the bus. Serial data shifts
handshaking purposes. This can be done example in this section). through SlOAT from right to left. Figure 15
after each bit or after a complete byte
shows how data in SlOAT is serially
transfer. SIOI will stretch the SCl space The Four SIOI Special Function
transferred to and from the 50A line.
duration after a byte has been transmitted or Registers: The microcontroller interfaces to
received and the acknowledge bit has been SIOI via four special function registers. SlOAT and the ACK flag form a 9-bit shift
transferred. The serial interrupt flag (SI) is These four SFRs (SIAOR, SlOAT, SICON, register which shifts in or shifts out an a-bit
set, and the stretching continues until the and SISTA) are described individually in the byte, followed by an acknowledge bit. The
serial interrupt flag is cleared. following sections. ACK flag.is controlled by the SIOI hardware
and cannot be accessed by the CPU. Serial
Serial Clock Generator The Address Register, SIADR: The CPU
can read from and write to this 8-bit, directly data is shifted through the ACK flag into
This programmable clock pulse generator addressable SFR. S 1AOR is not affected by SlOAT on the rising edges of serial clock
provides the SCl clock pulses when SIOI is the SIOI hardware. The contents of this pulses on the 5Cl line. When 'a byte has
in the master transmitter or master receiver register are irrelevant when SIOI is in a been shifted into SlOAT, the serial data is
mode. It is switched off when SIOI is in a master mode. In the slave modes, the seven available in SlOAT, and the acknowledge bit
slave mode. The programmable output clock most significant bits must be loaded with the is retumed by the control logic during the
frequencies are: foscl120, foscl9600, and the microcontroller's own slave address, and, if ninth clock pulse. Serial data is shifted out
Timer 1 overflow rate divided by eight The the least significant bit is set, the general call from SlOAT via a buffer (BS07) on the falling
output clock pulses have a 50% duty cycle address (OOH) is recognized; otherwise it is edges of clock pulses on the SCl line.
unless the clock generator is synchronized ignored.
When the CPU writes to SlOAT, BS07is
with other SCl clock sources as described
above. loaded with the content of 51 OAT.7, which is
78543210
SDA
SCL
The Control Register, 51 CON: The CPU START condition. STA may be set at any SI = "0": When the SI flag is reset, no serial
can read from and write to this S-bit, directly time. STA may also be set when SID 1 is an interrupt is requested, and there is no
addressable SFR. Two bits are affected by addressed slave. stretching of the serial clock on the SCl line.
the SIOI hardware: the SI bit is set when a
serial interrupt is requested, and the STO bit STA = "0": When the STA bit is reset, no AA, the Assert Acknowledge Flag
is deared when a STOP condition is present START condition or repeated START AA = "I": lithe AA flag is set, an
on the 12C bus. The STO bit is also cleared condition will be generated. acknowledge (low level to SOA) will be
when ENSI = "0". STO, the STOP Flag returned during the acknowledge dock pulse
on the SCl line when:
7654320 STO = "I": When the STO bit is set while - The "own slave address" has been
SICON (1l8H)ICR21 ENSII STAI STol SliM ICRI leRO I SIOI is in a master mode, a STOP condition received
is transmitted to the 12C bus. When the STOP
- The general call address has been
ENS1, the SID 1 Enable Bit condition is detected on the bus, the SIOI
received while the general call bit (GC) in
hardware clears the STO flag. In a slave
ENSI ="0": When ENSI is "0", the SOA and SIAOR is set
mode, the STO flag may be set to recover
SCl outputs are in a high impedance state. - A data byte has been received while SIOI
from an error condition. In this case, no
SOA and SCl input signals are ignored, SIOI is in the master receiver mode
STOP condition is transmitted to the 12C bus.
is in the "not addressed" slave state, and the - A data byte has been received while SID 1
However, the SIOI hardware behaves as if a
STO bit in SICON is forced to "0". No other is in the addressed slave receiver mode
STOP condition has been received and
bits are affected. Pl.6 and Pl.7 may be used
switches to the defined "not addressed" slave
as open drain 110 ports. AA = "0": if the AA flag is reset, a not
receiver mode. The STO flag is automatically
acknowledge (high level to SOA) will be
ENSI = "I": When ENSI is "1", SIOI is cleared by hardware.
returned during the acknowledge dock pulse
enabled. The Pl.6 and Pl.7 port latches
If the STA and STO bits are both set, the a on SClwhen:
must be set to logic 1.
STOP condition is transmitted to the 12C bus - A data has been received while SID 1 is in
ENSI should not be used to temporarily if SIOI is in a master mode (in a slave mode, the master receiver mode
release SIOI from the 12C bus since, when SIOI generates an internal STOP condition - A data byte has been received while SIOI
ENS 1 is reset, the 12C bus status is lost The which is not transmitted). SIOI then transmits is in the addressed slave receiver mode
AA flag should be used instead (see a START condition.
description of the AA flag in the following When WID 1 is in the addressed slave
STO = "0": When the STO bit is reset, no transmitter mode, state CSH will be entered
text).
STOP condition will be generated. after the last serial is transmitted (see Figure
In the following text, it is assumed that 20). When SI is cleared, SIOI leaves state
SI, the Serial Interrupt Flag
ENSI = "I". CSH, enters the not addressed slave receiver
SI = "I": When the SI flag is set, then, if the mode, and the SOA line remains at a high
STA, the START Flag
EA and ESI (interrupt enable register) bits level. In state CSH, the AA flag can be set
STA = "I": When the STA bit is set to enter a are also set, a serial interrupt is requested. SI again for future address recognition.
master mode, the SIOI hardware checks the is set by hardware when one of 25 of the 26
status of the 12C bus and generates a START possible SIOI states is entered. The only When SID 1 is in the not addressed slave
condition if the bus is free. If the bus is not state that does not cause SI to be set is state mode, its own slave address and the general
free, then SIOI waits for a STOP condition FSH, which indicates that no relevant state call address are ignored. Consequently, no
(which will free the bus) and generates a information is available. acknowledge is returned, and a serial
START condition after a delay of a half dock interrupt is not requested. Thus, SID 1 can be
While SI is set, the low period of the serial temporarily released from the 12C bus while
period of the internal serial dock generator.
clock on the SCl line is stretched, and the the bus status is monitored. While SID 1 is
If STA is set while SID 1 is already in a master serial transfer is suspended. A high level on released from the bus, START and STOP
mode and one or more bytes are transmitted the Sel line is unaffected by the serial conditions are detected, and serial data is
or received, SID 1 transmits a repeated interrupt flag. SI must be reset by software. shifted in. Address recognition can be
resumed at any time by setting the AA flag. If More Information on 5101 Operating mode can be entered, SI CON must be
the AA flag is set when the part's own slave Modes: The four operating modes are: initialized as follows:
address or the general call address has been - Master Transmitter
4 3 2 o
partly received, the address will be - Master Receiver
recognized at the end of the byte
- Slave Receiver
transmission.
- Slave Transmitter
CRO, CR1, and CR2, the Clock Rate Bits CRO, CR1, and CR2 define the serial bit rate.
Data transfers in each mode of operation are ENS! must be set to logic 1 to enable SIOI.
These three bits determine the serial clock shown in Figures 17-37. These figures If the M bit is reset, SIOI will not
frequency when SIOI is in a master mode. contain the following abbreviations: acknowledge its own slave address or the
The various serial rates are shown in Table 2. general call address in the event of another
Abbreviation Explanation device becoming master of the bus. In other
A 12.5kHz bit rate may be used by devices S Start condition words, if M is reset, Sioo cannot enter a
that interface to the 12C bus via standard 1/0 SLA 7-bit slave address
slave mode. STA, STO, and SI must be reset.
port lines which are software driven and slow. R Read bit (high level at SDA)
100kHz is usually the maximum bit rate and W Write bit (low level at SDA) The master transmitter mode may now be
can be derived from a 16MHz, 12MHz, or a A Acknowledge bit (low level at entered by setting the STA bit using the
6MHz oscillator. A variable bit rate (O.5kHz to SDA) SETB instruction. The SIOI logic will now
62.5kHz) may also be used if Timer 1 is not Not acknowledge bit (high test the 12C bus and generate a start
level at SDA)
required for any other purpose while SIOI is condition as soon as the bus becomes free.
Data 8-bit data byte
in a master mode. p When a START condition is transmitted, the
Stop condition
serial interrupt flag (SI) is set, and the status
The frequencies shown in Table 2 are In Figures 17-37, circles are used to indicate code in the status register (SISTA) will be
unimportant when SIOI is in a slave mode. In when the serial interrupt flag is set. The 08H. This status code must be used to vector
the slave modes, SIOI will automatically numbers in the circles show the status code to an interrupt service routine that loads
synchronize with any clock frequency up to held in the SISTA register. At these points, a SI DAT with the slave address and the data
100kHz. service routine must be executed to continue direction bit (SLA+W). The SI bit in SICON
or complete the. serial transfer. These service must then be reset before the serial transfer
The Status Register, SISTA: SISTA is an
routines are not critical since the serial can continue.
8-bit read-only special function register. The
transfer is suspended until the serial interrupt
three least significant bits are always zero. When the slave address and the direction bit
flag is cleared by software.
The five most significant bits contain the have been transmitted and an
status code. There are 26 possible status When a serial interrupt routine is entered, the acknOWledgment bit has been received, the
codes. When SI STA contains F8H, no status code in SISTA is used to branch to the serial interrupt flag (SI) is set again, and a
relevant state information is available and no appropriate service routine. For each status number of status codes in S 1STA are
serial interrupt is requested. All other S 1STA code, the required software action and details possible. There are 18H, 2OH, or 38H for the
values correspond to defined SIOI states. of the following serial transfer are given in master mode and also 68H, 78H, or BOH if
When each of these states is entered, a Tables 15-18. the slave mode was enabled (M = logic 1).
serial interrupt is requested (SI = "I "). A valid The appropriate action to be taken for each of
status code is present in SI STA one machine Master Transmitter Mode: In the master these status codes is detailed in Table 3.
cycle after SI is set by hardware and is still transmitter mode, a number of data bytes are After a repeated start condition (state 10H).
present one machine cycle after SI has been transmitted to a slave receiver (see SIOI may switch to the master receiver mode
reset by software. Figure 17). Before the master transmitter by loading SI DATwith SLA+R).
SOA 07 D6 D5 D4 D3 D2 01 DO A
SCL
ShiftACK& SlOAT
Shift!"
I
SlOAT
ShiftBS07
I (1) (2) (2) (2) (2) (2) (2) (2) (2) (1)
Shift OUt
BS07
, 07 D6 05 D4 03 02 01 DO (3)
MT
Successful Trll18f11isalon
to • Slave Receiver
To MSTIREC Mode
Not Acknowledge Received Enlly= MR
ofter 0 00111 Byle
To Ccmeaponding
States In Slave Mode
MR
To MSTITRX Mode
Entry=MT
To ConesponcRng
States In Slave Mode
Reception of the Own Slave """ I""" ""~," I ""," '\" '~"'I'\' II"", "~" "~'" ""," II,. " '\ ...., I"" ~ 11,.... '\ \, ',~,.
Addreu and One or More Data
Byteo. AI, Are Acknowledged.
'",~,""'I~"'~I"" 1~"~II,'"",~,,",,~I"'II,'I,.,,~IIIW."" I",.
I~~':""'I~"I,"':'I I",""'I':~"~I,""",>~,,:",,~,:'I"">""""'~::'"1
A I",' :,':, :'" ,' :, ": '" ,' :, :, :', ,~ ": ",' ,' : ', ,' _,' : ', ', ',:', : ', ~',; : ', ',
o
F::::::::::::::::::::::::::::::::::I From Maater to Sla..
r'...::""o.~~
'...., ""," I"" '~
Any Number of Do.. Byte. and Their
Aaeociated Acknowtedge Bits
~
~
From Master to Slave
Last Data Byte Transmitted.
--------~
'\,,' ....,','\",""','
Switched to Not Addressed AU '"1"'. '.... ,i>,~,$ . ,.
Mastet Receivet Mode: In the master Slave Receiver Mode: In the slave receiver When SIADR and SICON have been
receiver mode, a number of data bytes are mode, a number of data bytes are received initialized, SIOI waits until it is addressed by
received from a slave transmitter (see from a master transmitter (see Figure 19). To its own slave address followed by the data
Figure IS). The transfer is initialized as in the initiate the slave receiver mode, SIADR and direction bit which must be "0" (W) for SIOI
master transmitter mode. When the start SI CON must be loaded as follows: to operate in the slave receiver mode. After
condition has been transmitted, the interrupt its own slave address and the W bit have
service routine must load SI DATwith the 7 6 5 4 3 been received, the serial interrupt flag (I) is
7-bit slave address and the data direction bit
(SLA+R). The SI bit in SICON mustthen be
SlADRIDBHl1 xl xl xI xI xl x!j Gel set and a valid status code can be read from
SI STA. This status code is used to vector to
- - own slave address
cleared before the serit\1 transfer can an interrupt service routine, and the
continue. appropriate action to be taken for each of
The upper 7 bits are the address to which
When the slave address and the data these status codes is detailed in Table 5. The
SIOI will respond when addressed by a
direction bit have been transmitted and an slave receiver mode may also be entered if
master. If the LSB (GC) is set, SIOI will
acknowledgment bit has been received, the arbitration is lost while SIOI is in the master
respond to the general call address (OOH);
serial interrupt flag (SI) is set again, and a mode (see status 6SH and 78H).
otherwise it ignores the general call address.
number of status codes in SISTA are If the AA bit is reset during a transfer, SIOI
possible. These are 40H, 46H, or 38H for the 7 6 5 3 2 will return a not acknowledge (logic 1) to SDA
master mode and also 6SH, 78H, or SOH if after the next received data byte. While AA is
the slave mode was enabled (AA = logic 1). reset, SIOI does not respond to its own slave
The appropriate action to be taken for each of x o 0 1 X X
address or a general call address. However,
these status codes is detailed in Table 4. the 12C bus is still monitored and address
ENS1, CR1, and CRO are not affected by the CRO, CR1, and CR12 do not affect SID 1 in recognition may be resumed at any time by
serial transfer and are not referred to in the slave mode. ENSI must be set to logic 1 setting AA. This means that the AA bit may
Table 4. After a repeated start condition (state to enable SIOI. The AA bit must be set to be used to temporarily isolate SIOI from the
10H), SIOI may switch to the master enable SIOI to acknowledge its own slave 12C bus.
transmitter mode by loading SI DAT with address or the general call address. STA,
SLA+w. STO, and SI must be reset.
1BH SLA+W has been Load data byte or 0 0 0 X Data byte will be transmitted;
transmitted; ACK has ACK bit will be received
been received no SlOAT action or 1 0 0 X Repeated START will be transmitted;
no SlOAT aciion or 0 1 0 X STOP condition will be transmitted;
STO flag will be reset
no SlOAT action 1 1 0 X STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
20H SLA+W has been Load data byte or 0 0 0 X Data byte will be transmitted;
transmitted; NOT ACK ACK bit will be received
has been received no SlOAT action or 1 0 0 X Repeated START will be transmitted;
no SlDATaction or 0 1 0 X STOP condition will be transmitted;
STO flag will be reset
no SlOAT action 1 1 0 X STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
2BH Data byte in SlOAT has Load data byte or 0 0 0 X Data byte will be transmitted;
been transmitted; ACK ACK bit will be received
has been received no SlOAT action or 1 0 0 X Repeated START will be transmitted;
no Sl DAT action or 0 1 0 X STOP condition will be transmitted;
STO flag will be reset
no Sl DAT action 1 1 0 X STOP condition followed by a
START condition willbe transmitted;
STO flag will be reset
30H Data byte in Sl DAT has Load data byte or 0 0 0 X Data byte will be transmitted;
been transmitted; NOT ACK bit will be received
ACK has been received no SlOAT action or 1 0 0 X Repeated START will be transmitted;
no SlDATaction or 0 1 0 X STOP condition will be transmitted;
STO flag will be reset
no Sl DAT action 1 1 0 X STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
40H SLA+R has been No SI DAT action or 0 0 0 0 Data byte will be received;
transmitted; ACK has NOT ACK bit will be retumed
been received no SWAT action 0 0 0 1 Data byte will be received;
ACK bit will be returned
4SH SLA+R has been No SI DAT action or 1 0 0 X Repeated START condition will be transmitted
transmitted; NOT ACK
has been received no SWAT action or 0 1 0 X STOP condition will be transmitted;
STO flag will be reset
no SWAT action 1 1 0 X STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
50H Data byte has been Read data byte or 0 0 0 0 Data byte will be received;
received; ACK has been NOT ACK bit will be returned
returned read data byte 0 0 0 1 Data byte will be received;
ACK bit will be returned
5SH Data byte has been Read data byte or 1 0 0 X Repeated START condition will be transmitted
received; NOT ACK has
been returned read data byte or 0 1 0 X STOP condition will be transmitted;
STO flag will be reset
read data byte 1 1 0 X STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
Slave Transmitter Mode: In the slave STO flag (no other bits in SICON are condition was received and is able to transmit
transmitter mode, a number of data bytes are affected). The SDA and SCl lines are a START condition. The STO flag is cleared
transmitted to a master receiver (see released (a STOP condition is not by hardware (see Figure 22).
Figure 20). Data transfer is initialized as in transmitted).
the slave receiver mode. When SIADR and 12C Bus Obstructed by a low level on SCl
SI CON have been initialized, SIOI waits Some Special Cases: The SIOI hardware orSDA
until it is addressed by its own slave address has facilities to handle the following special
followed by the data direction bit which must cases that may occur during a serial transfer:
An 12C bus hang-up occurs if SDA or SCl is
be "I" (R) for SIOI to operate in the slave pulled lOW by an uncontrolled source. If the
transmitter mode. After its own slave address Simultaneous Repeated START Conditions
SCl line is obstructed (pulled lOW) by a
and the R bit have been received, the serial from Two Masters
device on the bus, no further serial transfer is
interrupt flag (SI) is set and a valid status
possible, and the SIOI hardware cannot
code can be read from SI STA. This smtus A repeated START condition may be
resolve this type of problem. When this
code is used to vector to an interrupt service generated in the master transmitter or master
occurs, the problem must be resolved by the
routine, and the appropriate action to be receiver modes. A special case occurs if
device that is pulling the SCl bus line lOW.
taken for each of these status codes is another master simultaneously generates a
detailed in Table 6. The slave transmitter repeated START condition (see Figure 21).
Until this occurs, arbitration is not lost by If the SDA line is obstructed by another
mode may also be entered if arbitration is lost
either master since they were both device on the bus (e.g., a slave device out of
while SIOI is in the master mode (see state
SOH). transmitting the same data. bit synchronization), the problem can be
solved by transmitting additional clock pulses
If the SIOI hardware detects a repeated on the SCl line (see Figure 23). The SIOI
If the AA bit is reset during a transfer, SIOI
START condition on the 12C bus before hardware transmits additional clock pulses
will transmit the last byte of the transfer and
generating a repeated START condition itself, when the STA flag is set, but no START
enter state COH or C8H. SIOI is switched to
it will release the bus, and no interrupt condition can be generated because the SDA
the not addressed slave mode and will ignore
request is generated. If another master frees line is pulled lOW while the 12C bus is
the master receiver if it continues the transfer.
the bus by generating a STOP condition, considered free. The SIOI hardware
Thus the master receiver receives all 1s as
SIOI will transmit a normal START condition attempts to generate a START condition after
serial data. While AA is reset, SIOI does not
(state 08H), and a retry of the total serial data every two additional clock pulses on the SCl
respond to its own slave address or a general
transfer can commence. line. When the SDA line is eventUally
call address. However, the 12C bus is still
released, a normal START condition is
monitored, and address recognition may be
Data Transfer After loss of Arbitration transmitted, state 08H is entered, and the
resumed at any time by setting AA. This
means that the AA bit may be used to serial transfer continues.
Arbitration may be lost in the master
temporarily isolate SIOI from the 12C bus.
transmitter and master receiver modes (see If a forced bus access occurs or a repeated
Figure 13). loss of arbitration is indicated by START condition is transmitted while SDA is
Miscellaneous States: There are two
the following states in SI STA; 3SH, 68H, obstructed (pulled lOW), the SIOI hardware
SISTA codes that do not correspond to a
7SH, and SOH (see Figures 17 and IS). performs the same action as described
defined SIOI hardware state (see Table 7).
These are discussed below. above. In each case, state OSH is entered
If the STA flag in SI CON is set by the after a successful START condition is
routines which service these states, then, if transmitted and normal serial transfer
SISTA = F8H:
the bus is free again, a START condition continues. Note that the CPU is not involved
(state 08H) is transmitted without intervention in solving these bus hang-up problems.
This status code indicates that no relevant by the CPU, and a retry of the total serial
information is available because the serial transfer can commence.
interrupt flag, SI, is not yet set. This occurs Bus Error
between other states and when SIOI is not Forced Access to the 12C Bus
involved in a serial transfer. A bus error occurs when a START or STOP
In some applications, it may be possible for condition is present at an illegal position in
SISTA=OOH: an uncontrolled source to cause a bus the format frame. Examples of illegal
hang-up. In such situations, the problem may positions are during the serial transfer of an
This status code indicates that a bus error be caused by interference, temporary address byte, a data or an acknowledge bit.
has occurred during an SIOI serial transfer. interruption of the bus or a temporary
A bus error is caused when a START or short-circuit between SDA and SCL. The SIOI hardware only reacts to a bus error
STOP condition occurs at an illegal position when it is involved in a serial transfer either
in the format frame. Examples of such illegal If an uncontrolled source generates a as a master or an addressed slave. When a
positions are during the serial transfer of an superfluous START or masks a STOP bus error is detected, SIOI immediately
address byte, a data byte, or an acknowledge condition, then the 12C bus stays busy switches to the not addressed slave mode,
bit. A bus error may also be caused when indefinitely. If the STA flag is set and bus releases the SDA and SCl lines, sets the
external interference disturbs the internal access is not obtained within a reasonable interrupt flag, and loads the status register
SIOI signals. When a bus error occurs, SI is amount of time, then a forced access to the with OOH. This status code may be used to
set. To recover from a bus error, the STO flag 12C bus is possible. This is achieved by vector to a service routine which either
must be set and SI must be cleared. This setting the STO flag while the STA flag is still attempts the aborted serial transfer again or
causes SIOI to enter the "not addressed" set. No STOP condition is transmitted. The simply recovers from the error condition as
slave mode (a defined state) and to clear the SIOI hardware behaves as if a STOP shown in Table 7.
OOH Bus error during MST or No SWAT action 0 1 0 X Only the internal hardware is affected in the
selected slave modes, MST or addressed SLY modes. In all cases,
due to an illegal START the bus is released and SI01 is switched to the
or STOP condition. Slate not addressed SLY mode. STO is reset.
OOH can also occur
when interference
causes SI01 to enter an
undefined slate.
SLA W'
.
r---r-------~--~--------~--_r--_r----------~--r_~----
A. Data Other MST Continues SLA
~~----~--~~~------~~~~----------~~~-L---
~ n~UnWt ==J
STAfI_g ~------I---I-·~----
SClline
STAflag .-J
\1--(2)---110...-(3)_ _
SDA line ! (1)
SClllne
Figure 23. Recovering from a Bus Obstruction Caused by a Low Level on SOA
Software Examples of 5101 Service RAM are allocated to the 510 to act as either - The slave mode is enabled by
Routines: This section consists of a software a transmission or reception buffer. In this simultaneously setting the ENSl and M
example for: example, 8 bytes of internal data RAM are bits in 51 CON and the serial clock
- Initialization of 5101 after a RESET reserved for different purposes. The data frequency (for master modes) is defined by
- Entering the 5101 interrupt routine memory map is shown in Figure 24. The loading CRO and CRl in SlCON. The
- The 26 state service routines for the initialization routine performs the following master routines must be started in the main
functions: program.
- Master transmitter mode
- SlADR is loaded with the part's own slave
- Master receiver mode address and the general call bit (GC)
The 5101 hardware now begins checking the
- Slave receiver mode - Pl.S and Pl.? bit latches are loaded with 12C bus for its own slave address and general
- Slave transmitter mode logic ls
call. If the general call or the own slave
- RAM location HADD is loaded with the address is detected, an interrupt is requested
Initialization
high-order address byte of the service and 51 STA is loaded with the appropriate
In the initialization routine, 5101 is enabled routines state information. The following text
for both master and slave modes. For each - The 5101 interrupt enable and interrupt describes a fast method of branching to the
mode, a number of bytes of internal data priority bits are set appropriate service routine.
5101 Interrupt Routine Master Transmitter and Master Receiver bus is released and 5101 enters the not
Modes selected slave receiver mode.
When the 5101 interrupt is entered, the PSW
is first pushed on the stack. Then SlSTA and The master mode is entered in the main In the slave receiver mode, a maximum of 8
HADD (loaded with the high-order address program. To enter the master transmitter received data bytes can be stored in the
byte of the 26 service routines by the mode, the main program must first load the internal data RAM. A maximum of 8 bytes
initialization routine) are pushed on to the internal data RAM with the slave address, ensures that other RAM locations are not
stack. SlSTA contains a status code which is data bytes, and the number of data bytes to overwritten if a master sends more bytes. If
the lower byte of one of the 26 service be transmitted. To enter the master receiver more than 8 bytes are transmitted, a not
routines. The next instruction is RET, which is mode, the main program must first load the acknowledge is returned, and 5101 enters
the return from subroutine instruction. When internal data RAM with the slave address and the not addressed slave receiver mode. A
this instruction is executed, the high and low the number of data bytes to be received. The maximum of one received data byte can be
order address bytes are popped from stack RIW bit determines whether 5101 operates in stored in the intemal data RAM after a
and loaded into the program counter. the master transmitter or master receiver general call address is detected. If more than
The next instruction to be executed is the first mode. one byte is transmitted, a not acknowledge is
instruction of the state service routine. Seven returned and 5101 enters the not addressed
Master mode operation commences when the slave receiver mode.
bytes of program code (which execute in
STA bit in 51 CION is set by the SETS
eight machine cycles) are required to branch
instruction and data transfer is controlled by In the slave transmitter mode, data to be
to one of the 26 state service routines.
the master state service routines in transmitted is obtained from the sarne
51 PUSH PSW Save PSW
PUSH SlSTA Push status code accordance with Table 3, Table 4, Figure 17, location s in the internal data RAM that were
(low order and Figure 18. In the example below, 4 bytes previously loaded by the main program. After
address byte) are transferred. There is no repeated START a not acknowledge has been returned by a
PUSH HADD Push high order condition. In the event of lost arbitratic:n, the master receiver device, 5101 enters the not
address byte transfer is restarted when the bus becomes addressed slave mode..
RET Jump to state free. If a bus error occurs, the 12C bus is
service routine released and 5101 enters the not selected Adapting the Software for Different
The state service routines are located in a slave receiver mode. If a slave device returns Applications
256-byte page of program memory. The a not acknowledge, a STOP condition is
location of this page is defined in the generated. The following software example shows the
initialization routine. The page can be located typical structure of the interrupt routine
A repeated START condition can be included
anywhere in program rnemory by loading including the 26 state service routines and
in the serial transfer if the STA flag is set
data RAM register HADD with the page may be used as a base for user applications.
instead of the STO flag in the state service
number. Page 01 is chosen in this example, If one or more of the four modes are not
routines vectored to by status codes 28H and
and the service routines are located between used, the associated state service routines
58H. Additional software rnust be written to
addresses 0100H and 01 FFH. may be removed but, care should be taken
determine which data is transferred after a
The State Service Routines repeated START condition. that a deleted routine can never be invoked.
The state service routines are located 8 bytes Slave Transmitter and Slave Receiver Modes This example does not include any time-out
from each other. Eight bytes of code are routines. In the slave modes, time-out
sufficient for most of the service routines. A After initialization, 5101 continually tests the routines are not very useful since, in these
few of the routines require rnore than 8 bytes 12C bus and branches to one of the slave modes, 5101 behaves essentially as a
and have to jump to other locations to obtain state service routines if it detects its own passive device. In the master modes, an
more bytes of code. Each state routine is part slave address or llie general call address internal timer may be used to cause a
of the 5101 interrupt routine and handles one (see Table 5, Table 6, Figure 19, and Figure time-out if a serial transfer is not complete
of the 26 states. It ends with a RETI 20). If arbitration was lost while in the master after a defined period of time. This time
instruction which causes a return to the main mode, the master mode is restarted after the period is defined by the system connected to
program. current transfer. If a bus error occurs, the 12C the 12C bus.
StADR I GC DB
StOAT DA
StSTA I a I a I 0 D9
StCCH CR2 I ENStl STA I STa I 51 I AA I CRIj ClIO 118
~
PSW DO
i:
IPO I PSt I B8
: ~
Pt P1.7 I Pt.61 90
80
SRD
• Slave Receiver Data RAM :
40
: Mo01er Recei .... Dolo RAM
MRD 38
}I-----:----It
Figure 24. 8101 Oats Memory Map
1··········*"'·"'··**·****·····***********···****·**·***..................................................**
! SIOl EQUATE LIST
!*************** ••• ** •••••• **"' ••• ********",**** •• *** ••••• ******* ••• ******* ••• *****_****",****",*******ir.* •••
! BIT LOCATIONS
!** ••••• **.** •••••••• ** ...... ******* ••••••• ***** •• **.***••••••• * ••• **-*.** •••••••••••• "' ••••• "' •• *.*** •••••••
!..................."'-_ •••• "'_ ••••••••••••••••••••••••••*.* ••••• ",.*****.*********** •••* ••• "'*.*.****.* ••• ***
! IMMEDIATE DATA TO WRITE INTO REGISTER SlCON
!******************* ••••• *****************************•••• *.* ••••••••• _•••••••• _•• - .......................
OOD5 ENS1_NOTSTA_STO_NOTSLAA_CRO -Oxd5 ! Generates STOP
! (CRO = 100kHz)
OOC5 ENS1_NOTSTA_NOTSTO_NOTSLAA_CRO -Oxe5 ! Releases BUS and
!ACK
OOCl ENS l_NOTSTA_NOTSTO_NOTSLNOTAA_CRO -oxel ! Releases BUS and
! NOTACK
OOE5 ENS1_STA_NOTSTO_NOTSI_AA_CRO -Oxe5 ! Releases BUS and
!setSTA
,........................................................................................................
,!......................................................................
GENERAL IMMEDIATE DATA
""""."""""""..".,,..."'''' ... ,,........
0031 OWNSLA -Ox31 ! Own SLA+General Call
! must be written into S1ADR
OOAO ENSIOl -OxaO ! EA+ES1, enable SIOl interrupt
! must be written into IENO
0001 PAGl -OxOl ! select PAGl as HADD
OOCO SLAW -OxcO ! SLA+W to be transmitted
OOC1 SLAR -Oxel ! SLA+R to be transmitted
0018 SELRB3 -Ox18 ! Select Register Bank 3
I••••••• "' ••••••••••••••••• "'."' •••••••••• "' •••••••••••• "'.'II ••••••••••• "' ••••••••• "••••••••••••••••••••••••••••
! LOCATIONS IN DATA RAM
!•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• "•••••••
0030 MTD -Ox30 ! MST/TRXlDATA base address
0038 MRD -Ox38 ! MST/REC/DATA base address
0040 SRD -Ox40 ! SLV/REC/DATA base address
0048 STD -Ox48 ! SLVfTRXlDATA base address
I INITIALIZATION ROUTINE
I Example to initialize IIC Interface as slave receiver or
I slave transmitter and start a MASTER TRANSMIT or a MASTER
I RECEIVE function. 4 bytes will be transmitted or received.
,••••••••••••••••••••••••••••••••••••••••**................................................................
.sect strt
.base OxOO
0000 4100 ajmp INIT I RESET
.sect initial
.base Ox200
0200 750831 INIT: mov SlAOR,#OWNSLA I Load own SLA + enable
I general call recognition
0203 0296 setb Pl(S) I Pl.S High level.
0205 0297 setb Pl(7) I Pl.7 High level.
0207 755001 mov HAOO,#PAGl
020A 43A8AO or! IENO,#ENSIOl I Enable SIOl interrupt
0200 C2BO clr SI01HP I SIOl interrupt low
I priority
020F 7508C5 mov SlCON, #ENS1_NOTSTA_NOTSTO_NOTSLAA_CRO
I Initialize SLV tuncl.
,.........................................................................................................
1-------------------------------------------------
I START MASTER TRANSMIT FUNCTION
~------------------------------------------------
0212 755204 mov NUMBYTMST,#Ox4 I Transmit 4 byles.
0215 7551 CO mov SLA,#SLAW I SLA+W, Transmittuncl.
0218 0200 setb STA I set STA in SlCON
~------------------------------------------------
I START MASTER RECEIVE FUNCTION
~------------------------------------------------
021A 755204 mov NUMBYTMST,#Ox4 ! Receive 4 bytes.
0210 7551Cl mov SLA,#SLAR ! SLA+R, Receive tuncl.
0220 0200 setb STA I set STA in SlCON
1Sl STA and HADD are pushed onto the stack. They serve as
1retum address for the RET instruction.
1The RET instruction sets the Program Counter to address
1HADD, Sl STA and jumps to the right subroutine.
1-------------------------------------------------
1STATE : 00, Bus error.
1ACTION: Enter not addressed SLV mode and release bus.
STOresel.
~------------------------------------------------
.sect stO
.base Oxl00
...........................................................................................................
"
,•••••••••••••• *** ...............................**.**••• ** ••••••• **** ••••• **.** •••••••••••••••••• ***•••••
I MASTER STATE SERVICE ROUTINES
!..................................._........................................................................
I State 08 and State 10 are both for MSTrrRX and MST/REC.
I The RIW bit decides whether the next state is within
I MSTrrRX mode orwithiil MST/REC mode.
,................................................**••••••••••• **••••••• *** ••••••••••••••••••••••••••••***
~------------------------------------------------
I STATE : 08, A, START condition has been transmitted.
I ACTION: SLA+RIW are transmitted, ACK bit is received.
~------------------------------------------------
.sect mls8
.base Oxl08
~------------------------------------------------
I STATE: 10, A repeated START condition has been
! transmitted.
I ACTION: SLA+RIW are transmitted, ACK bit is received.
~------------------------------------------------
.sect mlsl0
.base Oxll0
.sect ibasel
.base OxaO
OOAO 75D018 INITBASE1: mov psw,#SELRB3
OOA3 7930 mov rl,#MTD
OOA5 7838 mov rO,#MRD
OOA7 855253 mov BACKUP,NUMBYTMST I Save initial value
OOM DODO pop psw
OOAC 32 reti
~------------------------------------------------
! STATE 18, Previous state was STATE 8 or STATE 10,
SLA+W have been transmitted, ACK has
been received.
! ACTION: First OATA is transmitted, ACK bit
! is received.
~------------------------------------------------
.sect mts18
.base Oxl18
!-------------------------------------------------
! STATE : 20, SLA+W have been transmitted, NOT ACK
has been received
! ACTION: Transmit STOP condition.
~------------------------------------------------
.sect mts20
.base Oxll0
!-------------------------------------------------
! STATE : 28, OATA of SlOAT have been transmitted,
ACK received.
! ACTION: If Transmitted OATA is last OATA then
! transmit a STOP condition, else transmit
nextOATA.
~------------------------------------------------
.sect mts28
.base Ox128
.sect mts28sb
.base OxObO
0080 750018 NOTLOAT1: mav psw,#SELRB3
0083 870A mav S1DAT,@rl
00B5 7508C5 CON: mav SlCON,#ENS1_NOTSTA_NOTSTO_NOTSLAA_CRO
! elr SI, set AA
ooBS 09 inc rl
ooB9 0000 RETmt pop psw
ooBB 32 reti
1-------------------------------------------------
1STATE : 30, DATA of SlOAT have been transmitted,
1 NOT ACK received.
1ACTION: Transmit a STOP condition.
~------------------------------------------------
.sect mts30
.base Oxl30
~------------------------------------------------
I STATE : 38, Arbitration lost in SLA+W or DATA.
! ACTION: Bus is released, not addressed SLV mode is
entered. A new START condition is transmitted
I when the IIC bus is free again.
~------------------------------------------------
.sect mts38
.base Oxl38
1****····················******····******************************************"'.****_.*******************
!******************************.*********************.***********.******* •• ***.******.******************11"
I MASTER RECEIVER STATE SERVICE ROUTINES
!*****************"' •• "'*****************.** •• *****.**********************"'*********************_.""********
!*******ir*****.***+.******.*****t-**********!**********__ **_ ..... _. ___ ._.* __
* ____________ ._ .... ___._ ..... _. __ •
~---------------------~--------------------------
I STATE : 40, Previous state was STATE 08 or STATE 10,
I SLA+R have been transmitted, ACK received.
I ACTION: DATA will be received, ACK returned.
~------------------------------------------------
.sect mts40
.base Ox140
1-------------------------------------------------
I STATE : 48, SLA+R have been transmitted, NOT ACK
! receiVed.
1ACTION: STOP condition will be generated.
~-----------------------------------------------~
.sect mts48
.base Ox148
!----------------~--------------------------------
! STATE :
50, DATA have been received, ACK returned.
! ACTION:
Read DATA of SlOAT.
DATA will be received, if it is last
DATA then NOT ACK will be returned else ACK
will be returned.
!-------------------------------------------------
.seet mrs50
.base Ox15O
.seet mrs50s
.base OxeO
!-------------------------------------------------
! STATE : 58, DATA have been received, NOT ACK
! returned.
! ACTION: Read DATA of SI DAT and generate a STOP
! condition.
~------------------------------------------------
.seet mrs58
.base Ox158
~------------------------------------------------
I STATE : GO, Own SLA+W have been received, ACK
! returned.
! ACTION: DATA will be received and ACK returned.
~------------------------------------------------
.seet srs60
.base OxlGO
01 GO 75D8C5 mov SICON,#ENS1_NOTSTA_NOTSTO_NOTSLAA_CRO
I clr SI, set AA
0163 75D018 mov psw,#SELRB3
0166 01DO ajmp INITSRD
.seet insrd
.base OxdO
~------------------------------------------------
! STATE :
68, Arbitration lost in SLA and RIW as MST
I Own SLA+W have been received, ACK returned
! ACTION:
DATA will be received and ACK returned.
STA is set to restart MST mode after the
! bus is free again.
!-------------------------------------------------
.seet srs68
.base Oxl68
0168 75D8E5 mov SICON,#ENS1_STA_NOTSTO_NOTSLAA_CRO
016B 75D018 mov psw,#SELRB3
016E 0100 ajmp INITSRD
~------------------------------------------------
I STATE : 70, General call has been received, ACK
I returned.
! ACTION: DATA will be received and ACK returned.
~------------------------------------------------
.seet srs70
.base Ox170
0170 75D8C5 mov SICON,#ENSI NOTSTA NOTSTO NOTSI AA CRO
- !clr SI, set AA - -
0173 75D018 mov psw,#SELRB3 ! Initialize SRD counter
~------------------------------------------------
I STATE : 78, Arbitration lost in SLA+RIW as MST.
I General call has been received, ACK returned.
I ACTION: DATA will be received and ACK returned.
I STA is set to restart MST mode after the
! bus is free again.
~------------------------------------------------
.seet srs78
.base Ox178
0178 75D8E5 mov SICON,#ENS1_STA_NOTSTO_NOTSI_AA_CRO
017B 75D018 mov psw,#SELRB3 ! Initialize SRD counter
017E 01DO ajmp INITSRD
~------------------------------------------------
I STATE : 50, Previously addressed with own SLA.
I DATA received, ACK retumed.
! ACTION: Read DATA.
I IF received DATA was the last THEN superfluous
! DATA will be received and NOT ACK retumed ELSE
next DATA will be received and ACK retumed.
!-------------------------------------------------
.sect srs80
.base Oxl80
.sect srs80s
.base Oxd8
~------------------------------------------------
! STATE :
88, Previously addressed with own SLA.
! DATA received NOT ACK retumed.
! ACTION:
No save of DATA, Enter NOT addressed SLV
I mode. Recognition of own SLA. General call
! recognized, if SlADR. 0-1.
!-------------------------------------------------
.sect srs88
.base Ox188
~------------------------------------------------
I STATE : 90, Previously addressed with general call.
I DATA has been received, ACK has been retumed.
I ACTION: Read DATA.
! After General call only one byte will be
received with ACK the second DATA will be
received with NOT ACK.
DATA will be received and NOT ACK
I returned.
1-------------------------------------------------
.sect srs90
.base Oxl90
~------------------------------------------------
! STATE : 98, Previously addressed with general call.
! DATA has been received, NOT ACK has been
! retumed.
! ACTION: No save of DATA, Enter NOT addressed SLV
! mode. Recognition of own SLA. General call
I recognized, if SlADR. 0-1.
!-------------------------------------------------
.sect srs98
.base Ox198
~------------------------------------------------
! STATE: AO, A STOP condition or repeated START has
I been received, while still addressed as
I SLVlREC or SLVrrRX.
! ACTION: No save of DATA, Enter NOT addressed SLV
! mode. Recognition of own SLA. General call
! recognized, if SlADR. 0-1.
~------------------------------------------------
.sect srsAO
.base OxlaO
~------------------------------------------------
I STATE : AS, Own SLA+R received, ACK returned.
I ACTION: DATA will be transmitted, A bit received.
~---------------------------------------------~--
.sect stsaS
.base OxlaB
.sect ibase2
.base OxeS
OCE8 75D018 INITBASE2: mov psw,#SELRB3
OCEB 7948 mov rl, #STD
OIlED 09 inc rl
OCEE DODO pop psw
OCFO 32 reti
~------------------------------------------------
I STATE : 80, Arbitration lost in SLA and RIW as MST.
! Own SLA+R received, ACK returned.
I ACTION: DATA will be transmitted, A bit received.
I STA is set to restart MST mode after the
! bus is free again.
~------------------------------------------------
.sect stsbO
.base OxlbO
~------------------------------------------------
I STATE : 88, DATA has been transmitted, ACK received.
I ACTION: DATA will be transmitted, ACK bit is received.
1-------------------------------------___________ _
.sect stsbB
.base OxlbB
0188 75D018 mov psw,#SELRB3
01BB 87DA mov S1DAT,@rl
01BD 01F8 ajmp SCON
.sect scn
.base Oxl8
OCFB 09 inc rl
OCFC DODO pop psw
oOFE 32 reti
1-------------------------------------------------
1STATE : CO, DATA has been transmitted, NOT ACK
1 received.
J ACTION: Enter not addressed SLV mode.
1-------------------------------------------------
.sect stscO
.base OxleO
01CO 7SDacs mov SlCON,#ENSl NOTSTA NOTSTO NOTSI AA CRO
- !elr SI, set AA - -
01C3 DODO pop psw
01CS 32 reti
~------------------------------------------------
1STATE : ca, Last DATA has been transmitted (AA=O),
1 ACK received.
1 ACTION: Enter not addressed SLV mode.
1-------------------------------------------------
.seet stseS
.base OxleS
01ca 7SDacs mov S 1CON ,#ENSCNOTSTA_NOTSTO_NOTSLAA_CRO
1elr SI, set AA
01CB DODO pop psw
01CD 32 reti
vee vee
II LJ Overflow
veeU
timerT3 +
2.21lF
;;:;;:=; 8XC552
Schmitt
Trigger
L. RST
Reset
RST
ff I---
Circuitry
On-chlp
reaI.tor
II RRST
RRST
'*
Figure 25. On-Chip Reset Configuration Figure 26. Power-On Reset
--
IIITII ExternoJ
Interrupt
Req_O ~
01
02
01
b1
-.......-
1 .,
12c
Serial
Port
- - 1
1
b1
b2
d1
.,
ADC
1
1 -
.......,.
.,
c2
11
g1
1
TImer 0
1 d1 h1
1 High
OvertIow
~ d2 11
priority
--
Interrupt
1 11
request
CTllI 81
TImer 2 1
-'--- CopIureO k1
82
1
--
11
1 11
TImer 2
Compare 0
1 .......,. m1
12
-
1 n1
--
!RTf Externol
Interrupt
Req_t1
1
1
g1
g2
01
Source
kientificatlon
Vector
--
CTtI
1 h1
TImer 2 1
CopIure1 ....... h2
1 02
1 11
TImer 2 b2
~re1
1
"'"'- 12 .2
TImer 1
OvertIow - - 1
1 -
.......
11 d2
82
fl
1 12
1 k1
~ TImer 2
Capture 2 .......,. g2
k2
-.......-
h2
1
TImer 2
Compare 2 -- 1
1
11
12
12
fl
Low
priority
Interrupt
request
UART'
Seri.. :- - -
Port •
T
R ""
/' - 1
1- -....... m1
m2
k2
12
--
CT3I TImer 2
CopIure3
1
_1-
1
-.......
-
n1
n2
m2
n2
TImerT2
OvertIow
i"-,.
V -- 1
1 .......,.
01
02
02
Source
IdentificaUon
Vector
The Sial (12C) interrupt is generated by the level request is serviced. If requests of the The polling cycle is repeated with every
SI flag in the Sial control register (SlCON). same priority are received simultaneously, an machine cycle, and the values polled are the
This flag is set when Sl STA is loaded with a internal polling sequence determines which values present at S5P2 of the previous
valid status code. request is serviced. Thus, within each priority machine cycle. Note that if an interrupt flag is
level, there is a second priority structure active but is not being responded to because
The ADClllag may be reset by software. It determined by the polling sequence. This of one of the above conditions, and if the flag
cannot be set by software. All other flags that second priority structure is shown in Table B. is inactive when the blocking condition is
generate interrupts may be set or cleared by removed, then the blocked interrupt will not
software, and the effect is the same as The above Priority Within Level structure is be serviced. Thus, the fact that the interrupt
setting or resetting the flags by hardware. only used when there are simultaneous flag was once active but not serviced is not
Thus, interrupts may be generated by requests of the same priority level. remembered. Every polling cycle is new.
software and pending interrupts can be
canceled by software. Interrupt Handling: The interrupt sources The processor acknowledges an interrupt
are sampled at S5P2 of every machine cycle. request by executing a hardware-generated
Interrupt Enable Registers: Each interrupt
The samples are polled during the following LCALL to the appropriate service routine. In
source can be individually enabled or
machine cycle. If one of the flags was in a set some cases it also clears the flag which
disabled by setting or clearing a bit in the
condition at S5P2 of the previous machine generated the interrupt, and in others it does
interrupt enable special function registers
cycle, the polling cycle will find it and the not. It clears the Timer 0, Timer 1, and
lEND and IEN1. All interrupt sources can also
interrupt system will generate an LCALL to external interrupt flags. An external interrupt
be globally enabled or disabled by setting or
the appropriate service routine, provided this flag (lEO or IE1) is cleared only if it was
clearing bit EA in lEND. The interrupt enable
hardware-generated LCALL is not blocked by transition-activated. All other interrupt flags
registers are described in Figures 2B and 29.
any of the following conditions: are not cleared by hardware and must be
1. An interrupt of higher or equal priority cleared by the software. The LCALL pushes
Interrupt Priority Structure: Each interrupt
level is already in progress. the contents of the program counter on to the
source can be assigned one of two priority
levels. Interrupt priority levels are defined by stack (but it does not save the PSW) and
the interrupt priority special function registers 2. The current machine cycle is not the final reloads the PC with an address that depends
IPO and IP1. IPO and IPl are described in cycle in the execution of the instruction in on the source of the interrupt being vectored
Fig ures 30 and 31. progress. (No interrupt request will be to as shown in Table 9.
serviced until the instruction in progress is
Interrupt priority levels are as follows: completed.) Execution proceeds from the vector address
'0"-low priority until the RETI instruction is encountered. The
"1"-high priOrity 3. The instruction in progress is RETI or any RETI instruction clears the "priority level
access to the interrupt priority or interrupt active" flip-flop that was set when this
A low priority interrupt may be interrupted by enable registers. (No interrupt will be interrupt was acknowledged. It then pops the
a high priority interrupt. A high priority serviced after RETI or after a read or write top two bytes from the stack and reloads the
interrupt cannot be interrupted by any other to IPO, IP1, lEO, or IEl until at least one program counter. Execution of the interrupted
interrupt source. If two requests of different other instruction has been subsequently program continues from where it was
priority occur simultaneously, the high priOrity executed.) interrupted.
6 4 3
lEND
(ASH)
EA I I I I I I I I
EAO ESI ESO En EXI ETO EXO !:~) I ET2 I ECM21ECMli ECMOI ECT31 ECT21 Ecnl ECTOI
Figure 28. Interrupt Enable Register (I END) Figure 29. Interrupt Enable Register (IEN1)
7 6 0 6 5 4 3 o
IPO
(BaH)
- I PADI PSI I Pml PTI I PXl I PTO I PXO I
IPI
(F8H)
I PT2 I pcM21 PCMll pcloIll PCT31 PCT21 pcTtI PCTO I
(MSB) (LSB) (MSB) (LSB)
Figure 30. Interrupt Priority Register (IPO) Figure 31. Interrupt Priority Register (IP1)
1/0 Port Structure Port 5 is not bidirectional and may not be fosc = 24M Hz, the frequency range is 184Hz
The 8XC552 has six 8-bit ports. Each port configured as an output port. All six ports are to 47.1 Hz. By loading the PWM registers with
consists of a latch (special function registers multifunctional, and their alternate functions either DOH or FFH, the PWM channels will
PO to P5), an input buffer, and an output are listed in Table 10. A more detailed output a constant HIGH or lOW level,
driver (port 0 to 4 only). Ports 0-3 are the description of these features can be found in respectively. Since the 8-bit counter counts
same as in the BOC51 , with the exception of the relevant parts of this section. modulo 255, it can never actually reach the
the additional functions of port 1. The parallel value of the PWM registers when they are
1/0 function of port 4 is equal to that of ports Pulse Width Modulated Outputs loaded with FFH.
I, 2, and 3. Port 5 may be used as an input The 8XC552 contains two pulse width
modulated output channels (see Figure 33). When a compare register (PWMO or PWM1)
port only.
These channels generate pulses of is loaded with a new value, the associated
programmable length and interval. The output is updated immediately. It does not
Figure 32 shows the bit latch and 1/0 buffer have to wait until the end of the current
repetition frequency is defined by an 8-bit
functional diagrams of the unique 8XC552 counter period. Both PWKfri output pins are
prescaler PWMP, which supplies the clock for
ports. A bit latch corresponds to one bit in a driven by push-pull drivers. These pins are
the counter. The prescaler and counter are
port's SFR and is represented as a D type not used for any other purpose.
common to both PWM channels. The 8-bit
flip-flop. A "Write to latch" signal from the CPU
counter counts modulo 255, i.e., from 0 to Prescaler frequency control register PWMP
latches a bit from the internal bus and a "read
254 inclusive. The value of the 8-bit counter
latch" signal from the CPU places the Q
output of the flip-flop on the internal bus. A
is compared to the contents of two registers: PWMP(FEH) 171 6 1 5 1 4 13 1 2 I, 10 1
PWMO and PWM1. Provided the contents of MSB LSB
"read pin" signal from the CPU places the
either of these registers is greater than the
actual port pin level on the internal bus.
counter value, the corresponding PWIiim or PWMP.O-7 Pre scaler division factor =
Some instructions that read a port read the
PWIVIT output is set lOW. If the contents of PWMP + 1.
actual port pin levels, and other instructions
these registers are equal to, or less than the
read the latch (SFR) contents. Reading PWMP gives the current reload
counter value, the output will be HIGH. The
pulse-width-ratio is therefore defined by the value. The actual count of the prescaler
contents of the registers PWMO and PWMI. cannot be read.
Port 1 Operation
Port 1 operates the same as it does in the The pulse-width-ratio is in the range of 0 to 1
B051 with the exception of port lines Pl.6 and and may be programmed in increments of ~~~~~g~ll 71 6 1 5 1 4 13 1 2 1' 10
1/255. MSB LSB
PI. 7, which may be selected as the SCl and
SDA lines of serial port SIOI (12C). Because
Buffered PWM outputs may be used to drive PWMO/l.0-7} low/high ratio of PWIVfri =
the 12C bus may be active while the device is
DC motors. The rotation speed of the motor
disconnected from V DD , these pins are !PWMnl
would be proportional to the contents of
provided with open drain drivers. Therefore 255-(PWMn)
PWMn. The PWM outputs may also be
pins Pl.6 and Pl.7 do not have internal
configured as a dual DAC. In this application,
~~~L . Analog-to-Digital Converter
the PWM outputs must be integrated using
The analog input circuitry consists of an
conventional operational amplifier circuitry. If
B-input analog mUltiplexer and a 10-bit,
Port 5 Operation the resulting output voltages have to be
straight binary, successive approximation
accurate, external buffers with their own
Port 5 may be used to input up to 8 analog ADC. The analog reference voltage and
analog supply should be used to buffer the
signals to the ADC. Unused ADC inputs may analog power supplies are connected via
PWM outputs before they are integrated. The
be used to input digital inputs. These inputs separate input pins. The conversion takes 50
repetition frequency fpwm, at the PWMn
have an inherent hysteresis to prevent the machine cycles, i.e., 37.5f.ls at an oscillator
outputs is give by:
input logic from drawing excessive current frequency of 16MHz, 25f.ls at an oscillator
from the power lines when driven by analog frequency of 24MHz. Input voltage swing is
fosc
signals. Channel to channel crosstalk (Ct) fpwm = from OV to +5V. Because the internal DAC
should be taken into consideration when both 2 x (1 + PWMP) x 255
employs a ratio metric potentiometer, there
analog and digital signals are simultaneously are no discontinuities in the converter
input to Port 5 (see, D.C. characteristics in This gives a repetition frequency range of characteristic. Figure 34 shows a functional
data sheet). 123Hz to 31.4kHz (fosc = 16MHz). At diagram of the analog input circuitry.
Alternate
Output
~.:: - - - - , ~~----, Function
VDD VDD
Int. Bus
. )
Internal
Pull-Up
Int. Buo D Q
.
)
Internal
Pul-Up
P1.X Pl.X
ulch ulch
Write
tll----j Write
to CL
10 CL tl
u!ch
Latch
A. B.
NOTE:
Pull-up not present on P1.6 and P1.7.
·Two period active pull-up as in the BOCS1.
VDD
Int. Bu.
. )
lmernal
PulI·Up
Int. BUB ~P5.X
Pin
P4.X Read Pin
ulch
Write
to CL tl 1-----; ToADC
u!ch
D.
Re~ _ _ _-'
Clea,from
Allernale Function
c.
}
PO.1 AD1
PO.2 AD2
PO.3 AD3 Multiplexed lower order address/data bus used
PO.4 AD4 during external memory accesses
PO.5 AD5
PO.6 AD6
PO.7 AD7
P1.0 CTOI
P1.1
P1.2
P1.3
P1.4
CTlI
CT21
CT31
T2
} Capture timiner input signals for timer T2
T2 event input
P1.5 RT2 T2 timer reset signal. Rising edge triggered
P1.6 SCL Serial port clock line 12C bus
P1.7 SDA Serial port data line 12C bus
P2.0 A8
}
P2.1 A9
P2.2 A10
P2.3 A11 High order address byte used during
P2.4 A12 external memory accesses
P2.5 A13
P2.6 A14
P2.7 A15
CMS~
P4.0
P4.1 CMSR1
P4.2 CMSR2 Timer T2: compare and set/reset outputs on a
P4.3 CMSR3 match with timer T2
P4.4 CMSR
P4.5 CMSR5}
P4.6 CMTO Timer T2: compare and toggle outputs on a match
P4.7 CMT1 with timer T2
P5.0
P5.1
P5.2
AOCO}
ADC1
ADC2
P5.3 ADC3
P5.4 Eight analogue ADC inputs
ADC4
P5.5 ADC5
P5.6 ADC6
P5.7 ADC7
STADC
ADCO --1"-----...,
ADCl +
ADC2 Analog ref.
ADC3 Analog Input 10-81t AID Converter
ADC4 Multiplexer
ADCS Analog supply
ADC6
Analog grouKl
ADC7
ADCON ADCH
Intemll aua
Analog-la-Digital Conversion: Figure 35 that sets ADCS. ADCS is actually set; otherwise the bit being tested is cleared.
shows the elements of a successive implemented with two flip-flops: a command This process is repeated until all ten bits have
approximation (SA) ADC. The ADC contains flip-flop which is affected by set operations, been tested, at which stage the result of the
a DAC which converts the contents of a and a status flag which is accessed during conversion is held in the successive
successive approximation register to a read operations. approximation register. Figure 36 shows a
voltage (VDAC) which is compared to the conversion flow chart. The bit pointer
The next two machine cycles are used to
analog input voltage (Vin). The output of the identifies the bit under test. The conversion
initiate the converter. At the end of the first
comparator is fed to the successive takes four machine cycles per bit.
cycle, the ADCS status flag is set and a value
approximation control logic which controls the
of "1" will be retumed if the ADCS flag is read
successive approximation register. A The end of the 1O-bit conversion is flagged by
while the conversion is in progress. Sampling
conversion is initiated by setting ADCS in the control bit ADCON.4 (ADCI). The upper 8 bits
of the analog input commences at the end of
ADCON register. ADCS can be set by of the result are held in special function
the second cycle.
software only or by either hardware or register ADCH, and the two remaining bits
software. During the next eight machine cycles, the are held in ADCON.7 (ADC.1) and ADCON.6
voltage at the previously selected pin of port (ADC.O). The user may ignore the two least
The software only start mode is selected
5 is sampled, and this input voltage should be significant bits in ADCON and use the ADC
when control bit ADCON.5 (ADEX) = o. A
stable in order to obtain a useful sample.vent, as an 8-bit converter (8 upper bits in ADCH).
conversion is then started by setting control
the input voltage slew rate must be less than In any event, the total actual conversion time
bitADCON.3 (ADCS). The hardware or
10V/ms in order to prevent an undefined is 50 machine cycles. ADCI will be set and
software start mode is selected when
result. the ADCS status flag will be reset 50 cycles
ADCON.5 = 1, and a conversion may be
after the command flip-flop (ADCS) is set.
started by setting ADCON.3 as above or by The successive approximation control logic
applying a rising edge to extemal pin STADC. first sets the most significant bit and clears all
Control bits ADCON.O, ADCON.1, and
When a conversion is started by applying a other bits in the successive approximation
ADCON.2 are used to control an analog
rising edge, a low level must be applied to register (10 0000 00008). The output of the
multiplexer which selects one of eight analog
STADC for at least one machine cycle DAC (50% full scale) is compared to the input
channels (see Figure 37). An ADC
followed by a high level for at least one voltage Vin. If the input voltage is greater
conversion in progress is unaffected by an
machine cycle. than VDAC, then the bit remains set;
extemal or software ADC start. The result of
otherwise it is cleared.
The low-to-high transition of STADC is a completed conversion remains unaffected
recognized at the end of a machine cYcle, The successive approximation control logic provided ADCI = logic 1; a new ADC
and the conversion commences at the now sets the next most significant bit (11 conversion already in progress is aborted
beginning of the next cycle. When a 000000008 or 01 000000008, depending on when the idle or power-down mode is
conversion is initiated by software, the the previous result), and VDAC is compared entered. The result of a completed
conversion starts at the beginning of the to Vin again. If the input voltage is greater conversion (ADCI = logic 1) remains
machine cycle which follows the instruction than VDAC, then the bit being tested remains unaffected when entering the idle mode.
Vin
VDAC
rv I
~ Successive
Approximation
Successive
Approximation
~
Register Control Logic
t
Start Stop
t
Full Scale 1
15/16 59/64
Vin ------------ -----_.
314 29/32
7i1J
'~1
112
0
-----
1 2 3 4 5 6
tflau_
6 5 4 3 2 1 0
ADCON (C5H) I ADC.1 I ADC.O I ADEX ADCI ADCS I AADR21 AADR1 I AADROI
(MSD) (LSD)
BIt Symbol Nmction
ADCON.7 ADC.1 Bit 1 of ADC result
ADCON.6 ADC.O Bit 0 of ADC result
ADCON.5 ADEX Enable external.tan of conyeraion by STADe
0= Conversion can be started by software only (by setting ADCS)
1 =Conversion can be started by software or enemally (by a rising edge on STADC)
ADCON.4 ADCI ADC interrupt flag: thia nag f. eet when an AID conversion reault is ready to be read. An Interrupt is
invoked if it ia enabled. The nag rnay be cleared by the interrupt eervice routine. While this flag is set.
the ADe cannolalart a new conversion. AOa cannot be eel by aoftware.
ADCON.3 ADCS ADC etart and status: setting this bit starts an AID tonveraion.lt may be eel by software or by the
external aignal STADe. The ADC logic ensures that this signa' is HGH while the ADC I. busy. On com·
pletion of the conversion, ADCS ia reset at the same time the interrupt flag I. eel ADCS cannot be
reaet by software A new converalon may not be started while either ADCS or AOCI is high.
ADCON.2 AADR2 Analogue Input select: this binary coded address selects one of
ADCON.1 AADR1 the eight analogue port bits of P5 10 be input to the converter.lt
ADCON.O AADRO can only be changed when AOe! and ADCS are both LOW.
0 0 0 ADCO(P5.0)
0 0 1 ADC1 (P5.1)
0 1 0 ADC2(P5.2)
0 1 1 ADC3 (P5.3)
1 0 0 ADC4(P5.4)
0 1 0 ADC5(P5.5)
1 1 0 ADC6(P5.6)
1 1 1 ADC7(P5.7)
ADC Resolution and Analog Supply: may be between AVoo + 0.2V and AVss- register. When the BXC552 enters the idle
Figure 3B shows how the ADC is realized. 0.2V. AVref+ should be positive with respect mode, the following functions are disabled:
The ADC has its own supply pins (AVoo and to AVref-, and the input voltage (Vin) should
CPU (halted)
AVss) and two pins (Vref+ and Vref-) be between AVref+ and AVref-. If the analog
TimerT2 (halted and reset)
connected to each end of the DAC's input voltage range is from 2V to 4V, then
PWMO, PWMI (reset; outputs are high)
resistance-ladder. The ladder has 1023 lO-bit resolution can be obtained over this
ADC (conversion aborted if in
equally spaced taps, separated by a range if AVref+ = 4V and AVref- = 2V.
progress).
resistance of "R". The first tap is located 0.5 x
R above Vref-, and the last tap is located 1.5 The result can always be calculated from the In idle mode, the following functions remain
x R below Vref+. This gives a total ladder following formula: active:
resistance of 1024 x R. This structure
ensures that the DAC is monotonic and Timer 0
results in a symmetrical quantization error as Result=1024x VIN-AV,ef- Timer 1
AV,of+-AV,of_ TimerT3
shown in Figure 40.
81008101
External interrupts
For input voltages between Vref- and (Vref-)
+ 1/2 L8B, the lO-bit result of an AID Power Reduction Modes When the BXC552 enters the power-down
conversion will be 00 0000 OOOOB = OOOH. The BXC552 has two reduced power modes mode, the oscillator is stopped. The
For input voltages between (Vref+) -3/2 L8B of operation: the idle mode and the power-clown mode is entered by setting the
and Vref+, the result of a conversion will be power-down mode. These modes are entered PO bit in the PCON register. The PO bit can
lIIIIIIIIIB=3FFH.AVref+andAVref- by setting bits in the PCON special function only be set if the EW input is tied HIGH.
RI2
r------- 1023 MSB
R
R
1022
R Smrt
r------- 1021
Succeaalve Succeuive
Decoder Approximation Approximation
Total resistance
= 1023R + 2 x RI2 Register Control Logic
= I024R
ReIdy
R
R LSB
RI2
AVrel-
Value 0000 0000 00 is output for voltages Vref_ to (Vre ,_ + 112 LSB)
Value 11111111 11 is output for yoltages (Vre'+ - 3(2 LSB) to Vref+
•
r-------,
•
I • I
• I I
I I
I SmN+1 RmN+1 I
1N+1 I ./ I
I
I
I SmN RmN
II
To Comparator
IN
--~~~b-~-------------
IL _ _ _ _ _ _ _ ..JI
Multiplexer
Cc
I~
I
VANALOG INPUT
Rm = 0.5 - 3 kohms
CS + CC = 15pF maximum
RS = Recommended < 9.6 kohms for 1 LSB@ 12MHz
NOTE:
Because the analog to digital converter has a sampled-data comparator, the input looks capacitive to a source. When a conversion is
initiated, switch Sm closes for 8tcy (Bf.ls @ 12MHz crystal frequency) during which time capacitance Cs + Cc is charged. It should be
noted that the sampling causes the analog input to present a varying load to an analog source.
Quantization Error
q=l.5B =5 mV
Vin - Vdighal
+q/2
/1/1/1/1/1
1 vvvvv -q/2 ~ Vin
Symmetrical Quantization Error
Power-Down Mode: The instruction that sets Power Control Register PCON: The idle CPU always begins execution at locations
PCON.1 will be the last instruction executed and power-down modes are entered by OOOOH. Locations 0OO3H to 0075H are
in the normal operating mode before the writing to bits in PCON. PCON is not bit reserved for the fifteen interrupt request
power-down mode is entered. In the addressable. See Figure 41. service routines.
power-down mode, the on-chip oscillator is
stopped. This freezes all functions; only the Memory Organization Functionally, the internal data memory is the
on-chip RAM and special function registers The memory organization of the BXC552 is most flexible of the address spaces. The
are held. The port pins output the contents of the same as in the 8OC51 , with the exception internal data memory space is subdivided into
their respective special function registers. A that the BXC552 has Bk ROM, 256 bytes a 256-byte internal data RAM address space
hardware reset is the only way to terminate RAM, and additional SFRs. AddreSSing and a 12B-byte special function register
the power-down mode. Reset re-defines all modes are the same in the BXC552 and the (SFR) address space, as shown in Figure 42.
the special function registers, but does not BOC51. Details of the differences are given in
change the on-chip RAM. the following paragraphs. The internal data RAM address space is 0 to
255. Four B-bit register banks occupy
In the power-down mode, Voo and AVDo can
In the BXC552, the lower Bk of the 64k locations 0 to 31. 12B bit locations of the
be reduced to minimize power consumption.
program memory address space is filled by internal data RAM are accessible through
Voo and AVoo must not be reduced before
internal ROM. By tying the EA pin high, the direct addressing. These bits reside in 16
the power-down mode is entered and must
processor fetches instructions from internal bytes of internal data RAM at locations 20H
be restored to the normal operating voltage
program ROM. Bus expansion for accessing to 2FH. The stack can be located anywhere
before the power-down mode is terminated.
program memory from Bk upwards is in the internal data RAM address space by
The reset that terminates the power-down
automatic since external instruction fetches loading the B-bit stack pointer. The stack
mode also freezes the oscillator. The reset
occur automatically when the program depth may be 256 bytes maximum.
should not be activated before VDO and AVoo
are restored to their normal operating level, counter exceeds B191. If the EA pin is tied
low, all program memory fetches are from The SFR address space is 12B to 255. All
and must be held active long enough to allow
external memory. The execution speed of the registers except the program counter and the
the oscillator to restart and stabilize (normally
BXC552 is the same regardless of whether four B-bit register banks reside in this address
less than 10ms).
fetches are from external or internal program space. Memory mapping the SFRs allows
The status of the external pins during memory. If all storage is on-chip, then byte them to be accessed as easily as internal
power-down is shown in Table 11. If the location 8191 should be left vacant to prevent RAM, and as such, they can be operated on
power-down mode is entered while the an undesired pre-fetch from external program by most instructions. The 56 SFRs are listed
BXC552 is executing out of externaLprogram memory address B192. in Figure 43, and their mapping in the SFR
memory, the port data that is held in the P2 address space is shown in Figures 44 and
special function register is restored to port 2. Certain locations in program memory are 45. RAM bit addresses are the same as in
If a port latch contains a "1", the port pin is reserved for specific programs. Locations the BOC51 and are summarized in Figure 46.
held HIGH during the power-down mode by OOOOH to 0002H are reserved for the The special function bit addresses are
the strong pull-up transistor. initialization program. Following reset, the summarized in Figure 47.
Table 11. External Pin Status During Idle and Power-Down Modes
MODE MEMORY ALE PSER PORTO PORT 1 PORT 2 PORT 3 PORT 4 "l'WM"GiPWflf
Idle (1) Internal 1 1 Port data Port data Port data Port data Port data HIGH
Idle (1) External 1 1 Floating Port data Address Port data Port data HIGH
Power-down Internal 0 0 Port data Port data Port data Port data Port data HIGH
Power-down External 0 0 Floating Port data Port data Port data Port data HIGH
~ Space
m
4 0
PCON
(87H) ISMODI
- I
- I WLEI GFI.I GFO I PD I IDL
U_ Spec:IoI
128 Byt.. Function
Inclrect Intemal Reglolera Direct
Addressing RAM AddreeoIng
Bit Symbol Function
Only Only
PCON.O IDL
the powet-doYlln mode, It can only be eet
If Input EW 10 high.
kI:e mode bit. SeHing this bit activates the
IcIemode.
Addre88able
Bltaln RAM
(128 Bita) { l!&
127
7
R7
120
Bank 3
Direct or
2! RO Indirect
R7 Adclreoolng
Bank 2
If logic 1. are written to PO and IDL at the ~ RO
eame time. PO takes precedence. The re- Registers
R7
eet yalue of PCON 10 (OXJ(OOOOO). Bank I
a RO
R7
Bank I
!! RO
~ ________
,,_________J
Intemal
Data RAM
Figure 41. Power Control Register (PCON) Figure 42. Internal Data Memory Address Space
ARiTHMEnC REGISTERS: PULSE WiDTH MODULATED OIP.: CAPTURE AND COMPARE LOGIC:
ACCumulator,· B regis1er: Pulse Width Modulation Prescaler CapTure CONtrol,
Program Status Word' Pulse Width Modulation Register 0, TIMer T2 Interrupt flag Reglater,
Pulse Wtdth Modulation Register 1 CapTure Low 0, CopTure High 0,
POINTERS: CapTure low 1, CapTure High 1.
Stack Pointer, SERIAL I/O PORTS: CapTure Low 2, CopTure High 2,
Data Pol",", (High and Low) Serial 0 CONtrol: Serial 0 data BUFfer, CapTure Low 3, CopTure High 3,
Serial 1 CONtrol," Serial 1 DATa, CoMpere Low 0, CoMpare tlgh 0,
PARALLEL UO PORTS: CoMpare Low " CoMpare tlgh 1,
Serial 1 STAtus, Serial 1 ADDreu, PCON
Port 5,' Port 4,'Port 3,' CoMpare low 2, Co~are tlgh 2
Port 2,' Port I,' PortO' nMERS: SeT Enable, ReseT Enable
Timer MODe, TImer CONtrol,"
INTERRUPT SYSTEM: Timer Low 0, Timer High 0, ADC
Interrupt Priorhy 0,' Timer low 1, Timer High 1, ADC cONtrol, ADC High byte
Interrupt Priorhy I,' TiMer T2 CONb'oI, TiMer Low 2,
Interrupt Enable 0,' Timer High 2. Timer T3
Interrupt Enable ,. "NOTE: Bit and byte _ a b l e
_ _c
Regl.ter Direct BY'" Regl.... Direct Byte
,.---'---, ,.
BbAddreoo
....... ,,........
Addre. . (Hex) Mnemonic
,.---'---,
BitAddreaa
r,..--------------~,
Addr... (Hex)
,........
~1
FFH
1
FEH
FDH
FCH
~1~'~'~'~'~'~I~'OOr
B5 Bll DO
OOH
P3 B7 B6 B4 113 B2
IPI FFI FEI FDI FCI FBI FAI FII F8 FBH .cru
1= .CTL2
B F71F6IFSI F41 F31 nl FllFD FOH .CTll
RYE EFH .CTlD
STE EEH CML2
.TMH2 EOH CMLt
.TML2 ECH CMLD
CTCON EBH lEN! AF IAE I AD I AC I AB I AA I At I A8
Tll2CON EAH
P2 A7 I A6 I AS I MI A3 I A2 I AI I AD
IENI EF EE ED EC EB EA ESIES ESH
SOBUF
ACC E71 ESI ESI 641 E31 a l El I BI EoH SOCON SF 9E 90 9C 9B 9A 99 98
~L.,.,.,a,a, . J
CMH2 CBH 83H
CMHI CAH 82H
CMHO C9H 81H
TM:!IR CFICEICOI eel CBI CAl C9lca COH 80H
.ADCH C6H
ADCON C5H
.PS C4H
,
P4 c71 C61 csl C41 C31 C21 cllco COH
SpecIoI
FunctIon
lIegIotora
~
l!5! 255 248 FlH
248 RJH
240
EBH
232 BIll
224 DeH
21&
-I
DOH
2D8
caH
2110
COH Direct
112 BaH
184 BON· (BIIa)
17&
AlH
168
1&0
ADH
88H
152
lIOII
144
138 68H
l2i 135 1211 80H
,
127
B.
DlI8CI
Adchufng
(811a) . {a 127
7
120
D
R7
8onk3
lit. RO
R7
8onk2
IIegloter l§. AD
-18AIng R7
Bank 1
I RO
R7
_1
II RO
FIgure 45. Bit and Byte Addressing Overview of Inlernal Oa.. Memory
laH ADH A7 I AS I AS I A4 I A3 I A2 I AI I AD P2
24
SIlO SUI 5M2 REN TBa RB8 n III
17H 23
98H 9F I 9E I 90 I 9C I 9B I 9A I 99 I 98 SOCON
Benk2
IOH 16 90H 97 I 96 I 95 I 94 I 93 I 92 I 91 I 90 PI
OFH IS TFI TRI TRI TAO lEI ITt lEO ITO
Benkl 88H aF I aE I aD I ac I 8B I 8AI 89 I 88 TCON
OBH 8 SOH 87 I 96 I 85 I 94 I 83 I 92 I 81 I SO PO
07H 7
BenkO
DOH 0
Figure 46. RAM Bit Addresses Figure 47. Special Function Register Bit Address
Single-chip B-bit microcontroller with 10-bit AID, capture/compare timer. high-speed outputs, PWM
DESCRIPTION PIN CONFIGURATIONS
The 8OC552183C552187C552 (hereafter
II
generically referred to as 8XC552)
Single-Chip 8-Bit Micrccontroller is
manufactured in an advanced CMOS process
and is a derivative of the 80C51
microcontroller family. The 8XC552 has the
same instruction set as the 8OC51. Three
versions of the' derivative exist:
• 83C552 - 8k bytes mask programmable
ROM
'FEATURES
• 8OC552 - ROMless version'of the 83C552 Pin FuIctIon PIn FIInctIon
• 80C51 central processing unit
1 P5.OIADCO 35 XTAlI
• 87C552 - 8k bytes EPROM
• 8k x 8 ROM expandable externally to 64'k 2 VDD 36 VSS
The 8XC552 contains a non-volatile 8k x 8 bytes 3
4 _STAOC 37 VSS
39 NC
read-only program memory (83C552) • An additional 16-bit timer/counter coupled 5'_ P2.OIA08
39
EPROM (87C552), a volatile 256 x 8 to four capture registers and three compare 6 EW 40 P2.1/AOB
read/write data memory, five B-bit I/O ports, registers 7 P4.OICMSRO 41 P2.21Al0
one B-bit input port, two 16-bit timer/event 8 P4.1ICMSRI 42 P2.3/A11
counters (identical to the timers of the • Two standard 16-bit timer/counters 9 P421CMSR2 43 P2.41A12
8OC51), an additional 16-bit timer coupled to 10 P4.atCMSR3 44 P2.5IAI3
• 256 x 8 RAM, expandable externally to 64k 11 P4.4ICMSR4 45 P2.61AI4
capture and compare latches, a lS-source, · bytes 12 P4.5ICMSR5 46 P2.7/AI5
two-priority-level, nested interrupt structure, 13 P4.6/CMTO 47 l'SEl'l
an B-input ADC, a dual DAC pulse width • Capable of producing eight synchronized, 14 P4.7ICMTI 46 AlEiPROG
modulated interface, two serial interfaces timed outputs 15 RST 49 9Wpp
(UART and 12C-bus), a "Watchdog" timer and • A 1O-bit ADC with eight multiplexed analog 16 Pl.OICTOI 50 PO.7/AD7
on-dlip oscillator and timing circuits. For 17 Pl.1ICTII 51 PO.61AD6
inputs 18 Pl.2/CT21 52 PO.5IADS
systems that require extra capability, the
8XC552 can be expanded using standard • Two B-bit resolution, pulse width 19 Pl.3iCT31 53 PO.4IAD4
20 Pl.41T2 54 PO.3/AD3
TTL compatible memories and logic. modulation outputs
21 Pl.5IRT2 55 PO.21AD2
In addition, the 8XC552 has two software • Five 8-bit I/O ports plus one 8-bit input port 22 Pl.61SCl 56 PO.l/ADl
23 P1.7JSDA 57 PO.OIAOO
selectable modes of power reduction - idle shared with analog inputs
24 P3.OIRxD 58 AVra-
mode and power-down mode. The idle mode 25 P3.11TxD 59 AVrfI+
• 12C-bus serial I/O port with byte oriented
freezes the CPU while allowing the RAM, 26 P3.2i11'1Tl1 80 AVSS
master and slave functions
timers, serial ports, and interrupt system to 27 P3.3I1fITT 61 AVOO
continue functioning. The power-down mode • Full-duplex UART compatible with the 28 P3.4IT0 '62 PS.7/AOC7
saves the RAM contents but freezes the slandard 80C51 29 P3.5iTl 63 PS.61A0C6
oscillator, causing all other chip functions to 30 P3.6IWR 64 PS.5IADC5
be inoperative. • On-chip watchdog timer 31 P3.7/RU 65 P5.4/ADC4
32 NC 68 PS.3/ADC3
The device also functions as an arithmetic • Three speed ranges: 33 NC 67 P5.21ADC2
processor having facilities for both binary and - 16MHz 34 XTA12 68 PS.lIAOCI
BCD arithmetic plus bit-handling capabilities. - 24MHz
The instruction set consists of over 100 - 30MHz (in preparation)
instructions: 49 one-byte, 45 two-byte, and 17
three-byte. With a 16MHz (24MHz) crystal, • Extended temperature ranges
58% of the instructions are executed in • OTP package available
0.75jl.S (0.5jl.S) and 40% in 1.5jl.S (1jl.S).
Multiply and divide instructins require 311S
(2jl.S).
010 +70.
PCBSOC552-5-16WP PCBS3C552-5WP/xxx SSOC552-1A68 S83C552-1 A68 SS7C552-4A68 16MHz
plastic PLCC
010 +70,
SS7C552-4K68 16MHz
ceramic CLCC with window
010 +70,
PCBSOC552-5-16H PCBS3C552-5H/xxx SSOC552-1B S83C552-1B SS7C552-4B 16MHz
plasticOFP
-4010 +85,
PCF80C552-5-16WP PCF83C552-5WP/xxx SSOC552-2A68 S83C552-2A68 SS7C552-5A68 16MHz
plastic PLCC
-4010 +85,
SS7C552-5K68 16MHz
ceramic CLCC with window
-4010 +85,
PCF80C552-5-16H PCF83C552-5H/xxx SSOC552-2B S83C552-2B SS7C552-5B 16MHz
plasticOFP
-4010+125,
PCA80C552-5-16WP PCA83C552-5WP/xxx SSOC552-6A68 S83C552-6A68 16MHz
plasticPLCC
-4010 +125,
PCA80C552-5-16H PCA83C552-5H/xxx SSOC552-6B S83C552-6B 16MHz
plaslicOFP
010 +70,
PCBSOC552-5-24WP PCBS3C552-5WP/xxx SSOC552-AA68 S83C552-AA68 24MHz
plastic PLCC
-4010 +85,
PCF80C552-5-24WP PCF83C552-5WP/xxx SSOC552-BA68 S83C552-BA68 24MHz
plastic PLCC
-4010 +85,
PCF80C552-5-24H PCF83C552-5H/xxx S80C552-BB S83C552-BB 24MHz
plasticOFP
NOTE:
1. xxx denoles the ROM code number.
~ XTAL1 _
QFP
~~L2 ~
~'PP ~ ~
-----~-"Et
.-
--:=: .::=--
LOW ORDER
A~~ ADDRESS AND
~ ~
AYSS -
AYDD _
AYref. -
--~- DATA BUS
~ ~ AVref- _
-
~
:=~~
STADe
PWIIf _
~~
FIn Function PWIIJ -
FIn Func:1lon
=: :=:
-- f:=
1 P4.1/CMSRl 41 P2.3/A11
P4.2!CMSR2 ~~
f
42 P2.41A12
3 NC 43 NC ADCO-7 _ __ _SCL
- . SDA
4 P4.3ICMSR3 44 NC
NC - not connected
IC - Intemally connected (do 001 use)
BLOCK DIAGRAM
TO, T1
TW016-81T PROGRAM DATA DUAL SERIAL
cPU MEMORY MEMORY PWM ADC
nMERIEVENT .2cPORT
COUNTERS 8l<aSROM 256aSRAM
T2 12
16-81T 16 16-81T COMPARA- T3
nMERI COMPARA- TOR ATCHDOG
EVENT TORS OUTPUT nMER
COUNTERS wtTH SELECnON
REGISTERS
CD CD m
PO P1 P2 P3 TaD RaD PS P4 CTOI-CT3I T2 R12 CMSRD-CMSRS RST 'EW
CMTD, CMT1
PIN DESCRIPTION
PIN NO.
MNEMONIC PLCC QFP TYPE NAME AND FUNCTION
Voo 2 72 I Digital Power Supply: +5V power supply pin during normal operation. idle and
power-down mode.
STADC 3 74 I Start ADC Operation: Input starting analog 10 digital conversion (ADC operation can also
be started by software).
~ 4 75 0 Pulse Width Modulation: Output o.
l'WfM 5 76 0 Pulse Width Modulation: Output 1.
~ 6 n I Enable Watchdog TImer: Enable for T3 watchdog timer and disable power-down mode.
PO.O-PO.7 57-50 58-51 1/0 Port 0: PortO is an B-bit open-drain bidirectional 110 port. Port 0 pins that have ls written
to them float and can be used as high-impedance inputs. Port 0 is also the multiplexed
low-order address and data bus during accesses to external program and data memory. In
this application it uses strong internal pull-ups when emitting 1s. Port 0 is also used to input
the code byte during programming and to output the code byte during verification.
Pl.O-Pl.7 16-23 10-17 110 Port 1 : B-bit I/O port. Alternate functions include:
16-21 10-15 110 (Pl.O-Pl.5): Quasi-bidirectional port pins.
22-23 16-17 110 (Pl.6, Pl.7): Open drain port pins.
16-19 10-13 I CTOI-CT31 (Pl.O-Pl.3): Capture timer input signals for timer T2.
20 14 I T2 (Pl.4): T2 event input.
21 15 I RT2 (Pl.5): T2 timer reset signal. Rising edge triggered.
22 16 110 SCl (Pl.6): Serial port clock line 12C-bus.
23 17 110 SDA (Pl.7): Serial port data line 12C-bus.
Port 1 is also used to input the lower order address by1e during EPROM programming and
verification. AO is on Pl.0. etc.
P2.O-P2.7 39-46 38-42, 110 Port 2: B-bit quasi-bidirectional 110 port.
45-47 Alternate function: High'Order address byte for external memory (AOB-A 15). Port 2 is also
used to input the upper order address during EPROM programming and verification. AB is
on P2.0, A9 on P2.1. through A 12 on P2.4.
P3.O-P3.7 24-31 1B-20. 110 Port 3: B-bit quasi-bidirectional 110 port. Alternate functions include:
23-27
24 lB RxD(P3.0): Serial input port.
25 19 TxD (P3.l): Serial output port.
26 20 IIiITIr (P3.2): External interrupt.
27 23 mn (P3.3): External interrupt.
2B 24 TO (P3.4): Timer 0 external input.
29 25 Tl (P3.5): Timer 1 external input.
30 26 WR (P3.6): External data memory write strobe.
31 27 ltD (P3.7): External data memory read strobe.
P4.O-P4.7 7-14 80.1-2 110 Port 4: B-bit quasi-bidirectional 110 port. Alternate functions include:
4-8
7-12 80,1-2 0 CMSRO-CMSR5 (P4.0-P4.5): Timer T2 compare and set/reset outputs on a match with
4-6 timerT2.
13,14 7,B 0 CMTO, CMT1 (P4.6, P4.7): Timer T2 compare and Ioggle outputs on a match with timer T2.
PS.O-PS.7 68-62, 71-64, I PortS: 8-bit input port.
1 ADCO-ADC7 (PS.0·P5.7): Alternate function: Eight input channels to ADC.
RST 15 9 110 Reset: Input to reset the 8XC552. It also provides a reset pulse as output when timer T3
overflows.
XTAll 35 32 I Crystal Input 1 : Input to the inverting amplifier that forms the oscillator, and input to the
internal clock generator. Receives the external clock signal when an external oscillator is
used.
XTAl2 34 31 0 Cryslalinpul 2: Output of the inverting amplifier that forms the oscillator. left open-circuit
when an external clock is used.
PSEN 47 48 0 Program Store Enable: Active-low read strobe to external program memory.
ALEIPROG 48 49 0 Address Latch Enable: Latches the low byte of the address during accesses to external
memory. It is activated every six oscillator periods. Durin(l an external data memory
access, one ALE pulse is skipped. ALE can drive up to eight LS TTL inputs and handles
CMOS inputs without an external pull-up. This pin is also the program pulse input (P"ROO)
during EPROM programming.
Ei\Npp 49 50 I External Access: When EJ\ is held at TTL level high, the CPU executes out of the internal
~rogram ROM provided the program counter is less than 8192. When EJ\ is held at TTL low
evel, the CPU executes out of external program memory. EJ\ is not allowed to float. This
pin also r~eives the 12.75V programming supply voltage (Vpp) during EPROM
programming.
OSCILLATOR RESET remain intact during this mode. The idle mode
CHARACTERISTICS A reset is accomplished by holding the RST can be terminated either by any enabled
pin high for at least two machine cycles (24 interrupt (at which time the process is picked
XTAL 1 and XTAL2 are the input and output,
respectively, of an inverting amplifier. The oscillator periods), while the oscillator is up at the interrupt service routine and
pins can be configured for use as an on-chip running. To insure a good power-on reset, the continued), or by a hardware reset which
RST pin must be high long enough to allow starts the processor in the same manner as a
oscillator, as shown in the logic symbol,
page 424. the oscillator time to start up (normally a few power-on reset.
milliseconds) plus two machine cycles. At
To drive the device from an external clock power-on, the voltage on Voo and RST must
source, XTAl1 should be driven while XTAL2 come up at the same time for a proper POWER-DOWN MODE
is left unconnected. There are no start-up. In the power-down mode, the oscillator is
requirements on the duty cycle of the external stopped and the instruction to invoke
clock signal, because the input to the internal power-down is the last instruction executed.
clock circuitry is through a divide-by-two Only the contents of the on;:;hip RAM are
IDLE MODE
flip-flop. However, minimum and maximum preserved. A hardware reset is the only way
In the idle mode, the CPU puts itself to sleep
high and low times specified in the data sheet to terminate the power-down mode. The
while all of the on-chip peripherals stay
must be observed. control bits for the reduced power modes are
active. The instruction to invoke the idle
mode is the last instruction executed in the in the special function register PCON. Table 1
normal operating mode before the idle mode shows the state of the 1/0 ports during low
is activated. The CPU contents, the on-chip current operating modes.
RAM, and all of the special function registers
0 0 0 23 47 62.5 94 256
0 0 1 27 54 71 107 1 224
0 1 0 31.25 62.5 83.3 125 1 192
0 1 1 37 75 100 150 1 160
1 0 0 6.25 12.5 17 25 960
1 0 1 50 100 133 1 200 1 120
1 1 0 100 200 267 1 400 1 60
1 1 1 0.25 <62.5 0.5 < 62.5 0.67 < 56 0.98<50 96 x (256 - (reload value Timer 1»
Timer 1 in Mode 2.
NOTE:
1. These frequencies exceed the upper limit of 100kHz of the 12C-bus specification and cannot be used in an 12C-bus application.
2. At fose =24MHz the maximum 12C bus rate of 100kHz cannot be realized due to the fixed divider rates. For fose = 24MHz the maximum rate
is limited to 94kHz.
Power dissipation (based on package heat transfer limitations, not device power 1.0 W
consumption)
NOTES:
1. Stresses above those listed under Absolute Maximum Ratings may cause permanent damage 10 the device. This is a stress rating only and
1unctional operation of the device at these or any conditions other than those described in the AC and DC Electrical Characteristics section
of this specification is not implied.
2. This product includes circuitry specifically designed for the protection of its intemal devices from the damaging effects of excessive static
charge. Nonetheless, it is suggested that conventional precautions be taken to avoid applying greater than the rated maxima.
3. Parameters are valid over operating temperature range unless otherwise specified. All voltages are with respect to Vss unless otherwise
noted.
DEVICE SPECIFICATIONS
SUPPLY VOLTAGE (V) FREQUENCY (MHz)
DC ELECTRICAL CHARACTERISTICS
Vss AVss= OV
TEST UMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
OIf8et Geln
error error
os" Ge
'023
I· ·1·· ·1
'022
.02 •
• 020
.0.9
.0.8
t
Code
7
OUt
LJ0fI0et
enor
4 .0'8 .0'9 .020 .02. .022 .023 .024
AC ELECTRICAL CHARACTERISTICS1, 2
12MHzCLOCK 16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX MIN MAX UNIT
ll1cLCL 2 Oscillator frequency3 1.2 16 MHz
It.HLL 2 ALE pulse width 127 85 21cLcL-40 ns
tAVLL 2 Address valid to ALE low 28 8 teLCL-55 ns
It.LAX 2 Address hold alter ALE low 48 28 teLCL-35 ns
It.LlV 2 ALE low to valid instruction in 234 150 4teLcL-l00 ns
Iu.PL 2 ALE low to PSEN low 43 23 teLCL-40 ns
IpLPH 2 PSEN pulse width 205 143 3teLCL-45 ns
IpLiV 2 PSEN low to valid instruction in 145 83 3teLcL-l05 ns
IpXIX 2 Input instruction hold after PSEN 0 0 0 ns
IpXlz 2 Input instruction float after PSEN 59 38 teLCL-25 ns
IAvlV 2 Address to valid instruction in 312 208 5teLCL-l05 ns
IpLAZ 2 ?SEN low to address float 10 10 10 ns
Dala Memory
IAvLL 3,4 Address valid to ALE low 43 23 teLCL-40 ns
tRLRH 3 RO" pulse width 400 275 6teLCL-l00 ns
tWLWH 4 WR pulse width 400 275 6IcLcL-l00 ns
tRLOV 3 RO" low to valid data in 252 148 5teLCL-165 ns
tRHOX 3 Data hold after RO" 0 0 0 ns
tRHOZ 3 Data float alter RO" 97 55 2teLCL-70 ns
hov 3 ALE low to valid data in 517 350 8teLCL-150 ns
tAVOV 3 Address to valid data in 585 398 9teLcL-165 ns
It.LWL 3,4 ALE low to RO" or WR low 200 300 138 238 3teLCL--50 3teLCL+50 ns
IAVWL 3,4 Address valid to WR low or RO" low 203 120 4IcLcL-I30 ns
tavwx 4 Data valid to WR transition 23 3 teLCL-<>O ns
tow 4 Data before WR 433 288 7teLcL-I50 ns
tWHoX 4 Data hold alter WR 33 13 teLcL-50 ns
tRLAZ 3 RO" low to address float 0 0 0 ns
tWHLH 3,4 RO" or WR high to ALE high 43 123 23 103 teLcL-40 IcLCL+40 ns
External Clock
teHCX 5 High time4 20 20 20 ns
teLcX 5 Lowtime4 20 20 20 ns
teLCH 5 Risetime4 20 20 20 ns
teHcL 5 Falltime4 20 20 20 ns
Serial Timing - Shift Register Mode" (Test Conditions: Tam = DoC to +70°C; Vss = OV; Load Capaciatnce = 80pF)
tXLXL 6 Serial port clock cycle time 1.0 0.75 12teLcL fls
taVXH 6 Output data setup to clock rising edge 700 492 10teLCL-133 ns
tXHQX 6 Output data hold after clock rising edge 50 8 2teLCL-117 ns
tXHOX 6 Input data hold after clock rising edge 0 0 0 ns
tXHOV 6 Clock rising edge to input data valid 700 492 IOteLCL-133 ns
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port 0, ALE, and ?SEN = 100pF, load capacitance for all other outputs = 80pF.
3. 87C552: lIteLCL = 3.5 to 16 MHz.
4. These values are characterized but not 100% production tested.
5. IcLCL = I/fosc =one oscillator clock period.
teLCL = 83.3ns at fosc = 12MHz.
teLCL = 62.5ns at fosc = 16MHz.
ALE
PORTO AG-A7
PORT 2 A8-A15
ALE
tWHLH -
i+-----lllDV -----·~I
IllWl --~---IRlRH ---~
RD ____________~--------~
IRlDV-
PORTO
AG-A7 FROM PCl INSTRIN
PORT 2
P2.0-P2.7 OR A8-A15 FROM DPH A8-A 15 FROM PCH
ALE
tWHUI-
--\4---tWlWH - - - - + I
WR-------+-----,J
lavwx
tow
PORTO OATAOUT AG-A7 FROM PCl INSTRIN
1+-----lclCl ------>-1
INSTRUCllON 2 4 8
ALE
ClOCK
-----, r- tXLXl
-1
OUTPUT DATA
RITE TO SBUF
INPUT DATA
~
CLEAR RI
t
SETRI
Rost
2.4V
2.4V=>(2.0V_
TeoIPointa
_2.0V>C r-.:.ov 2.0~
V-2.4V
o.a;-
0.45V
NOTE:
O.8V"'- - - O.8V
O.45V
NOTE:
V o.av
- O.45V
At; Inputs during testing are driven at 2.4V for a logic '1' and O.4SV for a logic '0',
Tirring measurements arB made at 2.0Vfor a logic '1' and a.eVfot a logic '0',
The float state Is defined as the point at which a pon 0 pin sinks 3.2mA or
sources 400JlA at the voltage test levels.
STOP condition
50
40 v (1)
V
30 lL:
V (2)
20
V ./ V
V V
V Vf"'"
10
./ ./"V
""- - ~
8
- f-- f--
12
t-
16
(3)
(4)
I (MHz)
Figure 10. 16MHz Version Supply Current (100) as a Function 01 Frequency at XTAL1 (Iosc)
60
(1)
50
V
V
40
/V V (2)
V V VV
100nIA 30
V
VV
VV
20
t/V
10 I~ ~ l -I--
(3)
(4)
~V r--
~ I-::: ~ ~ I-- f-
..-
=:;
4 8 12 16 20 24
I (MHz)
(1) Maximum operating mode; voo =5.SV
(2) Maximum operating mode; VOO =4.5V
NOTE: (3) Maximum idle mode; VOO = S.SV
These values are valid only within the frequency specifications of the device under test. (4) Maximum idle mode; VOO = 4.SV
Figure 11. 24M Hz Version Supply Current (I DO) as a Function 01 Frequency at XTAL1 (lose)
Pl.6 Pl.6
Pl.7 voo Pl.7 voo
RST
STADC
PO PO
RST
STADC Ell:
EW
XTAl2 (NC) XTAl2
- -
Figure 12. 100 Test Condition, Active Mode Figure 13. 100 Test Condition, Idle Mode
All other pins are disconnected 1 All other pins are dlsconnected 2
Voo
Pl.6
Pl.7 voo
RST
VOo-O·5 STADC
a· 7Voo
O.SV O.2VOo-O·l PO
XTAl2
Ell:
XTAl1
Vss
NOTES:
1. Active Mode:
a. The following pins must be forced to Voo: EA, RST, Port 0, and EW.
b. The following pins must be forced to Vss: STADe, AV", and AVref_.
c. Ports 1.6 and 1.7 should be connected to Voo through resistors of sufficiently high value such that the sink current into these pins cannot
exceed the lOll spec of these pins.
d. The following pins must be disconnected: XTAL2 and all pins not specified above.
2. Idle Mode:
a. The following pins must be forced to Voo: Port 0 and EW.
b. The following pins must be forced to Vss: RST, STADe, AV"" AVref-, and EA.
c. Ports 1.6 and 1.7 should be connected to Voo through resistors of sufficien~y high value such that the sink current into these pins cannot
exceed the lOLl spec of these pins. These pins must not have logic 0 written to them prior to this measurement.
d. The following pins must be disconnected: XTAL2 and all pins not specified above.
3. Power Down Mode:
a. The following pins must be forced to Voo: Port 0 and EW.
b. The following pins must be forced to Vss: RST, STADe, XTAL 1, AV,s" AVref-, and EA.
c. Ports 1.6 and 1.7 should be connected to Voo through resistors of sufficiently high value such that the sink current into these pins cannot
exceed the 10L 1 spec of these pins. These pins must not have logic 0 written to them prior to this measurement.
d. The following pins must be disconnected: XTAL2 and all pins not specified above.
EPROM CHARACTERISTICS addresses 0 through 1FH, using the ·Pgm Reading the Signature Bytes
The 87C552 is programmed by using a Encryption Table" levels. Do not forget that The signature bytes are read by the same
modified Quick-Pulse Programming'" after the encryption table is programmed, procedure as a normal verification of
algorithm. It differs from older methods in the verification cycles will produce only encrypted locations 030H and 031 H, except that P3.6
value used for Vpp (programming supply data. and P3.7 need to be pulled to a logic low. The
voltage) and in the width and number of the values are:
To program the lock bits, repeat the 25-pulse
ALE/PRrn; pUlses. programming sequence using the ·Pgm Lock (030H) ~ 15H indicates manufactured by
The 87C552 contains two signature bytes Bit" levels. After one lock bit is programmed, Philips Components
that can be read and used by an EPROM further programming of the code memory and
(031 H) = 94H indicates 87C552
programming system to identify the device. encryption table is disabled. However, the
The signature bytes identify the device as an other lock bit can still be programmed. ProgramNerlfy Algorithms
87C552 manufactured by Signetics. Note that the ~pp pin must not be allowed Any algorithm in agreement with the
Table 3 shows the logic levels for reading the to go above the maximum specified Vpp level conditions listed in Table 3, and which
signature byte, and for programming the for any amount of time. Even a narrow glitch satisfies the timing specifications, is suitable.
program memory, the encryption table, and above that voltage can cause permanent
the lock bits. The circuit configuration and damage to the device. The Vpp source Erasure Characteristics
should be well regulated and free of glitches Erasure of the EPROM begins to occur when
waveforms for quick-pulse programming are
and overshoot. the chip is exposed to light with wavelengths
shown in Figures 16 and 17. Figure 18 shows
shorter than approximately 4,000 angstroms.
the circuit configuration for normal program
Program Verification Since sunlight and fluorescent lighting have
memory verification.
If lock bit 2 has not been programmed, the wavelengths in this range, exposure 10 Ihe
Quick-Pulse Programming on~hip program memory can be read out for light sources over an extended lime (aboull
The setup for microcontroller quick-pulse program verification. The address of the week in sunlight, or 3 years in room level
programming is shown in Figure 16. Note that program memory locations to be red is fluorescent lighting) could cause inadvertent
the 87C552 is running with a 4 to 6MHz applied to ports 1 and 2 as shown in erasure. For Ihls and secondary effecls, il
oscillator. The reason the oscillator needs to Figure 18. The other pins are held at the Is recommended thai an opaque label be
be running is that the device is executing ·Verify Code Data" levels indicated in Table 3. placed over Ihe window. For elevated
internal address and program data transfers. The contents of the address location will be temperature or environments where solvents
emitted on port o. External pull-ups are are being used, apply Kaplon tape Fluorglas
The address of the EPROM location to be required on port 0 for this operation. part number 2345-5, or equivalent.
programmed is applied to ports 1 and 2, as
shown in Figure 16. The code byte to be If the encryption table has been programmed, The recommended erasure procedure is
programmed into that location is applied to the data presented at port 0 will be the exposure 10 ultraviolellighl (al 2537
port O. RST, !'SEN, and pins of ports 2 and 3 exclusive NOR of the program byte with one angstroms) to an integraled dose of at leasl
specHied in Table 3 are held at the ·Program of the encryption bytes. The user will have to 15W-seclcm2 . Exposing Ihe EPROM to an
Code Data" levels indicated in Table 3. The know the encryption table contents in order to ultraviolet lamp of 12,OOOflW/cm2 rating for
ALE/PRrn; is pulsed low 25 times as shown correctiy decode the verification data. The 20 10 39 minutes, at a distance of about 1
in Figure 17. encryption table itself cannot be read out. inch, should bEi sufficient. Erasure leaves Ihe
array in an all 1s slate.
To program the encryption table, repeat the
25-pulse programming sequence for
VDD
AlM7 PI PO PGIIDATA
P2.B o
XTALI P2.1J.P2.4 A8-A12
Vss
10""IIN -1 1~·----lOJUI±I0----.~. 1
o~I ______~______~rl~__________~~rl~___
Figure 17. PROG:.Waveform
+IV
VDD
AO-A7 PI PO. PGIIDATA
RST EJNpp
P3.6 Al.EII'IICG
P3.7 87C552 PSER o
XllIL2 P2.7 O'ERJIII[E
P2.& o
XTAtl P2.1J.P2.4 .A8-AI2
,,---
Vss
-
Figure 18. Program Vermedon
PROGRAMMING' VER1ACAllON'
P1.0-Pl.7 ADDRESS ADDRESS
P2.D-P2.4
AL~ ______________- ,
LOGIC 1 LOGIC 1
ElWpp
tEHQZ
P2.7
BIlrnLE
'FOR PROGRAMMING VERIFICATION SEE FIGURE 16.
FOR VERIFICATION CONDITIONS SEE FIGURE lB.
Single-chip 8-bit microcontrol/er with 8-bit AID, capture/compare timer, high-speed outputs, PWM
DESCRIPTION PIN CONFIGURATION
The 80C562183C562 (hereafter generically
II
referred 10 as 8XC562) Single-Chip 8-Bit
Microcontroller is manufactured in an
advanced CMOS process and is a derivative
of the BOC51 microcontroller family. The
83C562183C562 has the same instruction set
as the BOC51.
The 8XC562 contains a non-volatile 256 x 8
read-only program memory, a volatile 256 x 8
readlwrite data memory (83C562) (the
BOC562 is ROMless), a volatile 256 x 8 FEATURES
readlwrite data memory, six 8-bit I/O ports, • .80C51 instruction set
two 16-bit timer/event counters (identical to
.8k x 8 ROM expandable externally 10
the timers of the BOC51), an additional 16-bit
64k bytes Func:t/on Pin Function
timer coupled to capture and compare Pin
1 P5.OIADCO 35 XTAl1
latches, a 15-source, two-priority-Ievel, • 256 x 8 RAM, expandable externally to 2 36
'V"" V..
nested interrupt structure, an 8-input ADC, 64k bytes 3 STADC ~ V..
two pulse width modulated outputs, standard 4 PW!rn 39 NC
• Two standard 16-bit timer/counters 5 l'WI.n" 39 P2.OIAOB
BOC51 UART, a 'watchdog" timer and on-chip 6 EW 40 P2,1/A09
oscillator and timing circuits. For systems that • An additional 16-bit timer/counter coupled 7 P4.OICMSRO 41 P2,21A10
8 P4.1iCMRS1 42 P2.3/A11
require extra capability, the 83C562 can be to four capture registers and three compare 9 P4,2CMSR2 43 P2,41A12
expanded using standard TTL compatible registers 10 P4,3/CMSR3 44 P2,!ilA13
memories and logic. 11 P4,41CMSR4 45 P2,6/A14
• Capable of producing eight synchronized, 12 P4,!ilCMSR5 46 P2.7/A15
The device also functions as an arithmetic timed outputs 13 P4,6/CMTO 47 PSrn
14 P4,7iCMTl 48 ALE
processor having facilities for both binary and • An 8-bit ADC with eight multiplexed analog 15 RST 49 ~
BCD arithmetic plus bit-handling capabilities. 16 P1,OICT01 50 PO.7/AD7
inputs 17 P1.1iCTlI 51 PO.6/AD6
The instruction set consists of over 100 18 P1.2ICT21 52 PO.!ilAD5
instructions: 49 one-byte, 45 two-byte and 17 • Two 8-bit resolution, pulse width modulated 19 P1.3/CT31 53 PO.41AD4
three-byte. With a 12MHz crystal, 58% of the outputs 20 P1.4fT2 54 PO.3/AD3
21 P1.!ilRT2 55 PO.21AD2
instructions are executed in ljls and 40% in • Five 8-bit I/O ports plus one 8-bit input port 22 P1.6 56 PO.lIAD1
2jlS. Multiply and divide instructions require 23 P1.7 57 PO.OIAIlO
shared with analog inputs 24 P3,O/RxD 58 AVrel-
4jlS. 25 P3.1TxD 59 AVref+
• Full-duplex UART compatible with the 26 P3.2JlNTO" 00 AV..
standard 80C51 27 P3,3IIfITf 61 AV""
28 P3.4IT0 62 P5,7/ADC7
• On-chip watchdog timer 29 P3.W1 63 P5,6/ADC6
30 P3.6!WR 64 P5.!ilADC5
• Three temperature ranges 31 P3.7/RU 65 P5.41ADC4
32 NC 66 P5.3/ADC3
- 0 to +70°C 33 NC 67 P5.21ADC2
34 XTAl2 68 P5.1/ADC1
- -40 to +85°C
- -40 to + 125°C
SB7C552-4K682
o to +70, 16MHz
ceramic CLCC with window
PCF80C562-12WP PCF83C562-12WP/xxx SBOC562-2A68 S83C562-2A68 SB7C552-5A682 -40 to +85, plastic PLCC 12MHz
-40 to +85,
SB7C552-5K682 ceramic CLCC with window 12MHz
LOGIC SYMBOL
Vss
VDD
XTAL1
XTAl2
EI: LOW ORDER
ALE ADDRESS AND
l'SEJ/ DATA BUS
AVss -
AVDD
AVref+ - . .
AIIre!- -
~
STADC
PWII!I ......
...... --_ cm
CT2I
CTOI
l'WJH
~ ~ -4- CT3I
:=: ~:= ~~
ADCO-7
- {=:
:! -...
......
......
-- ~~ ......
J
~1Ij-
'" ...... Ii: =:
"'--
...... .. - HIGH ORDER
ADDRESS AND
...... 0 DATA BUS
......
cLi~ ~
..-.
~_RXD
~ --. rID
.......
+--+ COlI
~~
-+- JRTtJ
fRTf
CMTO+-
C1IT1- -. ...... ~-TD
4---)0. +- T1
RST ...... _WR
EW 4--+ -RlJ
BLOCK DIAGRAM
m m m m VDD Vss
_______ -' _________ L __ ._____ .__
.--------------....
TO,Tl
lW01_T PROGRAM DATA
MEMORY MEMORY DUAL
nMERIEVENT cPU ADC
COUNTERS 8kx8ROM 256x8 RAM PWM
(83C562)
T2 16
IS-BIT T3
DMERI WATCHDOG
EVENT DYER
COUNTERS
.OJ OJ
PO PI P2 P3 TxD RxD P5 P4 CTCI-CT3I T2 RT2 CMSRD-CMSR5 RST EW
CMTo,CMTl
PIN DESCRIPTION
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
VDD 2 I Digital Power Supply: +5V power supply pin during normal operation, idle and power-down mode.
STADC 3 I Start ADC Operation: Input starting analog to digital conversion (ADC operation can also be started
by software).
~ 4 0 Pulse Width Modulation: Output o.
PWm 5 0 Pulse Width Modulation: Output 1.
EW 6 I Enable Watchdog TImer: Enable for T3 watchdog timer and disable power-down mode.
PO.O-PO.7 57-50 I/O Port 0: Port 0 is an 8-bit open-drain bidirectional 1/0 port. Port 0 pins that have 1s written to them float
and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and data
bus during accesses to external program and data memory. In this application it uses strong internal
pull-ups when emitting 1s.
Pl.O-Pl.7 16-23 1/0 Port 1: 8-bit 1/0 port. Alternate functions include:
16-23 I/O (P1.D-P1.7): Quasi-bidirectional port pins.
16-19 I/O CTDI-CT31 (P1.D-P1.3): Capture timer input signals for timer T2.
20 I T2 (P1.4): T2 event input
21 I RT2 (P1.5): T2 timer reset signal. Rising edge triggered.
P2.O-P2.7 39-46 I/O Port 2: 8-bit quasi-bidirectional I/O port.
Alternate function: High-order address byte for external memory (AOS-AI5).
P3.O-P3.7 24-31 I/O Port 3: 8-bit quasi-bidirectional I/O port. Alternate functions include:
24 RxD(P3.D): Serial input port.
25 TxD (P3.1): Serial output port.
26 1NTlI (P3.2): External interrupt.
27 lNTf (P3.3): External interrupt.
28 TO (P3.4): TImer 0 external input.
29 T1 (P3.5): TImer 1 external input.
30 WR (P3.6): External data memory write strobe.
31 RU (P3. 7): External data memory read strobe.
P4.O-P4.7 7-14 I/O Port 4: 8-bit quasi-bidirectional I/O port. Alternate functions include:
7-12 0 CMSRD-CMSR5 (P4.D-P4.5): TImer T2 compare and set/reset outputs on a match with timer T2.
13, 14 0 CMTD, CMT1 (P4.6, P4.7): TImer T2 compare and toggle outputs on a match with timer T2.
P5.O-P5.7 68-62, I Port 5: 8-bit input port.
1 ADCD-ADC7 (P5.D-P5.7): Alternate function: Eight input channels to ADC.
RST 15 I/O Reset: Input to reset the 87C552. It also provides a reset pulse as output when timer T3 overflows.
XTAl1 35 I Crystal Input 1: Input to the inverting amplifier that forms the oscillator, and input to the internal clock
generator. Receives the external clock signal when an external oscillator is used.
XTAL2 34 0 Crystal Input 2: Output of the inverting amplifier that forms the oscillator. Left open-circuit when an
external clock is used.
Vss 36,37 I Digital ground.
PSEN 47 0 Program Store Enable: Active-low read strobe to external program memory.
ALE 48 0 Address Latch Enable: Latches the low byte of the address during accesses to external memory. II is
activated every six oscillator periods. During an external data memory access, one ALE pulse is
skipped. ALE can drive up to eight LS TTL inputs and handles CMOS inputs without an external
pull-up.
"EA 49 I External Access: When EA is held at TTL level high, the CPU executes out of the internal program
ROM provided the program counter is less than 8192. When EA is held at TTL low level, the CPU
executes out of external program memory. "EA is not allowed to float.
AV REF_ 58 I Analog to Digital Conversion Reference Resistor: Low-end.
AVREF+ 59 I Analog to Digital Conversion Reference Resistor: High-end.
AVss 60 I Analog Ground
AV DD 61 I Analog Power Supply
NOTE:
1. To avoid "latch-up" effect at power-on, the voltage on any pin at any time must not be higher or lowerthan V DD +0.5V or Vss - 0.5V,
respectively.
OSCILLATOR RESET remain intact during this mode. The idle mode
CHARACTERISTICS A reset is accomplished by holding the RST can be terminated either by any enabled
pin high for at least two machine cycles (24 interrupt (at which time the process is picked
XTAL 1 and XTAL2 are the input and output,
respectively, of an inverting amplifier. The oscillator periods), while the oscillator is up at the interrupt service routine and
pins can be configured lor use as an on-chip running. To ensure a good power-on reset, continued), or by a hardware reset which
oscillator, as shown in the logic symbol. the RST pin must be high long enough to starts the processor in the same manner as a
allow the oscillator time to start up (normally power-on reset.
To drive the device from an external clock a lew milliseconds) plus two machine cycles.
source, XTAL 1 should be driven while XTAL2 At power-on, the voltage on VDD and RST
is left unconnected. There are no must come up at the same time for a proper POWER-DOWN MODE
requirements on the duty cycle of the external start-up. In the power-down mode, the oscillator is
clock signal, because the input to the internal stopped and the instruction to invoke
clock circuitry is through a divide-by-two power-down is the last instruction executed.
flip-flop. However, minimum and maximum Only the contents of the on~hip RAM are
IDLE MODE
high and low times specified in the data sheet preserved. A hardware reset is the only way
In the idle mode, the CPU puts itself to sleep
must be observed. to terminate the power-down mode. the
while all 01 the on-chip peripherals stay
active. The instruction to invoke the idle control bits for the reduced power modes are
mode is the last instruction executed in the in the special function register PCON. Table 1
normal operating mode before the idle mode shows the state 01 the 1/0 ports during low
is activated. The CPU contents, the on-chip current operating modes.
RAM, and all of the special function registers
DC ELECTRICAL CHARACTERISTICS
Vss, AVss ~ OV
TEST UMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
Voo Supply voltage
PCBaXC562 4.0 6.0 V
PCF8XC562 4.0 6.0 V
PCAeXC562 4.5 5.5 V
100 Supply current operating: See notes 1 and 2
PCBaXC562 lose ~ 16MHz 45 rnA
PCF8XC562 lose ~ 12MHz 34 rnA
PCA8XC562 lose~ 12MHz 30 rnA
110 Idle mode: See notes 1 and 3
PCBaXC562 lose ~ 16MHz 10 rnA
PCF8XC562 lose~ 12MHz 8 rnA
PCA8XC562 lose ~ 12MHz 7 rnA
Ipo Power-down current: See notes 1 and 4;
2V < Vpo < Voo max
PCBaXC562 50 fIA
PCF8XC562 50 fIA
PCA8XC562 100 fIA
Inputs
VIL Input low voltage, except E!: -0.5 0.2Voo-O.l V
VILl Input low voltage to E!: -0.5 0.2Voo-O·3 V
VIH Input high voltage, exceptXTAL 1, RST 0. 2Voo+0.9 Voo+0.5 V
VIHl Input high voltage, XTAL 1, RST 0.7Voo Voo+0.5 V
IlL Logical 0 input current, ports 1, 2, 3, 4 VIN ~0.45V -50 fIA
ITt Logical 1-10-0 transition current, ports 1, 2, 3, 4 See note 5 -650 fIA
±11L1 Input leakage current, port 0, E!:, STADC, EW O.45V < VI < Voo 10 fIA
Outputs
VOL Output low voltage, ports 1, 2,3, 4 IOL~ 1.6mA6 0.45 V
VOLl Output low voltage, port 0, ALE, PS"EIiI", PWm, PWm IOL ~ 3.2mA6 0.45 V
VOH Output high voltage, ports 1, 2, 3, 4 Voo + 5V±10%
-loH ~ SOfIA 2.4 V
-loH ~ 25fIA 0.75Voo V
-IOH ~ 10fIA 0.9Voo V
VOHl Output high voltage (port 0 in external bus mode, ALE,
PS"EIiI", "PWm, PWmj1 Voo+5V±10%
-IOH ~ 400fIA 2.4 V
-loH ~ 150fIA 0.75Voo V
-loH ~ 40fIA O.9Voo V
VOH2 Output high voltage (RST) -loH ~ 400fIA 2.4 V
-IOH ~ 120fIA 0.8Voo V
RRST Internal reset pull-down resistor 50 150 kQ
CIO Pin capacitance Test Ireq ~ 1MHz, 10 pF
TarrIJ ~ 25°C
0ftMt GoIn
enu, error
os" Ge
255
I· ·1· ·1
254
253
252
251
250
i
Code
Out
u OIIMt
error
2 3 250 251 252 253 254
AVIN(LSBideol) -
255 256
os"
AC ELECTRICAL CHARACTERISTICS1,2
12MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
It.LWL 3,4 ALE low to RlJ or WR low 200 300 31cLcL-50 3IcLCL+50 ns
tAVWL 3,4 Address valid to WR low or RlJ low 203 41cLCL-130 ns
IcLCX 5 Lowtime3 20 20 ns
IcLCH 5 Rise time3 20 20 ns
ALE
PORTO AG-A7
PORT 2 A8-A15
ALE
tWHLH
1+-----tLLDV -----+1°1
tLLWL --~---tRLRH - - - - + I
PORTO
AG-A7 FROM PCL INSTRIN
PORT 2
P2.G-P2.7 OR A8-A15 FROM DPH A8-A15 FROM PCH
ALE , V
\--tWHLH -
~tUWl tWlWH
WR
tAVU
tLLAX
I+---- Iovwx ... ... tWHQX
tow
PORTO
=>--< FROMA~OPL ~
f.--tAVWl - - - -
OATAOUT
K M-A7 FROM PCl INSmlN
PORT 2
)< P2.0-P2.7 OR AB-AIS FROM OPH AB-AIS FROM PCH
i+------IcK - - - - - ,
=X
Roat
2.4V -2.4V
4V 2.0V_ _2.0V>C 1\..2.0V 2.o'.y
2. Test Points
O.8V...... ~O.SV
Va.8V o.si'
o.4SV - - - - - -_ _ O.4SV i'---- OASV
NOTE: NOTE:
AC Inputs during testing are driven at 2.4Vlor a logic '1' and O.45Vfor a logic '0', The float state Is defined as the point at which a port a pin sinks 3.2mA or
TIrring measurements are made at 2.0V for a logic '1' and C.SV for a logic '0', sources 400J.IA at the voltage test levels.
50
45 (1)
40
/
35 V
V
100mA 25
V
20 :L /
(2)
15 / V
V
10 V ....-V (3)
--
/ !----
/ ~
:::::
./'"
/ ~
~ I---
~
- (4)
- f--:: 12 16
I (MHz)
NOTE:
These values are valid only within the frequency specifications of the device under test.
VOD
VOO
AST
STADC
AST PO
EW
(NC) XTAl2 (NC) XTAl2 Ell:
CLOCK SIGNAL XTALI CLOCK SIGNAL XTALI
AVss
Vss
Vss AVref
STADC
Figure 9. 100 Test Condition, Active Mode Figure 10. 100 Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
VOO
VOO
AST
VOo-O·5 - - - - , - - - - . . . STADC
O.5V PO
-
(NC) XTAl2 Ell:
VSS AVref
·II
W
···· [:=5C··
:::., ::::.::-:;-::::.:: <::
• .• . . . •. •. .• . •. G'i
:): :::J/n{
.
. •. . •. •. .•. •. •. .• .• .• .• . •. .• . •. .• .• .• . •. •. •. •. •. •. .•. •. •. •. •. . .
» Purchase of Philips' 12 C components conveys a license under the
BIIS Philips' 12C patent to use the components In the 12C-system
provided the system conforms to the 12C specifications defined by Philips.
87C575 OVERVIEW there is a flag (LVF) that is set if a low voltage CPS1 CPSO PCA Timer Count Source
The Signetics B7C575 is a single chip condition is detected. The LVF flag is set o 0 1/12 oscillator frequency
microcontroller derivative of the BOC51. The even if the Low Voltage detection circuitry is o 1 1/4 oscillator frequency
B7C575 has the same instruction set and disabled. Notice that the Low voltage 1 0 Timer 0 overflow
core architecture as the industry standard detection circuitry does not drive the RST# 1 External Input at ECI pin
BOC51. The features of the B7C575 include pin so the LVF flag is the only way that the
In the CMOD SFR are three additional bits
the following: microcontroller can determine if it has been
associated with the PCA. They are CIDL
reset due to a low voltage condition.
• BK bytes EPROM which allows the PCA to stop during idle
The B7C575 has an on-chip power-on mode, WDTE which enables or disables the a
• 256 bytes RAM watchdog function on module 4, and ECF
detection circuit that sets the POF (PCON.4)
• Two standard BOC51 16-bit Timers flag on power up or if the Vee level which when set causes an interrupt and the
momentarily drops to OV. This flag can be PCA overflow flag CF (in the CCON SFR) to
• One 16-bit Timer 2 used to determine if the part is being started be set when the PCA timer overflows.
• Programmable Counter Array from a power-on (cold start) or if a reset has The watchdog timer function is implemented
occurred due to another condition (warm
in module 4 as implemented in other parts
• Watchdog Timer start). that have a PCA that are available on the
• Enhanced UART market. This industry standard PCA
Timers watchdog timer affords little in the way of
• Four Analog Comparators The B7C575 has four on-chip timers.
protection and is very cumbersome to use, so
• Low Vee Detect Circuit Timers 0 and 1 are identical in every way to it is recommended that it not be used. If a
Timers 0 and 1 on the BOC51. watchdog timer is required in the target
• Oscillator Failure Detect Circuit application use the hardware watchdog timer
Timer 2 on the B7C575 is identical to the that is implemented on the B7C575
• Schmitt Trigger Inputs BOC52 Timer 2 (described in detail in the separately from the PCA.
• Power On Reset Detection Circuit BOC52 overview) with the exception that it is
an up or down counter. To configure the The CCON SFR contains the run control bit
• Low Active Reset Timer to count down the DCEN bit in the for the PCA and the flags for the PCA timer
T2MOD special function register must be set (CF) and each module. To run the PCA the
• Asynchronous Low Port Reset
and a low level must be present on the T2EX CR bit (CCON.6) must be set by software.
• Port 2 Selectable Open Drain Output pin (Pl.l). The PCA is shut off by clearing this bit. The
CF bit (CCON. 7) is set when the PCA
• Reduced EMI mode The Watchdog timer operation and counter overflows and an interrupt will be
implementation is the same as that for the generated if the ECF bit in the CMOD register
• 40-pin DIP, 44-pin PLCC, 44-pin QFP
BXC550 (described in the BXC550 overview) is set, The CF bit can only be cleared by
with the exception that the reset values of the software. Bits 0 through 4 of the CCON
Low Active RESET WDCON and WDL special function registers register are the lIags for the modules (bit 0 for
One of the most notable features on this part have been Changed. The changes in these module 0, bit 1 for module 1, etc.) and are set
is the low active reset. At this time this is the registers cause the watchdog timer to be by hardware when either a match or a
only BOC51 derivative available that has low enabled with a timeout of 9B304 x Tose when capture occurs. These flags also can only be
active reset. This feature makes it easier to the part is reset. The watchdog can be cleared by software.
interface the B7C575 into an application to disabled by executing a valid feed sequence
accommodate the power-on and low voltage and then clearing WDRUN (bit 2 in the Each module in the PCA has a special
conditions that can occur. The low active WDCONSFR). function register associated with it. These
reset operates exactly the same as high registers are: CCAPMO for module 0,
active reset with the exception that the part is Programmable Counter Array CCAPMl for module 1, etc. The registers
put into the reset mode by applying a low contain the bits that control the mode that
(PCA)
level to the reset pin. For power-on reset it is each module will operate in. The ECCF bit
The Programmable Counter Array is a
also necessary to invert the power-on reset (CCAPMn.O where n~O, 1,2, 3, or 4
special Timer that has five 16-bit
circuit; connecting the B.2K resistor from the depending on the module) enables the CCF
capture/compare modules associated with it.
reset pin to Vee and the l0l-'f capacitor from flag in the CCON SFR to generate an
Each of the modules can be programmed to
the reset pin to ground. interrupt when a match or compare occurs in
operate in one of four modes: rising and/or
the associated module. PWM (CCAPMn.l)
When reset the port pins on the B7C575 are falling edge capture, software timer,
enables the pulse width modulation mode.
driven low asynchronously. This is different high-speed output, or pulse width modulator.
The TOG bit (CCAPMn.2) when set causes
from all other BOC51 derivatives. Each module has a pin associated with it in
the CEX output associated with the module to
port 1. Module 0 is connected to P 1.3(CEXO),
The B7C575 also has Low voltage detection toggle when there is a match between the
module 1 to P1.4(CEX1), etc.
circuitry that will, if enabled, force the part to PCA counter and the module's
reset when Vee (on the part) fails below a set The PCA timer is a common time base for all capture/compare register. The match bit MAT
level. Low Voltage Reset is enabled by a five modules and can be programmed to run (CCAPMn.3) when set will cause the CCFn
normal reset. Low Voltage Reset can be at: 1/12 the oscillator frequency, 1/4 the bit in the CCON register to be set when there
disabled by clearing LVRE (bit 5 in the oscillator frequency, the Timer 0 overflow, or is a match between the PCA counter and the
WDCON SFR) then executing a watchdog the input on the ECI pin (Pl.2). The timer module's capture/compare register. The next
feed sequency (A5H to WFEEDl followed count source is determined from the CPS 1 two bits CAPN (CCAPMn.4) and CAPP
immediately by 5A to WFEED2). In addition and CPSO bits in the CMOD SFR as follows: (CCAPMn.5) determine the edge that a
capture input will be active on. The CAPN bit Pulse Width Modulator Mode There are two special function registers
enables the negative edge, and the CAPP bit All 01 the PCA modules can be used as PWM associated with the comparators. They are
enables the positive 99ge. If both bits are set outputs. The frequency of the output depends CMP which contains the comparator enables
both edges will be enabled and a capture will on the source for the PCA timer. All of the and a bit that can be read by software to
occur for either transition. The last bit in the modules will have the same frequency of determine the state of each comparator's
register ECOM (CCAPMn.6) when set output because the all share the PCA timer. output, and CMPE which controls whether
enables the comparator function. The duty cycle of each module is the output from each comparator drives the
There are two additional registers associated independently variable using the module's associated output pin or a capture input
with each of the PCA modules. They are capture register CCAPLn. When the value of associated with one of the PCA modules.
CCAPnH and CCAPnl and these are the the PCA Cl SFR is less than the value in the
module's CCAPLn SFR the output will below, The CMP registers bits 0-3 can be read by
registers that store the 16-bit count when a software to determine the state of the output
capture occurs or a compare should occur. when it is equal to or greater than the output
will be high. The PWM and ECOM bits in the of each comparator. To do this the associated
When a module is used in the PWM mode comparator must be enabled but the output in
the CCAPnl register is used to control the module's CCAPMn register must be set to
enable the PWM mode. port 1 can be disabled. This allows easy
duty cycle of the output. polling of the comparator output value without
PeA Capture Mode Enhanced UART the need to use up a port pin.
To use one of the PCA modules in the The UART operates in all of the usual modes
capture mode either one or both of the The CMPE register allows the comparator to
that are described in the first section of this drive the associated PCA module capture
CCAPM bits CAPN and CAPP for that book for the 80C51. In addition the UART can
module must be set. The external CEX input input, so that on compare a capture can be
perform framing error detect by looking for generated in the PCA. Bits 0-3 of this
for the module (on port 1) is sampled for a missing stop bits, and automatic address
transition. When a valid transition occurs the register enable the comparator output to drive
recognition. The 87C575 UART also fully the associated port 1 output circuitry. Used as
PCA hardware loads the value of the PCA supports multiprocessor communication as
counter registers (CH and Cl) into the a comparator output this circuitry is open
does the standard 8OC51 UART. drain. To enable the comparator output to
module's capture registers (CCAPnl and
CCAPnH). If the CCFn bit for the module in When used for framing error detect the UART drive to port 1, the corresponding port bit
the CCON SFR and the ECCFn bit in the looks for missing stop bits in the must also be set to disable the pulldown. If
CCAPMn SFR are set then an interrupt will communication. A missing bit will set the FE the comparator is not enabled to drive the
be generated. bit in the SCON register. The FE bit shares port 1 circuitry, the associated port 1 pin can
the SCON.7 bit with SMO and the function of be used for other I/O. This includes when a
16-blt Software Timer Mode comparator is enabled to drive the capture
SCON.7 is determine by PCON.6 (SMODO).
The PCA modules can be used as software input to a PCA module.
If SMODO is set then SCON.7 functions as
timers by setting both the ECOM and MAT
FE. SCON.7 functions as SMO when SMODO
bits in the modules CCAPMn register. The Reduced EMI Mode
is cleared. When used as FE SCON.7 can
PCA timer will be compared to the modules There are two bits in the AUXR register that
only be cleared by software.
capture registers and when a match occurs can be set to reduce the internal clock drive .
an interrupt will occur if the CCFn (CCON Analog Comparators and disable the ALE output. AO (AUXR.O)
SFR) and the ECCFn (CCAPMn SFR) bits for The 87C575 has four analog comparators when set turns off the ALE output lO
the module are both set. on-chip. Three of these comparators have a (AUXR.l) when set reduces the drive of the
High Speed Output Mode common negative reference. These three internal clock circuitry. Both bits are cleared
In this mode the CEX output (on port 1) comparators have independent positive on Reset. With lO set the 87C575 will still
associated with the PCA module will toggle inputs. The fourth comparator has operate at 12MHz, but will have reduced EMI
each time a match occurs between the PCA independent positive and negative inputs. in the range above 100MHz.
counter and the module's capture registers.
To activate this mode. the TOG, MAT, and
ECOM bits in the module's CCAPMn SFR
must be set.
CCAPMO# Module 0 Mode DAH - ECOM CAPP CAPN MAT TOG PWM ECCF xOOOOOOOB
CCAPM1# Module 1 Mode DBH - ECOM CAPP CAPN MAT TOG PWM ECCF xOOOOOOOB
CCAPM2# Module 2 Mode DCH - ECOM CAPP CAPN MAT TOG PWM ECCF xOOOOOOOB
CCAPM3# Module 3 Mode DOH - ECOM CAPP CAPN MAT TOG PWM ECCF xOOOOOOOB
CCAPM4# Module 4 Mode DEH -' ECOM CAPP CAPN MAT TOG PWM ECCF xOOOOOOOB
OF DE DO DC DB DA 09 DB
CCON"# PCA Counter Control DBH CF CR - CCF4 CCF3 CCF2 CCFl CCFO OOxOOOOOB
CHI PCA Counter High F9H OOH
Cl# PCA Counter low E9H OOH
CMOD# PCA Counter Mode D9H CIDl WDTE - - - CPSI CPSO ECF OOxxxOOOB
EF EE ED EC EB EA E9 EB
CMP"# Comparator EBH EC3DP EC2DP ECIDP ECODP C3RO C2RO CIRO CORO OOH
CMPE# Comparator Enable 91H EC3TDC EC2TDC EC1TDC ECOTDC EC30D EC20D EC10D ECOOD OOH
B7 B6 B5 B4 B3 B2 81 BO
PO" Port 0 BOH AD7 AD6 AD5 AD4 AD3 AD2 ADI ADO FFH
97 96 95 94 93 92 91 90
PI" Port 1 90H CEX4 CEX3 CEX2 CEXI CEXO EXI T2EX T2 FFH
A7 A6 A5 A4 A3 A2 Al AD
P2" Port 2 AOH AD15 AD14 AD13 AD12 AD11 AD10 AD9 ADB FFH
B7 86 B5 B4 B3 B2 Bl BO
P3" Port 3 BOH RD WR Tl TO TfiITT INTO TxD RxD FFH
" SFRs are bit addressable.
# SFRs are modified from or added to the BOC51 SFRs.
PCON Power Control B7H SM001' SMQDO , OSF' , POF' I LVF' , GFO I PD , IDL OOxxxOOOB
D7 D6 DS D4 D3 D2 Dl DO
PSW' Program Status Word DOH CY I AC I FO I RSl I RSO I OV I - I P OOH
RACAP2H# Timer 2 Capture High CBH OOH
RACAP2L# Timer 2 Capture Low CAH OOH
CF CE CD CC CB CA C9 CB
I EXF2 I RCLK I TCLK I EXEN2 I I C/T2 I CP/RL2
T2COW
T2MOD#
Timer 2 Control
Timer 2 Mode Control
CBH
C9H
TF2
- , - I - I - I - I
TA2
- I - I DCEN
OOH
xxxxxxxOB
.
WFEED2# Watchdog Feed 2
SFRs are bit addressable.
C3H xxH
39
17 29
PART NUMBER SELECTION
ROMless ROM EPROM TEMPERATURE OC FREQ. 18 28
PBOC575EBP N
PSOC575EBAA
PS3C575EBPN
PS3C575EBAA
PS7C575EBPN
PS7C575EBAA
AND PACKAGE
16
16
. 34
PSOC575EBB B PS3C575EBBB PS7C575EBBB o to +70, plastic QFP 16 SEE NEXT PAGE FOR Lec AND aFP PIN FUNCTIONS.
n n n 0
44
H ~
34
7[ !J39 1= 0 1==33
lCC QFP
U
18 ;;; ~
12
tl
22
,
Pin function
NC
Pin
23
Function
NC ,
Pin Function
P' .5ICMPM:EX2
Pin
23
Function
P2.5IA'3
2 T2IP' .OICMPO+ 24 P2.OIAS 2 P' .6ICMP3ICEX3 24 P2.SlA'4
3 T2EXlPt 1ICMPO- 25 P2.lIA9 3 P1.7iCEX4 25 P2.7/A15
4 P'.2iECI 26 P2.21A,0 4 1lST 26 I'SEfi
5 P1.3ICMPOICEXO 27 P2.31A11 5 R,DlP3.0 27 AlElPROG
6 p, .4ICMPlICEX' 28 P2.41A'2 8 NC 28 NC
7 P'.5ICMP2ICEX2 29 P2.5IA'3 7 T,DP3.1 29 ElWpp
8 p, .6ICMP3ICEX3 30 P2.SlA'4 8 1NTO/P3.2 30 PO.7/AD7
9 P1.7iCEX4 3, P2.7/A'5 9 WIT/P3.3 31 PO.SlADe
'0 RST 32 I'SEfi 10 TO/P3.41CMPR- 32 PO.5IAD5
11 R'DlP3.0 33 AlElPROG 11 T1/P3.5ICMP1+ 33 PO.41AD4
'2 NC 34 NC 12 WR"P3.6/CMP2+ 34 PO.31AD3
'3 T,DlP3.' 35 ElWpp 13 mJ/P3.7/CMP3+ 35 PO.21AD2
'4 1NTOP3.2 36 PO.7/AD7 14 XTAl2 36 PO.lIAD1
'5 WITP3.3 37 PO.SlADe 15 XTAl1 37 PO.O/ADO
,6 TOIP3.4iCMPR- 38 PO.5IAD5 ,6 38
Vss VCC
'7 T1/P3.5ICMP1+ 39 POAIAD4 17 NC 39 NC
,8 WRiP3.SlCMP2+ 40 PO.31AD3 18 P2.0/A8 40 T2/P1.0/CMPO+
'9 lID/P3.7/CMP3+ 4' PO.2lAD2 ,9 P2.lIA9 41 T2EXlP1.1ICMPO-
20 XTAl2 42 PO.lIAD' 20 P2.21A10 42 P1.2iECI
2, XTAl1 43 PO.OIADO
2' P2.31A', 43 p, .31CM POICEXO
22 Vss 44 Vee 22 P2.4/A12 44 P'.4iCMP'
LOGIC SYMBOL
g~~~::
_0.._
-
ADDRESS AND
_ g_ DATA BUS
........ ........
~~
2 -CMPO+
- T2EX- CMPO-
RST ~ ECI
EA:Npp ~ CMPO/CEXO
~ . CMPlICEX1
l'SE'I_ CMP2ICEX2
CMP3ICEX3
5~RX~~{_
-
CEX4
~i~-'w
TxD_ _
~ ---... ~
CMPR- - +
...t: TO
...
-+ a: -+
CMP1+-;§ T1_~ -
CMP2+ _ ~ WR_ -
CMP3+_ u R1J_ ~
~
BLOCK DIAGRAM
PO.~.7 P2.0-P2.7
r--------------- ,....uCU-l.J.LI-,----------------l
I rUllU~
I
I
~
I
_ _ _ _ _ _ _ _ _ _ _ .....J
Pl.O-Pl.7 P3.0-P3.7
PIN DESCRIPTIONS
PIN NUMBER
MNEMONIC DIP LCC QFP TYPE NAME AND FUNCTION
Vss 20 22 16 I Ground: OV reference.
Vee 40 44 38 I Power Supply: This is the power supply voltage for normal, idle, and power-down
operation.
PO.O-O.7 39-32 43-36 37-B0 I/O Port 0: Port 0 is an open-drain bidirectional 110 port. Port 0 pins that have 1s written to
them float and can be used as high-impedance inputs. Port 0 is also the mUltiplexed
low-order address and data bus during accesses to external program and data memory. In
this application, it uses strong internal pull-ups when emitting 1s. Port 0 also receives code
bytes during EPROM programming and outputs code bytes during program verification.
External pull-ups are required during program verification. During reset, prot 0 will be
asynchronously driven low and will remain low until written to by software. All port 0 pins
have Schmitt trigger inputs with 200mV hysteresis. A weak pulldown on port 0 guarantees
positive leakage current (see DC Electrical Characteristics: Ill).
P1.O-P1.7 1-8 2...g 40-44 1/0 Port 1: Port 1 is an 8-bit bidirectional 1/0 port. Port 1 pins have internal pull-ups such that
1-B pins that have 1s written to them can be used as inputs but will source current when
externally pulled low (see DC Electrical Characteristics: IILl. Port 1 receives the low-order
address byte during program memory verification and EPROM programming. During reset,
port 1 will be asynchronously driven low and will remain low until written to by software. All
port 1 pins have Schmitt trigger inputs with SOmV hysteresis. Port 1 pins also serve
alternate functions as follows:
1 2 40 1/0 Pl.0 T2 TImer 2 external 1/0
CMPO+ ComparatorO positive input
2 3 41 I Pl.l T2EX Timer 2 capture input
CMPO- Comparator 0 negative input
3 4 42 I Pl.2 ECI PCA count input
4 5 43 1/0 Pl.3 CEXO PCA module 0 external 1/0
CMPO Comparator 0 output
5 6 44 1/0 Pl.4 CEXl PCA module 1 external 1/0
CMPl Comparator 1 output
6 7 1 1/0 Pl.S CEX2 PCA module 2 external 1/0
CMP2 Comparator 2 output
7 8 2 1/0 Pl.S CEX3 PCA module 3 external 1/0
CMP3 Comparator 3 output
8 9 3 1/0 Pl.7 CEX4 PCA module 4 external 1/0
P2.O-P2.7 21-28 24-B1 18-25 I/O Port 2: Port 2 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 2 pins that have 1s
written to them can be used as inputs, but will source current when externally pulled low
(see DC Electrical Characteristics: IILl. Port 2 emits the high-order address byte during
accesses to external program and data memory that use 16-bit addresses (MOVX
@DPTR). In this application, it uses strong internal pull-ups when emitting 1s. Port 2
receives the high-order address byte during program verification and EPROM programming.
During reset, port 2 will be asynchronously driven low and will remain low until written to by
software.
P3.O-P3.7 10-17 11, 5, 1/0 Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins except P3.1
13-19 7-13 that have 1s written to them can be used as inputs but will source current when externally
pulled low (see DC Electrical Characteristics: IILl. P3.1 will be a high impedance pin except
while transmitting serial data, in which case the strong pull-up will. remain on continuously
when outputting a 1 level. The P3.1 output drive level when transmitting can be set to one
of two levels by the writing to the P3.1 register bit. During reset all pins (except P3.1) will be
asynchronously driven low and will rernain low until written to by software. All port 3 pins
have Schmitt trigger inputs with 200mV hysteresis, except P3.2 and P3.3, which have
50mV hysteresis. Port 3 pins serve alternate functions as follows:
WATCHDOG TIMER ROM access), the watchdog parameters are • All other device action same as external
The watchdog timer is not directly loadable taken from the mask programmed values. If reset.
by the user. Instead, the value to be loaded the watchdog is mask programmed to the
into the main timer is held in an autoload timer mode, then the autoload values and the Note that if the watchdog underflows, the
register or is part of the mask ROM pre-scaler taps are taken from the SFRs. program counter will start from OOH as in the
programming. In order to cause the main When EA is low (external access), the case of an external reset. The watchdog
timer to be loaded with the appropriate value, watchdog parameters are taken from the time-out flag can be examined to determine if
a special sequence of software action must SFRs. The user should be able to leave code the watchdog has caused the reset condition.
take place. This operation is referred to as in his program which initializes the watchdog The watchdog time-out flag bit can be cleared
feeding the watchdog timer. SFRs even though he has migrated to the by software.
mask ROM part. This allows no code
To feed the watchdog, two instructions must When the watchdog is in the timer mode and
changes from EPROM prototyping to ROM
be sequentially executed successfully. No the timer software underflows, the following
coded production parts.
intervening instruction fetches are allowed, so action takes place:
interrupts should be disabled before feeding Watchdog Detailed Operation • Autoload takes place.
the watchdog. The instructions should move
A5H to the WFEED1 register and then 5AH EPROM Device (and ROMless Operation: • Watchdog time-out flag is set
to the WFEED2 register. If WFEEDI is EA =0) • Mode bit unchanged.
correctly loaded and WFEED2 is not correctly In the ROM less operation (ROM part, EA = 0)
loaded, then an immediate underflow will and in the EPROM device, the watchdog • Watchdog run bit unchanged.
occur. operates in the following manner. • Autoload register unchanged.
The watchdog timer subsystem has two Whether the watchdog is in the watchdog or • Prescaler tap unchanged.
modes of operation. Its principal function is a timer mode, when external RESET is applied,
watChdog timer. In this mode it protects the the following takes place: Mask ROM Device (EA 1) =
system from incorrect code execution by • Watchdog mode bit set to watchdog mode. In the mask ROM device, the watchdog mode
causing a system reset when the watchdog bit (WDMOO) is mask programmed and the
timer underflows as a result of a failure of • Watchdog run control bit set to ON. bit in the watchdog command register is read
software to feed the timer prior to the timer • Autoload register set to 00 (min. count). only and reflects the mask programmed
reaching its terminal count. If the user does selection. If the mask programmed mode bit
not employ the watchdog function, the • Watchdog time-out flag cleared. selects the timer mode, then the watchdog
watchdog subsystem can be used as a timer. • Prescaler is cleared. run bit (WDRUN) operates as described
In this mode, reaching the terminal count sets under EPROM Device. If the mask
a flag. In most other respects, the timer mode • Prescaler tap set to the highest divide. programmed bit selects the watchdog mode,
possesses the characteristics of the • Autoload takes place. then the watchdog run bit has no effect on the
watchdog mode. This is done to protect the timer operation.
integrity of the watchdog function. The watchdog can be fed even though it is in
the timer mode. Watchdog Function
The watchdog timer subsystem consists of a The watchdog consists of a programmable
prescaler and a main counter. The prescaler Note that the operational concept is for the prescaler and the main timer. The prescaler
has 8 selectable taps off the final stages and watchdog mode of operation, when coming derives its clock from the on-chip oscillator.
the output of a selected tap provides the out of a hardware reset, the software should The prescaler consists of a divide by 12
clock to the main counter. The main counter load the autoload registers, set the mode to followed by a 13 stage counter with taps from
is the section that is loaded as a result of the watchdog, and then feed the watchdog stage 6 through stage 13. The tap selection is
software feeding the watchdog and it is the (cause an autoload). The watchdog will now programmable. The watchdog main counter
section that causes the system reset be starting at a known point. is a down counter clocked (decremented)
(watchdog mode) or time-out flag to be set each time the programmableprescaler
If the watchdog is in the watchdog mode and
(timer mode) if allowed to reach its terminal underflows. The watchdog generates an
running and happens to underflow at the time
count. underflow signal (and is autoloaded) when
the external RESET is applied, the watchdog
time-out flag will be cleared. the watChdog is at count 0 and the clock to
Programming the Watchdog Timer
decrement the watchdog occurs. The
Both the EPROM and ROM devices have a When the watchdog is in the watchdog mode watchdog is 8 bits long and the autoload
set of SFRs for holding the watchdog and the watchdog underflows, the following value can range from 0 to FFH. (The
autoload values and the control bits. The action takes place: autoload value of 0 is permissible since the
watchdog time-out flag is present in the
• Autoload takes place. prescaler is cleared upon autoload).
watchdog control register and operates the
same in all versions. In the EPROM device, • Watchdog time-out flag is set This leads to the following user design
the watchdog parameters (autoload value equations. Definitions :!osc is the oscillator
• Mode bit unchanged.
and control) are always taken from the SFRs. period, N is the selected prescaler tap value,
In the ROM device, the watchdog parameters • Watchdog run bit unchanged. W is the main counter autoload value, tMIN is
can be mask programmed or taken from the the minimum watchdog time-out value (when
• Autoload register unchanged.
SFRs. The selection to take the watchdog the autoload value is 0), tMAX is the maximum
parameters from the SFRs or from the mask • Prescaler tap unchanged.
programmed values is controlled by EA
(external access). When EA is high (intemal
time-out value (when the autoload value is 12 x 64 x 12B x Iosc. The watchdog timer will CMP Register Bit Definitions
FFH), to is the design time-out value. not generate an interrupt. Additional bits in CMP.7 enable comparator 3,
WDCON are used to disable reset generation disable pullups at P3.4, P3.7
!MIN = lose x 12 x64
by the oscillator fail and low voltage detect CMP.6 enable comparator 2,
!MAX = !MIN x 12B x 256 circuits. WDCON can be written by software disable pullups at P3.4, P3.6
only by executing a valid watchdog feed CMP.5 enable comparator 1,
to = !MIN x 2PRESC Al.ER x W
sequence. disable pullups at P3.4, P3.S
(where prescaler = 0, 1, 2,3,4,5, 6, or 7)
CMP.4 enable comparator 0,
Note that the design procedure is anticipated WDCON Register Bit Definitions disable pullups at Pl.0, Pl.l
to be as follows. A !MAX will be chosen either WDCON.! PRE2 Prescaler Select 2, CMP.3 comparator 3 output (readonly)
from equipment or operation considerations resetto 1 CMP.2 comparator 2 output (readonly)
and will most likely be the next convenient WDCON.6 PREl PrescalerSelect 1, CMP.l comparator 1 output (readonly)
value higher than 10. (If the watchdog were resetto 1 CMP.O comparator 0 output (readonly)
inadvertenHy to start from FFH, an overflow WDCON.5 PREO Prescaler Select 0,
reset to 1 All comparators are disabled automatically in
would be guaranteed, barring other
WDCON.4 LVRE Low Voltage Reset power down mode, in idle mode unused
anomalies, to occur within !MAX). Then the
Enable, reset to 1 comparators should be disabled by software
value for the prescaler wl)uld be chosen from:
(enabled) to save power. A comparator can generate an
pre scaler = log2 (!MAX' (tosc x 12 x 256» - 6 WDCON.3 OFRE Oscillator Fail Reset interrupt that will terminate idle mode when
Enable, reset to 1 used to drive a PCA capture input.
This then also fixes !MIN. An autoload value
would then be chosen from: (enabled) The CMPE register contains bits to enable
WDCON.2 WDRUN Watchdog Run, each comparator to drive external output pins
W = 10 '!MIN - 1 reset to 1 (enabled) or internal PCA capture inputs. Pullups at the
The software must be written so that a feed WDCON.l WDTOF Watchdog Timeout output pins are disabled by hardware when
operation takes place every 10 seconds from Flag, reset to 0 the external comparator output is enabled.
the last feed operation. Some tradeoffs may WDCON.O WDMOD Watchdog Mode, The comparator output is wire-ORed with the
need to be made. It is not advisable to reset to 1 (watchdog corresponding port SFR bit, so the SFR bit
include feed operations in minor loops or in mode) must also be set by software to enable the
subroutines unless the feed operation is a output.
specific subroutine.
INTERNAL RESET CMPE Register Bit Definitions
Watchdog Control Register (WDCON) Internal resets generated by the power on, CMPE.7 enables comparator 3 to drive
(Bit Addressable) Address CO low voltage, and oscillator fail detect circuits CEX3
The following bits of this register are read are self timed to guarantee proper CMPE.6 enables comparator 2 to drive
only in the ROM part when EA is high: initialization of the BXC575. Reset will be held CEX2
WDMOD, PREO, PRE1, and PRE2. That is, approximately 24 oscillator periods after CMPE.5 enables comparator 1 to drive
the register will reflect the mask programmed normal conditions are detected by all enabled CEXl
values. In the ROM part with EA high, these detect circuits. Internal resets do not drive CMPE.4 enables comparator 0 to drive
bits are taken from mask coded bits and are RST but will cause missing pulses on ALE. CEXO
not readable by the program. WDRUN is read CMPE.3 enables comparator 3 output on
only in the ROM part when EA is high and P1.6 (open drain)
WDMOD is in the watchdog mode. When ANALOG COMPARATORS CMPE.2 enables comparator 2 output on
WDMOD is in the timer mode, WDRUN Pl.S (open drain)
Four analog comparators are provided on
functions normally. CMPE.l enables comparator 1 output on
chip. three comparators have a common
negative reference CMPR- and independent P1.4 (open drain)
The parameters written into WDMOD, PREO,
positive inputs CMP1+, CMP2+, CMP3+ on CMPE.O enables comparator 0 output on
PRE1, and PRE2 by the program are not
port 3. The fourth comparator has Pl.3 (open drain)
applied directly to the watchdog timer
subsystem. The watchdog timer subsystem is independent positive and negative inputs When ls are written to CMPE bits 7-4, the
direcHy controlled by a second register which CMPO+ and CMPQ.- on port 1. The CMP comparator outputs will drive the
stores these bits. The transfer of these bits register contains an output and enable bit for corresponding capture input. When 1s are
from the user register (WDMOD) to the each comparator. The CMP register is bit written to CMPE bits 3-0 the comparator
second control register takes place when the addressable and is located at SFR address output will also drive the corresponding port 1
watchdog is fed. This prevents random code EBH. pin. If the comparator s enabled to drive the
execution from direcHy foiling the watchdog capture input but not the port pin, then the
Pullups at the comparator input pins will be
function. This does not affect the operation
disabled by hardware when the comparator is port pin can be used for general purpose 110.
where these bits are taken from mask coded When a comparator output is enabled,
enabled. In addition, to make inputs high
values. pull ups at the output pin are disabled and the
impedance, the corresponding port SFR bits
must be set by software to disable the output becomes open drain.
The reset values of the WDCON and WDL
registers will be such that the timer resets to pUlidowns.
the watchdog mode with a timeout period of
Interrupt Enable (IE) Register Auxlillary Register Bit Definitions IDLE MODE
EA IE.7 enable all interrupts (AUXR=8EH) In idle mode, the CPU puts itself to sleep
EC IE.6 enable PCA interrupt AO AUXR.O ALE Off, while all of the on-chip peripherals stay
ET2 IE.5 enable Timer 2 interrupt when set turns off ALE active. The instruction to invoke the idle
ES IE.4 enable Serial 110 interrupt LO AUXR. I Low Speed, mode is the last instruction executed in the
ETI IE.3 enable Timer I interrupt reduces internal clock drive normal operating mode before the idle mode
EXI 1E.2 enable External interrupt I is activated. The CPU contents, the on-chip
ETO IE. I enable Timer 0 interrupt Port 2 Pullup Disable Register
RAM, and all of the special function registers
EXO IE.O enable External interrupt 0 (P20D = OAIH)
remain intact during this mode. The idle mode
Port 2 pullups can be disabled by writing
can be terminated either by any enabled
Interrupt Priority (IP) Register ones to P20D. Each bit in P20D controls the
interrupt (at which time the process is picked
IP.7 reserved corresponding bit in P2. P20D resets to all
up at the interrupt service routine and
PPC IP.6 PCA interrupt priority zeros enabling Port 2 pullups. Writing one to
continued), or by a hardware reset which
PT2 IP.5 Timer 2 interrupt priority a P20D bit disables pullups at the
starts the processor in the same manner as a
PS IP.4 Serial 110 interrupt priority corresponding port 2 bit making the output
power-on reset.
PTI IP.3 Timer I interrupt priority open drain.
PXI IP.2 Extemal interrupt I priority
PTO IP.I Timer 0 interrupt priority
PXO IP.O External interrupt 0 priority OSCILLATOR POWER-DOWN MODE
In the power-down mode, the oscillator is
Priortty Source Rag Vector CHARACTERISTICS stopped and the instruction to invoke
I INTO lEO 03H highest priority XTAL I and XTAL2 are the input and output, power-down is the last instruction executed.
2 TImer 0 TFO OBH respectively, of an inverting amplifier. The Only the contents of the on-chip RAM are
3 INTI lEI 13H pins can be configured for use as an on-chip preserved. The control bits for the reduced
4 TImer I TFI IBH oscillator, as shown in the Logic Symbol, power modes are in the special function
5 PCA CF,CCFn 33H page 462. register PCON. Power-down mode can be
6 SeriailiO RI,TI 23H To drive the device from an external ciock terminated with either a hardware reset or
7 TImer 2 TF2lEXF2 2BH lowest priority source, XTAL 1 should be driven while XTAL2 external interrupt. With an external interrupt
Power Control (peON) Register is left unconnected. There are no TfJ'TO or TJifIT must be enabled and
requirements on the duty cycle of the external configured as level sensitive. Holding the pin
SMODI PCON.7 double baud rate bit
SMODO PCON.6 SCON.7 access control clock signal, because the input to the internal . low restarts to oscillator and bringing the pin
clock circuitry is through a divide-by-two back high completes the exit.
OSF PCON.5 oscillator fail flag
POF PCON.4 power off flag flip-flop. However, minimum and maximum
LVF PCON.3 low voltage flag high and low times specified in the data sheet
GFO PCON.2 general purpose flag must be observed. DESIGN CONSIDERATIONS
PO PCON.I power down mode bit At power-on, the voltage on Vcc must come
IDL PCON.O idle mode bit up with mrr low for a proper start-up.
Table I shows the state of 110 ports during
low current operating modes.
Security Bit 1: When programmed, this bit has two effects on masked ROM parts:
1. External MOVC is disabled, and
2. EA# is latched on Reset.
Security Bit 2: When programmed, this bit inhibits Verify User ROM.
DC ELECTRICAL CHARACTERISTICS
Tamb= -55°C to + 125°C V ee= 5V±20"!.0, VS5= OV
TEST LIMITS
VIL Input low voltage (Ports 0, 2, 3, except 3.2, 3.3) -0.5 0.5Vcc-O.6 V
VOL Output voltage low (Ports 1, 2, 3, except 3.1 ) IOL= 1.6mA 0.45 V
VOL1 Output voltage low (Ports 0, ALE, !'SEW IOL =3.2mA 0.45 V
VOH Output voltage high (Ports 1, 2, 3, except P3.1) IOH = -1 001lA Vee-1.5 V
IOf! = -30f!A Vec-O·7 V
IOf! = -10f!A Vec-O·3 V
VOH1 Output voltage high (PortO in external bus mode, ALE, IOH =-3.2mA Vec-O·7 V
PSEN) IOH = -200f!A Vec-O·3 V
IlL Logical 0 input current (Ports 1, 2, 3, except 3.1) VIN = 0.45V -75 f!A
Logical Ho-O transition current
In. (Ports 2, 3, except 3.1, 3.2, 3.3) 4 VIN = 0.5Vee+0.8 --BOO f!A
In.l Logical Ho-O transition current (Ports 1,3.2,3.3) VIN = 0.7Vee +0.5 -450 f!A
1L1 Input leakage current (Port 0) 0.45 < VIN < Vee 2 40 IlA
112 Input leakage current (E1\:, P3.1) 0.45 < VIN < Vee -10 +10 IlA
ILe Input leakage current comparator inputs O<VIN<Vee -10 +10 IlA
lee Power supply current:? See note 6
Active mode @ 16MHzs 15 30 rnA
Idle mode@ 16MHz 5 7.5 rnA
Power-down mode 5 75 IlA
RR5T Internal reset pull-up resistor VIN =OV 50 200 k.Q
AC ELECTRICAL CHARACTERISTICS
-
Tarm --55°Cto -
+125°C Vcc --5V±20% VsS-OV1,2
VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX UNIT
1/teLCL 1 Oscillator frequency: Speed VersIons
8XC575 E 4 16 MHz
OSCF Oscillator fail detect frequency 1 3.9 MHz
TR Comparator response time 10 I'S
ItHLL 1 ALE pulse width 21cLcL-40 ns
tAvLL 1 Address valid to ALE low teLcL-13 ns
ItLAX 1 Address hold after ALE low teLCL-20 ns
1t1iV 1 ALE low to valid instruction in 4!cLcL-65 ns
ItLPL 1 ALE low to !'SEN low teLcL-13 ns
tpLPH 1 PSEN pulse width 3teLcL-2O ns
tpliV 1 PSEN low to valid instruction in 3teLCL-45 ns
tpXIX 1 Input instruction hold after PSEN 0 ns
tpXIZ 1 Input instruction float after PSEN teLcL-10 ns
tAVIV 1 Address to valid instruction in 5teLcL-55 ns
tpLAZ 1 PSEN low to address float 10 ns
Data Memory
tRLRH 2,3 'AU pulse width 6tCLCL-100 ns
tWLWH 2,3 WR pulse width 6teLCL-100 ns
tRLDV 2,3 RU low to valid data in 5tcLCL-90 ns
tRHDX 2,3 Data hold after 'AU 0 ns
tRHDZ 2,3 Data float after 'AU 2teLcL-28 ns
ItLDv 2,3 ALE low to valid data in 8tcLcL-150 ns
tAVDV 2,3 Address to valid data in 9teLCL-165 ns
ItLWL 2,3 ALE low to 'AU or WR low 3teLcL-50 3teLCL+50 ns
tAVWL 2,3 Address valid to WR low or 'AU low 4lcLCL-130 ns
tavwx 2,3 Data valid to WR transition teLCL-40 ns
tWHOX 2,3 Data hold after WR teLCL-40 ns
tRLAZ 2,3 RU low to address float 0 ns
tWHLH 2,3 RU or WR high to ALE high teLCL-40 teLCL+25 ns
External Clock
teHcx 5 High time 12 ns
teLcX 5 Low time 12 ns
teLCH 5 Rise time 20 ns
teHCL 5 Fall time 20 ns
Shift Register
tXLxL 4 Serial port clock cycle time 12teLCL ns
taVXH 4 Output data setup to clock rising edge 10lcLCL-133 ns
tXHOX 4 Output data hold after clock rising edge 2!cLCL-80 ns
tXHDX 4 Input data hold after clock rising edge 0 ns
tXHDV 4 Clock rising edge to input data valid 10teLcL-133 ns
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port 0, ALE, and PSEN = 100pF, load capacitance for all other outputs = BOpF.
3. Interfacing the 80C32152 to devices with float times up to 45ns is permitted. This limited bus contention will not cause damage to Port 0
drivers. .
ALE
PORTO AlJ-A7
PORT 2 A8-A'S
ALE
tWHLH
~-------t~DV--------~
I~WL -----'Ic-------
tRHDZ
PORT 2
P2.~7 OR A8-A.S FROM DPF AlJ-A.S FROM PCH
ALE
tWHLH -
tLlWl - - ! + - - - t W l W H ---~
WR-------------4--------~1
Iovwx
INSTRUCllON o 3 4
ALE
CLOCK
-------, r- -1
tXLXL
IovXH H i tXHQX
,OUTPUTDATA, _ _ _ _.......,...-_ _ _-... ,,______..
I ~--, ,,_ _~ ~ _ _, ,,_ _~
t
WRITE TO SBUF
INPUT DATA
~
CLEAR RI
t
SETAl
Vcc-O·5
O·7VCC
O.45V 0. 2VSS-O·l
tcLCL
VCC-O.5
0.45V
=x 0.2VCC,o·9 >C
._o.:;;2:.V~C:::c-O:....:;'':'''_ _ _ _~
VLOAD----<
VLOA[)+O·1V TIMING
REFERENCE
POINTS
V~.1V
VOl.,o.1V
NOTE: NOTE:
AC inputs during testing are driven al Vee -0,5 for a logic '1' and O.45V for a logic '0', FOf timing purposes, aport is no longer floating when a lOOmV change from load
llrring measurements are made at VIH min for a logic '1' and VIL for a logic '0', voltage occurs, and begins to 1I0at when a lOOmV change from the loaded VOH}
VOL level occurs. IOH/IoL !!±-20mA.
10 1---bL--t--;;~t----l
Vcc
Vcc r-------------,
Vcc
RST
RST
Vss Vss
Figure 9. Icc Test Condition, Active Mode Figure 10. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
VCc;--O·5 - - - - -o.7V-C-C-'
O.4SV O.2VCc;--O.1 "-----/I
Figure 11. Clock Signal Waveform for Icc Tests in Active and Idle Modes
feLcH = feHCL = Sns
Vcc
Vec
RST
(NC) XTAl2
XTAl1
Vss
EPROM CHARACTERISTICS To program the encryption table, repeat the Reading the Signature Bytes
To put the B7C575 in the EPROM 25 pulse programming sequence for The signature bytes are read by the same
programming mode, PSEN must be held high addresses 0 through 1FH, using the 'Pgm procedure as a normal verification of
during power up, then driven low with reset Encryption Table' levels. Do not forget that locations 030H and 031 H, except that P3.S
active. The B7C575 is programmed by using after the encryption table is programmed, and P3.7 need to be pulled to a logic low. The
a modified Quick-Pulse Programming T• verification cycles will produce only encrypted values are:
algorithm. It differs from older methods in the data. (030H) = 15H indicates manufactured by
value used for Vpp (programming supply Philips
To program the security bits, repeat the 25
voltage) and in the width and number of the (BOH) = 97H indicates B7C575
pulse programming sequence using the 'Pgm
ALEIP'ROG pulses. Security Bit' levels. After one security bit is ProgramNerify Algorithms
The B7C575 contains two signature bytes programmed, further programming of the Any algorithm in agreement with the
that can be read and used by an EPROM code memory and encryption table is conditions listed in Table 2, and which
programming system to identify the device. disabled. However, the other security bit can satisfies the timing specifications, is suitable.
The signature bytes identify the device as an still be programmed.
B7C575 manufactured by Philips. . Note that the EAiVpp pin must not be allowed Erasure Characteristics
to go above the maximum specified Vpp level Erasure of the EPROM begins to occur when
Table 2 shows the logic levels for reading the
for any amount of time. Even a narrow glitch the chip is exposed to light with wavelengths
signature byte, and for programming the
above that voltage can cause permanent shorter than approximately 4,000 angstroms.
program memory, the encryption table, and
damage to the device. The Vpp source Since sunlight and fluorescent lighting have
the secuity bits. The circuit configuration and
should be well regulated and free of glitches wavelengths in this range, exposure to these
waveforms for quick-pulse programming are
and overshoot. light sources over an extended time (about 1
shown in Figures 13 and 14. Figure 15 shows
week in sunlight, or 3 years in room level
the circuit configuration for normal program
Program Verification fluorescent lighting) could cause inadvertent
memory verification.
II security bit 2 has not been programmed, erasure. For this and secondary effects, It
the on-chip program memory can be read out is recommended that an opaque label be
QuiCk-Pulse Programming
for program verification. The address of the placed over the window. For elevated
The setup for microcontroller quick-pulse
program memory locations to be read is temperature or environments where solvents
programming is shown in Figure 13. Note that
applied to ports 1 and 2 as shown in are being used, apply Kapton tape Fluorglas
the B7C575 is running with a 4 to SMHz
Figure 15. The other pins are held at the part number 2345-5, or equivalent.
oscillator. The reason the oscillator needs to
'Verify Code Data' levels indicated in Table 2.
be running is that the device is executing The recommended erasure procedure is
The contents of the address location will be
internal address and program data transfers. exposure to ultraviolet light (at 2537
emitted on port o. Extemal pull-ups are
The address of the EPROM location to be angstroms) to an integrated dose of at least
required on port 0 for this operation.
programmed is applied to ports 1 and 2, as 15W-s/cm2 . Exposing the EPROM to an
II the encryption table has been programmed, ultraviolet lamp of 12,000fLW/cm2 rating for
shown in Figure 13. The code byte to be
the data presented at port 0 will be the 20 to 39 minutes, at a distance of about 1
programmed into that location is applied to
exclusive NOR of the program byte with one inch, should be sufficient.
port O. RST, PSEN and pins of ports 2 and 3
of the encryption bytes. The user will have to
specified in Table 2 are held at the 'Program Erasure leaves the array in an all 1s state.
know the encryption table contents in order to
Code Data' levels indicated in Table 2. The
correctly decode the verification data. The
ALEIP'ROG is pulsed low 25 times as shown
encryption table itsell cannot be read out.
in Figure 14.
Read signature 0 0 1 1 0 0 0 0
+5V
Vcc
AO-A7 Pl PO PGMDATA
P2.&
Vss
~1~~----------~----~----25PULS~------~------------------~·1
ALEII'IlOG:
.-----
-.j 114.---------10ilS±10---------1.1
10ilS MIN
ALEII'IlOG: o~1~__________~IlL__________~IlL___
+5V
Vcc
AO-A7 Pl PO PGMDATA
RST EJWpp
P3.& ALEIPROO
P3.7 87C575 PSEII
XTAL2 P2.7 o ENJrn[E
P2.& o
Vss
-
Figure 15. Program Verification
PROGRAMMING VERIACAll0N
P1.G-P1.7
-
P2.G-P2.4
ADDRESS ADDRESS
- tAVQV
ALEIPROO
IDVGL
IAVGL ~
--.. I-
f\ .. h
---->
-
---.
IGHDX
IGHAX
LOGIC 0
------------ -------------------------- .. -- ------_ ... _-- ------------
IEHSH
tELQ~ tEHOZ
P2.7
ENlrnI:E
·FOR PROGRAMMING VERIFICATION SEE FIGURE 13. I I
FOR VERIFICATION CONDITIONS SEE FIGURE 15.
BLOCK DIAGRAM
.------
ill ill ill ill
________________ l __ J______ J______ _
VDD Vss cVss
STA:~7_ ~ _~~rl~ol ~R:~RX~ ~ OJ
2.5V - I
TD, T1
lWOI6-BlT PROGRAM AUXlUARY DATA
cPU MEMORY MEMORY MEMORY DUAL ADC CAN
llMERlEVEHT
COUNTERS 16><8 ROM 256><8 RAM 256><8 RAM PWM
T2
THREE
16·BlT 16 16-.81T T3
llMERI COMPARATOR
COMPARATOR OUTPUT WATCHDOG
EVENT llMER
WITH SELECllON
COUNTER
REGISTERS
PIN DESCRIPTION
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
VDD 2 I Digital Power Supply: +5V power supply pin during normal operation, idle and power-down mode.
STADC 3 I Start ADC Operation: Input starting analog to digital conversion (ADC operation can also be started by
software). This pin must not float.
PWfiiIO 4 0 Pulse Width Modulation: Output o.
PWm 5 0 Pulse Width Modulation: OutpUt 1.
EW 6 I Enable Watchdog Timer: Enable for T3 watchdog timer and disable power-down mode. This pin must
not float.
PO.O-PO.7 54-47 I/O Port 0: Port 0 is an 8-bit open-drain bidirectionalI/O port. Port 0 pins that have 1s written to them float
and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and data
bus during accesses to external program and data memory. In this application it uses strong internal
pull-ups when emitting 1s. Port 0 is also used to input the code byte during programming and to output
the code byte during verification.
P1.O-Pl.7 16-21, I/O Port 1: 8-bit I/O port. Alternate functions include:
23-24
16-19 I CTOI-CT31 (Pl.0,Pl.3): Capture timer input signals for timer T2.
16-19 I INT2·INT5 (Pl.0·Pl.3): External interrupts 2-5.
20 I T2 (Pl.4): T2 event input. Rising edge triggered.
21 I RT2 (Pl.5): T2 timer reset signal. Rising edge triggered.
23 0 CTXO (Pl.6): CAN transmitter output o.
24 0 CTXl (Pl.7): CAN transmitter output 1.
Port 1 is also used to input the lower order address byte during EPROM programming and verification.
AD is on Pl.0, etc.
CVss 22 I CVss: CAN transmitter drive~ ground.
P2.0-P2.7 36-43 I/O Port 2: 8-bit quasi-bidirectional I/O port.
Alternate function: High-order address byte for external memory (A08-A 15). Port 2 is also used to input
the upper order address during EPROM programming and verification. A8 is on P2.0, A9 on P2.1,
through A 12 on P2.4.
P3.O-P3.7 25-32 I/O Port 3: 8-bit quasi-bidirectional I/O port. Alternate functions include:
25 RxD (P3.0): Serial input port.
26 TxD (P3.1): Serial output port.
27 II'ITiJ (P3.2): External internupt.
28 IRTf (P3.3): External interrupt.
29 TO (P3.4): Timer 0 external input.
30 T1 (P3.5): Timer 1 external input.
31 WR (P3.6): External data memory write strobe.
32 RD (P3.7): External data memory read strobe.
P4.0-P4.7 7-14 I/O PorI 4: 8-bit quasi-bidirectional I/O port. Alternate functions include:
7-12 0 CMSRO-CMSR5 (P4.0·P4.5): Timer T2 compare and sel/reset outputs on a match with timer T2.
13,14 0 CMTO, CMTl (P4.6, P4.7): Timer T2 compare and toggle outpuls on a match with timer T2.
P5.O-P5.7 68-62, I Port 5: 8-bit input port.
1 ADCO·ADC7 (P5.0·P5.7): Alternate function: Eight input channels to ADC.
RST 15 I/O Resel: Input to reset the 8XC592. It also provides a reset pulse as output when the watchdog timer
overflows or after a CAN wakeup from power-down.
XTALl 34 I Crystal Pin 1: Input to the inverting amplifier that forms the oscillator, and input to the internal clock
generator. Receives the external clock signal when an external oscillator is used.
XTAL2 33 0 Cryslal Pin 2: Output of the inverting amplifier that forms the oscillator. Left open-circuit when an
external clock is used.
Vss 35 I Dlgilal ground.
!'SEN 44 0 Program Slore Enable: Active-low read strobe to external program memory.
ALE/PROG 45 0 Address Latch Enable: Latches the low byte of the address during accesses to external memory. It is
activated every six oscillator periods. During an external data memory access, one ALE pulse is
skipped. ALE can drive up to eight LS TIL inputs and handles CMOS inputs without an external pull-up.
This pin is also the program pulse input (l'ROG) during EPROM programming.
The BXC592 has the same operation as the the 12B byte special function area. these can bank and the DPTR. An access to
BXC552 for all features except the CAN be addressed each in a different way. AuxRAM 0 \0 255 will not affect the ports
interface and the AuxRAM. Please reler to - Main RAM 0 to 127 can be addressed PO, P2, P3.6 and P3.7 during internal
the BXC552 section in this data handbook for dirctly and indirectly as in the BOC51. program execution.
information on the PWM outputs, AID Address pointers are RO and Rl of the An access to external Data Memory
converter, Timers 0, 1, or 2, the Watchdog selected register bank. locations higher than 255 will be performed
Timer and the UART (Sloo). - Main RAM 12B to 255 can only be with the MOVX @DPTR instructions in the
addressed indirectly. Address pointers are same way as in the BOC51 structure, so
RO and Rl of the selected register bank. with PO and P2 as data/address bus and
INTERNAL DATA MEMORY - AuxRAM 0 to 255 is indirectly addressable P3.6 and P.37 as write and read strobe
The internal Data Memory is divided into in the same way as the external Data signals. Note that these external Data
three physically separated parts: the 256 byte Memory with MOVX instructions. Address Memory locations cannot be accessed with
of Main RAM, the 256 byte of AuxRAM, and pointers are RO, Rl of the selected register RO or Rl as address pointer.
j._-------------------------------------------j,
-,,' ~ ,
ADDRESS , 2 CRXO
and
v ,
"':
-",
Inlerfoce
Management
logic A
Bit Dming
Logic
,
,
CRXl
, ,
, ,
···, 2 ,
··
CTXO
and
··, ~
Transmit
Buffer
k=h '---~
r-r-V
Transceiver
Logic
l-
··
··
CTX1
t-- ··
L
,
_____ • _______________________________________ I ··
CAN FUNCTIONAL DESCRIPTION • Guaranteed latency time for high priority The CAN Controller meets the following
messages automotive requirements:
SI01,CAN • Short message length
(Controller Area Network) • Powerful error handling capability
CAN is the definition of a high performance • Guaranteed latency time- for urgent
• Data length from 0 up to 8 bytes
communication protocol for serial data messages
communication. The 8XC592 on· chip CAN • Multicast and broadcast message facility
• Bus access priority, determined by the
Controller is a full implementation of the • Non-destructive bit-wise arbitration message identifier
CAN-protocol. With the 8XC592, powerful
local networks can be built, both for • Non-retum-to-zero (NRZ) coding/decoding • Powerful error handling capability
automotive and general industrial with bit stuffing • Configuration flexibility to allow area
environments. This results in a strongly network expansion.
• Programmable transfer rate (up to 1 Mbills)
reduced wiring harness and enhanced
NOTE:
diagnostic and supervisory capabilities. • Programmable output driver configuration
- The latency time defines the period
• Suitable for use in a wide range of between the initiation (Transmission
Features Request) and the start of the transmission
networks, including the SAE's network
• Multi-master architecture on the bus. The latency time strongly
classes A, Band C
depends on a large variety of bus-related
• Bus access priority determined by the • DMA providing high-speed on-chip data conditions. In the case of a message
message identifier exchange being transmitted on the bus and Qlll!.
distortion, the latency time can be up to
• 2032 message identifier • Bus failure management facility 149 bit times (worst case). For more
information, see the application note on
• AVoOJ2 reference voltage bit timing.
CAN Functional Overview DMA: To enable the direct transfer of a CAN Receive Buffer (RBFO, RBF1)
The 8XC592 includes all hardware modules message between the RAM and Tx- or Rx- The RBF is an interface between the SSP
necessary to implement the transfer layer Buffer, you first have to write the RAM and the CPU and stores a message received
which represents the kernel of the CAN address (location of the first message byte, from the busline. Once filled by SSP and
protocol. Refer to the block diagram (previous O.. FFH is addressable) into CANSTA; then allocated to the CPU by IMl, the buffer
page) of the CAN controller portion of the you can address the Tx- (10) resp. Rx Buffer cannot be used to store subsequently
8XC592. (~ 20) and set the DMA bit (CANADR.7). This received messages until the CPU has (read
causes an automatic evaluation of the Data and) released the buffer.
Interface Special Function Registers length Code and then a transfer 01 the whole
The data transfer between the CPU and the message via the DMA bus, which connects To reduce the requirements on the CPU, two
CAN part of the 8XC592 is done via four the CPU internal RAM with the CAN part. receive buffers (RBFO, RBF1) are
SFRs: implemented. While one RBF is allocated to
The time needed for the DMA block move is the CPU, the BSP may write to the other one.
CANADR DBH up to two instruction cycles after the DMA bit Both RBFO and RBF1 are 10 bytes long to
CANDAT DAH was set; the transfer itself is done in the hold the Descriptor (2 bytes) and the
CANCON D9H background, so the CPU can process the Data-Field (up to 8 bytes) of the message.
CANSTA D8H next instruction. An immediate access to the
To access a register of the CAN, you first
main internal RAM or to the CAN is not Bit Stream Processor (BSP)
possible. This is a sequencer controlling the data
have to store a 5-bit CAN address in
CANADR and second readlwrite CANDAT. In To order a Tx-DMA, CAN register 10 has to stream between transmit and receive buffers
the mode of auto-address-increment it is not be addressed and the DMA bit set (8AH ~ (parallel data) and the busline (serial data).
necessary to write to CANADR (see section CANADR). The DlC is expected at the RAM The BSP contains the Acceptance Filter and
"Auto Address Increment"). The function of address pointer plus 1, which was written into also controls the TCl and the EMl such that
CANCON depends on its access direction. CANSTA before. the processes of reception, arbitration,
By writing CANCON you can access the CAN transmission, and error signaling are
The Rx-DMA is very versatile. After setting performed according to the protocol. The
command register direcHy. A read access of
the RAM address, you can store an arbitrary BSP provides signals to the IMl indicating
CAN CON shows which interrupts are
Rx address in CANADR, which causes a when a message has got acceptance, when
enabled and the source of a CAN interrupt.
transfer of the message starting at the a receive buffer contains a valid message,
After reading CAN CON, all interrupt flags are
specified address from the Rx Buffer to the and also when the transmit butter is no longer
reset. CANSTA (read access) is equivalent to
CPU RAM. This allows you, e.g., to collect required after a successful transmission.
the CAN Status register. It allows you to
only the data bytes of several messages in
observe the status of the CAN. Writing
CANSTA sets the RAM address for a DMA
the RAM and process them combined. Bit Timing Logic (BTL)
access. CANSTA is implemented as a bit This block monitors the busline using the
After a successful DMA transfer, the DMA bit
addressable register for observing single (built-in) Input Comparator and handles the
is reset.
status bits. busline-related bit timing.
NOTE: After a reset of the 8XC592, the
The BTL synchronizes on a "recessive" to
Accelerated Data Transfer DMA mode is disabled, the Auto
"dominant" busline transition at the beginning
There are two features implemented in the Address Increment mode is
of a message (hard synchronization) and
8XC592 to accelerate the exchange of data enabled, and the address value
resynchronizes on further transitions during
between CAN and CPU. The auto increment contained by CANADR is four, so
the reception of a message (soft
mode provides a fast stack-like reading and to point to the first register to be
synchronization).
writing of the CAN registers, while the DMA programmed after a reset (i.e.,
mode allows you to transfer a whole the Acceptance Code register). The BTL also provides programmable time
message from or to the CPU internal main segments to compensate for the propagation
RAM. Interface Management logic delay times and phase shifts (e.g., due to
Auto Address Increment: If the Auto (IML) oscillator drifts) and to define the sampling
Increment bit (CANADR.5) is high, the The IMl interprets the commands from the time and the number of samples (one or
contents of CANADR is incremented CPU, controls the allocation of the message three) to be taken within a bit time.
automatically after any read or write access buffers Transmit Buffer (TBF), Receive Buffer
to CANDAT. For example, if you want to start o (RBFO), and Receive Buffer 1 (RBF1), and Transceiver logic (TCl)
a message, you have to address the Transmit provides interrupts and status information to The TCl controls the transmit output driver.
Buffer only one time by writing a 10 into the CPU.
CANADR and setting the Auto Increment bit. Error Management logic (EML)
After that, you may calculate databyte by Transmit Buffer (TBF) The EMl is responsible for the error
databyte and move it to CANDAT. The TBF is iln interface between the CPU confinement of the transfer-layer modules.
and the Bit Stream Processor (BSP) and is The EMl gets error announcements from
Incrementing CANADR over 31 resets the
able to store a complete message. The buffer SSP and then informs the BSP, TCl, and I Ml
Auto Increment bit automatically. about error statistics.
is written by the CPU and read by the BSP.
The TBF is 10 bytes long to hold the
Descriptor (2 bytes) and the Data-Field (up to
B bytes) of the message.
CONTROL SEGMENT AND message buffers. The Control Segment is Control Segment Layout
MESSAGE BUFFER programmed during an initialization The exchange of status, control and
down-load in order to configure command signals between the CPU and the
DESCRIPTION communication parameters (e.g., bit timing). CAN Controller is performed in the control
The CAN Controller appears to the CPU as
The communication over the CAN-bus is also segment. The layout of this segment is
an on chip memory mapped peripheral,
controlled via this segment by the CPU. A shown in Figure 1 . After an initial down-load,
guaranteeing the independent operation of
message which is to be transmitted, must be the contents of the registers Acceptance
both parts.
written to the Transmit Buffer. After a Code, Acceptance Mask, bus Timing 0 and 1
successful reception the CPU may read the and Output Control should not be changed.
Address Allocation
message from the Receive Buffer and then These registers may only be accessed when
The address area of the CAN Controller
release it for further use. the Reset Request bit in the Control Register
consists of the Control Segment and the
is set HIGH (see "Control Register").
ADDRESS
CONTROL
COMMAND
STATUS
INTERRUPT
4 ACCEPTANCE CODE
CONTROL SEGMENT
ACCEPTANCE MASK
BUS TIMING 0
BUS TIMING 1
8 OUTPUT CONTROL
TEST
10 IDENTIAER,
DESCRIPTOR
11 RTR BIT, DATA LENGTH CODE
12 BYTE 1
13 BYTE 2
14 BYTE 3
TRANSMIT BUFFER
15 BYTE 4
DATAAELD
16 BYTE 5
17 BYTE 6
18 BYTE 7
19 BYTE 8
20 IDENTIAER, IDENTIAER,
DESCRIPTOR
21 RTR BIT, DATA LENGTH CODE RTRBIT, DATA LENGTH CODE
22 BYTE 1 BYTE 1
23 BYTE 2 BYTE 2
24 BYTE 3 BYTE 3
RECEIVE BUFFER 0 OR 1
25 BYTE 4 BYTE 4
DATAAELD
26 BYTE 5 BYTE 5
27 BYTE 6 BYTE 6
28 BYTE 7 BYTE 7
29 BYTES BYTES
CR.O RR Reset Request' HIGH (present) Detection of a Reset Request results in the CAN Controller aborting
the current transmission/reception of a message entering the reset
state.
LOW (absent) On the HIGH-te-LOW transition of the Reset Request bit, the CAN
Controller returns to its normal operating state.
CR.l RIE Receive Interrupt Enable HIGH (enabled) When a message has been received without errors, the CAN
Controller transmits a Receive Interrupt signal to the CPU.
CR.2 TIE Transmit Interrupt Enable HIGH (enabled) When a message has been successfully transmitted or the transmit
buffer is accessible again, (e.g., after an Abort Transmission
command) the CAN Controller transmits a Transmit Interrupt signal
to the CPU.
CR.3 EIE Error Interrupt Enable HIGH (enabled) If the Error or Bus Status change (see status Register), the CPU
receives an Error Interrupt signal.
LOW (disabled) The CPU receives no Overrun Interrupt signal from the CAN
Controller.
CR.S RA Reference Active 2 HIGH (output) The pin REF is an AVDD12 reference output.
CR.7 - RESERVED
NOTES:
1. During an external reset (RST = HIGH) or when the Bus Status bit is set HIGH (Bus-Off), the IML forces the Reset Request HIGH (present).
During an external reset the CPU cannot set the Reset Request bit LOW (absent). Therefore, after having set the Reset Request bit LOW
(absent), the CPU must check this bit to ensure that the external reset pin is not being held HIGH (present). After the Reset Request bit is
set LOW (absent) the CAN controller will wait for:
- one occurance of the Bus-Free signal (11 recessive bits), if the preceding reset (Reset Request = HIGH) has been caused by an external
reset or a CPU initiated reset.
- 128 occurances of Bus-Free, if the preceding reset (Reset Request = HIGH) has been caused by a CAN Controller initiated Bus-Off,
before re-entering the Bus.Qn mode.
- When Reset Request is set HIGH (present), for whatever reason, the control, command, status and interrupt bits are affected, see Table 3.
Only, when Reset Request is set HIGH (present) the registers at addresses 4to 8 are accessible.
2. A modification of the bits Reference Active and Synch is only possible with Reset Request = HIGH (present). It is allOWed to set these bits
while Reset Request is changed from HIGH to Law. After an external reset (pin RST = HIGH) the Reference Active bit is set HIGH (output),
the Synch bit is undefined.
FUNCTIONAL DIAGRAM
RXO ACTIVE
RX, ACTIVE
REFERENCE ACTIVE
REF
AVOOJ2 - VOLTAGE
WAKE-UP MODE
WAKE-UP
(BUS ACTIVE SIGNAL)
, , so ,
RXO DIFFERENTIAL
CRXO WAKE-UP
.£RX, __
-~~-l ~~====~~~S~'~~~-J~-1+
RX,
o
~~-------------------------- COMPOUT
8XC592
LOW (differential) The differential signal between RXO and RX1 is used for wake up.
CMR.6 RX1A RX1 Active7 RXO RX1 See Figure 2.
Active Active
Acceptance Code Register (ACR) Acceptance Mask Register qualifies which of transmission. The synchronization jump width
The Acceptance Code Register is part of the the corresponding bits of the acceptance defines the maximum number of clock cycles
acceptance filter of the CAN Controller. This code are "relevant" or "don't care" for a bit period may be shortened or lengthened
register can be accessed (readiwrite), if the acceptance filtering. by one resynchronization:
Reset Request bit is set HIGH (present).
Acceptance Mask Register Bits 'sJW = 'sCL (2SJW. 1 + SJW.O + 1)
When a message is received which passes
the acceptance test and if there is an empty BuS Timing Register 1 (BTR1)
Receive Buffer, then the respective The contents of Bus Timing Register 1
Descriptor and Data Field (see Figure 1) are defines the length of the bit period, the
sequentially stored in this empty buffer. In the location of the sample point and the number
case that there is no empty Receive buffer, of samples to be taken at each sample point.
the Data Overrun bit is set HIGH (overrun), Description of the Acceptance Mask
This register can be accessed (readiwrite) if
see Status and Interrupt Register. When the Register Bits
the Reset Request bit is set HIGH (present).
complete message has been correctly ACCEPTANCE VALUE COMMENTS
MASK BIT
received, the following occurs: Bus Timing Register 1 Bits
AM.7to AM.O HIGH This bit position is
BTRl ADDRESS 7
• The Receive Buffer Status bit is set HIGH (don' care) -don' care" for the
(full) acceptance of a 7 6 5 4
massage. 1 1
• If the Receive Interrupt Enable bit is set SAM TSEG2.2 1 TSEG2.1 1 TSEG2.0
LOW This bit position is
HIGH (enabled), the receive Interrupt is set (relevant) "relevant" for
acceptance filtering.
3 I 2 I 1 I 0
HIGH (set). TSEG1.3 I TSEG1.2 I TSEGl.l I TSEG1.0
The Acceptance Code bits (AC.7-AC.0) and
the eight most significant bits of the Bus Timing Register 0 (BTR 0) Sampling (SAM)
message's Identifier (10.10-10.3) must be The contents of Bus Timing Register 0 BIT VALUE COMMENTS
equal to those bit positions which are marked defines the values of the Baud Rate
SAM HIGH 3 sal'q)les are taken.
relevant by the Acceptance Mask bits Prescaler (BRP) and the Synchronization (3 sa....,les)
(AM.7-AM.0). If the follOWing equation is Jump Width (SJW). This register can be LOW The bus is saO"flIed once.
satisfied, acceptance is given: accessed (readlwrite) if the Reset Request bit (1 sa....,I.)
is set HIGH (present).
[(10.10 .. 1D.3) EQUAL (AC.7 .. AC.O)] or
(AM.7 .. AM.O) = llllllllb Bus Timing Register 0 Bits SAM = LOW is recommended for high speed
IBTRO I ADDRESS 6 buses (SAE class C), while SAM = HIGH is
Acceptance Code Register Bits
recommended for slow!medium speed buses
ACR ADDRESS 4 1716151413121'10
I (class A and B) where filtering of spikes on
7 ISJW.lISJw.0IBRP.5IBRP.4IBRP.3IBRP.2IBRP.lIBRP.0
615-'413121'101 the bus-line is beneficial (see "Bit Timing
AC.7 AC.6 1AC.51 AC.4 I AC.3 I AC.2 I AC.l I AC.O I Restrictions").
Baud Rate Prescaler (BRP)
During transmission of a message which The period of the system clock 'sCL is Time Segment 1 (TSEG1) and
passes the acceptance test, the message is programmable and determines the individual Time Segment 2 (TSEG2)
also written to its own Receive Buffer. If no bit timing. The system clock is calculated TSEGl and TSEG2 determine the number of
Receive Buffer is available, Data Overrun is using the following equation: clock cycles per bit period and the location of
signaled because it is not known at the start the sample point:
of a message whether the CAN Controller will 'sCL = 2fcLK (32BRP.5 + 16BRP.4 + BBRP.3 +
4BRP.2 + 2BRP.l + BRP.O +1) tTSEGl = tSCL (BTSEG1.3 + 4TSEG1.2 +
lose arbitration and so become a receiver of 2TSEG.l + TSEG1.0 + 1)
the message. !eLK = time period of the BXC592 oscillator.
tTSEG2 = \sCL (4TSEG2.2 + 2TSEG2.1 +
Acceptance Mask Register (AMR) Synchronization Jump Width (SJW) TSEG2.0+ 1)
The Acceptance Mask Register is part of the To compensate for phase shifts between
For further information on bus timing see Bus
acceptance filter of the CAN Controller. This clock oscillators of different bus controllers,
Timing Register 0 and "Bus Timing!
register can be accessed (readlwrite) if the any bus controller must resynchronize on any
Synchronization".
Reset Request bit is set HIGH (present). The relevant signal edge of the current
Output Control Register (OCR) voltage levels on the output driver pins CTXO scheme. During recessive bits all outputs are
The Output Control Register allows, under and CTXl depend on both the driver de-activated (floating). Dominant bits are sent
software control, the set-up of different output characteristic programmed by OCTPx, alternatingly on CTXO and CTX1, i.e., the first
driver configurations. This register can be OCTNx (float, pull-up, pull-down, push-pull) dominant bit is sent on CTXO, the second is
accessed (readlwrite) if the Reset Request bit and the output polarity programmed by sent on CTX1, and the third one is sent on
is set HIGH (present). OCPOLx (see Figure 3). CTXO again, etc.
Output Control Register Bits Clock Output Mode Test Output Mode
For the CTXO pin thiS is the same as in For the CTXO pin this is the same as in
IOCR ADDRESS a
Normal Output Mode. However, the data Normal Output Mode. To measure the delay
7 6 5 I 4 I 3
I I stream to CTXl is replaced by the transmit time of the transmitter and receiver this mode
IOCTP1 OCTN1 I OCPOl1 I OCTPO I OCTNO clock (TXCLK). The rising edge of the connects the output of the input comparator
2 I 1 I 0 transmit clock (non·inverted) marks the (COMP OUT) with the input of the output
OCPOlO I OCMODE1 I OCMODEO beginning of a bit period. The clock pulse driver CTX1. This mode is used for
width is tSCl. production testing only.
If the CAN Controller is in the sleep mode BI-phase Output Mode The following two tables, Table 7 and Table 8,
(Sleep = HIGH) a recessive level is output on In contrast to Normal Output Mode the bit show the relationship between the bits of the
the CTXO and CTXl pins. If the CAN representation is time variant and toggled. If Output Control Register and the two serial
Controller is in the reset state (Reset Request the bus controllers are galvanically decoupled output pins CTXO and CTXl of the 8XC592-
= HIGH) the output drivers are floating. from the bus-line by a transformer, the bit CAN Controller, connected to the serial bus
stream is not allowed to contain a DC (see Block Diagram, page 484).
Normal Output Mode
component. This is achieved by the following
In Normal Output Mode the bit sequence
(TXD) is sent via CTXO and CTX1. The
OCTP1 OCTPO
TI'O
OCPOLO
OCPOL1 f..---i--CTXO
OCMODEil
OCMODE1 TNa
TXD OUTPUT cvss
CONTROL
TXClK
LOGIC
CVss
OCTN1 OCTNO
TRANSMIT BUFFER LAYOUT message's name, used in a receiver for transmitted/received data bytes to be O.
The global layout of the Transmit Buffer is acceptance filtering, and also determines the Nevertheless, the Data Length code must be
shown in Figure 1. This buffer serves to store bus access priority during the arbitration specified correctly to avoid bus errors, if two
a message from the CPU to be transmitted process. The lower the binary value of the CAN-controllers start a Remote Frame
by the CAN Controller. It is subdivided into Identifier, the higher the priority. this is due to transmission simultaneously.
Descriptor and Data Field. the Transmit the larger number of leading dominant bits
The range of the Data Byte Count is 0 to 8
Buffer can be written to and read from by the during arbitration.
bytes and coded as follows:
CPU.
Remote Transmission Request Data Byte Count = 8DLC.3 + 4DLC.2 +
DESCRIPTOR Bit (RTR) 2DLC.1 + DLC.O
Descriptor Byte 1 (DSCR1) Description of the RTR Bit For reasons of compatibility, no Data Byte
DSCRI ADDRESS 10 Counts other than 0,1,2, ... and 8 should be
BIT VALUE COMMENTS
used.
7 6151413121110 RTR HIGH Remote Frame will be
ID.l0 ID.9 IID.8 IID.7 IID.6 J ID.5 IID.4 IID.3 (remote) transmitted by the CAN
Controller. Data Field
The number of transferred data bytes is
LOW Data Frame will be
Descriptor Byte 2 (DSCR2) (data) transmitted by the CAN determined by the Data Length Code. the first
Controller. bit transmitted is the most significant bit of
DSCR2 ADDRESS 11
I data byte 1 at address 12.
7 61514131211101
ID.2 ID.l IID.o 1 RTR I DLC.~ DLC.~ DLC.ll DLc.ol Data Length Code (DLC)
The number of bytes (Data Byte Count) in the RECEIVE BUFFER LAYOUT
Data Field of a message is coded by the Data The layout of the Receive Buffer and the
Identifier (10) Length Code. at the start of a Remote Frame individual bytes correspond to the definitions
The Identifier consists of 11 bits (ID.10 to transmission, the Data Length Code is not given for the Transmit Buffer layout, except
ID.O) ID.1 0 is the most significant bit, which is considered due to the RTR bit being HIGH that the addresses start at 20 instead of 10
transmitted first on the bus during the (remote). This forces the number of (see Figure 1).
arbitration process. the Identifier acts as the
HANDLING OF THE CPU-CAN CANSTA to be transferred. Setting the DMA bit causes
INTERFACE Reading CANSTA is an access to the Status an automatic evaluation of the Data Length
Via the four special registers CANADR, Register of the CAN Controller. Writing to Code and then the transfer; for a TX-DMA
CANDAT, CANCON and CANSTA, the CPU CANSTA sets the address of the on-chip transfer the Data Length Code is expected at
has access to the CAN Controller and also to Main RAM (internal data memory) for a the location "RAM address + 1".
the DAM-logic. Note that CANCON and subsequent DMA transfer. CANSTA is
In order to program a TX-DMA transfer, the
CANSTA have different meanings for a read implemented as a bit-addressable readlwrite
value BAH (address 10) has to be written into
and write access. register.
CANADR. Then a complete message,
Auto Address Increment consisting of the 2-byte Descriptor and the
CANAOR Data Field (0 ... 8 bytes), starting at location
The five least significant bits CANADR.4 With the auto address increment mode a fast
stack-like reading and writing of CAN "RAM address" is transferred to the
down to CANADA.O (CANA4 ... CANAO)
Controller intemal registers is provided. "the TX-Buffer.
define the address of one of the CAN
Controller internal registers to be accessed bit CANADR.S (Autolnc) is high, the content The RX-DMA transfer is very versatile. By
via CANDAT. For instance, after an external of CANADR is incremented automatically writing a value in the range of 94H (address
hardware (e.g., power-on) reset CANADR after any read or write access to CANDAT. 20) up to 9DH (address 29) of CANADR the
contains the value 64h, and hence the CPU For instance, loading a message into the whole or a part of the received message,
accesses (readlwrite) the Acceptance Code Transmit Buffer can be done by writing 2AH starting at the specified address, is
register of the CAN Controller, via the Special into CANADR and then moving byte by byte transferred to the internal data memory. This
Function Register CANDAT. CANADR also of the message to CANDAT. allows e.g. to transfer the bytes of the Data
controls the auto address increment mode via Incrementing CANADR beyond xxllllllb Field only.
bit CANADR.S (Autolnc) and the DMA-Iogic resets the bit CANADR.S (Autolnc) After a successful DMA transfer the DMA-
via M CANADR.7 (DMA). CANADR is automatically (CANADR = XXOOOOOOb)' (and Auto Inc-) bit is reset.
implemented as a readlwrite register.
High Speed DMA During a DMA transfer the CPU can process
CAN OAT the next instruction. However, an access to
The DMA-Iogic allows to transfer a complete
The Special Function Register CAN OAT the data memory, CANADR, CAN OAT,
message (up to 10 bytes) between CAN
appears as a port to the CAN Controller'S CAN CON or CANSTA is not allowed. After
Controller and Main RAM in 2 instruction
internal register (memory location) being having set the DMA-bit, every interrupt is
cycles at maximum; up to 4 bytes are
selected by CANADA. Reading or writing disabled until the end of the transfer. Note,
transferred in 1 instruction cycle. The
CANDAT is effectively an access to that CAN that disadvantageous programming may lead
performance of the CPU is strongly enhanced
Controller intemal register, which is selected to an interrupt response time of at most 10
because this very fast transfer is don in the
by CANADA. CANDAT is implemented as a instruction cycles. The shortest interrupt
background. A DMA transfer is achieved by
read/write register. response time is achieved by using 2
first writing the RAM address (0 .. FFH) into
CANCON CANSTA and then setting the TX- or consecutive I-cycle instructions direcdy after
When reading CANCON the Interrupt RX-Buffer address in CANADR and the bit selting the DMA-bit. During the reset state
Register of the CAN Controller is accessed, CANADR.7 (DMA) simultaneously; the RAM (bit Reset Request is HIGH) a DMA transfer
while writing to CAN CON means an access address points to the location of the first byte is not possible.
to the Command Register. CAN CON is
implemented as a read/write register.
I I
t
SAMPLE POINT
• TSEG1 'TSEG2~
I
mANSMIT POINT
I
1 CLOCK CYCLE
t
SAMPLE POINT
('seLl
a) As Implemented in the 8XC592's on-chip CAN Controller.
Propagation Delay Time (tpROP) Controller synchronizes on the first incoming • To increase a bit period by the amount of
The propagation delay time is calculated by recessive-to-dominant edge of a message IsJw, if the phase error is positive and the
summing the maximum propagation delay (being the leading edge of a message's magnitude of the phase error is larger than
times of the physical bus, the input Start-Of-Frame bit). IsJW;
comparator and the output driver. The • To decrease a bit period by the amount of
resulting sum is multiplied by 2 and then Resynchronlzation
IsJW, if the phase error is negative and the
rounded up to the nearest multiple of tSCl. Resynchronization occurs during the
magnitude of the phase error is larger than
transmission of a message's bit stream to
!PROP = 2 x (physical bus delay compensate for: tSJw·
+ input comparator delay Synchronization Rules
• Variations in individual CAN Controller
+ output driver delay)
oscillator frequencies; The synchronization rules are as follows:
Bit Timing Restrictions • Changes introduced by SWitching from one • Only one synchronization within one bit
Restrictions on the configuration of the bit transmitter to another (e.g., during time used.
timing are based on internal processing. The arbitration). • An edge is used for synchronization only if
restrictions are: As a result of resynchronization, either tTSEGl the value detected at the previous sample
• tTSEG2 2: 21scl may be increased by up to a maximum of point differs from the bus value immediately
after the edge.
• tTSEG2 2: IsJW tSJW, or tTSEG2 may be decreased by up to a
maximum of tSJw: • Hard synchronization is performed
• tTSEGl 2: tTSEG2
whenever there is a recessive-to-dominant
• tTSEGl 2: IsJW + tpROP • tTSEGl ~ tSCl [(TSEG1 + 1) + (SJW + 1)1
edge during Bus-Idle.
• tTSEG22: tscd(TSEG2 + 1) - (SJW + 1)1
The three sample mode (SAM = 1) has the • All other edges (recessive-to-dominant and
effect of introducing a delay of one system NOTE: TSEG1, TSEG2 and SJW are the optionally dominant-to-recessive edges if
clock cycle on the bus-line. This must be programmed numerical values. the Synch bit is set HIGH) which are
taken into account for the correct calculation candidates for resynchronization will be
The phase error (e) of an edge is given by the
of TSEG1 and TSEG2: used with the following exception:
position of the edge relative to SYNCSEG,
• tTSEGl 2: IsJW + tpROP + 2tscl - A transmitting CAN Controller will not
measured in system clock cycles (tscd. The
perform a resynchronization as a result
• tTSEG2 2: 31scl value of the phase error is defined as:
of a recessive-to-dominant edge with
• e = 0, if the edge occurs within SYNCSEG positive phase error, if only these edges
Synchronization
Synchronization is performed by a state • e > 0, if the edge occurs within TSEG1 are used for resynchronization. this
machine which compares the incoming edge • e < 0, if the edge occurs within TSEG2. ensures that the delay times of the
with its actual bit timing and adapts the bit output driver and input comparator do
The effect of resynchronization is:
timing by hard synchronization or not cause a permanent increase in the
• The same as that of a hard . bit time.
resynchronization.
synchronization, if the magnitude of the
Hard Synchronization phase error (e) is less or equal to the
This type of synchronization occurs only at programmed value of IsJw;
the beginning of a message. The CAN
INTER.fRAME
SPACE
.1. DATA FRAME .1. INTER.fRAME SPACE
OR OVERLOAD FRAME
II 11111111111111111111111111111111111111111111111 II
I I
I
ll\S\\\\\\\\~ ~1111V IVIIIIIIIIIIIIZ/J ~
I - RECESSIVE LEVEL
I
l I 1 DOIlNANT LEVEL
START.of.l'RAME
t
ARBlTRAllON RELD: -0
IDENTIFIER
RTRBIT
......-.. -
ACKNOWLEDGE RELD: .....
DATARELD:
OT08BYTES
-CRCAELD:-
ACKSET
ACK DELIMITER
~~FRAM~
CONTROL FIELD: CRC SEQUENCE
RESERVED BITS CRC DELIM ITER
DATA LENGTH CODE
Acknowledge Field (ACK) Remote Frame an Active Error Flag. This Error Flag's form
The Acknowledge Field consists of two bits, A CAN Controller acting as a receiver for violates the bit-stuffing rule applied to all
the Acknowledge Slot and the Acknowledge certain information may initiate the fields, from Start-of-Frame to CRC Delimiter,
Delimiter, which are transmitted with a transmission of the respective data by or destroys the fixed form of the fields
recessive level by the transmitter of the Data transmitting a Remote Frame to the network, Acknowledge Freid or End-of-Frame.
Frame. All CAN Controllers having received addressing the data source via the Identifier Consequently, all other CAN Controllers
the matching CRC Sequence, report this by and setting the RTR bit HIGH (remote; detect an error condition and start
overwriting the transmitter's recessive bit in recessive bus level). The Remote Frame is transmission of an Error Flag. Therefore the
the Acknowledge Slot with a dominant bit. similar to the Data Frame with the following sequence of dominant bits, which can be
Thereby a transmitter, still monitoring the bus exceptions: monitored on the bus, results from a
level recognizes that at least one receiver superposition of different Error Flags
• RTR bit is set HIGH
within the network has received a complete transmitted by individual CAN Controllers.
and correct message (i.e., no error was • Data Length Code is ignored The total length of this sequence varies
found). The Acknowledge Delimiter • No Data Field contained between six (minimum) and twelve
(recessive bit) is the second bit of the Note that the value of the Data Length Code (maximum) bits.
Acknowledge Field. As a result, the should be the one of the corresponding Data An error-passive CAN Controller detecting an
Acknowledge Slot is surrounded by two Frame, although it is ignored for a Remote error condition tries to signal this by
recessive bits: the CRC Delimiter and the Frame. transmission of a Passive Error Flag. The
Acknowledge Delimiter.
A Remote Frame is composed of six different error-passive CAN Controller waits for six
All nodes within a CAN network may use all bit fields: consecutive bits with identical polarity,
the information coming to the network by all beginning at the start of the Passive Error
• Start-of-Frame
CAN Controllers (shared memory concept). Flag. The Passive Error Flag is complete
Therefore, acknowledgement and error • Arbitration Field when these six identical bits have been
handling are defined to provide all information • Control Field detected.
in a consistent way throughout this shared • CRC Field
memory. Hence, there is no reason to • Acknowledge Field Error Delimiter
discriminate different receivers of a message The Error Delimiter consists of eight
• End-of-Frame recessive bits and has the same format as
in the acknowledge field. If a node is
disconnected from the neiwork due to bus Error Frame the Overload Delimiter. After transmission of
failure, this particular node is no longer part of an Error Flag, each CAN Controller monitors
The Error Frame consists of two different
the shared memory. To identify a "lost node" fields. The first field is accomplished by the the bus-line until it detects a transition from a
additional and application specific superimposing of Error Flags contributed dominant-to-recessive bit level. At this point
precautions are required. from different CAN Controllers. in time, every CAN Controller has finished
sending its Error Flag and has additionally
End..()f-Frame The second field is the Error Delimiter. sent the first out of the 8 recessive bits of the
Each Data Frame or Remote Frame is Error Delimiter. Afterwards all CAN
delimited by the End-of-Frame bit sequence Error Flag Controllers transmit the remaining recessive
which consists of seven recessive bits There are two forms of an Error Flag: bits. After this event and an Intermission Field
(exceeds the bit stuff width by two bits). • Active Error Flag, consists of six all error-active CAN Controllers within the
Using this method a receiver detects the end consecutive dominant bits network can start a transmission
of a frame independent of a previous • Passive Error Flag, consists of six simultaneously.
transmission error because the receiver consecutive recessive bits unless it is
overwritten by dominant bits from other If a detected error is signaled during
expects all bits up to the end of the CRC
CAN Controllers. transmission of a Data Frame or Remote
Sequence to be coded by the method of
Frame, the current message is spoiled and a
bit-stuffing. The bit-stuffing logic is An error-active CAN Controller detecting an retransmission of the message is initiated.
deactivated during the End-of-Frame error condition signals this by transmission of
sequence.
If a CAN Controller monitors any deviation of Controllers start simultaneously transmitting first and the RTR bit last. The message with
the Error Frame, a new Error Frame will be seven more recessive bits. the lowest binary value of the Identifier and
transmitted. Several consecutive Error RTR bit has the highest priority. A Data
Frames may result in the CAN Controller Inter-Frame Space Frame has higher priority than a Remote
becoming error-passive and leaving the Data Frames and Remote Frames are Frame due to its RTR bit having a dominant
network unblocked. separated from preceding frames (all types) level.
by an Inter-Frame Space, consisting of an
In order to terminate an Error Flag correctly, For every Data Frame there is an unique
Intermission Field and a Bus-Idle.
an error-passive CAN Controller requires the transmitter. For reasons of compatibility with
Error-passive CAN Controllers also send a
bus to be Bus-Idle for at least three bit other CAN-bus controllers, use of the
Suspend Transmission after transmission of a
periods (if there is a local error at an Identifier bit pattern ID = lllllllXXXXt, (X
message. Overload Frames and Error
error-passive-receiver). Therefore a CAN bus being bits of arbitrary level) is forbidden.
Frames are not preceded by an Inter-Frame
should not be permanenHy loaded.
Space. The number of available different Identifiers is
Overload Frame 2032 (2" - 24 ).
Intermission Field
The Overload Frame consists of two fields, The Intermission Field consists of three Coding I Decoding
the Overload Flag and the Overload recessive bits. During an Intermission period, The following bit fields are coded using the
Delimiter. There are two conditions in the no frame transmissions will be started by the bit-stuffing technique:
CAN protocol which lead to the transmission BXC592's on chip CAN Controller. An • Start-of-Frame
of an Overload Flag: Intermission is required to have a fixed time
• Arbitration Field
• Condition 1; receiver circuitry requires period to allow a CAN Controller to execute
more time to process the current data internal processes prior to the next receive or • Control Field
before receiving the next frame (receiver transmit task. • Data Field
not ready) • CRC Sequence
Bus-Idle
• Condition 2; detection of a dominant bit
The Bus-Idle time may be of arbitrary length When a transmitting CAN Controller detects
during Intermission Field.
(minimum 0 bit). The bus is recognized to be five consecutive bits of identical polarity to be
The transmission of an Overload Frame may free and a CAN Controller having information transmitted, a complementary (stuff) bit is
only start: to transmit may access the bus. The inserted into the transmitted bit-stream.
• Condition 1; during the first bit period of an detection of a dominant bit level during When a receiving CAN Controller has
expected Intermission Field Bus-Idle on the bus is interpreted as the monitored five consecutive bits with identical
• Condition 2; one bit period after detecting Start-of-Frame. polarity in the received bit streams of the
the dominant bit during Intermission Field above described bit fields, it automatically
Bus Organization deletes the next received (stuff) bit. The level
The BXC592's on chip CAN Controller will Bus organization is based on five basic rules
never initiate transmission of a condition of the deleted stuff bit has to be the
described in the following paragraphs.
l-Overload Frame and will only react on a complement of the previous bits; otherwise a
transmitted condition 2 Overload Frame, Bus Access Stuff Error will be detected and signaled.
according to the CAN protocol. No more than CAN Controllers only start transmission The remaining bit fields or frames are of fixed
two Overload Frames are generated to delay during the Bus-Idle state. All CAN Controllers form and are not coded or decoded by the
a Data Frame or a Remote Frame. Although synchronize on the leading edge of the method of bit-stuffing.
the overall from of the Overload Frame Start-of-Frame (hard synchronization).
corresponds to that of the Error Frame, an The bit-stream in a message is coded
Overload Frame does not initiate or require Arbitration according to the Non-Return-to-Zero (NRZ)
the retransmission of the preceding frame. If two or more CAN Controllers method, i.e., during a bit period, the bit level
simultaneously start transmitting, the bus is held constant, either recessive or
Overload Flag access conflict is solved by a bit-wise dominant.
The Overload Flag consists of six dominant arbitration process during transmission of the
bits and has a similar format to the Error Arbitration Field. Error Signaling
Flag. A CAN Controller which detects an error
During arbitration every transmitting CAN condition, transmits an Error Flag. Whenever
The Overload Flag's form corrupts the fixed Controller compares its transmitted bit level a Bit Error, Stuff Error, Form Error or an
form of the Intermission Field. All other CAN with the monitored bus level. Any CAN Acknowledgement Error is detected,
Controllers detecting the overload condition Controller which transmits a recessive bit and transmission of an Error Flag is started at the
also transmit an Overload Flag (condition 2). monitors a dominant bus level immediately next bit. Whenever a CRC Error is detected,
becomes the receiver of the higher-priority transmission of an Error Flag starts at the bit
Overload Delimiter message on the bus without corrupting any following the Acknowledge Delimiter, unless
The Overload Delimiter consists of eight information on the bus. Each message an Error Flag for another error condition has
recessive bits and takes the same form as contains an unique Identifier and a RTR bit already started. An Error Flag violates the
the Error Delimiter. After transmission of an describing the type of data within the bit-stuffing or corrupts the fixed form bit fields.
Overload Flag, each CAN Controller monitors message. The Identifier together with the A violation of the bit-stuffing law affects any
the bus-line until it detects a transition from a RTR bit implicitly define the message's bus CAN Controller which detects the error
dominant-to-recessive bit level. At this point access priority. During arbitration the most condition. These devices will also transmit an
in time, every CAN Controller has finished significant bit of the Identifier is transmitted Error Flag.
sending its Overload Flag and all CAN
An error-passive CAN Controller which monitored is different from the transmitted 1. The destuffed bit stream consisting of
detects an error condition, transmits a one, a Bit Error is signaled. The exceptions Start-of-Frame up to the Data Field (if
Passive Error Flag. A Passive Error Flag is being: present) is interpreted as polynomial with
not able to interrupt a current message at • During the Arbitration Field, a recessive bit coefficients 0 or 1.
different CAN Controllers but this type of can be overwritten by a dominant bit. In 2. This polynomial is divided (modulo-2) by
Error Flag may be ignored (overwritten) by this case, the CAN Controller interprets this
the following generator polynomial, which
other CAN Controllers. After having detected as a loss of arbitration.
includes a parity check:
an error condition, an err~r-passive CAN • During the Acknowledge Slot, only the
Controller will wait for six consecutive bits receiving CAN Controllers are able to fIX) = (X14 + X9 + XB + X6 + X5 + X4 + X2
with identical polarity and when monitoring recognize a Bit Error. + X + 1) (X + 1) = ll0001011001100lb.
them, interpret them as an Error Flag.
Stuff Error 3. The remainder of this polynomial division
After transmission of an Error Flag, each
The following bit fields are coded using the is the CRC sequence.
CAN Controller monitors the bus-line until it
bit-stuffing technique:
detects a transition from a
• Start-of-Frame Burst errors are detected up to a length of 15
dominant-to-recessive bit level. At this point
• Arbitration Field [degree of fIX)]. Multiple errors (number of
in time, every CAN Controller has finished
disturbed bits at least d=6) are not detected
transmitting its Error Flag and all CAN • Control Field
with a residual error probability of
Controllers start transmitting seven additional • Data Field
Z-15 (=3.10-5) by CRC check only.
recessive bits.
• CRC Sequence
The message format of a Data Frame or Form Error
There are two possible ways of generating a
Remote Frame is defined in such a way that Form Errors result from violations of the fixed
Stuff Error:
all detectable errors can be signaled within form of the following bit fields:
• A disturbance generates more than the
the message transmission time and therefore • CRC Delimiter
allowed five consecutive bits with identical
it is very simple for the CAN Controllers to • Acknowledge Delimiter
polarity. These errors are detected by all
associate an Error Frame to the
CAN Controllers. • End-of-Frame
corresponding message and to initiate
• A disturbance falsifies one or more of the • Error Delimiter
retransmission of the corrupted message.
five bits preceding the stuff bit. This error • Overload Delimiter
If a CAN Controller monitors any deviation of situation is not recognized as a Stuff Error
the fixed form of an Error Frame, it transmits by the receivers. Therefore, other error During the transmission of these bit fields an
a new Error Frame. detection processes may detect this error error condition is recognized if a dominant bit
condition such as: CRC check, format level instead of a recessive one is detected.
Overload Signaling violation at the receiving CAN Controllers
Some CAN Controllers (but not the one Acknowledgement Error
or Bit Error detection by the transmitting
on-chip of the 8XC592) require to delay the This is detected by a transmitter whenever it
CAN Controller.
transmission of the next Data Frame or does not monitor a dominant bit during the
Remote Frame by transmitting one or more CRC Error Acknowledge Slot.
Overload Frames. The transmission of an To ensure the validity of a transmitted
Error Detection by an Error Flag of
Overload Frame must start during the first bit message all receivers perform a CRC check.
another CAN Controller
of an expected Intermission Field. Therefore, in addition to the (destuffed)
The detection of an error is signaled by
Transmission of Overload Frames which are information digits (Start-of-Frame up to Data
transmitting an Error Flag. An Active Error
reactions on a dominant bit during an Field), every message includes some oontrol
Flag causes a Stuff Error, a Bit Error or a
expected Intermission Field, start one bit after digits (CRC Sequence; generated by the
Form Error at all other CAN Controllers.
this event. transmitting CAN Controller of the respective
message) used for error detection. Error Detection Capabilities
Though the format of Overload Frame and
The oode used by all CAN Controllers is a Errors which occur at all CAN Controllers
Error Frame are identical, they are treated
(shortened) BCH code, extended by a parity (global errors) are 100% detected. For local
differently. Transmission of an Overload
check and has the following attributes: errors, i.e., for errors occurring at some CAN
Frame during Intermission Field does not
Controllers only, the shortened BCH code,
initiate the retransmission of any previous • 127 bits as maximum length of the code
extended by a parity check, has the following
Data Frame or Remote Frame. • 112 bits as maximum number of
error detection capabilities:
information digits (maximum 83 bits are
If a CAN Controller which transmitted an • Up to five single Bit Errors are 100%
used by the CAN Controller)
Overload Frame monitors any deviation of its detected, even if they are distributed
fixed form, it transmits an Error Frame. • Length of the CRC Sequence amounts to
randomly within the code
15 bits
• All single Bit Errors are detected if their
Error Detection • Hamming distance d=6.
total number (within the code) is odd
The processes described in the following
As a result, (d-l) random errors are • The residual error probability of the CRC
paragraphs are implemented in the 8XC592's
detectable (some exceptions exist). check amounts to 3.10-5.
on-chip CAN Controller for error detection.
The CRC Sequence is determined
Bit Error (calculated) by the following procedure.
A transmitting CAN Controller monitors the
bus on a bit-bY-bit basis. If the bit level
Error Confinement (definitions) Controller will become the receiver of this reacts with a high probability the quickest
message; otherwise being in Bus-Idle it may (i.e., becomes error-passive or Bus-Off).
Bus-Off start to transmit a further message. Hence errors can be localized and their
A CAN Controller which has too many influence on normal bus activities is
unsuccessful transmissions, relative to the Start-Up minimized.
number of successful transmissions, will A CAN Controller which either was switched
enter the Bus-Off state. It remains in this off or is in the Bus-Off state, must run a Error Confinement
state, neither receiving nor transmitting Start-Up routine in order to: All CAN Controllers contain a Transmit Error
messages until the Reset Request bit is set • Synchronize with other available CAN Counter and a Receive Error Counter, which
LOW (absent) and both Error Counters set Controllers before starting to transmit. registers errors during the transmission and
toO. Synchronization is achieved, when 11 the reception of messages, respectively.
recessive bits, equivalent to Acknowledge
Acknowledge (ACK) If a message is transmitted or received
Delimiter, End-of-Frame and Intermission
A CAN Controller which has received a valid correctly, the count is decreased. In the event
Field, have been detected (Bus-Free).
message correctly, indicates this to the of an error, the count is increased. The Error
• Wait for other CAN Controllers without Counters have an non-proportional method of
transmitter by transmitting a dominant bit passing into the Bus-Off state (due to a
level on the bus during the Acknowledge Slot, counting: an error causes a larger counter
missing acknowledge), if there is no other
independent of accepting or rejecting the increase than a correctly transmitted/received
CAN Controller currently available.
message. message causes the count to decrease. Over
a period of time this may result in an increase
Aims of Error Confinement
Error-Active in error counts, even if there are fewer
An error-active CAN Controller in its normal Distinction of Short and Long Lasting corrupted messages than uncorrupted ones.
operating state is able to receive and to Di stu rban ces The level of the Error Counters reflect the
transmit normally and also to transmit an The CPU must be informed when there are relative frequency of disturbances. The ratio
Active Error Flag. long-lasting disturbances and when bus of increase/decrease depends on the
activities have returned to normal operation. acceptable ration of invalid/valid messages
Error-Passive on the bus and is hardware implemented to
An error-passive CAN Controller may During long-lasting disturbances, a CAN
eight.
transmit or receive messages normally. In the Controller enters the Bus-Off state and the
case of a detected error condition it transmits CPU may use default values. If one of the Error Counters exceeds the
a Passive Error Flag instead of an Active Warning Limit of 96 error points, indicating a
Minor disturbances of bus activities will not
Error Flag. significant accumulation of error conditions,
affect a CAN Controller. In particular, a CAN
this is signaled by the CAN Controller (Error
Hence the influence on bus activities by an Controller does not enter the Bus-Off state or
Status, Error Interrupt).
error-active CAN Controller (e.g., due to a inform the CPU of a short-lasting bus
malfunction) is reduced. disturbance. A CAN Controller operates in the error-active
mode until it exceeds 127 error points on one
Suspend Transmission Detection and Localization of Hardware of its Error Counters. At this point it will enter
After an error-passive CAN Controller has Disturbance and Defects the error-passive state.
transmitted a message, it sends eight The rules for error confinement are defined
recessive bits after the Intermission Field and by the CAN protocol specification (and A transmit error which exceeds 255 error
then checks for Bus-Idle. If during Suspend implemented in the 8XC592's on-chip CAN points results in the CAN Controller entering
Transmission another CAN Controller starts Controller), in such a way that the CAN the Bus-Off state.
transmitting a message the suspended CAN Controller, being nearest to the error-locus,
Interrupt Priority
Each interrupt source can be iether high
priority or low priority. If both priorities are
requested simultaneously, the processor will
branch to the highy priority vector. If there are
simUltaneous requests from sources of the
same priority, then interrupts will be serviced
in the following order: XO, Sl, ADC, TO, CTO,
CMO, XI, CT1, CM1, Tl, CT2, CM2, SO,
CT3, T2.
A low priority interrupt routine can only be
interrupted by a high priority interrupt. A high
priority interrupt routine cannot be interupted.
Table 11. Status of External Pins During Sleep, Idle and Power-Down Modes
PROGRAM PWMOI
MODE
MEMORY
ALE PSE"fl PORTO PORT 1 PORT 2 PORT 3 PORT 4
PWM1
Idle Internal 1 1 Port Data Port Data Port Data Port Data Port Data High
Idle External 1 1 Float Port Data Address Port Data Port Data High
Power-down Internal 0 0 Port Data Port Data Port Data Port Data Port Data High
Power-down External 0 0 Float Port Data Port Data Port Data Port Data High
NOTE:
If the port pins Pl.6 and Pl.7 are used as the CAN transmitter outputs (CTXO and CTX1), then during Sleep and Power-down mode these pins
output a "recessive" level.
POWER REDUCTION MODES mode. After the interrupt is serviced, the pulse with a width of 6144 machine cycles
The 8XC592 has three software-selectable program continues with the instruction (4.6ms with fCLK~16MHz). All hardware
modes to reduce power consumption. These immediately after the one, at which the except Irom the CAN Controller 01 the
are: interrupt request was detected. P8XC592 is reset (the contents of all CAN
• Sleep mode, affecting the CAN Controller Controller registers are preserved) .
The flag bits GFO and GFI may be used to
only determine whether the interrupt was received Note that a capacitance connected to the
• Idle mode, affecting the during normal execution or during the Idle RST pin could lengthen the internally
- CPU (halted) mode. For example, the instruction that writes generated reset pulse. If the pulse exceeds
- Timer 2 (stopped and reset) to PCON.O can also set or clear one or both 8192 machine cycles, the CAN Controller
- PWMO, PWMI (reset, output ~ HIGH) flag bits. When Idle mode is terminated by an part is reset too.
- ADC (aborted if in progress) interrupt, the service routine can examine the
• Power-down mode, affecting the whole status of the flag bits.
8XC592 device.
Another way of terminating the Idle mode is RESET
an external hardware reset. Since the A reset is accomplished by holding the RST
CAN Sleep Mode pin HIGH for at least two machine cycles (24
oscillator is still running, the reset signal is
In order to reduce power consumption of the oscillator periods). The CPU responds by
required to be active only for 2 machine
P8XC592 the CAN Controller may be executing an internal reset. During reset ALE
cycles (24 oscillator periods) to complete the
switched off (disconnecting the internal clock) and PSEN output at a HIGH level. In order to
reset operation.
by setting the CAN Command Register bit 4 perform a correct reset, this level must not be
(Sleep) HIGH. The CAN Controller leaves The third way is the internally generated affected by external elements.
this Sleep mode by detecting either activity watchdog reset after an overflow of Timer 3.
on the CAN-bus (dominant bit-level on Also with the P8XC592, the RST line can be
CRXO/CXR 1) or by setting the Sleep bit to Power-down Mode pulled HIGH internally by a pull-up transistor
LOW. The instruction that sets PCON.l to HIGH, is activated by the watchdog timer T3. The
the last one executed before entering the length of the output pulse from T3 is 3
As the CPU cannot only write to the Sleep bit, machine cycles. A pulse 01 such short
Power-down mode. In Power-down mode the
but can also read it, the CAN Controller duration is necessary in order to recover from
oscillator of the P8XC592 is stopped. If the
status can be determined directly. a processor or system fault as fast as
CAN Controller is in use. it is recommended
to set it into Sleep mode belore entering possible.
Idle Mode
Power-down mode. However, setting During Power-down a reset could be
The instruction that sets PCON.O is the last
PCON.l to HIGH also sets the Sleep bit generated internally via the CAN Wake-up
one executed in the normal operating mode
(CAN Controller Command Register bit 4) to interrupt. Then the RST pin is pulled HIGH for
before Idle mode is activated. Once in the
HIGH. 6144 machine cycles. In this case the CAN
Idle mode, the CPU status is preserved in its
entirety: the Stack Pointer, Program Counter, The P8XC592 leaves Power-down mode Controller is not reset.
Program Status Word, Accumulator, RAM either by a hardware reset or by a CAN If the watchdog timer or the CAN Wake-up
and all other registers maintain their data Wake-up interrupt (due to activity on the CAN interrupt is used to reset external devices, the
during Idle mode. The status of the external bus), il the SIOI (CAN) interrupt source is usual capacitor arrangement for power-on
pins during Idle mode is show in Table 12. enabled (contents of register IENO ~ reset should not be used. However, the
1XI xxxxxb). A hardware reset affects the internal reset is forced, independent of the
There are three ways to terminate the Idle
whole P8XC592, but leaves the contents of external level on the RST pin.
mode:
the on-chip RAM unchanged (CAN Controller
Activation of any enabled interrupt will cause and CPU's Special Function Registers are The Main RAM and AuxRAM are not
PCON.O to be cleared by hardware, provided reset). A CAN Wake-up interrupt during affected. When VDD is turned on, the RAM
that the interrupt source is active during Idle Power-down mode causes a reset output content is indeterminate.
Table 12.
After a reset the internal registers have the following contents:
(CPU PART) REGISTER 7 6 5 4 3 2 1 0
ACC 0 0 0 0 0 0 0 0
ADCO X X 0 0 0 0 0 0
ADCH X X X X X X X X
B 0 0 0 0 0 0 0 0
CMlO-CMl2 0 0 0 0 0 0 0 0
CMHO-CMH2 0 0 0 0 0 0 0 0
CTCON 0 0 0 0 0 0 0 0
CTlO-CTl3 X X X X X X X X
CTHO-CTH3 X X X X X X X X
DPl 0 0 0 0 0 0 0 0
DPH 0 0 0 0 0 0 0 0
IENO 0 0 0 0 0 0 0 0
IENI 0 0 0 0 0 0 0 0
IPO X 0 0 0 0 0 0 0
IPI 0 0 0 0 0 0 0 0
PCH 0 0 0 0 0 0 0 0
PCl 0 0 0 0 0 0 0 0
PCON 0 X X 0 0 0 0 0
PSW 0 0 0 0 0 0 0 0
PWMO 0 0 0 0 0 0 0 0
PWMI 0 0 0 0 0 0 0 0
PWMP 0 0 0 0 0 0 0 0
PO-P4 1 1 1 1 1 1 1 1
PS X X X X X X X X
RTE 0 0 0 0 0 0 0 0
SOBUF X X X X X X X X
SOCON 0 0 0 0 0 0 0 0
CANSTA 0 0 0 0 1 1 0 0
CANCON X X X 0 0 0 0 0
CANDAT X X X X X X X X
CANADR 0 X 1 0 0 1 0 0
SP 0 0 0 0 0 1 1 1
STE 1 1 0 0 0 0 0 0
TCON 0 0 0 0 0 0 0 0
THO, THI 0 0 0 0 0 0 0 0
TMH2 0 0 0 0 0 0 0 0
TlO, TL1 0 0 0 0 0 0 0 0
TMl2 0 0 0 0 0 0 0 0
TMOD 0 0 0 0 0 0 0 0
TM2CON 0 0 0 0 0 0 0 0
TM21R 0 0 0 0 0 0 0 0
T3 0 0 0 0 0 0 0 0
(CAN PART) REGISTER 7 6 5 4 3 2 1 0
CR 0 X 1 X X X X 1
CMR 1 1 X 0 X X X X
SR 0 0 0 0 1 1 0 0
IR X X X 0 0 0 0 0
ACR X X X X X X X X
AMR X X X X X X X X
BTRO X X X X X X X X
BTR 1 X X X X X X X X
OCR X X X X X X X X
TR X X X X X X X X
TXB 10-19 X X X X X. X X X
RXB20-29 X X X X X X X X
NOTE:
X = Undefined State
DC ELECTRICAL CHARACTERISTICS
-
Tarrb ---40°C to +85°C (83C592FFA 87C592EFA) Ta ni> - -40°C to +125°C (83C592FHA)' voo AVoo --5V±10% vss AVss - OV
TEST UMITS
SYMBOL PARAMETER CONDITIONS MIN TYPICAL MAX UNIT
Voo Supply voltage 4.5 5.5 V
Supply current:
100 operating fCLK= lGMHz - 50 rnA
110 Idle mode fCLK= lGMHz - 15 rnA
lis Idle and Sleep mode fCLK = lGMHz - 10 rnA
Ipo Power-down mode (83C592 FHA) Note 4 150 IlA
Ipo Power-down mode (8XC592 xFx) Note 4 100 IlA
Inputs
VIL Input low voltage, except 8(, CRXO, CRXl -0.5 0.2Voo-O·l V
VILl Input low voltage to 8( -0.5 0.2Voo-O·3 V
VIH Input high voltage,
0.2Voo+0.9 Voo+0.5 V
exceptXTAl1, RST, CRXO, CRXl
VIHl Input high voltage, XTAL 1, RST 0.7Voo Voo+0.5 V
-IlL Input current Low, ports 1, 2, 3, 4 VIN = 0.45V -60 I1A
-ITL High-to-Low transition current, ports 1, 2, 3, 4 VI = 2.0VIO.45V -650 IlA
±IILl Input leakage current, port 0, 8(, STADC, EW 0.45V<VI<Voo 10 IlA
±11l2 Input leakage current, port 5 0.45V<VI<Voo I IlA
Outputs
VOL Output low voltage, fOrts 1, 2, 3, 4,
exceptPl.G, Pl.P, IOL = 1.GmA2 0.45 V
VOll ~WMlt low voltage, Rort 0, ALE, !'SEN, 1'Wm, IOL =3.2mA2 0.45 V
, Pl.G, Pl.75, 6
Analog Inputs
AV DD Analog supply voltage7 AVDD = VDo±O·2V 4.S S.5 V
AC ELECTRICAL CHARACTERISTICS
T a mb -- -40°C to +85°C V DD AV DD - 5V ±10"lo vss AVss - OV
VARIABLE CLOCK
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port 0, ALE, and PSEI'J = 100pF, load capacitance for all other outputs = 80pF.
3. These values are characterized but not 100"10 production tested.
ALE
PORTO AO-A7
PORT 2 AS·AI5
ALE
tWHLH
~------------~--------~
tRLDV
PORTO
INSTRIN
14------ tAVDV - - - - - + 1
PORT 2
P2.0·P2.7 OR AS·AI5 FROM DPH AO·AI5 FROM PCH
ALE
tWHLH-
tavwx
INSllIUC1ION o 3 4 6 7 8
ALE
CLOCK
tavXH H
~.OUT~PII~t~D~Al~iI,'_------~,,;:-------=
r- I
tXHOX
>C=>C7
WRITE TO SBUF
+
SETTI
INPUT DATA
~
CLEARRI
SETAl
VD~·5 - - - - O.7VDD
D.45V D.2VDo-O-l
tCLK
Vol)-<l.5
D.45V
=x D.2Voo.D·9
.....::O'2;;;V;.::O~D4l:...::..1;...._ _ __
x= VLOAOI----<
VLOAo.D· 1V TIMING
REFERENCE
POINTS
V()It-O.1V
VOI.~.1V
NOTE: NOTE:
AC Inputs during testing are driven at VOO -0.5 for a logic '1' and D,45V for a logic '0', For timing purposes, a port Is no longer floating when a 100mV change from load
Timng measurements are made at VIH min fora logic '1' and VIL max for a logic '0'. vohage occurs, and begins to float when a l00mV change from the loaded VoH'
VOL level occurs. rOH'IoL~±20mA.
45
V VOO= 5.5V
40
1/
35 1/
30
/ MAXIMUM OPERATING MODE
IOOmA / /'
V VOO=4.5V
25
20
/ V
/V
15
/ V
/ /'" V
---
MAXIMUM IDLE AND SLEEP MODE
10
;.- 100- VOO= 5.5V
~
::: ~
I--
~
~
~ - MAXIMUM IDLE AND SLEEP MODE
VOO=4.5V
12 16
NOTE:
Valid only within frequency specifications of the device under test. Maximum values takeri
at worst case ter11'9rature.
EPROM CHARACTERISTICS addresses 0 through 1FH, using the "Pgm Reading the Signature Bytes
The 87C592 is programmed by using a Encryption Table" levels. Do not forget that The signature bytes are read by the same
modified Quick-Pulse Programming™ after the encryption table is programmed, procedure as a normal verification of
algorithm. It differs from older methods in the verification cycles will produce only encrypted locations 030H and 031 H, except that P3.S
value used for Vpp (programming supply data. and P3.7 need to be pulled to a logic low. The
voltage) and in the width and number of the values are:
To program the lock bits, repeat the 25-pulse
ALEIPROO pulses. programming sequence using the "Pgm Lock (030H) = 15H indicates manufactured by
The 87C592 contains two signature bytes Bit" levels. After one lock bit is programmed, Philips
that can be read and used by an EPROM further programming of the code memory and
(031 H) = 9CH indicates 87C592
programming system to identify the device. encryption table is disabled. However, the
The signature bytes identify the device as an other lock bit can still be programmed. ProgramNerify AlgorHhms
87C592 manufactured by Signetics. Note that the E7iNpp pin must not be allowed Any algorithm in agreement with the
to go above the maximum specified Vpp level conditions listed in Table 13, and which
Table 13 shows the logic levels for reading
for any amount of time. Even a narrow glitch satisfies the timing specifications, is suitable.
the signature byte, and for programming the
program memory, theencryption table, and above that voltage can cause permanent
damage to the device. The Vpp source Erasure Characteristics
the lock bits. The circuit configuration and
should be well regulated and free of glitches Erasure of the EPROM begins to occur when
waveforms for quick-pulse programming are
and overshoot. the chip is exposed to light with wavelengths
shown in Figures 15 and IS. Figure 17 shows
shorter than approximately 4,000 angstroms.
the circuit configuration for normal program
memory verification. Program Verification Since sunlight and fluorescent lighting have
If lock bit 2 has not been programmed, the wavelengths in this range, exposure to the
Quick-Pulse Programming on-chip program memory can be read out for light sources over an extended time (about 1
program verification. The address of the week in sunlight, or 3 years in room level
The setup for microcontroller quick-pulse
program memory locations to be red is fluorescent lighting) could cause inadvertent
programming is shown in Figure 15. Note that
applied to ports 1 and 2 as shown in erasure. For.thls and secondary effects, It
the 87C592 is running with a 4to SMHz
oscillator. The reason the oscillator needs to Figure 17. The other pins are held at the is recommended that an opaque label be
be running is that the device is executing "Verify Code Data" levels indicated in placed over the window. For elevated
internal address and program data transfers. Table 13. The contents of the address temperature or environments where solvents
location will be emitted on port o. External are being used, apply Kapton tape Fluorglas
The address of the EPROM location to be pull-ups are required on port 0 for this part number 2345-5, or equivalent.
programmed is applied to ports 1 and 2, as operation.
shown in Figure 15. The code byte to be The recommended erasure procedure is
programmed into that location is applied to If the encryption table has been programmed, exposure to ultraviolet light (at 2537
port O. RST, PSEN, and pins of ports 2 and 3 the data presented at port 0 will be the angstroms) to an integrated dose of at least
specified in Table 13 are held at the "Program exclusive NOR of the program byte with one 15W-sedcrn2. Exposing the EPROM to an
Code Data" levels indicated in Table 13. The of the encryption bytes. The user will have to ultraviolet lamp of 12,000l1W/cm2 rating for
ALEIPROO is pulsed low 25 times as shown know the encryption table contents in order to 20 to 39 minutes, at a distance of about 1
in Figure IS. correc~y decode the verification data. The inch, should be sufficient. Erasure leaves the
encryption table itself cannot be read out. array in an all 1s state.
To program the encryption table, repeat the
25-pulse programming sequence for
+5V
VDD
AD-A7 PI PO PGMDATA
P2.6 o
Vss
1 I- 25 PULSES -------------1-1.-----
10,", liN ---1 1-100 - - - - - - 10'"'±10,-----ooI_1
ALEIPRllGl °LI__________~nL__________~n~__
Figure 16. !'ROO Waveform
+5V
VDO
AD-A7 PI PO PGMDATA
RST EJWpp
P3.& Al.EII'lIOO
P3.7 87C592 P!IER o
XTAL2 P2.7 o"ERllll[E
P2.& o
XTALt P2.0.p2.5 A8-At3
Vss
PROGRAMIJING* VERIRCAllON
P1.~1.7
P2.0-P2.5
ADDRESS ADDRESS "-
/
--- - tAVOV
ALEA'RUG:
IDVGL --.
tAVGL I - -
I-
f\ . In
---- --
4- IGHDX
IGHAX
/V
ElWpp
LOGIC 0
------------ -----------------------------
tEHSH
IEL~
,
LOGIC I
.,
tEHOZ
8XC652/654 OVERVIEW are from external memory. Pl.6 and Pl.7 on these parts do not have a
The 8XC652 and 8XC654 (hereafter referred pull-up structure as found on the BOC51.
The organization of the data memory is
to collectively as 8XC65214) are derivatives of Therefore Pl.6 and Pl.7 have open drain
similar to the 80C51 except that the outputs on the 8XC65214.
the BOC51 8-bit CMOS microcontroller. The 8XC65214 has an additional 128 bytes of
8XC65214 contains all of the features of the RAM overlapped with the special function fdle and Power-Down Operation
BOC51 (that is, the standard counterltimers register space. This additional RAM is
TO and Tl, the standard serial 110 (UART), Idle mode operation permits the interrupt,
addressed using indirect addressing only and serial ports, and timer blocks to continue to
and four 8-bit 110 ports). In addition, the is available as stack space. (This memory
8XC65214 has the following: function while the CPU is halted. The
addition is the same as in the SOC52 and following functions remain active during idle
• 8k bytes of ROM (8XC652) 83C552. See Figure 1 for a memory map.) mode. These functions may generate an
• 16k bytes of ROM (8XC654) interrupt or reset and thus end the idle mode:
Special Function Registers
• 256 bytes of RAM The 8XC652/4 special function register space • TImer 1 overflow
is the same as that on the 80C51 except that • 12C serial 110 interrupt
• 12C bus serial 110 it contains four additional SFRs. The added
registers are: SICON, SISTA, SlOAT.. and • UART serial 110 interrupt
The only difference between the 8XC652 and
the 8XC654 is that the 8XC654 has 16k bytes SIAOR. In addition to these, the standard • TImer 0, TImer 1
of program memory while the 8XC652 has 8k UART special function registers SCON and
SBUF have been renamed SOCON and ·Sloo,SIOl
bytes. All other features of these parts are
identical. SOBUF for clarity. • External interrupt
The 8XC65214 is pin-for-pin compatible and Since the standard SOC51 on-chip functions In idle mode, port pins Pl.6 and PI.7 function
fully code compatible with the 80C51. There are the same on the 8XC65214, the SFR as SCl and SOA, respectively, if the 12C
are some differences in the Pl.6 and PI. 7 pin locations, bit locations, and operation are
serial port is enabled. The power-down
functions that are described in detail later in unchanged. The only exception is in the
operation freezes the oscillator. The
this section. All of the 80C51 functions are interrupt enable and interrupt priority SFRs.
power-down mode can only be activated by
present, including the external64k program These have been changed to include the
setting the PO bit in the PCON register. The
and data memory expansion, Boolean interrupt from the 12C serial port. Table 1
power-down mode in the 8XC65214 operates
processing, and two reduced power"modes. shows the special function registers, their
exactly the same as in the 80C51.
direct address, the bit addresses, and the
Differences from the 80C51 value in the register after a reset. ROM Code Protection (83C6S2/83C654)
The data and program memory are organized The 83C652183C654 has an additional
12C Serial Communlcallon-SI01
similar to the 80C51. The 8XC65214 program security feature. ROM code protection is
The 12C serial port is identical to the 12C serial
memory differs in that it has 8k116k bytes of mask programmable and therefore user
port on the 8XC552. The operation of this
on-cllip ROM. When Eli: is high the 8XC65214 dependent. This feature may be requested
subsystem is described in detail in the
fetches instructions from the internal ROM during ROM code submission. When
8XC552 section of this manual.
unless the address exceeds 1FFFH/3FFFH. enabled, access to the internal ROM is only
locations 2000H/4OOOH to FFFFH are Note that in both the 8XC652/4 and the possible when executing from internal
fetched from external program memory. 8XC552 the 12C pins are alternate functions program memory, not in the EA-mode
When Eli: is held low, all instruction fetches to port pins Pl.6 and Pl.7. Because of this, (external access).
64k
64k
Exlernal
8192/16384
Overtapped
A
8191116383
Space
f \
8191116383
255
I I
Sped.1
Internal External Fta'tCtlon
(Ell =1) Regi.'....
(EJI"=O)
127 - --
-- --
Internal
0 Data RAM 0
0 0
\, \, .I
-V-
./
...""... '------v--1
Program Memory Intema! Edemal
Data Memory D.ta Memory
SlSTA# Serial 1 status D9H SC4 I SC3 I SC2 I SCl I SCO I 0 I 0 I 0 F8H
OF DE DO DC DB DA 09 08
SlCON'# Serial 1 control D8H CR2 I ENSl I STA I STO I SI I AA I CRl I CRO ooooooooB
8F 8E 80 8C 8B 8A 89 88
TCON' Timer control 88H TF1 I TRl I TFO I TRO I IEl I 1T1 I lEO I ITO ooH
THl Timer high 1 8DH ooH
THO Timer high 0 8CH ooH
TLl Timer low 1 BBH ooH
THO Timer low 0 BAH ooH
,
TMOD Timer mode B9H GATE I cfT I Ml I MO I GATE I cfT I Ml I MO ooH
SFRs are bit addressable.
# SFRs are modified from or added to the 80C51 SFRs.
Interrupt System can be individually enabled or disabled by a interrupts will be serviced in the following
The interrupt system is the same as in the corresponding bit in the IE register; moreover, order:
8OC51 except that the 8XC65214 each interrupt may be programmed to a high 1. Tl'ITO external interrupt 0
acknowledges interrupt requests from six or low priority level using a corresponding bit
2. 12C serial 110 interrupt
sources as follows: in the IP register. Also, all enabled sources
can be globally disabled or enabled. 3. limer 0 overflow
• lFITn external interrupt 0
.1NTT external interrupt 1 Both external interrupts can be programmed 4. 1NTT external interrupt 1
to be level-activated or transition-activated; 5. limer 1 overflow
• limer 0 overflow
an active LOW level allows "Wire-ORing" or
• limer 1 overflow several input sources to the input pin. 6. UART serial 110 interrupt
Polling hardware
il
Interrupt Interrupt priority bl
SolM'ce enable Globel enable registers
IIgh
-
cl
IRTII EX1emaI al p10rity
Interrupt ....,.. dl Interrupt
RequeetO
I
a2 ., request
I
....,..'"
12C bl II
SlO l' I
IHT SerioJ Vector
Port b2
Source
I
Internal
llmerO - ,.. I
I
"'.
-....,..
cl
c2
Identification
---
INTJ EX1emaI
Interrupt
Requeet 1
.- '"
I
... 1,..
--....,.. dl
d2
.2
b2
il
I
InternoJ
llmer 1 .- '"
_I,..
I
-....,.. 81
02
c2
d2
Low
priority
Interrupt
82 req ....t
__ II ,..
--....,..
o T 11
'"
SlOO InternoJ
Serial
L_ 12
IHT
Port
0
o R ./ 12
Vector
Source
Jdentification
Interrupt Enable Register Interrupt Priority Register The following vectors indicate the ROM
location where the appropriate interrupt
IE (ASH) lEAl -IES1IE50IET1IEXlIETOIEXOI IP(BaH) 1-1-lpslIPSOlpT1lpXlIPTOlpXOI service routine starts.
USB LSB USB LSB
Source Vector
Bit Symbol Function Bit 5ymbol Function Extemal 0 (EXO) 0OO3H
IE.7 EA General enable/disable control IP.7 Unused limer 0 overflow (TO) OOOBH
o = No interrupt enabled IP.6 Unused Extemall (EX1) 0013H
1 = Any individually enabled IP.5 P51 5101 (12C) interrupt priority Timer 1 overflow (Tl) 00lBH
interrupt will be accepted level Serial I/O 0 (UART) (SO) 0023H
1E.6 Unused IPA P50 5100 (UART) interrupt priority Serial I/O 1 (12C) (51) 002BH
IE.5 E51 Enable 5101 (12C) interrupt level
lEA ESO Enable 5100 (UART) interrupt IP.3 PTl Timer 1 interrupt priority level
IE.3 ETl Enable timer 1 interrupt IP.2 PXl Enable interrupt 1 priority level
IE.2 EXl Enable eX1email interrupt IP.l PTO Timer 0 interrupt priority level
IE.l ETO Enable timer 0 interrupt IP.O PXO External interrupt 0 priority
lE.O EXO Enable eX1emai 0 interrupt level
o = interrupt disabled o = Low priority
1 = interrupt enabled 1 = High priority
LOGIC SYMBOL
17 29
18 28
44 34
33
11 23
12 22
SB7C652-4F40
o to +70, 16MHz
ceramic DIP with window
SB7C652-4K44
o to +70, 16MHz
ceramic CLCC with window
-40 to +85,
S87C652-5F40 16MHz
ceramic DIP with window
P80C652FFA P83C652FFAlxxx SBOC652-5A44 SB3C652-5A44 S87C652-5A44 -40 to +85, plastic PLCC 16MHz
-40 to +85,
SB7C652-5K44 16MHz
ceramic CLCC with window
F80C652FFB P83C652FFBlxxx SBOC652-5B44 SB3C652-5B44 SB7C652-5B44 -40 to +85, plastic OFP 16MHz
P80C652FHP P83C652FHP/xxx SBOC652-6N40 SB3C652-6N40 -40 to + 125, plastic DIP 16MHz
P80C652FHA P83C652FHAlxxx SBOC652-6A44 SB3C652-6A44 -40 to + 125, plastic PLCC 16MHz
P80C652FHB P83C652FHB/xxx SBOC652-6B44 S83C652-6B44 -40 to + 125, plastic OFP 16MHz
S87C652-7F40
o to +70, 20MHz
ceramic DIP with window
SB7C652-7K44
o to +70, 20MHz
ceramic CLCC with window
-40 to +85,
S87C652-8F40 20MHz
ceramic DIP with window
-40 to +85,
S87C652-8K44 20MHz
ceramic CLCC with window
Lee QFP
BLOCK DIAGRAM
FREQUENCY
REFERENCE COUNTERS
r-'----o r-'----o
XTAL2 XTAll TO 11
SD]SHARED
CPU WITH
SCl PORT 1
INTERNAL
INTERRUPTS
NOTE:
1. The 87C652 EPROM ie not expandable.
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC QFP TYPE NAME AND FUNCTION
Vss 20 22 16 I Ground: OV reference.
Vee 40 44 38 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.O-O.7 39-32 43-36· 37-30 110 Port 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 pins that have 1s written to them
float and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order
address and data bus during accesses to external program and data memory. In this
application, it uses strong internal pull-ups when emitting 1s. Port 0 also outputs the code
bytes during program verification in the 87C652. External pull-ups are required during
program verification. ' .
Pl.O-Pl.7 l-a 2-9 40-44, 110 Port 1: Port 1 is an 8-bit bidirectional 110 port with internal pull-ups, except Pl.6 and Pl.7
1-3 which are open drain. Port 1 pins that have Is written to them are pulled high by the intemal
pull-ups and can be used as inputs. As inputs, port 1 pins that are externally pulled low will
source current because of the internal pull-ups. (See DC Electrical Characteristics: IlL).
Port 1 also receives the low-order address byte during program memory verification.
Alternate functions include:
Pl.6 7 8 2 110 SCL: 12C-bus serial port clock line.
Pl.7 8 9 3 110 SDA: 12C-bus serial port data line.
P2.D-P2.7 21-28 24-31 18-25 110 Port 2: Port 2 is an 8-bit bidirectional 110 port with internal pull-ups. Port 2 pins that have 1s
written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 2 pins that are extemally being pulled low will source current because of the internal
pull-ups. (See DC Electrical Characteristics: IILl. Port 2 emits the high-order address byte
dUring fetches from external program memory and during accesses to exterral data memory
that use 16-bit addresses (MOVX@DPTR).ln this application, it uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that use 8-bit
addresses (MOV @Ri), port 2 emits the contents of the P2 special function register.
P3.O-P3.7 10-17 11, 5, 110 Port 3: Port 3 is an 8-bit bidirectional 110 port with internal pull-ups. Port 3 pins that have 1s
13-19 7-13 written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 3 pins that are externally being pulled low will source current because of the pull-ups.
(See DC Electrical Characteristics: IILl. Port 3 also serves the special features of the BOC51
family, as listed below: .
10 11 5 I RxD (P3.0): Serial input port
11 13 7 0 TxD (P3.l): Serial output port
12 14 8 I mTII' (P3.2): External interrupt
13 15 9 I INTf (P3.3): External interrupt
14 16 10 I TO (P3.4): Timer 0 external input
15 17 11 I T1 (P3.5): Timer 1 external input
16 18 12 0 WR (P3.6): External data memory write strobe
17 19 13 0 RD (P3.7): External data memory read strobe
RST 9 10 4 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the
device. An internal diffused resistor to Vss permits a power-on reset using only an external
capacitor to Vee.
ALEIPRO'G 30 33 27 110 Address Latch Enable/Program Pulse: Output pulse for latching the low byte of the
address during an access to external memory. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency, and can be used for external timing or docking.
Note that one ALE pulse is skipped during each access to external data memory. This pin is
also the program pulse input (!'ROO) during EPROM programming.
1'SEIII' 29 32 26 0 Program Store Enable: The read strobe to externa:tEwam memory. When the 87C652 is
executing code from the external program memory, is activated twice each machine
cyde, except that two PSER activations are skipped during each access to external data
rnemory. PSER is not activated during fetches from internal program memory.
'FJ{Npp 31 35 29 I External Access Enable/Programming Supply Voltage: 91: must be externally held low to
enable the device to fetch code from external program memory locations OOOOH and 1FFFH.
If 91: is held high, the device executes from internal program memory unless the program
counter contains an eddress greater than 1FFFH. This pin also receives the 12.75V
programming supply voltage (Vpp) during EPROM programrning.
XTALI 19 21 15 I Crystal 1 : Input to the inverting oscillator amplifier and input to the internal clock generator
circuits.
XTAL2 18 20 14 0 Crystal 2: Output from the inverting oscillator amplifier.
NOTE.
To avoid "Iatch-up" effect at power-on, the voltage on any pin at any time must not be higher than Vee + 0.5V or Vss - 0.5V, respectively.
ROM CODE PROTECTION pins can be configured for use as an on-chip IDLE MODE
(83C652) oscillator, as shown in the logic symbol, In the idle mode, the CPU puts itself to sleep
page 522. while all of the on-chip peripherals stay
The 83C652 has an additional security
feature. ROM code protection may be To drive the device from an external clock active. The instruction to invoke the idle
selected by setting a mask programmable mode is the last instruction executed in the
source, XTAL 1 should be driven while XTAL2
security bit (Le., user dependent). This is left unconnected. There are no normal operating mode before the idle mode
feature may be requested during ROM code requirements on the duty cycle of the external is activated. The CPU contents, the on-chip
submission. When selected, the ROM code is clock signal, because the input to the internal RAM, and all 01 the special function registers
protected and cannot be read out at any time clock circuitry is through a divide-by-two remain intact during this mode. The idle mode
by any test mode or by any instruction in the flip-flop. However, minimum and maximum can be terminated either by any enabled
external program memory space. high and low times specified in the data sheet interrupt (at which time the process is picked
must be observed. up at the interrupt service routine and
The MOVC instructions are the only continued), or by a hardware reset which
instructions that have access to program starts the processor in the same manner as a
code in the internal or extemal program RESET power-on reset.
memory. The ~ input is latched during A reset is accomplished by holding the RST
RESET and is "don't care" after RESET. This pin high for at least two machine cycles (24
implementation prevents reading internal oscillator periods), while the oscillator is POWER-DOWN MODE
program code by switching from external running. To insure a good power-on reset, the In the power-down mode, the oscillator is
program memory to internal program memory RST pin must be high long enough to allow stopped and the instruction to invoke
during a MOVC instruction or any other the oscillator time to start up (normally a few power-down is the last instruction executed.
instruction that uses immediate data. milliseconds) plus two machine cycles. At Only the contents 01 the on-chip RAM are
power-on, the voltage on Vee and RST must preserved. A hardware reset is the only way
come up at the same time for a proper to terminate the power-down mode. the
OSCILLATOR control bits for the reduced power modes are
start-up.
CHARACTERISTICS in the special lunction register PCON. Table 1
XTAL 1 and XTAl2 are the input and output, shows the state of the 1/0 ports during low
respectively, of an inverting amplifier. The current operating modes.
0 0 0 23 47 62.5 94 256
0 0 1 27 54 71 1071 224
0 1 0 31.25 62.5 83.3 125 1 192
0 1 1 37 75 100 150 1 160
1 0 0 6.25 12.5 1.7 25 960
1 0 1 50 100 133 1 200 1 120
1 1 0 100 200 1 267 1 400 1 60
1 1 1 > 0.25 < 62.5 > 0.5 < 62.5 > 0.67 < 56 >0.98 <50 96 x (256 - (reload value Timer 1))
(Reload value range: 0 - 254 in mode 2)
NOTES:
1. These frequencies exceed the upper limit of 1ookHz 01 the 12C-bus specification and cannot be used in an 12C-bus application.
DEVICE SPECIFICATIONS
SUPPLY VOLTAGE FREQUENCY
(V) (MHz) TEMPERATURE
TYPE MIN. MAX. MIN. MAX. (DC)
DC ELECTRICAL CHARACTERISTICS
Vss=ov
TEST UMITS
VIL1 Input low voltage to "Eli: O°C to +70°C -{l.5 0.2Vcc- 0.3 V
-40°C to +85°C -{l.5 0.2Vee - 0.35 V
-40°C to + 125°C -{l.5 0.2Vcc - 0.45 V
VIH1 Input high voltage, XTAL 1, RST O°C to +70°C 0. 7Vcc Vee +0.5 V
-40°C to +85°C 0·7Vee+ 0.1 Vee + 0.5 V
-40°C to + 125°C 0· 7Vcc+ 0.1 Vee + 0.5 V
VOL1 Output low voltage, port 0, ALE, PSEN 10l =3.2mA8 0.45 V
VOH1 Output high voltage, Port 0 in external bus 10H = -4001lA 2.4 V
mode, ALE, PSEN, RS"f9 10H = -1501lA 0.75Vee V
10H =-401lA 0.9Vee V
III Logical 0 input current, ports 1, 2, 3, except O°C to +70°C VIN=O.45V -50 IlA
Pl.6/SCL, P1.7ISDA -40°C to +S5°C -75 IlA
-40°C to + 125°C -75 IlA
III Logicall-to-O transition current, ports 1, 2, O°C to +70°C See Note 7 -650 IlA
3, except Pl.6/SCL, P1.7/SDA -40°C to +S5°C -750 IlA
-40°C to + 125°C -750 IlA
1L1 Input leakage current, port 0 0.45 < VI < Vee ±10 IlA
1L2 Input leakage current, P1.61SCL, Pl.7/SDA OV <V;<6.0V ±10 IlA
OV < Vee < 6.0V IlA
Icc Power supply current: See Note 1
Active mode @ 16MHz (SO/S3C652) 2. 10 Vee = 6.0V 26.5 rnA
Active mode@ 16MHz (S7C652) 2 25 rnA
Idle mode@ 16MHz (SO/83C652) 3, 10 6 rnA
Idle mode @ 16MHz (S7C652) 3 6 rnA
Power down mode 4, 5 50 IlA
Power down mode 4, 5 -40°C to + 125°C 100 IlA
RRST Internal reset pull.<Jown resistor 50 150 kQ
40
30
00
-
12 16
IxTALl (MHz)
AC ELECTRICAL CHARACTERISTICS
Tarrb = O'C to +70'C or Tarrb =-4Q'C to +85'C/+125'C Vss =OV',2
16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
1/lcLCL 2 Oscillalor frequency 1.2 (3.5) 16 MHz
It.HLL 2 ALE pulse width 85 2tcLCL-40 ns
IAVLL 2 Address valid 10 ALE low 8 IcLcL-55 ns
It.LAX 2 Address hold after ALE low 28 IcLcL-35 ns
It.LlV 2 ALE low to valid instruction in 150 41cLCL-100 ns
It.LPL 2 ALE low 10 'PSE'N low 23 IcLcL--40 ns
IpLPH 2 'PSE'N pulse width 143 3IcLcL-45 ns
IpLIV 2 'PSE'N low 10 valid instruction in 83 31cLCL-105 ns
IpXIX 2 Inpul instruclion hold after 'I'S'EN 0 0 ns
IpXIZ 2 Inpul instruction floal after 'I'S'EN 38 IcLCL-25 ns
IAVIV 2 Address 10 valid instruction in 208 51cLCL-105 ns
IpLAZ 2 'PSE'N low 10 address floal 10 10 ns
Data Memory
IAVLL 3,4 Address valid 10 ALE low 28 IcLCL--35 ns
IRLRH 3,4 RD' pulse width 275 61cLCL-100 ns
IWLWH 3,4 WR pulse width 275 61cLCL-100 ns
IRLDV 3,4 RD' low 10 valid data in 148 51cLcL-165 ns
IRHDX 3,4 Data hold after RD' 0 0 ns
IRHDZ 3,4 Data floal after FlU 55 21cLcL-70 ns
It.LDV 3,4 ALE low 10 valid data in 350 81cLCL-150 ns
lAVDV 3,4 Address 10 valid data in 398 91cLCL-165 ns
It.LWL 3,4 ALE low to FlU or WR low 138 238 3IcLCL--50 31cLCL+50 ns
lAVWL 3,4 Address valid 10 WR low or RD' low 120 41cLCL-130 ns
tavwx 3,4 Data valid 10 WR transilion 3 IcLCL-OO ns
taw 3,4 Data setup time before WR 288 71cLcL-150 ns
IWHOX 3,4 Data hold after WR 13 IcLCL-50 ns
IRLAZ 3,4 RD' low 10 address floal 0 0 ns
IWHLH 3,4 RD' or WR high to ALE high 23 103 IcLCL--40 IcLCL +40 ns
Shift Register'
IXLXL 5 Serial port clock cycle time<! 0.75 12lcLCL IlS
taVXH 5 Outpul data setup 10 clock rising edge4 492 101cLCL-133 ns
IXHOX 5 Outpul dala hold after clock rising edge4 8 21cLCL-117 ns
IXHDX 5 Inpul dala hold after clock rising edge4 0 0 ns
IXHDV 5 Clock rising edge 10 inpul dala valid4 498 10IcLCL-133 ns
External Clock
12C Interface
lHo; STA START condition hold time " 14lcLCL > 4.01lS 5
It.ow SCL low time " 16lcLCL > 4.71lS 5
IHIGH SCL high time " 14lcLCL > 4.01lS 5
SCL rise time - 6
tAC SIlls
!Fc SCLfalitime S 0.31lS < 0.31lS 7
Isu; DATl Data set-up time " 250ns > 20 IcLCL -tAD
tsu; DAT2 SDA set-up time (before rep. START cond.) " 250ns > Ills 5
Isu; DAT3 SDA set-up time (before STOP cond.) " 250ns > B IcLCL
lHo; DAT Data hold time "Ons > B IcLCL -tFc
Isu; STA Repeated START set-up time " 14 lcLCL 5 > 4.711S 5
Isu; STO STOP condition set-up time " 14lcLCL 5 > 4.01lS 5
\aUF Bus free time " 14lcLCL 5 > 4.711S 5
tAD SDA rise time SIllS B - 6
ALE
PORTO AO-A7
PORT 2 A8-A15
ALE
/
"'
~tWHLH-
fc--tLLWL
tLLDV
-I
tRLRH
"'
~
tRHDZ
,~
'AVLL !--tRLDV-
tRHDX ......-
tRLAZ
PORTO
~
AO-A7
FROM AI OR DPL
'1
DATA IN "','
///
/
""-
AO-A7 FROM PCL INSTRIN
f.!--tAVWL -
tAVDV
PORT 2
)< P2.0-P2.7 OR A8-A15 FROM DPH A8-A15 FROM PCH
ALE
V
"
f.o--tWHLH ---
!+--tLLWl tWlWH
WR
IAVLL
tLLAX
r- tavwx
4 r.-. tWHOX
tow
~ K
PORTO AD-A7
Ar>-A7 FROM PCl INSTRIN
FROM RI OR OPL
>< OATAOUT
~tAVWl-
PORT 2
)< P2.~7 OR A8-A15 FROII OPH A8-A15 FROII PCH
INSTRUCll0N
ALE
-------,
~tXLXl --i
CLOCK
,
OUTPUTOATA !
f
WRITE TO SBUF
INPUT OATA
~'
CLEAR RI
t
SET RI
Vcc-O· 5 - - - - -o.7V-C-C""""
O.45V O.2VCC-o'1 1'---"1
Vcc-O.
OA5V
5
=x o. 2VCC+O·9
._o.;;;2;;.;V.::C::::~~.t,--_ _ __
>C VLOAD----<
TIMING
REFERENCE
POINTS
VQH-<l.1V
VQL+O.1V
NOTE: NOTE:
AC INPUTS DURING TESTING ARE DRIVEN AT VCc-O.5 FOR A LOGIC '1' AND FOR TIMING PURPOSES, A PORT IS NO LONGER FLOATING WHEN A l00MV
CHANGE FROM LOAD VOLTAGE OCCURS, AND BEGINS TO FLOAT WHEN A
O.45V FOR A LOGIC '0'. TIMING MEASUREMENTS ARE MADE AT VIH MIN FOR A
l00mV CHANGE FROM THE LOADED VofJIVOL LEVEL OCCURS.
LOGIC '1' AND VIL MAX FOR A LOGIC '0'.
IOH"OL 2: ± 2OmA.
Figure 8. AC Testing Input/Output Figure 9. Float Waveform
Vee Vcc
Vcc Vcc
Vcc RST
PO
RST
EJ(
Vss Vss
1
Figure 1D. Icc Test Condition, Active Mode Figure 11. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
Vcc
0.45V EJ(
-
(NC) XTAL2 P1.6
Pl.7
XTALI
Vss
Figure 12. Clock Signal Waveform for Icc Figure 13. Icc Test Condition, Power Down Mode
Tests in Active and Idle Modes All other pins are disconnected
IcLCL = IcHCL = 1 Dns Vcc = 2V to S.SV
NOTE:
• Ports 1.6 and 1.7 should be connected to Vec through resistors of sufficiently high value such that the sink current into these pins does not
exceed the lOll specification.
EPROM CHARACTERISTICS To program the encryption table, repeat the Reading the Signature Bytes
The 87C652 is programmed by using a 25 pulse programming sequence for The signature bytes are read by the same
modified Quick-Pulse Programming'" addresses 0 through 1FH, using the "Pgm procedure as a normal verification of
algorithm. It differs from older methods in the Encryption Table' levels. Do not forget that locations 030H and 031H, except that P3.6
value used for Vpp (programming supply after the encryption table is programmed, and P3.7 need to be pulled to a logic low. The
voltage) and in the width and number of the verification cycles will produce only encrypted values are:
ALEIPROO pulses. data. (030H) 5H indicates manufactured by
Philips
The 87C652 contains two signature bytes To program the lock bits, repeat the 25 pulse
(031 H) 99H indicates 87C652
that can be read and used by an EPROM programming sequence using the 'Pgm Lock
programming system to identify the device. Bit' levels. After one lock bit is programmed, ProgramNerlfy Algorithms
The signature bytes identify the device as an further programming of the code memory and Any algorithm in agreement with the
87C652 manufactured by Philips encryption table is disabled. However, the conditions listed in Table 3, and which
Components. other lock bit can still be programmed. satisfies the timing specifications, is suitable.
Table 3 shows the logic levels for reading the Note that the ~pp pin must not be allowed
signature byte, and for programming the to go above the maximum specified Vpp level Erasure Characteristics
for any amount of time. Even a narrow glitch Erasure of the EPROM begins to occur when
program memory, the encryption table, and
above that voltage can cause permanent the chip is exposed to light with wavelengths
the lock bits. The circuit configuration and
damage to the device. The Vpp source shorter than approximately 4,000 angstroms.
waveforms for quick-pulse programming are
should be well regulated and free of glitches Since sunlight and fluorescent lighting have
shown in Figures 14 and 15. Figure 16 shows
and overshoot. wavelengths in this range, exposure to these
the circuit configuration for normal program
light sources over an extended time (about 1
memory verification.
Program Verification week in sunlight, or 3 years in room level
Quick-Pulse Programming If lock bit 2 has not been programmed, the fluorescent lighting) could cause inadvertent
The setup for microcontroller quick-pulse on-chip program memory can be read out for erasure. For this and secondary effects, it
programming is shown in Figure 14. Note that program verification. The address of the Is recommended that an opaque label be
the 87C652 is running with a 4 to 6MHz program memory locations to be read is placed over the window. For elevated
oscillator. The reason the oscillator needs to applied to ports 1 and 2 as shown in temperature or environments where solvents
be running is that the device is executing Figure 16. The other pins are held at the are being used, apply Kapton tape Fluorglas
internal address and program data transfers. 'Verify Code Data' levels indicated in Table 3. part number 2345-5, or equivalent.
The contents of the address location will be The recommended erasure procedure is
The address of the EPROM location to be emitted on port O. External pull-ups are
programmed is applied to ports 1 and 2, as exposure to ultraviolet light (at 2537
required on port 0 for this operation. angstroms) to an integrated dose of at least
shown in Figure 14. The code byte to be
programmed into that location is applied to If the encryption table has been programmed, 15W-seclcm2 . Exposing the EPROM to an
port O. RST, PSE'Jil and pins of ports 2 and 3 the data presented at port 0 will be the ultraviolet lamp of 12,OoouW/cm 2 rating for
specified in Table 3 are held at the 'Program exclusive NOR of the program byte with one 20 to 39 minutes, at a distance of about 1
Code Data' levels indicated in Table 3. The of the encryption bytes. The user will have to inch, should be sufficient. Erasure leaves the
ALEIPROO is pulsed low 25 times as shown know the encryption table contents in order to array in an all 1s state.
in Figure 15. correctly decode the verification data. The
encryption table itself cannot be read out.
Vee
_7 " P1 PO
It..
PGIIDATA
v 'f
1 RST ElWpp +12.75V
1 P3.6 ALEiPROG 25 100"" PULSES TO GROUND
1 P3.7 87C652 JfSEII 0
XTAL2 P2.7 1
~_c6 i- P2.6 0
T T XTAL1 P2.0-P2.4 .~
A8-A12
~ Vss P2.5 0
-::!=-
1~~-----------------------~PU~6 ------------------------~~I
ALEIPRllGl
.------
10"" MIN -1 Ik~--------- 10jJS±101--------~~1
ALEIPRllGl o~I ______________~r1~____________~rl~__
Figure 15. PROG Waveform
_7 P1
Vcc
PO PGMDATA
RST ElWpp
P3.6 ALEiPROG
P3.7 87C652 JfSEII 0
Vss P2.5 0
-
Figure 16. Program Verification
PORTO DATA IN
- I-- tAYQY
DATA OUT
/
AL~
tDY L -
tAYG ~ -f\ .. h
--0 +---
~
IGHDX
IGHAX
~
V
/ LOGIC 1 LOGIC 1
LOGIC 0
-------.---- --------------.---.----------
L
----------- ------------
tEHSH
tELQ~ tEHQZ
1'2.7
£RlIII(E
"FOR PROGRAMMING VERIFICATION SEE FIGURE 14. I I
FORYERIFICATION CONDITIONS SEE FIGURE 16.
II
February 5,1992
Purchase of PhilipS' 12C components conveys a license under the
Philips' 12C patent to use the components In the 12C-system
provided the system conforms to the 12C specifications defined by Philips.
540
Signetics Mlcrocontroller Products Product specification
LOGIC SYMBOL
17 29
vccVss
18 28
44 34
33
11 23
12 22
~ n 0
0
7[ :::::1 39
33
Lce
17 [ 11 23
:::::129
'iii i;l 12 22
Pin Function Pin Function Pin Function Pin Function
1 NC 23 NC 1 Pl.5 23 P2.51A13
2 Pl.0 24 P2.0/AB 2 P1.6ISCL 24 P2.6IA14
3 Pl.1 25 P2.1/A9 Pl.7/SDA 25 P2.7/A15
4 P1.2 2S P2.21Al0 RST 2S PSEN
5 P1.3 27 P2.3/All P3.OIRxD 27 ALEIPROG
6 Pl.4 28 P2.4/A12 NC 28 NC
7 Pl.5 29 P2.51A13 P3.11TxD 29 ElWpp
8 P1.6ISCL 30 P2.6IA14 P3.2IIfI11J 30 PO.7/AD7
9 P1.7/SDA 31 P2.7/A15 P3.3ITmT 31 PO.61AOO
10 RST 32 PSrn 10 P3.4ITO 32 PO.51AD5
11 P3.0/RxD 33 ALEn>!IDG 11 P3.5'Tl 33 PO.4/AD4
12 NC 34 NC 12 P3.6!WH 34 Pa.31AD3
13 P3.11TxD 35 ElWpp 13 P3.7RD 35 PO.21AD2
14 P3.2IIfI11J 36 PO.7/AD7 14 XTAL2 36 PO.l/ADl
15 P3.3IIN1T 37 PO.6IAOO 15 XTALl 37 PD.O/ADO
16 P3.4ITO 38 PO.51AD5 16 VSS 38 VCC
17 P3.5lTl 39 PO.4IAD4 17 NC 39 NC
18 P3.6!WH 40 PO.3/AD3 18 P2.OIA8 40 P1.0
19 P3.7/RO 41 PO.21AD2 19 P2.1/A9 41 Pl.1
20 XTAL2 42 PO.l/ADl 20 P2.21Al0 42 P1.2
21 XTALl 43 PO.OJADO 21 P2.3/All 43 P1.3
22 VSS 44 VCC 22 P2.41A12 44 Pl.4
BLOCK DIAGRAM
FREauENCY
REFERENCE COUNTERS
r--'------o r--'------o
XTAL2 XTAL1 TO T1
I--
I
I DSaLLATOR PROGRAM DATA TW011H11T
I ANO MEMORY MEMORY nMERIEVENT
nMlNG (16K.8 ROM) (256.8 RAM) COUNTERS
I
I
I
I
I
I
I
8DjSHARED
I CPU WITH
I SCL PORT 1
INTERNAL
INTERRUPTS
PIN DESCRIPTIONS
PIN NUMBER
MNEMONIC DIP lCC QFP TYPE NAME AND FUNCTION
Vss 20 22 16 I Ground: OV reference.
Vee 40 44 38 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation.
PO.O--O.7 39-32 43-36 37-.'30 I/O Port 0: Port 0 is an open-drain, bidirectional 1/0 port. Port 0 pins that have 1s written to them
float and can be used as high-impedance inputs. Port 0 is also the multiplexed low-order
address and data bus during accesses to external program and data memory. In this
application, it uses strong internal pull-ups when emitting 1s. Port 0 also outputs the code
bytes during program verification in the 87C654. External pull-ups are required during
program verification.
Pl.O-Pl.7 1-8 2-9 40-44, 1/0 Port 1: Port 1 is an 8-bit bidirectionalI/O port with internal pull-ups, except Pl.6 and PI. 7
1-.'3 which are open drain. Port 1 pins that have Is written to them are pulled high by the internal
pull-ups and can be used as inputs. As inputs, port 1 pins that are externally pulled low will
source current because of the internal pull-ups. (See DC Electrical Characteristics: IILl.
Port 1 also receives the low-order address byte during program memory verification.
Alternate functions include:
Pl.6 7 8 2 I/O SCl: 12C-bus serial port clock line.
Pl.7 8 9 3 I/O SDA: 12C-bus serial port data line.
P2.O-P2.7 21-28 24-.'31 18-25 I/O Port 2: Port 2 is an 8-oit bidirectional 110 port with internal pull-ups. Port 2 pins that have 1s
written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 2 pins that are externally being pulled low will source current because of the internal
pull-ups. (See DC Electrical Characteristics: IILl. Port 2 emits the high-order address byte
during fetches from external program memory and during accesses to external data memory
that use 16-bit addresses (MOVX @DPTR). In this application, it uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that use 8-bit
addresses (MOV @Ri), port 2 emits the contents of the P2 special function register.
P3.O-P3.7 10-17 II, 5, I/O Pori 3: Port 3 is an 8-bit bidirectionalI/O port with internal pUll-Ups. Port 3 pins that have 1s
13-19 7-13 written to them are pulled high by the internal pull-ups and can be used as inputs. As inputs,
port 3 pins that are externally being pulled low will source current because of the pull-ups.
(See DC Electrical Characteristics: IlL). Port 3 also serves the special features of the BOC51
family, as listed below:
10 11 5 I RxD (P3,O): Serial input port
11 13 7 0 TxD (P3,1): Serial output port
12 14 8 I IfmJ (P3,2): External interrupt
13 15 9 I INTf (P3,3): External interrupt
14 16 10 I TO (P3.4): Timer 0 external input
15 17 11 I T1 (P3.S): Timer 1 external input
16 18 12 0 WR (P3.S): External data memory write strobe
17 19 13 0 lID (P3.7): External data memory read strobe
RST g 10 4 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the
device. An internal diffused resistor to Vss permits a power-on reset using only an external
capacitor to Vee.
ALEIPRCG 30 33 27 I/O Address latch Enable/Program Pulse: Output pulse for latching the low byte of the
address during an access to external memory. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency, and can be used for external timing or clocking.
Note that one ALE pulse is S~~~~Uring each access to external data memory. This pin is
also the program pulse input during EPROM programming.
PSEN 29 32 26 0 Program Store Enable: The read strobe to external~am memory. When the 87C654 is
executing code from the external program memory, is activated twice each machine
cycle, eXcp'£~at two 1'SEJil activations are skipped during each access to external data
memory. is not activated during fetches from internal program memory.
9;Npp 31 35 29 I External Access Enable/ProgrammIng Supply Voltage: Ell: must be externally held low to
enable the device to fetch code from external program memory locations OOOOH and 3FFFH.
If Ell: is held high, the device executes from internal program memory unless the program
counter contains an address greater than 3FFFH. This pin also receives the 12.75V
programming supply voltage (Vpp) during EPROM programming.
XTALI 19 21 15 I Crystal 1 : Input to the inverting oscillator amplifier and input to the internal clock generator
circuits.
XTAL2 18 20 14 0 Crystal 2: Output from the inverting oscillator amplifier.
NOTE.
To avoid ·'atch-up· effect at power-on, the voltage on any pin at any time must not be higher than Vee + 0.5V or Vss - 0.5V, respectively.
DEVICE SPECIFICATIONS
SUPPLY VOLTAGE FREQUENCY TEMPERATURE
(V) (MHz) RANGE
DC ELECTRICAL CHARACTERISTICS
Vss= ov
TEST LIMITS
VOLl Output low voltage, port 0, ALE, PSEN IOl = 3.2mAB, 9 0.45 V
VOH1 Output high voltage; port 0 in external bus mode, IOH = -400(lA 2.4 V
ALE, PSEN, RST10 IOH = -150(lA 0.75Vcc V
IOH = -40(lA 0.9Vcc V
III Logical 0 input current, ports 1, 2, 3, 4, o to +70°C VrN = 0.45V -50 (lA
except P1.6/SCL, P1.7/SDA -40 to +85°C -75 (lA
-40 to +125°C -75 (lA
III Logical 1-to-O transition current, ports " 2, 3, o to +70°C See note 7 -650 (lA
except P1.6ISCL, Pl.7/SDA -40 to +85°C -750 (lA
-40 to +125°C -750 (lA
III Input leakage current, port 0 0.45V < VI < Vcc ±10 (lA
1L2 Input leakage current, P1.6/SCL, Pl.7/SDA OV<VI <6.0V ±10 (lA
OV < Vee < 6.0V (lA
30
MAXIMUM OPERATING MODE:
,/' Vcc = MAX
,/
ICC (mA) 20
./
./
V
10 ./
V
-
"r
/'
MAXIMUM IDLE MODE:
--
Vcc = MAX
o
o 12 16
'XTALI (MHz)
VALID ONLY WITHIN FREQUENCY SPECIRCATIONS OF DEVICE UNDER TEST.
AC ELECTRICAL CHARACTERISTICS1, 2
16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
lltct.Cl 2 Oscillator frequency 1.2(3.5) 16 MHz
It.HLL 2 ALE pulse width 85 2teLcL-40 ns
IAVLL 2 Address valid to ALE low 8 teLCL-05 ns
It.LAX 2 Address hold after ALE low 28 tcLCL~5 ns
It.LlV 2 ALE low to valid instruction in 150 4teLCL-l00 ns
2 ALE low to PSEN low 23
.. ns
\LPL teLcL-40
IpLPH 2 PSEN pulse width 143 3teLcL-45 ns
IpLiV 2 PSEN low to valid instruction in 83 3teLCL..,105 ns
!PXIX 2 Input instruction hold after PSEN 0 0 ns
IpxlZ 2 Input instruction float after PSEN 38 teLCL-25 ns
tAvlV 2 Address to valid instruction in 208 5teLcL-l05 ns
IpLAZ 2 PSEN low to address float 10 10 ns
Data Memory
IAVLL 3,4 Address valid to ALE low 28 teLcL~5 ns
tRLRH 3,4 RU pulse width 275 6teLCL-l00 ns
tWLWH 3,4 WR pulse width 275 6teLCL-l00 ns
tRLOV 3,4 RU low to valid data in 148 5tcLCL-165 ns
tRHOX 3,4 Data hold after RU 0 0 ns
tRHDZ 3,4 Data float after RU 55 2tcLCL-70 ns
\Lov 3,4 ALE low to valid data in 350 8teLcL-150 ns
IAvov 3,4 Address to valid data in 398 9teLCL-165 ns
\LWL 3,4 ALE low to RU or WR low 138 238 3teLCl-SO 3teLCL+50 ns
IAVWL 3,4 Address valid to WR low or RU low 120 4teLcL-130 ns
lavwx 3,4 Data valid to WR transition 3 tcLCL~O ns
tow 3,4 Data setup time before WR 288 7teLCL-150 ns
tWHOX 3,4 Data hold after WR 13 teLCL-OO ns
IRLAZ 3,4 RU low to address float 0 0 ns
IwHLH 3,4 RU or WR high to ALE high 23 103 teLCL-40 teLCL+40 ns
Shift Register
txLXL 5 Serial port clock cycle time3 0.75 12teLcL JlS
IaVXH 5 Output data setup to clock rising edge3 492 1OfcLcL-133 ns
txHOX 5 Output data hold after clock rising edge3 80 2teLCL-117 ns
tXHOX 5 Input data hold after clock rising edge3 0 0 ns
tXHOV 5 Clock rising edge to input data valid3 492 lOfcLCL-133 ns
External Clock
teHCX 6 Hightime3 20 20 teLCL-It.OW ns
teLCX 6 Lowtime3 20 20 teLcL -IHIGH ns
teLCH 6 Risetime3 20 20 ns
teHCL 6 Falltime3 20 20 ns
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port 0, ALE, and PSEN =100pF, load capacitance for all other outputs =8OpF.
3. These values are characterized but not 100% production tested.
AC ELECTRICAL CHARACTERISTlCS1, 2
24MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
It.LWL 3,4 ALE low to RD' or WR' low 75 175 3!cLCL-SO 3!cLCL+50 ns
tAvWL 3,4 Address valid to WR low or FlU low 92 41cLCL-75 ns
tavwx 3,4 Data valid to WR'transition 12 IcLCL-{!O ns
tow 3,4 Data setup time before WR' 162 71cLCL-130 ns
tWHOX 3,4 Data hold after WR' 17 IcLCL-25 ns
tRLAZ 3,4 RD' low to address float 0 0 ns
tWHLH 3,4 RD' or WR' high to ALE high 17 67 IcLCL-25 !cLcL+25 ns
Shift Register
tXLXL 5 Serial port clock cycle time 3 0.5 12!cLcL JlS
tavxH 5 Output data setup to clock rising edge3 283 10lcLCL- 133 ns
tXHOX 5 Output data hold after clock rising edge3 23 2!cLCL-60 ns
tXHDX 5 Input data hold after clock rising edge 3 0 0 ns
tXHDV 5 Clock rising edge to input data valid3 283 1OIcLCL-133 ns
External Clock
SOA
SCL
(INPUT/OUTPUT)
-4--*-.../1
ALE
PORTO ~7
PORT 2
ALE
IWHUl
~----tLLDV ----~.I
tLLWL --+!o<----IRLRH - - - - + I
w ____________~--------~
tRLDV
PORTO
INSTRIN
\4------tAVDV -----~
PORT 2
P2.0-P2.7 OR AB-A15 FROM DPH AB-A15 FROM PCH
ALE V
"
I+-tWHLH - -
--tLLWL tWLWH
WR
tLLAX
tAVLL I-- Iovwx
-fo I+- tWHQX
tow
PORTO
PORT 2
)< P2.G-I'2.7 OR A8-A15 FROM OPH A8-A 15 FROM PCH
INSTRUCTION 8
ALE
CLOCK
OUTPUTOATA
IovXH I~ r- tXHQX I
, t
WRITE TO SBUF
'
\ X X~ __~X~~X~~X~__~X~~X /
t
SETTI
INPUTOATA
'"----r-'
CLEAR RI
t
SETRI
Figure 5. Shift Register Mode Timing
Vcc-O-5 - - - - ~D.-7Y-cc-"'"
D.45V O,2Vcc-D.l "---""
Vcc-D.5
D.MW
~ D.2Vcc;.o,'
~~D.2~V~C~~~'l_ _ _ _ _ ,
>C VLOAD
VLOAl)+O.lV n"NG
REFERENCE
POINTS
V0ft'lJ.1V
NOTE: NOTE:
AC INPUTS DURING TESTING ARE DRIVEN AT V~,5 FOR A LOGIC '1' AND FOR TIMING PURPOSES, A PORT IS NO LONGER FLOATING WHEN A l00MV
CHANGE FROM LOAD VOLTAGE OCCURS, AND BEGINS TO FLOAT WHEN A
OA5V FOR A LOGIC '0', TIMING MEASUREMENTS ARE MADE AT VIH MIN FOR A
10DmV CHANGE FROM THE LOADED VOfilVOL LEVEL OCCURS, IOWOL ~ ±
LOGIC '1' AND VIL MAX FOR A LOGIC '0', 2OmA.
Figure 7. AC Testing InpuUOutpul Figure 8. Floal Waveform
Vee Vee
Vee Vcc
Vee RST
PO PO
RST
Vss Vss
Figure 9. lee Tesl Condition, Active Mode Figure 10. lee Tasl Condltlon,ldle Mode
All olher pins are dlsconnecled All olher pins are dlsconnecled
Vcc-O-S - - - -r:o.-:7Y~ee-'-I
OA5V o.ZVcc-O-l 1'---'1
IcHCL_
IcLCL
Figure 11. Clock Signal Waveform for lee Tesls In ACIlve and Idle Modes
IcLCH = IcIfCL = 10ns
VCC
Vee
RST
EX
PO
-
(NC) XTA12 P1.6
PI.7
XTALI
Vss
EPROM CHARACTERISTICS To program the encryption table, repeat the Reading the Signature Bytes
The 87C654 is programmed by using a 25 pulse programming sequence for The signature bytes are read by the same
modified Quick-Pulse Programming'· addresses 0 through 1FH, using the 'Pgm procedure as a normal verification of
algorithm. It differs from older methods in the Encryption Table' levels. Do not forget that locations 030H and 031 H, except that P3.S
value used for Vpp (programming supply after the encryption table is programmed, and P3.7 need to be pulled to a logic low. The
voltage) and in the width and number of the verification cycles will produce only encrypted values are:
ALEII"ROO pulses. data. (030H) 15H indicates manufactured by
Philips
The 87C654 contains two signature bytes To program the lock bits, repeat the 25 pulse (031 H) 99H indicates 87C654
that can be read and used by an EPROM programming sequence using the 'Pgm Lock
programming system to identify the device. Bit' levels. After one lock bit is programmed, ProgramNerify Algorithms
The signature bytes identify the device as an further programming of the code memory and Any algorithm in agreement with the
87C654 manufactured by Philips encryption table is disabled. However, the conditions listed in Table 3, and which
Components. other lock bit can still be programmed. satisfies the timing specifications, is suitable.
Table 3 shows the logic levels for reading the Note that the FJiJVpp pin must not be allowed
signature byte, and for programming the to go above the maximum specified Vpp level Erasure Characteristics
for any amount of time. Even a narrow glitch Erasure of the EPROM begins to occur when
program memory, the encryption table, and
above that voltage can cause permanent the chip is exposed to light with wavelengths
the lock bits. The circuit configuration and
damage to the device. The Vpp source shorter than approximately 4,000 angstroms.
waveforms for quick-pulse programming are
should be well regulated and free of glitches Since sunlight and fluorescent lighting have
shown in Figures 13 and 14. Figure 15 shows
and overshoot. wavelengths in this range, exposure to these
the circuit configuration for normal program
light sources over an extended time (about 1
memory verification.
Program Verification week in sunlight, or 3 years in room level
Quick-Pulse Programming If lock bit 2 has not been programmed, the fluorescent lighting) could cause inadvertent
The setup for microcontroller quick-pulse on-chip program memory can be read out for erasure. For this and secondary effects, It
programming is shown in Figure 13. Note that program verification. The address of the Is recommended that an opaque label be
the 87C654 is running with a 4 to SMHz program memory locations to be read is placed over the window. For elevated
oscillator. The reason the oscillator needs to applied to ports 1 and 2 as shown in temperature or environments where solvents
be running is that the device is executing Figure 15. The other pins are held at the are being used, apply Kapton tape Fluorglas
internal address and program data transfers. 'Verify Code Data' levels indicated in Table 3. part number 2345-5, or equivalent.
The contents of the address location will be
The address of the EPROM location to be The recommended erasure procedure is
emitted on port O. External pull-ups are
programmed is applied to ports 1 and 2, as exposure to ultraviolet light (at 2537
required on port 0 for this operation.
shown in Figure 13. The code byte to be angstroms) to an integrated dose of at least
programmed into that location is applied to If the encryption table has been programmed, 15W-sec/cm2 . Exposing the EPROM to an
port O. RST, PSEN and pins of ports 2 and 3 the data presented at port 0 will be the ultraviolet lamp of 12,OOOuW/cm2 rating for
specified in Table 3 are held at the 'Program exclusive NOR of the program byte with one 20 to 39 minutes, al a distance of about 1
Code Data' levels indicated in Table 3. The of the encryption bytes. The user will have to inch, should be sufficient. Erasure leaves the
ALEII"ROO is pulsed low 25 times as shown know the encryption table contents in order to array in an all 1s state.
in Figure 14. correcUy decode the verification data. The
encryption table itself cannot be read out
5V
Vee
"- A
AO-A7 - Pl PO PGMDATA
'I
1 RST mYPP +12.75V
XTAL2 P2.7 1
~MHz~ 1- P2.& 0
T T XTALl P2.~5
.A
A8-A13
~ Vss
"
-==-
Figure 13. Programming Configuration
~1«~---------------------25PU~5 ------------------------~
ALEIPJrolE
10"" ~N ~ 1"'.---------10""'"101--------..!~1
ALEIPJrolE o~1 ____________~fl~__________~fl~___
Figure 14. PROG"Waveform
Vce
AO-A7 Pl PO PGMDATA
RST mYPP
P3.6 ALEIPROO
P3.7 87C654 P!!EII
XTAL2 P2.7 o "EIOOJ[E
P2.& 0
Vss
-
Figure 15. Program Verification
PROGRAMtIING* VERIRCAnON*
P1.D-P1.7 ADDRESS ADDRESS
"'
-
P2.~3 ,/
- - IAVOV
ALEiPllllG
love L -
IAVG :-----
I-
1"\ ..
- -- h
~
IGHDX
IGHAX
IGLGH -
ISHGL I-
f- -.
• IGHGL
IGHSL
V
P2.7
"ENJJI[E
/
LOGtCO
------------ -----------------------------
IEHSH '"
-----------
'3.
IELO~
I
LOGIC.
I
--- ..
IEHOZ
_-------
DESCRIPTION
The 83CE654 Single-Chip 8-Bit
Microcontroller is manufactured in an
advanced CMOS process and is a derivative
of the BOC51 microcontroller family. The
83CE654 has the same instruction set as the
BOC51. Two versions of the derivative exist:
83CE654 - 16k bytes mask programmable
..
m;
·L=Sllim''.
O
..
."
BUS
Q
..
.. "
.".
:: ..
".
,
'.
1=
1
0
OFP
j
F33
(SOT 311)
ROM. 256 bytes RAM
BOCE654 - ROMless version of the 11= F23
FEATURES
83CE654
• 80CSl central processing unit H H
This device provides architectural 12 22
enhancements that make it applicable in a • 16k x 8 ROM expandable externally to
variety of applications for general control 64k bytes
systems. The 8XCE654 contains a • 256 x 8 RAM. expandable externally to Pin func1lon Pin function
non-volatile 16k x 8 read-only program 1 Pl.5 23 P2.!>AI3
64k bytes
2 Pl.6ISCl 24 P2.6IAI4
memory (83CE654). a volatile 256 x 8
• Two standard 16-bit timer/counters 3 Pl.7/SDA 25 P2.7/AI5
read/write data memory. four 8-bit 110 ports. 4 RST 26 PSrn
two 16-bit timer/event counters (identical to • Four 8-bit 110 ports 5 P3.OIRxD 27 ALE
the timers of the BOC51). a mUlti-source. 6 VSS4 28 VSS2
• 12C-bus serial 110 port with byte oriented
two-priority-Ievel. nested interrupt structure. 7 P3.1ITxD 29 Ell
master and slave functions
an 12C interface. UART and on-chip oscillator 8 P3.2I1m1l 30 PO.7/AD7
and timing circuits. For systems that require • Full-duplex UART facilities 9 P3.3ITIITf 31 PO.6IADS
10 P3.4IT0 32 PO.!>AD5
extra capability. the 8XCE654 can be
• ROM code protection 11 P3.!>Tl 33 PO.41AD4
expanded using standard TTL compatible
12 P3.6IWR 34 PO.3'AD3
memories and logic. • XTAL frequencey range: 1.2MHz to 16MHz 13 P3.7IID 35 PO.21AD2
14 XTAL2 36 PO.lIADI
The device also functions as an arithmetic • Software enable/disable of ALE output
15 XTAL1 37 PO.OIADO
processor having facilities for both binary and pulse 16 38
VSSI VCC2
BCD arithmetic plus bit-handling capabilities.
• Electromagnetic compatibility 17 VCCI 39 VSS3
The instruction set consists of over 100
improvements 18 P2.OIAS 40 Pl.0
instructions: 49 one-byte. 45 two-byte and 17 19 P2.lIA9 41 Pl.l
three-byte. With a 16MHz crystal. 58% of the • Operating ambient temperature range: 20 P2.21Al0 42 Pl.2
instructions are executed in 0.75jlS and 40% - P83CE654 FBB T amb O°C to + 70°C 21 P2.31Al1 43 Pl.3
in 1.5jlS. Multiply and divide instructions 22 P2.41AI2 44 Pl.4
- P83CE654 FFB Tamb -40°C to +85°C
require 311S.
LOGIC SYMBOL
VCCVSS
I
ELECTROMAGNETIC • Separate Vee pins for the internal logic and software control (bitS in the SFR PCON:
COMPATIBILITY (EMC) "RFI"); if disabled, no ALE pulse will occur.
the port buffers
ALE pin will be pulled down internally,
IMPROVEMENTS • Internal decoupling capacitance improves switching an external address latch to a
Primary attention was paid on the reduction the EMC radiation behavior and the EMC quiet state. The MOVX instruction will still
of electromagnetic emission of the immunity toggle ALE as a normal MOVX. ALE will
microcontroller PB3CE654. retain its normal high value during Idle
• External capacitors are to be located as mode and a low value during Power-down
The following features effect in reducing the close as possible between pins Vee2 and
electromagnetic emission and additionally mode while in the "RFI" reduction mode.
VSS3 as well as Vee1 and VSS2 ; ceramic Additionally during internal access (85; = 1)
improve the electromagnetic susceptibility: chip capacitors are recommended (l00nF). ALE will toggle normally when the address
• Two supply voltage pins (Vee) and four exceeds the internal program memory size.
ground pins (Vss) with a pair of Vee and Useful in applications that require no external
memory or temporarily no external memory: During external access (85; = 0) ALE will
Vss at two adjacent pins in the center at always toggle normally, whether the flag
one side of the package and at two • The ALE output signal (pulses at a "RFI" is set or not.
adjacent pins at the opposite side of the frequency of fosc/6) can be disabled under
package and one more Vss pin at each of
the other two sides of the package
BLOCK DIAGRAM
FREQUENCY
REFERENCE COUNTER INPUTS SHARED WITH PORT 3
r-'---1 ,.-'--,
XTA1.2 XTAL1 TO Tl
-----------1
~~--~~ 1
OSCILLAlOR PROGRAM DATA TW016-111T 1
AND MEMORY MEMORY TlMER/EVENT
moiNG (16K,8ROM) (256,8 RAM) COUNTERS 1
sDjSHARED
WITH
SCL PORT 1
INTERNAL
INTERRUPTS
PIN DESCRIPTIONS
PIN
MNEMONIC TYPE NAME AND FUNCTION
NUMBER
Vss1, Vss 2, 16,28, I Ground: OV reference. All pins must be connected.
VSS3, VSS4 39,6
VCC1, VCC2 17,38 I Power Supply: This is the power supply voltage for normal, idle, and power-down operation. Both pins
must be connected.
PO.CHl.7 37-30 110 Port 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 pins that have 1s written to them float and
can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and data bus
during accesses to external program and data memory. In this application, it uses strong internal pull-ups
when emitting 1s. Port 0 can sink/source 8 LSTTL inputs.
P1.D-P1.7 40-44, 110 Port 1: Port 1 is an 8-bit bidirectional 110 port with internal pull-ups, except P 1.6 and P1. 7 which are open
1-3 drain. Port 1 pins that have 1s written to them are pulled high by the intemal pull-ups and can be used as
inputs. As inputs, port 1 pins that are externally pulled low will source current because of the internal
pull-ups. (See DC Electrical Characteristics: IILl. Port 1 also receives the low-order address byte during
program memory verification. Alternate lunctions include:
P1.6 2 110 SCL: 12C-bus serial port clock line.
P1.7 3 1/0 SDA: 12C-bus serial port data line.
P2.D-P2.7 18-25 1/0 Port 2: Port 2 is an B-bit bidirectional 1/0 port with internal pull-ups. Port 2 pins that have 1s written to
them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins that are
externally being pulled low will source current because of the internal pUll-Ups. (See DC Electrical
Characteristics: IILl. Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that use 16-bit addresses (MOVX @DPTR). In this
application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory
that use 8-bit addresses (MOV @Ri), port 2 emits the contents of the P2 special function register.
P3.D-P3.7 5, 1/0 Port 3: Port 3 is an 8-bit bidirectional 1/0 port with internal pull-ups. Port 3 pins that have 1s written to
7-13 them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins that are
externally being pulled low will source current because 01 the pull-ups. (See DC Electrical Characteristics:
IILl. Port 3 also serves the special features of the 80C51 farnily, as listed below:
5 I RxD (P3.0): Serial input port
7 0 TxD (P3.1): Serial output port
8 I lffrn (P3.2): External interrupt 0 or gate control input for timerlevent counter 0
9 I rnTi (P3.3): External interrupt 1 or gate control input for timerlevent counter 1
10 I TO (P3.4): Timer 0 external input
11 I T1 (P3.5): Timer 1 external input
12 0 WR (P3.6): External data memory write strobe
13 0 lID (P3.7): External data memory read strobe
RST 4 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the device. An
internal pull-down resistor to Vss permits a power-on reset using only an external capacitor to Vcc.
ALE 27 1/0 Address Latch Enable: Output pulse for latching the low byte of the address during an access to
external memory. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency,
and can be used for external timing or clocking. Note that one ALE pulse is skipped during each access to
external data memory. ALE can sink/sourse 8 LSTTL inputs. It can drive CMOS inputs without an external
pull-up. To prohibit the toggling of ALE pin (RFI noise reduction) the bit RFI in the PCON Register
(PCON.5) must be set by software. This bit is cleared on RESET and can be cleared by software. When
set, ALE pin will be pulled down internally, switching an external address latch to a quiet state. The MOVX
instruction will still toggle ALE as a normal MOVX. ALE will retain its normal high value during Idle mode
and a low value during Power-down mode while in the "RFI" mode. Additionally during internal access
(EJ!: ; 1) ALE will toggle normally when the address exceeds the internal program memory size. During
external access (EJ!: ; 0) ALE will always toggle normally, whether the flag "RFI" is set or not.
l'SER 26 0 Program Store Enable: The read strobe to external program memory. When the 8XCE654 is executing
code from the external program memory, l'SER is activated twice each machine cycle, except that two
PSrn activations are skipped during each access to external data memory. PSrn is not activated during
fetches from internal program memory. PSrn can sink/source 8 LSTTL inputs.
E1I: 29 I External Access Enable: E1I: must be externally held low to enable the device to fetch code from
external program memory locations OOOOH and 3FFFH. If E1I: is held high, the device executes from
internal program memory unless the program counter contains an address greater than 3FFFH. E1I: is not
allowed to floal.
XTAL1 15 I Crystal 1 : Input to the inverting oscillator amplilier and input to the internal clock generator circuits.
XTAL2 14 0 Crystal 2: Output from the inverting oscillator amplifier.
NOTE:
To avoid "latCh-up" effect at power-on, the voltage on any pin at any time must not be higher or lower than Vee + 0.5V or Vss - 0.5V,
respectively.
ROM CODE PROTECTION Power-on Reset (See Figure 1.) Power-Down Mode
(83CE654) When Vee is turned on, and provided its In the power-<!own mode, the oscillator is
The B3CE654 has an additional security rise-time does not exceed 10ms, an stopped and the instruction to invoke
feature. ROM code protection may be automatic reset can be obtained by power-down is the last instruction executed.
selected by setting a mask-programmable connecting the RST pin to Vee via a 2.2~F Only the contents of the on-chip RAM are
security bit (Le., user dependent). This capacitor. When the power is switched on, preserved. A hardware reset is the only way
feature may be requested during ROM code the voltage on the RST pin is equal to Vee to terminate the power-down mode. the
submission. When selected, the ROM code minus the capacitor voltage, and decreases control bits lor the reduced power modes are
is protected and cannot be read out at any from Vee as the capacitor charges through in the special function register PCON. Table 2
time by any test mode or by any instruction in the internal resistor (RRST) to ground. The shows the state 01 the 110 ports during low
the external program memory space. larger the capacitor, the more slowly VRST current operating modes.
decreases. V RST must remain above the
The MOVC instructions are the only lower threshold of the Schmitt trigger long Power Control Register PCON
instructions that have access to program enough to effect a complete reset. The time These special modes are activated by
code in the internal or external program required is the oscillator start-up time, plus 2 soitware via the SpeCial Function Register
memory. The EA input is latched during machine cycles. PCON. Its hardware address is 87H. PCON
RESET and is "don't care" alter RESET This is not bit addressable. The reset value of
implementation prevents reading internal PCON is (OxOxOOOO).
program code by switching from external
vcc---.-----------------, 76543210
program memory to internal program memory
during a MOVC instruction or any other
PCON
(87H) 1 SMQ9 -I RRI -I GFIIGFOI POIIDLI
instruction that uses immediate data.
vce Bit Symbol Function
Table 1 lists the access to the internal and PCON.7 SMOD Double Baud rate bit.
external program memory by the MOVC When set to logic 1 the
instructions when the security bit has been baud rate is doubled when
+ 83CE654
set to a logical "1": 80CE654 limer 1 is used to
generate baud rate, and
the Serial Port is used in
OSCILLATOR modes 1, 2 or 3.
RST
CHARACTERISTICS PCON.6 (reserved for future use·)
XTAL 1 and XTAL2 are the input and output, PCON.5 RFI When set to logic 1 the
respectively, of an inverting amplifier. The toggling of ALE pin is
pins can be configured for use as an on-chip prohibited. This bit is
oscillator, as shown in the Logic Symbol, cleared on RESET.
page 560. PCON.4 - (reserved for future use·)
PCON.3 GFl General purpose flag bit
To drive the device from an external clock Figure 1. Power-on Reset
PCON.2 GFO General purpose flag bit
source, XTAL1 should be driven while XTAL2
PCON.l PO Power-down bit. Setting
is lelt unconnected. There are no
this bit activates
requirements on the duty cycle of the external Idle Mode Power-down mode.
clock signal, because the input to the internal In the idle mode, the CPU puts itself to sleep PCON.O IDL Idle mode bit. Setting this
clock circuitry is through a divide-by-two while all of the on-chip peripherals stay bit activates the Idle
flip-flop. However, minimum and maximum active. The instruction to invoke the idle mode. If 1s are written to
high and low times specified in the data sheet mode is the last instruction executed in the PO and IDL at the same
must be observed. normal operating mode before the idle mode time, PO takes
is activated. The CPU contents, the on-chip precedence.
Reset
RAM, and all of the special function registers NOTE:
A reset is accomplished by holding the RST
remain intact during this mode. The idle mode • User software should not write 1s to
pin high for at least two machine cycles (24 reserved bits. These bits may be used in
can be terminated either by any enabled
oscillator periods), while the oscillator is future 80C51 family products to invoke
interrupt (at which time the process is picked
running. To insure a good power-on reset, the new features. In that case, the reset or
up at the interrupt service routine and
RST pin must be high long enough to allow inactive value of the new bit will be 0, and
continued), or by a hardware reset which
the oscillator time to start up (normally a few its active val ue will be 1. The value read
starts the processor in the same manner as a from a reserved bit is indeterminate.
milliseconds) plus two machine cycles. At
power-on reset.
power-on, the voltage on Vee and RST must
come up at the same time for a proper
start-up.
Table 1.
ACCESS TO INTERNAL ACCESS TO EXTERNAL
PROGRAM MEMORY PROGRAM MEMORY
Bits CRO, CRl and CR2 determine the serial clock frequency that Is generated In the master mode of operation.
DEVICE SPECIFICATIONS
SUPPLY VOLTAGE FREQUENCY TEMPERATURE
(V) (MHz) RANGE
DC ELECTRICAL CHARACTERISTICS
Vrx; = 5V (±lO"Io), Vss = ov, Tarrll = O°C to +70°C or -40°C to +B5°C
TEST LIMITS
SYMBOL PARAMETER PART TYPE CONDITIONS MIN. MAX. UNIT
VIHl Input high voltage, XTAl1, RST 010 +70°C 0.7Vrx; Vrx;+O.5 V
-40 to +B5°C O.7Vee+O.1 Vrx;+0.5 V
Vou Output low voltage, port 0, ALE, !'"SEN4 IOL =3.2mA7 0.45 V
VOL2 Output low voltage, PI .6/SCl, PI. 7/SDA4 IOL = 3.0mA7 0.4 V
VOH Output high voltage, ports I, 2, 3, ALE, !'"SEN IOH =-OO/lA 2.4 V
IOH =-25/lA 0.75Vrx; V
IOH =-10/lA 0.9Vcc V
40
30
MAXIMUM OPERAnNG MODE:
vee. MAX
ICC(mA) 20
./
,,/
,,/
,,/
V
10
,. ,."
00 4 8 12 16
ixTAL1IMHz)
AC ELECTRICAL CHARACTERISTICS1, 2
16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
lltcLcL 2 Oscillator frequency 1.2 16 MHz
It.HLL 2 ALE pulse width 85 2teLCL-40 ns
IAvLL 2 Address valid to ALE low 8 teLcL-55 ns
It.LAX 2 Address hold alter ALE low 28 teLcL~5 ns
It.LlV 2 ALE low to valid in struction in 150 4teLcL-l00 ns
It.LPL 2 ALE low to PSEN low 23 teLCL--40 ns
IpLPH 2 PSEN pulse width 143 3!cLcL--45 ns
IpLiV 2 PSEN low to valid instruction in 83 3!cLcL-l05 ns
IpXIX 2 Input instruction hold alter PSEN 0 0 ns
IpXIZ 2 Input instruction float alter PSEN 38 teLcL-25 ns
IAvlV 2 Address to valid instruction in 208 5teLCL-l05 ns
IpLAZ 2 PSEN low to address lIoat 10 10 ns
Data Memory
IAvLL 3,4 Address valid to ALE low 28 teLCL~5 ns
tRLRH 3,4 FlU pulse width 275 6teLCL-l00 ns
tWLWH 3,4 WR pulse width 275 6teLCL-l00 ns
tRLDV 3,4 FlU low to valid data in 148 5teLCL-165 ns
tRHDX 3,4 Data hold alter FlU 0 0 ns
tRHDZ 3,4 Data lloat alter FlU 55 2!cLcL-70 ns
It.LDv 3,4 ALE low to valid data in 350 8teLCL-150 ns
tAvDV 3,4 Address to valid data in 398 9teLCL-165 ns
It.LWL 3,4 ALE low to FlU or WR low 138 238 3!cLcL-50 3teLCL+50 ns
tAVWL 3,4 Address valid to WR low or FlU low 120 4!cLCL-130 ns
tavwx 3,4 Data valid to WR transition 3 teLCL-60 ns
low 3,4 Data setup time before WR 288 7teLCL-150 ns
tWHQX 3,4 Data hold alter WR 13 teLcL-50 ns
tRLAZ 3,4 FlU low to address float 0 0 ns
tWHLH 3,4 FlU or WR high to ALE high 23 103 teLcL--40 teLCL+40 ns
Shift Register"
tXLXL 5 Serial port clock cycle time 0.75 12teLCL J!S
taVXH 5 Output data setup to clock rising edge 492 10teLCL-133 ns
tXHQX 5 Output data hold after clock rising edge 80 2teLCL-117 ns
tXHDX 5 Input data hold after clock rising edge 0 0 ns
tXHDV 5 Clock rising edge to input data valid 492 10teLCL-133 ns
External Clock
teHCX 6 High time 20 20 teLCL-It.OW ns
teLCX 6 Low time 20 20 teLCL - tHIGH ns
teLcH 6 Rise time 20 20 ns
teHcL 6 Fall time 20 20 ns
NOTES:
1. Parameters are valid over operating temperature range unless otherwise specified.
2. Load capacitance for port 0, ALE, and PSEN = 100pF, load capacitance for all other outputs =80pF.
3. Test condition: Tant> = O°C to +70C; Vee =5V + 10%; Vss = OV; load capacitance =BOpF.
OSCillator Circuitry
The capacitors connected to the crystal
should be: C1 = C2 = 2OpF.
ALE
PORTO AO-A7
PORT 2 A8-A15
ALE
tWHlH
i+-----tLlDv ----.r~1
w ____________-+________--+t--- tRlRH ---~
tLlWl
~
PORTO
DATA IN AO-A7 FROM PCl INSTRIN
f4-------tAvDV -----.r
PORT 2
P2.0-P2.7 OR Aa-A15 FROM DPH A8-A15 FROM PCH
ALE
V
" -tWHlH-
~tllWl tWlWH
WR
ILLAX
IAVLL f4--- tavwx --l> +- IWHOX
low
PORTO
=>---< FROM~~OPL X
j4-tAVWl-
OATAOUT >( Ar>-A7 FROM PCl INSTRIN
PORT 2
)< P2.0-P2.7 OR A8-A15 FROM DPH A8-A15 FROM PCH
INSTRUCTION 4
ALE
CLOCK
------,
r- tXLXL
-1
IOVXH I~ i'XHOX I
OUTPUT DATA
,
t
WRITE TO SBUF
!
\ X X~ __~X~__~X~~X~__X====X~~/
t
SETTI
INPUT DATA
'----r'
CLEAR RI
t
SETRI
Figure 5. Shift Reglsler Mode Timing
vcc-as - - - -rO-.7V~cc-"
o.45V O.2VC~1 1'-.._-'1
teLCL
2.
4V
O.45V
=X 2.0V
...;O';;;s"-v_ _ _ _ __
>C uv
O.4SV
.
-----le
=$.o.a-V------o-.sv
I----FLOAT
2.OV 2.0V
NOTE:
f<C INPUTS DURING TESTING ARE DRIVEN AT 2.4V FOR A LOGIC .,. AND O.4SV NOTE:
FOR A LOGIC '0'. TIMING MEASUREMENTS ARE MADE AT2.0V FOR A LOGIC .,. THE FLOAT STATE IS DEFINED AS THE POINT AT WHICH A PORT 0 PIN SINKS
AND O.BV FOR A LOGIC '0'. 3.2MA OR SOURCES 400115 AT THE VOLTAGE TEST LEVELS.
Vc~s - - - - -O.7V-CC-'
O.4SV O.2Vcc-a1 1'---1
teHCL_
teLCL
Figure 9. Clock Signal Waveform for Icc Tests In Active and Idle Modes
=
teLCH teHCL 5ns =
lI
i~
I. •.• ·. ·. • '. .• . '•. •'. •.,.,.~
•. • . ,•. •. . . . •. •. ,.•
~L~
Purchase of Philips' 12C components conveys a license under the
Philips' 12C patent to use the components In the 12C-system
provided the system conforms to the 12C specifications defined by Philips.
(FFH) 255
Special
Function
Reglstera
(80H) 128
(3FH) 63
Intemlll Data
RAM
(OOH)O
9F 9E 9D 9C 9B 9A 99 98
12CON"# l2Ccontrol 98HIRD ROAT I ATN I OROY I ARl I STR I STP I MASTER I - 81H
WR CXA I 10LE I COR I CARL I CSTR I CSTP I XSTR I XSTP
12DAT"# l2Cdata 99H/RO ROAT I 0 I 0 I 0 I 0 I 0 I 0 I 0 SOH ,,"
WR XOATI X, I X I X I X I X I X J X
FF FE FO FC FB FA F9 F8
12STA·# 12C control F8H - 1 10lE 'I XDATA 1 XACrv[ MAKSTR I MAKSTP I XSTR 1 XSTP xOl00000B
AF AE AD AC AB AA A9 AS
IE·# Interrupt enable A8H EA I - I - I EI2 I ETI I EXl I ETO I EXO OOH
82 81 80
PO·# PortO 80H - 1 - 1 - J ~
97 96 95 94 93 92 91 90
Pl· Port 1 90H TO Inm I IFIm I - J - J - J - J - FFH
P3· Port 3 BOH B7 I B6 I B5 J B4 J B3 J B2 J Bl J BO FFH
07 06 05 04 03 02 01 00
PSW" Program status word DOH CY I AC I FO I RSl I RSO I OV J - J P OOH
I/O Pon Structure register pair overflows, the register pair is Note that the positions of the IEOIITO and
The BXC751 has two B-bit ports (ports 1 reloaded with the values in registers RTH and IElllTl bits are transposed from the positions
and 3) and one 3-bit port (port 0). All three RTl. The value in the reload registers is left used in the standard BOC51 TCON register.
ports on the BXC751 are bidirectional. Each unchanged. See the B3C751 counter/timer
Timer I is used to control the timing of the 12C
consists of a latch (special function register block aagram in Figure 2. The TF bit in
bus and also to detect a "bus locked"
PO, PI, P3), an output driver, and an input special function register TCON is set on
condition, by causing an interrupt when
buffer. Three port 1 pins and two port 0 pins counter overflow and, if the interrupt is
nothing happens on the 12C bus for an
are multifunctional. In addition 10 being port enabled, will generate an interrupt.
inordinately long period of time while a
pins, these pins serve the function of special
TeON Register transmission is in progress. lithe interrupt
features as follows:
does not occur, the program can attempt to
PonPln Alternate Function IGATEI CIT I TF I TR I lEO I lTD IIE1 I IT! I correct the fault and allow the last lze
PO.O 12C clock (SCl) USB LSB transmission to be repeated.
PO. 1 12C data (SOA)
GATE - Timer/counter is enabled only The 12C watchdog timer. timer I, is also
Pl.5 INTO (external interrupt 0 input)
when INTO pin is high, and TR available as a general-purpose fixed-rate
Pl.6 INT1 (external interrupt 1 input)
is 1. timer when the 12C interlace is not being
Pl.7 TO (timer 0 external input)
0 - Timer/counter is enabled used. A clock rate of 1/12 the oscillator
Ports 1 and 3 are identical in structure to the whenTRisl. frequency forms the input to the timer. Timer I
same ports on the 8OC51. The structure of CIT - Counterltimer operation from has a timeout interval of 1024 machine cycles
port 0 on the BXC751 is similar to that of the TO pin. when used as a fixed-rate timer.
8OC51 but does not include address/data 0 - Timer operation from intemal
input and output circuitry. As on the BOC51 , clock. 12(: Serial Interface
ports 1 and 3 are quasi-bidirectional while TF 1 - Set on overflow of TH. The 12C bus uses two wires (SOA and SCL)
port 0 is bidirectional with no internal pullups. 0 - Cleared when processor to transfer information between devices
vectors to interrupt routine and connected to the bus. The main features of
llmeriCounter by reset. the bus are:
TR 1 - Timer/counter enabled. • Bidirectional data transfer between masters
The BXC751 has two timers: a 16-bit
0 - Timer/counter disabled. and slaves
timer/counter and a 1O-bit fixed-rate timer.
lEO 1 - Edge detected in TFrrn.
The lB-bit timer/counter's operation is similar • Serial addressing of slaves (no added
ITO 1 - 1NTlJ is edge triggered.
to mode 2 operation on the 8OC51 , but is wiring)
extended to 16 bits. The timer/counter is
0 - TFrrn is level sensitive.
lEI 1 - Edge detected on lliITI. • Acknowledgment after each transferred
clocked by either 1/12 the oscillator
frequency or by transitions on the TO pin. The
1T1 1 - lliITI is edge triggered. byte
0 - lliITI is level sensitive.
CIT pin in special function register TCON
• Multimaster bus
selects between these two modes. When the These flags are functionally identical to the
TCON TR bit is set, the timer/counter is corresponding BOC51 flags, except that there • Arbitration between simultaneously
enabled. Register pair TH and Tl are is only one timer on the 83C751 and the flags transmitting masters without corruption of
incremented by the clock source. When the are therefore combined into one register. serial data on bus
Int.
A large family of 12Ccompatible ICs is performance of the 12C bus. See special be written to send the Ack bit and
available. See the 120 section of this manual function register 12CFG description for clearDRDY.
for more details on the bus and available ICs. prescale values (CTO, CTI). ATN "ATteNtion" is I when one or more
The 83C7511 2C subsystem includes The MAXIMUM SCL CHANGE time is of DRDY, ARL, STR, or STP is I.
important, but its exact span is not critical. Thus, ATN comprises a single bit
hardware to simplify the software required to
The complete 10 bits of timer I are used to that can be tested to release the
drive the 120 bus. The hardware is a single bit
count out the maximum time. When 12C 12C service routine from a "wait
interface which in addition to including the
operation is enabled, this counter is cleared loop."
necessary arbitration and framing error
checks, ·includes clock stretching and a bus by transitions on the SCL pin. The timer does DRDY "Data ReaDY" (and thus ATN) is set
timeout timer. The interface is synchronized not run between 120 frames (i.e., whenever when a rising edge occurs on SCL,
to software either through polled loops or reset or stop occurred more recendy than the except at idle slave. DRDY is
interrupts. Refer to the application note last start). When this counter is running, it will cleared by writing CDR = I, or by
AN422, in Section 4, entitled ·Using the carry out after 1020 to 1023 machine cycles writing or reading the 12DAT
axC751 Microcontroller as an 12C Bus have elapsed since a change on SCL. A . register. The following low period
Master" for additional discussion of the carrY out causes a hardware reset of the on SCL is stretched until the
83C751 12C interface and sample driver 83C751 12C interface and generates an program responds by clearing
routines. interrupt if the timer I interrupt is enabled. In DRDY.
cases where the bus hang up is due to a lack Checking ATN and DRDY
Six time spans are important in 12C operation of software response by this 83C751, the
and are insured by timer I: reset releases SCL and allows 120 operation When a program detects ATN = I, it should
• The MINIMUM HIGH time for SCL when among other devices to continue. next check DRDY. " DRDY = I, then if it
this device is the master. receives the last bit, it should capture the
12C Interrupts data from RDAT (in 12DAT or 12CON). Next, if
• The MINIMUM LOW time for SCL when " 12C interrupts are enabled (EA and EI2 are the next bit is to be sent, it should be written
this device is a master. This is not very both set to I), an 12C interrupt will occur to 12DAT. One way or another, it should clear
important for a single-bit hardware interface wheneverthe ATN flag is set by a start, stop, DRDV' and then return to monnoring ATN.
like this one, because the SCL low time is arbitration loss, or data ready condition (refer Note that if any of ARL, STR, or STP is set,
stretched until the software responds to the to the description of ATN following). In clearing DRDY will not release SCL to high,
12C flags. The software response time practice, it is not efficient to operate the 12C so that the 12C will not go on to the next bit II
normally meets or exceeds the MIN La interface in this fashion because the 12C a program detects ATN = I, and DRDY = 0, it·
time. In cases where the software interrupt service routine would somehow should go on to examine ARL, STR, and
responds within MIN HI + MIN La) time, have to distinguish between hundreds of STP.
timer I will ensure that the minimum time is possible conditions. Also, since 12C can
met. operate at a fairly high rate, the software may ARL ·Arbitration Loss" is 1 when
execute faster if the code simply waits for the transmit Active was set, 'but this
• The MINIMUM SCL HIGH TO SDA HIGH
12C interface. 83C751 lost arbitriition to another
time in a stop condition.
transmitter. Transmit Active is
• The MINIMUM SDA HIGH TO SDA LOW Typically, the 12C interrupt should only be cleared when ARLis I. There are
time between 12C stop and start conditions used to indicate a start condition at an idle four separate cases in which ARL is
(4.7I1S, see spec.). slave device, or a stop condition at an idle sel..
master device (if it is waning to use the 12C 1. II the program sent a 1 or
• The MINIMUM SDA LOW TO SCL LOW bus). This is accomplished by enabling the repeated start, but another
time in a start condition. 12C interrupt only during the aforementioned device sent a 0, or a stop, so
conditions. that SDA is 0 at the rising edge
• The MAXIMUM SCL CHANGE time while
an 12C frame is in progress. A frame is in of SCL. (II the other device sent
12<: Register 12CON
progress between a start condition and the a stop, the setting of ARL will be
following stop condition. This time span followed shordy by STP being
serves to detect a lack of software sel.)
response on this 8XC751 as well as 2. II the program sent a I, but
extemal12C problems. SCL ·stuck low· another device sent a repeated
indicates a faulty master or slave. SCL start, and it drove SDA low
Reading 12CON before the 83C751 could drive
·stuck high" may mean a faulty device, or
that noise induced onto the 12C bus caused RDAT The data from SDA is captured into SCL low. (This type of ARL is
all masters to withdraw from 12C arbitration. "Receive DATa· whenever a rising always accompanied by
edge occurs on SCL. RDAT is also STR= 1.)
The first five of these times are 4.711S (see available (with seven low-order 3. In master mode, if the program
12C specification) and are covered by the low zeros) in the 12DAT register. The sent a repeated start, but
order three bits of timer I. Timer I is clocked difference between reading it here another device sent a I, and n
by the 8XC751 oscillator, which can vary in and there is that reading 12DAT drove SCL low before this
frequency from 0.5 to 16MHz. Timer I can be clears DRDY, allowing the 12C to 83C751 could drive SDA low.
preloaded with one of four values to optimize proceed on to another bil. Typically, 4. In master mode, if the program
timing for different osciilator frequencies. At the first seven bits of a received sent stop, but it could not be
lower frequencies, software response time is byte are read from 12DAT, While the sent because another device
increased and will degrade maximum. 8th is read here.. Then 12DAT can sentaO.
STR "STaRt" is set to a 1 when an 12C CSTP Writing a 1 to "Clear SToP" clears violation. The programmer need not worry
start condition is detected at a Iile STP bit. Note that if one or about Iilis possibility because XDAT is
non-idle slave or at a master. (STR more of DRDY, ARL, STR, or STP applied to SDA only when SCL is low.
is not set when an idle slave is 1, the low time of SCL is
Conversely, a program Iilat includes an 12C
becomes active due to a start bit; stretched untillile service routine
service routine may take a long time to
Iile slave has noliling useful to do responds by clearing Iilem.
respond to DRDY. Typically, an 12C routine
untillile rising edge of SCL sets XSTR Writing 1s to "Xmit repeated STaRt"
DRDY.) operates on a flag-polling basis during a
and CDR tells Iile 12C hardware to message, with interrupts from oliler
STP "SToP" is set to 1 when an 12C stop send a repeated start condition. peripheral functions enabled. If an interrupt
condition is detected at a non-idle This should only be at a master. occurs, it will delay the response of Iile 12C
slave or at a master. (STP is not set Note Iilat XSTR need not and service routine. The programmer need not
for a stop condition at an idle should not be used to send an worry about this very much eililer, because
slave.) "initial" (nonrepeated) start; it is Iile 12C hardware stretches Iile SCL low time
MASTER "MASTER" is 1 if this 83C751 is sent automatically by the 12C untillile service routine responds. The only
currently a master on Iile 12C. hardware. Writing XSTR = 1 constraint on Iile response is Iilat it must not
MASTER is set when MASTRO is 1 includes the effect of writing 12DAT exceed the Timer I time-out, which is at least
and Iile bus is not busy (i.e., if a wilil XDAT = 1; it sets Transmit
765 microseconds.
start bit hasn't been received since Active and releases SDA to high
reset or a "Timer I" time-out, or if a during Iile SCL low time. After SCL 12C Register I2CFG
stop has been received since Iile goes high, the 12C hardware waits
last start). MASTER is cleared for Iile suitable minimum time and
when ARL is set, or after Iile Iilen drives SDA low to make the
software writes MASTRO = 0 and start condition.
Iilen XSTP = 1. XSTP Writing 1s to "Xmit SToP" and CDR
tells Iile 12C hardware to send a SLAVEN Writing a 1 to "SLAVe ENable"
Writing 12CON stop condition. This should only be enables Iile slave functions of the
done at a master. If Iilere are no 12C subsystem. If SLAVEN and
Typically, for each bit in an 12C message, a MASTRO are 0, Iile 12C hardware
service routine waits for ATN = 1. Based on more messages to initiate, Iile
service routine should clear Iile is disabled. This bit is cleared to 0
DRDY, ARL, STR, and STP, and on Iile by reset and by an 12C time-out.
MASTRO bit in 12CFG to 0 before
current bit position in the message, it may MASTROWriting a 1 to "MASTRO" requests
writing XSTP with 1. Writing XSTP
!hen write 12CON wilil one or more of Iile
following bits, or it may read or write the
=1 includes the effect of writing mastership of Iile 12C. If a frame
12DAT wilil XDAT = 0; it sets from anoliler master is in progress
12DAT register. when Iilis bit is changed from 0 to
Transmit Active and drives SDA low
CXA Writing a 1 to "Clear Xmit Active" during Iile SCL low time. After SCL 1, action is delayed until a stop
clears Iile Transmit Active state. goes high, Iile 12C hardware waits condition is detected. Then, or
(Reading Iile 12DAT register also for Iile suitable minimum time and immediately if a frame is not in
does Iilis.) Iilen releases SDA to high to make progress, a start condition is sent
Iile stop condition. and DRDY is set (Iilus making ATN
Regarding Transmit Active 1 and generating an 12C interrupt).
120 Register 12DAT When a master wishes to release
Transmit Active is set by writing Iile 12DAT mastership status of Iile 12C, it
register, or by writing 12CON wilil XSTR =1 7 I 5 4 3 2 1 0
writes a 1 to XSTP in 12CON.
or XSTP = 1. The 120 interface will only drive MASTRO is cleared by reset and
!he SDA line low when Transmit Active is set, by an 120 time-out.
and Iile ARL bit will only be set to 1 when
CLRTI Writing a 1 to Iilis bit clears Iile
Transmit Active is set. Transmit Active is RDAT "Receive DATa" is captured from Timer I interrupt flag. This bit
cleared by reading the 12DAT register, or by SDA every rising edge of SCL position always reads as a o.
writing 12CON with CXA = 1. Transmit Active Reading 12DAT also clears DRDY
is automatically cleared when ARL is 1. TIRUN Writing a 1 to this bit lets Timer I
and the Transmit Active state. run; a zero stops and clears it
IDLE Writing 1 to "IDLE" causes a slave's XDAT "Xmit Data" sets Iile data for the Togetherwilil SLAVEN, MASTRO,
120 hardware to ignore Iile 12C until next bit. Writing 12DAT also clears and MASTER, this bit determines
Iile next start condition (but if DRDY and sets Iile Transmit Active operational modes as shown in
MASTRO is 1, Iilen a stop state. Table 2.
condition will make Iile 83C751 into Regarding Software Response Time CT1,O These two bits are programmed as
a master). a function of Iile OSC rate, to
CDR Writing a 1 to "Clear Data Ready" Because Iile 83C751 can run at 16MHz, and optimize the MIN HI and LO time of
clears DRDY. (Reading or writing because Iile 12C interface is optimized for SCL when this 83C751 is a master
Iile 12DAT register also does Iilis.) high-speed operation, it is qUite likely that an on the 12C. The time value
12C service routine will sometimes respond to determined by these bits controls
CARL Writing a 1 to "Clear Arbitration DRDY (which is set at a rising edge of SCL) both of these parameters, and also
Loss" clears Iile ARL bit. and write 12DAT before SCL has gone low the timing for stop and start
CSTR Writing a 1 to "Clear STaRt" clears again. If XDAT were applied directly to SDA, conditions. These bits are cleared
lileSTRbit this situation would produce an 12C protocol to 00 by reset
Values to be used in the 0T1 and OTO bits count of 008 (the actual value preloaded into Interrupta
are shown in Table 3. To allow the 120 bus to Timer I is 8 minus, the oscl12 count). The interrupt sb'UCture is a five-source,
run at the maximum rate for a particular one-level interrupt system. Interrupt sources
oscillator frequency, compare the actual common to the 80051 are the extemal
oscillator rate to the fose max column in the 120 Register I2STA interrupts {IfmI", INTI) and the timer/counter
table. The value for 0T1 and OTO is found in interrupt (ETO). The 120 interrupt (EI2) and
the first line of the table where fose max is -only
Timer I interrupt (ETI) are the other two
greater than or equal to the actual frequency. 7& 5 4 3 210 interrupt sources. The interrupt sources are
listed below in their order of polling sequence
The table also shows the oscl12 count for
I-I IDLE IXDAT3XACTVIMAKSTRlMAKSTPI XSTR IXSTPI priority. '" ,
various settings of OT1/0TO. This allows MSB LSB
Upon interrupt or reset the program counter is
calculation of the actual minimum high and loaded with specific values for the appropriate
low times for SOL as follows: This register is read only and reflects the
interrupt service routine in program memory;
intemal status of the 120 hardware. IDLE, These values are: '
SOL min higMow time = 12· !XIunt XSTR, and XSTP reflect the status of the like
(in microseconds) osc (in MHz) named bits in llie I2CON register. Program Memory
Event Addre.. ' ,Priority
XDA1A The content of the transmitter Reset 000 Highest
For instance, at a 16MHz frequency, with
buffer: INTO 003
OT1ICTO set to 10, the minimum SOL high
and low times will be 5.25j.lS XAOTV Transmitter active. Oountermmer 0 OOB
INTI 013
MAKSTR This bit is high while the hardware
Timer I 01B
The table also shows the Timer I timeout peri- is effecting a start condition.
120 023 Lowest
od (given in machine cycles) for each MAKSTP This bit is high while the hardware
OT1ICTO combination. The timeout period is effecting a stop condition. The interrupt enable register (IE) is used to
varies because of the way in which minimum individually enable or disable the five
SOL high and low times are measured. When XSTR This bit is active while the hardware sources. Bit ~ in the interrupt enable
the 120 interface is operating, Timer I is pre- is effecting a repeated start register can be used to globally enable or
loaded at every SOL transition with a value condition. disable all interrupt sources. The interrupt
dependent upon 0T1/0TO. The preload value XSTP This bit is active while the hardware enable register is desCribed below. All other
is chosen such that a minimum SOL high or is effecting a repeated stop interrupt details lire based on the ~051
low time has elapsed when Timer I reaches a condition. interrupt architecture.
1~lxlxl82 I I I I I
En EX! ElD EXO
'G"
efficient interface to a wide variety of • Wide oscillator frequency range
dedicated 12C peripherals.
• Low power consumption:
LCC
- Normal operation: less than 11 mA @ 5V,
12MHz 11 ' 19
- Idle mode
12 18
- Power-down mode
Pin Function Pin Function
• 2kx 8 ROM (83C751) PS.4/M 15 P1.000
2k x 8 EPROM (87C751) PS.31AS 16 P1.1101
PS.2IA2IA10 17 P1.2I02
• 64x8 RAM PS.t1AtlA9 18 Pl.WS
N.C. 19 Pl.4104
• 16-bit auto reloadable counter/timer PS.OIAO/A8 20 P1.5ill'lm'D5
PO.2IVPP 21 N.C.
• Fixed-rate timer 8 PO.t1SDAIOE-PGM 22 N.C.
9 PO.OISCUASEL 23 P1.6iI1'lTf1ll6
• Boolean processor 10 N.C. 24 Pl.71T0ID7
11 RST 25 PS.7/A7
• CMOS and TIL compatible 12 X2 26 PS.6!A6
IS XI 27 PS.51A5
• Well suited for logic replacement, 14 VSS 28 VCC
consumer and industrial applications
BLOCK DIAGRAM
r-------------------
I ~~~
---------------------,
I
vcc l
-=j
vssl
Ji
- I
I
I
I
liMING
RST AND
CONTRO
P1.G-P1.7 P3.0-P3.7
PIN DESCRIPTIONS
PIN NO.
MNEMONIC DIP LCC TYPE NAME AND FUNCTION
Vss 12 14 I Circuit Ground Potential
Vee 24 28 I Supply voltage during normal, Idle, and power-down operation.
PO.O-PO.2 8..0 9-7 110 Port 0: Port 0 is a 3·bit open·drain, bidirectional port. Port 0 pins that have Is written to them float,
and in that state can be used as high-impedance inputs. Port 0 also serves as the serial1 2C
interface. When this feature is activated by software, SCL and SDA are driven low in accordance
with the 12C protocol. These pins are driven low if the port register bit is written with a 0 or if the 12C
subsystem presents a O. The state of the pin can always be read from the port register by the
program.
To comply with the 12C specification, PO.O and PO.l are open drain bidirectional 110 pins with the
electrical characteristics listed in the tables that follow. While these differ from ·standard TIL"
characteristics, they are close enough for the pins to still be used as general-purpose 110 in
non-12C applications. Port 0 also provides alternate functions for programming the EPROM
memory as follows:
6 7 N/A Vpp (PO.2) - Programming voltage input.
7 8 I OElPGM (PO.l) - Input which specifies verify mode (output enable) or the program mode.
OE/PGM ~ 1 output enabled (verify mode).
OE/PGM ~ 0 program mode.
8 9 I ASEL (PO.O) - Input which indicates which bits of the EPROM address are applied to port 3.
ASEL ~ 0 low address byte available on port 3.
ASEL ~ 1 high address byte available on port 3 (only the three least significant bits are used).
7 8 I/O SDA (PO.l) _12C data.
8 9 I/O SCL (PO.O) _12C clock.
Pl.O-Pl.7 13-20 15-20, 110 Port 1 : Port 1 is an 8-bit bidirectional 110 port with internal pull-ups. Port 1 pins that have Is written
23,24 to them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 1 pins
that are externally pulled low will source current because of the internal pull-ups. (See DC
Electrical Characteristics: IILl. Port 1 serves to output the addressed EPROM contents in the verify
mode and accepts as inputs the value to program into the selected address during the program
mode. Port 1 also serves the special function features of the 80C51 family as listed below:
18 20 I ~ (Pl.S): External interrupt.
19 23 I INTf (Pl.6): External interrupt.
20 24 I TO (Pl.7): Timer 0 external input.
P3.O-P3.7 5-1, 4-1,6, 110 PorI 3: Port 3 is an 8-bit bidirectional 110 port with internal pull-ups. Port 3 pins that have Is written
23-21 27-25 to them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins
that are externally being pulled low will source current because of the pull-ups. (See DC Electrical
Characteristics: IILl. Port 3 also functions as the address input for the EPROM memory location to
be programmed (or verified). The II-bit address is multiplexed into this port as specified by
PO.O/ASEL.
RST 9 11 I Resel: A high on this pin for two machine cycles while the oscillator is running, resets the device.
An internal diffused resistor to Vss permits a power-on RESET using only an external capacitor to
Vee· After the device is reset, a 10-bit serial sequence, sent LSB first, applied to RESET, places
the device in the programming state allowing programming address, data and Vpp to be applied for
programming or verification purposes. The RESET serial sequence must be synchronized with the
Xl input.
Xl 11 13 I Cryslall: Input to the inverting oscillator amplifier and input to the internal clock generator circuits.
Xl also serves as the clock to strobe in a serial bit stream into RESET to place the device in the
programming state.
X2 10 12 0 Crystal 2: Output from the inverting oscillator amplifier.
DC ELECTRICAL CHARACTERISTICS
Tamb = O°C to +70°C or-40°C to +85°C, Vee = 5V ±10% for 87C751, Vee = 5V±20% for 83C751 , Vss = OVl
TEST LIMITS
SYMBOL PARAMETER CONDITIONS MIN MAX UNIT
VIL Input low voltage, except SDA, SCL -{l.5 0.2Voo-O·l V
VIH Input high voltage, except Xl, RST 0.2Vee+0.9 Vee+0.5 V
VIHl Input high voltage, Xl, RST 0.7Vee Vee+0.5 V
SDA, SCL:
Vill Input low voltage -{l.5 0.3Vee V
VIH2 Input high voltage 0.7Vee Vee+0.5 V
VOL Output low voltage, ports 1 and 3 IOL = 1.6mA2 0.45 V
VOll Output low voltage, port 0.2 IOL= 3.2mA2 0.45 V
VOH Output high voltage, ports 1 and 3 IOH =-6011A 2.4 V
IOH =-2511A 0.75Vec V
IOH =-1011A 0.9Vce V
Port 0.0 and 0.1 (l2C) - Drivers
VOL2 Output low voltage 10L =3mA 0.4 V
Driver, receiver combined: (over Vee range)
C Capacitance 10 pF
IlL Logical 0 input current, ports 1 and 3 VIN =0.45V -50 jJA
ITt Logical 1 to 0 transition current, ports 1 and 33 VIN = 2V -650 jJA
III Input leakage current, port 0 0.45 < VIN < Vee ±10 IIA
RRST Internal pull-down resistor 25 175 kQ
Vss = OV
Vpp Vpp program voltage (for 87C751 only) Vee = 5V±10% 12.5 13.0 V
Tant> = 21·C to 27·C
AC ELECTRICAL CHARACTERISTICS
Tant> =O·C to +70·C or--40°C to +85·C Vcc = 5V ±10% for 87C751 Vee =5V ±20% for 83C751 Vss =OV1,2
12MHzCLOCK VARIABLE CLOCK
SYMBOL PARAMETER MIN MAX MIN MAX UNIT
i+-----IcLCL - - - - - - . 1
22 /
20 /
V
18
16 /
14
/
IccmA
12 TYP ACTIVE ICCS
10 L L
1 L
J ./
,/
/ ~ MAX IDLE ICC6
---
4
/ ~
PROGRAMMING initially be held high for at least two machine PO.2. The various combinations are shown in
CONSIDERATIONS cycles. PO.l (PGMI) and PO.2 (Vpp) will be at Table 3.
VOH as a result of the RESET operation. At
EPROM Characteristics this point, these pins function as normal Encryption Key Table
The B7C751 is programmed by using a quasi-bidirectional 1/0 ports and the The B7C751 includes a 16-byte EPROM
modified Quick-Pulse Programming algorithm programming equipment may pull these lines array that is programmable by the end user.
similar to that used for devices such as the low. However, prior to sending the 10-bit code The contents of this array can then be used
B7C451 and B7C51. It differs from these on the RESET pin, the programming to encrypt the program memory contents
devices in that a serial data stream is used to equipment should drive these pins high (V1H). during a program memory verify operation.
place the B7C751 in the programming mode. The RESET pin may now be used as the When a program memory verify operation is
serial data input for the data stream which performed, the contents of the program
Figure 4 shows a block diagram of the places the B7C751 in the programming mode. memory location is XNOR·ed with one of the
programming configuration for the B7C751. Data bits are sampled during the clock high bytes in the 16-byte encryption table. The
Port pin PO.2 is used as the programming time and thus should only change during the resulting data pattern is then provided to port
voltage supply input (Vpp signal). Port pin time that the clock is low. Following 1 as the verify data. The encryption
PO.l is used as the program (PGMI) signal. transmission of the last data bit, the RESET mechanism can be disable, in essence, by
This pin is used for the 25 programming pin should be held low. leaving the bytes in the encryption table in
pulses. their erased state (FFH) since the XNOR
Next the address information for the location product of a bit with a logical one will result in
Port 3 is used as the address input for the to be programmed is placed on port 3 and
byte to be programmed and accepts both the the original bit. The encryption bytes are
ASEL is used to perform the address mapped with the code memory in 16-byte
high and low components of the eleven bit multiplexing, as previously described. At this
address. Multiplexing of these address groups. the first byte in code memory will be
time. port 1 functions as an output. encrypted with the first byte in the encryption
components is performed using the ASEL
input. The user should drive the ASEL input A high voltage Vpp level is then applied to the table; the second byte in code memory will be
high and then drive port 3 with the high order Vpp input (PO.2). (This sets Port 1 as an input encrypted with the second byte in the
bits of the address. ASEL should remain high port). The data to be programmed into the encryption table and so forth up to and
for at least 13 clock cycles. ASEL may then EPROM array is then placed on Port 1. This including the 16the byte. The encryption
be driven low which latches the high order is followed by a series of programming pulses repeats in 16-byte groups; the 17th byte in
bits of the address internally. the high applied to the PGMI pin (PO.l). These pulses the code memory will be encrypted with the
address should remain on port 3 for at least are created by driving PO.l low and then first byte in the encryption table, and so forth.
two clock cycles after ASEL is driven low. high. This pulse is repeated until a total of 25
Port 3 may then be driven with the low byte of programming pulses have occurred. At the Security Bits
the address. The low address will be conclusion of the last pulse, the PGMI signal Two security bits, security bit 1 and security
internally stable 13 clock cycles later. The should remain high. bit 2, are provided to limit access to the
address will remain stable provided that the USER EPROM and encryption key arrays.
TheVpp signal may now be driven to the VOH Security bit 1 is the program inhibit bit, and
low byte placed on port 3 is held stable and level, placing the B7C751 in the verify mode.
ASEL is kept low. Note: ASEL needs to be once programmed performs the following
(Port 1 is now used as an output port). After functions:
pulsed high only to change the high byte of four machine cycles (4B clock periods), the
the address. 1. Additional programming of the USER
contents of the addressed location in the EPROM is inhibited.
Port 1 is used as a bidirectional data bus EPROM array will appear on Port 1.
during programming and verify operations. 2. Additional programming of the encryption
The next programming cycle may now be key is inhibited.
During programming mode, it accepts the initiated by placing the address information at
byte to be programmed. During verify mode, the inputs of the multiplexed buffers, driving 3. Verification of the encryption key is
it provides the contents of the EPROM the Vpp pin to the Vpp voltage level, providing inhibited.
location specified by the address which has the byte to be programmed to Portl and
been supplied to Port 3. 4. Verification of the USER EPROM and the
iSSUing the 26 programming pulses on the security bit levels may still be performed.
The XTAL 1 pin is the oscillator input and PGMI pin, bringing Vpp back down to the Vc
receives the master system clock. This clock level and verifying the byte. (If the encryption key array is being used, this
should be between 1.2 and 6MHz. security bit should be programmed by the
Programming Modes user to prevent unauthorized parties from
The RESET pin is used to accept the serial The B7C751 has four programming features
data stream that places the B7C751 into reprogramming the encryption key to all
incorporated within its EPROM array. These
various programming modes. This pattern logical zero bits. Such programming would
include the USER EPROM for storage of the
consists of a 10-bit code with the LSB sent provide data during a verify cycle that is the
application's code, a 16-byte encryption key
first. Each bit is synchronized to the clock logical complement of the USER EPROM
array and two security bits. Programming and contents).
input,Xl. verification of these four elements are
selected by a combination of the serial data Security bit 2, the verify inhibit bit, prevents
Programming Operation stream applied to the RESET pin and the verification of both the USER EPROM array
Figures 5 and 6 show the timing diagrams for
the programlverify cycle. RESET should ,
voltage levels applied to port pins PO.l and and the encryption key arrays. The security
bit levels may still be verified.
Programming and Verifying Ports 1.7 contains the security bit 1 data and erasure. For this and secondary effects, It
is a logical one il programmed and a logical Is recommended that an opaque label be
Security Bits placed over the window. For elevated
Security bits are programmed employing the zero il erased. Ukewise, Pl.6 contains the
security bit 2 data and is a logical one il temperature or environments where solvents
same techniques used to program the USER
programmed and a logical zero if erased. are being used, apply Kapton tape Aourfess
EPROM and KEY arrays using serial data
part number 2345-0 or equivalent.
streams and logic levels on port pins
Erasure Characteristics
indicated in Table 3. When programming The recommended erasure procedure is
Erasure of the EPROM begins to occur when
either security bit, it is not necessary to exposure to ultraviolet light (at 2537
the chip is exposed to light with wavelengths
provide address or data information to the angsb'oms) to an integrated dose 01 at least
shorter than approximately 4,000 angstroms.
87C75t on ports 1 and 3. 15W-slcm2 • Exposing the EPROM to an
Since sunlight and fluorescent lighting have
ultraviolet lamp 01 12,OOOIlW/cm2 rating for
Verification occurs in a similar manner using wavelengths in this range, exposure to these
20 to 39 minutes, at a distance 01 about
the RESET serial stream shown in Table 3. light sources over an extended time (about 1
week in sunlight, or 3 years in room level 1 inch, should be sufficient.
Port 3 is not required to be driven and the
results of the verify operation will appear on lluorescentlighting) could cause inadvertent Erasure leaves the array in an allIS state.
ports 1.6 and 1.7.
87C751
PROGRAIIMNG
.l-
PO.I
PULSES
CLKSOURCE XTALI
Y RESET
CONTROL
LOGIC
I
I
RESET
XTALI ..Jl.
MN 211ACIINE
I. CYCLES .1. TEN BIT SERIAL CODE .1
RESET
PO.2 UNDEANED I
PO.I UNDEANED I
Figure 5. Entry Into ProgramNerlfy Modes
12 75V
0
~5~V_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _~1
1 r-
P002(Vpp)
tsOOl
25 PULSES
I I
1'0.1 (PCII)
L~~
I- ~ 'MAsEl IGlGHH
98~.MlN
-1 r-
10~.
'GHGl
~J
MIN
PO.O (ASEL) \
tw.SE~. ~I ~I 'HAHlD
PORT 3
=x IIGH ADDRESS
X lOW ADDRESS
I<II-~----- VERIFY MODE -------10'1+- PROGRAM MODE - ....>-+1____- - - VERIFY MODE - - -....>.jl
~
III
.•i.•I.'.'.F.!.i
.•. I.i.i. ••. . '. .' ·.C.• . •. •. ·.··.'.".:.:
. j . .! '••. •i.
Purchase of Philips' 12C components conveys a license under the
Philips' 12C patent to use the components In the 12C-system
provided the system conforms to the 12C specifications defined by Philips.
Alternate Alternate
:= -----, Output
Function
~~ - - - - ,
Output
Function
Internal
NI-Up
Int. a.. D Q Int. Bus D Q
P1.x PO.X
Latch Latch
Wrtte 10 Write 10
Latch CL CL
Latch
The PWM output can be set continuously ADCON Register ADCS remains high
high by loading the compare register with throughout the
MSB LSB
OOH and continuously low by loading the conversion cycle. On
compare register with FFH. The PWM output I x I x IENAOCIADClIADCSIAADRZIAADRtlAADROI completion of the
is enabled by setting the PWE bit in the PWM conversion, it is reset
enable register, PWENA. When enabled, the ADCI ADCS Operation
just before the ADCI
output is driven with a fully active strong o 0 ADC not busy, a conversion
interrupt flag is
pullup. When disabled, the pin behaves as a can be started.
cleared. ADCS cannot
normal bidirectional 110 pin. When disabled, o ADC busy, start of a new be reset by software.
the counter remains active. The PWM conversion is blocked.
ADCS should not be
function is disabled by a reset condition. The o Conversion completed, start
used to monitor the
PWM output is high during power-down and of a new conversion is
AID converter status.
idle modes and the counter is disabled. blocked.
ADCI should be used
Not possible.
The repetition frequency is given by: for this purpose.
ADCON.2 AADR2 Analog input select.
fosc INPUT CHANNEL SELECTION
fPWM = ADCON.l AADRI Analog input select.
510 x (1 + PWMP) AOOR2 AODR1 AOORO INPUT ADCON.O AADRO Analog input select.
An oscillator frequency of 12MHz results in a PIN This binary coded
repetition range of 92Hz to 23.5kHz. 0 0 0 Pl.0 address selects one of
0 0 1 P1.1 the five analog input
The lowlhigh ratio of the PWM output is port pins of PI to be
PWM/(255 - PWM) for PWM values except 0 1 0 Pl.2
input to the converter.
255. A PWM value of 255 results in a low 0 1 1 P1.3
It can only be changed
PWMoutput 1 0 0 Pl.4
when ADCI and ADCS
If enabled, a PWM interrupt will occur when Position Symbol Function are both low. AADR2 is
the PWM counter overflows. ADCON.5 ENADC Enable AID function the most significant bit.
when ENADC = 1. The completion of the 8-bit ADC conversion
In order for the PWM output to be used as a Reset forces
standard 1/0 pin, the PWM function needs to is flagged by ADCI in the ADCON register,
ENADC=O. and the result is stored in the special function
be disabled. The PWM counter can still be ADCON.4 ADCI ADC interrupt flag.
used as an intemaltimer by enabling the register ADAT.
This flag is set when
PWM interrupt. An ADC conversion in progress is unaffected
an ADC conversion is
complete. If IE.S = I, by an ADC start. The result of a completed
AID Converter
an interrupt is conversion remains unaffected provided
The 83C752 contains a fivEH:hannel
requested when ADCI remains at a logic 1. While ADCS is a
mukiplexed 8-bit AID converter. The
ADCI = 1. The ADCI logic 1 or ADCI is a logic I, a new ADC
conversion requires 40 machine cycles (40l1s
flag is cleared when START will be blocked and consequently lost.
at 12MHz oscillator frequency).
conversion data is An ADC conversion in progress is aborted
The AID converter is controlled by the AID read. This flag is read when the idle or power-down mode is
control register, ADCON. Input channels are only. entered. The result of a completed
selected by the analog mUltiplexer by bits ADCON.3 ADCS ADC start. Setting this conversion (ADCI = logic 1) remains
ADCON.O through ADCON.2. The ADCON bit starts an AID unaffected when entering the idle mode. See
register is not bit addressable. conversion. Once set, Figure 2 for an AID input equivalent circuit.
r-------,
• I· • I
• I. • I
I I
I SmN+1 RmN+1 I
1N+1--i-_---,1i---"'/ I
I I
~--------"IN'--il---......I-s.../mN _-'\jR<\Im\rN_+,I_+___
TO ~~~ __
+ IL _ _ _ _ _ _ _ .JI
- p i e....
Cc
I
VANALOG INPUT
Rm = 0.5 - 3 kohms
CS + CC = 15pF maximum
RS =Recommendad < 9.6 kohms for 1 LSB @ 12MHz
NOTE:
Because the analog to digital converter has a sampled-data comparator, the input looks capacitive to a source. When a conversion is
initiated, switch Sm closes for Stcy (SIlS @ 12MHz ClYstal frequency) during which time capacitance Cs + Cc is charged. It should be
noted that the sampling causes the analog input to present a varying load to an analog source.
The analog input pins ADCO-ADC4 may be Position Symbol Function These flags are functionally idantical to the
used as digital inputs and outputs when the TCON.7 GATE 1 - Timer 0 is enabled corresponding BOC51 flags except that there
AID converter is disabled by a 0 in the only when INTO pin is is only one of the SOC51 style timers, and the
ENADC bit in ADCON. When the AID is high and TR is 1. flags are combined into one register.
enabled, the analog input channel that is o - Timer 0 is enabled Note that the positions of the IEOIITO and
selected by the ADDR2-ADDRO bits in only when TR is 1.
IE1IITI bits are transposed from the positions
ADCON cannot be used as a digital input. TCON.6 CfT 1 - Counter operation
used in the standard SOC51 TCON register.
Reading the selected AID channel as a digital from TO pin.
input will always retum a 1. The unselected o- Timer operation from A communications watchdog timer, Timer I, is
AID inputs may always be used as digital internal clock. dascribed in the 12C section. In 12C
inputs. Un selected analog inputs will be TCON.5 TF 1 - Set on overflow of TO. applications, this timer is dadicated to time
floating and may not be used as digital 0- Cleared when generation and bus monitoring for the 12C. In
outputs. processor vectors to non-PC applications, it is available for use as
interrupt routine and a fixed time base.
Countermmer by reset.
The SXC752 counterltimer is dasignated The 16-billimer/counter's operation is similar
TCON.4 TR 1 - Enable timer 0
Timer 0 and is separate from Timer I of the to moda 2 operation on the SOC51 , but is
0- Disable timer 0
12C serial port and from the PWM. Its extended to 16 bits. The timer/counter is
TCON.3 lEO 1 - Edge datected on
operation is similar to mode 2 of the S.OC51 clocked by either 1112 the oscillator
INTO
counterltimer, extendad to 16 bits. When frequency or by transitions on the TO pin. The
TCON.2 ITO 1 - INTO is edge
Timer 0 is used in the external counter mode, CfT pin in special function register TCON
triggered.
the TO input (pI. 7) is sampled every S4Pl. selects between these two modes. When the
0- INTO is level
The counterltimer function is controlled using TCON TR bit is se~ the timer/counter is
sensitive.
the timer control register (TCON). enabled. Register pair TH and TL are
TCON.l lEI 1 - Edge datected on
incremented by the clock source. When the
TOON Register INTI
register pair overflows, the register pair is
TCON.O ITI 1 - INTI is edge
IISB LSB reloaded with the values in registers RTH and
triggE!red.
RTL. The value in the reload registers is left
IGATE I CIT I TF 1m 1181 I ITO I IE1 1m o- INTI is level unchanged. The TF bit. in special function
sensitive.
register TeON is set on counter overflow
and, if the interrupt is enabled, will generate
an interrupt (see Figure 16).
lot
12<: Serial I/O The vector addresses are as follows: Special Function Registers
The 12C bus uses two wires (SDA and SCL) The special function registers (direcdy
Source Vector Address
to transfer information between devices addressable only) contain all of the 8XC751
INTO 0OO3H
connected to the bus. The main technical registers except the program counter and the
TFO OOOBH
features of the bus are: four register banks. Most of the 21 special
INTI 0013H
• Bidirectional data transfer between masters function regislers are used to control the
TIMER I 001BH
and slaves on-chip peripheral hardware. Other registers
SIO 0023H
include arithmetic registers (ACC, B, PSW),
• Serial addressing of slaves ADC 002BH
stack pointer (SP) and data pointer registers
PWM 0033H
• Acknowledgment after each transferred (DPH, DPL). Nine of the SFRs are bit
byte Interrupt Control Registers addressable.
The 80CSI interrupt enable register is
• Multimaster bus Data Pointer
modified to take into account the different
The data pointer (DPTR) consists of a high
• Arbitration between simultaneously interrupt sources of the 8XC752.
byte (DPH) and a low byte (DPL). In the
transmitting master without corruption of 80C51 this register allows the access of
Interrupt Enable RegIster
serial data on bus external data memory using the MOVX
MSB LSB
instruction. Since the 83C752 does not
A large family of 12C compatible ICs is
available. See the 12C section for more details
! EA ! EAD! Ell ! ES !EPWM! EX1 ! ElO !EXO ! support MOVX or external memory accesses,
this register is generally used as a 16-bit
on the bus and available ICs. Position Symbol Function offset pointer of the accumulator in a MOVC
The 83C752 12C subsystem includes IE.7 EA Global interrupt instruction. DPTR may also be manipulated
hardware to simplify the software required to disable when EA = 0 as two independent 8-bit registers.
drive the 12C bus. This circuitry is the same IE.6 EAD ND conversion
as that on the 83C751. (See the 83C751 complete
section for a detailed discussion of this IE.5 ETI Timer I
subsystem). lEA ES 12C serial port
IE.3 EPWM PWMcounter
Interrupts overflow
The interrupt structure is a seven-source, IE.2 EXI External interrupt 1
one-level interrupt system similar to the IE.l ETO Timer 0 overflow
8XC751. The interrupt sources are listed IE.O EXO External interrupt a
below in their order of polling sequence
priority (highest to lowest): Power-Down and Idle Modes
The 8XC752 includes the 80C51 power-down
Priority Source Function
and idle mode features. The functions that
Highest INTO External interrupt 0
continue to run while in the idle mode are
TFO Timer flag 0
Timer 0, the 12C interface including Timer I,
INTI External interrupt 1
and the interrupts. Upon powering-up the
PWM PWM counter overflow
circuit, or exiting from idle mode, sufficient
TI 12C timer overflow
time must be allowed for stabilizalion of the
SIO Serial port interrupt
internal analog reference voltages before an
Lowest ADC ND conversion
ND conversion is started.
complete
5025
• 8-bit PWM output/timer
4 1 26
• Fixed-rate timer
• Boolean processor
• CMOS and TTL compatible LCC
• Well suited for logic replacement, 11 19
consumer and industrial applications
12 18
BLOCK DIAGRAM
1'0.11-1'0.4
r---------------
I ~~~
--------------------l
I
I I
vcel I
=1 I
vssl I
P I
I
I
I
I
I
RST
Pl.lI-Pl.7 P3.1I-P3.7
PIN DESCRIPTION
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
Vss 12 I Circuit Ground Potential.
Vee 28 I Supply voltage during normal, Idle, and power-down operation.
PO.O-PO.4 8-6 110 Port 0: Port 0 is a 5-bit bidirectional port. Port 0.O-P0.2 are open drain. Port 0.O-PO.2 pins that have
23,24 Is written to them float, and in that state can be used as high-impedance inputs. PO.3-PO.4are
bidirectional 110 port pins with internal pull-ups. Port 0 also serves as the serial 12(: interface. When
this feature is activated by software, SCl and SDA are driven low in accordance with the 12C protocol.
These pins are driven low if the port register bit is written with a 0 or if the 12C subsystem presents a O.
The state of the pin can always be read from the port register by the program. Port 0.3 and 0.4 have
internal pull-ups that function identically to port 3. Pins that have 1s written to them are pulled high by
the internal pull-ups and can be used as inputs.
To comply with the 12C specification, PO.O and PO. 1 are open drain bidirectional 110 pins with the
electrical characteristics listed in the tables that follow. While these differ from ·standard TTL'
characteristics, they are close enough for the pins to still be used as general-purpose 110 in non-12C
applications.
6 I Vpp (PO.2) - Programming voltage input.
7 I OElPGM (PO.l) -Input which specifies verify mode (output enable) or the program mode.
OElPGM = 1 output enabled (verify mode).
OElPGM =0 program mode.
8 I ASEL (PO.O) -Input which indicates which bits of the EPROM address are applied to port 3.
ASEl =0 low address byte available on port 3.
ASEl = 1 high address byte available on port 3 (only the three least significant bits are used).
Pl.O-Pl.7 13-17, 110 Port 1: Port 1 is an 8-bit bidirectional 110 port with internal pull-ups. Port 1 pins that have 1s written to
20-22 them are pulled high by the internal pull-ups and can be used as inputs. PO.3--P0.4 pins are
bidirectional 110 port pins with internal pull-ups. As inputs, port 1 pins that are externally pulled low will
source current because of the internal pull-ups. (See DC Electrical Characteristics: IILl. Port 1 also
serves the special function features of the SC80C51 family as listed below:
20 I 1RTG (Pl.5): External interrupt.
21 I 1JIIll (Pl.6): External interrupt.
22 I TO (Pl.7): Timer 0 external input.
13-17 I ADCO (Pl.0)-ADC4 (Pl.4): Port 1 also functions as the inputs to the five channel multiplexed AID
converter. These pins can be used as outputs only if the AID function has been disabled. These pins
can be used as inputs while the AID converter is enabled.
Port 1 serves to output the addressed EPROM contents in the verify mode and accepts as inputs the
value to program into the selected address during the program mode.
P3.O-P3.7 5-1, 110 Port 3: Port3is an 8-bit bidirectional 110 port with internal pull-ups. Port 3 pins that have Is written to
27-25 them are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins that are
externally being pulled low will source current because of the pull-ups. (See DC Electrical
Characteristics: IILl. Port 3 also functions as the address input for the EPROM memory location to be
programmed (or verified). The II-bit address is multiplexed into this port as specified by PO.O/ASEL.
RST 9 I Reset: A high on this pin for two machine cycles while the oscillator is running resets the device. An
internal diffused resistor to Vss permits a power-on RESET using only an external capacitor to Vee.
After the device is reset, a 10-bit serial sequence, sent lSB first, applied to RESET, places the device
in the programming state allowing programming address, data and Vpp to be applied for programming
or verification purposes. The RESET serial sequence must be synchronized with the XI input.
XI 11 I Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock generator circuits. XI
also serves as the clock to strobe in a serial bit stream into RESET to place the device in the
programming state.
X2 10 0 Crystal 2: Output from the inverting oscillator amplifier.
AVee 19 I Analog supply voltage and reference input.
AVee 18 I Analog supply and reference ground.
The Iowlhigh ratio of the PWM signal is PWM can be used as an interval timer by enabling Special Function Register
/ (255 - PWM) for PWM not equal to 255. For the PWM interrupt. Addresses
PWM = 255, the output is always low. Special function registers for the aXC752 are
AiD COnverter identical to those of the SC80C51, except for
The repetition frequency range is 92Hz to The analog input circuitry consists of a
23.5kHz for an oscillator frequency of 12MHz. the changes listed below:
5-input analog mUltiplexer and an A to D
An interrupt will be asserted upon PWM converter with a·bit resolution. The scaOC51 special function registers not
counter overflow if the interrupt is not masked conversion takes 40 machine cycles, i.e., present in the aXC752 are TMOD (a9), P2
off. 40115 at 12MHz oscillator frequency. The AID (AO) and IP (88). The SCaOC51 registers
converter is controlled using the ADCON TH1, TL1, SCON, and SBUF are replaced
The PWM output is an altemative function of control register. Input channels are selected with the aXC752 registers RTH, RTL, 12CON,
PO.4. In order to use this port as a by the analog multiplexer through ADCON and 12DAT, respectively. Additional special
bidirectional I/O port, the PWM output must register bits 0-2. function registers are 12CFG (Da) and 12STA
be disabled by clearing the enable/disable bit (FB), ADCON (AO), ADAT (84), PWM (aE),
in PWENA. In this case, the PWM subsystem PWMP (aF), and PWENA (FE). See Table 2.
DC ELECTRICAL CHARACTERISTICS
TIIII'I> = O°C to +70°C or--40°C to +85°C, AVee = 5V ±5, AVss = oVJ
83C752' Vee - 5V ± 20% 87C752' Vee - 5V ± 10% VSS - OV
TEST LlMITS3
SYMBOL PARAMETER CONDITIONS MIN TYPICAL1 MAX UNIT
lee Supply current (see Figure 3)
Inputs
VIL Input low voltage, except SDA, SCL ~.5 0.2Ve~·1 V
VIH Input high voltage, except XI, RST 0.2Vee+0.9 Vee+O·5 V
VIHI Inpm high voltage, XI, RST 0.7Vee Vee+o.5 V
SDA,SCL:
VILI Input low voltage ~.5 0.3Vee V
VIH2 Input high voltage 0.7Vee Vee+o.5 V
Outputs
Output low voltage, ports I, 3, 0.3, and 0.4
VOL (PWM disabled) 10L= 1.6mA 0.45 V
VOLl Output low voltage, port 0.2 IOL=3.2mA 0.45 V
Output high voltage, ports I, 3, 0.3, and 0.4
VOH (PWM disabled) 10H = -80fIA, 2.4 V
10H = -25fIA 0.75Vee V
IOH = -10fIA 0.9Vee V
IOH =-400pA 2.4 V
VOH2 Output high voltage, 0.4 (PWM enabled) IOH = -40fIA 0.9Vee V
Port 0.0 and 0.1 (l2C) - Drivers
VOL2 Output low voltage IOL=3mA 0.4 V
(over Vee range)
Driver, receiver combined:
C Capacitance 10 pF
IlL Logical 0 input current, VIN =0.45V -50 fIA
ports I, 3, 0.3, and 0.4 (PWM disabled)IO
ITl Logical 1 to 0 transition current, VIN =2V -650 fIA
ports I, 3, 0.3 and 0.4 10
III Input leakage current, port 0.0, 0.1 and 0.2 0.45 < VIN < Vee ±10 fIA
RRST Reset pull-down resistor 25 175 k.Q
CIO Pin capacitance Test freq = 1MHz, 10 pF
TIIII'I> = 25°C
Ipo Power-down currenl" Vee = 2 to 5.5V 50 fIA
Vee = 2 to 6.0V
(83C752)
Vpp Vpp program voltage (87C752 only) Vss=OV 12.5 13.0 V
Vee = 5V±10%
Tamb = 21°C to 27°C
Ipp Program current (87C752 only) Vpp = 13.0V 50 rnA
Analog Inpuls (AID guaranteed only with quartz window covered).
AVec Analog supply voltage9 AVee = Vcc±O.2V 4.5 5.5 V
Alee Analog operating supply current AVee=5.12V 38 rnA
AVIN Analog input voltage AVss~.2 AVee+O·2 V
CIA Analog input capacitance 15 pF
AID CONVERTER PARAMETER constructed. This is also referred to as Channel to Channel Matching
DEFINITIONS relative accuracy and also integral Channel to channel matching is the maximum
The following definitions are included to non-linearity. difference between the corresponding code
clarify some specifications given and do not transitions of the actual characteristics taken
represent a complete set of AID parameter
Differential Non-Linearity from different channels under the same
Differential non-linearity is the maximum temperature, voltage and frequency
definitions.
difference between the actual and ideal code conditions.
Absolute Accuracy Error widths fo the converter. The code widths are
Absolute accuracy error of a given output is the differences expressed in LSB between Crosstalk
the difference between the theoretical analog the code transition points, as the input Crosstalk is the measured level of a signal at
input voltage to produce a given output and voltage is varied through the range for the the output of the converter resulting from a
the actual analog input voltage required to complete set of codes. signal applied to one deselected channel.
produce the same code. Since the same
output code is produced by a band of input
Gain Error Total Error
Gain error is the deviation between the ideal Maximum deviation of any step point from a
voltages, the "required input voltage" is
and actual analog input voltage required to line connecting the ideal first transition point
defined as the midpoint of the band of input
cause the final code transition to a full-scale to the ideal last transition point.
voltage that will produce that code. Absolute
output code after the offset error has been
accuracy error not specified with a code is
the maximum over all codes.
removed. This may sometimes be referred to Relative Accuracy
as full scale error. Relative accuracy error is the deviation of the
NonlinearHy ADC's actual code transition points from the
If a straight line is drawn between the end
Offset Error ideal code transition points on a straight line
Offset error is the difference between the which connects the ideal first code transition
points of the actual converter characteristics
actual input voltage that causes the first code point and the final code transition point, after
such that zero offset and full scale errors are
transition and the ideal value to cause the nulling offset error and gain error. It is
removed, then non-linearity is the maximum
first code transition. This ideal value is 1/2 generally expressed in LSBs or in percent of
deviation of the code transitions of the actual
LSB above VreI_. FSR.
characteristics from that of the straight line so
AC ELECTRICAL CHARACTERISTICS
Tamb =O"C to +70"C or -40"C to +85"C. Vee =5V ±10% (B7C752). Vcc =5V ±20% (B3C752). Vss =01P. 7
12MHzCLOCK VARIABLE CLOCK
SYMBOL PARAMETER MIN MAX MIN MAX UNIT
VCC-o·5 - - - - -,-------..
0.2 Vcc +0.9
0.2VCC- 0•1
o.45V
!eHCH
!eLCH
~----!eLCL ------.(
VCC-o·
5
----..x~<-=--~x\
0.4SV _ _ _ _- - '
0. 2VCC+0.9
0. 2VCC- 0. 1
__
Figure 2. AC Testing Input/Output
20 /
V
18
16 /
14
/
Ice mA 12 TVP ACTIVE IceS
10 / L
8 :1. / V
iL
4
2
/
/'
,/
A high voltage Vpp level is then applied to the memory location is XNOR'ed with one of the and the encryption key arrays. The security
Vpp input (PO.2). (This sets Port 1 as an input bytes in the 16-byte encryption table. The bit levels may still be verified.
port). The data to be programmed into the resulting data pattem is then provided to port
EPROM array is then placed on Port 1. This 1 as the verify data. The encryption Programming and Verifying
is followed by a series of programming pulses mechanism can be disable, in essence, by Security Bits
applied to the PGMI pin (PO.l). These pulses leaving the bytes in the encryption table in Security bits are programmed employing the
are created by driving PO.l low and then their erased state (FFH) since the XNOR same techniques used to program the USER
high. This pulse is repeated until a total of 25 product of a bit with a logical one will result in EPROM and KEY arrays using serial data
programming pulses have occurred. At the the original bit. The encryption bytes are streams and logic levels on port pins
conclusion of the last pulse, the PGMI signal mapped with the code memory in 16-byte indicated in Table 3. When programming
should remain high. groups. the first byte in code memory will be either security bit, it is not necessary to
encrypted with the first byte in the encryption provide address or data information to the
The Vpp signal may now be driven to the VOH
table; the second byte in code memory will be 87C752 on ports 1 and 3.
level, placing the 87C752. in the verify mode.
encrypted with the second byte in the
(Port 1 is now used as an output port). After Verification occurs in a similar manner using
encryption table and so forth up to and
four machine cycles (48 clock periods), the the RESET serial stream shown in Table 3.
including the 16the byte. The encryption
contents of the addressed location in the Port 3 is not required to be driven and the
repeats in 16-byte groups; the 17th byte in
EPROM array will appear on Port 1. results of the verify operation will appear on
the code memory will be encrypted with the
ports 1.6 and 1.7.
The next programming cycle may now be first byte in the encryption table, and so forth.
initiated by placing the address information at Ports 1.7 contains the security bit 1 data and
the inputs of the multiplexed buffers, driving Security Bits is a logical one if programmed and a logical
the Vpp pin to the Vpp voltage level, providing Two security bits, security bit 1 and security zero if erased. Ukewise, P 1.6 contains the
the byte to be programmed to Portl and bit 2, are provided to limit access to the security bit 2 data and is a logical one if
issuing the 26 programming pulses on the USER EPROM and encryption key arrays. programmed and a logical zero if erased.
PGMI pin, bringing Vpp back down to the Vc Security bit 1 is the program inhibit bit, and
level and verifying the byte. once programmed performs the following Erasure Characteristics
functions: Erasure of the EPROM begins to occur when
Programming Modes 1. Additional programming of the USER the chip is exposed to light with wavelengths
The 87C752 has four programming features EPROM is inhibited. shorter than approximately 4,000 angstroms.
incorporated within its EPROM array. These Since sunlight and fluorescent lighting have
2. Additional programming of the encryption
include the USER EPROM for storage of the wavelengths in this range, exposure to these
key is inhibited.
application's code, a 16-byte encryption key light sources over an extended time (about 1
array and two security bits. Programming and 3. Verification of the encryption key is week in sunlight, or 3 years in room level
verification of these four elements are inhibited. ftuorescentlighting) could cause inadvertent
selected by a combination of the serial data erasure. For this and secondary effects, It
4. Verification of the USER EPROM and the
stream applied to the RESET pin and the Is recommended that an opaque label be
security bit levels may still be performed.
voltage levels applied to port pins PO.l and placed over the window. For elevated
PO.2. The various combinations are shown in temperature or environments where solvents
(If the encryption key array is being used, this
Table 3. are being used, apply Kapton tape Flourless
security bit should be programmed by the
part number 2345-5 or equivalent.
Encryption Key Table user to prevent unauthorized parties from
The 87C752 includes a 16-byte EPROM reprogramming the encryption key to all The recommended erasure procedure is
logical zero bits. Such programming would exposure to ultraviolet light (at 2537
array that is programmable by the end user.
The contents of this array can then be used provide data during a verify cycle that is the angstroms) to an integrated dose of at least
logical complement of the USER EPROM 15W-sec/cm2 . Exposing the EPROM to an
to encrypt the program memory contents
contents). ultraviolet lamp of 12,OoouW/cm2 rating for
during a program memory verify operation.
When a program memory verify operation is 20 to 39 minutes, at a distance of about 1
Security bit 2, the verify inhibit bit, prevents
performed, the contents of the program inch, should be sufficient.
verification of both the USER EPROM array
Erasure leaves the array in an all 1s state.
87C7S2
PROGRAMMING
-t
PD.l
PULSES
~ RESET
CONTROL
LOGIC
I
I
RESET
XTALI ~
loiN 2 MACHINE
I. CYCLES' 01. TEN BIT SERIAL CODE 01
RESET ~ N 1~~BI~T_O~~BI~T~I-L~BI~T~2~~BI~T~3~_Bl_T_4~__Bl_T_5~I__Bl_T_6~1__Bl_T_7~I~BI_T_8~_Bl_T_9~1______
PO.2 UNDEANED I
PO.l UNDEANED I
Figure 5. Enlry Inlo ProgramNerlfy Modes
12.75V
PO.2(Vpp)
~~~------------------------~;I~ r- 'SIKlL
25 PULSES
PO. I (I'GJ!)
f.oI41-------.l
..I·MAsEL
/ \ 98Jl8 MIN
1'0.0 (ASEL) _J ~ ________ _ _ _ 10Jl.
__ liN
_ _ _ _ _ _ _ _ _ _ __ _
Xr----L-OW--A-DD-R-E-SS---------------------------------------------
----------------~~
H 'ADSTA H 'DVGL 'AVQV---.j
j-------
PORT I INVAUDDATA DATA TO BE PROGRAMMED INVAUD DATA VAUDDATA
'"1____----- VERIFY MODE -------...r_-- PROGRAM MODE ---0""1------ VERIFY MODE ---...,oo-tl
Figure 6. ProgramNerlfy Cycle
8XC851 OVERVIEW In addition, some special security features • Two 16-bit counterltimers
The SOC851 and the 83C851 (hereafter are implemented:
referred to collectively as the 8XC851) are • Two external interrupts
• ROM code protection:
EEPROM expanded versions of the 80C51. Mask-programmable. When implemented, • External memory addressing capability
These devices are pin-lor-pin compatible with access to the internal ROM is possible only
- 64k ROM and 64k RAM
the SOC51 with the addition of 256 bytes of when executing internal program memory;
EEPROM. The addition of the EEPROM it is. not possible to access the internal • Low power consumption
makes these devices suitable for a variety of ROM when executing external program - Idle mode
applications, specifically control and security memory.
- Power-down mode
systems.
• EEPROM protection:
• ROM code protection
The 8XC851 includes a 4k x 8 ROM, a In the security mode (enabled when the
128 x 8 RAM, a 256 x 8 electrically erasable security bit is set), the contents of the • EEPROM security mode
programmable read-only memory EEPROM are protected and, when
(EEPROM), 32110 lines, two 16-bit executing external program memory, no Differences from the 8OC51
timer/counters, a seven-source, two priority read or write operation to the EEPROM is
level nested interrupt structure, a serial 110 possible except "Blockerase" ("Blockerase" Special Function Registers
port for either full duplex UART or 110 clears all bytes, including the byte The SFRs are identical to those of the
expansion, and an on-chip oscillator and containing the security bits). standard 80C51 with the exception of five
clock circuit. The 80C851 includes all of the registers (EADRL, EADRH, EDAT, ECNTRL,
The 8XC851 features include:
83C851 features except the on-board 4k x 8 and ETIM) that have been added to allow
ROM. • 80C51 pin-for-pin compatibility control of the 256 bytes of EEPROM. Table 1
is a detailed expansion of the special function
The 8XC851 has two software selectable ·4kx8ROM
registers.
modes of reduced activity for further power
.128 x8 RAM
reduction: idle mode and power-down mode. Refer to the 80C851 data sheet for additional
Idle mode freezes the CPU while allowing the • 256 x 8 EEPROM information.
RAM, timers, serial port, and interrupt system - On-chip voltage multiplier for eraseiwrite
to continue functioning. Power-down mode
- SO,OOO eraseiwrite cycles per byte
freezes the oscillator, causing all other chip
functions to be inoperative while maintaining - 10 years non-volatile data retention
the RAM contents. - Infinite number of read cycles
AF AE AD AC AB M A9 AS
IE' Interrupt enable A8H EA I - I - I ES I En I EXl I ETO 1 EXO OxxOOOOOB
PO' PortO 80H 87 86 85 84 83 82 81 80 FFH
Pl' Port 1 90H 97 96 9S 94 93 92 91 90 FFH
P2' Port 2 AOH A7 A6 AS A4 A3 A2 AI AO FFH
P3' Port 3 BOH B7 B6 B5 B4 B3 B2 Bl BO FFH
PCON Power control 87H SMOOJ - I - 1 - J GFl J GFO j PO j 10L OxxxOOOOB
07 06 OS 04 03 02 01 DO
PSW' Program status word DOH CY I AC I FO 1 RSl J RSO 1 ov 1 - J P OOH
SBUF Serial data buffer 99H xxxxxxxxB
9F 9E 90 9C 9B 9A 99 98
SCON' Serial port control 98H SMO I SMI I SM2 I REN I TB8 I RB8 I TI I RI OOH
SP Stack pointer 81H 07H
8F 8E 80 8C 8B 8A 89 88 OOH
TCON· Timer/counter control 88H TFI I TRl I TFO I TRO I IEl I In I lEO 1 ITO OOH
39
LOGIC SYMBOL
Vcc vss
~
17 29
0:_
E}ADDRESS AND
-
DATA BUS 18 28
~-
44 34
}~ 33
}im·~-
11 23
12 22
BLOCK DIAGRAM
FREOUENCY
REFERENCE COUNTERS
,--'-, ,--'-,
XTAL2 XTAL1 TO 11
r- -~--J------------------------t--r----------
I
I OSCILLATOR PROGRAM DATA TWO 16·BlT
AND MEMORY MEMORY lIMER/EVENT EEPROM
liMING (4K.SROM) (128.S RAM) COUNTERS (256.S)
~ :>. L r- ~ :>. ~
i'
7
CPU
A
"
"\j
rrrr
INTERNAL
INTERRUPTS
7- ;.
" " "
~
64K BYTE BUS PROG SERIAL PORT
EXPANSION PROGRAMMABLE 1/0 FULL DUPLEX UART
CONTRTOL SYNCHRONOUS SHIFT
--
INTO
---------~---~{}{}{}--
mTl CONTROL PARALLEL PORTS,
----
ISEmALIN SEmALOUT
----------
I
L-,------J ADDRESs/oATA BUS
AND 1/0 PINS SHARED WITH
EXTERNAL
INTERRUPTS PORT 3
n n n 0
44 34
7[ P39 33
Lee
17[ P29 11 23
;; it 12 22
PIN DESCRIPTION
PIN NO.
MNEMONIC DIP LCC QFP TYPE NAME AND FUNCTION
Vee 40 44 38 I Power Supply: This is the power supply voltage for normal, idle, and power·down
operation.
PO.O-O.7 39-32 43-36 37-30 110 Port 0: Port 0 is an open-drain, bidirectional 110 port. Port 0 pins that have ls written to
them float and can be used as high-impedance inputs. Port 0 is also the multiplexed
low-order address and data bus during accesses to extemal program and data memory.
In this application, it uses strong internal pull-ups when emitting 1s.
P1.O-P1.7 1-8 2-9 40-44, 110 Port 1: Port 1 is an 8-bit bidirectional 110 port with internal pull-ups. Port 1 pins that have
1-3 1s written to them are pulled high by the internal pull-ups and can be used as inputs. As
inputs, port 1 pins that are externally pulled low will source current because of the internal
pull-ups. (See DC Electrical Characteristics: IILl.
P2.O-P2.7 21-28 24-31 18-25 110 Port 2: Port 2 is an 8-bit bidirectional 110 port with internal pull-ups. Port 2 pins that have
1s written to them are pulled high by the internal pull-ups and can be used as inputs. As
inputs, port 2 pins that are externally being pulled low will source current because of the
internal pull-ups. (See DC Electrical Characteristics: IILl. Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to
external data memory that use 16-bit addresses (MOVX@DPTR). In this application, it
uses strong internal pull-ups when emitting 1s. During accesses to external data memory
that use 8-bit addresses (MOV @Ri), port 2 emits the contents of the P2 special function
register.
P3.O-P3.7 10-17 11, 5, 110 Port 3: Port 3 is an 8-bit bidirectional 110 port with internal pull-ups. Port 3 pins that have
13-19 7-13 1s written to them are pulled high by the internal pull-ups and can be used as inputs. As
inputs, port 3 pins that are externally being pulled low will source current because of the
pull-ups. (See DC Electrical Characteristics: IILl. Port 3 also serves the special features
of the SC80C51 family, as listed below:
10 11 5 I RxD (P3.D): Serial input port
11 13 7 0 TxD (P3.1): Serial output port
12 14 8 I INTO (P3.2): External interrupt
13 15 9 I !RTf (P3.3): External interrupt
14 16 10 I TO (P3.4): limer 0 external input
15 17 11 I T1 (P3.S): limer 1 external input
16 18 12 0 WR (P3.6): External data memory write strobe
17 19 13 0 RO (P3.7): External data memory read strobe
RST 9 10 4 I Reset: A high on this pin for two machine cycles while the oscillator is running, resets the
device. An internal diffused resistor to V55 permits a power-on reset using only an
external capacitor to Vee.
ALE 30 33 27 110 Address Latch Enable: Output pulse for latching the low byte of the address during an
access to external memory. In normal operation, ALE is emitted at a constant rate of 1/6
the oscillator frequency, and can be used for external timing or clocking. Note that one
ALE pulse is skipped during each access to external data memory.
PSrn 29 32 26 0 Program Store Enable: The read strobe to external program memory. When the device
is executing code from the external program memory, PSrn is activated twice each
machine cycle, except that two l'SEN activations are skipped during each access to
external data memory. PSrn is not activated during fetches from internal program
memory.
EA 31 35 29 I External Access Enable: EA must be externally held low to enable the device to fetch
code from external program memory locations OOOOH and OFFFH. IfEA is held high, the
device executes from internal program memory unless the program counter contains an
address greater than OFFFH.
XTAL1 19 21 15 I Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock
generator circuits.
EEPROM EADRH register address is F3H. The EADRL The ETIM register address is F5H. Table 1
Communications between the CPU and the register address is F2H. contains the values which must be written to
EEPROM is accomplished via 5 special the ETIM register by software for various
Data Register (EDAT) oscillator frequencies (the default value is
function registers; 2 address registers (high
This register is required for read and write 08H after RESET).
and low byte), 1 data register for read and
operations and also for rowlblock erase. In
write operations, 1 control register, and 1 The general formula is:
write mode, its contents are written to the
timer register to adapt the eraselwrite time to
addressed byte (for "row erase" and "bloCk 5ms Write time:
the clock frequency. All registers can be read
erase" the contents are don't care). The write
and written. Figure 1 shows a block diagram Value (decimal, fXTAL 1 [kHz] _ 2
pulse starts all operations, except read. In
of the CPU, the EEPROM and the interface. to be rounded up) 204.8
read mode, EDAT contains the data of the
Register and Functional addressed byte. The EDATregisteraddress 10ms Write time:
is F4H.
Description fXTAl1 [kHz] _ 2
TImer Register (ETIM) Value (decimal)
Address Register (EADRH, EADRL) 96
The timer register is required to adapt the
The lower byte contains the address of one of
eraselwrite time to the oscillator frequency. Control Register (ECNTRL)
the 256 bytes. The higher byte (EADRH) is
The user has to ensure that the erase or write See Figure 2 for a description of this register.
for future extensions and for addressing the
(program) time is neither too short or too The ECNTRL register address is F6H.
security bits (see Security Facilities). The
long.
INTERRUPT
)f CONTROL I
EJ
LOGIC
SEQUENCER 8
POWER-DOWN IDLE
l EEPROM
RESET CLOCK
GENERATOR
COLUMN 3 5 ROW
ECNTRL I EnM DECODER DECODER
CPU
CLK
< ;:. 'I' I
"
l.....- I--- 8
~ ~
I EDATA I I EADRH I I EADRL I
V V
INTERNAL BUS
} ~J D I
Figure 1, EEPROM Interface Block Diagram
321 0
IFE EEiNT EWP I ECKTRl31 ECKTRl21 ECKTRl1l ECNTRLD I
Bit Symbol Function
ECNTRL.7 IFE Active high EEPROM interrupt flag: sat by the sequencer or by software; reset by software.
When set and enabled, this flag forces an interrupt to the same vector as the serial port
Interrupt (see Interrupt section).
ECNTRL.6 EEINT EEPROM Interrupt enable: set and reset by software (active high).
ECNTRL.5 EWP Eras.e/Write In progress flag: set and reset by the sequencer (active high). When EWP is set.
access to the EEPROM Is not possble. EWP cannot be set or reset by software.
ECNTRL.4 Reserved.
ECCTRL.3- See table below.
ECNTRLO
Operation ECNTRL.3 ECKTRL2 ECKTRL1 ECNTRLO
Byte mode a a a a
Row erase 1 1 a a
Page write· - - - -
Page eraseJwrito'" - - - -
block erase 1 a 1 a
Future products.
Byte mode: Normal EEPROM mode, default mode after reset. In this mode, data can be read and written to one byte at
a lima.
Read mode: This is the default mode when byte mode is selected. This means that the contents of the addressed byte
are available in the data register.
Wrtle mode: This rrode is activated by writing to the data register. The address register must be loaded first. Since the
old contents are read first (by default), this allows the sequencer to decide whether an erase'Write or write
cycle only (data _ OOH) is required.
Row erase: In this mode, the addressed raw is cleared. The three LSBs of EADRL are not signHicant, i.e. the 8 bytes
addressed by EAORL are cleared in the same time normally needed to clear one byte
(tAOWERASE - Ie - tw). For the following write modes, only the write and not the eraselwrite cycle is
required. For exall1Jle, using the row erase mode, programmng 8 bytes takes tTOTOot.L .. Ie + S x tw
coll1Jared to troTAL - 8 x IE + S x tw (It: - 1eRASE' Iw - t'MllTE)'
Page write: For futuro products.
Block erase: In this mode all 256 bytes are cleared. The byte containing the security bils is also cleared. taOCKERASE '" tEo
The contents of EADRH, EADRL and EDAT are insignificant.
security Facilities the EJ!i pin low or by passing the 4K mode to internal access within the MOVe
boundary). For S8 = 1 and 'external access" cycle.
EEPROM Prolectlon only, the 'block erase" mode is enabled. The
The EEPROM is protected using four security Additionally, a maSk-programmable ROM
program sequence has 10 be as follows:
bits which are contained in an exira code prolection facility is available. When the
EEPROM byte al address 8000H MOV EADRH, #80H (security byte address) program memory passes the 4K boundary
(EADRH/EADRL). They can be sel or cleared MOV EADRL, #OOH (security byle address) using both the internal and exlernal ROMs, il
by software. To activale the EEPROM MOV ECNTRL, #OAH (block erase mode) is nol possible to access the internal ROM
protection, the program sequence in byle MOV EDAT, #xxH (start block erase) from the external program memory if the
mode musl be as follows: mask-programmable ROM security bil is sel.
All 256 data bytes, the security bits, and S8
An access 10 the lower 4K bytes of program
MOV EADRH, #SOH will be cleared after completing this mode
memory using the Move instruction is only
MOV EADRL, #OOH (EWP = 0). S8 will also be affected in byte
possible while executing internal program
MOV EDAT, #FFH mode when wriling to the security byte (not
memory.
for S8 = 1 and 'external access"). Figure 3
If two or more of these bits are reset, S8 = 0, illustrates the access to S8. Also the verification mode (Iesl-mode which
the security mode is disabled and the ROM Code Prolectlon writes the ROM contents 10 a port for
EEPROM is nol protected. If three or four bits Since the external access mode can only be comparison with a reference code) is not
are set, S8 = 1 and the 81: mode differs from selected by pulling the EJ!i pin low during implemented for security reasons. A different
the internal access mode. reset, it is not possible to read the internal test-mode is implemented for test purposes.
In this case, access 10 the EEPROM is only program memory using the MOVC instruction This mode allows every bit to be lested.
possible in one mode regardless of how the while executing external program memory. However, the internal code cannol be
exlernal access mode is reached (by pulling Furthermore, it is not possible to change this accessed via a port.
RESET
S8=1
OSCILLATOR (i.e., the EWP bit has to be reset before INTERRUPT SYSTEM
CHARACTERISTICS activating the idle or power-down modes; External ewnts and the real-time-driven
XTAL 1 and XTAL2 are the input and output, otherwise EEPROM accesses will be on-chip peripherals require service by the
respectively, of an inverting amplifier. The aborted). CPU asynchronous to the execution of any
pins can be configured for use as an on-chip particular section of code. To tie the
oscillator, as shown in the logic symbol, IDLE MODE asynchronous activities of these functions to
page 610. In idle mode, the CPU puts itself to sleep normal program execution, a multiple-source,
while all of the on-chip peripherals stay two-priority-Ievel, nested interrupt system is
To drive the device from an external clock active. The instruction to invoke the idle provided. Interrupt response latency is from
source, XTALI should be driwn while XTAL2 mode is the last instruction executed in the 3115 to 711s when using a 12MHz crystal. The
is left unconnected. There are no normal operating mode before the idle mode S83C851 acknowledges interrupt requests
requirements on the duty cycle of the external is activated. The CPU contents, the on-chip from 7 sources as follows:
clock signal, because the input to the internal RAM, and all of the special function registers ~ 1Nm and lJilTT: externally via pins 12 and
clock circuitry is through a dividEl-by-two remain intact during this mode. The idle mode 13, respectiwly,
flip-flop. Howewr, minimum and maximum can be terminated either by any enabled - Timer 0 and timer 1: from the two internal
high and low times specified in the data sheet interrupt (at which time the process is picked counters,
must be observed. up at the interrupt service routine and
- Serial port: from the internal serial 110 port
continued), or by a hardware reset which
RESET or EEPROM (1 vector).
starts the processor in the same manner as a
A reset is accomplished by holding the RST power-on reset. Each interrupt vectors to a separate location
pin high for at least two machine cycles (24 in program memory for its service program.
oscillator periods), while the oscillator is POWER-DOWN MODE Each source can be individually enabled (the
running. To insure a good power-up reset, the In the power-down mode, the oscillator is EEPROM interrupt can only be enabled when
RST pin must be high long enough to allow stopped and the instruction to invoke the serial port interrupt is enabled) or
the oscillator time to start up (normally a few power-down is the last instruction executed. disabled and can be programmed to a high or
milliseconds) plus two machine cycles. At Only the contents of the on-chip RAM and low priority level. All enabled sources can
power-up, the voltage on Va; and RST must EEPROM are preserved. A hardware reset is also be globally disabled or enabled. Both
come up at the same time for a proper the only way to terminate the power-down external interrupts can be programmed to be
start-up. mode. The control bits for the reduced power level-activated and are actiwlow to allow
Nole: Before entering the idle or power-down modes are in the special function register "Wire-ORing" of several interrupt sources to
modes, the user has to ensure that there is PCON. Table 2 shows the state of the 110 one input pin.
no EEPROM eraselwrite cycle in progress ports during low current operating modes.
Note: The serial port and EEPROM interrupt
flags must be cleared by software; all other
flags are cleared by hardware.
DC ELECTRICAL CHARACTERISTICS
Tomb = OOC to +70°C (Vee - 5V±20%) -40°C to +85°C (Vee - 5V+20%)
- or-40°C to +125°C (Vee = 5V+l0%)
- Vss = ov
PART TEST UMITS
SYMBOL PARAMETER TYPE CONDITIONS MIN MAX UNIT
Vil Input low voltage, except U o to +70°C --{).5 0.2Vee--{)·1 V
-40 to +85°C --{).5 0.2Ve~·15 V
-40 to + 12SoC --{).5 0.2V~.25 V
VIl1 Input low voltage to U o to +70°C --{).S 0.2Ve~.3 V
-40 to +85°C --{).5 0.2V~.35 V
-40 to + 125°C --{).5 0.2V~.45 V
VIH Input high voltage, except XTAL 1, RST o to +70°C 0.2Vee+0.9 Vee+O·5 V
-40 to +8SoC 0. 2Vee+1.O Vee+0.5 V
-40 to + 125°C 0. 2Vee+1.O Vee+0.5 V
VIH1 Input high voltage, XTAL1, RST o to +70°C O.7Vee Vee+0.5
-40 to +85°C 0· 7Vee+0.1 Vee+0.5
-40 to + 12SoC 0.7Vee+0.1 Vee+O.S
VOL Output low voltage, ports 1, 2, 3 6 10l = 1.6mA4 0.45 V
Vou Output low voltage, port 0, ALE, PSEliI' 6 10l =3.2mA4 0.45 V
VOH Output high voltage, ports 1, 2,3, ALE, PSEliI' 10H = -SOIJA, 2.4 V
10H = -2SIJA, 0. 75Vee V
10H = -10flA 0.9Vee V
VOH1 Output high voltage, port 0 in external bus 10H = -8oolJA, 2.4 V
modeS 10H = -3oolJA, 0.75Vee V
10H =-80flA 0.9Vee V
III Logical 0 input current, ports 1, 2, 3 o to +70°C VIN = 0.4SV -50 f1A
-40 to +85°C -75 f1A
-40 to +12SoC -75 f1A
In Logical 1-to-O transition current, ports 1, 2, 3 o to +70°C VIN =2.0V -650 f1A
-40 to +85°C -750 f1A
-40 to + 12SoC -750 IJA
lu Input leakage current, port 0, U 0.45V<Vj<Vee ±10 IJA
Icc Power supply current: See note 7
Active mode @ 16MHz 1 32 mA
Idle mode@ 16MHz 2 6.5 mA
Power down mode 3 100 f1A
RRST Internal reset pull-down resistor 50 150 k.Q
AC ELECTRICAL CHARACTERISTICS1, 2
16MHzCLOCK VARIABLE CLOCK
SYMBOL FIGURE PARAMETER MIN MAX MIN MAX UNIT
l/tcLcL 4 Oscillator frequency 1.2 16 MHz
ALE
PORTO
PORT 2 A8-A15
ALE
IWHLH -
i+-----ILLDV ~I
--+lof---IRLRH ---~
RD _ _ _ _ _ _-+____---.
PORTO INSTRIN
AO-A7 FROM PCL
PORT 2
P2.0-P2.7 OR AB-A 15 FROM DPH A8-A 15 FROM PCH
ALE
tWHLH
--lIo!+----tWLWH - - - - + I
WR -------+------.1
Iovwx
t--+t--tgw ----~
PORTO
DATA OUT AD-A7FROM PCL INSTRIN
PORTZ
1'2.0-P2.7 OR A8-A15 FROM DPH A8-A15 FROM PCH
XTALI
PI s:.z 1P1 S~ 1P1 S3pz Ipl s;.z Ipi s~ Ipl S6pz PI S~ Ipi S~ \PI S3pz \Pl ~ Ipi SSpz Ipi S6pz
INPUT
ALE
PSER
lID
WR
P=~
FETCH
PORTZ - - - - - ,
(EXTERNAL) '-----------'
ADDRESS TRANSInONS
PORT
OUWUT ----------_~~~______________~
__________________
OLD DATA
~r1~
I
______________________
NEW DATA
~r_l~ ______
PORT
INPUT
SERIAL
PORT
(SIIFT CLOCK)
____--Ir-
SAMPLING TIllE OF 110 PORT PINS DURING INPUT (INCLUDING JNTII AND IHll)
~
Vcc-4-S
0.45V
O·7VCC
o.2Vss-G·' 2.
0.45V
4V
=X 2.0V
~O_.8_V_ _ _ _ _ _ __
>C
NOTE:
AC Inputs during testing are driven at 2.4V for a logic '1' and 0.45Vfor a logic '0',
Timing measurements are made at 2.0V min IOf a logic '1' and O.BV for a logic '0',
NOTE:
For timing purposes, a pon Is no longer floating when a l00mV change from load vohage occurs, and begins 10 floal when a 100mV change
from the loaded VOHNOL level oocurs. IOH'toL >± 2OmA.
RST
RST
Vss VSS
Figure 11. Icc Test Condition, Active Mode Figure 12. Icc Test Condition, Idle Mode
All other pins are disconnected All other pins are disconnected
RST
Ycc;-O·S - - - -._-"""""
O.SY
(NC) XTAL2
tClCl
Figure 13. Clock Signal Waveform for Icc Tests Figure 14. Icc Test Condition, Power Down Mode
In Active and Idle Modes All other pins are disconnected.
= =
felCH tCHCl Sns =
Vcc 2V to S.SV
ORDERING INFORMATION
VSS ClK
I I
~ ~
ROM RAM EEPROM
POWER-ON/OFF
n
RESET 2 K BYTES
6 K BYTES 256 BYTES
DATA &
PROGRAM DATA
PROGRAM
MEMORY MEMORY
lOW FREQUENCY MEMORY
DETECTOR
~(
CPU
II II f
I li li ~
INTERRUPT
SYSTEM
CALCULATION
UNIT
PROGRAMMABLE
I/O
I TWO 16-BIT
TIMERS
i i
~ ~
MBA740
1/01 1/02
PINNING
PIN
SYMBOL DESCRIPTION I I
(PAD) vss-D C5 C1 D~vDD
Voo C1 . +5 volts power supply pin during
normal operation, idle mode and
power-down mode
active LOW input that initializes the
RESET C2
processor
CLK C3 external clock input. The internal
clock frequency = the external
c2D-REsET
clock frequency
Vss C5 ground
1101 C7 quasi bi-directional port (TTL
compatible), the user's program
must include routines able to
handle an asynchronous serial
communication through a single 110
port (for half-duplex) .
1/02 C8 quasi bi-directional port (TTL 1/01 --f. 0 C7
compatible) 1/02 --f.D C8 C3DTCLK
~----------------------~
MBA907
EEPROM AS DATA MEMORY FOR THE CALCULATION UNIT: pointers are loaded by the CPU and decremented by the
calculation unit's sequencer. EADRL 1 or EADRL2 supply
Communication between calculation unit and EEPROM
the LOW byte (LSB) of the EEPROM address. The HIGH
is performed via SFRs (see Table 1), these comprise:
byte (MSB) of the EEPROM address is taken directly
• 2 EEPROM SFRs address registers (one HIGH and from the EADRH register. The access to the EEPROM
one of two alternate LOW address bytes) from the calculation unit, is controlled by the calculation
• calculation unit SFRs. unit SFRs .
The EEPROM data output is directly connected via a When the access to EEPROM by the calculation unit is
special bus to the data registers of the calculation unit. active, the EEPROM is not accessible by the CPU,
The calculation unit has direct READ access to the neither as data memory nor as program memory. When
EEPROM. the calculation unit is operating, but not accessing the
EEPROM, the CPU can READ, WRITE and EXECUTE
During memory access, the EEPROM is addressed by EEPROM.
one of two address pointers EADRL 1 or EADRL2. Both
.....,,--r~,.-,.-,.-.,., FFFFH
FFH 7FFH
128 BYTES RAM
FAB KEYS "-...
INDIRECT ADDRESSING 7FOH "-... 87FFH
FFH
8OHTO FFH
EEPROM
2K BYTES
DATA + CODE
r- 8000
SFRs
DIRECT ADDRESSING
r- / 17FFH
/
80H
7FH / 6 K BYTES
128 BYTES RAM
DIRECT &
USER
AREA
/ USER ROM
INDIRECT ADDRESSING /
00 000
/ 0000
t t
EADRH. program
EADRL1 counter
EEPROM SFRs
Table 1 provides a listing of the EEPROM associated SFRs:
EEPROM SFR descriptions • when there is no active access to the EEPROM from
EADRH the calculation unit, the contents of the EADRL 1
register are continuously loaded into its associated
EADRH is an 8-bit register (SFR), used as an address down counter. There is no hardware-decrement of the
pointer, it is loaded from the CPU and contains the down counter. The combination of EADRL 1 plus it's
highest byte (MSB) of the EEPROM address. Only bits down counter behaves therefore as a normal register.
EADRH.7, 2, 1,0 are relevant. Default value after reset In this mode, the LOW address byte of the EEPROM
is '1 OOOOOOOB'. is always supplied by EADRL 1. EADRL2 behaves
similar to EADRL 1 but it is not used for EEPROM
EADRL 1, EADRL2 addressing. Its contents are irrelevant.
EADRL 1 is an 8-bit register (SFR), used as an address Calculation unit access to the EEPROM:
pOinter, it is loaded from the CPU. Its contents are
transferred into an 8-bit down counter which provides the • EADRL 1 is the EEPROM LOW address pointer used
LOW byte (LSB) of the EEPROM address. The CPU has to address an operand (Ai) stored in the EEPROM. At
WRITE access to the EADRL 1 register and READ the beginning of the calculation unit's computation
access to the down counter. cycle, the address content of the EADRL 1 is loaded
into it's associated down counter. During the
Default value after reset of both the EADRL 1 register calculation, further EADRL 1 address transfers to the
and associated down counter are OOH. The transfer of down counter stop, whilst the down counter is
EADRL 1 to the down counter and the decrement are decremented by the calculation unit's sequencer.
controlled by the calculation unit. The behaviour of During a calculation, the EADRL 1 register can be
EADRL 1 depends on whether or not there is an access reloaded from the CPU with a new address. This new
in progress from the calculation unit to the EEPROM. address will then be used during the next calculation.
No access from the calculation unit to the EEPROM:
• EADRL2 (SFR) is the second EEPROM LOW started. In this mode, the data written to EDAT is then
address pointer which is required for some operations irrelevant. The ECNTRL 1 status bits EWP and IFE
of the calculation unit. It is used to address an indicate whether the EEPROM ERASElWRITE operation
operand (Xi) stored in the EEPROM. The function of is still active. Whilst the EEPROM programming is in
EADRL2 is similar to EADRL 1 function. EADRL2 progress, rewriting data to EDAT is not allowed.
cannot be used as a second address register for
normal CPU access to the EEPROM. Timer register ETIM
The ETIM timer register (SFR) is required to adapt the
Data register EDAT ERASElWRITE time to the clock frequency. ERASE (t.)
This register (SFR) is used to read data from the and WRITE (fw) times of 5 ms each are required. The
currently addressed EEPROM byte. When EDAT is user has to ensure that the ERASE or WRITE time is
written during BYTE MODE, it's contents will be neither too short nor too long. Table 2 gives values for
programmed into the addressed EEPROM byte. When ETIM register for given clock frequencies. ETIM has to
EDAT is written during ROW ERASE or BLOCK ERASE be loaded by software in advance to the first
mode, the ROW ERASE or BLOCK ERASE operation is ERASEIWRITE operation. ETIM's default value after
reset is '08H'.
IFE
I EEINT
I EWP
I - OPERATION MODE SELECT
7 I 6 l 5 I 4 3 2 1 0
BYTE MODE - t 0 0 0 0
ROW ERASE -t 1 1 0 0
BLOCK ERASE - t 1 0 1 0
TEST MODE -t 1 1 1 1
interrupt
request
EEPROM
OE 2Kx12BIT
INCLUDING ERROR
EEPROM CORRECTION
SEQUENCER AND
LOGIC
12
MBA7.J2
RAM address pointers • there is direct RAM memory access from the
calculation unit
The calculation unit uses 4 RAM pointers to address the
• the data transfer from the registers to their associated
RAM during it's direct memory access: AIPR, XIPR,
down counters is stopped
AOPR and APR.
• the address pointers AIPR, XIPR and APR address
ADDRESS POINTERS AIPR, XIPR, AOPR the operands Ai, Xi and A[3-0] while AOPR addresses
the Ao result area in RAM
AIPR and XIPR pointers address the operand fields Ai
• while the up and down counters are incremented/
resp. Xi inside RAM, while AOPR addresses a RAM area
decremented under control of the calculation unit, the
Ao where the calculation result is to be stored. Each
CPU can reload the registers with new addresses,
pOinter consists of an 8-bit register with associated 8-bit
ready for transfer to their down counters at the
down counter. The counter provides a RAM address. It is
beginning of the next calculation cycle.
parallel loaded from it's register.
The CPU has WRITE access to the registers and READ
access to the counters. Default values after reset for all
registers and counters are OOH. The data transfer from
the registers to their down counters and the counter
decrement are controlled by the calculation unit.
CALCULATION UNIT The calculation unit does not carry out a complete
exponentation in one step. However, it provides a set of
This unit computes, with it's associated software, any
basic instructions, from which the complete
exponential functions like x· mod.n. It has been designed
exponentation algorithm can be built by a dedicated
to optimize the calculation time of exponent modulo N. It
software. All of these basic instructions operate on
uses 196 by1es of RAM for 512-bit length operands.
data-fields inside RAM and EEPROM. The width of these
CALCULATION UNIT PERFORMANCE data-fields is variable. A typical operand width is 512 bits.
At felK = 6 MHz: x· modulo N is performed in 1.5 s The basic operation of the calculation unit is to multiply
typical, with 512 bit operands. either a 24-bit number or a 32-bit number with a
long-word (e.g. 512-bit) and adding the result to another
long-word. Further XOR and shift operations may be
To reach this speed, the calculation unit's architecture
carried out to give the final result. With a 32-bit number
provides:
this operation completes in typically 45 Ils at 6 MHz clock
• fast multiplication and addition frequency.
• fast carry handling
• fast data transfers to fetch operands from RAM or
EEPROM and to store results in RAM
o simultaneous operation of both CPU and calculation
unit.
a
8= (A +Ya.X) $ value
r---,---r---r,.,..,-,=r - - - - -,--,---,----,.--.,
IYn-1IYn-2IYn-3IY~~·~1 1Yo 1 Ya
Ir~-n_1~1--~~------~~~--~~
____
- -'---'-----'---'-----'
1xo 1 X
*
-
L - ._ - - ' . _ - - - ' _ - - - ' _ _ _ _ _ _ -'-_-'-_-'-_..1..---'
+
1Ao 1 A
I=A=n-=11========= ================ $
- B XOR value
result
80 8
'-1,-8-n_+=31=========18=n-=1=1======== ================
-
Fig.6 Multiply and accumulate step.
MBA 747
IYn-1IYn-2IYn-31 Ya
*
BX
+
BA
EB
(initial value) B XOR value
memory initialized
r----r--,---,- - - - - -,--,----,----,
-
00 00 8
'----''----'----'- - - - - -'---'---'-----'
MBA 749
A = (A + Ya.O) EB value * 2 32
+
----
IAn- 1 1 1 Ao 1 A
----
E9
B XORvalue
=~~~~-=-~-Y-I:A:O:LI__o-o~:_o-o~:=o_o- _-0=0= A
-
=1A=n-=1=1========== = = = = -L-r
MBA 750
B = (A + Ya.O) EB value
a
+
Ir- -r1-..-----.--- - - - - ---,-----,--,----.
An-_1
- 1 Ao 1
L-----'-_--'-_--'-_ _ _ _ _ _ _ _-'--_-'--_L-----l
~
A
EB
XORvalue
- 1 Ao 1
L-----'-_--'-_--'-_ _ _ _ _ _ _ _-'--_-'--_L-----l
-
----
----
1 Yo 1 Ya
*
Ixn- 1 1
-
----
----
1 Xo 1 X
+
IAn- 1 1
-
---- 1 Ao 1 A
~
E9
XORvalue
result
:lij:9ja:.1::=:=::=18:n-=11:::::::: =====1:80::1o:o::oo::o:o:r:gp:ll
-
Fig.10 Multiply accumUlate step and shift.
MBA748
8
o
0 A
step 2 r-IN-n_-r1-"-""'--- - - - -
1
' - - - - ' - _ - ' - - - - L_ _ _ _ _ _
----r--..------.--~
I No I X
0 *
1st reduction modulo on the intermediate result and shift 18n+318n+218n+11 8n 1 Va
+
=18=n-=11======== ==== 180 1 A
1=8=n:18=n-=11============·=1======--~I-o~l-o~o~1 8
step 3 '-M-n_-r
L.
1 1-,----.---- - - - - ----.----.--.,------.
1
1Mo 1
_ 1 - ._ - ' - - - - L_ _ _ _ _ _ _- - - L _ - - L . - - - - - l _ - l
X
*
2nd intermediate multiply Icn-4 1cn-5 1cn-6 1 Va
+
1.-8-n-,-I-8n--1-.1-.----.------.---,---.-- - - - - --.----.-.,----,
0
I I 1A
0 0
L - - - L _ - L - - - - 1 _ - . l - _ L . . - - - L _ . . . l . . -_ _ _ _ _ _---1_--1-_L-......J
Note
1. Ai operand and Xi operand can be stored in either the RAM or the EEPROM.
MBA741
Command and status registers CMD and CMDSTAT This allows the CPU to re-initialize the CMD register for
the next calculation while the current calculation is still
The calculation unit has two 8 bit registers (SFRs) for
busy.
commands and status. SFR CMD is used for commands
only, SFR CMDSTAT is used for both commands and The CMDSTAT SFR (see Table 10) is not pipelined and
status (2 command bits and 3 status bits). may not be reloaded by the CPU whilst the calculation
unit is active. Both CMD and CMDSTAT registers are
7 bits of the CMD register are pipelined (see Table 8). At
cleared at reset. Tables 9 and 11 describe the function of
the beginning of a calculation, the contents of these
single status and control bits within the CMD and
seven bits are transferred into an internal command
CMDSTAT registers.
register that controls the calculation unit's sequencer.
1 1 1 1 1 1 1
j
internal CMD interrnal command
loaded by the --.1 DWA' AE2P' XE2P' XOR' 1 SHIFT 1LDRAM' 1 M32' register
calculation unit (7·bit latCh)
,1 1 1 1 1 1 1 I MBC335
to the sequencer
calculation calculation
cycle # 1 cycle # 2
DONE
CMRD
WRITE LIMIT REGISTER WRLlM: The performance of the calculation unit degrades if
pOinter and control register initializations are done in
• as long as the CNTCYCL contents are greater than between two consecutive calculation cycles. The full
the WRLlM's contents, writing of the Ao output result calculation speed is reached when these initializations
to RAM is inhibited. are carried out by the CPU in parallel to a computation
cycle of the calculation unit (see Fig. 13). Thus with Table 12 1/0 SFR
parallel initializations, when a current computation cycle
is completed, all of the required initializations have
already been done to enable the next computation cycle
of the calculation unii to start immediately.
10 register Either 1/0 line can be used independently from the other
as an input or as an output. For an 1/0 line to be used as
The 83CB52 has 2110 lines: 1101 and 1/02. Line 1/01 is an input, a set 1 must first be written to it's port-latch.
represented by 101 (bit 0) and line 1/02 is represented by See Fig. 14. The strong output driver FET P1 is turned
102 (bit 1) of the 10 register (SFR). 10 bits: 7, 6, 5, 4, 3 off after one extemal clock period. The pin is then pulled
and 2 are don'teare. HIGH by the weak pull-up FETs P2 and P3. It can be
pulled LOW by an external source. After a hardware
reset, both port latches contain a set 1 and both lines
1/01 and 1/02 are in Input mode.
~__-+~~--~--------r----VDD
Qfrom port
latch
1/01
identical for
1/02
for use in ISO standard half duplex serial communication, only 1/01 is needed. Full duplex serial communication
may be carried out via both lines 1/01 and 1102.
Timers
The 83C852 has two 16-bit timer registers Timer 0 and
Timer 1 . The timer registers are incremented each
machine cycle and are thus capable of counting machine
cycles. Since a machine cycle consists of 6 external
clock periods, the count rate is 1/6 of the clock
frequency. Each timer has three operating modes:
(a)
(b)
Timers 0 and 1 are controlled via the two SFRs: Timer Mode Control (TMOD) and Timer ControVExtemal Interrupt
Control (TCON).
Table 17 IE SFR
Table 19 IP SFR
Low frequency sensor In the power-down mode, all on-chip intemal clocks are
frozen. The CPU and all on-chip peripherals stop
The low frequency detector circuit triggers a reset of the working. The only exit from a power-down mode is by a
CPU when the clock frequency falls below fCLK minimum hardware reset. The on-chip RAM and SFRs retain their
(approximately 500 kHz). When the clock frequency rises values until the power-down mode is terminated. Reset
above fCLK minimum the reset is de-activated. redefines the SFRs, but does not change the RAM
contents. The VDD supply can be reduced to 2 V whilst
Power ON/OFF reset the power-down mode is active. Both modes are
The power ON/OFF reset circuit triggers a reset of the activated by software via the SFR Power Control register
CPU when the power supply falls below VDD minimum PCON. PCON is not bit addressable.
(approximately 3.5 V). When the power supply rises
above VDD minimum, this reset is de-activated. When the
power-down mode is active (PD is set 1) the power
ON/OFF reset is de-activated.
Note
1. If a logiC 1 is written to PO and IOL at the same time, PO takes precedence.
SFRs
SYMBOL RESET VALUE FUNCTION
ADDRESS
FBH WRLlM OOOO.OOOOB WRITE limit register for calculation unit
FAH RDLIM OOOO.OOOOB READ limit for calculation unit
F9H CNTCYCL OOOO.OOOOB cycle counter for calculation unit
F7H ECNTRL2 XXXX.OOOOB EEPROM control register (test modes)
F6H ECNTRL1 OOOO.OOOOB EEPROM control register (user modes)
FSH ETIM 0000.1000B EEPROM timer register
F4H EDAT XXXX.XXXXB EEPROM data register
F3H EADRH 1000.0000B EEPROM address register HIGH
F2H EADRL1 OOOO.OOOOB EEPROM address register 1 LOW, address pointer
AIPE for calculation unit
F1H EADRL2 OOOO.OOOOB EEPROM address register 2 LOW, address pOinter
XIPE for calculation unit
FOH B OOOO.OOOOB B register
EOH ACC OOOO.OOOOB accumulator
DOH PSW OOOO.OOOOB program status word
B8H IP XXXO.OOOOB interrupt priority register
BOH 10 XXXX.XX11B 1/0 register
A8H IE OXXO.OOOOB interrupt enable register
A7H AOPR OOOO.OOOOB AOPR register for calculation unit
A6H APR OOOO.OOOOB APR register for calculation unit
ASH XIPR OOOO.OOOOB XIPR register for calculation unit
A4H AIPR OOOO.OOOOB AIPR register for calculation unit
A3H CXOR OOOO.OOOOB CXOR register for calculation unit
99H CMD OOOO.OOOOB command register for calculation unit
98H CMDSTAT XXXO.OOOOB command and status register for calculation unit
8DH TH1 OOOO.OOOOB Timer 1 HIGH
8CH THO OOOO.OOOOB Timer 0 HIGH
8BH TL 1 OOOO.OOOOB Timer 1 LOW
8AH TLO OOOO.OOOOB Timer 0 LOW
89H TMOD XXOO.XXOOB Timer 0 and 1 mode control
88H TCON OOOO.XOOOB Timer 0 and 1 control and external interrupt control
87H PCON XXXX.OOOOB power control register
83H DPH 0000.00008 data pointer HIGH
82H DPL OOOO.OOOOB data pointer LOW
81H SP 0000.01118 stack pointer
~
F8 CNTCYCL ROLIM WRLlM FF
co
,
cr
;::;:
~
Cf
FO B EADRL2 EAORL1 EAORH EOAT ETIM ECNTRL1 ECNTRL2 F7 3 ~
E8 EF
('5"
a "ag-
0 0
EO ACC E7 o liT
....
::I
08 OF a
DO PSW 07 ..,CD
C8 CF
CO C7
m B8 IP BF
~ ..
BO ... 10< .. B7
A8 IE AF
AO CXOR AJPR XIPR APR AOPR A7
98 CMOSTAT CMO 9F
90 97
88 TCON TMOD TLO TL1 THO TH1 8F
80 SP -
DPL
--- - -
DPH ------
PCON 87
- - - - ---
MBA746
l~I
[J0!Bil 83C852 specific SFR's :i"
co ~
w ~
() 1Il:;;
co
Fig.16 SFRs mapping. 01
I\) ~
o
::;,
Signetics Microcontroller Products Preliminary specification
INSTRUCTION SET
The instruction set consists of 49 single-byte, 46lwo-byte and 16 three-byte instructions. When using a 6 MHz
external clock, 64 instructions execute in 1 cycle (1 I-Is) and 45 instructions execute in 2 cycles (2 I-Is). Multiply and
divide instructions execute in 4 cycles (4I-1s).
OPCODE
MNEMONIC DESCRIPTION BYTES CYCLES
(HEX)
Logic operations
ANL A,Rr AND register to A 1 1 5'
ANL A,direct AND direct byte to A 2 1 55
ANL A,@Ri AND indirect RAM to A 1 1 56,57
ANL A,#data AND immediate data to A 2 1 54
ANL direct,A AND A to direct byte 2 1 52
ANL direct,#data AND immediate data to direct byte 3 2 53
ORL A,Rr OR register to A 1 1 4'
ORL A,direct OR direct byte to A 2 1 45
ORL A,@Ri OR indirect RAM to A 1 1 46,47
ORL A,#data OR immediate data to A 2 1 44
ORL direct,A OR A to direct byte 2 1 42
ORL direct,#data OR immediate data to direct byte 3 2 43
XRL A,Rr Exclusive-OR register to A 1 1 6'
XRL A,direct Exclusive-OR direct byte to A 2 1 65
XRL A,@Ri Exclusive-OR indirect RAM to A 1 1 66,67
XRL A,#data Exclusive-OR immediate data to A 2 1 64
XRL direct,A Exclusive-OR A to direct byte 2 1 62
XRL direct,#data Exclusive-OR immediate data to direct byte 3 2 63
CLR A Clear A 1 1 E4
CPL A Complement A 1 1 F4
RL A Rotate A left 1 1 23
RLC A Rotate A left through the carry flag 1 1 33
RR A Rotate A right 1 1 03
RRC A Rotate A right through the carry flag 1 1 13
SWAP A Swap nibbles within A 1 1 C4
OPCODE
MNEMONIC DESCRIPTION BYTES CYCLES
(HEX)
Data transfer
MOV A,Rr Move register to A 1 1 E"
MOV A,direct"" Move direct byte to A 2 1 E5
MOV A,@Ri Move indirect RAM to A 1 1 E6,E7
MOV A,#data Move immediate data to A 2 1 74
MOV Rr,A Move A to register 1 1 F"
MOV Rr,direct Move direct byte to register 2 2 A"
MOV Rr,#data Move immediate data to register 2 1 7"
MOV direct,A Move A to direct byte 2 1 F5
MOV direct,Rr Move register to direct byte 2 2 8"
MOV direct,direct Move direct byte to direct 3 2 85
MOV direct,@Ri Move indirect RAM to direct byte 2 2 86,87
MOV direct,#data Move immediate data to direct byte 3 2 75
MOV @RI,A Move A to indirect RAM 1 1 F6, F7
MOV @Ri,direct Move direct byte to indirect RAM 2 2 A6,A7
MOV @Ri,#data Move immediate data to indirect RAM 2 1 76, 77
MOV OPTR,#data 16 Load data pointer with a 16-bit constant 3 2 90
MOVC A,@A+OPTR Move code byte relative to OPTR to A 1 2 93
MOVC A,@A+PC Move code byte relative to PC to A 1 2 83
PUSH direct Push direct byte onto stack 2 2 CO
POP direct Pop direct byte from stack 2 2 DO
XCH A,Rr Exchange register with A 1 1 C"
XCH A,direct Exchange direct byte with A 2 1 C5
XCH A,@Ri Exchange indirect RAM with A 1 1 C6,C7
XCHO A,@Ri Exchange LOW-order digit indirect RAM with A 1 1 06,07
Note: the following MOVX instructions of SOC51 set are not applicable to 83C852
MOVX A,@Ri Move extemal RAM (8-bit address) to A 1 2 E2,E3
MOVX A,@OPTR Move extemal RAM (16-bit address) to A 1 2 EO
MOVX @Ri,A Move A to external RAM (8-bit address) 1 2 F2, F3
MOVX @OPTR,A Move A to external RAM (16-bit address) 1 2 FO
OPCODE
MNEMONIC DESCRIPTION BYTES CYCLES
(HEX)
Boolean variable manipulation
CLR C Clear carry flag 1 1 C3
CLR bit Clear direct bit 2 1 C2
SETB C Set carry flag 1 1 D3
SETB bit Set direct bit 2 1 D2
CPL C Complement carry flag 1 1 B3
CPL bit Complement direct bit 2 1 B2
ANL C,bit AND direct bit to carry flag 2 2 82
ANL C,/bit AND complement of direct bit to carry flag 2 2 BO
ORL C,bit OR direct bit to carry flag 2 2 72
ORL C,/bit OR complement of direct bit to carry flag 2 2 AO
MOV C,bit Move direct bit to carry flag 2 1 A2
MOV bit,C Move carry flag to direct bit 2 2 92
Program and machine control
ACALL addr11 Absolute subroutine call 2 2 .1addr
LCALL addr16 Long subroutine call 3 2 12
RET Return from subroutine 1 2 22
RETI Return from interrupt 1 2 32
AJMP addr11 Absolute jump 2 2 .1addr
LJMP addr16 Long jump 3 2 02
SJMP rei Short jump (relative address) 2 2 80
JMP @A+OPTR Jump indirect relative to the OPTR 1 2 73
JZ rei Jump if A is zero 2 2 60
JNZ rei Jump if A is not zero 2 2 70
JC rei Jump if carry flag is set 2 2 40
JNC rei Jump if carry flag is not set 2 2 50
JB bit,rel Jump if direct bit is set 3 2 20
JNB bit,rel Jump if direct bit is not set 3 2 30
JBC bit,rel Jump if direct bit is set and clear bit 3 2 10
CJNE A,direct,rel Compar.e direct to A and jump if not equal 3 2 B5
CJNE A,#data,rel Compare immediate to A and jump if not equal 3 2 B4
CJNE Rr,#data,rel Compare immed. to reg. and jump if not equal 3 2 8·
CJNE @Ri,#data,rel Compare immed. to indo and jump if not equal 3 2 86,B7
OJNZ Rr,rel Decrement register and jump if not zero 2 2 O·
DJNZ direct,rel Oecrement direct and jump if not zero 3 2 05
NOP No operation 1 1 00
· 8,9,A,9,C,D, E,F.
• 11,31,51,71,91,91, D1, F1.
3
i...
1 JBC ACALL LCALL RRCA DECA DEC DEC@Ri DEC Rr o· "a~
bit, rei addrll addr16 dir 0 I 1 011 I 2 3 4 5 6 7 a
0
~
2 JB AJMP RET RLA ADD ADD ADDA,@Ri ADD A,Rr 0
bit,rel addrll A,#data A,dir 0 11 o 11 I 2 3 4 5 6 7 :J
.-+
3 JNB ACALL ~ETI RLCA ADDC ADDC ADDCA,@Ri ' ADDCA,Rr
.....
0
bit,rel addrl1 A,#data A,dir o. I 1 01112 3 4 5 6 7 (1)
4 JC AJMP ORL ORL ORL ORL ORLA,@Ri ORL A,Rr .....
rei addrll dir,A dir,#data A,#data A,dir 0 I 1 011 I 2 3 4 5 6 7
5 JNC ACALL ANL ANL ANL ANL ANLA,@Ri ANLA,Rr
rei addrll dir,A dir,#data A,#data A,dir 0 1 1 011 1 2 3 4 5 6 7
6 JZ AJMP XRL XRL XRL XRL XRL A,@Ri XRL A,Rr
~ rei addrll dir,A dir,#data A,#data A,dir 0 I 1 o 111 2 3 4 5 6 7
7 JNZ ACALL ORL JMP MOV MOV MOV @Ri,#data MOV Rr,#data
rei addrll C,bit @A+DPTR A,#data dir,#data 011 011 I 2 3 4 5 6 7
8 SJMP AJMP ANL MOVC DIV MOV MOVdir,@Ri MOV dir,Rr
rei addrll C,bit A,@A+PC AB dir,dir 011 011 12 3 4 5 6 7
9 MOV DPTR, ACALL MOV MOVC SUBB SUBB SUBB A,@Ri SUBB A,Rr
#data addrll bit,C A,@A+DPTR A,#data A,dir 011 o 11 I 2 3 4 5 6 7
A ORL AJMP MOV INC MUL MOV@Ri,dir MOV Rr,dir
C.lbit addrll C,bit DPTR AB 011 011 12 3 4 5 6 7
B ANL ACALL CPL CPL C CJNE A, CJNE CJNE @Ri,#data,rel CJNE Rr,#data,rel
C.lbit addrll bit #data,rel A,dir,rel 011 o 11 I 2 '3 4 5 6 7
C PUSH AJMP CLR CLR C SWAP XCH XCH A,@Ri XCH A,Rr
dir addrll bit A A,dir 0 I o 11, 2I 3 4 5 6 7
0 POP ACALL SETB SETB DAA DJNZ XCHD A,@Ri
1
DJNZ Rr,rel "
i.
3'
dir addrll bit C dir,rel o I 1 011 I
2 3 4 5 6 7 5"
II)
E MOVX AJMP MOVXA,@Ri CLRA MOV. MOVA,@Ri MOV A,Rr -<
A,@DPTR addrll 0 I1 A,dir 0 I 1 o 11 12 3 4 5 6 7 ex> Ul
w "C
F MOVX ACALL MOVX@Ri,A CPLA MOV MOV@Ri,A MOV Rr,A () ~
I ex>
@lDPTR,A addrl1 0 11 dir,A 0 1 1 011 2 3 4 5 6 7
• MOV A,ACC is not a .Ilid instruction,
01
I\)
£o
C!:
::J
Signetics Microcontroller Products Preliminary specification
ISO INFORMATION
The following ISO characteristics information as applicable to this data sheet may be superseded. Please ensure that
the latest version of ISO information is studied for relevant features.
Note
1. It is assumed that a pull-up resistor is used in the interface device (recommend value =20 kil).
liMITING VALUES
In accordance with the Absolute Maximum System (IEC 134)
HANDLING
Inputs and outputs are protected against electrostatic discharge in normal handling. However, to be totally safe, it is
desirable to take precautions appropriate to handling MOS devices (see 'Handling MOS Devices').
CHARACTERISTICS
V DD = 5 V (±10 %); Vss= 0 V; Tant> = 0 to 70 °C; all voltages with respect to Vss unless otherwise specified.
BOC51-Based
8-BH Mlcrocontrollers
CONTENTS
AN417 256k Centronics Printer Buffer Using the 87C451 Microcontroller . . . . . . . . . .. 676
AN425 Interfacing the PCD8584 12C-bus Controller to 80C51 Family Microcontrollers. 724
AN426 Controlling Aire Core Meters with the 87C751 and SA 5775 ......•........ 744
AN428 Using the ADC and PWM of the 83C752187C752 ....................... 765
AN429 Airflow Measurement Using the 83/87C752 and ·C· ..................... 772
Hoot
Proceaeor 8 .
RI1 I -
,. /
~
..'
WR l -
T f----.
11 I ~
74HCT373
WR RI1 00·D7 SEL IDS tIllS P6
(AFLAG)
~ CE
825163
Add",. .
8OC451
6116 ~
Static RAM
AIlO-AD7
,IL-- ---" Addr...
ALE [E
AD fi .~ -
f +,
_ _ _ _ .J
-V
A8-An
l.---
11
-y ' " - -
665
Signelics BOC51-Based 8-Bit Microcontrollers Application Note
SOFTWARE EXAMPLES the input buffer full flag (CSR bit 0). If the flag Conversely, the BOC451 polls the IBF flag
To.write 10 pori 6 on the bus shown in is clear, the host writes a byte to address and reads a byte from pori 6 when it finds the
Figure 1, the host processor first reads the BOOOH. This loads the input buffer latch of flag set. The flag is automatically reset when
CSR contents ateddress BOO1H, and tests pori 6 and sets the input buffer full flag. this internal read occurs.
I I 1 1 1 1
USING PORT 6 AS A STANDARD characteristics become identical to port 1 on standard quasi-bidirectional 110 port (see
QUASI-BIDIRECTIONAL I/O PORT the BOC51 and the BOC451 ports 1. 4, and 5. Figure 4). In this case. only IDS and ODS are
To use pori 6 as a common //0 pori, all of the No software initialization is required. tied to ground and the CSR is initialized to
control pins are tied to ground (see Figure 3). allow operation of AFLAG and BFLAG as
If desired, AFLAG and BFLAG can be used
On hardware reset, bits 2 - 7 in the CSR are simple outputs (see Figure 5).
as outputs while pori 6 is operating as a
set to one. Pori operation and electrical
666
Signetics 80C51-Based B-Bit Microcontrollers Application Note
B
P6 .>.,-+-_,/ P6 '" ,--,-_. /
8OC451 8OC451
= =
Figure 4. Standard 1/0 Port on Reset
Figure 3. Standard 1/0 Port on Reset with AFLAG and BFLAG as Outputs
1 X 0 X X 1
Figure 5. CSR Programmed to Allow AFLAG and BFLAG to Operate as Outputs and Port 6 as a Standard 110 Port
GroungRebJm
Pin No. Pin No. Signal PinNa. Signal
9 21 DATAB 36 SIl:TlR
10 26 JIl:KRIll"
11 29 BUSY
IMPLEMENTATION OF PARALLEL 2. The onboard UART allows RS232 5. The 64k byte ROM addressing capability
interfacing with only level shifting chips allows space for the most sophisticated
PRINTER PORTS USING PORT 6
added. software.
The BOC451 is an excellent choice for a
printer controller. The BOC451 has the 3. The 8-bit parallel ports 0 to 6 are ample to
In addition, either end of a parallel interface
facilities to permit all of the intelligent features drive onboard control functions, even
can be implemented using port 6, and the
of a common printer to be handled by a single when ports are used for external memory
chip: . interfaces can be interrupt driven or polled in
access, interrupts, and other functions.
either case.
1. The features of port 6 allow a parallel
4. The RAM addressing ability of ports 0 and
printer port to be designed with only line
2 can be used to address up to 64k bytes
driving and receiving chips required as
of a hardware bufferlspooler. AFLAG and
additional hardware.
BFLAG as simple outputs (see Figure 5).
667
Signetics 8OC51-Based 8-Bil Microcontrollers Application Note
THE INTERFACE Type 2-Another style of handshake generate acknowledge pulses. We could poll
Data transfer on a parallel printer interface generates a busy signal only when the printer the busy signal line, bul not all receivers
occurs across eleven signal lines. The other will not be able to accept more data for a generate busy signals for each byte received;
conductors on the standard plug are used as relatively long time. Acknowledge pulses are so lack of a busy signal does not imply that
ground returns or for auxiliary functions (see created after every byte received. When the we can send another byte. We can, however,
Figure 6). Only the data transfer signals will busy signal is generated after a byte is expect an acknowledge pulse very shortly
be considered. received, the associated acknowledge pulse after the end of a busy signal if one is going
does not occur until after the busy signal to arrive at all. So we can send a new data
The Data Transfer Format returns to logic zero (see Figure 7). byte after having received either a positive
The parallel printer interfaces are far more transition on the acknowledge line, or shortly
Type 3--A third handshake style does not
standardized in features than their serial after receiving a negative edge on the busy
generate acknowledge pulses, but a busy
counterpart. However, alleast three line.
signal is produced after every byte is
significant variations exist in handshake style received. The CSR is programmed to the output only
in printers using generic parallel interfaces. mode. In this mode, the ODS' pin does not
This fact influences the design of both port control the output drivers but only the outpul
hardware and software. A good transmitter buffer full flag. The flag serves to record the
should be able to drive devices with all three
PARALLEL PRINTER
INTERFACES USING POLLING positive transition of the acknowledge signal.
styles of handshakes, and a good receiver
should generate the handshake most likely
The input latch is not used, but the pin is ms
Transmitter Operation used to set the input buffer full flag. This is
compatible with any transmitter. used to record the negative transition at the
This application illustrates the flexibility of the
port 6 logic in solving an applications end of the busy signal. Dummy reads by the
The Variations 80C451 of port 6 will be used 10 clear the
Type I-Figure 7 shows a common style of problem. We need to be able to handle all
types of acknowledge signals that might be flag. In this example, the AFLAG mode is set
handshake and is the style thaI will be
received by the transmitter. We will use the only to place the port in the output only mode.
implemented in the receiver examples. A
ODS' pin and output buffer full flag logic to The AFLAG pin is not actually used (see
busy signal and an acknowledge strobe pulse
record the receipt of the acknowledge pulse Figure 10).
are generated for every byte received.
(see Figure 8), but not all parallel receivers
Oa..
;: : ~: : ;:; : : : : ;: :,;: : : x
1- -
X::;;::::::;:::::::;;::::::;;::::::;;::::::;;::::::;;:::,::;;::::::;;:::::;;:::::::;::::::;::::::;;:::::;;::::::;::::::;;:::::,;:::::::::::::;::::::;;::::;;::::::;;:;:::
SlrObe-+---'--~~t~t-+--·~
Receiver Generated Signals
Handshake Type 1
--t~i~1r
Handshake Type 2
.~----------------', 1...-- ~ ~
. .1
I
---------------------_\~--~I;-
Figure 7, Parallel Printer Interface Signals
668
Signetics 80CS1-Based 8-Bit Microcontrollers Application Note
r----'
I I
I I
OIlS , - - -.......... H---'=--!-I-< BFlAG
STROlIE I
BFlAG >+-===--+--I :::~-I'" IDS
IDS
P6 P6
8OC451 8OC4S1
Bus Bus
Driver Receiver
AFLAG
Transmitter
= Receiver
0 1 1 0 0 1
The transmitter's CSR (control status NOTE: 1. The input buffer full flag is output through
registBr) is programmed to the following With this combination of modes set, port 6 is the BFLAG pin and is used as the busy
mode (see Figure 9): in the output only mode. signal to the transmitter.
1. CSR bit 6 controls the BFLAG output and
therefore the strobe line. Receiver Operation 2. The IBF flag is set and data is latched on
In receiver operation, the IDS input is used to the positive edge of IDS.
2. The OBF (output buffer full) flag controls
latch in the data transmitted on receipt of the 3. Writing to the CSR bit 4 controls the
the AFLAG output.
strobe pulse. The receiver'S CSR is AFLAG output and therefore the
3. The OBF is cleared on the positive edge programmed to allow the following (see acknowledge line.
of the ODS input. Figure 11):
669
Signetics 80CS1-Based 8-Bit Microcontroliers Application Note
1 0 0 1 1 0
670
Signetics 8OC51-Based 8-Bit Microcontrollers Application Note
SOFTWARE EXAMPLES
This polled parallel transmit routine outputs one byte passed to it in the accumulator.
MOV CSR,#064H ;INITIALIZE PORT 6 OPERATING MODE
JB P5.0 ;WAIT IF BUSY SIGNAL IS HIGH
MOVP6,ACC ;OUTPUT DATA
MOVR1.P6 ;DUMMY READ TO CLEAR IBF FLAG
MOVR1.#02H ;INITIALIZE DELAY COUNTER
CLEARCSR.6 :START STROBE PULSE
DJNZR1.$ ;TIME 6 MICROSECOND STROBE PULSE
SETB CSR.6 ;END STROBE PULSE
WAIT: JNB CSR.l.0UT ;EXIT IF ACKNOWLEDGE RCV'D
JNB CSR.O,WAIT ;EXIT IF NEGATIVE BUSY EDGE RCV'D
This polled parallel receive routine places one byte in the accumulator each time it is called.
MOV CSR,#09CH ;INITIALIZE PORT 6 OPERATING MODE
MOV R7,P6 ;DUMMY READ TO CLEAR IBF FLAG
JNB CSR.O ;INPUT BUFFER LATCH FULL?
CLRCSR.4 ;BEGIN ACKNOWLEDGE PULSE
MOVR7,#02H ;INITIALIZE DELAY COUNTER
DJNZR7.$ ;TIME ACKNOWLEDGE PULSE
MOVA.P6 ;READ BYTE - CLEAR BUSY SIGNAL
MOV R7,#02H ;INITIALIZE DELAY COUNTER
DJNZR7,$ ;TIME ACKNOWLEDGE PULSE
SETBCSR.4 ;END ACKNOWLEDGE PULSE
RET
671
Signetics 80C51-Based 8-Bit Microcontrollers Application Note
INTERRUPT DRivEN PARALLEL through the AFLAG pin. The OBF is cleared Receiver Operation
on the positive edge of ODS. The net result is In receiver operation, the IDS input is used to
PRINTER INTERFACE (SEE
that INTO is triggered on the end of the ACK latch in the data transmitted on receipt of the
FIGURE 13) pulse (a poSitive edge). This signals the strobe pulse. The receiver's CSR is
transmitter that another byte may be programmed to allow the following (see
TransmlHer Operation
transmitted. The transmitting 83C451 is free Figure 16):
The transmitter's CSR (control status
to do other tasks prior to this interrupt. 1. The input buffer full flag is output through
register) is programmed to the following
mode (see Figure 14): In this routine, Figure 15, the main program the BFLAG pin and is used as the busy
1. CSR bit 6 controls the BFLAG output and establishes a buffer in data memory ended by signal to the transmitter. The ISF flag is
therefore the strobe line. an ASCII end of text character. To begin set and data is latched on the positive
outputting the buffer, the routine PSEND is edge of lOS.
2. The OBF (output buffer full) flag controls
called. The rest of the buffer is emptied by 2. Writing to the CSR bit 4 controls the
the AFLAG output.
the interrupt vectors to PSEND1. A FLAG output and therefore the
3. The OBF is cleared on the positive edge acknowledge line.
For printers which generate acknowledge
of the ODS (output data strobe) input.
pulses, output rates of 25k transfers per
4. The ISF flag is set on the negative edge second are achieved. Timer generated The receiver is interrupted on the negative
of the lOS (input data strobe) pin. interrupts are used to periodically return edge of the data strobe. Data is latched in on
program execution to the routine to service the positive edge of the strobe pulse (see
NOTE: non-acknowledging printers and to provide a Figure 17). Since the strobe pulse is normally
With this combination of AFLAG and BFLAG timeout feature. Non-acknowledging printers very short, there is little time lost between
modes set, port 6 is in the output only mode. are serviced at a rate of about 2.5k transfers receiving the interrupt and having valid data
The output drivers are always enabled and per second. This maximum rate may be in the input latch. The receiver is free to do
the ODS input is only used to clear the OBF varied by adjusting the timer reload value. As other tasks prior to receiving themm
flag. written, the time out procedure attempts to interrupt.
retransmit a byte when the printer has not
INTO is programmed to be negative edge
acknowledged for an excessively long time.
sensitive and is connected to the OBF flag
r----'
I I
I I
AFLAG
BHAG
AFLAG
IIrnI
IDS 1+-....--< ~_--"''''-L_+--< BFLAG
P5.0
P6 P6
8OC451
IL.. _ _ _ _ .J
Cable
8OC451
Bus . Bus
Driver Receiver
Transmitter Receiver
672
Signetics 80C51-Based 8-Bit Microcontrollers Application Note
0 1 1 0 1 1
Figure 14. CSR Programmed for Use as an Interrupt Driven Parallel Transmitter
No
673
Signetics BOC51-Based B-Bit Microcontrollers Application Note
, 0 0 , , 0
Figure 16. CSR Programmed for Use as an Interrupt Driven Parallel Receiver
Figure 17. Flow Chart 'of Interrupt Driven Parallel Receiver Operation
SOFTWARE EXAMPLES
The software for the interrupt driven parallel receiver is similar to the polled receiver example. However. after an interrupt is received. this routine
checks to confirm that data has been latched by the positive edge of the strobe pulse before proceeding with the routine.
INIT: MOV CSR,#090H ;INITIALIZE CSR
SETBEXO ;ENABLE INTERRUPT 0
SETBITO ;SET NEG EDGE TRIGGERED INTERRUPTS
SETB EA ;ENABLE ALL INTERRUPTS
ORG EXTIO ;INTERRUPT 0 VEcTOR
JMP RCVR
RCVR:
RCVR: JNB CSR.O,# ;CONFIRM DATA LATCHED
CLRCSR.4 ;START ACKNOWLEDGE PULSE
MOVR7,#02H ;INITIALIZE THE DELAY COUNTER
DJNZR7,# ;TIME ACK PULSE
MOVA,P6 ;READ BYTE - RESET BUSY LINE
MOV R7,#02H ;INITIALIZE THE DELAY COUNTER
DJNZR7,$ ;TIME ACK PULSE
SETBCSR.4 ;END ACK PULSE
RET1
674
Signetics 8OC51-Based B-Bit Microcontrollers Application Note
This is the software for the interrupt driven parallel transmitter example.
; XMIT ROUTINE DRIVEN BY ACK PULSE GENERATED INTERRUPTS, OR TIME GENERATED INTERRUPTS
; FOR NON ACKNOWLEDGING PRINTERS. READS DATA BUFFER IN EXTERNAL RAM STARTING AT 100H
; AND READING UNTIL 04H IS FOUND.
ORG RESET
JMP 26H
ORG TIMERO
JMP PSEND1
ORG EXTIO
JMP PSEND1
ORG 26H
MOV CSR,#064H ;PORT6MODE
MOV TMOD,#OO2H ;CONFIGURE TIMER 0 TO 16 BITS
SETBTOO ;INTO IS EDGE TRIGGERED
SETB EA ;ENABLE INTERRUPTS
PSEND: MOV DPTR,#0100H ;SET DPTR TO START OF TEXT
;BUFFER
PSEND1: CLREA ;DISABLE INTERRUPTS AND STOP
;TIMER
CLRTRO ;IF ENABLED
CLRETO
MOVR7,OOH ;CLEAR TIMEOUT COUNTER
MOVR6,OOH
MOVTHO,#-4 ;SET TIMER INTERRUPT PERIOD
MOV TLO,#OOH
JBOCBH,BB ;BUS BUSY
MOV ACC,#OOH ;CLEAR ACCUMULATOR
MOVX 1,@DPTR ;RETRIEVE FIRST BYTE
MOV06,ACC ;OUTPUT FIRST BYTE
CJNE A,#OO4H, CONn ;LOOK FOR END OF TEXT
JMP EOTB
CONT1: SETB ERXO ;ENABLE INTO
CKROEEH ;START STROBE PULSE
INC DPTR
MOVACC,DPH ;LOOK FOR PHYSICAL END OF
JB ACC.2,EOTB ;TEXT BUFFER
SETBOEEH
JMP CONT
EOTB: CLREXO ;END OF TEXT FOUND, DISABLE
;INTO
SETBOEEH
SETB EA
RETI
BB: INCR7 ;COUNT TIMER TIMEOUTS ON
;BUS BUSY
CJNE R7,#OOH, CONT ;LOOK FOR OVERFLOW
INCR6 ;COUNT OVERFLOWS
CJNE R6,#10H, CONT ;TIMEOUT APPROX 5 SEC
JMPTO
CONT: SETBTRO ;ENABLE TIMER INTERRUPT
SETB ETO ;START TIMER
SETB EA
RETI
TO: CLROC9H ;SEND NEW STROBE PULSE IN
;RESPONSE TO TIMEOUT
NOP
NOP
MOVR6,#OOH ;RESET TO COUNTER
MOVR7,#OOH
SETBOC9H ;END OF STROBE PULSE
JMP PSEND1
675
Slgnellcs 80C51-Based 8-Blt Mlcrocontrollers Application Note
DESCRIPTION two 74LS244 buffers (U2, U3) and a' sets the input buffer full flag (IBF). BFLAG is
This application note describes a stand alone 76HCT374 (U4) octal flip-flop are needed. programmed to mirror the contents of IBF,
Centronics type parallel printer buffer using The U2 and U3 buffers are included to and therefore becomes asserted. This makes
the 87C451 expanded 110 microcontroller. provide full drive capability for the output port it i~al to be used as the BUSY output for the
This type of unit would typically be placed and some of the handshake signals on the input port. After the input port data has been
between a personal computer and its printer. input port, as the output buffers on the read and stored in the RAM buffer, BFLAG is
It captures the data to be printed at high 87C451 can only drive 3 LSTTL loads. U4 de-asserted by performing a dummy read of
speed, freeing the personal computer to go to has S-bit data strobed into it by the /sTB port 6, which clears IBF. To complete the
other tasks, and sends data to the printer as pulse of the input port. input port logic, one of the port 3 pins, P3.4,
required. As described here, 256k dynamic is used as the acknowledge signal, and is
As the code size for this application is quite asserted/de-asserted by software. The IODS
RAMs are used, providing over one quarter
small (less than lk bytes), the on-chip pin is tied to ground to permanendy enable
million characters of storage. If desired the
instruction memory is quite sufficient for the port 6 output drivers. This does not cause
design is easily modified to work with 1
program storage. For a production version, difficulty as no data is being input into the
megabit DRAMs. Although written with the
the 87C451 could be replaced with the port.
87C451 in mind, this design is applicable to
83C451 with a 4k x 8 masked ROM on chip.
the BOC451 and 83C451. Note that programming port 6 to operate in
Note that port 0 and port 1 are not used in the
present design; thus the 80C451 may be the bidirectional mode as described above
Design Objectives means the loss of 10DS as an acknowledge
used in this application with the addition of an
The objectives kept in mind during the design input. The acknowledge input is normally
external address latch and EPROM.
of this device were: provide a substantial size used to clear the OBF (output buffer full) flag,
of buffer, keep the parts count and the power The IRAS, ICAS, and IWR signals for the indicating that the printer is ready for another
consumption to a minimum, and use readily DRAM array are provided by port 3 bits IWR, character. On the other hand, operating port 6
available components. IRD, and n. Note that as in the BOC51 , all in the "output only· mode causes the loss of
A buffer size of 256k bytes was chosen port 3 signals are multifunctional. That is, BFLAG as BUSY output. Because the input
because, although a 64k byte buffer is very each can be treated as a regular port requires an instant BUSY indication
easily implemented using the B051 familts quasi-bidirectional port bit, or as having the while the output port only needs to remember
64k extemal data storage capabilities, it is a special function indicated by its name. This the occurrence of an acknowledge pulse, it
little too small for today's printing applications feature is an advantage when using IWR and makes sense to program port 6 to operate in
that print a page of text in graphics mode, IRD as IRAS and ICAS control signals for a the bidirectional mode, with IODS grounded
using up twenty times as many bytes as DRAM array. Treated as a normal port bit, the to enable the output drivers. The liNn pin
standard printing mode. Presenting a method IWR pin is cleared and set by individual CLR can be used instead of/ODS to record the
for controlling 256k DRAMs shows off the 110 and SETB instructions for a normal length , occurrence of an acknowledge pulse with the
capabilities of the 87C451 , and it is very easy RAM read or write cycle. However, when interrupt system.
to add the extra address line for one megabit performing a refresh cycle, IRAS (port 31WR)
devices if a larger buffer is needed. can be pulsed low using a dummy MOVX Priority and Execution of Tasks
@RO,A (move to external data memory) There are three tasks that must be performed
The 8XC451 Mlcrocontroller instruction. This allows DRAM refresh to be in this system: Receive-servicing the input
The 8XC451 is an 8-bit microcontroller based done much more quickly than would port and storing the input character;
on the familiar 8051 family of devices. In fact, otherwise be possible. Transmit-sending stored characters to the
it is an 80C51 with three added ports: P4, P5, output port as required; and
Port 1 and one bit from port 4 form the 9-bit Refresh-performing DRAM refresh. The
and P6. Ports 4 and 5 give 12 (16 in PLCC) address reqUired when addressing the DRAM
additional quasi-bidirectional 110 lines. Port 6 timers and interrupt system are used to
array. The data inputs to the array come from manage the execution and priority of these
provides another 8 bits of 110, plus 4 the parallel input data lines which are latched
handshake lines that can be programmed to tasks. Figure 2 and Figure 3 illustrate the flow
by U4. The RAM data outputs are fed to port charts of these tasks. Firmware, broken into
operate in several useful modes for
5. By making the data outputs available to the sections, performing these three frunctions as
interfacing. The 8XC451 comes in three processor, it is possible to add'some
versions: ROMless 80C451, 83C451 with well as an initialization routine is provided.
additional features to the firmware, such as
4k x 8 ROM, and 87C451 with 4k x 8 The 51C256 DRAMs require a 256 row
control codes for printing multiple copies of a
EPROM. refresh every 4 milliseconds. Rather than do
document, data compression, data
conversion, etc. which are not implemented an entire refresh cycle every 4 milliseconds, it
In this note, port 6 is used in the 110 mode as
in this design. is done as 64 rows every millisecond. This
a Centronics compatible printer output port.
Additionally, the nos and BFLAG pins leaves time for other tasks to get service
Port 6 Operation ·slices· more frequenUy. As DRAM refresh is
normally associated with port 6 are used as
The liDS (input data strobe) and BFLAG pins obviously the highest priority, timer 0 is used
part of the input port logic. For a complete
are normally used in conjunction with the port as the refresh interval timer, and is
discussion of port 6 operating modes and
programming, see the application note 6 bidirectional mode. In this mode, the liDS programmed to the 16-bit mode, and set to
pin is used to strobe data into the port 6 input the higher priority level in the interrupt priority
AN408 tided "83C451 Microcontroller
Operation of Port 6." latches, and BFLAG is used as flag output. In (IP) register. The refresh code is written
in-line rather than in a loop to maximize
this application, however, these two bits are
Circuit Description used to good effect as part of the (separate) speed.
Figure 1 is a schematic diagram of the printer input port logic. When a byte of data is An interesting point to note is that when there
buffer circuit. Other than the 87C451 (Ul), strobed into U4 by the printer port of the host are no characters stored, the DRAM does not
and the eight 256k DRAMs (U5-U 12), only computer, the ISTB signal connected to nos need to be refreshed. If power consumption
676
Signetics 8OC51-Based B-Bit Microcontrollers Application Note
is of concern, the B7C451 could be The printer (output port) service routine runs output ports are easily implemented for serial
programmed to go into idle mode whenever all the time, except when the CPU is called to interfaces or printers using the built-in UART.
the buffer were empty. A character strobed service the other conditions, therefore having The pins used for parallel port handshaking
into the input port would cause an interrupt, the lowest priority. If there are characters in could then be used as serial handshaking
restarting the B7C451; DRAM refresh would the buffer, polling is used to check for output lines, providing the standard "modem·
be maintained until the buffer was once again port BUSY status. If the printer is not busy, signals.
empty. then the character is sent, and the output port
Combining the above two features, this circuit
ISTB pin (P4.3) is cleared and set. The
could act as a "splitter: By connecting a
output port lACK line is connected to the
The next highest priority should be input port daisy-wheel printer to the serial port, a
liNn pin, so that the negative going edge of
service, as the reason for having a printer dot-matrix printer to the parallel port, and
the lACK signal is recorded as an interrupt
buffer is to get the data out of the computer sending an "address· flag in the file header,
pending. A very short INT1 service routine
as quickly as possible. Therefore, the input simUltaneous letter-quality and draft printing
sets a software flag to indicate that the printer
port ISTB signal is connected to the /INTO pin could be done.
acknowledge the last character.
(as well as U4's clock pin and liDS). Interrupt
o is programmed in the interrupt priority
Possible Enhancements
The size of the DRAM array is easily
register to be at the lower interrupt level so it expanded to one megabyte or large devices
There are a number of features that could be by connecting the additional address pins to
cannot prevent refresh service. The interrupt
added to this design. As mentioned
o service routine stores the input character at previously, the microcontroller could be put
port 4 bits 1 and 2. Only slight modifications
the next location in the DRAM array, using to the operating firmware would be required.
into the idle mode when the buffer is empty,
the technique of a circular FIFO buffer. The
conserving power. Conclusion
routine also sends back an acknowledge
pulse by clearing and setting the P3.4 pin, The software could be enhanced to provide The SCBXC451 microcontrollers provide
and then clears the BUSY (BFLAG) pin by features such as multiple copies of a plenty of 110 pins that previously had to be
performing a dummy read of port 6 (unless document, data compression, data implemented by clumsy I/O expansion
this character caused the buffer to be conversion, automatic printer setup, etc. The methods. The flexibility of port 6 means that
completely full). PC operating system could be suitably this device can be used in a wide variety of
modified to send a header for each file to be applications requiring special port functions,
printed, containing these parameters. There while still using the industry standard B051
During periods of access to the DRAM array
is plenty of room for operating firmware instruction set
by the input and output routines, the global
expansion, and plenty of horsepower left in
interrupt enable bit (EA) is cleared so that the The Application Note, describing a typical
the B7C451 to handle these features.
refresh interrupt does not disturb the contents parallel printer buffer, makes full use of the
of ports 1 and 4, or the IRAS, ICAS, and IWR The two serial port pins RxD and TxD were BXC451 features, yet allows room for
signals. deliberately left unused so that input andlor enhancement and expansion.
677
c: I\)
:t
:::l
oB25 CO
74LS244 ~-----------.
~. <n ct.
0
::l0> en
M
U3 ...,lL/ErrOr I
C>
CO"
P4.3 1~ <]2 120 SLeT 0
.... 0
()
nNTl
PS.7 66
16
U3
4
LJ 11,PE
1i:!BUIY
J..j/ACK eo
(»-
()
:::reo
::l
~
g,en
~:
co
87C451
PS.6
PS.5
65
64
63
..L.05
...§.J 04 Printer
"a
() 2.
Q.
'?'
g]
PLCC PS.4 ~n
PS.3 62 ~03 Output <nrn :;::
(i'
PS.2 61 ...!..,02 Port ...... "0
60 a
PS.l }:Ol 3_.::l ::::!. 0
a
n ....
PS.O :::l
eo a
;tOO
100S 'ISTB
0
an ..,0- ~
Ol
..... _ _ _ _ _ _ _ _ _ _ 1
+5Vo---f Eli
AFLAG 0 c:
':'
::l~
':'
~eo
Ul PS.7 51 o ..,
:!! 52 50
10
c: XTAL2
PS.6
P5.5 49 eo
..,
iil 46
,... P5.4
47
P5.3
III +5V P5.2 46
n XTALI
J
45
I~
Ol
P5.1
n
'"'" III
P5.0
14 141 14 141 14 1!..
5'
52
III
+5VO---O
..1 P4.0
PH
Q Q Q I Q Q I Q Q
ax
51C2560r41256
10 Pl.6
Ol Pl.5 10
3 35
-l
'11
RST PIA 31 11
r_~l~L~~
30 12 A4
10~F P1.3
29 6 A3 us U6 U7 US I US Ul0 I Ull U12
56 O.l~
nos 2a 7 A2
Each
I 5 t; w"'''''' 5 Al
.ii J! a.. I U3
4 AO
16 DRAM
_ ell ISTB: 115 5 nNTO IRAS
VSS
P3.4 ICRS
17 57 BFLAG IWR o o I 0 I 0 o o o
21 21
Input U3
Port
':' >
:t> '"'2.
z
~ ~I
':' ....... o·
:::l
.. _-------;
" Z
a
iii
Signetics 80CS1-Based 8-Bit Microcontrollers Application Note
679
Signetics 80CS1-Based 8-Bit Microcontrollers Application Note
Repeated
64Umea
680
Signetics 80C51-Based 8-Bit Microcontrollers Application Note
SIGNETICS CORPORATION
OCTOBER,1988
., .,
................................................ * •••••••••••••••••••••• *. _••••• "' •• "' •••••• ,. ••• * .
, ,
$M0d451
$1iUe(*XC451 Printer Buffer)
$Date( 10/28/88)
PORT USAGE:
681
Signetics 80C51-Based 8-Bit Microcontrollers · Application Note
; Miscellaneous Equates:
ORG 18h
START: MOV SP,#40h ; Initialize stack pointer.
MOV A,#OO
MOV REFCNT,A ; Initialize refresh counter.
MOV INLOW,A ; Initialize FIFO pointers.
MOV INMID,A
MOV INHI,A
MOV OUTLOW,A
MOV OUTMID,A
MOV OUTHI,A
682
Signetics 80CS1-Based 8-Bit Microcontrollers Application Note
Main Routine:
Executes while not performing DRAM refresh or servicing
input port interrupt.
683
Signetics 80051-Based 8-B~ Microcontrollers Application Note
Check if input port busy flag was left asserted, indicating that
the buller was full after last input. If so, acknowledge input
port and de-assert input busy signal.
684
Signetics 80C51-Based 8-Sit Microcontrollers Application Note
685
Signetics 80C51-Based 6-Bit Microcontrollers Application Note
686
Signetics 80C51-Based 8-Bit Microcontrollers Application Note
MOVX @RO,A ; 55
INC P1
MOVX @RO,A ;56
INC P1
MOVX @RO,A ;57
INC P1
MOVX @RO,A ;58
INC P1
MOVX @RO,A ; 59
INC Pl
MOVX @RO,A ;60
INC P1
MOVX @RO,A ; 61
INC Pl
MOVX @RO,A ; 62
INC Pl
MOVX @RO,A ; 63
INC P1
687
Signelics aoCS1-Based 8-Bit Microcontrollers Application Note
SJMP INooNE
END
688
Signelics 80C51-Based 8-BII Mlcrocontrollers Application Note
INTRODUCTION TO THE 83C552 16·BIT COUNTERITIMER twice the maximum external counting rate as
The 83C552 is an 8OC51 derivative with The description of Countermmer 2 in the compared to the standard timers.
several extended features: 8k ROM, 256 following paragraphs is intended to be a Any programming of the clock source or the
bytes RAM, 100bit AID converter, two PWM general overview. Details on architecture, prescaler divide ratio results in a reset of the
channels, two serial 110 channels, six 8-bit address locations, interrupt structure, and prescaler. This allows the state of the timer
110 ports, and four counter/timers. The timer operation are given in the 83C552 subsystem to be in a known state upon
architecture of the 83C552 is identical to that Users Manual. This users manual may be programming. The main 16-bit timer cannot
of the 80C51, making the two devices fully useful to complement the material presented be reset by soiIWare but it is reset by
code compatible. The additional peripheral in this application note. References to activating the reset pin or using the external
functions are added to the 80C51 Special registers, bits, 110 ports, and on-chip reset, RT2. The external reset, RT2, can be
Function Register space, and the interrupt hardware will relate directly to 83C552 Users enabled or disabled by bit T2ER in TM2CON.
structure is modified accordingly. This Manual nomenclature. This application note These resets reset the prescaler as well as
information is detailed in other references on will focus on the use of Countermmer 2 as a the 16-bit counter.
the 83C552. The focus of this application powerful input capture and high-speed output
note is on one of the timers of the 83C552, facilitator through some specific examples Only one interrupt is available from the IS-bit
Countermmer 2. and not on the detailed coding. counter timer. Two bits in TM2CON control
whether TM2L, TM2H, or both flags will be
This counterltimer includes capture, The counter/timer consists of a 16-bit counter used to generate the interrupt. A selection for
compare, and high-speed output capabilities which is readable by soilWare through special no interrupt is also possible.
which facilitate many control oriented tasks. function registers TM2L and TM2H. The timer
The objective of this note is to make users of itsell has two overflow flags, one after the Capture System
the 83C552 aware of this counter/timer entire IS-bit counter and one attached to the The capture system is a powerful tool to
subsystem and assist the use of this eighth stage. This latter flag reflects an measure the width of pulses or repetition
subsystem by a detailed explanation of its overflow from the first byte of the counter. rates. There are four independent inputs for
operation supported by actual application These two flags are present in register the signals to be analyzed, CTIO through
examples. TM21R and are labeled T2BO for the overflow CTI3. These inputs are alternate functions to
from the first byte and T20V for the overflow port I. Each input is connected to a
from the entire 16 bits. These flags may be dedicated capture register. A transition at any
TIMER 2 OF THE 83C552 used to generate an interrupt. of these inputs will cause the content of the
Timer 2 of the 83C552 is in fact a timing The counter timer is controlled directly 16-bit counter/timer to be loaded into the
controller and has an associated through the special function register respective capture register. The capture can
programmable array. The Timer 2 subsystem TM2CON, the timer 2 control register. This occur upon various conditions of the input
consists of three parts: register also contains certain status flags. signal as specified by certain bits in the
1. The time base consists of a IS-bit timer capture control register, CTCON. Each input
with a 3-bit prescaler. The master clock The pre scaler divides the input clock by a can be set to cause a capture on a
for the subsystem can be derived from the programmable ratio. The prescaler divide low-to-high transition, a high-to-Iow transition,
on-chip oscillator (fosc) or an external value is programmable to divide by 1, 2, 4, or or on both transitions. Upon a capture taking
input, T2. It has an external reset, RT2, by 8 as controlled by T2PO and T2Pl in place, each input causes an interrupt flag to
which a signal applied to this input can TM2CON. be set in the Timer 2 Interrupt Flag Register,
reset the timer if the external reset is The input clock to the prescaler is either TM21R. II enabled, an interrupt will be
enabled. fosC/12 or the external input, T2. The clock generated.
2. A capture system consisting of four input to the prescaler may also be shut off. One of the capture inputs is shown in more
capture registers and four capture inputs This clock input selection is controlled by bits detail in Figure 3. All of the other capture
which can be used for a wide variety of T2MSO and T2MSI in TM2CON. inputs are similar to this one. The capture
time measurements on external signals. II T2 is used as the input clock to the timer 2 input is gated with the capture enable bits
subsystem, the hardware logic samples this CTNO and CTPO, which are located in
3. A compare system consisting of three
input and looks for a low-to-high transition. II CTCON. According to the status of these
compare registers and eight associated
the logic detects a logic 0 at the T2 input in bits, the desired edges are selected to
high-speed outputs which can be
state S2PI of the rnicrocontroller and a logic generate the capture enable pulse. The input
activated upon a match between the
I in state SSP 1, then this is recognized as a pulse transient detection is at the input of the
IS-bit timer and one of the compare
low-te-high transition, and the prescaler is enable pulse generator. The input signal is
registers.
incremented. The prescaler is incremented in sampled atS1Pl of the machine cycle.lla
the second cycle after the cycle in which the logic 1 is detected when a logic 0 was
For reference a complete block diagram of
transition was detected. II the transition is detected at the same time in the previous
the 83C552 Counterrnmer 2 subsystem is
detected before S2Pl is finished, the cycle, then the event is taken as a transition.
shown in Figure 1.
prescaler is incremented in the next cycle. An enable pulse is sent to the capture
This timing is shown in Figure 2. Note that register, and the contents of timer 2 is copied
this sampling rate is twice that of the normal into the capture register at the end of this
80CSI timers, TO and Tl; therefore T2 has machine cycle. The interrupt flag CTIO is also
set.
689
Signelics 8OC51-Based 8-Bit Miaocontrollers Application Note
011
ll-llilOVer11ow
Interrupt
lose
I&-Bll 0VerII0w
1'2 _ _ _ _- - ' Intenupt
~ ----~~~---~----~
12ER - - - - - - '
S R P4JI
S R 1'4.1 lilt Inl
S R P4.2
110 Port 4
S R P4.3
S R PU
S R P4.5
TG T P4.8
TG T 1'4.7
liTE RTE
690
Signetics 80CS1-Based B-Bit Miaocontrollers Application Note
Somple
Puloe
~ n n n n
~ '~----;I
COWl'"
1- By transition 1 Bytraneition 2
TM2 CTO
TM2H CTHO
TM2L CTUI
Enable
Pul ..
r----'
TM21R
-
Inlemal
CTCON
r----'
CTPO Enabl.. ~
on raising edge
~"M---
, ,
'"----""
691
Signelics 8OCS1-Based 8-Bit Microcontrollers Application Nole
Compare Systein between Ihe 16-bit counler and Ihe conlents The two toggllH:Ontrolied outputs are CMTO
The compare syslem of limer 2 can be used of CMO, a SET pulse is generated. Similarly, and CMTt, and these are associated with
to generale a set of outputs whose transitions whenever Ihere is a match between Ihe timer compare register CM2. These outputs are
are controlled direcUy by Ihe time defined by and Ihe conlents of CM1, a RESET pulse is also allemale functions on port 4. Upon a
!he 16-bit counlerltimer. There are eight of generaled. The set pulse is applied to Ihe compare between Ihe counler and Ihe
!hese high-speed outputs which are direcUy set-reset outputs, CMSRO Ihrough CMSRS, conlents of CM2, CM2 generales a toggle
controlled from Counlermmer 2. These through gales controlled by bits in STE. Bits 0 pulse which is applied to the high-speed
outputs are allemate functions to port 4. Six through S in STE control the application of outputs CMTO and CMTt Ihrough a set of
of Ihese outputs are set-reset controlled the SET pulse to one of Ihe high-speed gates. The gales control the application of Ihe
(CMSRO Ihrough CMSRS), and two are outputs. For example, STE.O controls Ihe toggle pulse to the toggle outputs as
toggle controlled (CMTO and CMT1). To gating of Ihe SET pulse to CMSRO, STE.l specified by Ihe high-order bits of regiSler
clarify the operation, these two types will be controls Ihe gating of the SET pulse to RTE. RET.6 controls CMTO, and RET.7
ciscussed separalely. In Ihe following CMSR1, and so forth. Thus, if Ihe controls CMTI. Should Ihe corresponding bit
discussions, refer to Figure 4, which shows corresponding SET enable bit in STE is a 1 of RTE be set, Ihen Ihe toggle pulse is
Ihe compare syslem for P4.S (a set-reset and a compare occurs wilh CMO, Ihen Ihat enabled to the associated high-speed output
high-speed output) and P4.6 (a toggle high-speed output will become set. Similarly, and Ihat output will toggle upon generation of
high-speed output). the reset pulse from CMl is applied to the Ihe toggle pulse from CM2. The structure of
high-speed outputs CMSRO Ihrciugh CMSRS Ihese toggled outputs is different from Ihe
There are two compare registers associaled through gales controlled by bits in RTE. As other high-speed outputs in Ihatlhe toggling
wilh the set-reset outputs. These registers wilh STE, bits 0 Ihrough S in RTE controllhe is actually accomplished in a separale
are CMO and CM1. In addition, there are two application of Ihe reset pulse to one of Ihe toggled flip-flop and not direcdy in !he port
enable registers: one to enable setting of an high-speed outputs. If a compare occurs latch. This toggle flip-flop cannot be
output and the olher to enable resetting of an between Ihe timer and CM I, a high-speed controlled directly by software and powers up
output. These regiSlers are STE and RTE, output will be reset if its corresponding enable in an indeterminate state. The state of Ihe
respectively. The conlents of CMO and CM 1 bit in RTE is a 1. Compares wilh CMO and toggle flip-flops is readable in STE bits 6
are continuously compared to the contents of CM! set interrupt flags which, if enabled, can and 7.
!he 16-bit counler. Whenever there is a match be used to generate an interrupt.
TM2IR
}
eM
2
To
eM
1 .,......
Intenupt
CM
0
,, ,,
L ____ '"
& S Q Port P4
ro----,
& R U
P4.5
& S Q P4.6
-
P4.7
& R U
Toggle FF , STE
TG46 STE.&
TG47 STE.7
692
Signetics 80C51-Based B-Bit Microcontrollers Application Note
APPLICATION EXAMPLE-TIMED the injection duration is assumed to be a time parameters are available, and that it has
FUEL INJECTION value calculated from engine environmental been determined that the processor is
In modem automobiles, optimal combustion factors and operating parameters. The angle responding to the interrupt associated with
is necessary to meet emission standards and for the start of the injection must be the top dead center capture, CTOI. Interrupts
improve fuel consumption. Optimal converted into time with respect to the for CTOI, CMO (compare register 0). and
combustion depends on several factors and reference point. CMl (compare register 1) are enabled. Upon
is enhanced by proper fuel injection based entering the interrupt service routine for
The injector drivers are assumed to be
upon these factors which vary according to CTOI, the previous value of the captured top
connected to the port 4 high-speed outputs
engine speed and other factors. Thus the dead center time is subtracted from the
CMSRO through CMSR3. To obtain the top
task is to control the opening and closing of present value, and the crankshaft rotation
dead center reference point, the signal from
the engine fuel injectors of each cylinder time is determined. This is used to compute
the appropriate sensor is connected to the
relative to the crankshaft reference point. the time to open the first injector from the
capture input CTOL The interrupt for this
required angle at which the injector is to
For the application example here, we will not capture input is enabled so that software can
open. This time is made available for the
consider the factors which determine the synchronize its operation to this time
interrupt service routine which responds to a
timing relationships. These are assumed to reference and make use of the top dead
compare from CMO. The interrupt service
be given quantities. The example here will center time in the injector timing calculations.
routine is exited.
focus upon the implementation of the injector The software synchronization takes two
timing control signals and how they are forms. First, the captured time is an absolute The next interrupt to occur per the figure for
generated using the Countermmer 2 system. reference for all real-time output operations. this example is a result of a compare with
The illustration considers a four cylinder This time is available in capture register CTO. CM1 which will be a result of the injector stop
engine. While this is an automotive Note that at 12 MHz operation, limer 2 can time for cylinder 4 having been reached. The
application which serves to clearly illustrate have a resolution as fine as 1 microsecond flags in an internal status register are
Countermmer 2 Subsystem operation. it is with a total time before overflow of over 65 employed to keep track of the cylinder
clear that many systems share similar timing milliseconds, and these times are adjustable number that is presently active for both
requirements, and the techniques employed by increasing the prescaler divide ratio. A injection stop and injection start times. After
here are applicable to a wide class of timing proper selection can make the timing identifying this interrupt from the flags, the
tasks. The B3C552 will also support six calculations relatively simple. Second, at the processor uses the injector start time for
cylinder engine control. time the input is captured, flags which keep cylinder 1 (previously loaded into CMO) and
track of the phases of the crankshaft cycle the predetermined duration to calculate the
Figure 5 shows the injection timing required are reset when cylinder 1 is at top dead injector stop time for cylinder 1. This value is
for two consecutive revolutions of the engine center. These flags are used in the interrupt loaded into compare register CMl and the
crankshaft .. Start and stop of the injection are service routines to tell which action is reset enable bit for high-speed output
given relative to a reference point on the required for that phase of the crankshaft. CMSRO is programmed to a 1. This is bit
crankshaft. The cylinders are numbered in RTE.O The reset enable bit for the cylinder 4
the order of the injection sequence (not with Consider now the sequence of events in one
injector is set to 0 (bit RET.3). The interrupt
reference to their physical location). Start of rotation of the engine crankshaft and refer to
routine is now exited.
the injection is usually given in angular Figure 5 during the discussion. Assume that
measure with respect to top dead center, and the engine is running, that all relevant
Reference
T-etop
Cyll
Cyl2
Cyl3 ...
Cyl4
693
Signetics BOC51-Based B-Bit Microcontrollers Application Note
The next interrupt to ocaJr will be for the start interrupts are disabled. Then the following applied to the electronic drivers for the
time for the injector for cylinder 2. This and all actions are performed: ignition coils.
subsequent cases follow the same sequence - Set bit in STE to start next injector
To illustrate the toggle high-speed outputs of
of events as for the cylinder 1 CMO interrupt - Clear bit in STE for injector just started the 83C552 Countermmer 2 SUbsystem, the
described above. In this case, calculations - Load CMO with start time for next injector following example will discuss the ignition
are made for cylinder 2 and loaded into
- Clear CMIO interrupt flag in TM21R timing in a four cylinder engine employing the
CMO,STE.1 is programmed to a 1, and STE.O
two coil approach with one coil for a pair of
is programmed to a O. Similarly, the next Now that the essential set-up is made for the cylinders. The coil timing is illustrated in
interrupt for CM1 is treated in the same way, next interrupt, all interrupts are nowenabl.ed. Figure 6. A reference time is used which is a
and the sequence of events rotates around However, the return to the main program is given interval prior to top dead center so that
through all cylinders in tum. The flag bits not invoked until the following ancillary the times used in the illustration can be
associated with this operation keep track of processing is completed: always after the reference. There are two
the injector sequencing. - Calculate the next absolute start time for times of interest for each coil: the load time
While this example shows the injection stop the next injector (the next load value for and the ignition point.
time of one cylinder overfapping into the CMO)
Ignition advance is usually given in degrees
injector on time of Ihe subsequent cylinder, - Increment the flag so that the next entry to
crankshaft angle prior to top dead center. As
close examination of the operations this interrupt service routine will be able to
identify the next injector to start. with injection, this angle is assumed to be
described above reveal that the start and
derived from other calculations and is a given
stop events are independent and can overfap
The process performing these calculations value for this illustration. This angle must be
or not as required. In this way all injectors
can be interrupted to service reat-time converted in to a time with respect to the
may be driven independently and have
functions. reference point. The load time (the time at
overfapping on times.
which the coil has to be switched on·to reach
Given that this 'is an example applicable to the current that will give sufficient energy for
general usage, it is possible that interrupt APPLICATION EXAMPLE-TIMED an adequate spark) must be subtracted from
service routine could be relatively long as it the desired ignition point. At the ignition time,
IGNITION
would be in an actual injector application. the coil will be switched off and the spark will
In electronic ignition systems, multiple ignition
Since the service routine has other interrupts be generated.
coils may be used and each coil is fired by
disabled, the length may cause real-time
electronic means rather than with the old The coil driver electronics are connected to
conflicts. To eliminate this potential problem,
style mechanical breakers. In a fourcylinder port bits P4.6 and P4. 7. Ignition coil 1 is
the interrupt service routines are divided into
engine, there may be two ignition coils, one connected to P4.6, and ignition coil 2 is
two parts. In the first part, all other interrupts
coil providing spark for a pair of cylinders. connected to P4.7. These outputs are the
are disabled, and the essential register
Both plugs fire at the same time. For one toggle high-speed outputs controlled by the
loading is done to prepare for the next
cylinder, the spark occurs at the appropriate, l6-bit compare register, CM2. The program
interrupt. After this is completed, all interrupts
time while for the other cylinder, the spark simply needs to set up the compare and
are enabled and the ancillary service routine
occurs at the end of the exhaust stroke and control registers to tum the coils on and off at
functions are performed prior to a return to
has no effect. With timing references to the appropriate times. It is assumed in this
the main routine.
crankshaft top dead center provided by an example that the ignition and load times are
As an example, consider the interrupt service external sensor, the ignition timing for the given quantities and have been determined
routine for CMO. Upon entering the routine, all engine may be generated in the 83C552 and previously.
Reference TOC
II I II II II
rI. Tign
Ignition Advance
Coli 1
CoIl 2
694
Signetics BOC51-Based B-Bit Microcontrollers Application Note
Consider now the sequence of events in two incremented to indicate that the next interrupt CONCLUSION
rotations of the engine crankshaft and refer to will be a result of coil 2 turning off and This application note has examined one
Figure 6. Assume that the engine is running, causing ignition. The other interrupts can be aspect of the B3C552 CMOS BOC51
that all relevant parameters are available, and enabled and a return to the main program derivative microcontroller. The Countermmer
that it has been determined that the can be executed. After the other interrupts 2 Subsystem has been applied to a complex
processor is responding to the interrupt are enabled and before a return is made to timing task of gasoline engine injector valve
associated with a compare to CM2. The top the main program, it may be convenient to do and ignition coil timing control. While this is a
dead center time and crankshaft rotation any necessary calculations to determine the specific application to the automotive
speed have been already determined through time value to be loaded into CM2 in the next interests, the results are applicable to a wide
the top dead center capture, CTO!. This is CM2 interrupt. variety of time measurement and control
the same as in the injector example. The applications. The B3C552 would be ideal for
Since the flip-flops are toggled, it is likely that
interrupt for CTOI is enabled. From the top many electromechanical systems such as
upon power up of the microcontroller, the
dead center time, the times to turn on and copy machines, fax machines, industrial
toggle flip-flops will not be in the desired
turn off the coil drivers are computed and process control equipment, automatic
state. To get the toggle flip-flops in the correct
made available in data storage locations in transmission control, and anti-skid and
state in the ignition cycle, the flip-flops must
the microcontroller. It is also convenient to anti-lock braking control.
be toggled if they are in the wrong state. To
have flags to identify the step in the complete
determine if this is necessary, the state of the These application areas are those which can
ignition cycle. The flags are cleared in the
toggle flip-flops can be read from the STE successfully employ the B3C552
interrupt service routine for top dead center of
register. The state of the P4.6 flip-flop is Countermmer 2; however, the other features
cylinder 1.
present in STE bit 6 and the state of the P4.7 should not be overlooked. When combined
Upon entering the interrupt service routine, flip-flop is present in STE bit 7. Comparing with the 1O-bit A to D Converter, the Pulse
other interrupts are disabled. Examination of the actual state to the required state Width Modulator, the 12C serial bus, and
the flags reveals that the state of the ignition determines which if any or both of the peripheral device family, the B3C552 provides
sequence is that coil 1 has been turned on to flip-flops must be toggled. If a toggle is minimum component count solutions for
begin the current build up (load time). The necessary to put one or both of the flip-flops cellular radio systems, professional audio
next event will therefore be turning off coil 2 in the correct state, the corresponding bits in systems, and medical instrumentation
to cause ignition. The interrupt service routine RTE would be set for those flip-flops requiring products such as bedside patient monitors
then performs the following actions: The time the toggle, and CM2 would be loaded with a and analyzers for home care and sports use.
to turn off coil 2 is moved into compare value that is slightly larger than the present
register 2, CM2. Bit 6 of RTE is cleared; this contents of timer 2. If desired for reliability
disconnects the output of CM2 from the purposes, the state of the flip-flops could be
toggle flip-flop of P4.6 (coil 1). Bit 7 of RTE is checked periodically against the ignition cycle
set; this connects the output of CM2 to the flags to determine if a correction is
toggle flip-flop of P4.7 (coil 2). The flags are necessary.
695
Signetics 8OC51-Based II-Blt Mlcrocontrollers Application Note
BOC51 family microcontrollers are equipped Dedicated interrupt inputs that vector the counter to overflow and generate a timer
with up to two inputs which may be used as processor to individual service routines (as interrupt. The counter will be automatically
general-purpose interrupts. A typical device the two general-purpose interrupt inputs loaded with another FF from the reload
provides a total of 5 interrupt sources. limer work) do not have the drawbacks of the register, so the interrupt can occur again as
oand limer 1 generate vectored interrupts, method described above. soon as the interrupt service routine
as does the Serial Port. Applications that completes. Countermmer operation is
require more than two externally signaled described in detail elsewhere in this manual.
vectored interrupts, and do not use one or COUNTERITIMER
more of the counters or the serial port, can be CONFIGURATION
configured to use these facilities for additional limers 0 and 1 are placed in mode 2, which SERIAL PORT CONFIGURATION
external interrupt inputs. configures the timer/register as an S-bit The serial port can be placed in mode 2,
This note describes a method to configure counter with automatic reload. The counter which is a 9-bit UART with the baud rate
the timer/counters and the serial port for use and reload register are loaded with FF derived from the oscillator. The external
as interrupt inputs (see Figure 1). Minimum hexadecimal which is stored in THI and TL 1 interrupt is signaled through this port on the
response time is a goal for this configuration. or THO and TLO. RxD receive data pin. Reception is initiated
by a detected l-to-O transition at RxD. The
Another popular method to implement extra To prepare one of the timers for this kind of signal must stay at 0 for at least five-eighths
interrupt inputs is to poll under software operation, a number of control bits have to be of a bit period for this level to be recognized.
control a port pin configured as an input. This set up. The following is a list of these bits and Refer to the description of baud rates to
method is necessary when the on-chip their values: determine the length of a bit period at the
peripherals are in use. Applications where InTMOD: In TCON: InIE: oscillator frequency selected for the
this approach is recommended are ones in GATE= 0 TRi = 1 Eli = 1 application. The input signal should remain
which the processor spends more than half of CIT = 1 EA = 1 low for at least one bit period and for not
the time executing a "wait loop," or a short Ml = 1 more than 9 bit periods.
code sequence which jumps or branches MO = 0
back on itself without performing any To prepare the serial port for use as an
functions. In this case, the instructions that Where "i" is the timer number being used as external interrupt, the following bits must be
will check the state of input used as an the external interrupt. The TMOD value would set up:
interrupt source are inserted into this be 66 hexadecimal if both timers are being InSCON:
sequence. Consequently, this input is ignored used as external interrupt sources, x6 hex for SMO 1
when other routines are being executed. This timer 0, and 6x hex for timer 1. The interrupt SMI 0
input may have to be latched externally, or priority may also be set in the IP register. SM2 0
the processor may miss the signal while A falling edge on the corresponding limer 0 REN 1
executing other routines. or limer 1 input (TO or Tl) will cause the
x. 8OC51
CJ PortO
X2
Port 1
RST Reset
EA Port 2
696
Signetics 80C51-Based 8-Sit Microcontrollers Application Note
The Serial Port Interrupt is then used as a Note that the response time for this input will after the eighth serial data bit time after the
general-purpose interrupt. The contents of be slower than for the Counter/Timer inputs. falling edge on RxD.
receive buffer should be ignored, and will This is due to the fact that the RI is generated
subsequenHy be overwritten during the next
interrupt.
; Demonstration program for five external interrupts.
$MOD51
$TITLE (Five Vectored External Interrupts)
END
697
Slgnetlcs 80C51-Based 8-Blt Mlcrocontrollers Application Note
As more than one master may be connected Data Transfers The Start and Stop conditions are alWays
to the bus, it is possible that two devices will One data bit is translerred during each dock generated by the master.
by to initiate a transfer at the same time. pulse (see Figure 3). The data on the SDA The number of data bytes transferred
Obviously, in order to eliminate bus collisions line must remain stable during the HIGH between the Start and Stop condition from
and communications chaos, an arbitration period of the clock pulse in order to be valid. transmitter to receiver is not limited. Each
procedure is necessary. The 12C design has Changes in the data line at this time will be byte, which must be eight bits long, is
an inherent arbitration and clock interpreted as control signals. A transferred serially with the most significant
synchronization procedure relying on the HIGH-to-lOW transition of the data line bit first, and is followed by an acknowledge
wired-AND connection of the devices on the (SDA) while the clock signal (SCl) is HIGH bit. (see Figure 5). The dock pulse related to
bus. In a typical mUlti-master system, a indicates a Start condition, and a the acknowledge bit is generated by the
microcontroller program should allow it to lOW-to-HIGH transition of the SDA while master. The device that acknowledges has to
gracefully switch between master and slave SCl is HIGH defines a Stop condition (see pull down the SDA line during the
modes and preserve data integrity upon loss Figure 4). The bus is considered to be busy acknowledge clock pulse, while the
of arbitration. In this note, a simple case is aiter the Start condition and free again at a transmitting device releases the SDA line
presented describing the SB3C751 operating certain time interval aiter the Stop condition. (HIGH) during this pulse (see Figure 6).
as a.single master on the bus.
SDA I !
1
! ¢==="
1 1 1
SCL~--"---
1 DATA UNE 1 CHANGE 1
1 D:imUD 1f~g~D 1 START
CONDITION
STOP
CONDITION
Figure 3. BII Transfer on the 12<: Bus Figure 4. Start and Stop Conditions
SD~= --- ~
--
1 1
---- 1
1 1 MSB 1 1
1 1 1 1
SC~ __ _ 3~;~
L __ .J ACK L _ _ .J
START STOP
CONDITION CONDITION
CLOCK UNE HELD LOW
WHILE INTERRUPT
IS SERVICED
r--,
DATA OUTPUT BY 1 \ . 1i r-v-Y - v - - v J .....1--_ _ _ TRANSMITTER STAYS OFF OF THE BUS
TRANSMITTERR I. ~\.. _A-....I\...J DURING THE ACKNOWLEDGE CLOCK
1 1
1 1
DATA OUTPUT
1 1 ~ ~ ACKNOWLEDGEMENT
BY REC8VER '--1 - SIGNAL FROM REC8VER
1 1
SCL FROM MASTER ~.L __ J
___ ~
START
CONDITlON
A slave receiver must generate an software only - it is called "Slow Mode". "standard" addressing discussed here, the
acknowledge after the reception of each byte, When all of the devices on the network have 12C bus protocol allows for "general call"
and a master must generate one after the built-in 12C hardware support, the Slow Mode addressing and interfacing to CBUS devices.
reception of each byte docked out of the is irrelevant.
When the master is communicating with one
slave transmitter. II a receiving device cannot
Addressing and Transfer Fonnats device only, data transfers follow the format
receive the data byte immediately, it can
Each device on the bus has its own unique of Figure 7, where the R/W bit could indicate
force the transmitter into a wait state by
address. Before any data is transmitted on either direction. After completing the transfer
holding the clock line (SCl) lOW. When
and issuing a Stop condition, if a master
a
designing system, it is necessary to take the bus, the master transmits on the bus the
would like to address some other device on
into account cases when acknowledge is not address of the slave to be accessed for this
transaction. A well-behaved slave with a the network, it could of course start another
received. This happens, for example, when
matching address, if it exists on the network, transaction, issuing a new Start.
the addressed device is busy in a real time
operation. In such a case the master, after should of course acknowledge the master's Another way for a master to communicate
an appropriate "time-<lut", should abort the addressing. The addressing is done by the with several different devices would be by
transfer by generating a Stop condition, first byte transmitted by the master after the using a "repeated start". After the last byte of
allowing other transfers to take place. These Start condition. the transaction was transferred, including its
"other transfers" could be initiated by other An address on the network is seven bits long, acknowledge (or negative acknowledge), the
masters in a multi-master system, or by this appearing as the most significant bits of the master issues another Start, followed by
same master. address byte. The last bit is a direction (R/W) address byte and data - without effecting a
bit. A zero indicates that the master is Stop. The master may communicate with a
There are two exceptions to the
transmitting (WRITE) and a one indicates that number of different devices, combining
"acknowledge after every byte" rule. The first
the master requests data (READ). A READS and WRITES. After the last transfer
occurs when a master is a receiver: it must
complete data transfer, comprised of an takes place, the master issues a Stop and
signal an end of data to the transmitter by
address byte indicating a WRITE and two releases the bus. Possible data formats are
NOT signalling an acknowledge on the last
data bytes is shown in Figure 7. demonstrated in Figure 8. Note that the
byte that has been clocked out of the slave.
repeated start allows for both change of a
The acknowledge related clock, generated by When an address is sent, each device in the slave and a change of direction, without
the master should still take place, but the system compares the first seven bits after the releasing the bus. We shall see later on that
SDA line will not be pulled down. In order to Start with its own address. II there is a match, the change of direction feature can come in
indicate that this is an active and intentional the device will consider itsell addressed by handy even when dealing with a single
lack of acknowledgement, we shall term this the master, and will send an acknowledge. device.
special condition as a "negative The device could also determine if in this
acknowledge". In a single master system, the repeated start
transaction it is assigned the role of a slave
receiver or slave transmitter, depending on mechanism may be more efficient than
The second exception is that a slave will
the RIWbit. terminating each transfer with a Stop and
send a negative acknowledge when it can no
starting again. In a multi-master
longer accept additional data bytes. This Each node of the 12C network has a unique
occurs after an attempted transfer that cannot environment, the determination of which
seven bit address. The address of a format is more efficient could be more
be accepted.
microcontroller is of course fully complicated, as when a master is using
The bus design includes special provisions programmable, while peripheral devices repeated starts it occupies the bus for a long
for interfacing to microprocessors which usually have fixed and programmable time and thus preventing other devices from
implement all of the 12C communications in address portions. In addition to the initiating transfers .
., - ,
SDA,
~-~=~=~
, ,
SCL
, ,
I I I
, I
~'~7~'~~'~7~
:s: I I L--.J 1--...J1
, - • IIJW
I L-JI
ADDRESS
I 1--...J :P: ACK DATA ACK DATA ACK' - •
START STOP
CONOtTION CONOtTlON
Use of Sub-Addresses internal address of the word the master wants The memory read cycle (see Figure 9(b))
For some ICs on the 12C bus, the device to access for a single byte transfer, or the commences in a similar manner, with the
address alone is not sufficient for effective beginning of a sequence of locations for a master sending a slave address with the
communications, and a mechanism for multi-byte transfer. A sub-address is an 8-bit direction bit set to WRITE with a following
addressing the internals of the device is byte, unlike the device address, it does not sub-address. Then, in order to reverse the
necessary. A typical example when we want contain a direction (R/W) bit, and like any direction of the transfer, the master issues a
to access a specific word inside the device is byte transferred on the bus it must be repeated Start followed again by the memory
addressing memories, or a sequence of followed by an acknowledge. device address, but this time with the
memory locations starting at a specific direction bit set to READ. The data bytes
A memory write cycle is shown in Figure 9(a).
internal address. starting at the internal sub-address will be
The Start is followed by a slave byte with the
clocked oul of the device, each followed by a
A typical12C memory device like the direction bit set to WRITE, a sub-address
master-generated acknowledge. The last byte
PCF8570 RAM contains a built-in word byte, a number of data bytes and a Stop
of the read cycle will be followed by a
address register that is incremented signal. The sub-address is loaded into the
negative acknowledge, signalling the end of
automatically aher each data byte which is a word address memory, and the data bytes
transfer. The cycle is terminated by a Stop
read or written data byte. When a master which follow will be written one after the other
signal.
communicates with the PCF- 8570 it rnust starting with the sub-address location, as the
send a sub-acfdress in the byte following the register is incremented automatically.
slave address byte. This sub-address is the
DATA mANSFERRED
(n BYTES + ACKNOWLEDGE)
MASTER WRITE:
I I
S SLAVE ADDRESS Iw tA I
DATA mANSFERRED
(n BYTES + ACKNOWLEDGE)
MASTER READ:
I I
S SLAVE ADDRESS
COMBINED FORMATS:
S SLAVE ADDRESS
AUTo.INCREMENT
MEMORY WORD ADDRESS
(a)
S SLAVE ADDRESS
RIW
L~~ DATA A
(b)
6XC751 12C HARDWARE every time the fourth bit of the timer is 12CON Register
The on-chip 12Cbus hardware support of the toggled. (A value is actually loaded into the The 12C control register (12CON) can be
aXC751 allows operation on the bus at full least significant three bits, the third bit being written to (see Figure 10). When writing to the
speed, and simplifies the software needed for o unless both CTO and cn are programmed 12CON register, one should use bit masks as
effective communications on the network. high and in that case the third bit is 1). SCL is demonstrated in the example program. Trying
The hardware activates and monitors the then toggled every time the fourth bit of Timer to clear or set the bits in the register using the
SDA and SCL lines, performs the necessary I is toggled. For example: if CTl = 0 and CTO bit addressing capabilities of the aXC751
arbitration and framing errors checks, and = 1 then the least significant three bits of may lead to undesirable results. The reason
takes care of clock stretching and Timer I would be preloadedwith 2 (010 is that a command like CLR reads the
synchronization. The hardware support binary). Timer I would then count 3, 4, 5, 6, 7, register, sets the bit and writes it back, and
includes a bus time-out timer, called Timer I. a (6 counts or machine cycles). On a, the the write-back may affect other bits.
The hardware is synchronized to the software fourth bit of Timer I will toggle, SCL will toggle
either through polled loops or interrupts. and the 3 least significant bits will again be 12CFG Register
preloaded with the value 2 (010). The configuration register (12CFG) is a
Two of the port 0 pins are multi-functional.
readlwrite register (see Figure 11).
When the 12C is active, the pin associated
with PO.O functions as SCL, and the pin Table 5. CTO, cn Timer I Settings 12DAT Register
associated with PO.l functions as SDA. cn,CTO Timer I Oscillator The 12C data register (12DAT) is a readlwrite
These pins have an open drain output. Values Counts Freq (MHz)
register, where the MSB represents the data
Two of the five aXC751 interrupt sources may 1 0 7 16 received or data to be sent. The other seven
be used for 12C support. The 12C interrupt is 0 1 6 15,14, 13 bits are read as 0 (see Figure 12).
enabled by the EI2 flag of the interrupt enable 0 0 5 12, 11
register, and its service routine should start at
1 1 4 10 or less Transmit Active State
address023h. An 12C interrupt is usually Timer I counts = fosc (MHz) x 0.39 (rounded The transmit active state - Xmit Active - is
requested (if enabled) when a rising edge of up to next integer). an internal state in the 12C interface that is
SCL indicates a new data bit on the bus, or a affected by the 12C registers as explained
For the bus monitoring function, Timer I is
special condition occurs: Start, Stop or above. The 12C interface will only drive the
used as a "watchdog timer" for bus hang-ups.
arbitration loss. The interrupt is induced by SDA line low when Xmit Active is set. Xmit
It creates an interrupt when the SCL line
the ATN flag - see below for the conditions Active is set by writing the 12DAT register, or
stays in one state for an extended period of
for setting this flag. The Timer I overflow by writing 12CON with XSTR = 1 or XSTP =
time while the bus is active (between a Start
interrupt is enabled by the ETI flag, and the 1. The ARL bit will be set to 1 only when Xmit
condition and a following Stop condition).
service routine starts at 01 Bh. Active is set- in such a case Xmit Active will
SCL "stuck low" indicates a faulty master or
be automatically reset upon arbitration loss.
The 12C port is controlled through three slave. SCL "stuck high" may mean a faulty
Xmit Active is cleared by writing 1 to CXA at
special function registers: 12C Control device, or that noise induced unto the 12C
12CON register or by reading the 12DAT
(12CON), 12C Configuration (12CFG), and 12C caused all masters to withdraw from the 12C
register.
Data (12DAT). The register addresses are arbitration.
shown in Table 4. The time-out interval of Timer I is fixed
Although the following discussion of the (cannot be set): it carries out and interrupts (if PROGRAMMING EXAMPLE
hardware and register details is not complete, enabled) when about 1024 machine cycles The listing demonstrates communications
have elapsed since a change on SCL within a routines for the aXC751 as an 12C bus master
it should give a better understanding of the
frame. In other words, whenever 12C is active in a single-master system.
programming examples.
and Timer I is enabled, the falling edge of
SCL will reset Timer I. If SCL is not toggled The single-master system is less complicated
Timer I
low for 1024 machine cycles, Timer I will than a multi-master environment. The
In 12C applications, Timer I is dedicated to the
overflow and cause an interrupt. (Note: we programmer does not have to worry about
port timing generation and bus monitoring. In
wrote "about 1024 machine cycles" although switching between master and slave roles, or
non-12C applications, it is available for use as
for the sake of accuracy - this number is the consequences of an arbitration loss.
a fixed time base.
affected by the setting of the CTO and cn The 12C interrupt is not used, and therefore
In its port timing generation function, Timer I bits mentioned above and may vary by up to disabled. There is no need for frame Start
is used to generate SCL, the 12C clock. Timer three machine cycles) The exact number of interrupts, as this processor is the only bus
I is clocked once per machine cycle (osC/12), cycles for a time-out is not critical; what is master and all data transfers are initiated by it
so that the toggle rate of SCL will be some important is that it indicates SCL is stuck. when the appropriate routines are called by
multiple of that rate. Because the a3C751
In addition to the interrupt, upon Timer I the application. No one else generates frame
can be run over a wide range of oscillator
overflow the 12C port hardware is reset. This Starts which could be an interrupt source in a
frequencies, it is necessary to adjust SCL for
is useful for multiple master systems in multi-master system. Within the frames we
the part's oscillator frequency. This allows the
situations where a bus fault might cause the monitor bus activity with a wait-loop which
12C bus to be used at its highest transfer
bus to hang-up due to a lack of software polls the ATN flag. As we expect the bus to
rates independent of the oscillator frequency.
response. When this happens, SCL will be operate in its full-speed mode, we can
SCL is adjusted by writing to two bits (CTO
released, and 12C operation between other assume that only a small amount of time will
and CT1) in the 12CFG special function
register (see Table 5). The inverse of the devices can continue.
values in CTO and CTl are loaded into the
least significant two bit locations of Timer I
be wasted in those loops, and the use of Back at the beginning of the program, the hardware and software is best demonstrated
interrupts would be less efficient. next location after the reset vector is the by the following explanations, relating to two
'Timer I interrupt service routine. The cases in which the code is not self evident.
The 8XC751 has single-bit 12C hardware
microcontrollerwill go to address 1B
interface, where the registers may directly Sending the Address
hexadecimal if Timer I overflows. This routine
affect the levels on the bus and the software When sending the address byte in the Send
stops the timer, clears the timer interrupt,
interacting with the register takes part in the Addr subroutine, the first bit is written to
clears the pending interrupt so that other
protocol implementation. The hardware and 12DAT prior to the loop where the other seven
interrupts will be enabled, restores the stack
the low-level routines dealing with the bits are sent (SendAd2). The reason is that
pointer, and jumps to the 'Recover' routine to
registers are tightly coupled. Therefore, one we need to clear the Start condition in order
try to correct whatever stopped the 12C bus
should take extra care if trying to modify
and allowed 'Timer I to overflow. to release the SCLline, and this is done
these lower level routines.
explicitly by the subsequent command. When
Next in the listing come the main 12C service
The beginning of the program, at address 0, SCL is released, the correct bit (MSB of
routines. These are the routines SendData, address) must already be in 12DAT.
contains the reset vector, where the
RcvData, SendSub, and RcvSub that were
microcontroller begins executing code after a
called from the main program. Both of the Capturing the Received Data
hardware reset. In this case, the code simply
send routines use the data area labeled Typically, a program receiving data waits in a
jumps to the main part of the program, which
'XmtDal' as the transmit data buffer. In this loop for ATN, and when detected, checks
begins at the label 'Reset' near the end of the
sample program, four bytes were reserved for DRDY. If DRDY = 1 then there was a rising
listing.
this area, but it could be larger or smaller SCL, and the new data can be read from
The main program is a simple demonstration depending on the application. The two RDAT in 12CON or 12DAT. Reading or writing
of the 12C routines which comprise the receive routines use another four byte buffer 12DAT clears DRDY, thus releasing SCl.
balance of the listing. It first enables the labeled 'RcvDat' to store received data. All of
'Timer I interrupt, and sets up some sample these routines use the variables 'SlvAdr' and When reading the last bit in a byte, it should
data to be transmitted. Beginning at the label 'ByteCnt' to determine the slave address and be read from 12CON, and not 12DAT (see the
MainLoop, the program then proceeds to the number of bytes to be sent or received, end of the RcvByte routine). This way the
transmit one byte of data to a slave device at respectively. The SendSub and RcvSub Data Ready (DRDY) flag is not cleared, and
address 48 hexadecimal, using the routine routines use the variable 'SubAdr' as the the low period on SCL is stretched. The
titled 'Send Data' . In our demonstration sub-address to send to the slave device. reason for doing so is that upon reception of
hardware, this address corresponds to an the last bit of a received byte the master must
Following the main 12C service routines in the react with an acknowledge. In order to ensure
8-bit I/O port that drives eight monitor LEDs.
listing are the subroutines that are called by that we "wait" with the acknowledge clock
The program then reads back one byte of
the main routines to deal intimately with the (release of SCl) until the acknowledge level
data from the same port using the routine
12C hardware. is issued on SDA, the last bit is read out of
'RcvData'. The Send Data and RcvData
routines can send or receive multiple bytes of The 'SendAddr' subroutine requests 12CON and not 12DAT. SCL is stretched low
data, the number of which is determined by mastership of the 12C bus and calls the until the acknowledge level is written into
the variable' ByteCnt'. routine 'XmitAddr' to complete sending the 12DAT by th.e software.
slave address. The bulk of the XmitAddr
Upon return from both Send Data and Bus Faults and Other Exceptions
routine is shared with the 'XmitByte'
RcvData, the program checks the system flag Bus exceptions are detected either by Timer I
subroutine which sends data bytes on the 12C
named 'Retry' to see if the transfer was time-out, or "illegal" logic states tested for and
bus. XmitByte is also used to send 12C
completed correctly. If not, it loops back and detected by the software. Upon Timer I
sub-addresses. Both subroutines check for
attempts the same transfer again. time-out, a bus recovery is attempted by the
an acknowledge from the slave device after
Next, the program sends four bytes of data to every byte is sent on the 12C bus. Recover routine. The final section of the
a 256-byte EEPROM device, an 8-pin part listing is this 'Recover' routine. Its job is to try
The next subroutine 'RDAck' calls the to restore control of the 12C bus to the main
called the PCF8582. The routine 'SendSub' is
'RcvByte' routine to read in a byte of data. It program. First, the subroutine 'FixBus' is
used for this purpose. The EEPROM was
then sends an acknowledge to the slave called. It checks to see if only the SDA line is
located at address AO hexadecimal on our
device. RDAck is used to receive all data 'stuck', and if so, tries to correct it by sending
board. This device uses the sub-addressing
except for the last byte of a receive data some extra clocks on the SCLline, and
feature to select a starting location to address
frame, where the acknowledge is omitted by forcing a stop condition on the bus. If this
in the EEPROM array. When data is written
the bus master. The RcvByte subroutine is does not work, another subroutine 'BusResel'
to the EEPROM, the address is automatically
called directly for the last byte of a frame. is called. This generally happens when a
incre- men ted so that the data bytes are
stored in consecutive locations. The 'SendStop' subroutine causes a stop severe bus error occurs, such as a shorted
condition on the 12C, thus ending a frame. clock line. The philosophy used in this code is
Finally the program reads back four bytes of that the only chance of recovering from a
The 'RepStart' subroutine sends a repeated
data from the EEPROM using the routine severe error is to cause a reset of the Pc
start condition on the 12C bus, to allow the
'RcvSub'. Calls to SendSub and RcvSub hardware by deliberately forcing Timer I to
master to start a new frame without first
should also be followed by a test of the Retry time out. This method allows recovery from a
having to send an intervening stop.
flag to insure that all went according to plan. temporary short or other serious condition on
The lower level subroutines deal directly with the 12C bus.
This entire process is repeated indefinitely by
the hardware. The tight coupling between
jumping back to MainLoop.
ATN An -ATteNtion" flag. set when My oneal DRDY. ARL. STR or STP is set. This flag
allows a single bit testing for terminating "wait loops·, Indicating a meaningful
Q\lsnt on the bus. This flag also activates the Fe interrupt request.
DRDY Data ReaDY flag. Set by a rising edge of Sel when Fe is active. except at an Idle
slave. This flag is cleared by reading or writing the 12DAT register. or by writing
a 1 to CDR (at the same address, when I2CON is written).
ARL ARbitration Loss flag. Indicates that this device lost arbitration while trying to take
control 01 the bus.
STR STaRt flag. Set when a Start condition is detected, except at an idle slave.
STP SToP flag. Se( when a Stop condition is detected, except at an idle slave.
MASTER This flag is set when the controller is a bus master (or a potential master, prior to
arbitration).
CXA "Clear Xmit Active". Writing a 1 to CXA dears the internal transmil·active state.
IDLE Setting this bit will cause a slave to enter idle mode and ignore the I~C bus until the
next Start is detected. If the software sets the MASTRQ flag, the device may stop
idling by turning into a master.
XSTR "Xmit repeated STaRe. Writing a 1 to this bit causes the hardware to issue a Re-
peated Start signal. A side effed will be setting the internal Xmil Active state. This
should be used only when the device is a rmster.
XSTP "Xmit SToP". Issues a Stop condition. The Xmit active state is set.
SLAVEN Writing a 1 to this flag enables the slave functions of the I'C interface.
MASTRQ Request control of the bus as a master.
CLATI Clear the Timer I interrupt flag. This bit is always read as o.
TIRUN Writing a 1 will let TImer I run. When Fe is active, it will run only inside frames, and
will be deared by SCL transitions, Start and Stop. Writing a 0 will stop and c1earthetim·
e •.
en, eTa These bits should be programmed according to the frequency of the crystal oscillator
used In the hardware. They determine the minimum high and low times for SCL. and
are used to optimize performance at different oscillator speeds.
RDAT Received DATa bit. captured from SDA every rising edge of SCL Reading I2CATclears
DRDY and the Xmit Active state. It it is nemssary to read the data without affecting the
flags, it can be read out of RDAT in the I2CON register.
12DATWRlTE I XDAT I- I- I- I- I- I- I- I
XDAT Xrrit DATa bit. Writing XDAT determines the data forthe next bit to be transmitted on
the 12C bus. Writing t2DAT also dears DRDY and sets the Xmit Adive Slate.
1
2 ;*******************************************************
3
4 Sample I2C Single Master Routines for the 83C75l
5
6 ;*******************************************************
7
8 $TITLE(83C751 Single Master I2C. Routines)
9 $DATE(09/07/89)
10 $MOD751
11 $DEBUG
12
13
14 ; Value definitions.
15
0002 16 CTVAL EQU 02h ;CT1, CTO bit values for I2C.
17
18
19 ; Masks for I2CFG bits.
20
0010 21 BTm EQU 10h ;Mask for TmUN bit.
0040 22 BMRQ EQU 40h ;Mask for MASTRQ bit.
23
24
25 ; Masks for I2CON bits.
26
0080 27 BCXA EQU 80h ;Mask for CXA bit.
0040 28 BIDLE EQU 40h ;Mask for IDLE bit.
0020 29 BCDR EQU 20h ;Mask for CDR bit.
0010 30 BCARL EQU 10h ;Mask for CARL bit.
0008 31 BCSTR EQU 08h ;Mask for CSTR bit.
0004 32 BCSTP EQU 04h ;Mask for CSTP bit.
0002 33 BXSTR EQU 02h ;Mask for XSTR bit.
0001 34 BXSTP EQU Olh ;Mask for XSTP bit.
35
36
37 ; RAM locations used by I2C routines.
38
0021 39 BitCnt DATA 2lh ;I2C bit counter.
0022 40 ByteCnt DATA 22h
0023 41 SlvAdr DATA 23h ;Address of active slave.
0024 42 SubAdr DATA 24h
43
0025 44 RcvDat DATA 25h ;I2C receive data buffer (4 bytes) .
45 ; addresses 25h through 28h.
46
0029 47 XmtDat DATA 29h ;I2C transmit data buffer (4 bytes).
48 addresses 29h through 2Ch.
49
002D 50 StackSave DATA 2Dh ;Saves stack addr for bus recovery.
51
0020 52 Flags DATA 20h ;I2C software status flags.
0000 53 NoAck BIT Flags.O ;Indicates missing acknowledge.
0001 54 Fault BIT Flags.l ;Indicates a bus fault of some kind.
0002 55 Retry BIT Flags.2 ;Indicates that last I2C transmission
56 ; failed and should be repeated.
57
0080 58 SCL BIT PO.O ;Port bit for I2C serial clock line.
0081 59 SDA BIT PO.l ;Port bit for I2C serial data line.
60
61 ;**************************************************************
62 Begin Code
63 ;**************************************************************
64
65 ; Reset and interrupt vectors.
66
0000 2lE1 67 Reset ;Reset vector at address O.
68
69
70 A timer I timeout usually indicates a 'hung' bus.
71
OOlB 72 ORG lBh ;Timer I (I2C timeout)
; interrupt.
OOlB D2DD 73 TimerI: SETB CLRTI ;Clear timer I interrupt.
001D C2DC 74 CLR TIRUN
OOlF 1126 75 ACALL C1rInt ;Clear interrupt pending.
0021 8S2D81 76 MeV SP I StackSave ;Restore stack for return
; to main.
0024 218A 77 AJMP Recover :Attempt bus recovery.
0026 32 78 ClrInt: RETI
79
80
81 :*************************************************************
82 Main Transmit and Receive Routines
83 ;*************************************************************
84
85 Send data byte(s) to slave.
86 Enter with slave address 1n SlvAdr, data in XmtDat buffer,
87 # of data bytes to send in ByteCnt.
88
0027 C200 89 SendData: CLR NoAck ;Clear error flags.
0029 C201 90 CLR Fault
002B C202 91 CLR Retry
002D 85812D 92 MOV StackSave,SP ;Save stack address
for bus fault.
0030 E523 93 MeV A,SlvAdr ;Get slave address.
0032 3l.0C 94 ACALL SendAcldr ;Get bus and send slave addr.
0034 200012 9S JB NoAck,SDEX ;Check for missing
; acknowledge.
0037 200112 96 JB Fault,SDatErr ;Check for bus fault.
003A 7829 97 MOV RO,#XmtDat ;Set start of transmit
; buffer.
98
003C E6 99 SDLoop: MeV A,@RO ;Get data for slave.
003D 08 100 :mc RO
003E 3125 101 ACALL XmitByte ;Send data to slave.
0040 200006 102 JB NoAck,SDEX ;Check for missing
; acknowledge.
0043 200106 103 JB Fault,SDatErr ;Check for bus fault.
0046 D522F3 104 DJNZ ByteCnt,SDLoop
105
0049 3166 106 SDEX: ACALL SendStop ;Send an 12C stop.
004B 22 107 RET
108
109
110 ; Handle a transmit bus fault.
111
004C 218A 112 SDatErr: Recover ;Attempt bus recovery.
113
114
115 Receive data byte(s) from slave.
116 Enter with slave address in SlvAdr,
# of data bytes requested in ByteCnt.
117 Data returned in RcvDat buffer.
118
004E C200 119 RcvData: CLR NoAck ;Clear error flags.
0050 C201 120 CLR Fault
0052 C202 121 CLR Retry
0054 85812D 122 MOV StackSave,SP ;Save stack address
; for bus fault.
0057 B523 123 MOV A,SlvAdr ;Get slave address.
0059 D2BO 124 SBTB ACC.O ;Aet bus read bit.
005B 310C 125 ACALL SendAddr ;Send slave address.
005D 200023 126 JB NoAck,RDBX ;Check for missing
; acknowledge.
0060 200123 127 JB Fault,ROatErr :Check for bus fault.
128
0063 7825 129 MeV RO,IIRcvDat ;Set start of receive
; buffer.
0065 D52202 130 DJNZ ByteCnt,RDLoop ;Check for count = 1
; byte only.
0068 800A 131 SJMP RDLast
132
006A 3143 133 RDLoop: ACALL RDAck ;Get data and send
; an acknowledge.
006C 200117 134 JB Fault,RDatErr ;Check for bus fault.
006F F6 135 MOV @RO,A :Save data.
0070 08 136 INC RO
0071 D522F6 137 DJNZ ByteCnt,RDLoop ;Repeat until last
; byte.
138
0074 314F 139 RDLast: ACALL RcvByte ;Get last data byte
; from slave.
0076 20010D 140 JB Fault,RDatErr ;Check for bus
; fault.
0079 F6 141 MOV @RO,A ;Save data.
142
007A 759980 143 MOV I2DAT,1I80h ;Send negative
; acknowledge.
007D 309EFD 144 JNB ATN,$ ;Wait for NAK sent.
0080 309D03 145 JNB DRDY,RDatErr ;Check for bus
; fault.
146
0083 3166 147 RDBX: ACALL SendStop ;Send an I2C bus
; stop.
0085 22 148 RET
149
150
151 ; Handle a receive bus fault.
152
0086 218A 153 RDatBrr: Recover :Attempt bus recovery.
154
155
156 Send data byte(s) to slave with subaddress.
157 Enter with slave address in ACC, subaddress in
SubAdr, II of bytes to send in ByteCnt,
158 data in XmtDat buffer.
159
0088 C200 160 SendSub: CLR NoAck ;Clear error flags.
008A C201 161 CLR Fault
008C C202 162 CLR Retry
008E 85812D 163 MOV StackSave,SP ;Save stack address
; for bus fault.
0091 B523 164 MOV A,SlvAdr ;Get slave address.
0093 310C 165 ACALL SendAddr ;Get bus and send
; slave address.
324
325 I2C repeated start rout~ne.
326 Enter with address in ACC.
327
Ol7A 759822 328 RepStart: HOV I2CON,#BCDR+BXSTR ;Send repeated start.
017D 309EFD 329 JNB ATN,$ ;Wait for ATN.
0180 759820 330 HOV I2CON,#BCDR ;C1ear data ready.
0183 309EFD 331 JNB ATN,$ ;Wait for repeated
; start sent.
0186 759818 332 HOV I2CON,#BCARL+BCSTR ;Clear start.
0189 22 333 RET
334
335
336 ; Bus fault recovery routine.
337
018A 3lA4 338 Recover: ACALL FixBus ;See if bus is dead or
; can be 'fixed'.
018C 400D 339 JC BusReset ;If not 'fixed', try
; extreme measures.
018E D202 340 SETa Retry ;If bus OK, return to
; main routine.
0190 C201 341 CLR Fault
0192 C200 342 CLR NoAck
0194 D2DD 343 SETB CLRTI
0196 D2DC 344 SETa TIRUN ;Enable timer I .
0198 D2AB 345 SETa ETI :Turn on timer I
; interrupts.
019A 22 346 RET
347
348 :This routine tries a more extreme method of bus recovery.
349 This is used if SCL or SDA are stuck and cannot
otherwise be freed.
350 (will return to the Recover routine when Timer I times out)
351
019B C2DE 352 BusReset : CLR MASTRQ ;Release bus.
019D 7598BC 353 HOV I2CON,#OBCh ;Clear all I2C flags.
OlAO D2DC 354 SETa TIRUN
01A2 80FE 355 SJMP $ ;Wait for timer I
timeout (this will re-
356 ; set the I2C hardware) .
357
358
359 This routine attempts to regain control of the I2C
bus after a bus fault.
0221 752204 434 SL2: MeV ByteCnt, 114 ;Set up byte count.
0224 llB9 435 ACALL RcvSub
0226 2002F8 436 JB Retry,SL2
437
0229 0529 438 INC XmtDat
022B 052A 439 INC XmtDat+1
022D 052B 440 INC XmtDat+2
022F 052C 441 INC XmtDat+3
0231 80CD 442 SJMP MainLoop ;Do it all again.
443
444 ENDASSEMBLY COMPLETE, o ERRORS FOUND
DESCRIPTION serial data stream. Additional port pins may When the first timer interrupt occurs, the
The need often arises to make use of a serial be used to implement signals such as timer interrupt routine TlmrO calls the receive
port in connection with a microcontroller that Request to Send (RTS), Clear to Send bit routine RxBit which checks to make sure
does not have a hardware UART on~hip. (CTS), etc. that the start bit is still valid and flags an error
Aside from the obvious cases where the if it is not. The RxBit routine will then return
Finally, serial communication software will
miaocontroller application intrinsically control to the main program routine, waiting
take up a certain amount of CPU time, more
requires RS-232 communications to achieve for the next timer interrupt.
than would be required to operate a hardware
its purpose, a serial output may often be a UART. The overhead of software On the second timer interrupt, the RxBit
simple and convenient method of providing implemented serial communication mayor routine reads the serial input line and shifts
detailed diagnostic information to the outside may not be an issue, depending on the the value into the serial holding register
wood while using only a single I/O port pin. In application, the throughput of the serial RxDat. This process is repeated until 8 bits
many cases, the solution may be to channel(s), the baud rate, other tasks the have been read in on consecutive timer
implement the UART function in software. CPU is handling and how time~ritical they interrupts. Finally, on the tenth timer interrupt,
The routines included here demonstrate a are, etc. the receive routine looks for a valid stop bit
method to add such a function to a and flags an error if one is not detected. At
miaocontroller without the benefit 01 a The program listing that is included here is a
this point, the RcvRdy flag is set to inform the
hardware UART. demonstration of half.<fuplex serial routines
main program that a character is waiting in
on the 83C751 or 83C752 microcontrollers.
Examples of microcontrollers that do not the holding register.
The operation of the software would be the
have on~ip UARTs are the 83C751 and same on other 80C51 derivatives, except that The transmit routine works in a somewhat
83C752. While it is possible to connect an the counterltimer operation is slightly similar fashion, beginning with a call to the
external UART chip to these microcontrollers, different. The program, as listed, will send a byte transmit routine XmtByte, which first
it tends to use up many va port pins and canned message to the serial output (port pin checks to make sure that a byte receive
begins to become less economical than Pl.0 in this case), then wait for data on the operation is not already in progress. The
simply using a standard 8OC51. The are serial input (port pin Pl.5I1NTO). When a RSXmt routine will then set up the timer and
several factors to be considered in deciding if character has been received on the serial timer reload registers to correspond to one bit
!he software UART method will be usable in a input, it will be echoed through the serial cell time, start the timer, and assert a start bit.
particular application. The first is whether the output Since the software is inherently
serial communication channel is to be half.<fuplex, the rate at which characters are
simplex (transmit only or receive only), At each subsequent timer interrupt, the
received must be less than half the rate that
half.<fuplex (transmit and receive, but not routine TxBit shifts out the next bit from the
would be possible on a full.<fuplex channel.
simUltaneously), or full.<fuplex (simultaneous transmit holding register XmtDat, until all 8
This example has been set up to receive and
transmit and receive). Both simplex and bits have been transmitted. Once all of the
transmit at 9600 baud when run with a 16
half.<fuplex operation are fairly easy to data has been sent, the stop bit is asserted
MHz crystal.
implement in software on an 8OC51-type on the next timer interrupt. A final timer
miaocontroller, and will be covered by this The operation of the routines is fairly interrupt is required to insure that the stop bit
application note. Full-duplex operation is straightforward. Beginning with a start bit lasts at least one full bit cell time. At this
more difficult to implement in software and occurring on the serial input line, an interrupt point, transmit flag TxAag is cleared in order
can use up a large portion of the (external interrupt 0) will occur. At the to inform the main program that the
miaocontroller's time and resources. interrupt service routine InlO, the transmission is completed.
counter/timer is loaded with a value that will
A second consideration to be taken into A few other useful routines are embedded in
result in a time delay that is approximately
account is the amount of system resources the sample program: PrByte, which converts
equivalent to half a bit cell time for the baud
that will be ··used up· by the serial a byte of data to hexadecimal form and
rate being used, less some constant to
communication software. First of all, such transmits it; HexAsc, which converts one
account for the elapsed time between a timer
software routines will almost always require nibble of raw data to hexadecimal form; and
interrupt and the point where the serial input
!he use of at least one counterltimer to Mess, which transmits an absolute string of
is actually sampled. The timer reload register
generate the time slices for the serial bit cells. data (usually a text message) which is
is loaded with a value that will result in a time
Next, the phYSical connection to the outside terminated by a 0 byte.
delay that is as close as can be calculated to
wood will require one I/O port pin each for the one full bit cell time. The program then starts This demonstration of software driven serial
serial input and the serial output. Moreover, the timer and simply returns to the main . port routines uses 5 bytes of microcontroller
the port pin used for serial input should be an program, waiting for the timer to time out, RAM, two port bits (including one extemal
external interrupt input pin. This allows the generating another interrupt. interrupt input), one counterltimer, and about
software to be interrupted automatically at the 256 bytes of code space, excluding the mes-
beginning of an incoming start bit and At that point, the serial start bit should be
sage string at the end of the listing.
synchronizes the timer accurately to the about halfway through its nominal duration.
1
2 ;**************************************************************************
3
4 Software Driven Half-Duplex Serial Communication Routines
5 for 83C751 and 83C752 series Microcontrollers
6
7
8
9 ;**************************************************************************
10
11 $Title(Half-Duplex Serial Communication Routines)
12 $Date(ll/14/89)
13 $MOD751
14
15 ;**************************************************************************
16
FF75 17 BaudVal EQU -139 ;Timer value for 9600 baud @ 16 MHz.
18 ; (one bit cell time)
FFD9 19 StrtVal EQU -39 ;Timer value to start receive.
20 ; (half of one bit cell time, minus the
21 ;time it takes the code to sample RxD)
22
0010 23 XmtDat DATA lOh ;Data for RS-232 transmit routine.
0011 24 RcvDat DATA llh ;Data from RS-232 receive routine.
0012 25 BitCnt DATA 12h ;RS-232 transmit & receive bit count.
0013 26 LoopCnt DATA l3h ;Loop counter for test routine.
27
0020 28 Flags DATA 20h
0000 29 TxFlag BIT Flags.O ;Receive-in-progress flag.
0001 30 RxFlag BIT Flags.1 ;Transmit-in-progress flag.
0002 31 RxErr BIT Flags.2 ;Receiver framing error.
0003 32 RcvRdy BIT Flags.3 ;Receiver ready flag.
33
0090 34 TxD BIT 1'1.0 ;Port bit for RS-232 transmit.
0095 35 RxD BIT 1'1.5 ;1'ort bit for RS-232 receive (INTO).
36
37 ;**************************************************************************
38
39 Interrupt Vectors
40
0000 41 ORG 0 ;Reset vector.
0000 0124 42 AJMP Reset
43
0003 44 ORG 03H ;External interrupt O.
0003 019F 45 AJMP ExIntO ;Indicates RS-232 start bit received.
46
OOOB 47 ORG OBH ;Timer 0 interrupt.
OOOB 0175 48 AJMP TimrO ;Baud rate generator.
49
0013 50 ORG 13H ;External interrupt 1 (not used) .
0013 32 51 RETI
52
001B 53 ORG lBH ;Timer I interrupt (not used) .
OOlB 32 54 RETI
55
0023 56 ORG 238 ;I2C interrupt (not used) .
0023 32 57 RETI
58
59 :*************************************************************************
60
61 ;S1mp1e test of RS-232 transmit and receive.
62
0024 758130 63 Reset: MOV SP,#30h
0027 752000 64 MOV F1ags,tO ;C1ear RS-232 flags.
002A C201 65 CLR RxF1ag
002C 758800 66 MeV TCON,#OOh ;Set up timer controls.
002F 75AB82 67 MOV IE,II82h ;Enab1e timer 0 interrupts.
68
0032 751310 69 MOV LoopCnt, 1116 ;Test transmit first.
0035 7900 70 MOV R1,II0 ;Zero line count.
0037 90010C 71 MOV DPTR,ilMsg1 ;Point to message string.
003A 11FB 72 Loop1: ACALL Mass ;Send an RS-232 message repeatedly.
003C 743A 73 NOV A,I' :'
003E 1154 74 ACALL XmtByte
0040 E9 75 MOV A,R1
0041 11DD 76 ACALL PrByte ;Print R1 conterits.
0043 09 77 INC R1 ;Advance Rl value.
0044 D513F3 78 DJlIZ LoopCnt, Loop1
79
0047 D2AB 80 Loop2: SETB EXO ;Enable interrupt 0 (RS-232 receive).
0049 3003FD 81 RcvRdy,$ ;Wait for data available.
004C C203 82 CLR RcvRdy
004E E511 83 MOV A,RcvDat ;Echo same byte.
0050 1154 84 ACALL XmtByte
0052 80F3 85 SJMJ? Loop2
86
87
88 Send a byte out RS-232 and wait for completion before returning.
89 (use if there is nothing else to do while RS-232 is busy)
90
0054 200lFD 91 XmtByte: JB RxFlag, $ ;Wait for receive complete.
0057 115D 92 ACALL RSXmt ;Send ACC to RS-232 output.
0059 2000FD 93 JB TxFlag,$ ;Wait for transmit complete.
005C 22 94 RET
95
96
97 ; Begin RS-232 transmit.
98
005D F510 99 RSXmt: MOV XmtDat, A ;Save data to be transmitted.
005F 75120A 100 MOV BitCnt,,10 ;Set bit count.
0062 758CFF 101 MOV TH"High BaudVal ';Set timer for baud rate.
0065 758A75 102 MOV TL,'Low BaudVa1
0068 758DFF 103 MOV RTH,#High BaudVa1 ;A1so set timer reload value.
0068 758B75 104 MOV RTL,'Low BaudVa1
006E D28C 105 SETS TR ; Start timer.
0070 C290 106 CLR TxD ;Begin start bit.
0072 D200 107 SETS TxFlag ;Set transmit-in-progress flag.
0074 22 108 RET
109
110
111 ; Timer 0 timeout: RS-232 receive bit or transmit bit.
112
0075 COEO 113 TimrO: PUSH ACe
0077 CODO 114 PUSH PSW
0079 20013E 115 JB RxFlag,RxBit ;Is this a receive timer interrupt?
007C 200007 116 JB TxFlag,TxBit ;Is this a transmit timer interrupt?
DESCRIPTION value that is totally random, then there is a result of a warm boot and cleared as a result
For some dasses of applications, it may be one in eight chance that it will power-up with of a cold boot.
desirable to know if the application of the a predetermined value. If the assumption is
The label START is the location of the first
reset signal to a microcontroller is due to an extended to two bytes, a IS-bit number, then
instruction to be executed following a reset
initial power-on sequence, or is the result of there is one in 216 chance that both bytes will
(address = OOOOH). An instruction is located
an external signal such as an operator power-up with predetermined values.
here to jump into the main body of the
pressing a reset pushbutton, or the result of a Extending this to four bytes results in a one in
program to bypass the interrupt vector
watchdog timer or similar event. 232 chance; a very small probability. This is
locations.
the basis for the software determination of a
While there are perhaps numerous hardware warm or cold boot condition. The main program body begins by loading
solutions that can be employed, a simple register RO with the address of the first byte
software solution can offer a high degree of The technique consists of evaluating the in data memory to be evaluated. The
confidence in making this determination. The contents of four consecutive bytes of data contents of this first byte is compared with the.
task is to determine the differences in state of memory following a reset condition to first predetermined value. If there is no
resources internal to the microcontroller that determine whether these bytes had been match, the condusion is that it is a cold boot.
would occur as a result of these two types of previously loaded with known data values. If However, if a match is found, this does not
reset conditions. With respect to the 80C51 the contents of all four bytes match imply that it is a warm boot since all four
family of microcontrollers, on-<:hip resources predetermined values, this is interpreted to be bytes must match, and therefore the
consist of the special function registers a warm boot condition. If there is no match, it remaining three bytes must also be
(SFRs) and the internal data memory (RAM). is then interpreted to be a cold boot condition. evaluated. Register RO is incremented to
Most of the SFR locations are initialized as a At this point, it is necessary to load these four point to the second byte and then compared
result of a reset condition and thus cannot be bytes with predetermined data to prepare for to the second predetermined value.
used for this determination. The data memory the possibility of a subsequent warm boot Comparison of the bytes proceeds until either
contents are unaffected by reset. Thus, valid condition. a no match condition is found or until all four
data loaded into the RAM of the 8OC51 while 'bytes have been evaluated successfully. If all
executing a program would not be affected by four bytes compared favorable, then a status
The software example included in this
the application of an external reset signal bit (WARMBT) is set to indicate a warm boot
provided the power sourCe for the application brief can be used to perform this
warm or cold boot determination. and the remainder of the application program
microcontroler has not been removed (as is is completed.
the case for a "Warm boot").
The symbols WARMI thorough WARM4 An unsuccessful comparison results in
The contents of data memory as a result of represent the predetermined values. The branching to the label COLD. This section of
an initial application of power, however, is symbol WARM is the address of the first of code clears the status bit (WARMBT) to
indeterminate. While this effect has not been the four consecutive bytes in data memory. It indicate a cold boot, and loads the four bytes
extensively characterized, empirical is set to 30H to avoid conflict with the four of data memory with the predetermined
observation suggests that it is highly random register banks, the stack, and the values preparing the system for a subsequent
in nature. If it is assumed, for the moment, bit-addressable locations in data memory. possible warm boot. Program flow then
that the behavior of a given byte of data The symbol WARMBT is a bit-addressable continues with the remainder of the
memory is such that it will power-up with a location used as a status bit. It is set as the application program.
1
2 ;war.m boot application example
3
0030 4 WlIRH EOD 30R ;first location of the four bytes in RAM
0055 5 WlIRHl EOD 55R ;first predeterudned value
OOAA 6 WlIRH2 EOO OAAH ;second predeter.mined value
0033 7 WlIRH3 EOD 33R ;third predeterudned value
OOCC 8 WlIRH4 EOD OCCR ;fourth predeter.mdned value
0000 9 WARMBT EOD 0 ;wa~ boot statUB bit
10
0000 II ORG 0
12
0000 020026 13 START: JMI? MlUN :bypass interrupt vectors
14
0026 15 ORG 26R
16
0026 7830 17 MAIN: MOV RO,IIWlIRH ;pointer for first byte
0028 B65511 18 CJNE @RO, IIWlIRHl, COLD ;test first byte
002B 08 19 INC RO ;pointer for second byte
002C B6AAOD 20 CJNE @RO, IIWlIRH2, COLD ;test second byte
002F 08 21 INC RO ;pointer for third byte
0030 B63309 22 CJNE @RO, IIWlIRH3, COLD ;test third byte
0033 08 23 INC RO ;pointer for fourth byte
0034 B6CC05 24 CJNE @RO, IIWlIRH4, COLD ;test fourth byte
0037 D200 25 SETB WARMBT ;this is a war.m start
0039 020048 26 JMI? INIT ;continue with rest of application
003C C200 27 COLD: CLR WARMBT ;this is a cold boot
003E 7830 28 MOV RO,IIWlIRH ;pointer for first byte
0040 7655 29 MOV @RO,IIWARMl ;load the four bytes for future test
0042 08 30 INC RO
0043 76AA 31 MOV @RO,IIWlIRH2
0045 08 32 INC RO
0046 7633 33 MOV @RO,IIWlIRH3
0048 .08 34 INC RO
0049 76CC 35 MOV @RO,IIWlIRH4
004B 36 INIT: ; continue with the application
37
38 END
DESCRIPTION as a single master system the following bits microcontroller should always first write a
This application note shows how to use the are important: value to SO' after reset.
PCD8584 12C-bus controller with 80C51
PIN: Interrupt bit. This bit is made active SO is the 12C data register. It is addressed
family microcontrollers. One typical way of
when a byte is sent/received to/from the when AO = 0 and ESO-ES2 = IxO.
connecting the PCD8584 to an 80C31 is Transmission of a byte on the 12C bus is done
12C-bus. When ENI is made active, PIN also
shown. Some basic software routines are
controls the external INT line to interrupt the by writing this byte to SO. When the
described showing how to transmit and
microcontroller. transmission is finished, the PIN bit in SI is
receive bytes in a single master system. An
reset and if ENI is set, an interrupt will be
example is given of how to use these routines
ESO-ES2: These bits are used as pointer generated. Reception of a byte is signaled by
in an application that makes use of the 12C
for addressing SO, SO', S2 and S3. Setting resetting PIN and by generating an interrupt if
circuits on an 12C demonstration board.
ESO also enables the Serial I/O. ENI is set. The received byte can be read
The PCD8584 is used to interface between from SO.
parallel microprocessor or microcontroller ENI: Enable Interrupt bit. Setting this bit
enables the generation of interrupts on the The SDA and SCl lines have no protection
buses and the seriall 2C bus. For a
INTlIne. diodes to VDD. This is important for
description of the 12C bus protocol refer to
multi-master systems. A system with a
the 12C bus specification which is printed in
STA, STO: These bits allow the generation PCD8584 can now be switched off without
the microcontroller user guide.
of START or STOP conditions. causing the 12C-bus to hang-up. Other
The PCD8584 controls the transmission and masters still can use the bus.
reception of data on the 12C bus, arbitration, ACK: With this bit set and the PCD85B4 is
in master/receiver mode, no acknowledge is For more information of the PCD8584 refer to
clock speeds and transmission and reception
generated by the PCD8584. The the data sheet.
of data on the parallel bus. The parallel bus is
compatible with BOCSI , 68000, 8085 and Z80 slaveltransmitter now knows that no more
data must be sent to the 12C-bus. PCD858418031 Hardware Interface
buses. Communication with the 12C-bus can
Figure 2 shows a minimum system with an
be done on an interrupt or polled basis. This
application note focuses on interfacing with
BER: This bit may be read to check if bus 8051 family controller and a PCDB584. In this
errors have occurred. example, an 80C31 is used. However any
8051 microcontrollers in single master
80C51 family controller with external
systems.
BB: This bit may be read to check whether addressing capability can be used.
the bus is free for 12C-bus transmission.
The software resides in EPROM U3. For
PCD8584 S2 is the clock register. It is addressed when addressing this device, latch U2 is necessary
In Figure I, a block diagram is shown of the AD =0 and ESO-ES2 =010 in the previous to demultiplex the lower address bits from the
PCD8584. Basically it consists of an write cycle to SI. With the bits S24-S20 it is data bits. The PCD8584 is mapped in the
12C-interface similar to the one used in 84Cxx possible to select 5 input clock frequencies external data memory area. It is selected
family microcontrollers, and a control block and 4 12C clock frequencies. when A I = O. Because in this example no
for interfacing to the microcontroller. external RAM or other mapped peripherals
S3 is the interrupt vector register. It is
are used, no extra address decoding
The control block can automatically =
addressed when AO 0 and ESO-ES2 001 = components are necessary. AO is used by the
determine whether the control signals are in the previous write cycle to S 1. This register
PCD8584 for proper register selection in the
from 80xx or 68xxx type of microcontrollers. is not used when an 80C51 family
PCD8584.
microcontroller is used. An BOC51 micro-
This is determined after the first write action
controller has fixed interrupt vector U5A is an inverter with Schmitt trigger input
from the microcontroller to the PCD-8584.
addresses. and is used to buffer the oscillator signal of
The control block also contains a
the microcontroller. Without buffering, the rise
programmable divider which allows the SO' is the own address register. It is
and fall time specifications of the ClK signal
selection of different PCD8584 and 12C addressed when AO = 0 and ESO-ES2 =
are not met. It is also important that the ClK
clocks. 000. This register contains the slave address
signal has a duty cycle of 50%. " this is not
of the PCD8584. In the single master system
The 12C interface contains several registers possible with certain resonators or
described here, this register has no functional
which can be written and read by the microcontrollers, then an extra flip-flop may
use. However, by writing a value to SO', the
microcontroller. me necessary to obtain the correct duty
PCD8584 determines whether an 80Cxx or
cycle.
SI is the control/status register. This register 6Bxxx type microcontroller is the controlling
is accessed while the AD input is I. The microcontroller by looking at the C"S and WR U5C and U5D are used to generate the
meaning of the bits depends on whether the lines. So independent of whether the proper reset signals for the microcontroller
register is written to or read from. When used PCD8584 is used as master or slave, the and the PCD8584.
~ ~ ~
AO ESO ESI ES2 "lACK
r -I-'
SCL DIGITAL
t
~
ALTER BUS BUFFER
t
,
SO DATA
J ,
REGISTER
~
, DATA'SHlFT'REGIJTER RIW 0 1 X 0 H
SCL
CONTROL
r
i
COMPARATOR
(+
.~
so· ADDRESS
REGISTER
SlINT VECTOR
REGISTER
I OWN ADDRESS SO·
DEFAULT OOH IlOXXIOFH 68XXXl
I I
r- RIW 0 0 0 0 X
,0
°IACK
S2CLOCK
INTERRUPT VECTOR
r RIW
R(ACK)
0
x
0
1
0
0
1
X
x
L
REGISTER
SCL
-,-'
DIGITAL
ALTER
o , 0 ,
o , S24' S23' S22' S21' S20 1-- 0 0 1 0 X
~ i ~
SI CONTROU
STATUS REGISTER
1 CONTROL BLOCK
, I
I
aoXXXl ,
68XXX EN ENROl 0 ~ Et
MODE 0
1 T
lSCL
J~.SIIHz)
~1= 16CLK
J a-J
SlO DIVIDER
(S2O, S21)
:16/:321:128/:1024
DIVIDER
(522-524)
:21:3/:41:5/:8
W x 1 1 X L
f
I'C OWNADDR.
WAKEUPINT.
"RES~ ~
"STROBE
°CS °WRI
°RIW
AO I °RDI
°DACK
OINT, 1ACKI CL~I
50:50
(S.ADDR.P) (O.C.)
usc USD I
rT rr
V"
C3
lOuF
VeeO
L ~~SETcs II II C4
47uF 20
h hE:
E
40 C& 20
10
C72Ar::h
14
ca2Or::h
10
C9 14pb- Cl0
7
& 1-"5_+--,,<80<
74HCT14 74HCT14
,9
2 ... R3
10K JII'
Dl
.L
lN4148
ADO •.• AD7 CS ••. C10:0.luF
A ",U,,-3_ - : - , 11
AO 01 ~
00
Ul
U2
~~9 A3~ ~
::~
~ 9NP PO.O ~ q~ ao~ ~A4 ~~
H
H
C1 (22pF)
C2
.=.Xl
912MHz
19
1.
Xl
X2
PO.l
PO.2
PO.3
POA
~
~
~
~
f
q~D4g~ ~~04~ AD ••• A7 ~~24 A9
07 ~
~ g~ g~ ~
PO.S
~
(12pf) PO.&
9 23 AA,' O
,
~
RESET PO.7
9-+____vv2-
.r
JP2 '-.1§. D7 Q7 ... A12
16P--+-f---I--o
15
Vee r-.§:
13
lImI
IRTT
P2.0~21.
P2.1 23
.L r - - gc
L......::-::-::==-' ~ .. t:E
:: ,: ~ ~~:~ ~."",,AS_•••_A12~I"'"':"_ _ _
74HCT373 ~
12 rt- Pl.0 P2.4 _ _--' 1 V""
11 ;,-+ Pl.l P2.S ~. 27C64
10 :cts Pl.2 ~~~ ~ ~ Vee
7
:
>--
I
r}
~
/ < ::! RD~~'7~~~~~==========t4:[AfO~~
Pl.S
~
WR
PSER I
r ___ ~~~~~
1&
U4
7
&
~~
Pl.&
:~~3Iil-5l~:~!-----'
RD
1. WR
& AO
DBO
DBl
DB2
=F
+,..,
~
t:s DB3
DB4
~
~ ~ ~==r=====t===============~==========================~
DBS
19 RESET DB&
lIlT DB7 ...u..;:
L------------21 =
~~-----------~R~1r_r----,1'1~OO~---~~7~4HC~T~14~------------~
2
SDA
1 USA.
vcc~
CLK
:==l 3 SCL
~~~~~-------~R22c=~:J,1WOOo-----------------------~~~~~
_~.Fivc' PCD8584
PC CONNECTOR
Figure 2. PCD8584 to 80C31 Interface
Basic PCD8584/8031 Driver control register. The address of the PCD8584 accumulator will contain the value of status
Routines is in variable 'PCD8584'. This must have register SI of the PCD8584.
In the listing section (page 728), some basic been previously defined in the user program.
routines are shown. The routines are divided The DPTR is used as a pointer for Routine Start Lines (44-56)-
addressing the peripheral. If the address is This routine generates a START-condition
in two modules. The module ROUTINE con-
less than 255, then RO or Rl may be used as and the slave address with a RlW bit. In line
tains the driver routines and initialization of
the address pointer. 44, the variable IIC_ CNT is reset. This
the PCD8584. The module INTERR contains
the interrupt handler. These modules may be Routine Sendcontr (Unes 25, 26)- variable is used as a byte counter to keep
linked to a module with the user program that This routine is similar to Sendbyte, except track of the number of bytes that are received
uses the routines in INTERR and ROUTINE. that now AO = 1. This means that the or transmitted. IIC_CNT is defined in module
In this application note, this module will be contents of the accumulalor are sent to the INTERR.
called USER. A description of ROUTINE and control register SI in the PCD8584.
INTERR follows. Unes 45-46 increment the variable
Routine Readbyte (Unes 30-33)-
NR_BYTES if the PCD8584 must receive
This routine reads a register in the PCD8584
Module ROUTINE data. NR_BYTES is a variable that indicates
with AO = O. Which register depends on ESO
how many bytes have to be received or
-ES2 of the control register. The result of the
Routine Sendbyte (Unes 17-20)- transmitted. It must be given the correct value
read operation is returned in the accumulator.
This routine sends the contents of the in the USER module. Receiving or
accumulator to the PCD8584. The address is Routine Readcontr (Lines 37-39)- transmitting is distinguished by the value of
such that AO = O. Which register is accessed This routine is similar to Readbyte, except the DIR bit. This must also be given the
depends on the contents of ESO-ES2 of the that now AO = 1. This means that the correct value in the USER module.
Then the status register of PCD8584 must be to be transmitted. are used in the lIe driver routines. Note that
read to check if the 12C bus is free. First the PCDB584 must be an even address,
status register must be addressed by giving NR_BYTES, IIC_CNT and SLAVE were otherwise the wrong internal registers will be
ESO-- ES2 of the control register the correct explained earlier. 12C_END and DIR are flags accessed! Lines 37-42 initialize the interrupt
value (lines 47-48). Then the Bus Busy bit is that are used in the program. 12C_END logic of the microcontroller. Next the
tested until the bus is free (lines 49-50). If indicates whether an 12C transmission or PCDB584 will be initialized (line 45).
this is the case, the slave address is sent to reception is in progress. DIR indicates
data register SO and the 12C_END bit is whether the PCD8584 has to receive or The PCD85B4 is now ready to transmit data.
cleared (lines 51-53). The slave address is transmit bytes. The interrupt routine makes A table is made in the routine at line 61. For
set by the user program in variable USE R. use of register bank 1. the PCDB577, the data is a control byte and
The LSB of the slave address is the RIW bit. the segment data. Note that the table does
The transmission part of the routine starts at
12C_END can be tested by the user program not contain the slave address of the LCD
line 42. In lines 42-43, a check is made
whether an 12C reception/transmission is in driver. In lines 51-54, variables are made
whether IIC_CNT = NR_BYTES. If true, all
progress or not. ready to start the transmission. This consists
bytes are sent and a STOP condition may be
of defining the direction of the transmission
Next the START condition will be generated generated (lines 44-45).
(DIR), the address where the data table
and interrupt generation enabled by setting starts (BASE), the number of bytes to
Next the pointer for the internal RAM is
the appropriate bits in control register Sl. restored (line 46) and the byte to be transmit (NR_BYTES, without slave address!)
(lines 54-55). and the slave address (SLAVE) of the 12C
transmitted is fetched from the internal RAM
(line 47). Then this byte is sent to the peripheral that has to be accessed.
Now the routine will return back to the user
PCD85B4 and the variables are updated
program and other tasks may be performed.
(lines 47-49). The interrupt routine is left and In line 55 the transmission is started. Once
When the START condition, slave address
the user program may proceed. The receive the 12C transmission is started, the user
and RIW bit are sent, and the ACK is
part starts from line 55. First a check is made program can do other tasks because the
received, the PCD8584 will generate an
if the next byte to be received is the last byte transmission works on interrupts. In this
interrupt. The interrupt routine will determine
(lines 56-59). If true the ACK must be example a loop is performed (line 58). The
if more bytes have to be received or
disabled when the last byte is received. This user can check the end of the transmission
transmitted.
is accomplished by resetting the ACK bit in during the other tasks, by testing the
the control register S 1 (lines 60-61). 12C_END bit regularly.
Routine Stop (Unes 59-62)-
Calling this routine, a STOP condition will be
Next the received byte may be read (line 62) The second example program receives 2
sent to the 12C bus. This is done by sending
from data register SO. The byte will be bytes from the PCF8574P I/O expander on
the correct value to control register Sl (lines
temporary stored in R4 (line 63). Then a the OM1016 demonstration board. Until line
59-61). After this the 12C_END bit is set, to
check is made if this interrupt was the first 45 the program is identical to the transmit
indicate to the user program that a complete
after a START condition. If so, the byte read routine because it consists of initialization
12C sequence has been received or
has no meaning and the interrupt routine will and variable definition. From line 4B, the
transmitted.
be left (lines 6B-70). However by reading the variables are set for 12C reception. The
Routine 12C_lnlt (Unes 65-76)- data register SO the next read cycle is received bytes are stored in RAM area from
This routine initializes the PCDB5B4. This started. label TABLE. During reception, the user
must be done directly after reset. Lines program can do other tasks. By testing the
If valid data is received, it will be stored in the
67-70 write data to 'own address' register 12C_END bit the user can determine when to
internal RAM addressed by the value of
SO'. First the correct address of SO' is set in start processing the data in the TABLE.
BASE (lines 71-73). Finally a check is made
control register Sl (lines 67-68), then the
if all bytes are received. If true, a STOP
correct value is written to it (lines 69-70). The The third example program displays time
condition will be sent (lines 75-7B).
value for SO' is in variable SLAVE ADR and from the PCFB5B3P clock/calendar/RAM on
set by the user program. As noted-previously, the LCD display driven by the PCF8577. The
EXAMPLES
register SO' must always be the first register LED display (driven by SAA1064) shows the
In the listing section (starting on page B),
to be accessed after reset, because the value of the analog inputs of the AID
some examples are shown that make use of
PCD8584 now determines whether an converter PCF8591. The four analog inputs
the routines described before. The examples
80Cxxx or 6Bxxx microcontroller is are scanned consecutively.
are transmission of a sequence, reception of
connected. Lines 72-76 set the clock register
12C data and an example that combines both.
S2. The variable 12C_CLOCK is also set by In this example, both transmit and receive
the user program. The first example sends bytes to the sequences are implemented as shown in the
PCDB577 LCD driver on the OM1016 previous examples. The main clock part is
Module INTERR demonstration board. Lines 7 to 10 define the from lines 62-128. This contains the calls to
This module contains the 12C interrupt interface with the other modules and should the 12C routines. From lines 135-180,
routine. This routine is called every time a be included in every user program. Lines 14 routines are shown that prepare the data to
byte is received or transmitted on the 12C to 16 define the segments in the user be transmitted. Lines 171 to 232 are the main
bus. In lines 12-15 RAM space for variables module. It is completely up to the user how to program for the AD converter and LED
is reserved. organize this. display. Lines 239 to 340 contain routines
used by the main program. This demo
BASE is the start address in the internal Lines 24 and 2B are the reset and interrupt program can also be used with the 12C
8OC51 RAM where the data is stored that is vectors. The actual user program starts at peripherals on the OM1016 demonstration
received, or where the data is stored that has line 33. Here three variables are defined that board.
52
53
54 ;Program to receive byte from IIC bus
0020: 55 RECEIVE:
0020: E502 R 56 MeV A, IIC_ CNT ;Test if last byte is to be
; received
0022: 04 51 INC A
0023: 04 58 INC A
0024: B50l05 R 59 CJNE A,NR_BYTES,PROC_RD
0021: 1448 60 MeV A,#0100l000B;Last byte to be received.
;Disab1e ACK
0029: 120000 R 61 CALL SENDCONTR ;Write control word to
;PCD8584
002C: 120000 R 62 PROC_ RD : CALL READBYTE ;Read 12C byte
002F: FC 63 MeV R4,A ;Save aeou
64 ;If RECEIVE is entered after the transmission of
65 ;START+address then the result of READBYTE is not
66 ; relevant. READBYTE is used to start the generation
;of the clock pulses for the next byte to read.
61 ; This situation occurs when IIC_CNT is 0
0030: E4 68 CLR A ;Test IIC_CNT
0031: B50202 R 69 CJNE A,IIC_CNT,SAVE
0034: 8006 10 .JMP END TEST ;START is send. No relevant
;data in data reg. of 8584
0036: A800 R 11 SAVE: MeV RO,BASE
0038: EC 12 MOV A,R4 ;Destination is internal RAM
0039: F6 13 MeV @RO,A
003A: 0500 R 14 INC BASE
003C: 0502 R 15 END_TEST:INC IIC_CNT ;Test if all bytes are
; received
003E: E501 R 16 MeV A, NR_BYTES
0040: B50203 R 11 CJNE A,IIC_CNT,EXIT
0043: 120000 R 18 CALL STOP ;All bytes received
19
0046: DODO 80 EXIT: POP PSW ;Restore PSW and aeou
0048: DOEO 81 POP ACC
004A: 32 82 RET!
83
004B: 84 END
0021:
0021: 7800 R 62 MOV RO, #TABLE ;Make data ready for 12C
:transmission
0023: 7600 63 MOV @RO,ioO ;Contro1word PCF8S77
0025: 08 64 INC RO
0026: 76FC 65 NOV @RO,#OFCH ;'0'
0028: 08 66 INC RO
0029: 7660 67 MOV @RO,'60H ;'1'
002B: 08 68 INC RD
002C: 760A 69 MOV @RO,iDOAH ;'2'
002E: 08 70 INC RD
002F: 76F2 71 MOV @RO,iDF2H ;'3'
0031: 22 72 RET
73
74
7S RSEG RAMTAB
0000: R 76 TABLE: OS 10 ;Reserve space in internal
;data RAM
77 ;for 12C data to transmit
78
79
OOOA: 80 END
277
278 ;CONVER~ calculates the voltage of the analog value.
279 ;Ana1og value must be in accu
280 ;BCD result (3 bytes) is stored from address stored
;in R1
281 ;Calculation: AH_VlIL*(5/256)
0154: 75F005 282 CONVER~:MeV B,#05
0157: A4 283 MOL AB
284 ;b2 .. bO of reg. B 2E+2 .. 2EO
285 ;b7 .. bO of accu 2E-1. .2E-8
0158: A7FO 286 MeV @Rl,B ; Store MSB (lOEO-units)
015A: 09 287 INC R1
A typicial example of such an application is register, allowing the user to daisy chain
the interface between the 87C751 and the multiple SA5775 devices. Note that data is 4 I 26
'GJ
Philips SA 5775 Air Core Meter Driver shown clocked out of this pin on the falling edge of
in Figure 2. This circuit includes the 87C751 the clock. The CS pin is also used to latch the
microcontroller, the SA 5775 air core meter parallel outputs of the shift register into the PLCC
driver, an NE555 timer, and discrete support data latch. The outputs of the data latch feed
components. the inputs to the D/A converter. The D/A 11 18
converter outputs are buffered to form the
An air core meter differs from a conventional 12 18
drive signals for the meter coils.
(d'Arsonval) meter movement in that it has no
Pin Function Pin Function
spring to return the needle to a A voltage reference for the D/A converter is I P3A 15 PI.O
predetermined position, no zeroing provided internally. II is possible to externally 2 P3.3 16 PI.l
adjustment, and no permanent magnet in the force different values for these voltages and 3 P3.2 17 Pl.2
classical sense. Instead, it consists of two pins are provided for this purpose. However, 4 P3.1 18 Pl.3
5 N.C. 19 PIA
coils of wire wound in quadrature with each this is not generally recommended as this 6 P3.o 20 Pl.5I1Rl1I
other around a central core in which there is a could lead to increased power dissipation. 7 PO.2 21 N.C.
disc magnetized along its diameter. A shaft is S PO.lISDA 22 N.C.
The DIA converter circuits and its associated 9 PO.lllSCL 23 PI.6I1flTT
placed through the center of this disc so that 10 N.C. 24 Pl.7rro
output buffers are purposely designed such RST P3.7
the shaft rotates with the disc. An indicating 11 25
that the span of these circuits does not 12 X2 26 P3.6
needle attached to this shaft will rotate with it.
include the power supply rails. This is to 13 XI 27 P3.5
14 28
SA sns Air Core Meter Driver avoid inaccuracies that would otherwise
occur if the output were to become very close
vss Vee
The SA 5775 is a monolithic driver for
controlling air core meters typically used in to either supply rail. With a supply voltage of
14 volts (VIGN), the positive reference Figure 1. Pin Configuration
automotive instrument clusters and is shown
in Figure 3. The SA 5775 receives a 10-bit
F'
III
<II 3L-
i'
<II
Clock 0- r-- +5V 10k
<II ~
'" Data In 0- lOOk 78lO5
...
.....
I~
~~ _IO~Hz
10k
(J1
?l 10k C~ -=-
~
II> 10k
10~Fl
9''+
-=-
j!FI!~ +5V
'"
Q.
:T
..,
<II
:.
-1..
L-----.!!.
PO.lISDA
:1:1
en
....
CD
.....
<
0
0
24 10 11
TOW R8te~
0--
it lk
.
~
III 6
PO.O/SCL
PO.2
0
.....
~
Exl 8 4 7 lk
~
> Gnd 3 soak
..
~
." ." ." ." ."
:!i ~ ~ 'J ;!l
~
(J1 +5V _ 0fo' Rate
fo'
~ t: ~
~
~ :.. b NE555 Control
10k 4 5 1 2 3 16 15 14 3
'"22 Count Up ,.6fl
6
10k 123 ~
~
10k
~countDown
~ ~
10k
10k
'Ok ::::=: ,.,.F
10k
10k
10k
10k Pulse Monitor
>
»
z
"tJ
"2-
lJ
INC
JJJ 100 JJJJ J
Program Delay Start!
.j:>.
I\)
i:
:::>
Select Seloct -=- Count 0) z
~
Signetics 8OCS1-Based 8-Bit Microcontrollers Application Note
executed, the INC SELECT (52) switch bit) are masked ofl, leaving twice the value of
selects the incremental step sizes of the two the port selected in the accumulator. Twice
of the routines, and the DELAY switch (S4) is the read value is needed for the next few
used to set the delay between successive main program lines that determine which
word transmissions in one of the routines. routine to execute.
The START/COUNT button (55) is used to Une 31 moves the address of labef JMPTBL
begin execution of a routine, and to cause the (Jump Table) to the 16-bit Data Pointer
next incremental step in Routine #1. (DPTR) register. Une 32 causes a program
jump to the address that is the sum of the
The COUNT UP/DOWN switch (SS) is used
value in the accumulator (two times the
in Routine #1 to determine whether the count
routine number selected) plus the DPTR
is increased or decreased with transmission
register. Since each of the commands on
of successive words.
lines 33 through 40 are two by1e commands,
NE555 Timer these addresses are all separated by two
The NE555 timer shown in this application bytes; hence, the need for the accumulator to
example is used as a free running contain a number that is twice the number of
squarewave generator used to simulate the selected routine.
sensor inputs such as those which might be Routine 0
NOTE: D package available In
found in an automobile, etc. The NE555 timer This routine begins on line 41 by
large so (SOL) pockage only. (U4) operates in the astable mode to produce incrementing the 1O-bit word in registers 7
Figure 3. 0 and N Packages an output frequency that can be varied from and 6 by the amount indicated by the setting
about 1Hz to about 200 Hz. Three of the of the INCREMENT SELECT switch, then
program routines measure the input period sending that word to the SA5n5. When a full
87C751 Mlcrocontroller and produce an output code that is
The 87C751 microcontroller provides all of scale overflow is detected, a full scale code
proportional to the frequency present at pin (3FF hex) is sent out, followed by a delay of
the intelligence in this application. It samples 20 (TO) of the microcontroller. A RATE switch
various input ports to determine which 500 ms, then successive output codes are
(57) is used to select between the on board sent out, decremented by an amount
demonstration programs to run, the oscillator or an external source.
incremental step sizes for angular indicated by the INCREMENT SELECT
displacement of the meter core, and the time The program listing is included at the end of switch. When an underflow is detected a
delay between increments. In one of the this application note. code of zero scale is sent and the routine
demonstration modes, it also samples a returns to the beginning of the program. This
variable frequency input and positions the Program Entry routine is implemented with a series of
meter core in response to the frequency of The program starts at address 030(hex) on subroutine calls.
that input. The 87C751 also transmits the line 2t of the program listing. The first task is
to write l's to all pins of each port. The SO subroutine begins on line 356 and
10-bit serial data to the SA5n5. Data input starts by sending out whatever ten bits that in
(01), Clock (CLK), and Chip Select (CS) lines Lines 25 and 26 clear registers 6 and 7. the two LSBs of register 7 (R7) plus the 8 bits
are driven from the 87C751. These registers are used in this program only of R6 by calling the SENDIT subroutine. Then
Port 0 of the 87C751 is a 3-bit wide port and to hold the data that is sent out to the ACMD. it calls the UP subroutine, which increases
is used for communicating data to the ACMD. The registers are cleared to be sure that the the word value to be sent out. The program
Data is transmitted, MSB first, in a serial starting value is zero. then jumps to the beginning of this
stream clocked into the 01 of the SA5n5 on At line 27 the program waits until the subroutine, repeating the process of sending
the rising edge of the clock. In order to clock START/COUNT button (55) is depressed out a word and incrementing to the next word
in data, the CS pin of the SA5n5 must be before continuing. Lines 28 and 29 set the until an overflow from the tenth bit (bit 2 of
high. The data in the input register is shifted timer to overflow after 10ms. This is done by R7) is detected at line 362.
into a latch that drives the DAC on the high to setting the timer registers for a count of The SEN DIT subroutine (beginning on line
low transition of the CS line. As data is 10,000 microseconds less than full scale. 476) brings the CS line high, sets a bit
shifted into the ACMD, it overflows through When the timer counter overflows the timer counter (Rl) to 2 (to send out two bits of R7),
the Data Out (DO) pin on the falling edge of flag is set, and the timer is reloaded with the brings the value of R7 to the accumulator,
the dock. With this facility, multiple ACMDs value in the timer register. By examining the rotates the accumulator to the right three
can be daisy-drained with DO of one ACMD timer flag we know when 10ms has expired. times through the canry bit to bring the two
being connected to 01 of the next one, and LSBs to the position of the two MSBs, calls
common clock and chip select lines may be Line 30 calls subroutine RPS (Read Port
Selected), which reads Port 3 to determine the SENDl routine, which sends the number
used. This simplifies the interfacing to of bits in the accumulator, starting with the
multiple meter drivers. which routine has been selected. Since the
PROGRAM SELECT switch (53) is MSB, indicated by Rl. Counter Rl is then set
The 78L05 regulator (Q2) provides 5 Volt connected to port pins P3.2 through P3.4, to 8 to send out all 8 bit of R6 and the
power for the board so that single supply of subroutine RPS (lines 507 through 511 at the accumulator is loaded with the contents of
+14 volts can be applied to the board. end of the program) first reads Port 3 into the R6. The SENDl routine is again called to
accumulator, then complements it because send out the final 8 bits, and, on line 491, the
Three rotary switches are used on this board. CS line is brought low, loading the SA5n5
The PROGRAM SELECT switch (53) is used the switches used are complementary binary.
The reading is then rotated right once and the internal parallel latch with the contents of the
to select the program routine that is input shift register.
upper nibble and the LSB (least significant
~ 6 o 5 7 4 3
I 2
~
........
~
Logic 1
,--
......
10
I I
m~
~ 16
-
DAC - MUX 15
~r-
I IV U
~
Shut-Down
Logic
=-
-
11 12 13 14
The SENDl routine rotates the accumulator LSBs are hardly noticeable, the program then Routine 1
left through the carry bit, moves the value of multiplies the result by 8 (rotate left three This routine is selected with the PROGRAM
the carry bit to port pin PO.l (SDA - Serial times). To insure a minimum change amount, SELECT switch is in position 1 or position 9.
Data pin), waits to provide a setup time, the accumulator is increment by one alline Routine 1 (PROG1) increments or
brings the clock low, waits, brings the clock 386. This all means that the increment decrements the word send out, depending
high, waits, then decrements bit counter amounts that can be selected are 1, 9,17, or upon the setting of the COUNT UP/COUNT
sends the next bit if the counter is not zero. A 25 LSBs. This amount is added, in lines 387 DOWN switch, SS. The amount of change is
return is executed when the counter becomes through 391, to the word previously send out detennined by the setting of the INC SELECT
zero. and we return from this subroutine. switch, S2.
The UP subroutine, beginning at line 364, Alter calling the SO subroutine, PROGO call At line 63, the program examines SSat port
reads the delay selected by switch S4 at port the FULLSC (full scale) subroutine, which pin P3.6 and jumps to the decrement portion
pin Pl, complements it (again, because the sends out the full scaie code of 3E8(hex). of the routine if the pin is low. If this pin is
rotary switches are complementary binary), Although a 10-bit full scale code would be high, the UP subroutine is called from line 64
masks off the upper four bits (because the 3FF(hex), going only to 3E8 allows an easy to increase the R7/R6 word value. The UP
delay switch has just four positions and is distinction between zero scale and full scale subroutine was previously described.
connected to the lower four bits of the port), when looking at the display. The FULLSC
If pin P3.6 is low, the DOWN subroutine (line
multiplies it by 4 (rotates left twice), then subroutine is found at line 352.
402) decreases the previous word sent out by
moves the result to Rl. If Rl is not zero, the
After advancing to full scale, there is a SOOms the amount determined from the INC
program jumps around line 376 and calls a
delay, found at line 464 and called from line SELECT switch setting.
10ms delay (subroutine DLY10MS) the
48, then 49 calls the SOD subroutine to send
number of times entered into Rl. To insure enough delay to allow the user time
out decreasing word values.
to release the START/COUNT button (S5), a
The 10ms delay subroutine (starting at line
The SOD subroutine begins at line 393 and delay of 200ms is included at line 66 before
436) sets the timer for 10ms, waits at line 446
begins by sending out the current word in R7 jumping to line 27, where another depression
for the timer flag to be set, clears the timer
and R6 from line 398, then calling subroutine of the START/COUNT button is awaited. If S3
flag, stops the timer, and returns, in this case,
DOWN, which calculates the next (PROGRAM SELECT) is still set to 1 or 9,
to line 379, where the program decrements
(decreasing) word to send out. DOWN begins depression of S5 will cause a jump back to
R1 and repeats the 10ms delay until R1 is
at line 402. It essentially does the same thing line 52. If another program is selected, the
zero.
as the UP subroutine, but subtracts the program will jump to the selected routine.
If the selected delay was zero, the program INCREMENT SELECT value from the
Holding down S5 with PROGRAM SELECT
jumps from line 376 to line 380 and reads previously sent word rather than adding to it.
set at poSition 1 or 9 will cause increasing or
port 3 to detennine the amount the sent out
At line 50 subroutine ZEROSC is called to decreasing word values to be sent to llie
word is to change from the value previously
send a zero scale code to the SA5775, then SA5775.
sent out. The accumulator is complemented
the program branches back to the beginning.
and the upper 6 bits masked off to recover
only the two bits of the selected increment
amount. Since increments of 1, 2, 3, or 4
floutlne 2 (R7/R6) to zero, clearing the carry bit, code to display that is the average of these
PROG2 is the most complex of all these checking to see if R3 indicates a time above four readings.
routines. The purpose of this routine is to one second, returning to lirie 81 if it does.
II starts by setting a counter for three
cause the air core meter deflection to Otherwise the program continues at line 26,
readings, taking those three readings and
represent the frequency presented at the where the program checks to see if the input
storing them in memory, beginning at RAM
timerlcounter input to the microcontroller. frequency is beyond full scale (timer reading
address 20 hex, using register RO as an
This is done by measuring the period of the above 00 1288 hex). "it is, R7/R6 is loaded
index register.
input square wave and taking the inverse of with 1288 hex (full scale of decimal 1,000).
the period. The input here must be a square This value was chosen because it is At line 212 the program takes a fourth
wave because II slow rise and fall time at this sufficien~y far from zero scale that it is easily reading, then adds the three previous •
input will cause fluctuating readings. To discerned from zero scale on the display. readings to it in lines 213 through 227; and
determine the frequency by counting pulses divides the sum by four (rotates right twice) in
"the result is not to be full scale or zero
for a time would require a much longer time lines 229 through 239. The word to send out
scale, the program continues at line 140 with
and, therefore, is impractical. is then calculated from line 240 and sent to
a shift and subtract divide routine. The
the ACMD, aiter which the program then
The MEAS (measure) subroutine is called at dividend would be 1,000,000 (decimal) to
looks for and jumps to the selected routine.
line 79 to measure the period of the input convert back to frequency in Hertz (period
waveform and the CALC (calculate) measurements is in microseconds), but that Routine 4
subroutine is called at line 80 to calculate the would provide a maximum count of 200 at PROG4 begins at line 243 and displays the
code to send to the SA5775. The SENDIT 200Hz, only one fifth of the full scale desired average of the current and last three words
subroutine is then called to send the word to of 1,000. So we made the dividend to be sentoul.
the SA5775 and the program jumps back to 5,000,000 decimal, or 4C 4B 40 hex.
line 28. RAM space used is first initialized to zero and
This algorithm is found in lines 156 through a new reading is taken and a new word is
The MEAS subroutine begins at line 83 by 192 and works as follows: calculated and saved. At lines 264 through
being sure the timer is not running and 1. Clear a counter. 284, the new word is added to the last three
clearing the timer (overflow) flag, then readings and the average calculated and
2. Rotate dividend until the first one is in the
entering zero into both high and low bytes of stored in RAM locations 28 and 29 (hex), and
second MSB position. Since a code of 4C
the timer and the timer register. The carry bit the average word is sent out.
has already provides that, no shifting is
is then cleared (line 90) and the timer started
and the timer interrupt enabled. necessary. At line 286, the program reads for the
3. Rotate the divisor (the period in program selected and jumps to line 254 if this
Unes 93 and 94 form a short loop that waits routine is selected, otherwise it goes to line
until either the carry bit is set or until the TO microseconds in this case) left until the
first one is in the second MSB position, 28.
input is low. The carry bit is set when the
but the first byte is LESS THAN the first
timer has gone beyond one second. This is
byte of the dividend. Increment the
done by the timer interrupt subroutine, found ROUTINE 5
counter each .time the divisor is rotated.
at lines 16 through 19. "the TO input never PROG5 begins at line 293 and, very simply,
goes low, we know the frequency is at or near 4. Initialize a counter to zero. send in sequence the codes for 118 through
zero and the program jumps to GZS (line
5. Rotate the quotient (answer) and dividend full scale in 1/8 scale steps, with 500ms
108) where R3 is loaded with a 1F (hex) to between steps. It then steps down to zero
cause the CALC subroutine to load zero one bit left.
scale in 118 scale steps, then returns to line
scale into R7/R6. 6. "first byte of quotient is smaller than the 28.
When (and if) TO is found to be low, the first byte of the quotient, jump to step 8.
program jumps to line 95 and waits for that Routine 6
7. Add one to the quotient and subtract the
input to go high. Time out process is the PROG6 begins at line 314 and does the
divisor from the dividend.
same as above. same as PROG5, but steps in 1/4 scale
8. Decrement the counter and go to step 5 if increments.
Now that the TO input is found high (if is is it is not zero.
before the one second time out), the timer Routine 7
and carry bit are cleared in lines 97 through Once the CALC subroutine is completed, the PROG710ads the code for 318 scale into
100 (R3 is an extension of the timer). program calls SENDIT from line 81 and R7/R6, sends it, waits 500ms, changes r& for
jumps, ultimately, to the selected routine. 518 scale, sends it, waits for 500ms, then
At lines 101 through 107we wait for one repeats this sequence 9 more times (for a
complete cycle at the TO input, with the floutlne3 total of ten times), waits 500ms, then returns
timerlcounter measuring that period, then PROG3, beginning at line 194, measures the the output to zero scale and the program
return to line 80, where the CALC subroutine inpm period four times, then calculates the jumps to line 28.
is called.
The CALC subroutine, starting at line '113,
begins by initializing the word to send out
1 ACMD V3 DEMO
2 PROCESSOR: 87C751
3 7-29-89
4
5 The purpose of this proqram is to drive version 3 of the ACMD (SA5775)
6 demonstration board. The PROGRAM SELECT switch is used to select from
7 a choice of four routines. Reqisters R7 and R6 contain the 10-bit word
8 that is send to the SA5775.
9
10 $MeD751
0000 11 ORG 0
12
0000 B02E 13 SJMP START ;RESET VECTOR
14
OOOB 15 ORG OOBH ; TIMER/COUNTER INTERRUPT ROUTINE
OOOB OB 16 INC R3 ;INCREMENT R3 (3rd BYTE OF TIMER)
OOOC 740F 17 MeV A,#OFH ;TEST FOR TIME OUT (R3 > OF)
OOOE 9B 18 SUBB A,R3 ;IF R3 > OF, CARRY IS SET
OOOF 32 19 RETI
20
0030 21 ORG 30H ;START OF PROGRAM
0030 7580FF 22 START: MeV PO,I/OFFH ;SET PORTS HIGH
0033 7590FF 23 MeV Pl,I/OFFH
0036 75BOFF 24 MOV P3,I/OFFH
0039 7FOO 25 MeV R7,1/0 ; CLEAR WORD TO SEND OUT
003B 7EOO 26 MOV R6, I/O
003D 20B6FD 27 W: JB P3.6,W ;WAJ:T FOR START BUTTON DEPRESS
0040 758BFO 28 READY: MOV RTL,I/LOW(O-lOOOO) ;SET TIMER REGISTER
0043 758DD8 29 NOV RTH,I/HIGH(O-lOOOO);FOR 10ms TIME
0046 51D2 30 ACALL RPS ;READ PORT 3 FOR PROG SELECT
0048 90004C 31 MOV DPTR, IIJMPTBL ; JMP ADDRESS TO DATA POINTER
004B 73 32 JMP @A+DPTR ; GOTO APPROPRIATE ROUTINE
004C 015C 33 JMPTBL: AJMP PROGO ;Rl\MP UP AND BACK DOWN
004E 0168 34 AJMP PROG1 ; STEP UP/DOWN W/ start PRESS
0050 017A 35 AJMP PROG2 ;READ , DISPLAY SPEED
0052 2145 36 AJMP PROG3 ;DISPLAY AVERAGE OF 4 NEW READINGS
0054 2186 37 AJMP PROG4 ; DISPLAY AVERAGE OF LAST 4 READINGS
0056 21D3 38 AJMP PROG5 ;ADVANCE TO FULL SCALE AND BACK IN 45 DEGREE STEPS
0058 21F3 39 AJMP PROG6 ; ADVANCE TO FULL SCALE AND BACK IN 90 DEGREE STEP S
005A 4107 40 AJMP PROG7 ;ALTBRNATE DISPLAY BETWEEN 3/8 AND 5/8 SCALE TEN TIMES
005C 41 PROGO:
42 This routine increases word sent at the selected step size (INCREMENT SELECT)
43 and delay time (DELAY), up to full scale, waits 500ms, then decreases the
44 word sent at the selected step size and delay times until zero scale is reached.
45
005C 5128 46 ACALL SO ; SEND OUT INCREASING WORDS
005E 5121 47 ACALL FULLSC ;SET TO FULL SCALE
0060 51A5 48 ACALL DLY500 ;WAJ:T 500ms
0062 5152 49 ACALL SOD ;SEND OUT DECREASING WORDS
0064 511B 50 ACALL ZEROSC ;RESET TO ZERO SCALE
0066 0130 51 AJMP START ;GO TO BEGINNING OF PROGRAM
0068 52 PROG1:
53
54 MlINlJAL INCREMENT/DECREMENT ROUTINE
55
56 This routine increases or decreases the sent out word, depending upon
57 the settinq of the UP/DOWN switch, by an amount set by the INCREMENT
58 SELECT switch. There is a wait of 200ms before aqain 100kinq for
59 depression of the START/COUNT button to allow time to release this
60 button and switch bounce to settle. The proqram then looks to see which
61 routine is selected and qoes to that routine.
62
0068 30B50B 63 JNB P3.5,DCX ; GO AND COUNT DOWN IF SELECTED
0068 5130 64 ACALL UP ; INCREASE WORD
0060 5185 65 DP1: ACALL SEND IT ; SEND THE WORD
006F 519D 66 ACALL DLY200 ;WAIT 200ms
0071 013D 67 AJMP W ;WAJ:T FOR COUNT BUTTON DEPRESS , SELECTED ROUTINE
0073 20B5F2 68 DCX: JB P3.5,PROG1 ;GO AND COUNT UP IF SELECTED
0076 515A 69 ACALL DOWN ; DECREASE WORD
74
75 This routine measures the period of the square wave at the TO input and
76 sends out a word that is inversely proportional to 5 times that period,
77 providing a display proportional to frequency.
78
007A 1182 79 ACALL MEAS ;MEASURE THE INPUT PERIOD
007C llC5 80 ACALL CALC ;CALCULATE THE WORD TO SEND
007E 5lB5 81 ACALL SENDIT ; SEND OUT THE WORD
0080 0140 82 AJMI? READY
0082 C28C 83 MEAS: CLR TR ;HALT TIMER
0084 C28D 84 CLR TF ; CLEAR TIMER FLAG
0086 758BOO 85 MOV RTL,jfO ;SET TIMER REGISTERS
0089 758000 86 MOV RTH,IIO
008C 758AOO 87 MOV TL,jfO ; SET TIMER
008F 758COO 88 MOV TH,IIO
0092 7BOO 89 MOV R3,jfO ; CLEAR TIMER 3RD BYTE
0094 C3 90 CLR C
0095 D28C 91 SETB TR ; START TIMER
0097 75A882 92 MOV IE,1/82H ;ENABLE TIMER INTERRUPT
009A 4021 93 W20: JC GZS ;JUMP IF R3 > OF
009C 2097FB 94 JB Pl.7,W20 ;WAIT FOR TO INPUT LOW
009F 401C 95 W21: JC GZS ; JUMP IF R3 > OF
OOAl 3097FB 96 JNB P1.7,W21 ;WAIT FOR TO INPUT HIGH
00A4 758AOO 97 NOV TL,IIO ;RESET TIMER
00A7 758COO 98 NOV TH,IIO
OOAA 7BOO 99 NOV R3,1I0
OOAC C3 100 CLR C ;CLEAR CARRY/BORROW
OOAD 4008 101 W22: JC HT ; JUMI? IF TIME UP (CARRY SET)
OOAF 2097FB 102 JB Pl.7,W22 ;WAIT FOR TO LOW
00B2 4003 103 W23: JC HT ; JUMI? IF TIME UP (CARRY SET)
00B4 3097FB 104 JNB Pl.7,W23 ;WAIT FOR TO HIGH AGAIN
00B7 C28C 105 HT: CLR TR ;HALT TIMER
00B9 75A800 106 NOV IE,I/O ;DISJlBLE ALL INTERRUPTS
OOBe 22 107 RET
OOBD 7BlF 108 GZS: NOV R3, I/lFH ; SET FOR ZERO SCALE
OOBF 22 109 RET
OOCO 7F03 110 GFS: NOV R7,1/03
00C2 7EE8 111 NOV R6,I/OE8H
OOC4 22 112 RET
00C5 113 CALC:
114
115 This subroutine calculates the'10-hit word to send as a function fo what
116 is in R3, TH , TL. The 10-bit word is developed and left in registers
117 R7 and R6 for use by SENDIT subroutine.
118
00C5 7FOO 119 NOV R7,1/0 ;INITIALIZE QUOTIENT
00C7 7EOO 120 NOV R6,1I0
00C9 C3 121 CLR C ;CLEAR CARRY/BORROW
OOCA 740F 122 MOV A,IIOFH ; CHECK FOR ZERO SCALE
OOCC 9B 123 SUBB A,R3
OOCD 5001 124 JNC NZS ; JUMP IF NOT ZERO SCALE
OOCF 22 125 RET
0000 E58A 126 NZS: MOV A,TL ; CHECK FOR FULL SCALE
0002 9488 127 SUBB A,1/88H
0004 E58C 128 MOV A;TH
0006 9413 129 SUBB A, 1/l3H
0008 ED 130 MOV A,R3
0009 9400 131 SUBB A,IO
OODB 40E3 132 JC GFS
0000 752E4C 133 NOV 2EH,I4CH ; SET DIVIDEND TO 5,000,000
OOEO 752F4B 134 NOV 2FH,I4BH
00E3 753040 135 MOV 30H,1I40H
OOE6 7COO 136 NOV R4,#0 ;CLEAR DIVIDE COUNTER
OOE8 8B2B 137 MOV 2BH,R3 ;MOVE READING TO MEMORY (DIVISOR)
oon 858C2C 138 NOV 2CH,TH
346 SUBROUTINES
347
348
02lB 7FOO 349 ZEROSC: MeV R7,#0 ;RESET METER TO ZERO SCALE
021D 7EOO 350 MeV R6, #0
021F 4125 351 AJMP RST
0221 7F03 352 FULLSC: MeV R7,#03H ;SET METER TO FULL SCALE
0223 7EFF 353 MeV R6, #OFFH
0225 5lB5 354 RST: ACALL SENDIT
0227 22 355
0228 356 So:
357
358 This subroutine sends increasing IO-bit words in registers R7 & R6 to the ACMD.
359
0228 51B5 360 ACALL SENDIT ;WRITE THE 10-BIT WORD TO ACMe
022A 5130 361 ACALL UP ; INCREASE THE WORD VALUE
022C 30E2F9 362 JNB ACC.2,SO ;JUMP IF BIT 2 NOT SET
022F 22 363 RET
0230 364 UP:
365
366 This subroutine waits for a period of time = lOms X DELAY read un, then
367 increases the 10-bit word by the INCREMENT SELECT amount.
368
0230 E590 369 MeV A,P1 ;READ DELEY
0232 F4 370 CPL A ;COMPLEMENT ACC
0233 540F 371 ANL A,#OFH ;MASK OFF UPPER 4 BITS
0235 23 372 RL A
0236 23 373 RL A
0237 F9 374 MeV R1,A
0238 B90002 375 CJNE R1,#0,D10 ; JUMP IF DELAY SET FOR ZERO
023B 8006 376 SJMP NODLY
023D 7B01 377 D10: MOV R3,#1 ;SET FOR 1 X 10ms DELAY
023F 5195 378 D10A: ACALL DLY10MS ; DELAY 10MS x DELAY
024l D9FC 379 DJNZ R1,D10A
0243 E5BO 380 NODLY: MOV A,P3 ;READ INCREMENT SELECT
0245 F4 381 CPL A ; COMPLEMENT ACC
0246 5403 382 ANL A, #3 ;MASK OFF UPPER 6 BITS
0248 23 383 RL A
0249 23 384 RL A
024A 23 385 RL A
024B 04 386 INC A
024C 2E 387 ADD A,R6 ; ADD INCREMENT TO R6
024D FE 388 MOV R6,A ;SAVE IT
024E E4 389 CLR A
024F 3F 390 ADDC A,R7 ;ADD CARRY TO R7
0250 FF 391 MOV R7,A ;SAVE IT
0251 22 392 RET
0252 393 SOD:
394
395 This subroutine sends out decreasing words at the rate set by DELAY and
396 step size determined by INCREMENT SELECT.
397
0252 5lB5 398 ACALL SENDIT ; SEND OUT THE PRESENT WORD
0254 515A 399 ACALL DOWN ; DECREASE THE WORD
0256 50FA 400 JNC SOD ;DO IT AGAIN IF CARRY NOT SET
0258 411B 401 AJMP ZEROSC
025A 402 DOWN:
403
404 Waits for 10ms x DELAY pot setting, then sends out decreasing values of words
405 in step sizes of 8 x INCREMENT SELECT + 1.
406
025A E590 407 MeV A,P1 ;READ DELAY
025C F4 408 CPL A ; COMPLEMENT ACC
025D 540F 409 ANL A,#OFH ;MASK OFF UPPER FOUR BITS
025F 23 410 RL A
0260 23 411 RL A
0261 F9 412 MOV R1,A ;SAVE DELAY
0262 B90002 413 CJNE R1,#0,D10S ;JUMP IF DELAY SET FOR ZERO
0265 8004 414 SJMP NDD
0261 5195 415 DI0S: ACALL DLYlOMS ;DELAY 10ms x (DELAY +1)
0269 D9FC 416 DoJNZ Rl,D10S
026B E5BO 417 NDD: MOV A,P3 ; READ INCREMENT SELECT
026D F4 418 CPL A ; COMPLEMENT ACC
026E 5403 419 ANL A, #3 ;MASK OFF UPPER 6 BITS
0270 23 420 RL A ;MULTIPLY BY 8
0271 23 421 RL A
0272 23 422 RL A
0273 04 423 INC A ;INSURE MINIMUM STEP
0274 C3 424 CLR C ;CLEAR CARRY FOR SUBTRACTION
0275 CE 425 XCH A,R6
0276 9E 426 SUBS A,R6 ; SUBTRACT INCREMENT FROM R6
0277 CE 427 XCH A,R6 ;SAVE IT
0278 E4 428 CLR A ;CLEAR ACCUM FOR SUBTRACTION
0279 CF 429 XCH A,R7
027A 9F 430 SUBS A,R7 ;SUBTRACT BORROW FROM R7
027B 5403 431 ANL A, #3 ; INSURE MAXIMUM WORD
027D CF 432 XCH A,R7 ;SAVE IT
027E 22 433 RET
027F 00 434 DELAY: NOP ;31>S DELAY
0280 22 435 RET
0281 436 DMSI0:
437
438 Produces a delay of lOms x the value in R3.
439 Destroys R3 and timer readings.
440
441
0281 758AFO 442 MOV TL,#LOW, (0-10000) ;LOAD TIMER FOR 10ms DELAY
0284 758CD8 443 MOV TH,#HIGH(0-10000)
0287 C28D 444 CLR TF ;CLEAR TIMER FLAG
0289 D28C 445 SETB TR ; START TIMER
028B 308DFD 446 MSI0W: oJNB TF,MSI0W ;WAIT FOR TIMER FLAG TO BE SET
028E C28D 447 CLR TF ;CLEAR TIMER FLAG
0290 DBF9 448 DoJNZ R3,MS10W ;WAIT RS x 10ms
0292 C28C 449 CLR TR ;STOP TIMER
0294 22 450 RET
451
0295 7BOl 452 DLY10MS: MOV R3, #1 ;SET R3 FOR 10ms WAIT
0297 80RB 453 SJMP DMS10 ;WAIT 10ms
454
0299 7BOA 455 DLY100: MOV R3, #10 ;SET R3 FOR lOOms WAIT
029B 80E4 456 SJMP DMS10 ;WAIT lOOms
457
029D 7B14 458 DLY200: MOV R3, #20 ;SET R3 FOR 200ms WAIT
029F 80EO 459 SJMP DMS10 ;WAIT 200ms
460
02Al 7BlE 461 DLY300: MOV R3,1130 ;SET R3 FOR 300ms WAIT
02A3 80DC 462 SJMP DMS10 ;WAIT 300ms
463
02A5 1B32 464 DLY500: MOV R3,1150 ;SET R3 FOR 500ms WAIT
02A7 80D8 465 SJMP DMS10 ;WAIT 500ms
466
02A9 51B5 461 SD200: ACALL SENDIT ; SEND THE WORD
02AB 80FO 468 SJMP DLY200 ;WAIT 200ms
469
02AD 5185 470 SD300: ACALL SEND IT ; SEND THE WORD
02AF 80FO 471 SJMP DLY300 ;WAIT 200ms
472
02Bl 5185 473 SD500: ACALL SENDIT ; SEND THE WORD
02B3 80FO 474 SJMP DLY500 ;WAIT 500ms
475
02B5 476 SENDIT:
471
478 This subroutine sends out a single word locate4d in R7 and R6.
479 Accumulator, RO and Rl are destroyed.
480
02B5 D282 481 SETB PO.2 SET CS HIGH
02B7 7902 482 MOV R1,#02 SET COUNTER FOR 2 BITS OF R7
02B9 EF 483 MOV A,R7 MOVE R7 TO A FOR SEND OUT
The small package of the 83/87C751 and service routine and elsewhere must be a case, a watchdog may take care to reset
83/87C752 microcontrollers includes two explicitly saved). The Timer I interrupt nag is the microcontroller when the limer I interrupt
hardware-implemented timers: a 16-bit cleared by setting the ClRTI bit (bit 5) of the occurs. This could be applied in application
programmable timer, and a 1O-bit fixed-rate 12CFG register. programs with a repetitive nature-the
timer. The programmable timer is available software needs to reset the timer within 1024
Note that when the 12C interface is not
for the application program, and its operation machine cycles of the last reset.
operating-SLAVEN, MASTRO, and
is similar to the timer/counter of the 80C51
MASTER bits are all O-the 12C hardware
timer in mode 2. The fixed-rate timer, limer I, In a system where something is supposed to
does not affect Timer I. The Sel and SDA
is typically employed as a watchdog timer for occur regularly-for example, an interrupt for
pins can be used as I/O pins, and the activity
the 12C port communications and is not an external event-the watchdog is designed
of these pins will not cause the timer to run,
available for other uses. to 'bite" when the hardware 'sleeps" and the
stop, or reset. Upon hardware reset of the
expected 'something" does not happen for
In applications which do not take advantage microcontroller, the SLAVEN, MASTRO, and
too long a time. The timer is allowed to run
of the 12C communications capability, the MASTER bits are all reset, so the
continuously, but when the expected event
'silicon real estate' taken by Timer I is not programmer does not have to worry about
occurs, it resets the timer back to o. When
necessarily lost-it can be used as a interaction between the SDA/SCl pins and
the timer is reset within 1024 cycles of the
fixed-rate timer by the application. This timer the timer.
last reset, the application runs normally. If the
can become useful in various cases, such as
event does not occur, the limer I interrupt
simple control applications that need a delay
service routine will be activated to take care
while doing some software activities in FIXED· RATE TIMER of the exception.
parallel, or generating a free-running The first programming example demonstrates
repetitive waveform where the exact timing is
simple fixed-rate operation. Upon reset, The second progr.amming example
not important. Another type of application is a
interrupts are enabled, and limer I is started. demonstrates the watchdog. Upon Reset, the
watchdog timer prompting the user about
A wait loop simulates the "application" TI RUN bit, ETI, and global interrupts are
unexpected operation of a system or its
program. The demonstration service routine enabled. The watchdog timer is reset and
hardware, or resetting a program that 'lost
simply sets a flag-in real life it could do restarted by the small subroutine WdRst. The
track."
something more useful, such as toggling an application is simulated by a loop of delays.
output pin. Note that the interrupt flag is Delay 1 is less than 1024 cycles, and when
cleared by setting ClRTI prior to returning WdRst is called within Delay 1 intervals, no
TIMER I IMPLEMENTATION from the service routine. Upon overflow, the Timer I interrupt occurs. This represents
Timer I is clocked once per machine cycle, timer will go on running, as the TIRUN bit is normal operation of a 'real life" application.
which is the oscillator frequency divided by still set, so the interrupts will be spaced When the delay from last reset is greater than
12. The timer operation is enabled by setting exactly 1024 clock cycles apart. If the service 1024 cycles-representing a hardware
the TIRUN bit (bit 4) in the 12CFG register. routine would toggle an output pin instead of exception-the interrupt will occur. The
Writing a 0 into the TIRUN bit will stop and setting a flag, its output would be a square service routine for the watchdog is somewhat
clear the timer. The timer is 10 bits wide, and wave with a period of 2048 cycles. For an unusual, as it does not return to the program
when it reaches the terminal count of 1024 it application that demands a "one-shot" delay location where the interrupt occurred.
carries out and sets the limer I interrupt flag. only, the service routine should clear the Instead, the operation of the microcontroller
An interrupt will occur if the Timer I interrupt TIRUN bit in order to avoid subsequent is restarted at Reset. Upon entering the
is enabled by bit ETI (bit 4) of the Interrupt interrupts. service routine, the interrupt is cleared and
Enable (IE) register, and global interrupts are
the timer is reset. Because execution does
enabled by bit EA (bit 7) of the same IE
not return to the interrupted program with a
register.
WATCHDOG TIMER RETI instruction, the interrupt pending flag is
The vector address for the Timer I interrupt is A watchdog timer mechanism is typically cleared by a call to a dummy subroutine
1B hex, and the interrupt service routine must applied in order to detect "abnormal" behavior XRETI. The program is restarte9 at Reset
start at this address. As with afl 8051 family of hardware. If the microcontroller operates in with a regular AJMP instruction. The stack
microcontrollers, only the Program Counter is a very noisy environment, there might be a pointer is explicitly reinitialized for the warm
pushed onto the stack upon interrupt (other fear of the program "running wild" as a result reset, so there is no danger of stack overflow
registers that are used both by the interrupt of extremely violent EMI interference. In such upon repeated watchdog invocations.
***************************************************************************
2
3 Timer I Fixed Rate Timer Usage
4
5 ;This program demonstrates how to activate Timer I on the 83C751 or
6 ;B3C752 microcontrollers as a fixed rate timer when the 12C port is not
7 ;used. Once activated, Timer I will generate an interrupt every 1024
8 :machine cycles. The 12C bus pins SCL and SDA may be used as open drain
9 ;outputs.
10
11
***************************************************************************
12
13 $MOD7 751
14 $Title(Timer I Fixed Rate Timer)
15 $Date (11/06/90)
16 $Debug
17
18
0020 19 Flags DATA 20h ;Flag byte
0000 20 TstFlag BIT Flags.O ;'l'imer I flag.
21
22
0000 23 ORG
0000 0120 24 AJMP Reset
25
001B 26 ORG IBh ;Timer I interrupt.
001B D200 27 Timer!: SETB TstFlag ;Set flag to indicate a Timer I interrupt.
001D D2DD 28 SETB CLRTI ;Clear Timer I to allow it to restart.
001F 32 29 RETI
30
31
0020 D2AB 32 Reset: SETB ETI ;Enable Timer I interrupt.
0022 D2AF 33 SETB EA ;Enable global interrupts.
0024 D2DC 34 SETB TIRUN ;Start Timer I .
35
0026 C200 36 Loop: CLR TstFlag ;Initialize interrupt flag.
0028 3000FD 37 Wait: JNB TstFlag,Wait ;Wait for Timer I interrupt.
002B 80F9 38 SJMP Loop
39
40 END
1 ;*******************************************************************************
2
3 Timer I Watchdog Timer Usage
4
5 ;This program demonstrates how to use Timer I on the 83C751 or 83C752
6 ;microcontrollers as a watchdog timer when the 12C port is not used.
7 ;Once started, Timer I must be cleared more often than once every 1024
8 ;machine cycles. If Timer I is allowed to overflow, a Timer I
9 ;interrupt will be generated. Thus, if global interrupts or the Timer
10 ;1 interrupt are inhibited, the watchdog function will be disabled.
11 ;Also, if the watchdog interrupt occurs during another interrupt
12 ;service, it will be delayed until an RET! (return from interrupt)
13 ;instruction is executed~ The I2C bus pins seL and SOA may be used as
14 ;open drain outputs.
15
16;*******************************************************************************
17
18 $MOD751
19 $Title(Timer I Watchdog)
20 $Date (11-06-90)
21 $Debug
22
0000 23 ORG
0000 0126 24 AJMP Reset
25
001B 26 ORG IBh ;Timer I interrupt.
001B C2AF 27 Timer1: CLR EA :Get here only if watchdog overflows.
0010 C2DC 28 CLR TIRUN ;Turn off Timer I.
001F D2DD 29 SETB CLRTI :Clear Timer I interrupt.
0021 1125 30 ACALL XRET1 ;Force interrupt pending to clear.
0023 0126 31 AJMP Reset :00 a warm start.
0025 32 32 XRET1: RET1
33
0026 758107 34 Reset: MOV SP,i7h :Initialize the stack pointer.
35
36 Note: it is important to force the stack pointer to a particular
37 starting value in this application because we may be re-starting
38 after a watchdog interrupt, with the stack in an unknown condition.
39
0029 75D800 40 MOV 12CFG,#0 ;Initialize 12CFG (set up CTO, CT1) •
002C D2DC 41 SETB T1RUN ;Enable Timer I run.
002E D2AB 42 SETB ETr ;Enable Timer I interrupt.
0030 D2AF 43 SETB EA ;Enable interrupt system.
44
45
46 ;The following is a "dummy" main program to test the watchdog timer.
47
0032 1153 48 Loop: ACALL Delay1 :Wait 901 machine cycles.
0034 114E 49 ACALL WdRst :Reset Watchdog.
0036 1153 50 ACALL Delayl :Wait 901 machine cycles.
0038 114E 51 ACALL WdRst :Reset Watchdog.
003A 1153 52 ACALL Delay1 ;Wait 901 + 4 for ACALL & prior RET.
003C 1157 53 ACALL Delay2 ;Wait 108 + 2 for ACALL.
003E 00 54 NOP ;1016
003F 00 55 NOP ;1017
0040 00 56 NOP ;1018
0041 00 57 NOP ;1019
0042 00 58 NOP ;1020
The Signetics 83C752187C752 is a converter and the multiplexer is controlled by Bit5 of port 1 is used for the RS-232
single-chip control-oriented microcontroller. It the ADCON register. communications, and in order to hook the
is an 80C51 derivative, having the same microcontroller to a terminal, a buffer (e.g.,
The repetition frequency of the PWM output
basic architecture and powerful instruction MC1488) is needed. 1imer 0 is used as the
pulses is determined by an 8-bit prescaler,
set in a small 28-pin package. As "add-on" baud rate generator, where the timer value is
programmed at register PWMP. The duty
functions to a standard microcontroller, it defined by the symbol BaudVai. The
cycle of these pulses is determined by the
offers an 12C small area network port, a programmed value will generate a 9600 baud
contents of a compare register, PWM. In
five-channel multiplexed 8-bit rate with a 16MHz crystal.
order to implement the pulse width modulator,
analog-to-digital converter (ADC), and a
the prescaler output drives an 8-bit counter.
pulse width modulation (PWM) output The The program, after initialization and sending a
When the counter value matches the
part is essentially the popular 8XC751 with message to the terminal, scans all five AID
contents of the compare (PWM) register, the
the addition of the ADC and the PWM output. channel inputs and outputs the voltage read
PWM output is set high, and when the
on the serial port, as a hexadecimal value.
counter reaches zero, the output is set low.
There are many control applications for which Circuit operation can be verified by
The counter is modulo 255, so the duty cycle
this microcontroller can provide an comparing channel voltages with the reading
generated will be the PWM contents
almost-complete, low-cost solution. The AID at the terminal. The program follows with an
multiplied by 1/255.
converter can monitor analog voltages of up infinite loop in which channel 0 of the AID
to five sources. The PWM output can be used The enclosed listing demonstrates usage of converter is read, and its value is used to
to generate an analog control voltage with the the AID converter and the PWM. In order to program the PWM. A simple verification of
addition of a simple integrator circuit. Another communicate with the outside world, the the duty cycle can be done with a voltmeter:
potential use for the PWM output is as a program sends messages on a since it acts as an integrator, its reading will
driver of power-switching circuits for DC software-driven RS-232 port. The routines for be proportional to the duty cycle. Reading of
motor speed control. sending messages via a software-controlled a voltmeter on the PWM output should be
serial port can be quite useful, and for further proportional to the channel 0 input Voltage. If
The analog-ta-digital converter has 8-bit discussion on those, please refer to the analog reference voltage AVec, which is
resolution, and the conversion takes 40 Application Note 423: "Software Driven Serial full-scale of the AID measuremen~ is set to
machine cycles. A multiplexer selects one out Communication Routines for the 83C751 and be exactly as Vec, the PWM output will track
of five input pins. The operation of the AID 83C752 Microcontrollers." channel 0 within about 20mV.
1
2
3' ;***************************************~************* *********************
4
5 87C752 AID and PWM Demonstration Program
7 This program first reads all 'five AID channels and outputs the values in
8 hexadecimal as RS-232 data. Next, the PWM output is set to reflect the
9· value on AID channel 0, and again outputs the AID value to RS-232. Note
10 that the AID value is inverted before being moved to the PWM compare
11 register in order to compensate for the inversion on the PWM output pin.
12 This process is repeated continuously ..
13
14 Thus, a voltage may be applied to ADCO (P1.0, pin 13) to vary the PWM pulse
15 width. A simple test of this function is to measure the voltage on ADCO
16 and PWM with a voltmeter. A typical voltmeter will integrate the waveform
17 on the PWM output and show a voltage within about 20mV of that on ADCO.
18
19 The RS-232 output appears on Port 1 pin 5, which must be buffered with an
20 MC1488 or perhaps a MAX232 chip prior to being connected to a terminal.
21 The transmission rate will be 9600 baud when the 87C752 is operated from
22 16MHz crystal.
23
24 ;**************************************************************************
25
26 $Title(87C752 AID and PWM Demonstration)
27 $Date(12/03/90)
28 $MOD752
29
30 :**************************************************************************
31
FF75 32 BaudVal EQU -139 ;Timer value for 9600 baud @ 16 MHz.
33 ; (one bit cell time)
34
0010 35 XmtDat DATA 10h ;Data for RS-232 transmit routine.
0012 36 BitCnt DATA 12h ;RS-232 transmit bit count.
0013 37 PWMVal DATA 13h ;Holds next value for updating the PWM.
0014 38 ADVal DATA 14h ;Holds last AID conversion result.
39
0020 40 Flags DATA 20h
0000 41 TxFlag BIT Flags.O ; Transmit-in-progress flag.
0001 42 ADFlag BIT Flags .1 ;Indicates AID conversion complete.
43
0095 44 TxD BIT P1.5 ;Port bit for RS-232 transmit.
45
46 ;**************************************************************************
47
48 Interrupt Vectors
49
0000 50 ORG 0 ;Reset vector.
0000 0135 51 AJMP Reset
52
OOOB 53 ORG OBH ;Timer 0 interrupt.
OOOB 01C5 54 AJMP TimrO ; (used as a baud rate generator)
55
002B 56 .ORG 2Bh ;A/D conversion complete interrupt.
002B 0199 57 AJMP ADInt
58
117 set by the AID interrupt service routine. AID data must be read by the
118 calling routine.
119
0086 C201 120 ADStart: CLR ADFlag ;Clear AID conversion complete flag.
0088 4428 121 ORL A,#28h ;Add control bits to channel #.
008A F5AO 122 MOV ADCON,A :Start conversion.
008C 22 123 RET
124
125
126 Method 2: This is an alternative version of the AID routine which
127 starts the conversion and then waits for it to complete before
128 returning. AID data is returned in the Ace.
129
008D 4428 130 ADConv: ORL A,#28h ;Add control bits to channel #.
008F F5AO 131 MOV ADCON,A ;Start conversion.
0091 E5AO 132 ADC1: MOV A,ADCON
0093 30E4FB 133 JNB ACC. 4, ADCl ;Wait for conversion complete.
0096 E584 134 MOV A,ADAT ;Read A/D.
0098 22 135 RET
136
137
138 ; AID interrupt service routine.
139
0099 E584 140 ADInt: MOV A,ADAT ;Read A/D data.
009B F514 141 MOV ADVal,A ;Save AID data for print routine.
009D F4 142 CPL A ;Complement the value for the PWM.
009E F513 143 MOV PWMVal, A :Set new value for PWM update.
OOAO D201 144 SETB ADFlag iTell main that new AID data is ready.
00A2 32 145 RETI
146
147
148 ; PWM interrupt service routine allows updating the PWM synchronously.
149
00A3 85138E 150 PI"iMInt: MOV PWCM,PWMVal ;Update PWM duty cycle.
OOM 32 151 RETI
152
153
154 ; Send a byte out RS-232 and wait for completion before returning.
155
00A7 11AD 156 XmtByte: ACALL RSXmt ;Send ACC to RS-232 output.
00A9 2000FD 157 JB TxFlag,$ ;Wait for transmit complete.
OOAC 22 158 RET
159
160
161 ; Begin RS-232 transmit.
162
OOAD F510 163 RSXmt: MOV XmtDat,A ;Save data to be transmitted.
OOAF 75120A 164 MOV BitCnt, #10 :Set bit count.
00B2 758CFF 165 MOV TH,#High BaudVal ;Set timer for baud rate.
00B5 758A75 166 MOV TL,#Low BaudVal
00B8 758DFF 167 MOV RTH,#High BaudVal ;Also set timer reload value.
OOBB 758B75 168 MOV RTL,#Low BaudVal
OOBE D28C 169 SETB TR ;Start timer.
OOCO C295 170 CLR .TxD ;Begin start bit.
00C2 D200 171 SETB TxFlag ;Set transmit-in-progress flag.
00C4 22 172 RET
173
174
INTRODUCTION displays. The discrete CFM LED is also lit to beyond the initial programming cost, "hidden"
This application note describes a low-cost confirm the parameter being displayed. costs also arise in the form of life-cycle code
airflow measurement device based on the maintenance and revision and lost
Pressing the TEMP pushbutton switches the
Signetics 83/87C752 microcontroller. Airflow revenue/market share due to excessive
display to temperature (in degrees C) and
measurement-detennining the volume of air time-to-market.
lights the TEMP LED. As long as the
transferred per unit time (cubic feet per pushbutton remains pressed, the temperature Traditionally, control applications have been
minute, or cfm)-is intrinsic to a variety of is displayed. When the pushbutton is programmed in assembly language to
industrial and scientific processes. released, the display reverts to the default overcome microcontroller resource and
Airflow computation depends on three pressure display. performance constraints. Now, thanks to
simultaneous physical air more powerful microcontrollers and advanced
Similarly, pressing the PSI pushbutton
measurements-velocity, pressure, and compiler technology, it is feasible to program
displays the atmospheric pressure (in pounds
temperature. This design includes circuits control applications using a High-Level
per square inch) and lights the PSI LED. The
and sensors allowing the 8XC752 to measure Language (HLL).
pressure is displayed as long as the
all three parameters. pushbutton is pressed, and the default airflow The primary benefit of using an HLL is
The design also includes seven-segment display resumes when the pushbutton is obvious-one HLL program 'statement" can
LED displays, discrete LEOs, and pushbutton released. perform the same function as many lines of
switches to allow selective display of airflow, assembly language. Furthermore, a
Finally, pressing the SET-POINT pushbutton
temperature, and pressure. Furthermore, well-written HLL program will typically be
displays the programmed airflow setpoint (in
airflow is continuously compared with a more "readable" than an assembly language
cfm) and lights the SET-POINT LED. Again,
programmer-defined setpoin!. Should the equivalent, resulting in reduced maintenance
releasing the pushbutton causes the display
measured airflow exceed the setpoint, an and revision/upgrade costs.
to revert to the default airflow measurement.
output relay is energized. In actual Of the many popular HLLs, the "C" language
application, this relay output could be used to has emerged as the major contender for
signal the setpoint violation (via lamp or audio
CONTROL PROGRAMMING IN control applications. More than other
annunciator) or otherwise control the overall languages, C gives the programmer direct
process (e.g., emergency process shutdown). "C"
While, thanks to advanced semiconductor access to, and control of, low-level hardware
01 course, the setpoint, comparison criteria resources-a requirement for detenninistic,
(greater, less than, etc.) and violation processing, hardware price/performance
continues to improve, software development real-time I/O applications. Furthermore, C is
response (relay on, relay off) are easily based on a "minimalist" philosophy in which
changed by program modification to meet technology has changed little over time.
Thus, given ever-rising costs for qualified the language performs only those functions
actual application requirements. explicitly requested by the programmer. This
personnel, software "productivity" is arguably
Referring to Figure 1, the overall operation of in decline. Indeed, for low-unit cost and/or approach is well-suited for control
the airflow device is as follows. low-volume applications, software applications, which are often characterized by
development has emerged as the major strict cost and performance requirements.
Normally the unit continuously displays the
airflow (in cfm) on the seven-segment portion of total design cost. Furthermore,
LEOs
o o o o
CFM TEMP PSI SETPOINT
o o o
Pushbutlons
8XC752 OVERVIEW streamlined architecture, the CPU core, Another virtue of the CMOS process is
The 83C752187C752 (ROM/EPROM-based) unlike 4-bit devices, includes all the basic superior tolerance to variations in Vee, a
combine the perfonnance advantages of the capabilities (such as stack, multiply requirement inherent in the targeted
B-bit 80C51 architecture with the low cost, instruction, interrupts, etc.) required to applications. The EPROM-based device
power consumption, and sizelpin count of a support HLL compilation. The CPU core also (87C752) operates over a Vee range of 4.5V
4-bit microcontroller. Therefore, the 8XC752 includes a unique Boolean processor which is to 5.5V, while the ROM-based device
is uniquely capable of bringing high well-suited for the bit-level processing and 1/0 (83C752) will operate from 4V to 6V.
processing speed and HLL programming to common to control applications.
even the most cost-sensitive applications On-Chip ROM (83C752), EPROM
such as handheld (battery driven) Low-Power CMOS and (87C752), and RAM
instruments, automotive distributed Power-Saving Operation Modes The 8XC752 integrates 2048 bytes of
processing, ·smart" appliances, and Thanks to the advanced CMOS process, the program ROM/EPROM and 64 bytes of data
sophisticated consumer electronics. 8XC752 features extremely low power RAM. This relatively small amount of memory
consumption, which helps to extend battery reflects the fact that the targeted applications,
Obviously, the 8XC752 can be used for
life in handheld applications and otherwise though they may require high-speed
cost-reduced versions of existing B-bit
reduce power supply and thennal dissipation processing, are typically characterized by
applications. The device can also replace
costs and reliability concerns. Low ACTIVE simple algorithms and data structures. High
similarly priced 4-bit devices to achieve
mode (full-speed operation) power code efficiency of the architecture means
benefits of higher performance and, most
consumption-only 11 mA typical at even this small amount of memory can
importantly, easier sIw development including 12MHz-is further complemented by two effectively support the use of C. If necessary,
the use of HLL. Indeed, the component and program-initiated power-saving operation the judicious use of assembly language can
system design costs associated with the modes-IDLE and POWER-DOWN. help bypass code size (and performance)
8XC752 are so low that it is a viable
constraints.
candidate for first-time computerization of In idle mode, CPU instruction processing
fonnerfy non-microcontroller-based designs. stops while on-chip 1/0 and RAM remain Five-Channel 8-81t AID Converter
powered. Power consumption drops to 1.5JIA Most control applications are characterized
Figure 2 shows the block diagram of the
(typical, 12MHz) until processing is restarted by the need to monitor ·real-world" (i.e.,
8XC752. Major features of the device include
by interrupt or reset. Power-down mode cuts analog) parameters. To this end, the 8XC752
the following.
power consumption further (to only 10JIA includes a medium-speed (40 clock cycle
Full-Function, High-Speed (to typical at 12MHz) by stopping both instruction conversion) 8-bit analog-to-digital (AID)
and 1/0 processing. Return to full-speed converter. Five separate input lines are
16MHz) 8OC51 CPU Core operation from power-down mode is via reset.
The popular 80C51 architecture features 8- provided along with multiplexer logic to select
and 16-bit processing and high-speed Note that power consumption can be further an input for conversion. The AID converters
execution. Most instructions execute in a cut by reducing the clock frequency as much speed, resolution, and accuracy are more
single machine cycle (the slowest instructions as application perfonnance requirements than adequate to measure temperature,
require only two cycles). Though a allow, as shown in Figure 3. pressure, and other common environmental
parameters.
r--------------- --------------------l
I ~~~ I
I I
vcc l I
=j I
vssl I
-Ii
- I
I
I
I
I I
I I
I I
I I
I I
I I
I I
I
I
I
I
12CFG 12STA TCON I
12CON IE I
THO no I
RTH RTL I
INTERRUPT, SERIAL
PORT AND TIMER BLOCKS
I
I
I
I
I
I
TIMING I
RST AND
CONTRa
I
I
I
I
I
I
I
I
I
Pl.G-Pl.7 P3.0-P3.7
Timer/Counters calculation, periodic interrupt generation, and lines, while a parallel bus often consumes
Control applications, due to their "real-time" watchdog timer. 20--30 lines and may call for extra glue logic
nature, invariably call for a variety of timing (decoder, address latch, etc.). The 8XC752
and counting capabilities. The 8XC752 meets J2C Bus 12C port allows easy connection to a wide
the need by integrating three separate The Inter-Integrated Circuit (12C) bus is a variety of compatible peripherals such as
functions-a 16-bit auto-reload counter/timer, patented serial peripheral interface. The LCD drivers, AID and D/A converters,
an 8-bit pulse width modulator (PWM) virtue of 12C is the ability to expand system consumer/telecom and special-purpose
output/timer, and a fixed-rate timer for functionality with acceptable performance and memory (e.g., EEPROM). 12C can also be
time base generation. Together, these minimum cost. Notably, the pin and used to build distributed processing systems
timing/counting resources can serve a range interconnect count is radically reduced connecting multiple 12C-compatible
of tasks, including waveform generation, compared to expansion via a typical microcontrollers.
external event counting, elapsed time microprocessor bus-12C requires only two
20 /
lB /
16
V
14 /
ICC rnA 12 / TVP ACTIVE IcC'
10
/'
L
//
/-
//
V- --
- -
-- MAX IDLE ICC"
8XC752 PIN FUNCTIONS Of the 28 pins, seven pins are allocated to Figure 4 shows the alternative uses for these
Since the BXC752 is packaged in a basic functions, including digital power (Vce, 21 lines. As shown, the mapping is quite
cost/space-saving 28-pin package DIP or Vss), analog reference (AVec, AVss). clock versatile, which maximizes the access to
PLCC). a flexible mapping of 1/0 functions to oscillator (XI. X2), and reset (RST). Thus, 21 on-chip 1/0 functions and helps ensure full
pins is required to ensure the widest possible pins, organized into three ports (5-bit port 0, pin utilization.
application coverage. 8-bit ports 1 and 3), are available for user 1/0.
AIRFLOW METER CIRCUIT Pushbutton SWitch Inputs assumed to be a negativelloing pulse train
DESCRIPTION Three push buttons select the parameter to be with less than 10% duty cycle.
Figure 5 is the schematic diagram of the displayed-temperature, pressure, or setpoint
airflow meier circuit. As shown, the eXC752 (when no button is pressed, airflow is Air Pressure Sensor
displayed). The four stales (SW1, SW2, To delermine airflow, the air velocity must be
is connecled to the following function blocks.
SW3, or no button pressed) are effectively factored by ambient pressure-for a given
Discrete and Seven-Segment LED encoded onto two port 1 input lines (taking velocity (and temperature), lowerlhigher
advantage of the capability to use port 1 lines atmospheric pressure will correspond with
DIsplay lowerlhigher airflow. The pressure sensor,
The seven-segment LEOs display the configured as AID for TTL input) as follows:
U3, outputs a voltage differential
parameter of interest (airflow, temperature, Pl.3 Pl.4 corresponding to the pressure. Amplifier U4
pressure, or setpoint). A discrete LED No button pressed HIGH HIGH conditions the pressure sensor output to the
associated with each parameler is lit when SWl (TEMP) pressed LOW HIGH range of AVss to AVec (the analog references
that parameler is being displayed. SW2 (PSI) pressed HIGH LOW for the eXC752 AID converter). The
The seven-segment LEOs are identified as SW3 (SETPOINT) pressed LOW LOW conditioned pressure sensor output is
XO.l, Xl, and Xl 0, reflecting their decimal The only impact of this encoding scheme is presenled to AID input Pl.0.
position (lenths, ones, and tens, that SW3 has a higher priority than the other To calibrale the pressure sensor, press the
respectively). Each display has eight data pushbuttons-a factor of no concem in this PSI pushbutton and adjust the gain pot (Rl)
inputs (the seven segments and a decimal simple application. SimiiarlY,latching, until the display matches the local
point) and common terminals which allow the debouncing, rollover, or other conditioning of atmospheric pressure in pounds per square
display to be enabled or blanked. The eight the pushbutton inputs is not required. inch (14.7 at sea level).
data inputs, and the four discrete LEDs, are
driven from port 3 of the eXC7S2 via Setpolnt Control Air Temperature Sensor
high-current driver U2 and current limiting This is simply a variable resistor voltage Similar to pressure, ambient temperature also
resistors RP1. divider which serves to establish an analog affects the airflow calculation. For a given air
Since all the segmenled and discrete LE Ds voltage corresponding to an airflow threshold velocity (and pressure), higherllower
share common data lines, data display must at which action is taken. It connects to a port lemperature will correspond with lower/higher
be time multiplexed. Transistors 01-04 1 AID input. airflow. Temperature sensor US outputs an
connect to separale output lines of port 0, absolule voltage corresponding to
allowing a particular seven-segment LED or
Relay Output . lemperature. Amplifier US conditions the
When an airflow setpoint violation is lemperature sensor output to the range AVss
the discrele LEDs (as a group) to be
detected, DPDT relay Kl is energized via to AVec for connection to AID input Pl.l.
individually enabled for display. This type of
Pl.S, which is configured as a TTL output,
LED multiplexing is quile common since, at a To calibrale the temperature sensor, adjust
fast enough refresh rale, the switching buffered by transistor 05.
the gain pot (RS) so that the display (while
between displays is not perceptible by the Flowmeter Input pressing the TEMP pushbutton) matches the
operator. The major benefit is the reduction of measured output of US (LM3S).
Measurement of the air velocity is via an air
I/O lines required (without multiplexing, 2e,
turbine tachometer connecled, via
rather than e, data lines would be required). Figure S summarizes the usage of the
optoisolator U7, to Pl.S, which is configured
eXC7S2 I/O lines in this application.
as a TTL input. The tachometer input is
December 1990 ns
Signetics 80C51-Based 8-Bit Microcontrollers Application Note
~
rl~_~ U2
-'-l00nF UON2585A RP1 1 I 6 '1 6 '1 6
~ 9 vss OUT1~'~A~'~'r7~~-~-,'~1~6++++++++____==L--~__~++HHHH_____L--==~__-+++++++~--,L-- CRI
~
C:w::i INI
INI OUT,~1~7j2~::~j'~5=:tttttt======~====:t~~=======i=====:tttt~~~L--r-~f'~,CFM
f16 3
OUTI 14 CR2.
~
~ INI
INI OUTI
OUTI ~1~Sj4~'~:=~'j'~3===:tt~======~=====jj~=======i======~ttl1l
f14 .' , 12 CR3 T TEMP
~
t:.:m-L INI
INI OUTI
OUTI ~1~3~6~':::=:j'~I=====::tI=======~=======jj======i========~
f1' 7 10 CR4.• PSI
~ INI OUTI~I~,-,8.......~~~9"-____~0-_ _---1I-____-+-___+ ______---' T SETPOINT
__8t-N_'
=,-P37 .!!!...,
__S_U_B__ __ ...__"_-_-_-_.____....-__.....
illilmOl ~~C~ ~ ~E.C ~i3 ~ILC ~:04
I R1812N7°OO ~~ 2N7000 2N7000
10kn ~
6 ~!
Jl
VCC Ul VCC Jl
r~87C750 - Jl
~ :~:Ll :~:
Jl
R9 RIO Jl
vcc
-.---.!.J:Y
QI1f
f.
22pF 5 Xl PaS
:::
P34 VCC
4.7kn 4.7kn
CR9 s~
-0--
TEMP
SETPOINT
SWITCIING
Jl
'f
=
RIB C3 1211Hz 10 XTAL2:: • P33 lN4148
~t
R13
IOkn 22pF C4 J~ P3.2 = P32 IOkn CR10 SW2
vee ----4..----
-0--
RST Pal • PSI
10~F 24 PWII PaD lN4148
L.~::::::::::::::::::~7~
z: POI2PO.3 TO
INTI
r"~====~
~
__J CR11 SW3
'0-- SETPOINT
lN4002 05 T02E-SV
Y
~
VOO... ~
J3 + 8 VOLTS
J3 +8VOLTS
J3 GROUNO ~
II
II-V_C_C_ _ _ _-,
U7 R12
4.7kn
'1"+_ r::.L
VOO VOO
r=U:..3_ _-" f PRESSURE U4 C8
UE i-L--J SENSOR 3 r"A""M",P.o",,2'-.-.
111+ V+ 7 loo~ FLOWMETER J21' LI----~':4-'___-'~
IJ l( ~
UT~I '
RG' OUT !--"-6_-'\jR
INPUT J2 2 -- I
I-z-J 1~.R2 J
..3;-_-+
UP+ 8 REF f-"-S__'_DOn_-,
RG2
UP-~ lkn V- 4 CR6
lN4148
1'---------'2~lllll-~_~ VREF
~!;}
I C9 U6
VREF
'---_ _
UG_'I) E- AMP-02 CR7
3 7 l00~F
VEE lool1f;,. IN+ V+ ':"
lN4148
1
f-l!
RGI 6 R7
U5 OUT
SETPOINT LM35A R4 lDOn
VREF CONTROL R51
lkn R6 REF 5
VOO 1 +VS VOUT......
2 _ _-l'60kn 8 RG2 TEMP SENSOR
_~CI2 V-~C~}
GNO 5kn
---P' ~
11f
2 III_
I 1'00~F
VEE ...
Figure 5. Schematic Diagram of the Airflow Meter Circuit
SOFTWARE DEVELOPMENT programmer, every Franklin C program transferred to the factory for custom
PROCEDURE requires an assembly language startup masking.
The airflow meter application software is routine (supplied by Franklin and, if
almost entirely written in C using a necessary, edited by the programmer)
development package from Franklin which performs basic reset initialization
and configuration operations before PROGRAM DESCRIPTION
Software. The Franklin Software C compiler Figure 7 is a flowchart of the program;
is a cross-compiler that runs on the IBM PC transferring control to the C program.
following the flowchart is the program listing.
(and compatibles) while generating code 5. The compiled object code is tested for The flowchart shows the basic processing
suitable for execution by any 8OC51-based correct operation. This can either be and flow, while the listing documents the
product, including the 8XC752. For more accomplished by using an 80C51-family details of the program's implementation.
information, contact: simulator running on the PC or by
downloading the object code to an The program consists of four interrupt-driven
Franklin Software (i.e., foreground) routines and a main
888 Saratoga Ave., #2 in-<:ircuit emulator. The simulator
approach has the virtues of low cost and program (i.e., background). The background
San Jose, CA 95129 program is entered at reset and executes
consolidation of all work on the PC at the
The process of developing a C program using cost of non-real-time operationldebug forever, interrupted periodically by the
the Franklin package (the process is similar constraints (the simulator may execute foreground interrupts. Communication
for other third-party cross-compilers) is as 100-1000 times slower than the between the background program and the
follows: microcontroller). The in-circuit emulator foreground handlers is via shared variables.
1. The program is entered/edited on the PC provides real-time operation and the The four interrupt routines are as follows.
using the programmer's preferred text additional benefit of assisting hardware
editor. • multiplex () (INT3)
design debug at somewhat higher cost.
2. The program is compiled on the PC with 6. Should program execution prove faulty Free-running Timer I generates an interrupt at
the Franklin C compiler. (known as semantic errors), retum to step approximately 1000Hz and is used to
1 until error-free operation is achieved. multiplex the seven-segment and discrete
3. Should compile errors (also known as
LED display data. In a round-robin manner, at
syntax errors) occur, they are corrected by 7. The error-free (syntax and semantic) and each interrupt, the program tums off the
retuming to step 1 until an error-free linked object code, in the form of a .HEX previously enabled display and writes data to,
compile is achieved. file, is transferred to an EPROM and enables, the next display. Finally, the
4. Before testing the compiled program, it programmer. Fitted with a suitable interrupt routine sets a pointer to the next
needs to be combined, using the adaptor, the EPROM programmer can display-at the next interrupt, that display will
Franklin-supplied linker, with any required "bum" the object file into the targeted be refreshed. Thus, each display (tens, ones,
assembly language routines. Besides EPROM-based 80C51-family device. For tenths, discrete LEOs) will be refreshed every
routines explicitly written by the ROM-based devices, the object file is fourth interrupt, which is more than fast
enough for a flicker-free display.
December 1990 n8
Signetics BOC51-Based B-Bit Microcontrollers Application Note
• read_switch () (INT6) count is cleared for possible updating by the tachometer interrupt is adjusted by removing
lollowing routine. the execution time 01 the calc_clm () handler
The PWM prescaler is configured to generate • overflow () (INT1) itself. Next, the temperature is determined
a periodic interrupt (INT6) at about 97Hz. The (AID channell), and airflow is compensated.
program counts these interrupts, and every When Timer 0 overflows (generating an Similarly, the air pressure is determined (AID
32nd interrupt sets an "Update" variable. The interrupt), the program increments the channel 0) and airflow compensated again.
main program will change the display data high-order B bits of a 24-bit variable, counting
Now that the true airflow is calculated, it is
when ~ detects that "Update" is set and clear the microseconds between tachometer
compared with the selpoint (adjusted with the
"Update" to prepare for the next display cycle. interrupts (handled by the previous routine). II
variable resistor), which is determined by
Thus, display change frequency is about this B-bit value becomes too large (i.e.,
reading AID channel 2. II the airflow is
33Hz (i.e., 33ms), which eliminates display tachometer interrupts stop), a NOFLOW
greater than the setpoint, the relay is closed.
glitches associated with pushbutton switch variable is set, which will cause the main
Otherwise, the relay is opened.
bounce. program to display an EEE out-ol-range
• calc_elm () (INTO) indicator on the seven-segment LEOs. Finally, the UPDATE flag (set by the 33Hz
read_switch () interrupt) is checked. If it is
With the interrupt handlers executing the
The air velocity turbine tachometer drives the lime to update, the data to be displayed is
low-level timing and I/O, the main program,
BXC752 INTO interrupt pin. At each interrupt, determined based on the pushbutton status
which is entered on reset and executes
the program reads Timer 0, which keeps and the state of the NOFLOW flag. The
lorever, consists of only three major steps.
track of the elapsed time (the low 16 bits of a updated display data is initialized for later
24-bit count in microseconds) between INTO The temperature/pressure compensated display on the LEOs by the multiplex ()
interrupts. The high-order 8-bit elapsed time airflow is calculated. First, the "base" clm display refresh interrupt handler.
rate, as tracked by the calc_cfm ()
rel'U,wltchO overflow()
Toch Interrupl
(INTO)
1*
this program measures the air flow through a rotary flowmeter
and displays the calculated cfm. the output of the flowmeter
tachometer is a small duty cycle pulse train with period
which is proportional to the flow. the flow is compensated
for changes in pressure and temperature to maintain
calibration. if the flow exceeds an adjustable setpoint
it energizes a 2 form c relay for user application.
*1
*1
these pragmas specify compiler command line options
*1
#pragma CODE 1* generate code *1
#pragma SYMBOLS 1* and symbols *1
#pragma PL (60) 1* 60 lines per page *1
#pragma PW (120) 1*120 eols per page *1
#pragma OT (3)
#pragma ROM (SMALL) 1* single-chip mode *1
*1
include the aXC752-specific definitions and
the standard i/o library.
*1
#include <reg752.h>
#include <stdio.h>
*1
define symbolic names for program constants
*1
#define ZERO K 2730 1* a degrees centigrade in 1/10 kelvin *1
#define ONE_TENTH_CFM 4444444L 1* 1/10 cfm in microseconds *1
#define STD TEMP 2980 1* 25 degrees centigrade in 1/10 kelvin *f
#define STD ATM 147 1* one atmosphere in 1/10 psi *1
#define LOWEST CFM Ox40 1* maximum period from meter Ox400000 *f
#define START ADCO Ox28 1* commands to start appropriate *f
#define START-ADC1 Ox29 1* aid channel conversion cycle *f
#define START-ADC2 Ox2a 1* *f
#define START-ADC3 Ox2b 1* *f
#define START-ADC4 Ox2e 1* *1
#-define ADCI OxlO 1* aid converter status flags *f
#define ADCS Ox08 1* *1
#define FREERUN OxlO 1* *1
#define SEG A Ox01 1* P3 position for display segment 'a' *f
#define CFM OxOl 1* P3 position for , cfm' led *f
#define SEG B Ox02 1* P3 position for display segment 'b' *f
#define DEGREES Ox02 1* P3 position for 'degrees' led *1
#define SEG_C Ox04 1* P3 position for display segment 'e' *I
#define PSI Ox04 1* P3 position for , psi' led *1
#define SEG D Ox08 1* P3 position for display segment 'd' *1
#define SETPOINT Ox08 1* P3 position for , setpoint' led *1
#define SEG E OxlO 1* P3 position for display segment 'e' *1
#define SEG F Ox20 1* P3 position for display segment , f' *f
#define SEG G Ox40 1* P3 position for display segment 'g' *1
#define SEG DP Ox80 1* P3 position for display decimal pt. *1
/*
define look-up table of possible seven segment display
characters. the table consists of 11 elements corresponding
to the 10 digits ('0'-'9') and error symbol ('E') that can be
displayed. Each element is defined by ANDing (I) the bit
mask for each segment (SEG A - SEG G) comprising the
character. the table contents need-to be inverted before
use to be compatible with U2 (udn2585a). for example,
'-segments[3]' specifies the segment mask to display '3'.
*/
code byte segments [ 1 =
(
SEG A SEG B SEG C SEG D SEG E SEG F /* 0 */
SEG-B SEG C /* 1 */
SEG_A SEG B SEG D SEG E /* 2 */
SEG_A SEG B SEG C SEG-D SEG G /* 3 */
SEG B SEG C SEG F SEG G /* 4 */
SEG A SEG C SEG D SEG F SEG G /* 5 */
SEG-A SEG C SEG D SEG_E SEG-F SEG-G /* 6 */
SEG:') SEG B SEG-C /* 7 */
. SEG_A SEG B SEG C SEG D SEG E SEG_F SEG G /* 8 */
SEG A SEG-B SEG C SEG D SEG F SEG-G /* 9 */
SEG A SEG D SEG E SEG F SEG G /* E */
} ;
/* define the '752 special function bits which control i/o lines.
note that i/o line (and constant) names are capitalized */
sbit RELAY Ox96; 1* active hi to turn on setpoint relay */
sbit STROBE 0 Ox80; 1* active hi to enable display status led's */
sbit STROBE-l Ox81; /* active hi to enable display cr15 (tenths) */
sbit STROB() Ox82; /* active hi to enable display cr14 (ones) */
sbit NO FLOW Ox83; /* flag set when no flow detected */
sbit STROBE 3 Ox84; /* active hi to enable display cr13 (tens) */
sbit SEL 0 - Ox93; 1* active low pushbutton inputs used to */
sbit SEL-l Ox94; 1* select the display mode */
sbit INTR Ox95; /* */
sbit UPDATE Ox97; /* flag set when time to update display */
/* define memory variables. note memory variable names are lower case */
data word cfm; /* gas flow in tenths of a cfm */
data word setpoint; 1* relay setpoint in tenths of a cfm */
data word degree_c 1* temperature in tenths centigrade */
data 1 word carr; 1* intermediate calculation value */
data w~rd psi; 1* pressure in tenths of a psi */
data byte displayO; 1* variables to hold values for the */
data byte display1; 1* displays during refresh. */
data byte display2; /* displayO=status LEDs, displayl=CR15, */
data byte display3; /* display2=CR14, display3=CR13 */
data byte disp pntr; 1* pointer to next display to enable */
data byte refresh; 1* counter determines display updates */
data byte high; /* bits 16 - 23 of flow period */
data byte middle; /* bits 8 - 15 of flow period */
data byte low; /* bits 0 - 7 of flow period */
data byte ticks; 1* incremented by timer overflow */
1*
multiplex -
use the free-running I timer to multiplex the seven-segment and
discrete leds at approx. 1000 hz.
*1
/*
read switch -
use the free running pwm prescaler to generate
interrupts at 92 hz. every 32nd interrupt set
the UPDATE flag which causes main () to sample
the pushbuttons and update the led displays.
*/
/*
overflow -
whenever timeD overflows (from Oxffff to OxOOOO)
increment the variable 'ticks' which accumulates the
highest order (16 - 23) bits of the gas flow period
in microseconds. if the variable 'ticks' is greater
than the period corresponding to a flow of < 0.1 cfm
then set the NO_FLOW flag which causes main () to
display' 00.0'
*f
f*
calc cfm -
an external interrupt (intO) generated by a tach
pulse from the flowmeter transfers the current value
of timerO into variables 'low' and 'middle', and then
resets the timers. the 'ticks' variable described
above is also copied to variable 'high', and then
reset to zero. the NO FLOW flag is cleared to
enable display by mai~ () of the calculated cfm.
*f
f*
main -
after initializing pins and variables, enter a continuous loop to ...
- calculate the airflow based on the tach, temp and pressure inputs.
- compare the airflow to th~ setpoint input, and control the relay.
- if the UPDATE flag is set (by the read switch interrupt handler),
sample the pushbuttons and update the display data.
*f
void main ()
{
RELAY 0; 1* initialize output pins *f
INTR 1;
UPDATE 1;
STROBE a 0;
STROBE 1 0;
STROBE- 2 0;
STROBE- 3 0;
NO FLOW O·
IiCFG FREERUN I; f* enable I timer to run, no i2c *f
RTL 0; f* timer a period Ox10000 u seconds *f
RTH 0;
PWMP 255; f* pwm timer interrupt at 923 hz *f
TR 1; f* enable timer a *f
ITO 1; f* INTO is edge active *f
ticks 0; f* initialize variables *f
cErn 0;
low 0;
middle 0;
high 0;
degree c 250; f* 25.0 tenths degrees c *f
psi 147; f* 14.7 tenths psi *f
carr 0;
refresh 0;
disp_pntr 0;
IE Oxab; f* enable interrupts *f
*f
main execution loop, executes forever.
*f
while (1)
{
*f
calculate base cfm rate - first create long word representing
flow rate period in microseconds. then subtract the time
overhead in servicing the routine 'calc cfm'. then divide the
period into the period for 1/10 efm, to-get flow rate in 1/10
cfm resolution.
*f
corr ~ high * Ox10000L;
carr +~ (middle * Ox100L);
carr += low;
carr -= CORRECTION;
carr ONE TENTH CFM / carr;
/*
read temperature - measure output from the LM35 sensor,
scaled by the AMP-02. the scaling results in a range
of 0 to 51.0 degrees centigrade, in 0.2 degree steps.
*/
*/
compensate cfm rate for temperature - convert temperature
into degrees kelvin, then divide it into the measured flow
rate multiplied by the calibration temperature of the flow-
meter in degrees kelvin. (nominal 25 degrees centigrade)
*/
*/
read pressure - measure output of the KPIOOA pressure trans-
ducer, scaled by the AMP 02. the scaling results in a range
of a to 25.5 psi, in 1/10 psi steps.
*/
*/
compensate cfm rate for pressure - multiply measured pres-
sure and the calculated flow rate, and then divide it by
the standard atmospheric pressure at sea-level. (nominal
14.7 psi)
corr *= psi;
carr /~ STD_ATM;
cfm = carr;
*/
read setpoint pot to obtain set point in the range of
a - 25.5 cfm in 1/10 cfm steps.
*1
*/
*/
test if UPDATE flag has been set, and if so reset flag.
*1
i f (UPDATE)
(
UPDATE 0;
*1
then test is the NO FLOW flag has been set. if so then
display '00.0' cfm
*1
i f (NO FLOW)
( -
displayO -CFM;
display1 -segments[O];
display2 -(segments[O]
display3 -segments [0];
*1
if the NO FLOW flag was not set then read the display
select pu;hbuttons, and display the appropriate data.
*1
*1
if no pushbutton is depressed then the default display is
the flow rate in cfm. if the flowrate is greater than
or equal to 30 cfrn then display the overrange message
, EEE', otherwise display the flow in ' XX.X' format.
*1
else
{
displayO -CFM;
displayl -segments [10]
display2 -segments [10]
display3 -segments [10]
*/
if the temp pushbutton (SW1) is pressed then display the air temperature.
*/
else
{
disp1ayO -DEGREES;
display1 -segments[degree c % 10];
degree c 10; /~ -
displaY2 -{segments[degree c % 10]
degree c /= 10 -
display3 -segments[degree_c % 10];
else
(
*/
if the psi pushbutton (SW2) is pressed then display the air pressure.
*/
H(SEL 1)
{ -
displayO -PSI;
displayl -segments[psi % 10];
psi /~ 10;
display2 ~ -(segments [psi % 10] SEG_DP)
psi /~ 10;
display3 ~ -segments[psi % 10] ;
*/
if the setpoint pushbutton (SW3) is pressed then display the setpoint.
*/
else
{
displayO -SETPOINT;
display1 -segments[setpoint % 10] ;
setpoint /= 10;
display2 -(segments[setpoint % 10] I SEG DP
setpoint /~ 10;
display3 -segments[setpoint % 10] ;
9XC1XX
AN431
Philips 16/32-bit microcontroller series
This Application Note is an updated version memory programmable by standard SOC51 PINOUT
of an article published earlier this year and programmer with a OO.C adaptor. During RESET or power-up the OOC is
presented at Electro '90. configured to operate in one of four modes
In addition to the on-chip peripherals the
architecture has been updated to include defined in hardware by the logic state of two
decoded, latched external interrupts, an input pins. The four modes differ primarily in
INTRODUCTION auto-DTACKN generator and control registers external address range and 110 ports
Philips 9XC 1XX 16/32 bit microcontroller for user definition of system operation. Power availability. Mode selection will depend upon
family introduces an innovative solution to consumption varies from SOmA during normal the application's memory requirements vs.
16-bit design by extending the 68000 design operation down to lOrnA for Idle Mode and the need for 110 control. Once the operating
environment to 8OC51 peripheral users. SmA for Stand-by mode. All family members mode has been established, port functions
Based upon Philips 68070 microprocessor, are available in S4-pin PLCC or SO-pin QFP and peripherals are controlled by software
the 9XC 1XX line supports the full 68000 in commercial and industrial temperature access to on-chip memory locations.
instruction set while providing up to 34K ranges.
ROM, 512 bytes RAM, 256 Bytes EEPROM,
UART, 12C bus port, two counterltimers plus NOTE: For the remainder of this article, 90C
40 quasi-bi, and bidirectional 110 lines. The refers to all family members unless otherwise
EPROM version will house 32K Bytes of stated.
2l 8 2! 13
~ ~ ~ &
MOl 2 SP1/SDA
::::~UART ~~
MOO
ALE 1
SP5/CS~~
8OC51 BUS [ RON
CONTROL
WRN
ASN
UOSN
SP6lT1l TIMER
S~/~J
§~
LOSN XCK'l I-
XCKQ] AUlCIUARY CLOCK ;
RIWN
g! OTACKN 1 SP811NIT1N
III
Ii! VSS VSS
iii HALTN SP9I1NIT2N
RESETN ~
SPID IINrr3N :::>
RESETIN 1 SP1111NIT4N Il!
MEMORY jCsROMN SP1211NITSN ~
SELECT [PSRAMN SP1311NITSN
CKOUT SPI4/INIT7N
MAIN [XTAL1 SP1511NITSN
CLOCK LXTAL2 NMI
A~
ADI AP6
~ ~ ~ ~ ~ ~ ~ ~ ~ <
8051 ADDRESS I DATA BUS
9XC1XX
AN431
Philips 16/32-bit microcontrolier series
128 K8 - - - r---------,'-
decoded by PCS3 ~
decoded by PCS2
decoded by PCS 1
decoded by PCSO
MICROCONTROLLER, Mode 0
BOCS1 peripherals \
----------- \ 512 KB
\ - - - 1.5 MB
64 KB - - .- ~"2'Z'~"2":;j'~,,"'!':'~,::;,'l':;j,d
\
o~ ~~~ ; 4ag~~~~:: 1-_-'A:!!u~x~iliaO!!Lrv!::Po~rt~_--l \ 512 KB
68000 Data Bus I--'Ge~ne~rae!l.!:p.'!'.m;;;ES!!!e.!:P.'!'ortC!---l \
Internal registers \ - -1 MB
\
\ 512KB CSRAMN asserted
\
I~ reservedl
\ - -512KB
111'1111,111,1111,11'11111,111"111111111,1111 II \ CSROMN
RAM 512 B asserted
b-....,.."".,....,...".---,.-f"" - - 128 KB
MODE 0 lower 64K for on-chip functions. Access to External access, beyond the first 128K
Microcontroller mode is used for embedded the first 34K block are directed to the on-chip address block, uses the eight, aOC51 AID
applications requiring only minimal memory ROM. The next 30K maps peripheral lines combined with either AP[1 :4] to give 2
(34K) space but extensive 110 and peripheral operation, system control registers, RAM and Mega bytes external range or AP[I] for a
interface. The three ports, the General EEPROM. The second 64K block defines the 12SK extension. The remaining AP lines act
Purpose Port, Secondary Port and Auxiliary address range for the BOC51 bus. Access to as quasi-bidirectional pins or can be enabled
Port are available for 110, peripheral functions locations $10000 to $1 FFFF follow the to provide the SOCSI bank chip selects. Data
and BOC51 bus chip selects. Each pin is synchronous BOC51 protocol supported by for external transfers outside the first 12BK is
individually definable as 1/0 or alternate ALE, WRN and RDN signals. This block can handled over the 16-bit general purpose port
function. be divided into four 16K blocks controlled by which provides a dedicated data bus. The
Auxiliary Port lines AP[1 :4] enabled as chip secondary port is still fully operational to
This provides a total of 40110 lines or 24 1/0 selects PSEN [0:3]. The 64K aOC51 address support any combination of 1/0, interrupt
lines, all on-chip peripherials plus a external block is the only available external address input and peripheral functions.
interrupts or 20110 lines, an aOC51 interface,
space. All other cycles are directed to on-chip
all of the peripherals and 4 interrupts. The Mode 1 provides the easiest upgrade path
locations.
designer not only has multiple combinations when moving from B-bit aOC51 family designs
of features available but features which are to IS-bit applications. By taking advantage of
defined by software allowing the system to be the SOC51 bus, memory can be expanded up
MODE 1 to 2 Mega bytes without significant changes
re-configured by service routines as the
MODE 1 offers a flexible option for designs to the peripheral structure. Firmware
operating environment changes.
which require only 34K of space now but may engineers can design using 68000
Mode 0 memory map divides the 12aK need up to 2 Meg for future upgrades. C-compilers in place of I NTEL assemblers.
memory into two 64K blocks reserving the
9XC1XX
AN431
Philips 16/32-bit microcontroller series
800000OO
128 KB - - - r - - - - - - - - { 2 MB
I
I 512KB
I
I - - - 1.5 MB
I
I 512KB
or 3 LIO 6~~it:~: f--",Ge",n",er",al!..!:p",u"""roosse=p",ort,-~ I
I - - 1 MB
Internal registers J
Secondary Port I 512KB CSRAMN
~: :;~: : 1 1 : : 1 1~: : 1 1 : : 1 1 : : 1 1 : : 1 1 : : ,1 1: : 1 1 : : 1 1': / asserted
- - 512 KB
1II1 IIII ~EI~RI~~II ~I~~II~ Illi 1111, III I
RAM 512B /
I~ rBServed I CSROMN
asserted
o - - On-ch"
- '-_ _ _ROM
__(34_
KB)_....1
Microprocessor, Mode 3
9XC1XX
AN431
Philips 16/32-bit microcontroller series
taking advantage of the ADD and FBC bits in UNIVERSAL ASYNCHRONOUS memory is included but the on-Chip ROM
the System Control Register to optimize holds a 32K monitor which supports line
RECEIVER TRANSMITTER
READ cycles and enable auto-DTACKN assembly, uploads and downloads from a
The UART interface follows the standard
control. When the Fast Bus Cycle bit (FBC) is host, breakpoints, single step operation and a
2681/2692 programming models and
set and DTACKN is pulled low, the minimum few other general purpose functions. The
operating modes. 8- or 7-bit characters are
number of external READ bus cycles is board operates by RS-232 serial connection
transferred at up to 19.2K baud using either a
reduced from four to three. With FBC to a PC running in terminal mode. The MCIII
two- or four-wire handshake. Independent
asserted, software transferring block data costs less than $600 and is great for initial
receiver and transmitter clocks are selected
from external memory executes about 10% software development and debugging
either from an onboard baud rate generator
faster than normal. assembly level driver routines.
or an external source via the auxiliary clock.
If DTACKN cannot be pulled low, normally the UART is initiated and controlled through a The second level of support is the 9OCDS, a
90C will insert wait states to delay the cycle dedicated memory mapped register set. full emulation system designed by Philips and
until the acknowledge is received. However, sourced and supported by third party for the
an internal acknowledge is automatically U.S. market. The system consists of a
generated after 7 clock periods when the 16-BIT COUNTER TIMERS stand-alone box with I.C.E. extension driven
ADD bit (Auto DTACKN Disable) is cleared. An on-chip 16-bit continuous timer by serial connection to a PC. Although a
The maximum access time required is 250ns increments once every 192 CPU clocks to low-level monitor is supplied with the system,
at 17.5MHz CPU. provide a reference for two t 6-bit most detailed hardware analysis will require
programmable timers operating in match, the 9OC-XRAY development software
Power Down Modes count, or event mode. Match mode generates package from BSOrrASKING, Boston. The
Two bits in the System Control Register a pulse output on the corresponding timer package includes a C-compiler,
control the main and aUXiliary oscillators to special function pin (Tl or T2). The pulse Assembler/Linker/Librarian and Microtec
enable normal, idle or stand-by operating duty cycle equals TxI($FFFF-RR) with XRAY debugger. XRAY supports C code and
mode. As expected, during normal operation duration $FFFF-RR where RR is a value Assembly level symbolic debug, real time
all chip functions are supported and the main programmed into the reload register and Tx is operation, hardware and software
oscillator is running at full speed. In IDLE the Tl (T2) reference register. At rollover and breakpoints and 2K of Trace memory. The
mode, power consumption is reduced by match conditions an interrupt is issued and a user interface is a windowed environment
driving the chip from the auxiliary clock at status bit is set. In event counter mode, when with on-screen help. The 90CDS retails for
300KHz while the main oscillator remains a programmed number of events occurs at under $6000 and the Tasking package sells
running. This maintains minimal functionality the Tl (T2) input, an interrupt is issued. An for less than $4000.
while reducing power requirements to 50mW. event is definable as +edge, -edge, ±edge or
Normal mode can be re-entered by external The most sophisticated development system,
a level change. In capture mode, each time
or internal interrupt. STAND-BY mode also the Lauterbauch TRACE 32, is available from
an event occurs, the content of the
drives the system from the aUXiliary clock but SIGNUM systems in Thousand Oaks, CA.
continuous timer is stored in the Tt (T2)
off
the main oscillator is turn to reduce power register, an interrupt is issued and a status bit
While this is the most expensive solution, it is
also the most powerful. Like the HP 64700,
consumption to 40mW. The same is set. Event mode is used to count the
functionality as IDLE mode is maintained, the TRACE 32 is actually a host system
number of events occurring during a fixed
however, to return to normal operation the which supports numerous 8-, 16- and 32-bit
time span while capture mode determines the
main oscillator must be restarted and controllers through plug-in modules. The unit
time span between twi) events.
stabilized for at least 10ms. During IDLE and recognizes multiple high level languages and
STAND-BY modes some on-Chip functionality includes a built in logic analyzer. In addition to
is maintained (i.e., RAM integrity, timer and the 90C family, the TRACE 32 also supports
DEVELOPMENT TOOLS most of Philips 80C51family and the 68070.
UART operation) and a minimal instruction
When introducing a new microcontroller the For designs using more than one controller or
set supported.
second question customers always ask (after a mixture of controlier/processor
"What's new about it?") is "What development architectures, this system provides a
tools exist?". The 90C family is supported by common data base and may be the most
INTER-INTEGRATED CIRCUIT three levels of evaluation hardware and high economical solution.
(12C) BUS level software all of which are currently
The 12C port on the 90C lamily is a two-wire available either from a third party or via During the last 6 months the 16-bit processor/
serial bus designed to support information distribution. controller market has experienced a host of
transfers between multiple elements within a new product introductions from some healthy
The simplest and least expensive hardware competition. However, in a side-by-side
system rack or desk top range. The port
support is the Microcore iii evaluation/demo comparison, the 90C 100 family wins out
operates as a master or slave transmitter or
board from Philips. This is a spin-off from the easily by providing more on-chip memory,
receiver and supports multimaster operation.
68070 Microcore I and offers the same standard instructions and more useable
When operating as a master the SCl bus features minus the VSC and video interface. features than any other product in its class.
clock drives or receives byte data at transfer The board consists of 4x6" card with sockets The best news is that even with all these
rates up to 189KHz (12C specification for 512K EPROM and RAM, an RS232 port, advantages it's still one of the lowest cost
compatibility ~ 100KHz max). The portis 12C port and 93Cl00. There is also a 16-bit products in the world.
controlled by access to memory mapped prototype area and 96 pin connector. No
registers and operates in either polled or
interrupt driven designs.
INTRODUCTION FILE TRANSFER XRAY to load all the symbolic infonnation but
The SBE 68070 has a parallel port inpul to The file to transfer should be a S-code file not to download the code to the SBE.
provide a fast way of downloading program. with no symbolic infonnation in it, i.e., it Remark: you need to link your program twice:
But unfortunately, this port is not supported should start by an SO record. This file is one to generate IEEE fonnat for XRAY, the
by the on-board monitor. transferred to the SBE via the parallel port other to generate S-code for the download.
and the decoding is done by the SBE.
So for those of you who can't afford to wait
during the serial download, here is an This program recognizes all S-records types:
implementation of a parallel link between a HINTS AND TIPS
SO: header
PC and the SBE. - Some controls lines used for the parallel
S 1 : data record with 16 bits address port are connected to the 68681 Duart. The
This implementation consists of two S2 : data record with 24 bits address 68681.h file contains a full definition of the
programs: sa : data record with 32 bits address DUART register in C. A function which
- a C program on the host PC : SP 84,S5,S6 : ignored needs these definitions has to define the
(send parallel) S7,S8,S9 : last record of the file Duart variable and the DUART_Base
- a C program on the SBE : PR The checksum at the end of each record is symbol. This is done by inserting
(parallel receive) ignored. "USE_DUART" at the beginning of each
function and by defining DUART_Base in
The program on the PC uses the parallel port
the file. This variable definition allows the C
LPn (or PRN) and can be easily modified to
COMMANDS compiler to generate the addressing mode
support another parallel port.
To download a program into the SBE : $xx(an) which is more efficient to access
The program on the SBE can be - Use a tenninal emulator on your PC to peripherals.
implemented in ROM or can be downloaded connect to the SBE and start the PR - The Parallel port of the PC is not used as a
as needed. program by issuing the command GO printer port, the control lines are driven
The following files are available on the F8BOOO. directly by the program. This program does
Signetics BBS: - Go to a dos-shell and start the SP not interfere with the XRAY hardware key
- SP.C C source code for SP program. You can supply the name of the Here is a description of how the transfer
- SP.EXE Executable file for the PC absolute file on the command line or the works: The PC controls the lines SelectN and
- PR.C C source file for the SBE program will ask for it. During the StrobeN, the SBE answers with AckN.
download, SP displays one dot for each
- PR.SRC assembler file generated S-code record transferred. 1. The PC makes sure that the parallel
by the compiler interface on the SBE is free (AckN high).
- ENTRY.SRC entry level routine for At the end, both programs stop, SP returns to
C program DOS prompt and PR ends with a breakpoint. 2. The PC sets the data on the data lines
and asserts Strobe and SelectN, StrobeN
- PR.CMD command file for the linker
is used by the hardware of the SBE to
- PR.ABS S code file for PR. C latch the data.
USING THIS PROGRAM WITH
The BBS phone number is: (800)451-6644 or XRAY 3. When the SBE has taken the data, it
(408)991-2406. You cannot use directly this program when asserts AckN.
These files are grouped under the name: XRAY is running. However, you can 4. The PC releases StrobeN and SelectN
SBEPAR.ARC download your program before starting XRAY and finally, the SBE releases AckN when
and when you load your program into XRAY, it is ready for the next data.
The S-code is starting at $F8BOOO and can you can specify the INI option which tells
be merged in the EPROMs of the SBE with
Micromon.
SelectN
SlrobeN
- The Parallel port should be disconnected - The cable between the PC and the SBE is
from the PC when the SBE is powered up: a wire to wire connection. If you are using
some voltage levels present on the cable the SBE 68070 version 1. it is not possible
may interfere with the reset sequence. to plug the connectors for the serial line
and the parallel port at the same time. The
Rule of thumb: wait until the Halt LED of the solution is to use a 2xSO pin connector for
SBE is switched off before connecting the flat cable and connect both cables on this
parallel cable. connector. (See Figure 2.)
2xSO pins
conn~or
SBE 68070
\ ,c===r ===;>(~
1
Parallel Port
I I
PortB
(to the PC)
PortA
Figure 2.
File: PRe
/*
This program is intended to be used with the SEE 68070 It allows
the transfer of S-code through the parallel port of the SBE
*/
#include "686Bl.h"
UCHAR get_byte ()
(
UCHAR data;
data ~ p _get () ;
data = atoi(data) « 4;
data I~ atoi( p_get());
return data;
main ()
{
UCHAR *address;
UCHAR data;
ULONG Addr;
int Bytecount,dl_end;
USE DUART
dl end ~ 0;
Set_busy;
Set_ack;
data = Parallel;
do
do () while (p_get () !~ '5'); 1* wait for the first SO record */
while (p_get() !~ '0');
do
data ~ p _get () ;
Bytecount ~ get_byte();
switch (data)
{case '1' :
Addr ~ get byte() « 8;
Addr +~ get_byte();
address ~ (UCHAR *)Addr;
Bytecount -= 3;
for (; Bytecount > 0; BytecQunt-- ) *address +t
break;
case '2' :
Addr get_byte();
Addr ~ (Addr « 8) + get_byte();
Addr ~ (Addr « 8) + get_byte();
address ~ (UCHAR *)Addr;
Bytecount -= 4;
for (; Bytecount > 0; BytecQunt-- ) *address ++
break;
case '3'
Addr get_byte();
Addr (Addr « 8) + get_byte();
Addr (Addr « 8) + get_byte();
Addr (Addr « 8) + get_byte();
address ~ (UCHAR *)Addr;
Bytecount -= 5;
for (; Bytecount > 0; BytecDunt-- ) *address ++
break;
Program SP
f*
This program is intented to be used as a download program
to the SBE 68070 V2. It uses the parallel port LPTl to transmit
the data.
*f
#include <conio.h>
#include <stdio.h>
#include <process.h>
void p_put(UCHAR x)
(
do () while ( ( inp(Ctrl_in) & Ox40 ) ~~ 0 ); f* make sure ACKN is high f
outp(Data_lateh,x);
Qutp(Ctrl_out,Ox09); /* Start Strobe pulse & Selectn pulse *1
do () while ( ( inp (Ctrl_in) & Ox40 ) ! ~ a ); f* Wait for ACKN f
outp(Ctrl_out,OxOO); 1* Strobe & Selectn go high */
)
outp(Ctrlout,OxOO);
i f (arge ~~ 2)
(
fichier = fopen (argv(l],flrtrl);
if (fiehier ~~ NULL)
(
printf("Unable to find file");
exit (2);
else
(do
(
printf(" File to download to the SBE -->");
i = scanf("%s",&answer);
printf ("\r\n") ;
if (i==l) fichier = fopen (answer,"rt");
p _put ( (UCHAR) i) ;
if (1 == '5') putchar('.');
);
felose (fiehier);
)
INTRODUCTION resources dictate. The external circuitry current competitive arena for laptop
With conventional microprocessor based monitors battery power, system activities and development, time-to-market and value
systems, the market was primarily concerned timed events. added features have a significant impact on
with performance, cost and features. With the the sales success of a particular product. The
Conventionally, the external circuitry is 83/B7C752 offers flexibility at a low price. the
advent of hand-held and portable computers,
comprised of a digital power management power management design requirements can
the prominent market requirements focus on
ASIC and associated components. The use be coded and configured in the controller
size, weight and battery life.
of this part increases the chip count of the PC software and One lime Programmable (OTP)
Given a mature 386SXlAT architecture that system. devices can offer a quick low-cost
provides more than adequate performance implementation of the coded scheme.
The power management system has to
for average notebook application usage, the
determine how the system resources are
design challenges for these machines revolve With these integrated functions that the
being used. The resource usage of a PC can
around developing low power systems that 83/87C752 offers, and its ability to provide a
be determined by monitoring events or
maximize battery usage. complete solution to power resource control,
activities. User activity is usually determined
this device is emerging to be the industry
The features of a notebook PC are usually by monitoring the keyboard controller for
standard for power management.
characterized as weight and battery life. The keystroke events. Keystroke events can be
heaviest component of a PC is usually the indicated by interrupts to the PC core logic or
battery and the choice of battery is dictated 10 reads to the keyboard controller location.
by the power required. Thus the performance
The power management ASIC solutions on TOPOLOGY
of the power management scheme has a
the market today, such as the Figure 1 shows a block diagram of a typical
direct bearing on both these parameters.
VADEMIINTEL82C347, VLSI VL82C312 and system implementation. It employs the
The battery life targets for notebook INTEL 80C386SL all require external analog integrated power management scheme using
machines is around 5 hours (the air commute support circuitry to completely implement the the Philips/Signetics microcontroller to handle
time from coast to coast USA). power management functions. For example, the keyboard and power management
low battery detect is implemented by the use functions. The CPU and coprocessor reside
of external comparator chains and complex, on the local bus with the system memory. A
close tolerance level detect circuitry. The cost local bus controller monitors CPU bus cycles
OVERVIEW of this external circuitry is usually a significant to see if they are memory or ISA cycles. It
Most of the power consumed by a fully proportion of the overall cost of the power also integrates the interrupt and DMA
powered PC is wasted. The hard disk spins management solution. The 83/87C752 functions. The ISA bus controller processes
constantly even though data transfers from employs an internal analog-to-digital non-system memory bus cycles. A frequency
the disk are very sporadic. PCs may sit converter (ADC). The ADC can be used to generator is used to provide the system
unattended for periods where the user is implement the battery level detection function clocks and clock multiplexing. The peripheral
distracted by a telephone call, for instance. at no extra cost and with no extra support controller integrates the communications and
circuitry. mass storage sub-system. The VGA
There are two principle challenges in
The 83/87C752 is a member of the sub-system shares the ISA bus with the
designing a power management system: the
Philips/Signetics 8051 family of high peripheral controller. The VGA controller has
ability to power down various devices without
performance 8-bit microcontrollers. These associated VGA memory.
affecting other devices on the same bus, and
ensuring full compatibility with existing processors have been optimized for
sequential real time control applications. The Figure 2 shows the microcontroller with the
operating systems and applications. external support devices. The frequency
83/B7C752 contains most of the features of
The largest user of power in a PC is the the BOC51 and has the following features: generator provides the system clocks. It must
display sub-system (3-5 Watts) followed by - 2K bytes ROM have the ability to change the frequency of
the peripherals such as the hard disk (2-4 the clocks without violating the minimum high
- 64 bytes RAM or low times for the core logic. The
Watts), the main system memory (0.5-1.5
- Single level interrupt structure Philips/Signetics microcontroller can control
Watts), and the core logic (1 Watt).
- 16 bit programmable counter/timer the speed of the system clocks via frequency
select pins on the frequency generator.
- Two B-bit and one 5-bit bi-directionallO
Frequency generators such as the
ports
INTEGRATED POWER Avasem AV9127 can change the processor
- 12C serial interface clock speed gradually and continuously
MANAGEMENT - PWM with interrupt and overflow capability without violating the minimum high or low
The conventional PC architecture needs to times.
be extended to support power management. - 5 channels of B-bit AID
Hardware needs to be added to provide - 2B-pin DIP and PLCC. The integrated controller monitors system
power-down capabilities and software needs activity via its digital input ports. It uses
to be added to support the hardware and internal timers to time the intervals between
provide DOS compatibility. The software activity. The power to the VGA and peripheral
support is usually realized in the BIOS. The FLEXIBILITY sub-systems is controlled by the digital output
hardware support can be implemented with ASIC solutions to power management offer port pins via MOSFETs.
external circuitry. This external circuitry rigid schemes which work adequately with a
manages the power resources to individual few notebook architectures, but rarely offer Battery level and Vee is monitored by the
sub-sections of the PC system as these exactly what the designer requires. With the onboard AID converter.
POWER
c--
/ COREPWR
ISAPWR
POWER
MATH
SUPPLY FETS CPU COPROCESSOR
I---
VGAPWR
f\
I LOCAL BUS I
1 1
-
POWER
FREQ LOCAL BUS MEM SYSTEM
KEYBOARD r- MANAGEMENT
GEN t--- CONTROLLER MEMORY
UNIT
I---
I REFRESH j J
K
I
B
D
A ISA BUS CONTROLLER
T
A
ISA BUS I
I I
PERIPHERAL COMBO VGA SUB-SYSTEM
~
-
~ tl 1 ADC
COREON
HDDON
FDCON
C03 §~
CX>PJ
X:::J i5'
V
-
COM1ON ;;;
• 1 COM2ON OPJ
h· V ADC
BACKUGHTON
VGAON -I """'CO
(JICO
--1 1\)3
"T1
.0 ~ VL .... co
3_.:::J
-
c r
;;
!'>
m
V ...
"I
CPUS2
CPUS1
CPU"" FREQGEN
ClK2
0
-, 0
0
....
0-'
"
'3" 83187C752
- ~ - o :::J
.. ........
FCLS1 BUSCLK
:::JO
~ !!!. FClSO
-t -,co
~~
en SUSPEND -.J
c Ocr
't> -0
~o
't>
~ 'SWSUSPEND
INTO
KBDATA _ TOTHE
:7'
C
."
'VWE DBCLK
-~~~~R
:So INT1
<> ROFSOI.
IX
~"~K t-
tD1 'RASO
L-
- _
TO THE
SYSTEM
DRAM
~ ~
,.,4'"
IIGH INTI
LOW EXTI COUNT
,".~.
'RASa_
-V
--1
»
z
~
"[
.,f:o.
w g"
0)
~
Signetics 80CS1-Based 8-Bit Microcontrollers Application Note
RESUME SWITCH
LOW KBD
ACTIVITY
3 MINS.
POWER STATE
FLOW DIAGRAM
Table 1.
SIGNAL TYPE DEVICE/PERIPHERAL
*lDBCSl LEVEL Hard Disk IDE interface chip select
*lDBSCD LEVEL Hard Disk IDE interface chip select
*VWE EDGE VGA Memory Write enable signal
*FDCS LEVEL Floppy disk digital control register
*LPTRDY LEVEL Parallel printer interface flag
*GPRD EDGE Accessory interface select
*S3C9DSBL EDGE SCSI interface chip select
*tlDSW LEVEL Notebook lid switch
EXTERNAl3
ACTIVITIES
MONITOR
H L-_ _T_IM_E_R
___ HL__C_O_~_T_~_EL_~_E_R_-,~ TO
EXTERNAL
POWER
FETS
EXTERNAl3
ACTIVITIES
MONITOR
H L -_ _ _T_IM_E_R___
H ~CLOCK
L _ _C_O_N_T_R_O_L_L_E_R_--I
TO
EXTERNAL
~~:~~
Figure 4. Intemal Power Management Elements
N-CHANNEL
VCCIN--------f------...;D S VCCOUT
~
2.2K
PWRON--------' 7"'\
~-----~---~--~~r_---NCAD
Rl
t~
Figure 5. Power Control Circuitry
F ~ REFERENCE
CLOCK
T
1
CPUSO ClK2
CPUSI cpu
CLOCK
GENERATOR
CPUS2 ClK
POWER
MANAGEMENT
UNIT
83/87C752
FCLSO
1
MASS
FCLSI STORE FDCLK
CLOCK
GENERATOR
INTERRUPT
lIMER/COUNTER
RELOAD
I
I
I
I
) liCK COUNTER
/
/
/
/
/
/
/
/
/
// YES NO RESET COUNTER
/
/
/ RELOAD TIMER
/
/
/
( DECREMENT COUNTER
I
I
I
I
I
L __
RETURN
Suspend Control lines while switched over to the controller. This minus delta V algorithm can be
During the suspend state, power is removed The 'RAS lines are all driven by a single implemented in the microcontroller software.
from all the system devi~.es except the power 'REFRESH command from the controller. The analog to digital controller can be used to
management controller and system memory. sample the NiCAD battery voltage level at
Before the system is allowed to enter the Battery Monitor regular intervals. The sample is compared
suspend state, the BIOS empties all the DMA The ADC can be used to monitor the battery against the last sample for a negative result.
holding registers, makes a copy of the CPU condition via an external resistor divider. This If the magnitude of the result is greater than
registers and stack pointer into reserved main monitor can be used to assess the condition 50mV per cell, then the charging circuit must
memory. The VGA memory is also copied of the system batteries during system use be given a command to switch off.
into main memory. Once this transaction has and while being charged.
A battery condition detector can also be
been completed, the system BIOS instructs
A simple "minus delta V" algorithm may be implemented in the microcontroller. This
the power management controller to enter the
implemented to measure the slope of the detector can be used to give an early
suspend state.
battery voltage over time. The charging curve indication of an exhausted battery. When a
At the start of the suspend state, the of Figure 8 shows the characteristic of the NiCAD cell reaches its supply capacity, the
microcontroller takes over the memory voltage across the NiCAD cells with a voltage across the cell drops rapidly, thus the
refresh. This is achieved with the use of an constant current applied. As the NiCADs system supply can only sustain the core logic
external refresh mux. The mux is switched become charged, the internal temperature of for a matter of seconds. The battery condition
over to the microcontroller refresh lines when the cells rises and thus their internal monitor should give the system and user an
REFSEL is asserted. Switchover must only resistance increases. This results in a droop early indication of this condition. This can be
be executed after the system memory of the voltage across the cells. The charging implemented by monitoring the battery
controller has performed a complete refresh current must be terminated when a droop of voltage. When a preset slope or level is
cycle (512/1024 rows). The external greater than 50mV per cell over 1 second is reached or exceeded, the controller can issue
multiplexer asserts all the individual 'CAS detected. an NMI to the core logic. The core logic can
execute a shutdown routine which saves the core logic system and peripherals demand can be restored to the next post suspend
state of the machine on the hard disk and lower and lower power as the clock speeds cycle on the detection of an activity.
preserves the integrity of the user's data. are reduced, resets are asserted and power
The FULL-ON figures are maximums, In
is removed from the device or peripheral.
reality, the processor executes sporadic
scripts and then idles in tight loops awaiting
PERFORMANCE During the suspend mode, power is 10. This means that the actual power
Table 2 shows the power performance of the completely removed from the core logic required by the system under normal
83/B7C752 in a typical notebook system. devices and peripherals, only the DRAMs conditions will be lower than that estimated in
During each power management state, the remain energized so that the system state that column of the table.
Table 2.
STATE FULL-ON POWER (W) SHUTDOWN· DOZE (W) SLEEP POWER (W) SUSPEND POWER (W)
DEVICE (MAX)
Am386SX 2.14 0.7 0.5 0
DRAM + Controller 1.7 0.6 0.4 0.025
Local bus controller 0.3 0.3 0.2 0
ISA bus controller 0.2 O.lB 0.07 0
B7C752 O.OB O.OB O.OB 0.015
BIOS ROM 0.11 0.002 0.002 0
Floppy drive 3.1 0.035 0.035 0
IDE drive 3.3 0.68 0.68 0
VGA controller 2.1 1.6 1.2 0.Q15
Keyboard controller 0.7 0.6 0.4 0
Keyboard 0.15 0.15 0.15 0
Oscillators 0.1 0.1 0.1 0
RS232 buffers 0.11 0.002 0.002 0
LCD panel 0.7 0.62 0.2 0
Backlight 1.5 1.5 0.1 0
Table 3.
'/ 2 CLK2 '/4 CLK2
FULL·ON SHUTDOWN-DOZE SLEEP SUSPEND
CPU ON ON ON OFF
DRAM ON ON ON ON
Local bus ON ON ON OFF
ISAbus ON ON OFF OFF
B7C752 ON ON ON ON
BIOS ROM ON OFF OFF OFF
Floppy ON ON OFF OFF
IDE drive ON IDLE OFF OFF
VGA ON ON ON OFF
Keyboard controller ON ON ON ON
Keyboard ON ON ON OFF
Oscillators ON ON ON OFF
RS232 buffers ON OFF OFF OFF
LCD panel ON ON OFF OFF
Backlight ON ON OFF OFF
Note that the panel and backlight are off dunng the sleep state.
OTHER INTEGRATION function. The Philips/Signetics 83/87C552 83187C552 microcontroller would have the
microcontroller is ideal for this task. The bandwidth to take on other tasks.
OPPORTUNITIES
microcontroller can implement the scanning
The 83/87C752 offers a complete power Figure 9 shows the 83/87C552 integrated as
and code generation schemes associated
management solution as described above. a power management unit and keyboard
with the keyboard function, implement the
The functionality and 10 capability of this scanner.
activity monitors, timers and power control
device can be used as a common
scheme required for power management as Other members of the Philips/Signetics family
denominator for other, larger Philips/Signetics
well as provide an integrated solution to of 8051 derivative microcontrollers can also
microcontrollers. The 83187C552 offers the
battery condition detection by exploiting the provide an integrated solution to power
same internal functionality while providing
onboard AID converters. management (see Table 4).
more integration capabilities with its
increased 10, memory and timer functions. As can be seen, the 83187C550 provides an
The PC keyboard scanner is traditionally an intermediate solution to the 83/87C552 and
An example of an integration opportunity 8051 microcontroller. The keyboard scanning 83/87C752. It has more memory and 10 than
would be to combine the keyboard scanner and code generation can be performed by an the 83187C752 and has three more ADC
function with the power management 8051 running at SMHz. A 12 or ISMHz channels.
-t..v
v IIINUS DELTA-V SCHEME
TEMP
Charging
v~----------------------------------'
~
• • FULL
1.SV/
CEU
NOMINAL
~ ____ ~1~.2~VI~C~EL~L ________
MINIMUM
U"'_+_ SHUT SYSTEM
1VICE_..
DOWN
Discharging
Figure 8. Battery Characteristics
'" o ~
00 illo ".,
~ 3"0 Ih
"0 T' ~ ()
s.~
CO -, ~
~ N
cnCO il'
Ih
C
~
= ~
rp
i§V ~,"O
:::J 0 ~
NICAO - .---J co::::
-co
:;::
§'
f:td1i'~~ ~ PON
COM2RING
!.!:!Q!£ATOR
~
Jo
~.
~
'¢l
1 AOC
I- COREON
HODON
FDCOH
COM10H
-
-- ::f- -
:::r
CO
CXlfll
X:::J
~
3 8
:0
[
ro
<ri
~ : 9'[ COM20N Ofll
-....I CO
t-I~
"T1 BACKUGHTON
.c'
c
Cil ...
ADC
"- VGAOH
- 01 CO
1\.)3
3_,:::J
JD
"T1
!;
:;.
~
9'
l .... , CPUS2
CPUS1
CPUSO FREOGEN
CLK2_
0
-
oo~
CO
......
0
~
~II
~
:0
c;
cc
~
0'
:0
~~ SUSPEND
83187C552
OR
83/87C550
FCLS1
FCLSO i
1.
BUSCLK~
--
o :::J
:::J 0
...... co
00-
-0
sg
0
a 'SWSUSPEND
INTO
KBDATA TO THE
'tl
]
C
'VWE
'PWROFF
INT1
DBCLK
REFSE
PERIPHERAL
CONTROLLER '"
g.
.. .",,"~ ~
~
iii'
I- I
~
KBD
MATRIX MUX t~ 1~0 _'RASO
'RAS,
t-.- .....
__
~
TOTHE
SYSTEM
DRAM
'RAS'
~EYBOARD1NTEGRATION
'R'~'
V »
z
»
'tl
"2-
I ~ ~:
o
W :0
0> Z
o
a;
Signelics 8OC51-Based 8-BII Mlcroconlrollers Appllcallon Nole
II
·.< ·'. · ,~· ·. ·.
~iG
BmS
•.········•..'•.••.. •. ,'•...•., '.•........... '.•.••.••.."•.,. . ....
' , ....•.'." .•.. ".•.•.•...
' '. . .,....
Summary:
This application note presents a set of software routines, to drive the I'C interface in 8xC528
type of micro controliers. A description of the I'C interface is given. Examples show how to use
these routines in PUM-51, C and assembly source code
1. INTRODUCTION
This application note describes the I'C interface of the 8xC528 JlC and gives a set of routines
in application programs to drive this interface.
Chapter 2 gives a hardware description of the bit level I'C. It gives an overview what
functions are done in hardware by the interface and the functions that should be implemented by
software. The registers described are accessible with software and control the I'C interface.
Chapter 3 gives a descriptio" of the routines that may be used by the application program. The
routines are written in such a way that the l~ interface becomes transparent to the user. The
slave program is descibed in more detail, because this routine may be adapted by the user for his
specific application.
Chapter 4 gives simple example programs that show how to use the routines in assembly, PUM
and C application programs.
References:
- The I'C-bus specification; 9398 358 10011
- 8051-based 8-bit Microcontroliers; Data Handbook IC20
- PLM51 I'C Software interface IIC51; ETV/AN89004
On page 4 the block diagram of the bit-level 12 C interface is shown. P1.6/SCl and P1.7/SDA are
the serial I/O pins. These two pins meet the 12C specification concerning the input levels and output
drive capability. Consequently, these pins have an open drain configuration.
All four modes of the 12C bus can be used:
- Master transmitter
- Master receiver
- Slave transmitter
- Slave receiver
The advantages of using the bit-level 12 C hardware compared with a full software implementation
are:
Filtering the incoming serial data and clock signals. Glitches shorter than 4 Xtal periods are
rejected.
Recognition of a START or STOP condition.
Generating an interrupt request after reception of a START condition.
Setting the Bus Busy flag when a START condition is detected.
Clearing the Bus Busy flag when a STOP condition is detected.
Recognition of a serial clock pulse on the SCl line.
latching the serial data bit on the SDA line at every rising edge on the SCl line.
Stretching the lOW period of the serial clock SCl to synchronize with external master devices.
Setting the Read Bit Finished (RBF) or Write Bit Finished (WBF) flag if an error free bit
transfer has occurred.
Setting a Clock lOW-to-HIGH (ClH) flag when a leading edge is detected on the SCl line.
Generation of serial clock pulse on SCl in master mode.
4 2 0
SlmT IS~ I 0 0 0 0 0 0 0 R
PI.7ISDA
(DSIh) SDO X
I I I I I I I
X X X X X X W
FSDA
mT DF DD
ADDRESS DE DC DB DA DB DB
SISCS R
(Dah) W
NOTES: JFSCL
I. Software can only clear this bh.
2. This bit Is read with read·modlfy·wrlte operation.
OUTPUT SFR LATCH INPUT
X - Undellned (R) or don' care (W) PI.B PI.6
R - Read access
W - Write access
.PI.BlSCl
SCI
AUTOCL
JFSCL
SmETCH
RIW
SIBil
STRETCH RBF
JFSCL CLH
= BENS
GJ: AUTOCl
~S
RIW
SlmT
R On WBF
Jl
Control of the I'C bus hardware is done via 3 Special Function Registers:
S1INT: This register contains the serial interrupt flag SI.
S1 BIT: For read this register contains the received bit SOL
For write this register contains bit SOO to be transmitted.
S1 SCS:For read this register contains status information.
For write this register is used as control register.
After reception of a START condition, the lOW period of the SCl pulse is stretched,
suspending serial transfer to allow the software to take appropriate action. This clock stretching
is ended by accessing the S1BIT register.
S1 BIT.7 contains two physical latches; the Serial Oata Output (SOO) latch for a write operation
and the filtered Serial Oata Input (SOl) latch for a read operation. SOl data is latched on the
rising edge of the filtered SCl pulse. S1 BIT.7 accesses the same physical latches as S1 SCS.7,
but S1 BIT.7 is not bit-addressable.
The auto-clock is an active HIGH SCl pulse that starts 28 Xtal periods after an access to
S1BIT. SCl remains high for 100 Xtal periods. If the SCl line is kept. lOW by any device that
wants to hold up the bus transfer, the auto-clock counter still runs for 20 Xtal periods to try to
make SCl high and then go in a wait-state. This will result in a minimum SCl HIGH time of 80
Xtal periods (51ls at f xtal = 16MHz).
The auto-clock signal will be inhibited if the SCO flag in the S1 SCS register is set to '1 '.
SCl pulses must then be generated by software. In this situation access to S1BIT may be
used to clear the SI, CLH, RBF and WBF flags.
A quick check on a successful bit transfer fromlto SOO/SOI is carried out by testing only the
RBF or WBF flag (see 2.2.3).
S1SCS.7 represents two physical latches, the Serial Oata Output (SOO) latch for write
operations and the Serial Oata Input (SOl) latch for read operations. S1SCS.7 accesses the
same physical latches as SIBIT.7, but S15CS.7 is bit addressable. However a read or write
operation of SISCS.7 does not start an auto-clock pulse, will not finish clock stretching and will
not clear flags!
S1SCS.6 represents two physical latches, the Serial Clock Output (SCO) latch for write
operations and the Serial Clock Input (SCI) latch for read operations. The output of SCO is
"OR-ed" with the auto-clock pulse. If SCO == '1' the auto-clock generation is disabled and its
output is lOW. Internal clock stretching logic and external devices then can pull the SCl line
LOW.
If the auto-clock is not used the SCl line has to be controlled by setting SCO == 'I', waiting for
ClH to become '1' and setting SCO == '0' after the specified SCl HIGH time. Oata access
should be done via SISCS.7.
S1SCS.5 is the serial Clock lOW-to-HIGH transition flag (ClH). This flag is set by a rising
edge of the filtered serial clock. ClH == '1' indicates that no devices are stretching SCl lOW,
and since the last ClH reset, a new valid data bit has been latched in SOl.
ClH can be cleared by writing '0' to 51 SCS.5 or by a read or write operation to the SI BIT
register. Clearing ClH also clears RBF and WBF. Writing a 'l'to SISCS.5 will not affect ClH.
SISCS.4 is the Bus Busy flag (BB). BB is set or cleared by hardware only. If set it indicates
that a START condition has been detected on the I'C bus. A STOP condition clears the BB-
flag.
SISCS.3 is the Read Bit Finished flag (RBF). If RBF == 1 it indicates that a serial bit has been
received and latched into SOl successfully. If during a bit transfer RBF is '0', the. cause is
indicated as follows;
- SCI == 'I' and ClH == '1'; The SCl pulse is not finished and still HIGH.
- CLH == '0'; A bus device is delaying the transfer by stretching the LOW level on the SCl
line.
- BB == '0'; A STOP-condition has been detected during the bit transfer. This should be
considered as a bus-error.
- SI == '1'; A START-condition has been detected during the bit transfer. This should be
considered as a bus-error.
RBF can be cleared by clearing CLH or by a read or write operation to the SI BIT register.
S1SCS.2 is the Write Bit Finished flag (WBF). If set it indicates that a serial bit in SOO has
been transmitted successfully. If during bit transfer WBF is '0', the following conditions may be
the cause;
- SCI == '1' and ClH == '1'; The SCl pulse is not finished and still HIGH.
- ClH == '0'; A bus device is delaying the transfer by stretching the lOW level on the SCl
line.
- BB == '0'; A STOP-condrtion has been detected during the bit transfer. This should be
considered as a bus-error.
- SI == '1'; A START-condition has been detected during the bit transfer. This should be
considered as a bus-error.
WBF can be cleared by clearing ClH or access to the SI BIT register.
S1SCS.1 is the STRetch control flag (STR). STR can be set or cleared by software only.
Setting STR enables the stretching of SCl lOW periods. Stretching will occur after a falling
edge on the filtered serial clock. This allows synchronization with the SCl clock signal of an
external master device.
If STR is cleared, no stretching of the SCl lOW period will occur after the transfer of a serial
bit.
The lOW level on the SCl line is also stretched after a START condition is received,
regardless of the STR contents. The stretching of the SCl lOW period is finished by a read or
write operation of the S1 BIT register.
! ! ! ! !
k--
~
III
SDA
I' ~ $' )1
3
seL
"
ii'
2- LOW PERIOD LOW PERIOD
III
<XI STRETCHED STRETCHED
Cil
I
,..::;I
III BB
SET
51
SET
CLH
SET
RBFORWBF
SET
BB
CLEARED
!i'
SDALATCHED
INTOSDI
> {
z
~
w
0)
i,.z
o
~
Signetics 80C51-Based 8-Bit Microcontrollers Application Note
3: I'C ROUTINES
3_1 INTRODUCTION
A set of routines is written for the I'C interiace that supports multi-master and slave operation.
The routines are placed in a library 12C_DR.L1B. If 12C_DR.L1B is linked to an application program,
only the needed object modules are linked in the output file.
The routines can be used as device driver for PUM-51, C and B051-assembly code. By using
these routines the bit-level I'C interiace is fully transparent for the user.
When using routines from this library DPH, DPL, PSW (except CY) and B are not altered.
An n-bytes data buffer is used as destination or source buffer for the bytes to be
received/transmitted and reside in DATA or IDATA memory space.
The code is written to generate the highest transfer rate on the I'C bus. At f'tal = 16Mhz this will
result in a bit rate of B7.5kbit/sec.
The following software tools from Tasking/BSO are used for program development:
- OM4142 Cross Assembler B051 for DOS: V3.0b
- OM4144 PLiM B051 Compiler for DOS: V3.0a
- OM4136 CB051 Compiler for DOS: V1.1a
- OM4129 XRAY51 debugger: V1.4c
When using these routines in a PUM application program they must be declared EXTERNAL. In
this declaration the user can specify the type returned by each procedure. All procedures (except
Init_"C and Dis_IIC) can return a BIT or BYTE, depending on the chosen EXTERNAL declaration.
The BIT or BYTE returned is '0' if the I'C was successful. If a BYTE is returned the following
check bits are available for the user:
Note that typed procedures must be called using an expression. If the result of an I'C procedure is
to be ignored, a dummy assignment must be done for a typed procedure. The examples in the
following section assume that the procedures are called from a PUM program. Examples will be
given later how to use these routines with C and assembly application programs.
3.2.1 InlUIC
Declaration:
IniUIC:
PROCEDURE (Own_Slave_Address, Slave_Sub_Address) EXTERNAL;
DECLARE (Own_Slave_Address, Slave_Sub_Address) BYTE;
END;
Description:
IniUIC must be called after RESET, before any procedure is called. The I'C interface and I'C
interrupt will be enabled. The global enable interrupt flag however will not be effected. This
should be done afterwards. Own_Slave_Address is passed to IniUIC for use as slave.
Slave_Sub_Address is the pOinter to a DATA buffer that is used for data transfer in slave
mode. When used as master in a single master system, these parameters are not used.
Example:
Declaration:
Dis_IIC:
PROCEDURE EXTERNAL;
Description:
Example:
3.2.3 IIC_TesCOevlce
Declaration:
IIC_TesCDevice:
PROCEDURE (Slave_Address) [BITIBYTE} EXTERNAL;
DECLARE (Slave_Address) BYTE;
END;
Description:
IIC_TesCDevice just sends the slave address to the 12C bus. It can be used to check the
presence of a device on the 12C bus
12C Protocol:
Example:
IIC_Error=IIC_TesCDevice(8Ch);
IF (IIC_Error) THEN
"Device not acknowledging on slave address"
ELSE
"Device acknowledges on slave address"
3.2.4 lie_Write
Declaration:
IIC_Write:
PROCEDURE (Slave_Address, Count, Source_Ptr) [BITIBYTE] EXTERNAL;
DECLARE (Slave_Address, Count, Source_Ptr) BYTE;
END;
Description:
I'C Protocol:
L =Count
D1[O .. L-1] BASED by Source_Ptr
Example:
Declaration:
Description:
L =Count
Sub =Sub_Address
D1[O .. L-1] BASED by Source_Ptr
Example:
Declaration:
IIC_Write_Sub_SW/nc:
PROCEDURE (Slave_Address, Count, Source_ptr, Sub_Address) [BITIBYTE] EXTERNAL;
DECLARE (Slave_Address, Count, Source_Ptr, Sub_Address) BYTE;
END;
Description:
Some I'C devices addressed with a sub-address do not automatically increment the sub-
address after reception of each byte. IIC_Write_Sub_SWlnc can be used for such devices the
same way as IIC_Write_Sub is used. IIC_Write_Sub_SWlnc splits up the message in smaller
messages and increments the sub-address itself.
I'C Protocol:
L =Counl
Sub =Sub_Address
D1 [O .. L-1] BASED by Source_Ptr
Example:
CALL IIC_Write_Sub_SWlnc(80h,LENGTH(Data_Buffer),.Data_Buffer,2);
Declaration:
IIC_Write_Memory:
PROCEDURE (Slave_Address, Count, Source_Plr, Sub_Address) [BITIBYTE] EXTERNAL;
DECLARE (Slave_Address, Count, Source_Plr, Sub_Address) BYTE;
END;
Description:
12C Non-Volatile Memory devices (such as PCF8582) need an additional delay after writing a
byte to it. IIC_Write_Memory can be used to write to such devices the same way
IIC_Write_Sub is used. IIC_Write_Memory splits up the message in smaller messages and
increments the sub-address itseH. After transmission of each message a delay of 40
milliseconds (fXtal = 16MHz) is inserted.
12C Protocol:
L =Count
Sub =Sub_Address
D1[0 .. L-1] BASED by Source_Ptr
Example:
Declaration:
IIC_Write_Sub_Write:
PROCEDURE (Slave_Address, Count1, Source_ptr1, Sub_Address, Count2, Source_ptr2)
[BITIBYTE) EXTERNAL;
DECLARE (Slave_Address, Count1, Source_Ptr1, Sub_Address, Count2, Source_Ptr2)
BYTE;
END;
Description:
I"C Protocol:
L =Count1
M =Count2
Sub =Sub_Address
D1[O .. L-1) BASED by Source_ptr1
D2[O .. M-1) BASED by Source_ptr2
Example:
r
The extended address (CCT-Cursor) is formed by Chapter, Rowand Column. These three
bytes are written after the sub-address (=8) followed by the actual data that will be storeQ
relative to the extended address.
*'
CALL IIC_Write_Sub_Write (22h, 3, .Chapter, 8, Data_Buf, Data_Count);
END Write_CCT_Memory;
Declaration:
IIC_Write_Sub_Read:
PROCEDURE (Slave_Address, Count1, Source_Ptr1, Sub_Address, Count2, DesCPtr2)
(BITIBYTE] EXTERNAL;
DECLARE (Slave_Address, Count1, Source_Ptr1, Sub_Address, Count2, DesCPtr2)
BYTE;
END;
Description:
L =Count1
M =Count2
Sub =Sub_Address
D1(O .. L-1] BASED by Source_Ptr1
D2(O .. M-1] BASED by Source_Ptr2
Example:
r
The extended address (CCT-Cursor) is formed by Chapter, Rowand Column. These three
byles are written after the sub-address (8). After that the actual data will be read relative to
the extended address.
*'
CALL IIC_Write_Sub_Write (22h, 3, .Chapter, 8, Data_Buf, Data_Count);
END Read_CCT_Memory;
Declaration:
IIC_Write_Com_Write:
PROCEDURE (Slave_Address, Count1, Source_Plr1, Count2, Source_Plr2) [BITIBYTE]
EXTERNAL;
DECLARE (Slave_Address, Count1, Source_Plr1, Count2, Source_ptr2) BYTE;
END;
Description:
IIC_Write_Com_Write writes two data blocks from different data buffers in one message to a
slave receiver. This procedure can be used for devices where the message consists of 2
different data blocks. Such devices are for instance LCD-drivers, where the first part of the
message consists of addressing and control information, and the second part is the data string
to be displayed.
I'C Protocol:
L =Count1
M =Count2
D1[O .. L-1] BASED by Source_Plr1
D2[O .. M-1] BASED by Source_Plr2
Example:
Declaration:
IIC_Write_Rep_Write:
PROCEDURE (Slave_Address1, Count1, Source_Ptr1, Slave_Address2, Count2, Source-ptr2)
[BITIBYTE) EXTERNAL;
DECLARE (Slave_Address1, Count1, Source-ptr1, Slave_Address2, Count2, Source_Ptr2)
BYTE;
END;
Description:
Two data strings are sent to separate slave devices, separated with a repeat START condition.
This has the advantage that the bus does not have to be released with a STOP condition
before the transfer from the second slave.
I"C Protocol:
L =Count1
M =Count2
SIvW1 =Slave_Address1
SIvW2 =Slave_Address2
D1[O .. L-1) BASED by Source_Ptr1
D2[O .. M-1) BASED by Source_Ptr2
Example:
Declaration:
"C_Write_Rep_Read:
PROCEDURE, (Slave_Address1. Count1. Source_Ptr1. Slave_Address2. Count2. Dest....Ptr2)
[BITIBYTEj EXTERNAL;
DECLARE (Slave_Address1. Count1. SOurce...,ptr1. Slave_Address2. Count2. DesCPtr2) BYTE;
END;
Description:
A data string is sent and received to/from two separate slave devices. separated with a repeat
START condition. This has the advantage that the bus does not have to be released with a
STOP condition before the transfer from the second slave.
L =Count1
M =Count2
SIvW1 =Slave_Address1
SIvW2 =Slave_Address2
D1[O .. L-1] BASED by Source_Ptr1
D2[O .. M-1j BASED by DesCPtr2
Example:
Declaration:
IIC_Read:
PROCEDURE (Slave_Address, Count, Dest_Ptr) [BITJBYTE] EXTERNAL;
DECLARE (Slave_Address, Count, DesCPtr) BYTE;
END;
Description:
IIC_Read is the most basic procedure to read a message from a slave device.
I'C Protocol:
M =Count
D2[0 .. M-1] BASED by DesCPtr
S-SlvR-A-D2[0]-A-D2[1]-A.... -A-D2[M-1]-N-P
Example:
Declaration:
"C_Read_Status:
PROCEDURE (Slave_Address, DesCPtr) [BITIBYTEj EXTERNAL;
DECLARE (Slave_Address, DesCPtr) BYTE;
END;
Description:
Several 12C devices can send a one byte status-word via the bus. IIC_Read_Status can be
used for this purpose. IIC_Read_Status works the same way as IIC_Read but the user does
not have to pass a count parameter.
12C Protocol:
Status
S-SlvR-A-Status-N-P
Example:
Declaration:
IIC_Read_Sub:
PROCEDURE (Slave_Address, Count, DesCPtr, Sub_Address) [BITIBYTE] EXTERNAL;
DECLARE (Slave_Address, Count, DesCPtr, Sub_Address) BYTE;
END;
Description:
IIC_Read_Sub reads a message from a slave device, preceeded by a write of the sub-
address. Between writing the sub-address and reading the message an 12C restart condition is
generated without releasing the bus. This prevents other masters from accessing the slave
device in between and overwriting the sub-address.
M =Count
Sub =Sub_Address
D2[D .. M-1] BASED by DesCPtr
S-SlvW-A-Sub-A-S-SlvR-D2[D]-A-D2[1]-A ....A-D2[M-1]-N-P
Example:
Declaration:
IIC_Read_Rep_Read:
PROCEDURE (Slave_Address1, Count1, DesCPtr1, Slave_Address2, Count2, Destptr2)
[BITIBYTE) EXTERNAL;
DECLARE (Slave_Address1, Count1. Dest..ptr1, Slave_Address2, Count2, DesCPtr2) BYTE;
END;
Description:
Two data strings are read from separate slave devices, separated with a repeat START
condition. This has the advantage that the bus does not have to be released with a STOP
condition before the transfer from the second slave.
L =Count1
M =Count2
SIvW1 =Slave_Address 1
SIvW2 =Slave_Address2
D1[O .. L-1) BASED by DesCPtr1
D2[O .. M-1] BASED by DesCPtr2
Example:
Declaratio n:
IIC_Read_Rep_Write:
PROCEDURE (Slave_Address1, Count1, Des,-Ptr1, Slave_Address2, Count2, Source-ptr2)
[BITIBYTE) EXTERNAL;
DECLARE (Slave_Address1, Count1, Dest-ptr1, Slave_Address2, Count2, Source_Ptr2) BYTE;
END;
Description:
A data string is received and send from/to two separate slave devices, separated with a repeat
START condition. This has the advantage that the bus does not have to be released with a
STOP condition before the transfer from the second slave.
I'C Protocol:
L =Count1
M =Count2
SIvW1 =Slave_Address1
SIvW2 =Slave_Address2
D1[O .. L-1) BASED by Dest_Ptr1
D2[O .. M-1) BASED by Source_Ptr2
Example:
There are two ways for the I'c interface to enter the slave-mode:
After an 12C interrupt the software must enter the slave-receiver mode to receive the slave
address. This address will then be compared with its own address. If there is a match either
slave-transmitter or slave-receiver mode will be entered. If no match occurs, the interrupted
program will be continued.
During transmission of a slave-address in master-mode, arbitration is lost to another master.
The interface must then switch to slave-receiver mode to check if this other master wants to
address the 8xC528 12C interface.
The slave-mode protocol is very application dependent. In this note the basic slave-receive and
slave-transmit routines are given and should be considered as examples. The user may for
instance send NO_ACK after receiving a number of bytes to Signal to the master-transmitter that a
data buffer is full. A description of the code will be given later.
Slave parameters are given with the IniUIC procedure. The passed parameters are the own-slave-
address and a source/destination-pointer to a data buffer.
Entry via MST_ENTRY happens when an arbitration error has occurred when transmitting a
slave address in master mode. Auto-clock generation will be disabled and SCL stretching enabled.
The byte will be continued to be received and can later be compared with the own slave address.
The second entry point is via an interrupt when a START condition is detected. At _PIPOA the
context of the interrupted program is stored. Next Auto-clock generation is disabled and SCL
stretching enabled. Reception of the slave address can now begin by calling RCV_SL_BY. When
the received slave-address is compared with the own-slave-address the R/W-bit is ignored. If there
is no match between the 2 addresses, a negative ACK bit is sent and the slave routine is left via
EXIT. If there was a match the R/W bit is checked to enter the slave-receiver or slave-transmitter
mode.
The slave-transmitter mode starts at NXT_TRX. After getting the byte from the data buffer via
BUF_POINT and initialising the bit counter BIT_CNT the transmission loop is entered. A bit is
written via access to S1 BIT because this will automatically reset the CLH and WBF status flags,
and also SCL stretching. Now WBF must be tested until the transmission is successful. When WBF
becomes true SCL will be stretched again. When 8 bits are sent the SOA line is released and RBF
is tested until the ACK bit is received. The ACK bit is read by reading SOl in stead of S1 BIT to
maintain SCL stretching. If ACK was false no more bytes have to be sent and the routine is left. If
another byte has to be transmitted, BUF_POINT is updated and transmission will continue.
If the slave routine is left via EXIT, the STR bit is cleared (to disable stretching on SCL edges
when the 8xC528 is not addressed as slave) and a dummy access to S1 BIT is done to finish
current SCL stretching. If the slave routine was entered via an interrupt the previous context is
restored.
94 i***************************************************** ***************
95 ;Receive byte routine
96 iOn exit, received byte in accu
97 iOn exit CY=O if STOP is detected
98 ;*****************************************************.*.************
0042: 99 RCV_SL_BY:
0042: 7A08 100 HOV BIT_CNT.f08
0044: E5D9 101 MOV A.S1BIT ;Disable stretching from START or previous ACK
0046: E4 102 CLR A
0047: 103 RCV_BIT:
0047: 30DCI0 104 JNB BB.STOP_RCV ;Test if STOP-condition is received
004A: 30DBFA 105 JNB RBF.RCV_BIT ;Wait till received bit is valid
004D: BA0105 106 CJNE BIT_CNT.'Ol.ASSEM_BIT ;Check if last bit is to be received
107
0050: A2DF 108 MOV C,SDI ;Get last bit without stopping stretching
0052: 33 109 RLC A
0053: D3 110 SETB C ;No STOP detected
0054: 22 111 RET
112
0055: 113 ASSEM_BlT:
0055: 45D9 114 ORL A,SlBlT ;Receive bit; release RBF,CLH and seL stretching
0057: 23 115 RL A
0058: DAED 116 DJNZ BlT_CNT,RCV_BIT
117
005A: 118 STOP_RCV:
005A: C3 119 CLR C ;STOP detected
005B: 22 120 RET
121
122 i***************************************************** ****************
123 ;Send ACK/NO_ACK. Value of ACK in Carry
124 ;*********************************************************************
005C: 125 SEND_ACK:
005C: 13 126 RRCA
005D: F5D9 127 MOV SlBIT,A ;carry to SDA line
005F: 30DAFD 128 JNB WBF, $ ;Test if ACK/NO_ACK is sent
0062: D2DF 129 SETB SDO iRelease SOA line
0064: 22 130 RET
131
132 ;*********************************************************************
133 iNO match between received slave-addres$ and own-slave-address
134 i***************************************************** ****************
0065: 135 NO_MATCl!:
0065: D3 136 SETB C
0066: 115C R 137 ACALL SEND_ACK
0068: 800A 138 SJMP EXIT
4. EXAMPLES
4.1 INTRODUCTION
Some examples are given how to use the I'C routines in an application program. Examples are
given for an assembly, PUM and C program.
The program displays time from the PCF8583P clock/calendar/RAM on an LCD display driven by
the PCF8577.
The example can be executed on the OM4151 I'C evaluation board.
From page 35 the listing is shown of the example program. The most important aspect when
using the I'C routines, is preparing the input parameters before the sub-routine call.
When for example the IIC_Write routine must be called, the parameters must be called in the
following order:
MOV _IIC_READ_BYTE,#SLAVE_ADR
MOV _IIC_READ_BYTE+1,#COUNT_1
MOV _IIC_READ_BYTE+2,#SOURCE_PTR_1
CALL _IIC_READ
Note that the order of defining the parameters is the same as in a PUM-call (see page 22).
An easier way to call the routines is making a macro that includes the initialising of the parameters.
The example program makes use of macros.
IIC_Read is then called in the following way:
%IIC_Read(Slave_Adr,CounC1,Source_Ptr_1);
Note that in the listing the contents of the macro are shown, in stead of the call.
Macro's for the I'C CALL's are found in 12C.MAC. This file should be included in all modules
making use of the macro's. One of the modules should also include the variable definitions needed
by the I'C routines. These are found in file VAR_DEF.ASM. If the program consists of more than 1
module, then these modules should also include EXT_VAR.ASM. This file contains the EXTRN-
definitions of the I'C routines.
When an I"C routine is called the accumulator contains status information and the CY-bit is set
if an error has occurred. The contents of the accumulator are the same as the retumed byte when
using PUM (see pg. 10).
* 18 "C:\USER\VAR_DEF.ASM"
8
•
$
"DEMO_ASM.ASM"
;Include 12C macro's
9 1 "C:\USER\I2C.MAC"
35 9 "DEMO_ASM.ASH"
00A2 10 CLOCK_ADR EQU OA2h ;Address of PCF8583
0001 11 CL_SUB_ADR EQU Olh ;Sub address for reading time
0074 12 LCD_ADR EQU 74h ;Address of PCF8577
13
14 RAMVAR SEGMENT DATA ;Segment for variables
15 USER SEGMENT CODE ;Segment for application
;program
16
17 RSEG RAMVAR
0000: R 18 STACK: DS 10 ;stack area
OOOA: 19 TlME_BUFFER:DS ;Buffer for I2C strings
OOOE: 20 LCD_BUFFER: DS 5
21
22 CSEG AT 00
0000: 020000 R 23
24
25
26 RSEG USER
27
0000: R 28 APL_START:
0000: 900073 R 29 MOV DPTR,fLCD_TAB iPointer to segment table
0003: 7581FF R 30 MOV SP,fSTACK-l ;Initialise stack
0006: 750EOO R 31 MOV LCD_BUFFER,fOO ;Control word for LCD driver
32
0009: 750022 R 33 MOV _Init_IIC_Byte ,'22h
OOOC: 75010A R 34 MOV _Init_IIC_Byte+l,fTlME_BUFFER
OOOF: 120000 R
36 ;Initialise 12C interface
0012 : E4 37 CLR A ;Prepare buffer for clock into
0013: F50A R 38 MOV TlME_BUFFER,A
0015: F50B R 39 MeV TIME_BUFFER+l,A
40
0017: 7500A2 R 41 MOV _IIC_Write_Byte ,fCLOCK_ADR
001A: 750102 R 42 MOV _IIC_Write_Byte+l,f2
001D: 75020A R 43 MOV _IIc_write_Byte+2,'TlME_BUFFER
0020: 120000 R 44 LCALL _IIC_write
45 ;Initia1ise clock
46
0023: 47 REPEAT:
0023: 7500A2 R 48 MOV _IIC_Read_Sub_Byte ,*CLOCK_ADR
0026: 750104 R 49 MOV _IIC_Read_Sub_Byte+1,f4
0029: 75020A R SO MOV _IIC_Read_Sub_Byte+2,fTlME_BUFFER
002C: 750301 R 51 MOV _IIC_Read_sub_Byte+3,*CL_SUB_ADR
002F: 120000 R 52 LCALL _IIC_Read_Sub
53 ;Read time
54
55 iTime has been read. Order: hundreds of sec's, sec's, min's and hr's
0032: E50D R 56 MOV A,TlME_BUFFER+3 ;Mask of hour counter
0034: 543F 57 ANL A,t3Fh
0036: F50D R 58 MOV TlME_BUFFER+3,A
59
0038: 120054 R 60 CALL CONVERT ;convert time data to LCD
;seqrnent data
61
62 ;Check if dot has to be switched on
003B: 431101 R 63 ORL LCD_BUFFER+3,f01h
64 iI£ lsb of seconds is '0', then switch on dp
003E: E50B R 65 MOV A,TlME_BUFFER+1 ;Get seconds
0040: 13 66 RRC A
0041: 4003 67 JC PROCEED
0043: 430F01 R 68 ORL LCD_BUFFER+1,f01 ;Switch on dp
69
70 ;Display new time
0046: 71 PROCEED:
0046: 750074 R 72 MOV _IIC_Write_Byte ,fLCD_ADR
0049: 750105 R 73 MOV _IIC_Write_Byte+1,f5
004C: 75020E R 74 MOV _IIC_Write_Byte+2,fLCD_BUFFER
004F: 120000 R 75 LCALL _IIC_Write
76
0052: 80CF 77 SJMP REPEAT iRead new time
78
79
80 ;CONVERT converts BCD data of time to segment- data
0054: 780F R 81 CONVERT:MOV RO,fLCD_BUFFER+1 ;RO is pOinter
0056: E50D R 82 MOV A,TIME_BUFFER+3 ;Get hours
0058: C4 83 SWAP A ;swap nibbles
0059: 12006D R 84 CALL LCD_DATA ;Convert la's of hours
005c: E50D R 85 MOV A,TIME_BUFFER+3
005E: 12006D R 86 CALL LCD_DATA ;Convert hours
0061: E50C R 87 MeV A,TlME_BUFFER+2 ;Get minutes
0063: C4 88 SWAP A
0064: 12006D R 89 CALL LCD_DATA iConvert 10's of minutes
0067: E50C R 90 MOV A,TlME_BUFFER+2
0069: 12006D R 91 CALL LCD_DATA ;Convert minutes
'; ,...,~
:::.:€:-: 22 92 RET
93
94 ;LCD_DATA gets data from segment table and stores i t in L::J BUFFER
esc:':: 95 LCD _DATA:
-
C86;): 540F 96 ANL A,*OFH ;Mask off LS-nibble
006F: 93 97 MOVC A,@A+DPTR ;Get segment data
0070: F6 9B MOV @RO,A iSave segment data
Oe7l : OB 99 INC RO
eC~2: 22 100 RET
101
102 iConversion table for LCD
08,3: 103 LCD TAB:
00,3: FC60DA 104 DB OFCH,60H,ODAH ;' 0' ,'1' ,'2'
::'.0'"76 : F266B6 105 DB OF2H,66H,OB6H i' 3' ,'4' ,'5'
O~790: 3EEOFE 106 DB 3EH,OEOH,OFEH i' 6' , , 7' ,'S'
0C7(;: £6 10i DB OE6H ;' 9'
lOS
C~-:-:;: 109 END
The listing from pg. 39 shows the listing of the clock program in PUM-S1. The.procedures are
untyped. The routines are used the same way as in the examples of chapter 3.2
$OPTIMIZE (4 )
$DEBUG
$CODE
DemoJ'lm: Do;
1* External declarations *1
Clock: Do;
1* Variable and constant declarations */
Call Init_IIC(22h,.Time_BUffer);
LCD_Buffer (0)=0; f* LCD control word *f
Time_Buffer (0)=0;
Time_Buffer (1) =0;
Call IIC Write (Clock_Adr, 2, .Time_BUffer); f* Initialise clock *f
End Clock;
End Demo-plm;
On page 42 an example of a C program is shown using the 12C routines. Function prototypes
are found in header file "i2c.h". In this example the function prototypes are written in such a way
that no value is returned by the function. If the STATUS byte is needed, the header file may be
changed to return a byte.
Note that the function calls are written in upper-case. This is due to the fact that the used version
of the assembler/linker is case sensitive.
~i~c!~de <C:\USER\i2c.h>
veid maine)
IIC READ_SOB(ClocK_Adr,4,&Time_Buffer,Cl_Sub_Adr);
1* Get time */
LCC_Ptr = &LCD_Buffer[l]; /* Initialise pointers */
Time_Ptr = &Time_Buffer[3];
Tab_Ptr = (LCD_Tab+(*Time_Ptr » 4)); /* lO-HR's */
* (LCD_Ptr++) = *Tab_ptri
Tab_ptr = (LCD_Tab+ (* (Time_Ptr--) & OxOF)); /* HR's */
* (LCD_Ptr++) = *Tab_ptri
Tab_ptr = (LCD_Tab+(*Time_ptr » 4)); /* 10-MIN's */
* (LCD_Ptr++) = (*Tab_ptr I OxOl); /* dp */
Tab_Ptr = (LCD_Tab+(*Time_ptr & OxOF)); /* MIN's */
*LCD_ptr = *Tab_ptr;
Time_ptr = &Time_Buffer[l]; /* CheCK sec's for blinking */
LCD_ptr = &LCD_Buffer[l];
if «*Time_ptr & OxOl»O)
*LCD_ptr = (*LCD_Ptr I OxOl);
IIC_WRITE(LCD_Adr,5,&LCD_Buffer); /* Display time */
5: CONTENTS OF DISK
1: \USER
This directory contains the files that may be used in the user program.
12C_DR.LlB Library with fc routines.
12C.H Header file for C applications.
12C.MAC Macro's for the 12C routine calls in assembly programs.
VAR_DEF.ASM Include file with variable definitions for assembly programs.
EXT_VAR.ASM Include file with external definitions for assembly programs.
LlB.BAT Example batch file to create 12C_DR.LlB.
ASM.BAT Examplebatch file to assemble source modules for library.
2: \EXAMPLE
This directory contains the source files of the examples described in chapter 4.
DEMO_ASM.* Assembly example.
DEMO_PLM.* PUM example.
HEAD_51.SRC Example of environment file for PUM example.
DEMO_C.* C example.
CSTART.ASM Example of environment file for C example.
3: \SOURCE
This directory contains the source files of the modules in the library .
~/x .........•.•••
1. ·····0····
)} j\:\/: \{ .:.:.
Purchase of PhilipS' 12C components conveys a license under the
liIas
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
• • • •
Philips' 12C patent to use the components In the 12C-system
provided the system conforms to the 12C specifications defined by Philips,
(SCM) 87C751
AN442
Specification for a bus-controlled monitor
SUMMARY The system can perform the following: • Both Horizontal and Vertical outputs have
BCM87C751 is a powerful, flexible and low - Determine the mode and standard of F-to-V converter DAC outputs
cost Digital Controlled Monitor System, based incoming signals with the stored values in
on the 87C751 microcontroller. It employs 12C memory (e.g. multisync modes). • Four outputs of Horizontal PLL capacitor
bus control with various 12C bus controlled - Enter parameters of user defined modes selection signal. This can be easily adapted
peripherals (PCF8582EP-EEPROM and into memory via a keyboard. for further extension.
TDA8444 D/A conterter). The control function· - Control analog parameters such as
is implemented via 8 6-bit DC voltage output contrast and brightness via the bus from
from TDA8444. keyboard inputs. IC DESCRIPTIONS
Some features of the system: - Control mode and standard parameters 87C751
(such as picture geometry parameters and A derivative of the 8051 family of
• Flexible approach, especially for multi sync
the free-running oscilltor frequency). microcontrollers, the 87C751 has an 8-bit
or auto sync operation
CPU, 2K bytes EPROM, 64 bytes RAM, 19
• Mode detection and frequency Features I/O lines, a bi-directional inter-integrated
measurements by microprooessor • Multisync or Autosync operation circuit (12C) serial bus interface, and an
• Mode switching under software control - FH = 31kHz-95kHz on-chip oscillator.
VIDEO PREAMP.
TDA48IIO
DAC
TDA8444
VERTICAL
DEFLECTION
TDA4800
87C751
"CII().
CONTROLLER
(SCM) 87C751
AN442
Specification for a bus-controlled monitor
OPERATION INSTRUCTION Each number denotes one mode. Modes 10 mode. If the user forgets to press the Reload
through 19 are user modes, which can be key again, the flashing of the mode display
Function Selection and Change defined by the user. When there is a new will last for 2 minutes, then the program will
When the monitor is powered on it will mode entering the monitor that does not cancel the copy old mode to new user mode
automatically enter the corresponding mode belong to any mode stored n the EEPROM, command.
depending on the input signal. Different the mode display will show "19". If the user
During the flash period, the program still
configurations and functions can be defined presses the Reload key while the mode
monitors the Horizontal and Vertical sync
by users with the use of different features. display is "19", the display will flash. When
signal to adapt the DAC to the proper mode.
The following configuration's functions are the mode display is flashing, the user can
For example, while the user tries to copy new
examples for user's reference. See Figure 2 select the destination mode by pressing the
mode 13 to mode IS, and the mode display
for Configurations 1 through 4. Up/Down keys. The destination mode is
13 (15) is flashing, if the PC sends out a
between 10 and 19.
To adjust functions such as V-size, V-shift, signal for mode 3, the program will change
H-center, H-shift, and PCC (Pincushion Every press of the Up key causes the the DAC output to adjust the monitor to work
Correction Circuitry): flashing display to add one, unless it already in mode 3, but the mode cisplay is still
1. The "Function" key should be pressed reached 19. Every press of the Down key flashing on user mode 13 (15) and the store
until the required function LED is lit. causes the flashing display to subtract one, procedure is still going on until the user
unless is has reached 10. When the user lets presses the Reload key again, or terminates
2. If the V-shift LED is on, the user can then the copy procedure after the 2 minutes time
the destination mode flash on the display, the
adjust V-shift by pressing Up or Down
user can press the Relead key to store the out. The mode display then shows 3.
key. If the Up key is pressed, the V-shift
new mode to destination mode. When the
DAC output will increase one step. While NOTE: Upon request, we can also program in
mode display stops flashing, the new mode is
the Down key is pressed, the V-shift DAC advance those 10 user-defined modes that
stored. The newly stored destination mode is
output will decrease one step. The user can still be changed by the user if necessary
permanent, unless the user repeats the entire
can repeat the Up or Down key simply by for further extension.
procedure.
pressing it longer than 0.5 second. It will
For Configuration 5 to Configuration 8, see
then automatically repeat approximately 2 To change an old user mode, already stored
Figure 3.
times per second until the key is released. in EEPROM, to a different user mode, press
the Reload key for longer than 8 seconds To adjust functions, the user can simply press
Mode Selection and Change while the monitor is working in the old mode. the corresponding push button. The upper
(See Figure 4) The mode display will flash the old mode, push button will increase the DAC output
then the user can use the Up/Down key to The lower push button will decrease the DAC
In Figures 3 and 4. the mode number is select the new mode. Press the Reload key output. (A total of 64 steps can be
displayed on the two seven-segment LEDs. again to copy the old to new destination user programmed in advance.)
CONFlGURAllON 1
[m[m
l', 0,
[Q]
FUNCllON
[Q] [Q]
UP DOWN
@
RELOAD
,I,
1.
,I,
2.
,I,
-0- -0- -0- -0- -0-
'1' '1' '1'
3-
( FUNCllON)
,I,
'1'
4.
,I,
'1'
5.
CONFlGURAllON 3
[m[m
LI, LI,
[Q]
FUNCll0N
[Q] [Q]
UP DOWN
@
RELOAD
,I,
1.
,I,
-0- -0- -0- -0-
'1' '1'
2.
,I,
'1'
3-
(FUNCll0N)
,I,
'1'
4-
(SCM) 87C751
AN442
Specification for a bus-controlled monitor
[Q]
Y-SIZE
[Q]
Y-SHIFT
[Q]
[Q]
H-CENTER
[Q]
Y-SiZE
[Q]
Y-SIIFT
[Q]
PIN
[Q]
18
19
(SCM) 87C751
AN442
Specification for a bus-controlled monitor
y'
KEY PRESSED
D.SSECOND
n OUT
(BCM) 87C751
AN442
Specification for a bus-controlled monitor'
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
y N
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
Table 1.
ADD DIODE REMOVE DIODE
01 Indirect ratio of veo output Direct ratio of veo output
(JP4)-See Figure 8. (JP4)-See Figure 8.
02 10 user modes 1 user mode
10 factory modes 19 factory modes
(JP5) (JP5)
03 4 adjustable functions 5 adjustable functions
(JP6) (JP6)
D4 Multiple Up/Down keys Single Up/Down keys
(JP7) (JP7)
Referring to previous section, Function program procedure. II they are not equal, the
Selection and Change, software can detect software will program the EEPROM. This
the hardware configuration by pulling 87C751 means that monitor makers can define their
miaocontroller pin PO.2 LOW to read the own ladory modes by programming the
diode arrangement. Each diode denotes one EEPROM in advance.
change in the hardware configuration. Table 1
The following programs are endless loops.
explains the usage of each diode.
Please refer to the main flow chart (Figure 5).
After the configuration detection, then it goes There are three tasks in the endless loop.
to check EEPROM status. If the EEPROM is
The first task is Function Selection, basically
blank, the program win start to move all
a keyboard process program.
factory set data from the microcontroller's
PROM to EEPROM. The last byte datum in The second task is Mode Detection, which
the miaocontroller's PROM is 66 used for includes search mode and change mode.
blank check. First it reads address DO in the
The third task is Mode and Fucnlion Display,
EEPROM, then compares it with 66. If they
which includes flash mode display.
are equal, the software will skip the EEPROM
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
Mode Detection the outcome is the same, then this test block user can use the RELOAD key to save the
Beginning with branch "B", Mode Detection will branch to set up a new user mode (19), new user mode to other user mode (modes
Flow Chart (Figure 7), the block at the top of as per the 4 steps indicated in the central 10 through 18).
the flow chart is "Read Previous Mode" (the flow chart Ii ne.
If the configuration for 10 user modes is
time before 0.5 second ago) and includes The first step in setting up a new user mode selected, it is highly recommended that you
Horizontal Sync Frequency, Vertical Sync is to "Put New Parameters" (such as save new user mode to other user mode
Frequency, Horizontal Sync Polarity, and Horizontal Sync Frequency, Vertical Sync (10-18) because the last mode "mode 19",
Vertical Sync Polarity. The second block is a Frequency, Horizontal Sync Polarity, and will be overwritten by any new user mode
comparison test block. When current mode Vertical Sync Polarity) into the EEPROM. The whenever a new user mode is detected, after
(from 0.5 second ago until now) parameters new mode parameters are always saved in new user mode parameters are detected.
are the same as those in previous mode, the the last mode address. If the configuration
program will branch to the right test block. The second step in setting up a new user
allowing 10 user modes is selected, then
Since the mode is not changed, the second mode is "Calculating VCO Output Value" (see
diode 2 is added. If one was found to be the
test block in the right part of the flow chart will Figure 8). There are two different curves for
same, the program will branch to the right
branch to leave the Mode Detection section. the designer to select. If diode 1 is removed,
test block. If it then finds that there is a mode
the VCO Output Voltage will be in direct ratio
If the current mode (from 0.5 second ago until change, it will branch to Reload Mode Data to
to the Horizontal Sync Frequency. If diode 1
now) parameters are not the same as the DAC to complete the mode change
is added, the VCO Output Voltage will have
previous mode (the time before 0.5 second procedure.
an indirect ratio.
ago), the first test block from the top of the When the mode change procedure is
flow chart will branch to search all mode The third step in setting up a new user mode
completed, the monitor will be working in a
parameters in the EEPROM to find out what is "Put VCO Value to EEPROM".
new mode. Since the program enters the
the current mode should be. The left loop of Mode Detection task every .0.5 second, it The last step is "Reload Mode Data to DAC".
the flow chart checks for the end of the takes from 0.5 to 1.0 s'econd to finish the After reloading the DAC, the monitor is
search procedure, i.e.; if all modes in the change of mode. To save the new user mode changed to the new user mode.
EEPROM are searched and checked, and
(mode 19) to other user mode (10-18), the
DAC7
OUTPUT
VOLTAGE
DIRECT RATIO
DAC7
OUTPUT
VOLTAGE
INDIRECT RATIO
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
Key Function Selection If the user presses the reload key, and the EEPROM needs 30ms to program one byte.
The first task is Function Selection (see program is not in the last mode, it will branch C2 is a decoupling capacitor to stabilize the
Figure S). When the program scans the right to reset mode data in EEPROM, starts DC supply voltage for PCF8582.
~~yboard, it first checks for the function key. If to read original mode data in microcontroller's
TDA8444 is an octalS-bit DAC. R7,VR5,C#
It IS depressed, the program will branch right PROM, then puts these data to EEPROM,
constructs a reference voltage to define the
to change function VALUE(+I). the function the outputs to DAC. This function is to help
DAC's maximum output Voltage. In practice,
LEDs are lit in sequence, i.e., when the the user to restore the monitor when the
the reference voltage must be below 10.5
second LED is lighting and the program monitor display is out of control. For example,
volts, so R7 is added to prevent the reference
~~ts a press in function key, the program if the user adjusts the Horizontal phase too
voltage from exceeding that limit. C4 is also a
will light the third LED and tum off the second broad, then monitor may become out of sync.
decoupling capacitor to stabilize the DC
LED. If the program detects that the last LED As a consequence the screen will be a mess
supply voltage for TDA8444.
is lighting, it will tum on the first LED and tum and it is not easy for the user to re-adjust for'
off the last LED. correction. This feature will minimize possible The upper half of the HEF4sSS is used to
complaints from customers. provide a switch signal to select Horizontal
If the key pressed by the user is not a OSC time constant capacitors. The four
function key, the program will check if it is the outputs are Active-LOW. When the Horizontal
reload key. If it is not, then the second test
block will branch left to check Up/Down keys.
CIRCUIT DESCRIPTION Sync Frequency (H.S.F.) falls in one of the
UI-87C751 is an 8-bit microcontroller and four ranges, the corresponding output pin will
both the Up and Down keys have two go low. The four ranges are:
different definitions. When the user is the heart of the Bus-Controlled Monitor. The
87C751 receives Vertical Sync and (H.S.F. < 35kHz),
updating function contents, Up and Down (35kHz < H.S.F. < 40kHz),
keys are used to change the function Horizontal Sync signals from pins P 1.5 and
Pl.S. The R3,C5 in pin PI.5 is a low pass (40kHz < H.S.F. < 50kHz),
contents stored in the EEPROM. In that (H.S.F. > 50kHz).
protection circuit. It can prevent the Vertical
situation, the flash flag is not set; after the
program branch left from the reload key test Sync signals, including Horizontal Sync The enable input in the upper part of the
block, the program will test flash flag, then Pulse, from interferring with the counting of HEF4556B can be used to extend the upper
the program will change the output of DAC. the V?rtical Sync Frequency. The R2 in pin limit of the switch signal. The lower part of the
Pl.S IS only used for protection of 87C751. HEF4556B is used to display function LEDs,
If a flash flag is set (see next paragraph, the fifth LED is driven by an NPN transistor.
also), Up and Down keys will change the The 87C751 automatically checks the mode
parameters from these two pins, then When the transistor is turned on by the
flashing mode displayed on two microcontroller, it also disables the lower part
switches the DAC from the old mode to a
seven-segment LED displays. The flashing of the HEF455SB. If multiple Up/Down keys
new mode. When 87C751 is checking the
mode is valid between 10 and 19. The Up are configured, the function LEDs are
key will add one to the flashing mode unless mode, it reads different mode parameters
from the EEPROM via 12C bus, then decides replaced by five pairs of Up/Down keys.
the flashing mode isalready 19, while the
Down key will subtract one unless the whether there has been a change in mode. If Because the tenth digit of the mode display is
flashing mode is already 10. a change is needed, the 87C751 will first either "1" or blank, the driver of the tenth digit
mute video by sending a LOW to pin PO.2, uses only one transistor. The driver of the
~f ~e reload key is pressed while the program then reads the correct mode data from the base digit employs an HEF4511 B, it is a BCD
IS In last mode (19), i.e., a new mode which is EEPROM via the 12C bus. It then puts the seven-segment display driver with output
not the same as any mode entered in the data to the DAC via 12C bus. Because of the Active-HIGH, so only common cathode types
EEPROM, the program will check to see if 12C bus, the connections between the can be used. The factory can use one LED to
this is the first press. If this is the first press, EEPROM, DAC, and the microcontroller are replace a BCD display. When the LED is lit,
the fouth test block in the middle will branch very simple. the BCD display can display user mode, or
right to set the flash flag, after the flash flag is factory mode. This is one way to reduce the
set, the mode displayed on the two The system clock is provided by a 12MHz
crystal connected to Pins 10, 11 of the system cost.
seven-segment LED displays will start to
flash. 87C751. Basically, portl is used for input, but If multiple Up/Down keys are not configured,
Pl.4 and Pl.7 are used for output. Pl.0 to the keyboard has four keys:
Between the first press of the reload key and Pl.3 are used for keyboard and configuration Function key,
the second press of the reload key, the Up input. Up key
and Down keys can be used to change the Down key
falshing mode to a destination mode. When PortO has only three pins; PO.O and PO. 1 are
used for 12C control. PO.2 is an output pin Reload key.
the program detects the second press of the If multiple Up/Down keys are configured,
reload key, the program will execute all the used to test configurations. Port3 is basically
used for output; P3.0 to P3.4 are used for there will be no function key, but five pairs of
center blocks in the flow chart. Firs~ starting Up/Down keys and one Reload key. the
mode seven-segment LED display output;
to clear the flash flag; second, to get last multiple Up/Down keys are configured by
mode data from EEPROM; and third, to put P3.5 to P3.7 are used for funciton display.
Both mode display and function display need adding a diode in JP7. If adding a diode in
the mode data into a new address. The JPS, there will be only four functions
extra decoders, an HEF4511 B
desitnation is decided by the user via Up and available, i.e., there will be only four paris of
Down keys to select flashing mode, then seven-segment display driver is used to
display the mode, while an HEF455SB dual Up/Down keys or four function LEDs.
pressing the reload key to make the flashing
2-to-4 decoder is used to display function LM7805 is a power regulator IC, it changes
m~de be a still mode. After mode display is
stili, the user finishes defining the destination LEDs. 12V to 5V to supply the whole circuit except
user mode. This destination user mode will PCF8582 is a 2k-bit EEPROM. R4,Cl TDA8444, which uses a 12V power supply to
last forever unless the reload key is used to constructs an external R-C time to program provide a wider range of DAC output.
redefine it. . the EEPROM. In normal operation the
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
There is a table to explain the usage of each 2. There are eight DAC output signals. Their circuits onto the demo board. For
pin in the JPl socket. JP2 and JP8 are maximum output voltage can be preset by example, an OPA can be added as a
connected together, JP3 is only used for setting a voltage on the TDAB444's VMAX comparator to detect the VCO output. If
future automatic alignment (including pin. The voltage on the V,IoAX pin must be the VCO output is higher than a certain
production line) if necessary. JP4 to JP7 are below 10.5V and also below the voltage voltage (VCO's 60kHz output voltage), the
used to select hardware configurations as on the TDAB444's Vp pin. For other OPA will be triggered and the upper half
previously mentioned. detailed output current characteristics, of the HEF 4556 can be disabled by the
please refer to Philips data books IC02a, OPA via HEF4556's Pin 1, when
IC02b and BOCS1 and Derivative HEF4556 is disabled, the four Horizontal
SPECIFICATION OF THE SYSTEM Microcontrollers. switch outputs will remain HIGH, then the
1. The input signals to the system are OPA's output can be used as another
3. The Horizontal switch outputs have four
Horizontal Sync and Vertical Sync. The switch output.
pins. they are standard CMOS B-type
system accepts standard TTL level buffered outputs. They are Active-LOW, 4. Total current consumption is around
signals, i.e., V 1H > 2V, and V 1L < 0.4V. i.e., there will be only one output active at 25-90mA, depending on the number of
Horizontal Sync tolerance is ±O.5kHz, and any time. If the designers wants to add LED and seven·segment displays being
Vertical Sync tolerance is +21-2 Hz. ranges in higher Horizontal Sync lit.
Frequency, the designer can put extra
PARTS LIST
B7C751 BUS CONTROLLED MONITOR Revised: November 7, 1991
TH-91 0214 Revision:
Bill of Materials November7 1991 12:08'46 Page 1
ITEM QUANTITY REFERENCE PART
1 1 Cl 2700pF
2 6 C2,C3,C4,C8,C12,C13 O.lIlF
3 1 C5 O.OlIlF
4 1 C6 l00IlF
5 2 C7, Cll 11lF
6 2 C9,Cl0 33pF
7 5 Dl, D2, D3, D4, D5 LED
8 3 JP1, JP2, JPB Header 16
9 1 JP3 Header 4
10 4 JP4, JP5, JP6, JP7 Jumper (add diode)
11 2 01,02 BC54B
12 1 Rl 470R*7
13 11 R2,R3,RB,R9,Rl0,Rll,R14,R15,R17,R19,R20 470R
14 6 R4,R6,R12,R13,R16,R18 22K
15 1 R5 VR10K
16 1 R7 2K
17 2 R21, R22 56R
18 5 Sl, S2, S3, S4, S5 SW Pushbutton
19 1 Ul B7C751
20 1 U2 HEF4556B
21 1 U3 PCFB5B2
22 1 U4 TDAB444
23 1 US HEF4511B
24 1 U6 LM7B05
25 2 U7,UB DISP-7
26 1 Yl 12MHz
(SCM) 87C751
AN442
Specification for a bus-controlled monitor
PARTS LIST
87C751 BUS CONTROLLED MONITOR Revised: November 13, 1991
TH-9102l5 Revision:
Bill of Materials November 13 1991 15·42·31 Page 1
ITEM QUANTITY REFERENCE PART
1 1 Cl 2700pF
2 6 C2,C3,C4,C8,C12,C13 O.IIlF
3 1 C5 O.OIIlF
4 1 C6 l00IlF
5 2 C7, Cll ljlf
S 2 C9, Cl0 33pF
7 3 JP1, JP2, JP8 Header 16
8 1 JP3 Header 4
9 4 JP4, JP5, JP6, JP7 Jumper (add diode)
10 2 01,02 BC548
11 1 Rl 470R+7
12 10 R2,R3,R8,R9,R'O,Rl',RI4,RI5,RI9,R20 470R
13 S R4,R6,R12,R13,R16,R18 22K
14 1 R5 VR10K
15 1 R7 2K
16 2 R21, R22 56R
17 12 SI,S2,S3,S4,S5,S6,S7,S8,S9,SI0,SI',SI2 SW Pushbutton
18 1 Ul 87C751
19 1 U2 HEF4556B
20 1 U3 PCF8582
21 1 U4 TDA8444
22 1 U5 HEF4511B
23 1 US LM7805
24 2 U7,U8 DISP-7
25 1 VI 12MHz
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
CIRCUIT DIAGRAM
[]ED 8 1
'- ---rn~L2ffi~J;3-
rn ~ B L--? _u~_ , ~ _U2 _s8
~~
4"=:3 ~G8444 E3
,-----I
HEf4556BI
R
-{]IT[]- C3 R5
--c:RD-.
-DID
@
@ =EB B ~~~~~;:::
E80B[J2 Ul ,
Jp8l
PHILIPS JUWPER • 16
GG
fUNCTION UP
GG
RELOAD DOWN
. HEf45\1B
PHILIPS
(SCM) 87C751
AN442
Specification for a bus-controlled monitor
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
~
i _NM'::i::i
..
~~
_N
NN
.-------;
,m:~II' ..
,... o,jI III • .. N ... 0
u u U u 0 U 0 u
... u~, a « a: « « a a (I
o 0 000 0 0 Co a a
• N I"
:! rI ...
r;::
I' ~
NO
~
.
••
mO
g
~~
: ...
~~
a
----.; "'
~ ..
00
~
"
~ ..
.~
.~
.. I ~
"
~ ..
~~
-~
1111 I' N
O ... N .... III
••••
alii w
I'
}~!:!1
,u
0
••••
.... 1'(1"1 Q)
<till W:r
,u ~ ~
~ s ~ ~ .§ ~
~
.
M
~
~
~
r
. t.
~
·
t. • ~
! J
W
· ~ ~ ~
~
g ~ ,
S
~ . . ·~ .S .S .
~
~
~ ~ ~
~
. .= " II
I
r;:::::.-
~r; ~
fITT
"{I~hr~r
~.
JJJJytmmmJ
~[tr~ ~~11
00
~::
~::
..
~11·
~
• >
,tf:
.
;:)
...
to!
N
~O
u ~
t~
Hit·
I>
Wfl
~
......
ovoouuuu
(I ([
([ a
III
a . x : n u o - t ...
...
a: a a (I ( I 0;
00000000
...J
:> ,. 1''1 VI a: a: G:
,.,
11 '1 '1
~ ....
0
0
z
U
~
II.
~
~
.
~
,g
r bill'
n~
ON
~~--+
0 II'
r ~
g ~~II ~~ I~II
~I--III'~~
0
"
~
.,
~
co U ..J ([
o .... u 0
:> Q. VI \/I
~ <l (I a ·~
:>
f
1 i i'
~!I'C\l~
"0
II.
.11".
<1111 '"
II'
aUl
.
"" l:
~ J J. . d J~ ~
~ ~
~ ~ ~ ~ ~
>
~ ·
~ ~
~ ~
~ ~ . ~
0 ! J
~ ~ ~ .
~ I ~
. ·. . . ~ ~ 3 ~ ~
~ ; > r;
g . .. . ~
II·
'~II'
g
~
r;:=:=.-
~J; - ~~~II'
jj3 tJ~ .~~
1+---
f:%m;r > ~L'-if-----lil'
'-L..jll'
~ 1;1 · N M • • • • • O""
.......................
•••• :lf~
)JJJJ)wm)}J}
(SCM) 87C751
AN442
Specification for a bus-controlled monitor
APPENDIX A
References 3. Philips Data Book 4. Tide: "ETV8831: Deflection Processor
1. Philips Data Book IC02a,IC02b RF Communications TDA8433 with 12C Control"
V"1deo and Associated Systems Title: "ANI68: The Inter-Integrated (12C) Author: DJA Teuling
Serial Bus: Theory and Practical
2. Philips Data Book IC20 5. Tide: "ETV89008: VGA Monitor with the
Consideration",
80051 and Derviative Microcentrollers High Resolution Colour Tube
Author: Carl Fenger
Title: "AN422: Using the 8XC751 M34ECL10X36"
Microcontroller as an 12C bus Master" Author: H. Nemees
APPENDIXB
+12V - lOV
10K H<35K
H veo .---+--"'-1
22K
10K 22K
. . - -....- - - GOK<H<70K
+12V
10K 22K
~-_-----.... H>70K
22K
10K
When you want to determine Vtrig signal, power on the demoboard, the mode display You can set P.S.G to 70kHz to measure
please disconnect Pulse Signal Generator should display "19", the the voltage in DAC trigger level voltage of 70kHz.
(P.S.G.) OUtput to H. Sync demoboard from H-V output pin is the trigger level voltage of
monitor and connect, and use input, set 60kHz.
P.S.G. to 60kHz, TTL level output, then
(BCM) 87C751
AN442
Specification for a bus-controlled monitor
APPENDIXC
U4
+12V VP DAC7
15
VMAX DAC6
14
SDA DAC5
~5V
4 13
SCL DAC4
12
AD DAC3
2K 11
A1 DAC2
10
A2 DAC1
+5V
GND DACO
TDA8444 +12V
+12V- 30V
+ 3
LM324
4
t
50K 22K
1UF
-= -= -= -= -= -=
8OC51-Based
8-BH Mlcrocontrollers
CONTENTS
Metalink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • . • . . . . • . • . . • . • . . . . . . . • • . • .. 886
i
I
I
I
Signelics 80C51·Based 8·BII Mlcroconlrollers
EMUL51-PC/BOX-S Box with serial port and cable. Box allows operation of emulator external to PC.
EMUL51-PC/BOX-M Box with serial port and modem
EMUL51-PC/BOX-CS Serial box with emulator (E12B--16) and trace (TRl6-16)
EMUL51-PC/BOX-CS--20 Serial box with emulator (E128-20) and trace (TRl6-20)
EMUL51-PC/BOX-CS--24 Serial box with emulator (E128-24) and trace (TRl6-24)
EMUL51-PC/BOX-CS--30 Serial box with emulator (E12B--30) and trace (TRl6-30)
METAUNK CORPORATION
1~051/200-20 iceMASTER.,'l051 emulator Model 200, 32K emulation memory, 20MHz
1~051/400-20 iceMASTER.,'l051 emulator Model 400, 32K emulation memory, 4K trace buffer,
2 performance analyzers, 20M Hz
1~051/400-24 iceMASTER.,'l051 emulator Model 400, 128K emulation memory, 4K trace buffer,
2 performance analyzers, 24MHz
128KUP 128K memory expansion option for iceMASTER-ao51
75211 PGMPC Programmer accessory for ice MASTER to program 87C751, 87C752
8031-12PC 0.5 to 12MHz 8031 , 8OC31
8031-16PC 0.5 to 16MHz8031, 80C31
8031-20PC 0.5 to 20MHz 8031, 8OC31
8031-24PC 0.5 to 24MHz 8031, 8OC31
8032-12PC 0.5 to 12MHz 8031, 8OC31 , 8032, 8OC32
8032-16PC 0.5 to 16MHz 8031, 8OC31 , 8032, 8OC32
8032-20PC 0.5 to 20MHz 8031, 8OC31 , 8032, 8OC32
8032-24PC 0.5 to 24MHz 8032, 8OC32, 8031, BOC31
8052-12PC 0.5 to 12MHz 8031, 80C31, 8032, 8OC32, 8051, 8751, 80C51, 87C51 , 8052, 8752, 80C52, 87C52
8052-16PC 0.5 to 16MHz 8031, 80C31 , 8032, 8OC32, 8051, 8751, 80C51 , 87C51 , 8052, 8752, 80C52, 87C52
80410-12PC 0.5 to 12MHz 80CL410
80451-12PC 1.2 to 12MHz 80C451
80451-16PC 1.2 to 16MHz 80C451
8052B--12PC 1.2 to 12MHz 80C528
8052B--16PC 1.2 to 16MHz 80C528
80552-12PC 1.2 to 12MHz 80C552, 80C562
80552-16PC 1.2 to 16MHz 80C552, eOC562
80652-12PC 1.2 to 12MHz 8031, 80C31, 8OC652
80652-16PC 1.2 to 16MHz 8031, 80C31 , 8OC652
80651-12PC 1.2 to 12MHz 8031, 80C31 , 8OC851
83053-12PC 6 to 12MHz 83C053, 83C054, 87C054
83451-12PC 1.2 to 12MHz 80C451, 83C451 , 87C451
8352B--12PC 1.2 10 12MHz 80C528, 83C528, 87C528, 83C524, 87C524
8352B--16PC 1.2 to 16MHz 80C528, 83C528, 87C528, 83C524, 87C524
83550-10PC 1.210 10MHz 80C550, 83C550, 87C550
83552-12PC 1.2 10 12MHz 80C552, 83C552, 87C552, 80C562, 83C562
83552-16PC 1.2 10 16MHz 80C552, 83C552, 87C552, 80C562, 83C562
83652-12PC 1.2 to 12MHz 80C652, 83C652, 87C652, 80C552, 83C552, 87C552, 80C562, 83C562
83652-16PC 1.210 16MHz 80C652, 83C652, 87C652, 80C552, 83C552, 87C552, 80C562, 83C562
MICROCONTROLLER SUPPORT
PRODUCT DEVICES SUPPORTED MANUFACTURER DESCRIPTION
8051 C Compiler 8051 and derivatives Franklin Software C Compiler for 8051 family
8051 C Compiler 8051 and derivatives Archimedes Software C Compiler for 8051 family
8OC51 C Compiler 8051 and derivatives BSOlTasking C Compiler for 8051 family
P8051 DB 8051 and derivatives Ceibo 80C51 Family Development Board
887COOKSD -- Signetics 12C Demonstration Board. 87C751 controls various 12C
peripherals. Board has sockets for 87C752, 87C652, and
87C552 also.
-- -- Signelics The Signetics computer Bulletin Board system has available a
microcontroller newsletter, application and demonstration
programs for download, and the ability to send messages to
microcontroler applications engineers. Access by modem at
2400,1200, or 300 baud. The telephone numbers are:
(800) 451-e644 (in the U.S.) or (408) 991-2406.
SMI-CNV451SD 80/83187C451 Signelics Signetics product adapts a PLCC emulator plug for the 8OC451
to the DIP pinout
The Nohau EMUL51-PC consists of a board which plugs directly into the IBM PC/XT/AT bus for fast file transfer. An optional
external box with a serial link is also available. The optional Trace board features an advanced trace function with many trigger
capabilities.
The POD, which plugs into the target system, is connected with a 5 ft (1.5 m) ribbon cable to theEmulator board to provide a flexible
operating range.
The EMUL51-PC uses no wait states and does not intrude on memory, stack, I/O or interrupt pins.
RS2321modemtparaliel interface
r.:7.?':7':;;t
~
External Box
o
POD (device dependent)
876
nOH8U
CORPORATION
(408)866-1820
The user interface is based on MS-DOS software. It incorporates a variety of techniques. The user can select to operate either with
short typed commands or using pull-down menus. On-screen features include windows to monitor or alter:
All commands are supported with context-sensitive help and full on-line manual.
Using high level language for code generation is a way to cut development time. Therefore the EMUL51-PC gives full support for
debugging directly in C, PL/M or Pascal source code. This eliminates the need for paper listings. Breakpoints can be marked directly
in the source code window. The user can single step through the program line by line and follow the program execution on the screen
listing.
The trace permits the user to trace his source code in real-time.
All variables can be displayed and altered. This includes full support for typed symbols which permits the user to address such
variables as floating-point, arrays and structures - both global and local.
The EMUL51-PC features 64 K of code memory and 64 K of external data memory. The addressable memory can be mapped either
to target or to the emulator in 4K pages.
The emulator can load all common file formats and the user can view and alter all registers and memory areas of the microcontroller.
3.3 Breakpoints
The EMUL51-PC permits the user to generate program breakpoints in a number of ways:
Using the Trace board it is possible to break on combinations of address, data, control signals, port signals and external signals.
877
nOHau
CORPORATION
(.408)866-1820
That session automation is made possible using the Macro commands. This pennits the user to defme his own command sequences
using structures like IFJELSEand REPEAT/WHILE. Such cominand sequences can be stored to a file which.can be loaded
automatically when the emulator is invoked.
A complete debug session and all setups can also be recorded to a file.
The optional trace board features a trace buffer capable of storing up to2S6k framesof64 bitdataeach. The 64 bits consist of address,
data, cootrol signals, port signals, external signals and a time stamp.
The trace memory can be displayed, reprogrammed and restarted during emulation.
The trace filter makes it possible to select what events are stored in the trace buffer. The qualifiers pennit the user to define the criteria
for which bus cycles are stored. The qualifiers can specify address, data, control signals, port signals and external signals.
The trace works much like a logic analyzer. Itis therefore possible to trigger the trace on an event and displll:Y what happened before
or after that evenL
The trigger event can be defmed using any of the qualifiers in up to eight levels. It is possible to trigger on boolean combinations
of the qualifiers, or sequential combinations including a loop counter.
The trigger point can be selected anywhere within the 2S6k trace bUffer to give full choice of preIpost trigger aligninent.
The trace infonnation can be displayed in high-level language statements, in disassembled form or iii binary/hex form. Ii can also
be stored to a me.
With the PPA, information can be generated s~wing which addresses ,the user program spends its time on. The infonnation can
be displayed as statistics or in histogram form. '
878
nOH8U
CORPORATION
(408)866- 1820
Host IBM PC{XT/AT{386/486, PS/2 or compatible with 640K of RAM. Monochrome, color or
enhanced graphics display.
External Box: The emulator boards can be installed in an external box with serial communication to the PC.
Processors supported: 8051, 8052, 8031, 8032, 8OC51, 8OC52, 8OC31, 8OC32, 8XC053/54, 83{8OCL41O,
83{8OC451, 8XC528, 8XC550, 83{8OC552, 8OC562, 8XC575, 8XC592, 83/8OC652,
83{87C751, 83/87C752, 83{8OC851 (For more details, please refer to the following pages.) A
switch from one microcontroller to another is made by changing the low cost POD.
Power supply: The boards are powered from the PC-bus. The Emulator board requires 1.7 N5V and the Trace
board 1.3N5V.
879
nOHau
CORPORATION
(408)866-1820
EMULATOR UNITS
Includes software and ribbon cable. Must be COJU\ected to a POD to operate. Each step up in frequency rating covers all lower frequency
steps. Includes DIP isolator if ordered with 4O-pin POD. Emulator software has high-level debug and all options.
.Advanced Trace Boards feature 32-bit timestamping with 16-bit prescaler, eight-level triggers, state and counter functions, search.
Order Number Description
EMULSI-PC/ATR64-16 16 MHz 64 k Advanced Trace Buffer.
EMULSI-PC/ATR256-16 16 MHz 256 k Advanced Trace Buffer. Contact Nohau for availability.
880
nOHau
CORPORATION
(408)866-1820
-S version of the above boards allows P3.6, PJ.7 to be used either as unidirectional I/O or write and read. (Example: POD-31-S;
POD-C31-S-1; POD-C32-S-16.)
BOX OPTIONS
Box units are AC line-powered. Emulator software runs under DOS on PC and uses a COM port at 110 baud to 115 kilobaud. Serial cable
included.
881
nOH8U
CORPORATION
(408)866-1820
MISCELLANEOUS OPTIONS
882
nOH8U
CORPORATION
(408)866-1820
SOFTWARE PACKAGES
NOHAU Corporation
SIMUL51-PC Nohau 8031/8051 Simulator. Same interface as EMUL51-PC.
Software subscription EMUL51-PC emulator software update service, one year.
AvocetSyste~In~
EMUL51-PC/AVA51 Avocet Systems AvCase51 8051 Assembler
Awc:ct iI: alCliBrcd Indcuwk of Avocet S)'SICmI.IDc.
BSOfrasklng
BSOTSKJC51PKG BSO/Tasking 8051 Family C-Compiler and Assembler Package.
BSOTSK/PLM51PKG BSO/Tasking 8051 Family PUM Compiler and Assember Package.
The EMULS I-PC Emulator, Trace,POD,and Box hardware is sold with a one-year warranty. The EMULSI-PCEmulation software
is sold with no warranty, but upgrades will be distributed to all customers up to one year from the date of purchase. Nohau
Corporation makes no warranties, express or implied, including, but not limited to, the implied warranties of merchantability and
fitness for a particular purpose. In no event will Nohau Corporation be liable for consequential damages. The SIMULSI-PC
Simulator software includes updates for a period of one year. Third-party software and programmers sold by Nohau carry
manufacturers' warranties.
883
nOHauCORPORATION
(408)866-1820
1. External-Mode PODs
External or microprocessor-mode PODs have several clear advantages. They are the cheapest type of POD. They have
easily-replaceable standard microcontrollers. Your program runs on the real production part, with most of the lines directly
connected to your target. You can use them where your microcontroller has external program or external read-write memory. With
this type of POD, Port 2 is used only for the upper address bus and not as port input-output (I/O). Port 0 is used as a multiplexed
address and data bus. In most of these PODs, P3.6 can only be used as the write line and P3.7 as only the read line. The POD·31
is a typical external POD.
Your target system shares Port 0 and Port 2 with the emulator. The emulator uses Port 0 to run its monitor code when it is not
executing your code in real-time. When you are not running real-time emulation, the POD holds the Program Store ENable line
(PSEN/) high so that your external read-only memory (ROM) is not enabled. It also holds the ReaD/ line and WRite/ lines high so
that none of your external read-write random access memory (RAM) or I/O is enabled.
But in the monitor (not emulating) mode, the address lines of both Port 2 and Port 0 are active and can output any address in the
64 kByte address range. It is up to your target system to prevent enabling any device unless the PSEN/ or the RD/ or the WR/ line
goes low.
If you are emulating a ROM-less part, like the 8031, you can use the POD-31 type of POD. You also might use this POD for some
internal ROM applications. You could use it for designs that have all of Port 2 and Port 0 used as external buses. This is true even
though the program can be executed from on-chip 8051 program memory in your [mal product. This is a case where your target
schematic, rather than the device you are using lets you use this type of POD. So though the part may ultimately be an 8051 or8751,
you can use a POD-31 because you are using the ports as buses.
If you are emulating the 8OC31, 8032, 8OC32 or 8OC652, you can get external-mode PODs for these microcontrollers. With the
POD-31, you can emulate all those parts in external mode at up to 12 MHz. You can get the POD with the correct micro installed,
such as a POD-32. Or you can change among the types by changing the microcontro11er component in the POD yourself.
16 MHz, 20 MHz, 24 MHz, 30 MHz and 33 MHz PODs are available for 40-pinparts; If you use a POD-C31-1 with a 16 MHz
rated emulator, you can support such parts as the 8OC31-1, 8OC32-1 and 8OC652-1. Any higher-frequency POD and emulator set
can support all the lower frequencies.
For emulating the 8OC451, 8OC452 or 8OC552, other external mode PODs are available. PODs for dual inline package (DIP) parts
have a DIP plug coming out of the bottom of the POD. PODs for plastic leaded chip carrier (PLCC) parts have a pin-grid array
(PGA) plug coming out from the bottom of the POD. To plug a PGA POD into a PLCC socket, you can get an optional adapter.
ThePGA68-PLCC68 is a typical adapter. If your target board has feed-through holes and you solder aPGA socket into it, you don't
need an adapter. If your target board already has a PGA socket, you don't need an adapter.
POD-31-S: All the above external PODs use P3.6 as WR/and P3.7 as RD/. But there is a40-pin external mode POD version that
lets you use these two lines as I/O. The basic board is the POD·31-S. This special-S option lets you select whether the two lines
are to be WR/ andRD/ or else I/O. They can be unidirectional port lines (input-input, input-output, output-input, or output-output).
You also can get this POD in the variations of 16 MHz and 20 MHz and any of the 40-pin part variations listed above.
884
nOH8UCORPORATION
(408)86&-1820
2. Bondout PODs
BondoutPODs use special microcontrollers that the semiconductor manufacturers designed to perform all the functions of the part.
They also have additional lines ''bonded out" from the chip that allow control for emulation. PODs with these special chips cost
more than PODs with widely available commercial chips, but give you a greater flexibility in how you use the ports. These PODs
allow you to use any combination of internal or external mode of the chip, and respond to the state of the External Access (EAt)
pin.
Nohau has bondout PODs for many different microcontrollers.
You can emulate the 80/8OC51, 87/87C51, SO/8OC31, 8OC/83C/87C652, 83C/87C654, 8OC/83C662 and 8OC/83C85I with the
POD-C51B. A 16 MHz version is available.
To emulate the 83C451, 87C451 and 8OC451 in the PLCC package, you can use the POD-C451B-PGA. See the previous
discussion about PGAs.
For emulating the 8OC/83C/87C552 and 8OC/83C/87C562 you can use the POD-C552B-PGA. It also is available in a 16 MHz
version.
For emulating the 83C751 and 87C751, use the POD-C751. It has a 24 pin DIP plug on the bottom of the POD. You also can
get an adapter to plug into 28 pin PLCC sockets. A 16 MHz version is available.
For emulating the 8XCL41O and 8XCL51, use the POD-CL410.
You should be aware of one small problem that most 8051 bondout parts have with serial communication. Specifically, if your
program has written to SBUF, but the TI flag has not been set, and you then break emulation, the TI flag will ncver be set after you
resume emulation. .
BondoutPODs give you the best of both worlds. They let you mix how you use the ports. So you can emulate the single-chip mode
using the ports as I/O. Or you can emulate external bus mode. Or you can emulate a mix of both modes.
3. "Hooks"-Mode PODs
The newest type of POD Nohau offers uses a different technique for emulating. Certain chips can be put into a proprietary "hooks"
mode that multiplexes the port information in and out of the part The chip can still put out address and data. Most have 16 MHz
versions available. This group includes these PODs:
The POD-C752 is for emulating the 83C752 and 87C752. It has a 28 pin DIP plug on the bottom of the POD. You also can get
an adapter to plug into 28 pin PLCC sockets.
The POD-C52 can emulate the SO/8OC/87/87C51, 80/8OC/87/87C52, 80/8OC31 and 80/8OC32. You can use this POD whcn you
need to emulate the 8052-type parts in single-chip mode when you are using Timer 2.
The POD-C528 can emulate the 80/8OC/87/87C528.
The POD-C592-PGA can emulate the 8XC592. See the previous discussion about PGAs.
The POD-C550-PGA can emulate the 80/8OC/87/87C550. It has a 44-pin PGA plug. You also can get an adapter to plug into
44-pin PLCC sockets.
The POD-C054 can emulate the 8XC0531054 "MTV" chip.
With the "Hooks"-Mode PODs, you use jumpers to select whether the code is to be fetched from the emulator RAM or from external
ROM. You also select whether the read-write memory is in the emulator or on your target board. The ports on these PODs may have
slightly different electrical characteristics than the microcontroller. Specifically, some output signals can appear up to three clock
cycles later than on the actual part Also, some ports have greater current sink or sink and source capacity or slightly higher
impedance than the actual part For almost all applications, these differences will have no detrimental effects.
You can use any size EMUL51-PC emulator and optional trace board with any POD you choose in Nohau's EMUL51-PC family.
Choose an emulator and trace board with frequencies as fast or faster than the frequency of your fastest POD. If you need more
information about which POD would best fit your application, please contact Nohau.
885
"~ ~ iMdali
- Corporation
TM
iceMASTER
IN-CIRCUIT EMULATORS From MetaLink
For 8051
887
IMPROVING THE QUALITY OF YOUR PRODUCT:
FINDING THE HOT' (OR NOT SO HOT) SPOTS
You have access to as many as 128K break ~nd 64K trace triggers. These
triggers can be enabled, disabled, set, or cleared. They can be SImple trigger.,
based"on ~ode or.external data addresses or address ranges. They"can also be
complex triggers, based on code address, direct address, bit address, opcode
value, opcode" class or immediate operand. Complex triggers cal) be .ANDed
and ORed together. Finding that elusive bug is now much easier! . .
.' Some 'companies design emulators that use one or twO full size PC ex-
pansion board slots. These companies take it for granted that you have the
"right" kind of PC, tliat you don't need the expansion slots' for something else,
iind that you don't mind taking apart your computer to install their emulator!
At MetaLink, we don't take our customers for granted. .
iceMASTER is the culmination of over 6 years of focused engineeril)g
by MetaLink to bring advanced semiconductor technologies to emulator de-
sign. Using state-of-the-art PALs (PEELs), LCAs, VLSI memories and mi-
croprocessors, MetaLink designed world-class emulation capability into the
smallest emulator footprint in the industry, combining powerful and complex
emulation" features with all-around ease-of-use.
The highspeed serial link connects easily to th~"backof your computer
with a standatd RS-232 cable. The emulator, about the size of a VCR tape,
fits neatly in crowded work spaces and is easyto move around on theI,ench or
to other computers. PORTABLE PRODUCTIV1TY!
888
MetaLink is DEDICATED
MetaLink specializes in enhancing the emulation technology required by EMBEDDED SYSTEMS DESIGNERS. MetaLink has consistently led the indus-
try in emulation technology: the first PC-based 8051 emulator; the first 8052 emulator; the first to offer support for all the unique features of 8051 family compo-
nents, such as watchdogatimcr, idle mode, power-down mode, and AID. Currently, other 8051 emulator suppliers must license MetaLink's patented technology
to support certain devices.
MetaLink is a full-service emulation company. We support our customers over the long term with services such as repair, discounted upgrades, rental
units, trial purchase periods, and free technical support for applications problems. A network of world-wide sales and service representatives is augmented by a
well-trained telemarketing staff at headquarters.
DEVICES SUPPORTED
Interchangeable Probo Cards are used with the appropriate emulator to support the functional derivatives
To order your iceMASTER emulator or to
of each microcontroJJer as well as the full range of NMOS, CMOS, EPROM, and OTP technology variations. arrange a demonstration of iceMASTER,
Since MetaUnk Is constantly adding to its list of supported devices, please contact MetaLink for Information
on any device not listed. call:1-(800)METAICE or 1-(800)638-2423.
Rental plans are available.
iceMASTER-8051 supports: 8031, 8051 , 8032, 8052, 80C451, 83C451 , 80C552, 83C552, 80C652, 83C652,
80C562, 83C562, 83C053, 83C054, 80C550, 83C550, 83C751, 83C752, 8DC851, 83C654, 80CL41 0, Ask for details on this opportunity.
83CL410, 80C528, 83C528, 83C524, 80CL51. MetaLink Corporation
Product names are used for purposes of identification only and may be trademarks or registered trade- 325 E. Elliot Road
marks of their respective companies.
Chandler, Az 85225
Phone: (602) 926-0797
Fax: (602) 926-1198
Telex: 4998050 MTLNK
889
DB-51 is a high-performance system design board dedicated to the Signetics BOC51 family of microcontrollers. It provides an
easy-to-use flexible instrument which enables the user to build a primary prototype, analyze and debug it, make changes, and
continue debugging. And you can improve your design decisions by using the DB-51 to check and test the advantages of
several different microcontrollers. The DB-51 is also a great training and tutorial aid for becoming familiar with designs using the
B0C51 architecture. Note that the DB-51 is not intended to replace a full emulator system in complex microcontroller designs.
• Software breakpoints
Signetics
890 PHILIPS
SPECIFICATIONS
User Software
The board is provided w~h a very easy-to-use menu-driven
The DB-51 is a Development Board Kit to be used with a software program as well as command oriented user
smndard IBM-compatible. It includes the board itself,
interface software. On-line assembler and disassembler are
software, and user manual.
provided together w~h upload and download capabil~ies of
hexadecimal and object files.
Command Set
ASM - BIT - BYTE - BREAKPOINT [enable, disable, resetj
System Memory - CHIP [type)- CLS - CODE - DATA - DASM - DEFAULT
DB-51 provides 32K of user code memory. This RAM - DIR - EVALUATE - EXIT -GO [from, tillj- HALT - HELP
memory permits downloading and modifying of users' - HISTORY - LINES - LIST [filej- LOAD [code, symbolsj-
programs. LOCALS - MODULES - PORTS - PROCEDURES -
PUBLICS - RBIT - RBYTE - REGISTERS - RESET -
Breakpoints SAVE - SOUND - STATUS - STEP [nj- TIME
Breakpoints allow real-time program execution until an
opcode is executed at a specified address. Host Characteristics
IBM PCIXTIAT or compatible system with 512 kbyteof RAM,
Symbolic Debugger one floppy disk drive, one RS-232 interface board for the PC
DB-51 allows symbolic debugging of assembler or high-level and cable, PC-DOS 2.0 or later.
languages. The symbolic debugger uses symbols contained
in the absolute file generated by the most commonly used Input Power
relocator and linker programs. 7.5 VDC to 12.0 VDC (9 VDC wall transformer supplied).
891
SlgnetlC8 8OC51-Baaed 8-Blt Mlc:roc:ontrollera
THREE CONFIGURATIONS TO Connection to a Host Computer If you work in a development team, shared
Most dewlopment tasks will, however, need access to files and programs is of course
SUIT YOUR 8051 PROJECTS essential to maximize productivity. Programs
For efficient, accurate software and hardware the power of a host compU1er or
Microcomputer Oevelopment System, and can be downloaded from any host cOmputer
dewlopment and integration, there is no
Philips' SOS (Stand-alone Oebugging to the SOS memory, using a PC or terminal
substitute for fully transparent, real-time
Station) can work with both. The process of as a workstation to operate the SOS.
emulation. But development must be
cost-effective, and the key to that is to haw writing the software and designing the
one emulation unit which can lit exactly into hardware can be done on the compU1er, with FEATURES
all your development projects irrespectiw of an SOS used to debug and integrate the
• Real-time, fully transparent emulation
their scope and stage of development. software with the hardware. SOS 8051
supports a wide range of hosts. It has its own • Works stand-alone from a VOU tenninal,
If you are developing with the 8051 family, in-line assembler in firmware, but you may PC or other computer
such a unit is the SOS 8051." Three also use the separate MS-DOS • Full hardware emulation using a dedicated
configurations suit all your projects without cross-assembler. probe--qlerates according to the exact
requiring modifications or extras:
specifications of the target microcontroller,
Connection to a PC including maximum speed
Stand-Alone Operation The SOS 8051 operates with an IBM PC or
A VOU Terminal is all that is needed to XT, or compatible, e.g., Philips P3100 series, • Interfacing signals to external equipment
integrate and debug with the SOS 8051. And so you can use it in your usual work • Full assembly-lewl debugging and HLL
because you can do basic emulation without environment. The SOS can be operated from debugging
putting demands on computer resources, the a PC using readily available terminal
smallest user as well as the big development • Single-step and breakpoint facilities
emulation software, or the XRAy™51
team can take advantege of the SOS 8051. symbolic debugging package, the latter • Large trace memory with hardware
allowing you to use your own source labels qualifiers
on screen in SOS displays and commands,
and having a DOS toggle switch.
Connection to a Host Computer or PC, and Terminal Connection to a PC with Terminal Emulation Software
"SOS 8051: Generic name for Philips Stand-alone Oebugging Station for the 8051 family of microcontrollers; for type numbers, see Ordering
Information. The 8051 family includes the 8OC51/31, 87C51 , 80CL51, 8XC0531054/4511528155O/5521562159216521654n51 n521851 , the
8XCL410mO and the 8051131/52132. Debugging stations are also available for Philips 8400 microcontroller family and the 5010/5011 digital
signal processors.
UNEQUALLED EMULATION allowing you to investigate program flow in Hardware Qualifier Bits
SOS B051 provides complete, high-quality detail and to debug very quickly. When a
breakpoint condition is met, the entire CPU is The trace memory has qualifier bits for
emulation for development with the 8051 selecting the information to be captured in the
family of microcontrollers. Standard features frozen and, besides the full interrupt status,
the status of all timers (frozen by a special trace memory. These bits enable cycles to be
indude:
bon~ut chip feature) is displayed. selected, for example, capture only on
Fully Transparent Real-Time fetches from emulation memory, or on
Alterable Memory and Processor interrupt acknowledge cydes. Selecting the
Emulation information before capture overcomes the
You can develop on the SOS 8051 with the Registers
drawback of software qualifiers which select
chip running in real time--no stretched dock For really quick fault-finding, the SOS allows
the information afterwards, relying on luck for
cycles or wait states to disrupt system timing you to alter, and to display, memory and CPU
register values as required, allowing parts of it to be in the trace memoryl
in the prototype. And emulation is fully
transparent-since no resources from the the program to be repeatedly tested using Debugger Commands
B051 memory, 110 or interrupt space are used convenient values.
for monitoring emulation, all are available to The microprocessor development command
In addition, the SOS has an emulator-resident
the target and user program. language employed by the SOS 8051 has
in-line assembler which is particularly useful
been designed for ease of use. Commands
when changing your program-there being
In-Circuit Emulation or no need for repeated up-loading and
form a subset of, and are similar to, the
Simulation widely used ICETM language.
down-loading.
The sos B051 is versatile--you can tailor When the XRAY51 symbolic debugging
operation to suit the state of the prototype. If Disassembly package is used, the commands are the
no prototype hardware is available, the SOS Of course, there is no need to remember XRAY commands. These and the SOS
may be used for simulation, so the software binary code references when developing commands are listed below (at the end of this
can still be tested. The emulation mode runs software with the SOS B051-instructions are description).
the program in the prototype so far as it has entered in assembly language. In addition,
been developed, with resources transferred in on-board memory can be disassembled into Software Packages
stages to the prototype. Hardware, software the originally programmed instruction
and their integration are fully tested. The XRAY51 high-level debugger, and
mnemonics.
cross-assemblers and cross-compilers for the
Full Real-Time Hardware Trace Memory SOS 8051 are described on the next page.
sos B051 has a 2048-line trace memory for Each package supports most 8051-clerived
Emulation and Breakpoint Setting microcontrollers including the BOC51 ,
The sos 8051 has an BOC51 (or derivative) quick checking of the program flow. The
display shows the address, opcodefoperand, 83C053, 83C054, BOC451 , 80C528, BOC550,
bond~ut chip in the emulation probe. This,
disassembly, instruction status (such as RO BOC552, 80C562, BOC592, 80C652, BOC654,
and only this, can ensure that hardware
OPC, WR) and the contents of 83C751 , 83C752, 80C851, BOC852, and
emulation is truly real-time, and it also allows
microcontroller ports andfor eight user test 8XCL410f710.
you to set hardware breakpoints. These can
be set on any combination of addresses, clips.
register values or branch instructions,
SYMBOLIC DEBUGGING any variable, compute the value of C,PllM • Symbolic debugging with C,PUM-51
PACKAGE (XRAY51) source language expressions and assembly variables and C,PLM-51 statements
level address expressions, and define,
The XRAY51 debugger helps to locate • Simple and complex breakPoints
programming errors in the source code of remove, or display symbols.
C,PllM or assembly language programs for • Single-step execution
Command files can be used to direct
the 8051 family. With XRAY51, the user can XRAY51 to read or write simulated • User-<lefinable screens and
isolate these errors by controlling and microprocessor input/output from or to a file, viewports-ability to write selected
monitoring program execution using the same allowing easy implementation of automated information
high-level orassembly level terms, definitions test sequences. Command files enable • Command macros
and structures found in the original source scripts of debugger commands to be
program. For example, the user can processed automatically without the need of • Breakpoint macros (limited to the number·
single-step through the program a specified user interaction. of breakpoints of the 50S 8051)
number of microcontroller instructions or • Command and breakpoint macros may
high-level language lines. Variables can be XRAY51 also allows a virtually unlimited
contain C statements, including: FOR,
accessed with respect to the source number of user-defined windows.
WHILE ~O, PRINTF, and FPRINTF
language in which they had been defined. A simulator version of XRAY51 having the
• On-line context-sensitive help
Operating XRAY51 in Assembly mode, the same features as the emulator is available.
user can manipulate the contents of all • Command files
processor registers. Only those registers that Features • Output logging
are part of the selected 8051 derivative are • Integrated C,PllM-51 source-language and
allowed to be accessed. • Fully supports 50S 8051 with the latest
assembly-language debugging; toggle by
firmware version
Macros may be defined that can execute function key at any time
complex user command procedures and • Window-oriented display with well- • High-level trace
provide a variety of complex breakpoints. organized segregation of debugging • Transparent ICE mode for direct control of
When debugging with XRAY51, the user can information 5058051
examine the contents and modify the value of
Data Viewport
{dlsplayathe monitored
variable expressiona}
Trace Viewport
(displays the proced .....
Code VIewport calling chain)
(dleplaye sowc:e pt'Ogram In
hlglHeYel m_ or
uoembIy-leYel_)
Cornmond Viewport
(displays
__ debuggar
from thecommando
keyboard)
XRAY51 AND SDS COMMANDS I NPORT Set or alter input port status ZOOM Increase or decrease the
INTERRUPT Simulate an interrupt size of a viewport
XRAY51 Commands NOINTERRUPT Cancel pending interrupts HELP Access on-line help
OUTPORT Set or alter output port VSCREEN Change the active ~reen
XRAY51 uses a powerful command language
status BACKUP Back up one command
that employs C language expressions. Note, Execute one machine
RIN Rewind input file STEP
all commands can be issued in an associated with input port instruction or source line
abbreviated form. ROUT Rewind output file STEP OVER Step, but execute through
associated with output port procedures
Session Control Commands
HOST Enter the host operating Symbol Commands In-Clrcult Emulator Commands
system environment ADD Create a symbol ICE Communicate with in-circuit
LOAD Load an object module for DELETE Delete a symbol from the emulator (ICE)
debugging symbol table NOICE Return to debugger
QUIT Tenninate a debugging PRINTSYMBOLSDisplay symbol, type, and command mode
session address
SCOPE Specify current module and 50S Commands
Execution and Breakpoint Commands procedure scope
BREAK Power-Up Commands
INSTRUCnON Set an instruction Utility Commands RESET Back to initialization
breakpoint CEXPRESSION Calculate the value of an
CLEAR Clear a breakpoint expression Program Execution Commands
GO Start or continue program ERROR Set include-file error BRn Break at given address
execution handling (n = 0, 1, 2, 3) "
GOSTEP Execute macro after each HELP Display on-line help screen BRR Break within given address
instruction step INCLUDE Read in and process a range
STEP Execute a specified command file BRB Break at branch instruction
number of instruction lines JOURNAL Record a debugger session BV Break on internal RAM
STEPOVER Step, but execute through in a file value
procedures LOG Record debugger GO Initiates program execution
commands and errors in a (FROM, TILL) (specified addresses)
Display Commands
file STEP (FROM) Executes single instruction
DISASSEMBLE Display disassembled MODE Select debugger mode or instructions (from a
memory (assembly mode) (high or assembly) specified address)
DUMP Display memory contents OPTION Set debugger options for UD User-defined memory
EXPAND Display aliloeal variables of this session address on display
a procedure PAUSE Pause simulation TRACE Display executed
FIND Search for a string RESET Simulate microprocessor instruction flow (real time)
FOPEN Open a file or device for reset INT Display interrupt enable,
writing RESTART Restart program counter to priority and status of all
FPRINTF Print fonnatted output io a the program starting interrupt sources
viewport or file address
LIST Display source code STARTUP Save the default startup Memory Access Comman"a
MONITOR Monitor variables options DBYTE Displays specified byte
NEXT Find next occurrence ola from internal data memory
string Macro Commands XBYTE Displays specified byte
NOMONITOR Discontinue monitOring DEFINE Create a macro from external data memory
variables SHOW Display the macro source CBYTE Displays specified byte
PRINTF Print fonnatted output to a from code memory
command viewport Viewport Commands RBYTE Displays specified byte
PRINTVALUE Print the value of a variable VACTIVE Activate a viewport from on-chip register
VCLEAR Clear data from a viewport memory
Memory Commands VCLOSE Remove a user-defined RBIT Displays specified bit from
COMPARE Compare two blocks of viewport or screen on-chip bit-addressable
memory VMACRO Attach a macro to a memory
COpy Copy a memory block viewport ASM Assemble single instruction
FILL Fill a memory block with VOPEN Create a screen or viewport mnemonic into program
values or change sizes memory
SEARCH Search a memory block for VSCREEN Activate a screen DASM Disassemble memory
a value VSETC Set the cursor position for a values into mnemonics
SETMEM Change the values of viewport
memory locations ZOOM Increase or decrease the Memory Set Commands
SETREG Change the contents of a size of a viewport All registers can be set and displayed by
register commands equal to their names (pSW,
TEST Examine memory area for Function Key Commands SCON, P3, TH1, TL1, TLO, etc.)
invalid values VACnVE-1 Activate the next viewport
(counterclockwise) Serial 110 Interface Commands
Port 110 and Interrupt Commands VACTIVE+ 1 Activate the next viewport SAVE Copies data from SDS
DIN Display input port buffer (clockwise) 8051 program memory to
values MODE Change debugging mode host disk file
DOUT Display output port buffer (assemblyihigh) LOAD Transfers file from hostto
values SDS8051
NOTES:
1. A minimum SDS configuration must include an OM4120S and an emulation probe. A minimum PC configuration must include 256 kbytes
system memory running MS-DOS 3.0 (or later releases), one floppy disk drive and a monochrome monitor. However, we recommend using
an IBM PC/XT (or compatible) with 640 kbytes RAM, hard disk drive, floppy disk drive and a color monitor. The SDS software can be
supplied on 3 1/ 2 " or 5 1/ 4 " diskettes. Conversion kits require the OM1092.
2. Support lor QFPs will be available in the near future.
3. Minor restrictions.
4. All probes 16MHz, exceptOM4123 (12MHz).
T. ICE is a trademark of Intel Corporation.
XRAY is a trademark of Microtec Research Inc.
MS-DOS is a trademark of Microsoft Corporation.
VAX is a trademark 01 Digital Equipment Corporation.
This package comprises the cross-assembler The assembler translates a source program available to accomplish the same task. And
for translating 8051 assembly language into relocatable object code using three the $workfiles is no longer useful and is
programs into relocatable object code: different passes. The program syntax, ignored too.
• The ASM51· macroassemblerwhich assembler directives and user-defined
Philips' ASM51 recognizes ?SYMB, ?LlNE
accepts Intel-oompatible assembler source symbolS are checked and processed during
and ?FILE symbols that are used to pass
programs and produces relocatable '-.OBJ' the first pass. In the second pass, all generic
debug information towards the object module.
object files. An absolute or executable forward jumps and calls are optimized. In the
Philips' ASM51 recognizes the C-like #line
'A. OUT' load-image is obtained using the third pass, relocatable code is generated.
directive to adjust the line number and file
LlNK51 linker. To obtain a single executable load image, all name. This directive is generated by both
The absolute object file can be modified to necessary relocatable objects, including preprocessors to synchronize the output line
IEEE format to serve as input to the XRAY51 library modules, are linked together using the with the original input. This improves the error
debugger. proper linker (i.e., LlNK51). This executable diagnostics of Philips' ASM51 compared with
load image may then be converted to an those of its competitors, since error
ASCII file that may be downloaded into an messages now refer to the proper (include)
FEATURES EPROM programmer or an emulator. file and line number.
• Produces relocatable object code, listing
The assembler is capable of generating A powerful addition is the overlay() which
files and diagnostic messages
symbolic debug information to accommodate gives the programmer full control of the
• Accepts Intel-oompatible source programs information for the XRAY debugger. section overlay strategy.
(ASM51)
• Supports most 8051-derived ASSEMBLER LIMITATIONS UTILITY PACKAGE
microcontrollers including the 80C51/31 , The number of user-defined symbols and Several utility programs are included for your
87C51,8XC451/528/5521562159216521 macro parameters is limited only by the convenience. Amongst these are a C
65417511851, 8XCL41 0171 0 and the available heap space. Save/restore nesting is preprocessor (cpp) and an Intel
8051131/52132. restricted to lGlevels. MPL-compatible preprocessor (mpl) to deal
• Compatible with PUM-51 compilers with the various preprocessor directives and
DIFFERENCES BETWEEN macros.
• Conversion to IEEE object code format
• Compatible with XRAY51 PHILIPS' ASM51* AND In many cases, the format of the object code
INTEL'S ASM51 produced is not suitable for
High-LeveVAssembly-Level Debugger
Unlike Intel's ASM51, which restricts the use EPROM-programmers, emulators or
• Includes many utilities such as, Librarian, debuggers. Therefore, several utilities are
of register equates to the A and RD-R7
Cross-reference generator, object included to convert the code to Intel HEX
registers, Philips' ASM51 puts no constraints
code-oonvertors (oct_ihex), Motorola SO-S9 (ocLsrec) or
on register name assignment. And it can
• Supports segment overlay at the Assembly optimize generic JMP and CALL instructions, IEEE-G95 (octJeee) or vice-versa (ocUhex,
level even when they contain a forward reference. ocLsrec).
• C and MPL (Macro Programming In such cases, Intel's ASM51 will always An optional utility package is available'
Language) compatible macro produce code for a LJMP and LCALL, which separately from Tasking Software B. V. It
preprocessors included takes 50% more code. contains UNIX-like utilities to obtain a
• Separate linking phase. Philips' ASM51 supports four new directives (cross-reference) list of all user-defined
that are not available in the Intel ASM51: symbols in a program (,axref' and 'anm'), and
the 'asize' utility to get information about the
OPERATION o $Iistall generate a listfile in section sizes.
The input to both assemblers usually comes every pass (not only in
from a preprocessor which interprets the final one). This HARDWARE/SOFTWARE
preprocessor directives in the source improves diagnostics.
program to deal with file inclusion, macro REQUIREMENTS AND
definition and replacement, conditional text • $(no-)optimize enable (default) or INSTALLATION
inclusion, etc. Two preprocessors are disable generic OM4142 software comes to you on 51/4
available as separate programs, allowing the JMP/CALL optimization. diskettes (3 1/ 2" diskettes are available on
programmer to use either the C preprocessor request) together with extensive
directives or Intel's Macro Programming • $debuginfo control symbolic debug documentation, including two Assembler
Language, or even a mixture of both. information generation. Reference Guides, Preprocessor Manuals,
Since the $gen, $genonly, $nogen, $include Utility and Installation Guide. The software
The output may then be assembled using the requires an MS-DOS computer with a hard
ASM51. Depending on the selected member and $macro directives are alreadY dealt with
during the preprocessing stage, these can be disk and at least 512k byte RAM installed.
of the 8051 family, the ASM51 assembler Software installation is simple,
enables or disables the names of special ignored by Philips' ASM51.
well-documented and can be verified
function registers that are applicable. For the Similarly, $(no-)xref and $(no-)symbols afterwards using an automatic verification
ASM51 , this is easily solved by directives are ignored-report utilities are program.
target-dependent inclusion of a specific
equate list in the source file .
• Sourced from BSOITasking Software B.V., Amersfoort, The Netherlands, which holds all intellectual property rights for this software.
ORDERING INFORMATION
TYPE NUMBER DESCRIPTfON
OM4142 8051 cross-assembler package comprising the
ASM51 assembler, and the LlNK51 linker
Related Products
OM4144 PUM-51 compiler package comprising the compiler
OM4129 XRAY51 high-level debugger for the SOS 8051
..
Orders can be placed VIa your local Philips Semiconductors sales representative.
This package comprises the cross-compiler • Automatic installation with sell-test Library Routines
(PlMTI51') which efficiently translates
programs written in the PUM-51 language • Benchmarks available on request Inlernal (Buill-In) Procedures:
into 8051 Assembly. The PlMTI51 generates lENGTH PROPAGATE
Intel-compatible source, which can be PUM-51 WORD ROl
assembled and linked using Philips' ASM51 PUM-51 is a structured, high-level EXPAND SCR
and UNK51 programs. programming language derived from the Intel SHR SIZE
This compiler embodies the latest PUM-80 language and adapted to the SCl BOOLEAN
techniques. It is built upon a YACC-based specific capabilities of the 8051 family of TIME SHL
parser. Intermediate code is built using tree single-chip microcontrollers. It supports LAST ROR
structures that are optimized into new trees Boolean processing and allows efficient DOUBLE TESTClEAR
by the compiler before code-generation access to all microcontroller hardware PLM51.UB:
starts. An intemal peephole optimizer further functions.
Library routines used by the compiler.
improves the density of the generated code. Software development in PUM-51 combines
It can be ordered under the Philips' type the ease of programming in a high-level U11151.LlB or utll51.oa, ut1l51:
number 0M4144. language with access to all of the 8051 I/O Assembler utility libraries for both compiler
and memory-features that are normally only versions, consisting of procedures for string
available to assembly language manipulation. It contains the routines MOV,
FEATURES RMV, CMP, FNDB, FNDW, SKPB, SKPW,
programmers.
• State-of-the-art compiler: fast, single-pass, SETB and SETW for each memory type and
memory-based The Philips' implementation of PUM-51 is an for each register bank.
extremely fast single-pass optimizing
• Fully compatible with the Intel PUM-51 compiler that is fully compatible with the Intel
language definition Re-entrancy
PUM-51 language definition. The generated code is not re-entrant,
• Fully compatible with Philips' because PUM-51 is not defined as a
ASM511l1NK51 cross-assembler and linker IMPLEMENTATION-DEPENDENT language with re-enb'ant procedures.
• Produces highly optimized code DATA Because of the limited size of intemal RAM,
• Supports most 8051-derived the local and formal parameters of
microcontrollers, including the 80C51131, Data Types procedures are not put on the stack, but on
87C51 , 8XC451/52815521562159216521654/ • Data types BIT, BYTE and WORD are static areas, which can be overlayed by the
751/851, 8XCl4101710/51 and the allowed for variables, arrays, structures or compiler using $OPTIMIZE(3).
8051131152132 combinations thereot:
Complier Controls
• Both compilers support the XRAY51 • Memory types MAIN, IDATA, REGISTER, ROM(s), REGISTERBANK(n), OPTIMIZE(n),
high-level language debugger, available AUXIUARY and CONSTANT are (NO)INTVECTOR, (END)ASM, INCLUDE,
from Philips supported. SAVEIRESTORE, (NO)lIST, (NO)SOURCE,
• Supports in-line assembly code • Data can be stored at fixed locations using (NO)CODE, (NO)DEBUG, (NO)OBJECT,
• Optional IEEE single-precision floating AT, or stored dynamically using BASED SET/RESET, EJECT and
point package pointer variables. IF/ElSIF/ElSElENDIF
• Includes several utility programs: pr, grep, Procedures Differences Between Philips' and
aar, cpp, selj51 , oel_051, ocUhex, Intel's PUM-51
ocLieee, ocLsrec, ocUhex, oct_srec, • BIT, BYTE or WORD typed procedures,
makelib and pack retuming a value upon completion • Philips' PUM-51 allows bit-structures to be
• Untyped procedures, invoked with a CAll ATed at byte-variables in bit-addressable
• Utility library included in source code memory
statement
• Combiner performs optimization at load-file • Philips' PUM-51 supports floating point
level (Philips' ASM51 only) • Optional procedure attributes:
- USING(n), specifies the register bank (n) • Invocation and compiler controls are mostly
• Easy tailoring to application and target to be used by the procedure. different
hardware
- INTERRUPT(n), defines an interrupt • Object modules are not generated
• Produces relocatable code and data procedure for interrupt (n).
• Available for many hosts besides the IBM • Error messages are mostly different
PC (MS-DOS), for example: (micro-)VAX, Statements • Different assembly language interfacing
(VMS, Ultrix), HP9OOOI300 (HP-UX), • Control statements: do while ... end, do ... (only for Philips' plm51)
SUN-3 (Sun-OS); available from to ... by ... end
BSOfrasking Software B. V. • Compiler limits always the same or better
• Conditional statements: if ... then ... else ... than Intel's
• Supports optimize(4): intermodule overlay
optimization • Miscellaneous statements: do ... end, do
case ... end, call, goto, enable/disable
• Supports 15 interrupts
• Sourced from BSQlTasking Software B.V., Amersfoort, The Netherlands, which holds all intellectual property rights for this software.
February 1992
Signetics 80C51 ·Based 8·Bit Microcontrollers
Easy Adaptation to Target • Length of a string constant: 254 The software requires an MS·DOS (ReI. 3.0
Environment or higher) computer with a hard disk and at
• Number of cases in a DO CASE block: 84 least 512kbyte RAM installed. Software
Cross--compilers are used to develop
embedded microprocessor applications, • Number of EXTERNAL items: no limit installation is simple, well-documented and
where the hardware environment in which can be verified afterwards using an automatic
• Number of non·EXTERNAL procedures in verification program.
they will run is not fixed beforehand. module: no limit
Adaptation to the target hardware
environment takes place via the files headx. • Number of names in a module: memory
These files are used to define all dependent
system.cfependent set·ups such as the
ORDERING INFORMATION
TYPE NUMBER DESCRIPTION
0M4144 PUM-51 compiler package comprising the PLMTII compiler
Related Producta
0M4142 8051 cross-assembler ,package comprising the ASM51 assembler, and
LlNK51 linker
0M4129 XRAY51 high-level language debugger for the SDS 8051
..
Orders can be placed VIa your local Philips Semiconductors sales representative.
INTRODUCTION is also available on the hosts: (micro)VAX The code-generation layer is driven both by
The BSOffasking C-51 cross-QImpiler (VMS or Ultrix), IBM PC (Xenix), IBM PS/2 the second layer and by a set of tables and
(0M4136) offers a new approach to (OS/2, AIX), IBM RISC System/6oo0, rules reflecting the target assembly language
high-level language programming for the SUN-31-4 (SUN-OS), HP9OO0/300 (HP-UX) and the behavior of individual instructions.
8051 family. It is a very powerful combination and Apollo (UNIX)
of our extensive 8051 knowledge and our • Generates reentrant and relocatable code
ANSI compliant C compilers. the result of this and relocatable data
combination is a compiler that is fast, efficient
IMPLEMENTATION DEPENDENT
and supports all the members of the 8051 • Same calling sequence on all hosts DATA
family. This section oudines features of the C-51
• Same source and generated assembly compiler which, for the most part, are specific
code can be used on all hosts to the 8051 family of microcontrollers.
FEATURES • Automatic installation and self test
• Supports: • Benchmarks and application notes are Complier Options
- Full ANSI Standard available on request The following options are supported:
- All members of the 8051 family -a specify function parameter size
-b specify default register bank number
- Reentrant programming
CLANGUAGE -C specify 8051 derivative type
- Extremely elficient and powerful pointer Although intended as a general purpose -D define named identifier to the
arithmetic high-level programming language, C is preprocessor
- Inline assembly programming perhaps most powerful in the area of -E only run the preprocessor
- Inline expansion of predelined functions real-time system programming for embedded -f read command line options from file
Uol, _ror, etc.) microcontrollers. -g generate high-level debugging
information for XRAY51 hll-debugger
- Full Intel OMF51 and IEEE695 version ANSI C features economy of expression, is -I force preprocessor to look for include
4.0 object formats well defined, has an improved type checking, files in the specified directory
- Data overlay mechanism supports structured and modular -m specify memory sizes for static
- Full calling interface (with parameter programming and has a rich set of data- and allocation checking
passing) to BSOffasking PUM-51 operator-types that map to virtually every -M select memory model
(OM4144) single address space -n write output to screen instead of output
microcontroller/processor. Since the file
- Fast8-bit chararithmetics operators and type definitions generally -0 write output to named output file
- C-Ievel access to chips' SFRs match well with the instruction sets and word -0 controlled optimization
- C-Ievel bit-type and interrupt lengths of most microcontrollers, C is very -r specify ROM size for optimal jump-type
efficient in therms of code size and execution generation
• Generates Intel-QImpatible assembly speed. -R control segment assignment
source -s merge C source with generated
• Outputs symbolic information for source assembly code
COMPILER TECHNOLOGY -S put strings in ROM only
level debugging using XRAY51
The 8051 C compiler was built using the -I do not produce module summary
• Produces very efficient, fast executing and latest compiler technology, including information
reliable code optimization and multi-layering. II is -u remove any initial definition of named
essentially a one pass compiler, translating identifier
• Code is ROMabie
on a function-by-function basis, achieving -v do not generate code for interrupt
• Supports 4 memory models to best meet very fast compilation and a large span for the vectors
application requirements optimization process. A significant effort was -w suppress warning messages
made to obtain a well-defined, layered
• Separate compilation of program modules product.
• Embodies integral standard preprocessor Data Sizes
The top layer basically consists of a lexical
• Is one-pass, fast and compact (no and grammar analyzer with co-routine
intermediate code or files) structures to serve both the pre-processing Type Size (In byles)
and compilation needs. The grammar bit 1 bit
• 3-layer design simplifies maintenance char 1
analyzer is produced by an LALR( 1) parser
• Complete set of UNIX-like compiler options generator, eliminating a potential source of shorlint 2
error. int 2
• Comes with C library and run-time support, long in! 4
including I/O calls (+ printf), memory A second layer separates the actual code float, (long) double 4 (IEEE single
management, floating point, math and generation layer from the top layer and is precision)
arithmetic functions merely intended to simplify re-targeting of the pointer type lor 2'
• C libraries in source code included for compiler to other target processors. II was
designed to represent the translated program 'NOTE: Pointers to data, idatand pdathave
learning and tuning purposes
independent from the language and the a size of 1, whereas pointers to
• The 0M4136 product is for IBM PC DOS target. This is where most of the rom, xdat aod functions have a size
as host. From BSOffasking, the C-compiler optimizations are done. of2.
Memory Models
MODEL DATA ALLOCATION APPLICATION
small static, in on-chip direct addressable RAM (data) fast programs in small environments
auxpage static, in first page of external RAM (pdaQ derivatives with 256 byles on-chip "external" RAM
large static, in external RAM (xdaQ fast, non reentrant with large external RAM
reentrant dynamic + static, in external RAM (xdaQ large, reentrant programs in large environments
ORDERING INFORMATION
TYPE NUMBER DESCRIPTION
OM4136 8051C-compiler package
Releted Products
OM4144 PLM-51 compiler
OM4142 8051 cross-assembler and linker
OM4129 XRAY51 high-level language debugger for the 50S 80.51
..
Orders can be placed VIa your local Philips Semiconductors sales representative .
SoulOOd lrom BSOITasklng Software B.V.. Amersloort. The Netherlands. which holds all Intellectual property rights fot this software.
,. Intel Is a trademarl< of Intel Corporallon.
MS-DOS and XENIX are trademarks of Microsoft Corporation.
XRAY Is a trademark 01 Mlcrotec Research Inc.
UNIX I, a trademark 01 AT&T 8elllaOOralories.
VAX, mIcroVAX, VMS and Uhrlx are trademarks 01 Digital Equipment Corp.
HP9000 and HP·UX are trademarks 0 1 _ Pacl<ard Co.
SUN-3 and SunOS are trademarks of Sun Mlcrosystems Inc.
IBM PC Is a trademark of International BUsiness Machines Corp.
The XRAyTII51 package enables the Variables can be accessed with respect to • Window-oriented display which segregalBs
software developer to monitor and control the the source language in which they had been debugging information into meaningful
execution of a target program using the same defined (i.e., PUM or Assembly). Operating areas
high-lewl or assembly-levellBrms, definitions XRAY51 in Assembly mode, the user can
and structures found in the original source manipulate the contents of all processor • Symbolic debugging with C, PUM-51
progrem. It employs a window-orientBd user regislllrs. Only those regislBrs that are part of variables and C, PUM-51 stalBments
interface which segregalBs the debugging the selected 8051 derivative are allowed to
• Simple and complex breakpoints
information into meaningful areas. Two be accessed.
wrsions of XRAY51 , each with identical user • Single-step execution
intBrface, are available: Macros may be defined that can execute
complex user command procedures and • User-definable screens and
• An emulator wrsion' using Philips' SOS provide a variety of complex breakpoints. viewports-ability to wrilB selectBd
8051 emulation hardware as engine
When debugging with XRAY51 , the user can information
• A simulator wrsion' using a software examine the contents and modify the value of
engine. • Command macros
any variable, compulBthe value of C, PUM
The emulator (debugger) facilitalBs source language expressions and assembly • Breakpoint macros (IimitBd to the number
debugging in real-time on a real target; the level address expressions, and define, of breakpoints of the SOS 8051)
simulator supports debugging in an 8051 remove, or display symbols.
• Command breakpoint macros may contain
environmen~ simulallld in software on the Command files can be used to cirect C statements, including: FOR, WHILE, ~O,
host syslBm. Both wrsions conlrol the XRAY51 to read or write simulated PRINTF, and FPRINTF
execution of the progrem and allow the user microprocessor input/output from or to a file,
to stop, s~ and examine the target allowing easy implementation of automated • On-line conlBxt-sensitive help
software by means of a powerful command test sequences. Command files enable
language that employs C language • Command files
scripts of debugger commands to be
expressions. processed automatically without the need of • Output logging
user interaction.
• Fully supports SOS 8051 with the latest
XRAY51 HIGH-LEVEL XRAY51 also allows a virtually unlimited firmware version
DEBUGGER number of user-defined windows.
The XRAY51 debugger helps to locate • High-Iewltrace
progremming errors in the source code of C,
FEATURES • Trensparent ICE mode for direct control of
PUM or assembly language progrems for the
8051 family of microcontrollers. The user can The XRAY51 debugger has been designed SOS8051
isola these errors by controlling and with the developer of embedded applications • Supports most 8051-derived
monitoring progrem execution. For example, in mind. Its principal features are: microconlroJlers, including the 8OC51131,
the user can single-step through the progrem • Integrated PUM-51 source-language and 87C51 , 8XC451/528/552J5621592165216541
a specif"i9d number of microcontroller assembly-language debugging; toggle by 751/851, 8XCL4101710/51 and the
inslrUctio!,s or high-lewllanguage lines. function key at any lime 8051131/52132.
1M XRAY is a trademark of Microtec Research Inc., which holds all inlBllectual property rights for XRAY51.
• The SOS 8051 emulator version of XRAY51 is available from Philips Semiconductors (type number OM4129) and is sourced from
BSO/Tasking Software B.V., Amersfoo~ The Netherlands. The simulator wrsion is available from BSO/Tasking Software B.V.
ORDERING INFORMATION
TYPE NUMBER DESCRIPTION
OM4129 XRAY51 high-level language debugger for the SDS 8051; M9-DOS
Related Products
OM4142 Cross-assembler package comprising the ASM51 assembler,
and the LlNK51 linker
OM4144 Compiler package comprising the PLMTl1
..
Orders can be placed VIa your local Philips Semiconductors sales representative.
CONTENTS
SCN8049 SERIES
SCN8049, SCN8050, SCN8039, SCN8040 Data Summary. . . . . . . . . . . . . . . . . . . .. 911
Microcontroller 8X30S
FEATURES The 8X305 can fetch, decode, and execute a PIN CONFIGURATION
16-bit instruction in a minimum of 200ns.
• Fetch, Decode, and Execute a IS-bit Within one instruction cycle, the 8-bit
instruction in a minimum of 200ns (one data-processing path can be programmed to N, I PACKAGES
machine cycle)
rolate, mask, shift, anellor merge single or
• Bit-oriented instruction set (addressable mUltiple bit subfields and, in addition, perform VA
single-or-multiple bit subfields) an ALU operation. In the same instruction, an AS
external dala field can be input, processed, AI
• Separate buses for Instruction, Instruction and output to a specified destination-
Address and .Three-Slate 110 likewise, single or multiple bit data fields can AS AtO
ORDERING INFORMATION
DESCRIPTION ORDER CODE
SO-Pin plasticDIP N8X305N
SO-Pin ceramic DIP N8X3051
sa-Pin PLCC N8X305A
Microcontroller 8X401
EXTENDED PACKAGE
TYPE NUMBER PINS PIN POSITION MATERIAL CODE
PCA82C200P 28 OIL plastic SOT117
PCA82C200T 28 S028 plastic SOT136A
CONTENTS
11.0 DC CHARACTERISTICS
12.0 AC CHARACTERISTICS
12.1 AC timing diagrams
12.2 Additional AC information
_ _ (I)
MODE RST INT
2, " 19,
28·23 20
AD710 AXO and
ADO RXI
ClK OUT
10
XTAL2
XTAL1
ALE 13,
14
TXO and
CS TXl
RD
WR
PCA82C200
V SS1
21
V SS2
15
VSS3
12
7Z28091.1
Note to Fig.2.1
ADS
AD4
AD3
AD2
AD'
ADO
V DD ,
VSS2
AX'
XTAL2 AXO
V DD2
V DD3 AST
TXO INT
TX, VSS3
7Z28092
4.1 Pinning
SYMBOL PIN DESCRIPTION
AD7-ADO 2,1,28 - 23 Multiplexed address/data bus.
ALE 3 ALE signal (Intel mode) or AS input signal (Motorola mode).
CS 4 Chip select input, low level allows access to the PCA82C200.
RD 5 RD signal (Intel mode) or E enable signal (Motorola mode) from the microcontroller.
WR 6 WR signal (Intel mode) or RDIWR signal (Motorola mode) from the microcontroller.
CLKOUT 7 Clock output signal produced by the PCA82C200 for the microcontroller. The clock
signal is derived from the built-in oscillator, via the programmable divider (see section
7.5). This output is capable of driving one CMOS or NMOS load.
VSSI 8 Ground potential for the logic circuits.
XTAL1 9 Input to the oscillator's amplifier. External oscillator signal is input via this pin.
(note 1)
XTAL2 10 Output from the oscillator's amplifier. Output must be left open when an external
(note 1) oscillator signal is used.
MODE 11 Mode select input: connected to Voo selects Intel mode; connected to Vss selects
Motorola mode.
VOO3 12 5 V power supply for the output driver.
TXO 13 Output from the output-driver 0 to the physical bus-line.
TX1 14 Output from the output-driver 1 to the physical bus-line.
VSS3 15 Ground potential for the output driver.
INT 16 Interrupt output, used to interrupt the microcontroller (see section 7.2.4). INT is active if
the Interrupt Register contains a logic HIGH bit (present). INT is an open drain output
and is designed to be a wired-OR with other INT outputs within the system. A LOW
level on this pin will reactivate the IC from the sleep mode (see section 7.2.2).
RST 17 Reset input, used to reset the CAN interface (LOW level). Automatic power-ON reset
can be obtained by connecting RST via a capacitor to Vss and via a resistor to Voo (e.g.
C = 1 fLF; R = 50 kf!).
VOD2 18 5 V power supply for the input comparator.
RXO - RX1 19,20 Input from the physical bus-line to the input comparator of the PCA82C200. A
. dominant level will wake-up the PCA82C200. A recessive level is read if RXO is higher
than RX1 and vice versa for the dominant level.
VSS2 21 Ground potential for the input comparator.
VOOI 22 5 V power supply for the logic circuits.
Note
With these facilities the board is a basis for prototype 6.1 Interface Management Logic (IML)
modules; using entirely your own software, the board can
The IML interprets commands from the microcontroller,
be used as a custom, debugged and proven hardware
allocates the message buffers (TBF, RBFO and RBF1) and
module.
provides interrupts and status information to the
microcontroller.
5.2 Advanced support
For further development support, Philips subcontractor 6.2 Transmit Buffer (TBF)
I+ME offers a complete set of development tools
The TBF is a 10 byte memory into which the
including:
microcontroller writes messages which are to be
transmitted over the CAN network.
6.3 Receive Buffers (RBFO and RBF1) 7.0 CONTROL SEGMENT AND MESSAGE BUFFER
The RBFO and RBF1 are each 10 byte memories which DESCRIPTION
are alternatively used to store messages received from The PCA82C200 appears to a microcontroller as a
the CAN network. The CPU can process one message memory-mapped I/O device due to the on-chip RAM,
while another is being received. guaranteeing the independent operation of both devices.
I
Control Segment Co
Control Register 0 Test Mode Synch reserved Overrun Error Transmit Receive Reset Request d>
Interrupt Interrupt· Interrupt Interrupt o
:::l
Enable Enable Enable Enable CD l!/
Command 1 reserved reserved reserved GotoSleep Clear Release Abort Transmission
I
(')
Register Overrun
Status
Receive
Buffer
Transmission Request
»
z
Status Register 2 Bus Status Error Transmit Receive Transmission Transmit Data Overrun Receive Buffer I
ADDRESS
CONTROL
COMMAND
STATUS
INTERRUPT
ACCEPTANCE CODE
control segment
ACCEPTANCE MASK
BUS TIMING 0
BUS TIMING 1
OUTPUT CONTROL
TEST
10 IDENTIFIER,
} descrlplm
11 RTR BIT, DATA LENGTH CODE
12 BYTE 1
13 BYTE 2
14 BYTE 3
transmit buffer
15 BYTE 4
data field
16 BYTE 5
17 BYTE 6
18 BYTE 7
19 BYTE 8
20 IDENTIFIER, IDENTIFIER,
} descriptor
21 RTR BIT, DATA LENGTH CODE RTR BIT, DATA LENGTH CODE
22 BYTE 1 BYTE 1
23 BYTE 2 BYTE 2
24 BYTE 3 BYTE 3
receive buffer 0 or 1
25 BYTE 4 'BYTE 4
data field
26 BYTE 5 BYTE 5
27 BYTE 6 BYTE 6
28 BYTE 7 BYTE 7
29 BYTE 8 BYTE 8
Table 7.4 Effects of setting the Reset Request bit HIGH (present).
TYPE BIT EFFECT
Control Test Mode LOW (disabled)
Command Goto Sleep LOW (wake-up)
Clear Overrun Status HIGH (clear)
Release Receive Buffer HIGH (released)
Abort Transmission LOW (absent)
Transmission Request LOW (absent)
Status Bus Status LOW (Bus-On), see note 1
Error Status LOW (no error), see note 1
Transmit Status LOW (idle)
Receive Status LOW (idle)
Transmission Complete Status HIGH (complete)
Transmit Buffer Access HIGH (released)
Data Overrun LOW (absent)
Receive Buffer Status LOW (empty)
Interrupt Overrun Interrupt LOW (reset)
Transmit Interrupt LOW (reset)
Receive Interrupt LOW (reset)
Notes to Table 7.6 5. The PCA82C200 will enter sleep mode, if Goto Sleep
is set HIGH (sleep), there is no bus activity and
1. If the Transmission Request bit was set HIGH in a
INT = HIGH (inactive). After sleep mode is set, the ClK
previous command, it cannot be cancelled by setting
OUT signal continues until at least 15 bit times have
the Transmission Request bit lOW (absent).
passed. The PCA82C200 will wake up when one of the
Cancellation of the requested transmission may be
three previously mentioned conditions is negated:
performed by setting the Abort Transmission bit HIGH
after Goto Sleep is set lOW (wake up), there is bus
(present).
activity or INT is driven lOW (active). On wake up, the
2. The Abort Transmission bit is used when the
oscillator is started and a Wake-Up Interrupt (see
microcontroller requires the suspension of the
section 7.2.4) is generated. A PCA82C200 which is
previously requested transmission, for example to
sleeping and then awoken by bus activity will not be
transmit an urgent message. A transmission already in
able to receive this message until it detects a Bus-Free
progress is not stopped. In order to determine if the
Signal (see section 9.9.6).
original message had been transmitted successfully,
or aborted, the Transmission Complete status bit
should be checked after the Transmit Buffer Access bit 7.2.3 STATUS REGISTER (SR)
has been set HIGH (released) or a Transmit Interrupt
The contents of the Status Register reflect the status of
has been generated (see section 7.2.4).
the PCA82C200 bus controller. The Status Register
3. After reading the contents of the Receive Buffer (RBFO
appears to the microcontroller as a read only memory.
or RBF1) the microcontroller must release this buffer
by setting the Release Receive Buffer bit HIGH
(released). This may result in another message Table 7.7 StatusHegister bits.
becoming immediately available.
SR : ADDRESS 2
4. This command bit is used to acknowledge the Data
BIT SYMBOL FUNCTION
Overrun condition signalled by the Data Overrun
status bit. It may be given or set at the same time as a SR.7 BS Bus Status
SR.6 ES Error Status
Release Receive Buffer command bit. SR.5 TS Transmit Status
SR.4 RS Receive Status
SR.3 TCS Transmission Complete Status
SR.2 TBS Transmit Buffer Status
SR.1 DO Data Overrun
SR.O RBS Receive Buffer Status
Notes to Table 7.8 The Transmission Complete Status bit is set LOW
(incomplete) whenever the Transmission Request bit is
1. If the command bit Release Receive Buffer is set HIGH set HIGH (present). If an Abort Transmission comrnand
(released) by the microcontroller, the Receive Buffer is issued, the Transmit Buffer will be released. If the
Status bit is set LOW (ernpty) by IML. When a new message, which was requested and then aborted, was
message is stored in any of the receive buffers, the not transmitted, the Transmission Complete Status bit
Receive Buffer Status bit is set HIGH (full) again. will remain LOW.
2. If Data Overrun = HIGH (Overrun) is detected, the 4. If both the Receive Status and Transmit Status bits are
currently received message is dropped. LOW (idle) the CAN-bus is idle.
A transmitted message, granted acceptance, is also 5. When the Bus Status bit is set HIGH (Bus-Off), the
stored in a Receive Buffer. This occurs because it is PCA82C200 will set the Reset Request bit HIGH
not known if the PCA82C200 will lose arbitration and (present). It will stay in this state until the
so becorne a receiver of the message. If no receive microcontroller sets the Reset Request bit LOW
buffer is available, Data Overrun is signalled. (absent). Once this is completed the PCA82C200 will
3. If the microcontroller tries to write to the Transmit wait the minimum protocol-defined time
Buffer when the Transmit Buffer Access bit is LOW (128 occurrences of the Bus-Free signal) before
(locked), the written bytes will not be accepted and will setting the Bus Status bit LOW (Bus-On), the Error
be lost without this being signalled. Status bit LOW (OK) and resetting the Error Counters.
7.2.5 ACCEPTANCE CODE REGISTER (ACR) 7.2.6 ACCEPTANCE MASK REGISTER (AMR)
The Acceptance Code Register is part of the acceptance The Acceptance Mask Register is part of the acceptance
filter of the PCA82C200. This register can be accessed filter of the PCA82C200. This register can be accessed
(read/write), if the Reset Request bit is set HIGH (present). (read/write) if the Reset Request bit is set HIGH (present).
When a message is received which passes the The Acceptance Mask Register qualifies which of the
acceptance test and if there is an empty Receive Buffer, corresponding bits of the acceptance code are 'relevant'
then the respective Descriptor and Data Field (see Fig 7.1) or 'do not care' for acceptance filtering.
are sequentially stored in this empty buffer. In the case
that there is no empty Receive Buffer, the Data Overrun
Table 7.12 Acceptance Mask Register bits.
bit is set HIGH (overrun), see sections 7.2.3 and 7.2.4.
When the complete.message has been correctly received AMR : ADDRESS 5
the following occurs: 7 I 6 I 5 I 4 I 3 I 2 I 1 I
0
I
AM.? AM.61 AM.51 AM.41 AM.31 AM.21 AM.1 I AM.O
• the Receive Buffer Status bit is set HIGH (full)
• if the Receive Interrupt Enable bit is set HIGH (enabled),
the Receive Interrupt is set HIGH (set).
7.2.7 Bus TIMING REGISTER 0 (BTR 0) 7.2.B Bus TIMING REGISTER 1 (BTR 1)
The contents of Bus Timing Register 0 defines the values The contents of Bus Timing Register 1 defines the length
of the Baud Rate Prescaler (BRP) and the Synchronization of the bit period, the location of the sample point and the
Jump Width (SJW). This register can be accessed (read/ number of samples to be taken at each sample point. This
write) if the Reset Request bit is set HIGH (present). register may be accessed (read/write) if the Reset
Request bit is set HIGH (present).
To compensate for phase shifts between clock oscillators hSEG1 = tscL(BTSEG1.3 + 4TSEG1.2 + 2TSEG1.1 +
of different bus controllers, any bus controller must TSEG1.0 + 1)
resynchronize on any relevant signal edge of the current
transmission. The synchronization jump width defines the tTSEG2 =tscL(4TSEG2.2 + 2TSEG2.1 + TSEG2.0 + 1)
maximum number of clock cycles a bit period may be
shortened or lengthened by one resynchronization: For further information on bus timing see sections 7.2.7
and B.O.
tSJW =tscL(2SJW.1 + SJW.O + 1)
The Output Control Register allows, under software For the TXO pin this is the same as in Normal Output
control, the set-up of different output driver Mode. To measure the delay time of the transmitter and
configurations. This register may be accessed (read/write) receiver this mode connects the output of the input
if the Reset Request bit is set HIGH (present). comparator (COMP OUT) with the input of the output
driver TX1. This mode is used for production testing only.
If the PCA82C200 is in the sleep mode
=
(Goto Sleep HIGH) a recessive level is output on the TXO
and TX1 pins. If the PCA82C200 is in the reset state
(Reset Request = HIGH) the output drivers are floating.
The following two tables, Table 7.18 and Table 7.19, show
the relationship between the bits of the Output Control
Register and the two serial output pins TXO and TX1 of the
PCA82C200, connected to the serial bus (see Fig.2.1 ).
PCA82C200
OCTPl ceTPO
voo
TPO
GepOLO
aCPOL 1 TXO
OCMODEO
TNO
DeMODE1
OUTPUT V55
TXO CONTROL
LOGIC Voo
TXCLK
TPl
TXl
TN1
V55
oeTN1 aCTNO
7Z28095
7.3 Transmit Buffer layout of a Remote Frame transmission the Data Length Code is
not considered due to the RTR bit being HIGH (remote).
The global layout of the Transmit Buffer is shown in
This forces the number of transmitted/received data bytes
Fig. 7.1. This buffer serves to store a message from the
to be O. Nevertheless, the Data Length Code must be
microcontroller to be transmitted by the PCAB2C200. It is
specified correctly to avoid bus errors, if two CAN-
subdivided into Descriptor and Data Field. The Transmit
controllers start a Remote Frame transmission
Buffer can be written to and read from by the
simultaneously.
microcontroller (see note 1 to Table 7.3).
Table 7.20 Descriptor Byte 1 (DSCR1). Data Byte Count =BDLC.3 + 4DLC.2 + 2DLC.l + DLC.O
DSCR1:ADDRESS10
7 I 6 I 5 I 4 I 3 I 2 I 1 T 0 For reasons of compatibility no Data Byte Counts other
10.10 I 10.9 I ID.B I 10.7 I 10.6 I 10.5 I 10.4 I 10.3 than 0 to B should be used.
Table 7.21 Descriptor Byte 2 (DSCR2). The number of transferred data bytes is determined by
DSCR2 : ADDRESS 11 the Data Length Code. The first bit transmitted is the
most significant bit of data byte 1 at address 12.
7 I 6 I 5 I 4 I 3 I 2 I 1 I 0
10.2 I 10.1 T 10.0 I RTR IDLC.3IDLC.2TDLC.l1DLC.0
7.4 Receive Buffer layout
Identifier (/0) The layout of the Receive Buffer and the individual bytes
The Identifier consists of 11 bits (10.10 to 10.0). 10.10 is the correspond to the definitions given for the Transmit Buffer
most significant bit, which is transmitted first on the bus layout, except that the addresses start at 20 instead of 10
during the arbitration process. The Identifier acts as the (see Fig 7.1).
message's name, used in a receiver for acceptance
filtering, and also determines the bus access priority 7.5 Clock Divider Register (CDR)
during the arbitration process. The lower the binary value
of the Identifier the higher the priority. This is due to the The Clock Divider Register controls the CLK OUT
larger number of leading dominant bits during arbitration frequency for the microcontroller (see Fig.2.1). It can be
(see section 5). written to or read by the microcontroller. The default state
of the register is divided by 12 for Motorola mode and
divided by 2 for Intel mode. Values from 0 to 7 may be
Remote Transmission Request bit (RTR) written into this register and will result in the CLK OUT
frequencies shown in Table 7.24.
Table 7.22 Description of the RTR bit.
BIT VALUE COMMENTS
Table 7.23 Clock Divider Register bits.
RTR HIGH Remote Frame will be transmitted
by the PCAB2C200 CDR: ADDRESS 31
LOW Data Frame will be transmitted by 7 6 5 1 4 3 2 I 1 0
I I I I I
the PCAB2C200.
- I - I - I - I - I CD.21 CD.l I CD.O
Table 7.24 ClK OUT frequency selection. • samples the bus-line level using majority logic
CO.2 CO.1 CO.D ClK OUT FREQUENCY (programmable, 1 or 3 samples)
• Synchronization to the bit stream:
a a a fCLK/2
a a 1 fCLK/4
a 1 a fCLKi6 - Hard synchronization at the start of a message
a 1 1 fCLK/B - Resynchronization during transfer of a message.
1 a a fCLK/10
1 a 1 fCLK/12
1 1 a fCLK/14 The configuration of the BTL is performed during the
1 1 1 fCLK initialization of the PCAB2C200. The BTL uses the
following three registers:
Note: fCLK is the frequency of the oscillator
• Control register (Synch)
• Bus Timing Register a
8.0 BUS TIMING/SYNCHRONIZATION • Bus Timing Register 1.
- . SYNC.SEG t--
I I
t
sample point
(a)
- - tSYNCSEG t--
-+----+--------------~I------~--#
transmit p o j I.- t
1 clock cycle (tSCL)
sample paint MEA010· 1
(b)
The incoming edge of a bit is expected during this state; SJW defines the maximum number of clock cycles (tscLl
this state corresponds to one system clock cycle a bit period may be reduced or increased by one
(1 x tscu. resynchronization. SJW is programmable from 1 to 4
system clock cycles (see section 7.2.7).
• additional time at the sample point for calculation of the 8.2.1 HARD SYNCHRONIZATION
subsequent bit levels (e.g. arbitration) This type of synchronization occurs only at the beginning
• synchronization buffer segment directly after the of a message. The PCA82C200 synchronizes on the first
sample point (see section 8.1.2). incoming recessive-to-dominant edge of a message
TSEG2 is programmable from 1 to 8 system clock cycles (being the leading edge of a message's Start-Of-Frame
(see section 7.2.8). bit; see section 8.1).
Note: TSEG1, TSEG2 and SJW are the programmed 9.0 COMMUNICATION PROTOCOL
numerical values.
9.1 Frame types
The phase error (e) of an edge is given by the position of
the edge relative to SYNCSEG, measured in system clock The PCA82C200 bus controller supports the four different
cycles (tseLl. The value of the phase error is defined as: CAN protocol frame types for communication:
• Start-Of-Frame
• Arbitration Field
• Control Field
• Data Field (may have a length of zero)
• CRCField
• Acknowledge Field
• End-Of~Frame.
}l
i
~~::~.OF. -I
1 l--~\\\\\\\\\~ VII 1Y flr-r-Tlll--r-r-IIr-r711--r-r-1I1T"T'Tn--.--r-~-+--!r--_ --1----7-_ ~::;':~:: ,':::,'
rTT"'l1
~
ACKNOWLEDGE - I-- :
ARBITRATION ____
FIELD:
I
FIELD
ACKSlot
ACK Delimiter
l-
:
Identifier
RlR bit ~~~~:,~II:- DATA FIELD I~ END·OF·FRAME
Cod.
a to e bytes CRe FIELD
CRe Sequence
CRe Delimiter
7Z2B097.1
. Consists of the message Identifier and the RTR bit (see An Identifier does not define which particular
section 7.3.1). In the event of simultaneous message PCA82C200 will receive the frame, because a CAN
transmissions by two or more PCA82C200's the bus base communication network does not discriminate
access conflict is solved by bit-wise arbitration, whic~ is between a point-to-point, multicast or broadcast
active during the transmission of the Arbitration Field. communication.
Remote Transmission Request bit (RTR) the code word can be detected by the absence of the
CRC Delimiter (recessive bit).
A PCA82C200, acting as a receiver for certain information
may initiate the transmission of the respective data by
transmitting a Remote Frame to the network, addressing 9.2.6 ACKNOWLEDGE FIELD (ACK)
the data source via the Identifier and setting the RTR bit The Acknowledge Field consists of two bits, the
HIGH (remote; recessive bus level). If the data source Acknowledge Slot and the Acknowledge Delimiter, which
simultaneously transmits a Data Frame containing the are transmitted with a recessive level by the transmitter of
requested data, it uses the same Identifier. No bus access the Data Frame. All PCA82C200's having received the
conflict occurs due to the RTR bit being set LOW (data; matching CRC Sequence, report this by overwriting the
dominant bus level) in the Data Frame. transmitter's recessive bit in the Acknowledge Slot with a
dominant bit (see section 9.9.2). Thereby a transmitter,
9.2.3 CONTROL FIELD still monitoring the bus level recognizes that at least one
receiver within the network has received a complete and
This field consists of six bits. It includes two reserved bits correct message (i.e. no error was found). The
(for future expansions of the CAN-protocol), transmitted Acknowledge Delimiter (recessive bit) is the second bit of
with a dominant bus level, and is followed by the Data the Acknowledge Field. As a result, the Acknowledge Slot
Length Code (4 bits). The number of bytes in the is surrounded by two recessive bits: the CRC Delimiter
(destuffed; number of data bytes to be transmitted/ and the Acknowledge Delimiter.
received) Data Field is indicated by the Data Length Code.
Admissible values of the Data Length Code and hence the All nodes within a CAN network may use all the
number of bytes in the (destuffed) Data Field, are 0 to 8. A information coming to the network by the PCA82C200's
logic 0 (logic 1) in the Data Length Code is transmitted as (shared memory concept). Therefore, acknowledgement
a dominant (recessive) bus level, respectively. and error handling are defined to provide all information in
a consistent way throughout this shared memory. Hence,
there is no reason to discriminate different receivers of a
9.2.4 DATA FIELD message in the acknowledge field. If a node is
disconnected from the network due to bus failure, this
The data, stored within the Data Field of the Transmit
particular node is no longer part of the shared memory. To
Buffer, are transmitted according to the Data Length
identify a "lost node" additional and application specific
Code. Conversely, data of a received Data Frame will be
precautions are required.
stored in the Data Field of a Receive Buffer. Data is stored
byte-wise both for transmission by the micro controller
and on reception by the PCA82C200. The most 9.2.7 END-OF-FRAME
significant bit of the first data byte (lowest address) is
Each Data Frame or Remote Frame is delimited by the
transmitted/received first.
End-Of-Frame bit sequence which consists of seven
recessive bits (exceeds the bit stuff width by two bits).
9.2.5 CYCLIC REDUNDANCY CODE FIELD (CRG) Using this method a receiver detects the end of a frame
independent of a previous transmission error because the
The CRC Field consists of the CRC Sequence (15 bits)
receiver expects all bits up to the end of the CRC
and the CRC Delimiter (1 recessive bit). The Cyclic
sequence to be coded by the method of bit-stuffing (see
Redundancy Code (CRG) encloses the destuffed bit
section 9.7.3 Coding/Decoding). The bit-stuffing logic is
stream of the Start-Of-Frame, Arbitration Field, Control
deactivated during the End-Of-Frame sequence.
Field, Data Field and CRC Sequence. The most
significant bit of the CRC Sequence is transmitted/
received first. This frame check sequence, implemented
in the PCA82C200, is derived from a cyclic redundancy
code best suited for frames with a total bit count of less
than 127 bits, see section 9.8.3. With Start-Of-Frame
(dominant bit) included in the code word, any rotation of
9.3 Remote Frame Frame to CRC Delimiter, or destroys the fixed form of the
fields Acknowledge Field or End-Of-Frame (see Fig 9.1).
A PCA82C200, acting as a receiver for certain information
Consequently, all other PCA82C200's detect an error
may initiate the transmission of the respective data by
condition and start transmission of an Error Flag.
transmitting a Remote Frame to the network, addressing
Therefore the sequence of dominant bits, which can be
the data source via the Identifier and setting the RTR bit
monitored on the bus, results from a superposition of
HIGH (remote; recessive bus level). The Remote Frame is
different Error Flags transmitted by individual
similar to the Data Frame with the following exceptions:
PCA82C200's. The total length of this sequence varies
between six (min) and twelve (max) bits.
• RTR bit is set HIGH
• Data Length Code is ignored.
An error-passive PCA82C200 (see section 9.9) detecting
• no Data Field contained.
an error condition tries to signal this by transmission of a
Note that the Data Length Code value should be the same Passive Error Flag. The error-passive PCA82C200 waits
as for the corresponding Data Frame (although this is for six consecutive bits with identical polarity, beginning
ignored for a Remote Frame). at the start of the Passive Error Flag. The Passive Error
Flag is complete when these six identical bits have been
A Remote Frame is composed of six different bit fields: detected.
• Start-Of-Frame
9.4.2 ERROR DELIMITER
• Arbitration Field
• Control Field The Error Delimiter consists of eight recessive bits and
• CRC-Field has the same format as the Overload Delimiter. After
• Acknowledge Field transmission of an Error Flag, each PCA82C200 monitors
• End-Of-Frame. the bus-line until it detects a transition from a dominant-
to-recessive bit level. At this point in time, every
See section 9.2 for a more detailed explanation of the PCA82C200 has finished sending its Error Flag and all
Remote Frame bit fields. PCA82C200's start transmission of seven recessive bits
(plus the recessive bit at dominant-to-recessive
tranSition, results in a total of eight recessive bits). After
9.4 Error Frame
this event and an Intermission Field all error-active
The Error Frame consists of two different fields. The first PCA82C200's within the network can start a transmission
field is accomplished by the superimposing of Error Flags simultaneously.
contributed from different PCA82C200s. The second field
is the Error Delimiter (see Fig.9.2). If a detected error is Signalled during transmission of a
Data Frame or Remote Frame, the current message is
spoiled and a retransmission of the message is initiated.
9.4.1 ERROR FLAG
There are two forms of an Error Flag: If a PCA82C200 monitors any deviation of the Error
Frame, a new Error Frame will be transmitted. Several
• Active Error Flag, consists of six consecutive dominant consecutive Error Frame's may result in the PCA82C200
bits becoming error-passive and leaving the network
• Passive Error Flag, consists of six consecutive unblocked.
recessive bits unless it is overwritten by dominant bits
from other PCA82C200's. In order to terminate an Error Flag correctly, an error-
passive CAN bus controller requires the bus to be Bus-
An error-active PCA82C200 (see section 9.9) detecting an Idle (see section 9.6.2) for at least three bit periods (if
error condition signals this by transmission of an Active there is a local error at an error-passive receiver).
Error Flag. This Error Flag's form violates the bit-stuffing Therefore a CAN bus should not be 100% permanently
law (see section 9.7.3) applied to all fields, from Start-Of- loaded.
I
Tm W
-
_
1 ERROR FLAG
~~:~;~~~~~ of
LJ . - ERROR DELIMITER
J
7Z28098.1
The Overload Frame consists of two fields, the Overload The Overload Flag consists of six dominant bits and has a
Flag and the Overload Delimiter. There are two conaiIions similar format to the Error Flag.
in the CAN-protocol which lead to the transmission of an
Overload Flag: The Overload Flag's form corrupts the fixed form of the
Intermission Field. All other PCA82C200's detecting the
• condition 1; receiver circuitry require more time to overload condition also transmit an Overload Flag
process the current data before receiving the next (condition 2).
frame (receiver not ready)
• condition 2; detection of a dominant bit during 9.5.2 OvERLOAD DELIMITER
Intermission Field (see section 9.6.1). The Overload Delimiter consists of eight recessive bits
and takes the same form as the Error Delimiter. After
The transmission of an Overload Frame may only start: transmission of an Overload Flag, each PCA82C200
monitors the bus-line until it detects a transition from a
• condition 1; during the first bit period of an expected dominant-to-recessive bit level. At this point in time, every
Intermission Field PCA82C200 has finished sending its Overload Flag and
• condition 2; one bit period after detecting the dominant all PCA82C200's start simultaneously transmitting seven
bit during Intermission Field. more recessive bits.
9.6.1 INTERMISSION FIELD A Data Frame has higher priority than a Remote Frame
due to its RTR bit having a dominant level.
The Intermission Field consists of three recessive bits.
During an Intermission period, no frame transmissions
For every Data Frame there is an unique transmitter. For
will be started by any PCA82C200. An Intermission is
required to have a fixed time period to allow a CAN- reasons of compatibility with other CAN-bus controllers,
use of the Identifier bit pattern ID =1111111XXXXb
controller to execute·internal processes prior to the next
receive or transmit task. (X being bits of arbitrary level) is forbidden. The number of
available different Identifiers is 2032 (2 11 - 24).
9.6.2 Bus-IDLE
9.7.3 CODING/DECODING
The Bus-Idle time may be of arbitrary length (min. 0 bit).
The following bit fields are coded using the bit-stuffing
The bus is recognized to be free and a CAN-controller
technique:
having information to transmit may access the bus. The
detection of a dominant bit level during Bus-Idle on the
bus is interpreted as the Start-Of-Frame. • Start-Of-Frame
• Arbitration Field
• Control Field
9.7 Bus organization • Data Field
Bus organization is based on five basic rules described in • CRC Sequence.
the following paragraphs.
When a transmitting PCA82C200 detects five
consecutive bits of identical polarity to be transmitted, a
9.7.1 Bus ACCESS complementary (stuff) bit is inserted into the transmitted
PCA82C200's only start transmission during the Bus-Idle bit-stream.
state. All PCA82C200's synchronize on the leading edge
of the Start-Of-Frame (hard synchronization). When a receiving PCA82C200 has monitored five
consecutive bits with identical polarity in the received bit
streams of the above described bit fields, it automatically
9.7.2 ARBITRATION deletes the next received (stuff) bit. The level of the
If two or more PCA82C200's simultaneously start deleted stuff bit has to be the complement of the previous
transmitting, the bus access conflict is solved by a bit- bits; otherwise a Stuff Error will be detected and signalled
wise arbitration process during transmission of the (see section 9.8.2).
Arbitration Field.
The remaining bit fields or frames are of fixed form and
During arbitration every transmitting PCA82C200 are not coded or decoded by the method of bit-stuffing.
compares its transmitted bit level with the monitored bus
level. Any PCA82C200 which transmits a recessive bit The bit-stream in a message is coded according to the
and monitors a dominant bus level immediately becomes Non-Return-to-Zero (NRZ) method, Le. during a bit
the receiver of the higher priority message on the bus period, the bit level is held constant, either. recessive or
without corrupting any information on the bus. dominant.
Each message contains an unique Identifier and a RTR bit
describing the type of data within the message. The
9.7.4 ERROR SIGNALLING
Identifier togetherwith the RTR bit implicitly define the
message's bus access priority. During arbitration the A PCA82C200 which detects an error condition,
most significant bit of the Identifier is transmitted first and transmits an Error Flag. Whenever a Bit Error, Stuff Error,
the RTR bit last. The message with the lowest binary Form Error or an Acknowledgement Error is detected,
value of the Identifier and RTR bit has the highest priority. transmission of an Error Flag is started at the next bit.
Whenever a CRC Error is detected, transmission of an Overload Frame during Intermission Field does not initiate
Error Flag starts at the bit following the Acknowledge the retransmission of any previous Data Frame or Remote
Delimiter, unless an Error Flag for another error condition Frame.
has already started. An Error Flag violates the bit-stuffing
law or corrupts the fixed form bit fields. A violation of the If a CAN-controller which transmitted an Overload Frame
bit-stuffing law affects any PCA82C200 which detects the monitors any deviation of its fixed form, it transmits an
error condition. These devices will also transmit an Error Error Frame.
Flag.
The microcontrolier must be informed when there are A transmit error which exceeds 255 error points results in
long-lasting disturbances and when bus activities have the PCA82C200 entering the Bus-Off state.
Signetics Microcontroller Products Product specification
Notes
1. lOT is allowed in case of a bus failure condition because then the TX-outputs are switched off automatically after a
short time (Bus-Off state). During normal operation lOT is a peak current, permitted for t < 100 ms. The average
output current must not exceed 10 mA for eac;h TX-output.
2. The value is based on the maximum allowable die temperature and the thermal resistance of the package, not on
device power consumption. .
11.0 DC CHARACTERISTICS
Voo = 5 V ±10%; Vss = 0 V; Tarrb =-40 to +125 °C; unless otherwise specified.
V OH ' Output voltage HIGH IOH = -BO /!A; all outputs except 2.4 - V
TXO, TX1, INT and CLK OUT
V OH2 CLK OUT voltage HIGH IOH = -80/!A O.BVoo - V
±ILI Input leakage current 0.45 < VI < Voo; all inputs except - 10 /!A
XTAL 1, RXO and RX1
100 Supply current fCLK = 16 MHz; RST = Rss; - 15 mA
see note 1
Ism Sleep mode supply current oscillator inactive; see note 2 - 40 /!A
CAN input comparator
Voo = 5 V ±5%;
1.4 V < VI < V DO - 1.4 V
±VOIF Differential input voltage note 3 42 - mV
VHYST Hysteresis voltage note 3 12 45 mV
±I, Input current - 400 nA
CAN output driver
Voo = 5 V ±5%
VOLT TXO and TX1 output voltage 10 = 1.2 mA; note 3 - 0.1 V
LOW 10 = 10mA - 1.0 V
V OHT TXO and TX1 output voltage 10 = 1.2 mA; note 3 Voo - 0.1 - V
HIGH 10 = 10 mA Voo - 1.0 - V
Notes
1. (ADO - AD7) ALE = RD = WR = CS = Voo; MODE = Vss; RXO = 2.7 V; RX1 = 2.3 V;
XTAL 1 = 0.5VNoo - 0.5 V; all outputs unloaded.
2. (ADO - AD7) = ALE = RD = WR = INT = RST = CS = MODE = RXO = Voo; RX1 = XTAL 1 = Vss; all
outputs unloaded.
3. Not tested during production.
12.0 AC CHARACTERISTICS
VDD = 5 V ±10%; VSS = 0 V; CL = 50 pF (output pins); Tamb = -40°C to + 125 °C; unless otherwise specified (note 1)
SYMBOL PARAMETER CONDITIONS MIN. MAX. UNIT
fCLK Oscillator frequency 3 16 MHz
tSU1 Address set-up to ALE/AS LOW 10 - ns
tHD1 Address hold time 22 - ns
tPW1 ALE/AS pulse width 60 - ns
tVD1 RD LOW to valid data output Intel mode - 148 ns
tVD2 E HIGH to valid data output Motorola mode - 148 ns
tDF1 Data float after RD HIGH Intel mode 10 55 ns
tDF2 Data float after E LOW Motorola mode 10 55 ns
tSU2 Input data set-up to WR HIGH Intel mode 30 - ns
tHD2 Input data hold after WR HIGH Intel mode 13 - ns
tHH1 WR HIGH to next ALE/AS HIGH 23 - ns
tSU3 Input data set-up to E LOW Motorola mode 30 - ns
tHD3 Input data hold after E LOW Motorola mode 25 - ns
tLL1 ALE LOW to WR LOW Intel mode 10 - ns
tLL2 ALE LOW to RD LOW Intel mode 10 - ns
tLH1 AS LOW to E HIGH Motorola mode 10 - ns
tSU4 Set-up time of RDIWR to E HIGH Motorola mode 20 - ns
tPW2 WR pulse width Intel mode 170 - ns
tPW3 RD pulse width Intel mode 170 - ns
tPW4 E pulse width Motorola mode 170 - ns
tLL3 CS LOW to WR LOW Intel mode 0 - ns
tLL4 CS LOW to RD LOW Intel mode 0 - ns
tLH2 CS LOW to E HIGH Motorola mode 0 - ns
Input comparator/output driver
Voo=5 V±5%
Sum of the input and output VOIF =±42mV -
tsd 62 ns
delays
1.4 V < VI < Voo -1.4 mV
ADO to
DO to 07
AD7
ALE
AD
t PW3 -------+-
WA
7Z2B099.1
ADO to
DO to 07
AD7
tLH1 - - - - -
AS
RD/WR
tpW4 ----I
CS
7Z28100.2
ADO to
DO to 07
AD7
-J -
tHDl f.-
tSUl f.- I-- 'SU2 'HD2-
ALE
---1 1\ I
I+-- 'PWI-'
f.- 'LLI
- . tHHl
.
AD
I--- 'PW2-
\ I
WA
I~ j
'LL3 .
lZ28101.1
ADO 10
DO to 07
AD7
'SU3
AS
RD/WR
CS
7Z28102.2
V OD3
VOD1
vOD2
RXD
LOGIC
t> TXD
RX1
V SS1
VSS3
7Z28093
• Driving circuit for external PNP SYMBOL PARAMETER CONDITIONS MIN. TYP. MAX. UNIT
power transistor with adjustable VDD supply voltage +5.7 - +24 V
output voltage via sense path, IQ quiescent current 380 - ~
short-circuit protected Isb standby output 50 - - rnA
• Additional 5 Vl50 rnA output for current
RAM buffering, short-circuit Vsb standby output +4.9 - +5.1 V
protected voltage
• Operating voltage range: 5.7 V to L load regulation 1 - mVi
rnA
24V
• Reset with adjustable trigger pulse IOlp) driving current 10 - rnA
external PNP
length activated by output voltage
<4.6V
G transconductance - +1.5 - rnA!
(sense input) mV
• Watchdog with adjustable input operating ambient VDD= 13V
Tamb
trigger window temperature range Isb = 50 rnA
• Dual polarity reset and watchdog SOT27 -40 - +130 °C
output pulse SOT163A -40 - +85 °C
• Low line detection adjustable by Ptot total power see
dissipation Fig.7
external resistor ratio
• Enable input to activate watchdog
and driving circuit ORDERING INFORMATION
• Low quiescent current typical:
EXTENDED PACKAGE
380~A
• Thermal protection
TYPE NUMBER PINS I PIN POSITION I MATERIAL I CODE
UAA1300 14 I DIL I plastic I SOT27
GENERAL DESCRIPTION
UAA1300T 20 I mini-pack I plastic I SOT163A
The UAA 1300 is a bipolar IC voltage
regulator especially designed for use
within an automotive environment
and also suitable to provide
enhanced facilities within many
microcontroller applications. The
UAA1300 provides two stabilized
low-drop outputs and offers special
control functions to increase system
protection and reliability.
UAA1300
VDD-'~-------------------------------------------' Vss
EN-.~------~------------~----------~--~
WDI
EN
LLI
EN n.c.
LLI LLD
LLD WOI
CT3
CT3
CT2
WRD
MLA146
PINNING
PIN
SYMBOL DESCRIPTION
SOT27 SOT163A
GTl 1 1 reset-length
Vst,llsb 2 2 standby output: 5 Vl50 mA
Voo 3 5 supply voltage (line)
IOlp) 4 6 driving current external pnp
VSI 5 7 sense input external pnp
WRO 6 9 watchdog reset output active LOW
WRO 7 10 watchdog reset output active HIGH
VSS 8 11 ground
GT2 9 12 maximum watchdog period
GT3 10 14 minimum watchdog period
WDI 11 15 watchdog input
LLO 12 16 low line output
LLI 13 19 low line input
EN 14 20 enable input
minimum
1--r-......---,-"+- watchdog
period
watchdog
reset oul
active LOW
maximum
J-;-~'-r-''+- watchdog
panod
watchdog
reset out
ac!lveHIGH
ground
MLAI51
UAA1300
Rl STAND-BY SUPPLY,
SHORT-CIRCUIT
PROTECTION
+
R2 J;C3
4 IOlp)
R3 I C3
C4
------lII-------1----l
watchdog-in
MLA150
HIGH LOW
watchdog-reset-out
I reset-length
FUNCTIONAL DESCRIPTION Vst/Isb) < 4.6 V, the watchdog output WROIWRO activated by watchdog
stage is triggered by a signal from the input pulse (WDI) timing
The following features of the voltage sense stages and forces a
UAA1300 are described below: The watchdog input pulse (WDI) from
static watchdog reset output pulse
the I'C/I'P must be received within a
(WFiOIWRO) when both the power
• operating voltage range time window determined by external
and standby output voltage rise
• outputs capacitors CS and C6. When this is
above 4.7 V. The duration of the pulse
• 'iVROIWRO activated by low not achieved the watchdog output
width is determined by the value of
output voltage stage generates a ii'ilROlWRO pulse
external capacitor C7 (see Figs Sand
• 'iVROIWRO activated by WDI pulse with fixed width of 40 I's. Each rising
18). To operate with external series
timing edge at WDI restarts the timing cycle
control transistor, the watchdog
• LLI detection (see Figs 6 and 19). To operate, this
function must first be switched on by
• enable input watchdog function must first be
the enable input (EN).
• thermal protection switched on by the enable input (EN).
1 ,r-~.....----------T~
supply voltage range of +S.7 V to
+24 V and provides reverse polarity
protection and low line voltage
t
detection. no rreessee, --.Jj : ! __ .:,
Outputs L---++--------t---- vOltage output at pins:
4.6V 4.7V 'O(p) and Vsb Ilsb
Two stabilized short-circuit
MLAI53
protected; low drop outputs are
provided:
WD (min) determined by C5
WROIWRO activated by low output WD (max) determined by C6 MLAI52
voltage
LIMITING VALUES
• Electrostatic handling is equivalent to discharging a 100 pF capacitor through a 1.5 kQ series resistor with a
15 ns rise time.
12
Ptot
(WI
'\ \
:'\.'1 {21
D,B
"\ '\.0,59 w \
0.4
85 0 6\ \ 0.36 W
"\ , \3D o
lc
50 'DO
~
'50
CHARACTERISTICS
UAA1300
Ime
39
'<l
lk1i IOOH
C4 330 pF
-----II 11
watchdog-In
I
C6
penodI
(min)
Penod
(max)
HIGH LOW rreseHenQth
watchdog-reset-ou!
MLA158 MLAI59
10 n load
RL :
r "
001,10
I,
n load
I
I
I
o~~}~__- L_ _- L_ _~_ _ _ _L -_ _~ 3L-__ ~ __ ~ __ ~ ____L __ _ ~ _ _~
o 10 20 30 o 10 20 30
Voo (V) Voo (V)
Fig.9 Standby output voltage (Vsb) as a function of Fig.10 Power output voltage (VO(p)) as a function of
line voltage (Voo); typical values; measured in line voltage (Voo); typical values; measured in
Fig.B. Fig.B.
MLAI64 MLAI63
1000
WD reset
pulse
length VOlPI
(ms)
100
V (V) ...."
10 1/ ~
V
J
0.1 V
100 pF 10F 10 nF 100nF 11lF 200 400 600 BOO
C5, C6 or C7 iO(p) (mA)
Fig.11 Watchdog reset pulse length as a function of Fig.12 Typical power output voltage (VO(p)) as a
external capacitors C5 or C6 or C7. function of power output current (IO(p)); Voo = 7 V;
behaviour is influenced by externally chosen
transistor type.
600
Vsb
(V)
.........
500
L..
./"
400 V
./"
o 300
o 20 40 60 80 100 o 10 20 30
Isb(mA) VDD(V)
Fig.13 Typical standby output voltage (Vsb) as a Fig.14 Quiescent current (II) as a function of line
function of standby output current (Isb); Voo = 7 V. voltage (Voo); no load at standby output voltage
(VSb); enable (EN) not active.
MLAt60
3000 1200
/
/
1/
2000
/
/
800 V
/ V
1000 /
/
400 V
V
/
V
0
20 40 60
oV 11
Isb (rnA) Vo(p) (V)
M[A156
Fig.15 Quiescent current (1,) minus standby output Fig.16 Adjustment of power output voltage (VOIP));
current (Isb) as a function of standby output current typical values of external adjustment resistors:
(Isb); Voo 13 V.= circuit with high accuracy.
120
R
(kll)
lL
80 L
V
40 V
1/
o V
5 11
VO(p) (V)
MLA'S?
____________ 4.7V
output voltage
l~;-------------- - - - - - - - - - - - - 4.6V
-"'--t-'-
-tRo-1
WRO
capacitor C7
reset-length
AI.(A,Sf
WDI-.-ll
I!-----
minimum
period
WRD
!. nonnaloperation .! T
WD-pulse period too short
WD·pulse period too long
.!.
normal operation
.!
MLA155
td = internal delay
APPLICATION INFORMATION
BYV95A
battery --r--+1~H~-~~-------,
~~~------------------------,
100kU
47 nF
22
kQ
MICROCONTROLLER
INTERFACES
UAA1300 RAM, ROM
ADC
(PCF84C40)
Ml.A165
GENERAL DESCRIPTION
The PCF 1252-X fam ily are CMOS voltage detectors designed especially for power-ON/OF F detection
in microcontroller/microprocessor systems (for initialization and data storage purposes). The output
POWF is activated at a precise, temperature stable, trip-point. The RESET output has a built-in delay
with duration determined by an external capacitor (CCT). A second comparator (comparator 2) has
been included to allow for the possibility of a second monitoring point in the system.
Features
• Low current consumption, typically 6 IJ.A
• 10 versions available, trip-points vary from 2.55 V to 4.75 V
• Temperature stable trip-point
• Variable RESET delay
• Reset polarity selection
• Comparator for second level detection (e.g. overvoltage detection)
• Advance warning of power failure
VDD COMIN
3
comparator 2
comparator 1 PCF12S2-X
>--~~----~ >-----~I__-POWF
>-~--RESET
7Z24919
CT SELECT
PACKAGE OUTLINES
PCF1252-XP: 8-lead DIL; plastic (SOT97).
PCF1252-XT: 8-lead mini-pack; plastic (S08; SOT96A).
PINNING
Supply
The supply voltage (VOO) is internally divided before being compared, via comparator 1, with the
internal reference voltage.
Power failure
Ouring a power·OFF condition (VOO < VTRIP), POWF goes LOW. Aher a time delay (tS), also
determined by CCT, RESET goes HIGH. Any POWF output (VDO < VTRIP) will result in a
subsequent RESET pulse.
Voltage trip-point
By selecting the voltage trip-point slightl.y higher than the minimum operating voltage of the
microcontroller/microprocessor, there is sufficient time for data storage before the power actually fails.
I n order to prevent oscillations around the voltage trip-point, a small hysteresis has been included,
resulting in a power·ON switching point that is higher than the voltage trip·point (minimum of 15 mV).
The voltage trip·point refers to the value at which power·OFF is signalled.
COMIN
I nput to the second comparator (comparator 2). When used in conjunction with an external voltage
divider, this allows a second point in the system to be monitored. This input has no built·in hysteresis.
When not in use connect to VDO. COMOUT will be LOW or HIGH depending on the voltage at
COMIN:
• COMOUT = HIGH, if voltage at COMIN is above the sWitch point VSP (typically 1.30 V).
• COMOUT = LOW, if voltage at COMIN is below the switch point VSP (typically 1.30 V).
RATINGS
Limiting values in accordance with the Absolute Maximum System (IEC 134)
HANDLING
I nputs and outputs are protected against electrostatic discharge in normal handling. However, to be
totally safe, it is desirable to take normal handling precautions appropriate to handling MaS devices
(see 'Handling MaS Devices').
CHARACTERISTICS (continued)
supply voltage
POWF l
------¥<'----'-7/----L..--.--J-
r 0 V
~_L. .,./C_-'-!lrD---+--!--L
~
RESET
(SELECT = v 55)
"'
7Z24921.1
7Z24922 7Z24923
10 12
I~ IDD
(~A)
I~ I I 10
"'"
VTRIP "
",255V
/
/1 VTRIP =
i"-. -
V ""
jVV
""
4 75 ~
""-
I"'-.
~
"-
II
"-
" /
2 o
-40 +40 +80 +120 o V DD (V)
T 3mb (DC)
7Z24924 7Z24925
40 40
10
0 J
DD 10 r-- I
VOD = 6.0V
I
_ 6V-
--~
(rnA) (rnA)
/
V
30 30
/ ~
20
10
/ /
//
/
V
4.0 V 20
10
---- ~
~
'" '\ \
/I ...,....2.5 V '\ \
o tv o
~
--..... ~5V \ \
o Vo (V)
o
Fig.6 Output sink current as a function of Fig.7 Output source current as a function of
the output voltage. the output voltage.
7Z24926 1
1000 100
v (ms)
IS
/
100
V 10
/
10
/
v
V
/ 0.1
./
/'
01
~ 0.01
0.001 0.01 0.1 10 100 1000
external capacitor (nF)
Fig.8 Reset and save tifTies as a function of the external capacitor (CCT).
Notes to Fig.8
1. tR (typ.) = (0.1 + CCT) ms.
2. ts (typ.) = (0.01 + 0.1 CCT) ms.
APPLICATION INFORMATION
V DD
(+5 V)
1
V DD VDD
PCF1252·X
COMIN
MICROCONTROLLER/
RESET RESET
MICROPROCESSOR
SELECT
VSS CT VSS
VSS
+ 1 nF
7Z24927
1
(0 V)
12 V VOLTAGE 5V
REGULATOR
T'" ~F
I
Ml1 V DD V DD
PCF1252·X
.--- RESET
GD
- MICROCONTROLLER/
COMIN COMOUT INT
MICROPROCESSOR
+ 1 nF addres/databu5
-
~
R/W V DD V RAM
RAM
(D
'---
CHIP·
DECODING ::i
LOGIC
- Cs VSS
T
7Z2492B.l
1
F ig.l 0 Data retention circu it for memory back-up systems.
VDD--4r----------~----------~--------------~------~·~----~~--------~
1 10 )..!F
r---------~--_.
external reset
Input Signal (1)
MICAOCONTROlLERj
PCF1252-X RAM
MICROPROCESSOR
Vss
VSS--4r------~--4---------------------~--------------------~----------J
7Z24929
Fig.11 Data retention circuit with external switchable reset for systems
with a single voltage supply.
Note to Fig.11
1. For external reset application, the SE LECT input must be debounced.
8OC51-Based
8-Bit Mlcrocontrollers
CONTENTS
24-Pin (300 mils wide) Ceramic Dual In-Line with Quartz Window (F) Package 981
24-Pin (300 mils wide) Plastic Dual In-Line (N) Package .. . . . . . . . . . . . . . . . . . . . . . . .. 982
28-Pin (600 mils wide) Ceramic Dual In-Line with Quartz Window (F) Package ........ 983
28-pin (600 mils wide) Plastic Dual In-Line (N) Package .......................... 984
SOT136A 28-Pin Plastic SO (Small aumne) Dual In-Line (OfT) ................... 987
40-Pin (600 mils wide) Ceramic Dual In-Line with Quartz Window (F/FA) Package. . . . .. 988
SOT158A 40-Pin Plastic VSO (Very Small Outline) Oualln-Une (OfT) Package ....... 991
44-Pin Square Ceramic Leaded Chip Carrier with Quartz Window (L) Package ........ 993
SOT311 44-Pin Square Plastic Quad Flat Pack (B) Package .................... 996
68-Pin Square Ceramic Leaded Chip Carrier with Quartz Window (l) Package ........ 999
68-Pin Cerquad J-Bend with Quartz Window (KIKA) Package ...................... 1000
SOT219 80-Pin Plastic Quad Flat Pack (B) Package .......................... 1001
SOT318 80-Pin Plastic Quad Flat Pack (B) Package .......................... 1002
Signetics 80C51-Based 8-BII Mlcroconlrollers
Package outlines
24-PIN (300 mils wide) CERAMIC DUAL IN-LINE WITH QUARTZ WINDOW (F) PACKAGE
I1-~8~9!
NOTES:
[
.09812.~
1. Controlling dimension: inches. Millimeters are shown in
.030 (.76) .030 1.761
parentheses.
2. Dimensions and tolerancing per ANSI Y14.5M - 1982.
3. "T", "0", and "E" are reference datums on the body
and include allowance for glass overrun and meniscus on
.-~r~~~~~~~~~ the seal line, and lid to base mismatch.
4. These dimensions measured with the leads constrained
.306 17.771 to be perpendicular to plane T .
5. Pin numbers start with pin # 1 and continue
counterclockwise to pin #20 when viewed from the top.
035 I 69~ ~
sse
-
015 (36)
010 (25) l=!. 395 110.03)
.300 17.62)
853-0586 84000
981
r-------------------------------------------------------------------------------------------------~I~
~
:g-
-u al
~ z" III
(')
g.
'"
~
CD
'"
;"" III
CO
8
~
I"
I
/e"/D®/0.004(0.10)/ ·1 NOTES:
~
Ui
~
is: =
CD
o
c: r
a.
'P
1. Controlling dimension: Inches. Metric are shown in parentheses.
~
5" g!
CD ;:
I®
0.265 (6.73)
2. Package dimensions conform to JEDEC Specification MS-001-AF
for standard Dual In-Line (DIP) package 0.300 inch row spacing
(plastic) 24 leads (Issue B, 7/85).
":toor-
en
-I
en §'
g
:>
0.255 (6.48) 3. Dimension and tolerancing per ANSI Y14, 5M - 1982. (') i3
15'
br~=r~=r~=r~~TT~FT~FT~~'1~ 4. "T", "D", and "E" are reference datums on the molded body and
do not include mold flash or protrusions. Mold flash or protrusions
shall not exceed 0.010 inch (0.25mm) on any side.
C
c:
:too
til
r-
5. These dimensions measured with the leads constrained to be Z
0.100 (2.54) SSC I perpendicular to plane T. r-
I~ 1.256 (31.90)
1.240 (31.50)
•
6. Pin numbers start with Pin #1 and continue counterclockwise to zm
Pin #24 when viewed from the top.
:3
~
'"
~
"
:too
G)
m
\
~
0.395 (10.03)
0.300 ( 7.62)
I I
z
~
Signetics 8OC51·Based 8·Bit Microcontrollers
Package outlines
28-PIN (600 mils wide) CERAMIC DUAL IN-LINE WITH QUARTZ WINDOW (F) PACKAGE
NOTES:
1. Controlling dimension: inches. Millimeters are shown in
parentheses.
2. Dimensions and tolerancing per ANSI Y14.5M - 1982.
3, "T", "D", and "E" are reference datums on the body
and include allowance for glass overrun and meniscus on
the seal line, and lid to base mismatch.
4. These dimensions measured with the leads constrained
to be perpendicular to plane T.
5. Pin numbers start with pin # 1 and continue
counterclockwise to pin #28 when viewed from the top.
6. Denotes window location for EPROM products (see FA
package).
.620 (15.7S)j
.590 (14.99)
(NOTE 4)
,'
::
\
~ 600 (15.24) esc
(NOTE 4)
.695 (17.65)
.600 (15.24)
853-0589 84000
983
r---------------------------------------------------------------------------------------------~i~ Ql
CjO co
'tI "U :J
CD
Z III ",.
0
(1 en
~ CD
Oi 0
III
I' 1-$-10 ®I 0.004 (0.10)1 ·1 8 CO
()
~
I I §!. CD g,en
NOTES:
I!
iii
C
0
=-.
CD
a.
I
1. Controlling dimension: Inches. Metric are shown in parentheses. 'P
2. Package dimensions conform to JEDEC Specification MS-011-AB ~ :::J [!
for standard Dual In-Line (DIP) package 0.600 inch row spacing CD ~
en
0.560 (14.22)
0.545 (13.84)
(plastic) 28 leads (Issue B. 7/84).
'tI
r
> a
0
3. Dimension and tolerancing per ANSI Y14. 5M - 1982. en 0
:J
!!~ 4. "T", "D", and "E" are reference datums on the molded body and
-oj
(5 a
15'
do not include mold flash or protrusions. Mold flash or protrusions C fil
" i shall not exceed 0.010 inch (0.25mm) on any side. C
I
I-+-
I
0.100 (2.54) sse I V V V V ".1
I 5. These dimensions measured with the leads constrained to be
perpendicular to plane T.
r>
Z
r-
_D _I 1• 1.460 (37.08) 6. Pin numbers start with Pin #1 and continue counterclockwise to
zm
1.415 (35.94) Pin #28 when viewed from the top.
:;
~
rAJ
~ 0.620 (15'75)~
i _ 0.600 (15.24)
(NOTE 5)
">mC>
~(5.08) ~
2
Signetics 80C51-Based 8-Bit Microcontrollers
Package outlines
I
,
3,9
3,4
top view
131
Dimensions in mm
985
N en
16'
CjO
-c ::I
I
:;;
'tI
Z
'tI
~
,.- .g.
CD
co
tID r- 0
~
0.007 (0.18l®TA®1 F-G 0
Iil
~
~
ti CD
0 0
c:
t
8.
r-
0.010 (0.25) MAX. R
3 PLACES 0.007 (0.18J®I B(m D-E® m =
5'
t:p
re
~
m CD 3:
NOTES (J) ~.
1. Package dimensions conform to JEDEC Specification MO~7·AB C
0.455 (11.58) 0.495 (12.57) for Plastic Leaded Chip Carrier 28 leads, O.OSO inch (1.27mm) lead 0 §
0.450 (11.43) ~ spacing, square. (Issue A, 10131/84.) X
=a ~
2. Controlling dimensions: inches. Mebic dimensions in mm are shown
in parentheses.
3. Dimensioning and tolerancing per ANSI Y14.SM-1982.
0
> f
XI
<» • I.£B &I. Datum plane "·H·" located at the top of mold parting line and coincident XI
in
0.048 (1.22)
~X45 [ &. with top of lead, where lead exits plastic body.
& Location to datum "·A·" and "·B·" to be determined at plane N·H·". These XI
'~ datums do not include mold flash. Mold flash protrusion shall not
exceed 0.010" (0.2Smm) on any side.
~
4 SIDES
r=T:"="""'=C=~=~=...j... 0.455 (11.58)
& Datum "O-E" and "F-G" are determined where these center leads ~
0.007 (0.18) ® A® F-G S 0.450 (11.43) exit from the body at plane "·H·". 0
~
..l.
-B-
O.OO2IN/IN A
&.
7. Pin numbers continue counterclockwise to Pin 28 (top view).
8. Signetics order code for product packaged in a PLCC is the suffix
"A" after the product number.
"m>
C)
LI. ·1 1.:
. __ 0Ts5(4.i9i I " SEATING PLANE
~
Signetics 80C51-Based 8-Bit Microcontrollers
Package outlines
m ji:----I~~.ls~--I'g.~~II'I~~ •
O.7Smox ~ ~ _-----10.65-----_
10.0
--l!I!J--
top view
2.0
max
987
Signetics 8OC51-Based 8-Bit Microcontrollers
Package outlines
4O-PIN (600 mils wide) CERAMIC DUAL IN-LINE WITH QUARTZ WINDOW (F/FA) PACKAGE
r .D98 (2.49J
.040 ( 1.02)
SEE NOTE 8
NOTES:
1.
2.
CONTROLLING DIMENSION: INCHES.
MILLIMETERS ARE SHOWN IN PARENTHESIS.
' 1 7 S L J 4 . 4 S )620(1575)
.I 45 (3.68) .ss-O(T"4.991]
(NOTE 4)
988
Signetics 80CS1-Based 8-Bit Microcontrollers
Package outlines
',$\O@j.OO4 (.10)
NOTES:
1. Controlling dimension: inches. Metric are shown in
parentheses.
2. Package dimensions conform to JEDEC specification
MS·Ol1·AC for standard dual in-line (DIP) package ,BOO
inch row spacing (PLASTIC) 40 leads (issue B. 7/85)
3. Dimensions and tolerancing per ANSI Y14. 5M·1982.
555 (14.10) 4. "T", "D" and "E" are reference datums on the molded
545 (13.84)
body and do not include mold flash or protrusions. Mold
flash or protrusions shall not exceed .010 inch (.25mm)
~
on any side.
5. These dimensions measured with the leads constrained
to be perpendicular to plane T.
__
020 (5~)
120 (305) 015 (38)
010 (25)
,','
U
~600 (1524) Bsc----ll
J~fg7~k)
600 (1524)
\\
II
853·0415 84971
989
Signetics 80C51-Based 8-Bit Microcontrollers
Package outlines
il~'-~
~'; ; I~.
'>0 ... • . : .. _ : •. ~:';;'1,
],05 , '
t
_
-
2,2Si.... __ i~i_
3a~
.
0,53_ ~UI
~~
top view
----15,8mo. ---~
990
Signetics 80C51-Based 8-Bit Microcontrollers
Package outlines
SOT158A 4O-PIN PLASTIC VSO (VERY SMALL OUTLINE) DUAL IN-LINE (OfT) PACKAGE
I' 'I
iiiriii Wii
1S,Smax
' +
2,45 2,7
~x max
1
i--- -0.42'1'1' +
0.51 QJ.21 \-i$1 0.1 ®I 0,1.21
0,14
__ I .-
0,41
7Z96425
.
10 ,762 1
top view
1-'-1
4 2,0:
~ m~x I
$ Positional accuracy.
@ Maximum Material Condition.
- - - - 16,0 max - - - - ,
Dimensions in mm
991
f--- 0.695 (17.65) 1'G71 0.007 (0.18)@ A® F-G ® ~
"tI "'U
:t-
al
I I»
0.685 (17.40)
Z o g"
-lO.500 (12.70) f------- "tI 7\ gJ
&. r I» ()
52"
Q, o !0.251 MAX. R ' " 1'G710.oo7(0.18)® B® D-E®
~(;
CO ~
3 PLACES --Jr-ill
ti
®
r
o
c
CD
t
~
~
m
» ::-. cp
0.656
10.500 (12.70) 1
c ::J ~
~~
""t"
o:sso- m CD ;::
P~
0.695(17.65) NOTES
c en ~.
0.685 (17.40) 1. Package dimensions conform to JEDEC Specification MO-047-AL
~ -E- for Plastic Leaded Chip Carrier 44 leads, 0.050 inch (1.27mm) lead
::r:
o
~&.
:>
spacing, square. (Issue A. 10/31/84).
:3
t ~. 2. Controlling dimensions: inches. Metric dimensions in mm are shown ~ ffi'
in parentheses. » O!
~ ,~,~
LI
0.165(4.19)
- - .
<8'(
1
,
~
Signetics 8OC51-Based 8-Bit Microcontrollers
Package outlines
44-PIN SQUARE CERAMIC LEADED CHIP CARRIER WITH QUARTZ WINDOW (L) PACKAGE
~.710
I 680 118 031~SO
(1727)
~ ,675 (17151 sa
I 640 (1626)J
~~ !£. 19
r: 2a
025 (0,64) MIN.
(4 PLACES)
,- -
.012 (30>
008 L20l
CONTROlL I NG 0 I MENS IONS: INCHES.
MILL I METERS ARE SHOWN IN PARENTHES t S
853-1268 95007
993
Signetics 8OCS1-Based 8-Bit Microcontrollers
Package outlines
CHAMFER
45"
fr L
17.65 (.695)
17.40 (.685)
16.89 (.665)
16.00 (.630) m
1.02 ( .040) X 45"
l ~:;"Of
3.05 (.120)
1.27 ( .050) TYP
.51 (.02)
17.65 (.695) X45°
16.89 (.665) 17.40 (.685) !II
16.00 (.630)
0---'"
~~:;aca;~-=~----1
tJm 45" TYP 4 PLACES
3, 0.63(.025) R MIN
LBASEPLANE
SEATING
PLANE
FIGURE 1. PRINCIPAL DIMENSIONS AND DATUMS mml(inch)
1.02±.25(.040±.010) _/ I. 0.482 (0.019 ±0.002)
DETAIL A
TYP ALL SIDES mm/(inch)
~
40X
I
7.37 (.290)
SEE DETAIL B
8.13 (.320)
7.37 (.290)
0.25 (.010) .508 (.020) R MIN
0.15 (.006) DETAIL B mm/(inch)
FIGURE 2. TERMINAL DETAILS mm/(inch)
853-1472 00440
III ~~~~~:PJc~OC\HE.f RELIEF IS OPTIONAL AND DIMENSIONS ARE FOR KB1
994
~
!l!
""0 '""....
~
"tI CD
Z ~ .,n
C')
§ "tI A ~
r ~ 0
I ® O.BO X 10 - B.OO ±0.05
):10
en
:!
CO
CD
<n
i.,
PIN 1 MARK
(0.0315 X 10 _ 0.315 ±0.002) C') 0
c: !
"
(NOTE 3)
c: d:. 'P
):10 S' ~
c CD ~
NOTES: 'TI en §
O.BO ±0.10 r
-E3i3--L(0.031 ,w.004) (40X) 1. Package dimensions conform to MEC specification. ~ 8
2. Controlling dimensions are in mm. Dimensions in parentheses
~ ["
are in inches. C')
CD
iil
r;
0.35 ±0.10 3. Pin numbers start with Pin #1 and continue counterclockwise to ;r;
to Pin #44 when viewed from top.
10.00 ±0.20
-t(0.014 ±0.004) (44X) §
®& Molded identation maybe replaced by other unique feature within
(0.394 ±O.OOB) SQ.
---rr; 0.20
this zone to indicate Pin #1 location. i:
m
U ,g
-t!o.oOS) MIN.
~
C')
~irrin"Tin"~i""~"~i~"~i~"~i~"~i ~ @
;r;
):10
~ \ R 0.13 (0.005) MIN. C)
m
I
I
I
(O.:!:O:~~~) "/
I
0.5 ::8:J5
• • • • • en•
?l ....<n0 !:l<n0 0Co>~
CD
!!l
0
CD
0
CD
'" '"N<n ~
l:!
0
~ 0~
0
Co>
....
0
<n
0
<n ~0
...
N
....0~ <n
<n iii
In N ?l
~ ~
Signetics 8OC51-Based 8-Bit Microcontroilers
Package outlines
9.9 - 10.1
Detal [R]
B~~--------~
• PCBlPCF/PCA80C31/80C51
• 8OC528183C528
• 8OC652183C652
• 8OC654/83C654
• 8OCE654/83CE654
·80C851/83C851
996
Signetics BOCS1-Based 8-Bit Microcontrollers
Package outlines
:I
I~ U21!.1JI2J
8U--~----------------- S.2OIIII,1All
8
.1" (un) Jl21(2UCI)
.171,4A11 .880(22.11)
I
..DoII!!.1.)
,0'6 (OM)
.015(0.31)
.010(0.261
997
01 en
cO·
CjO
;
m
o. ~
..... "'''' ... \' .... C.',
0.985 (25.02)
0.800(20.32) ~
1-$ 0.007(0.18i® A® F-G®
"
III
:::>
CD
g.
a>
'"
0
()
11 10 (0.25) MAX. R ' "
3 PLACES ---1H:B&. > CO ~
~ CJ)
-I CD g,
r
56 (24.33)
50 (24.13)
0.995 (25.27)
0.965 (25.02)
0.800 (20.32)
NOTES
1. Package dimensions conform to JEDEC Specification MO-047-AE
for Plastic Leaded Chip Carrier 68 leads, 0.050 inch lead spacing,
0
r
m
>
c
m
-
0
C
S'
CD
CJ)
a>
CD
a.
q:>
!1?,
;:
n·
square. (Issue A, 10/31/84).
c a0
0
~ 2. Controlling dimensions: inches. Metric dimensions in mm are shown
(')
:r:: 0
:::>
a16'
~
PIN#t
~
in parentheses. =ij
3. Dimensioning and tolerancing per ANSI Y14.5M-1982. (')
OJ
&. &. & Datum plane "-H-" located at the top of mold parting line and coincident >
:xJ
with top of lead, where lead exits plastic body. :xJ
& Location to datum "-A-" and "-8-" to be determined at plane "-H-". These iii
L--.J datums do not include mold flash. Mold flash protrusion shall not :xJ
~
0.046 (1.2t
0.042 (1.07) X45"
JL ~4B&.
1 0.050 (1.27) 14 SIDES
f$T 0.007 (0.18) ®
r..L 0.002 IN liN A
A®I F-G ®I
&
exceed 0.010" (0.2Smm) on any side.
Datum "D-E" and "F-G" are determined where these center leads
exit from the body at plane "-H-".
7. Pin numbers continue counterclockwise to Pin 68 (top view).
~
(')
~
0.956 (24.33)
0.950 (24.13)
I-B-I&
8. Signetics order code for product packaged in a PLCC is the suffix
"A" after the product number.
"~m
'" -$10.007(0.18) ®I B®I D-E®I
..L 0.002 IN liN B
I-A-I •
Yl E06~ (1.52) MIN. &.
&
Applicable to packages with pedestal only.
Location of Pin #1 mark is optional. Mark on chamfered side is
& preferred.
J:;. 0.015(0.36) tOO2O(0.5)MIN.~
ill 0.005 (0.13) CLEARANCE WID
PEDESTAL PEDESTAL
CLEARANCE
0.045 (1.14)
L t- 0
0.604(15.34) J:;.
0.596(15.19) ill"
0.930(23.62)
0.690 (22.61)
.1 1"$"10.015 (0.36)®1 D-E® 1
0.025 (0.64) R
66 PLACES
~
Signetics 8OC51-Based 8-Bit Microcontrollers
Package outlines
68-PIN SQUARE CERAMIC lEADED CHIP CARRIER WITH QUARTZ WINDOW (l) PACKAGE
25 10 641 450X-
~~J--'" , , , J
•
1010 115651
935 (2375)
t.
so
..
"l5"T:38T
l .025 10.641 MIN.
T" "
. I
,, - , ,,
,, I ,I
,
-,
.. .
I r :8~g ~1~l x 45
~ (3 CORNERS)
0
n I
853-1240 95007
999
Signetics OOC51·Based 8·Bit Microcontrollers
Package outlines
r~AMFER
J1\ I Elli~1i ~hJ'l l
~ 1 02 ( 040) X 45'
'
I2J ~
3.05 (.120)
2.29 ( .090)
~8(.015) 1.27 ( .050) TYP
I
I =r ~
.51 (.02)
! I
2527 ( 995)
X45'
~
I 25.02 ( .985)
24.51 ( .965)
J
45' TYP 4 PLACES
rn ";1'"""'
~~~:;c;::c~b------I-
!. 3x 0.63(.025) R MIN [
SEATING
PLANE SEATING
PLANE
lJr
li- LBASEPLANE
DETAIL A
TYP ALL SIDES mm/(inch)
1.27 (.050)
64X
I -j
'tS
r-
I
L I
20.321.800)
NOMNAL - -
It J .076 ( .003) MIN
853·1473 00441 III ~~¥~~:PJc~O~~&. RELIEF IS OPTIONAL AND DIMENSIONS ARE FOR
KC1
1000
Signetics aOCS1-Based 8-Bit Microcontrollers
Package outlines
1----------19.2max - - - - - - - - - - 1
1--------16.6max - - - - - - - - - - 1
0° min
~ FT14-=-1§5·[l24·8max 1.2
index corner
0.9
L+_ _ _ ~~O
1
max ,_ c=:::j
== 8'- I
0.5
max t
+
~-----+-.-- 20 22.6 25.2
max max
I
I
24 i 41
40 ~
00-1 25 2.8
· J.. ~
ma
_ L
max IQ&]
lZ2tiOfB.'
$ Positional accuracy.
Dimensions in mm @ Maximum Material Condition.
1001
Signetics 8OCS1-Based a-Bit Microcontrollers
Package outlines
lf1
0 ...:
'"' @
....
In
'"'
llIlIiIilil
---------+---------
I xN
~
co
N
4 I
I
0
In
l1!
'"
In
0 0
0
0
0
1002
Signetics
Section 9
Sales Offices,
Representatives & Distributors
8OC51-Based
8-BIt Mlcrocontrollers
Signelics B0C51-Based 8-BII Mlcroconlrollers
Loose data sheets are sent to subscribers to keep them IC19 Data Communication Products
up-to-date on additions or alterations made during the IC20 80C51-Based 8-Bit Microcontrollers
lifetime of a data handbook.
IC23 Advanced BiCMOS Interface Logic
Catalogs are available for selected product ranges (some
catalogs are also on floppy discs).
For more information about data handbooks, catalogs and DISCRETE SEMICONDUCTORS
subscriptions, contact one of the organizations listed on the SCOI Diodes
back cover of this handbook. Product specialists are at your
SC02 Power Diodes
service and inquiries are answered promptly.
SC03 Thyristors and Triacs
SC04 Small Signal Transistors
INTEGRATED CIRCUITS
ICOl Radio, Audio and Associated Systems SCOS Low-frequency Power Transistors and Hybrid IC
Bipolar, MOS Power Modules
IC02a1b Video and Associated Systems SC06 High-voltage and Switching Power Transistors
Bipolar, MOS SCO? Small-signal Field-effect Transistors
IC03 ICs for Telecom SC08a RF Power Bipolar Transistors
Subscriber Sets, Cordless, Mobile and Cellular
SC08b RF Power MOS Transistors
Telephones, Radio Pagers
SC09 RF Power Modules
IC04 HE4000B Logic Family
CMOS SC10 Surface Mounted Semiconductors
IC05 Advanced Low-power Schottky (ALS) Logic SC12 Optocouplers
Series
SC13 Power MOS Transistors
IC06 High-speed CMOS; ?4HC/HCT/HCU Logic Family
SC14 Wideband Transistors and Wideband Hybrid IC
ICO? Advanced CMOS Logic (ACL) Modules
IC08 1011 OOk ECL Logic/MemorylPLD SC15 Microwave Transistors
IC09 TTL Logic Series SCI? Semiconductor Sensors
Philips Semiconductors
Vee 39 33
Pl.l PO.D/ADO
PQ.1fADl
PO.21AD2 11 23
17 29
PO.31AD3
PO.4/AD4 18 29 12 22
Pin Function Pin Fooction Pin Function Pin Function
PI.6 PO.S/ADS
1 NC 23 NC 1 Pl.5 23 P2.5IA13
PO.6IADS Pl.0 24 P2.OIAO Pl.6 24 P2.&'A14
Pl.l 25 P2.1/A9 Pl.7 25 P2.7/A15
PO.7/AD7
Pl.2 26 P2.21Al0 RST 26 !'"SEN
"El'iNpp Pl.3 27 P2.31All P3.OIRxD 27 ALEi1'!1OO
Pl.4 26 P2.41A12 NC 28 NC
ALEII'ROO P3.1ITxD 29
Pl.S 29 P2.5IA13 ElWpp
l'SER Pl.6 30 P2.6IA14 P3.2!1NT!! 30 PO.7/AD7
Pl.7 31 P2.7/A15 P3.3IlJIITT 31 PO.6IAD6
P2.7/A1S 10 RST 32 !'"SEN 10 P3.4iT0 32 PO.S'AOS
TOJP3.4 P2.6IA14 11 P3.OIRxD 33 ALEiPROO 11 P3.5iTl 33 PO.41AD4
12 NC 34 NC 12 P3.6IWR 34 PO.31AD3
TlJP3.S P2.S/AI3 13 P3.1fTxD 35 ElWpp 13 P3.7RD 35 PO.21AD2
P2.4/AI2 14 P3.2!1NT!! 36 PO.7/AD7 14 XTAL2 36 PO.l/ADl
15 P3.3IINTT 37 PO.6IAD6 15 XTAL1 37 PO.OIADO
P2.31A11 16 P3.4iT0 3B PO.5IAD5 16 3B
VSS Vee
XTA1.2 P2.21Al0 17 P3.5iTl 39 PO.4/A04 17 NC 39 NC
18 P3.6IWR 40 PO.31AD3 18 P2.0/A8 40 PloD
XTAL1 P2.1/A9 19 P3.7JIID 41 PO.21AD2 P2.1/A9 41 Pl.l
19
20 XTAL2 42 PO.l/ADl 20 P2.2JA10 42 Pl.2
VSS P2.D/AB
21 XTAL1 43 PO.OIADO 21 P2.31All 43 Pl.3
22 VSS 44 VCC 22 P2.4/A12 44 Pl.4
P1.6 and P1.7 have the alternate functions SCL and SDA, respectively, on the 80C652183C652187C652 and 83C654/87C654.
NOTES TO QFP ONLY:
1. Due to EMC improvements, it is advised to connect pins 6, 28, 39 to Vss on the 80C652183C652, and 83C654.
8OCE654/83CE654
34
R H
1= 0 =33
OFP
(SOT 311)
11= =23
~2 H
22
Pl.111T2 1 VDD 3t 33
PO.O/ADO
PO.l/ADl
PO.2IAD2 11 23
17 29
PO.3IAD3
PO.4IAD4 1. 29 12 22
8OCL31/80CL51, 83C053183C054/87C054
8OCL41 0/83CL41 0*
VpplTDAC/PO.O 1 vcc
VDD
PROG/PWM11PO.l 1 1'3.7
PO.O/ADO
ASELJPWM2IPO.2 3 1'3.6
PO.l/ADl
PWM3/PO.3 1'3.5
PO.21AD2
PWM41POA P3A
PO.31AD3
PWMSIPO.5 6 I'3.3/lNTO
PO.41AD4
PWMBIPO.& 7 1'3.2ITO
PO.51ADS PWM7IPO.7 • 1'3.1nNTl
PO.6/AD6 ADIOIP1.o 8 1'3.0
PO.7/AD7 RST
Ell' XTAl2
ALE XTAl1
PSEH BF
P2.7/A15 VClK2
P2.6/A14 VClKl
P2.51A13 VSYNC
P2.41A12 IISYNC
VCTRl
P2.31A11
P2.1 V1D2
XTAU P2.21Al0
P2.0 V1Dl
XTAll P2.1/A9
V1DO
Vss P2.0/Aa
"0"
PSER AVssNrel- 2 9 PO.O/ADO
PS.7 Pl.0/ADCO 3 PO.lIADI
Lee Pl.1/ADCl 4 7 PO.21A02
PS.5 Pl.21ADC2 5 PO.31AD3
26 44
PS.4 5 PO.4/A04
Pl.31ADC3 6
27 43
PS.3
P1.4/ADC4 7 PO.5/ADS
PS.2
P1.5/ADC58 PO.61AD6
P6.1 Pin Function Pin Function
1 FJWpp 35 RST 2 PO.7/AD7
PS.O
P2.O/AB 36 P3.0/RxD RxD/P3.0 1 1 "EXNpp
AFLAG P2.lIAB 37 P3.1iTxD
P2.21Al0 38 P3.2IINTO AI.EiPIlOG
BFLAG
P2.3IA11 39 P3.3IIIITT 1NTlJ1P3.2 1 JISER
P2.4/A12 40 P3.4iTO
P2.51AI3 41 P3.5iTl 1IITf1P3.3 1 P2.7/AI5
P2.6IAI4 42 P3.6IWR
TO/PM 1 7 P2.61AI4
V.. P2.7/A15 43 P3.7iRIT
10 PO.7/AD7 44 P5.0 Tl1P3.5 1
XTALI
11 PO.6IA06 45 P5.1
WRlP3.& 1 5 P2.4/AI2
XTAl2 12 PO.51AD5 46 P52
13 PO.4/AD4 47 P5.3
Vee
14 PO.3IAD3 48 PS.4
XTAl2 P2.21Al0
15 PO.21AD2 49 P5.5
P4.2 1& PO.lIADI 50 P5.& XTAl1 1 P2.lIA9
17 PO.O/ADO 51 P5.7
P4.1 P5.4 lB Vee 52 XTAL2 VSS P2.0/AS
19 P4.7 53 XTAl1
20 P4.& 54 Vss
21 P4.5 55
= & 1 40
'8"
22 P4.4 56 TlJS
23 P4.3 57 BFLAG
Pl.2 P5.Q 24 P4.2 5B AFLAG
Lee
Pl.3 P3.71R1l" 25 P4.1 59 P6.0
26 P4.0 60 P6.1 17 29
Pl.4 P3.6/WR
27 Pl.0 61 P6.2
Pl.5 P3.5fT1 2B Pl.l 62 P&.3 18 28
P3.4/TO 29 Pl.2 63 P6.4
30 Pl.3 64 P6.5
Pl.7 P3.3i1RTf 31 Pl.4 65 P6.6 Pin Function Pin Function Pin Function
32 Pl.5 1 AVec 16 P3.2IINTO 31 P2.6IA14
P3.2ITRT!I 66 P6.7
2 Vref+ 17 P3.3IIIITT 32 P2.7/A15
33 Pl.& 67 I'IIEl'l 3 Vref- lB P3.4iT0 33 !'SEN
P3.0/RxD P3.1iTxD 34 Pl.7 6B ALEIf'mlll" 4 19 P3.5iTl 34 ALE,f'JIDG"
AVss
5 PLOIADCO 20 P3.6IWR 35 FJWpp
6 Pl.lIADCl 21 P3.71RIT 36 PO.7/AD7
7 Pl.21ADC2 22 XTAL2 37 PO.6IA06
B Pl.3IADC3 23 XTAl1 38 PO.51AD5
9 Pl.41ADC4 24 Vss 39 PO.4/AD4
10 Pl.51ADC5 25 P2.0/AB 40 PO.3IAD3
11 Pl.6IADC& 26 P2.lIAB 41 PO.21AD2
12 Pl.7/ADC7 27 P2.21Al0 42 PO.lIADI
13 RST 2B P2.3IAll 43 PO.O/ADO
14 P3.OIRxD 29 P2.41A12 44 Vee
15 P3.11TxD 30 P2.51A13
Appendix B
8OC552/83C552/87C552*, 8OC562/83C562 8OC592/83C592/87C592
LCC
P1.6 and P1.7 have the alternate functions SCL and SDA, respectively,
on the BOC5521B3C5521B7C552.
Appendix B
8OC575/83C575/87C575
40 44 34
VDD 39
33
PO.II/AIIO
PO.lIADI
PO.21AD2
17 11 23
29
PO.3/AD3
PO.4/AD4 .8 29
12 22
PO.5IAD5
Pin Funcdon Pin function Pin Function Pin FWlCllon
PO.6IADS 1 Pl.5.'CMP2ICEX2 23 P2.5IAI3
1 NC 23 NC
PO.7/AD7 2 T2IP1.OICMPIl+ 24 P2.OIA8 2 P 1.6ICMP3/CEX3 24 P2.6IAI4
T2EXlPI.1ICMPO- 25 P2.IIA9 Pl.7ICEX4 25 P2.7/A15
ElWpp Pl.2lECI 26 P2.21Al0 RST 26 PllEN
ALEIPROO Pl.3/CMPOICEXO 27 P2.31Al1 RxDIP3.0 27 AlEIPROG
6 Pl.4ICMP1ICEXI 28 P2.41AI2 6 NC 28 NC
PSER 7 Pl.5.'CMP2ICEX2 29 P2.5IAI3 7 TxD/P3.1 29 EJWPP
Pl.6ICMP3/CEX3 30 P2.6IAI4 lNTl!!P32 30 PO.7/AD7
P2.7/A15
Pl.7ICEX4 31 P2.7/AI5 lfiITT/P3.3 31 PO.6IAll6
P2.6IAI4 10 RST 32 1'SEI'I 10 T0IP3.4ICMPR- 32 PO.51AD5
11 RxDIP3.0 33 ALEiPRllG 11 TlIP3.5ICMP1+ 33 PD.4/AD4
P2.51AI3
12 NC 34 NC 12 WRiP3.6ICMP2+ 34 PO.31AD3
P2.41AI2 13 TxD/P3.1 35 ElWpp 13 RU/P3.7ICMP3+ 35 PO.21AD2
14 lNTl!!P3.2 36 PO.7/AD7 14 XTAl2 36 PO.IIADI
CIF3+IRI1/P3. P2.3/AI1
15 lfiITT/P3.3 37 PO.6IADS 15 XTALI 37 PO.OIACO
P2.21Al0 16 TOIP3.4ICMPR- 38 PO.5IAD5 16 VSS 38 Vee
17 Tl/P3.5.'CMP1+ 39 PO.41AD4 17 NC 39 NC
XTAll P2.1IA8
18 WRIP3.6ICMP2+ 40 PO.31AD3 18 P2.OIAS 40 T2IP1.OICMPil+
P2.OIAS 19 llUiP3.7ICMP3+ 41 PO.21AD2 19 P2.1IA9 41 T2EXlPl.1ICMPO-
20 XTAl2 42 PO.IIADI 20 P2.21Al0 42 Pl.2lECI
21 XTAl1 43 PO.DlADO 21 P2.31Al1 43 Pl.3/CMPO/CEXO
22 Vss 44 VCC 22 P2.41AI2 44 Pl.4ICMPI
Appendix B
83C751/87C751 83C752/87C752
Pl.s.1IIIllD6 PD.3
Pl.3/D3 Pl.s.1II11JlDS
X2 Pl.21D2 X2 AVee
Xl P1.1IDI Xl AVss
Pl.OIADCOIDO 13 Pl.3/ADC3/D3
Pl.21ADC21D2
4 1 2&
~
'G"
11
FunctIon
12
LCC
18
Pin
19
function
'G"
11
4
12
1
Lee
2&
18
19
1 P3NM 15 Pl.OIDO
2 P3.31A3 16 Pl.11D1 Pin Fl8lCtIon Pin FunctIon
3 P3.21A21Al0 17 Pl.21D2 1 P3.41M 15 Pl.21ADC21D2
4 P3.lIA1/A9 2 P3.31A3 16 Pl.31ADC3/D3
18 Pl.31D3 3 P3.21A21Al0 17 Pl.41ADC41D4
5 N.C. 19 Pl.41D4 4 P3.1/AlIA9 18 AV...
6 P3.OIAOIA8 20 Pl.5I1NTlII05 5 P3.O/AOIA8 19 AVec
7 PO·2IVpP 21 N.C. 6 PO.2IVpp 20 Pl.5IIIrnII05
8 PO.l/S0AIDE-PGM 22 N.C. 7 PO.l/S0AIDE-PGM 21 Pl.611R1TlD8
9 PO.O/SCUASEL 23 Pl.BIlRITID8 8 PO.O/SCUASEL 22 Pl.7/TO/D7
10 N.C. 24 Pl.71TO/D7 9 RST 23 PO.3
11 RST 10 X2 24 PO.4IPWM OUT
25 P3.7/A7 11 Xl 25 P3.7/A7
12 X2 2& P3.61A8 12 V... 26 P3.61A8
13 Xl 27 P3.51A5 13 Pl.01ADCOIDO 27 P3.51AS
14 VSS 28 Vee 14 Pl.l/ADC11D1 28 Vee
Philips - a worldwide company
Arvtnllna: PHILIPS ARGENTINA SA Div. Philips ComponenlS, Vedis 3892, Norw.y: NORSK AIS PHILIPS, Philips Components, Box 1, Manglerud 0612,
1430 BUENOS AilES, Tel. (01) 5414261 OSLO, Tel. (02) 7410 10
AuotI1llIl: PHILIPS COMPOtENTS PTY L1d, 34 waterloo Road, p.klotan: PHILIPS ELECTRICAL CO. OF PAKISTAN LTD., Philips Mar1<az.
NORTH RYDE, NSW 2113, TEL (02) 110!>4455. Fax (02) 805 4466 M.A Jinnah Rd., KARACHI-3, Tel. (021) 125m
Austrlo: OSTERREICHISCHE PHILIPS INDUSTRE G.m.b.H., Peru: CADESA, Cerretera Central 6.500, LIMA 3, Apartado 5612,
UB Bauelemente, Triester SIr. 64, 1101 WEN. Tel. (0222)60 10HI20 Tel. 51-14-350059
Bolgunt N. V. PHILIPS PROF. SYSTEMS - Components Div., Phl;wlnea: PHILIPS SEMICONDUCTORS PHILI'PINES k1~, 106 VaJero Sl
80 Rue Des Deu, Gems, 8-10lUBRUXEUfS, Tel. (02) 5256111 Salcedo Village, P.O. Box 911, MAKATI. Metro MANIlA. Tel. (63-2)810-0161
BrozI: PHLIPS COMPONENTS (Acti'le Devices & LCD) Fax. 632 8173474
Rua Do Rocio 220, SAO PAUL()'sP, CEP 4552. P.O. Bo, 7383, Portugal: PHILI'S PORTUGUESAS.AR.L, Av. Eng. Duarte Paclleco 6,
CEP 01051 , Tel. (011) _1166. Fax (011) 82S-1849. 1009 LISBOACodex, Tel. (019) 683121
PHILIPS COMPONENTS (Passive Devices & Materials) Singapore: PHILIPS SINGAPORE, PTE LTD., Components Div., Lorong I,
Av. Francis<:o Monteiro 702, RIlEIlAO PIRES-SP, CEP 09400, Toa Pay"", SINGAPORE 1231, Tel. 35 02 000
Tel. (011)4~11. Fax (011)459-11282 South Africa: SA PHILIPS PTY LTD .. Components Div~ion,
Canada: PHILIPS ELECTRONICS LTD., Philips Components, 195-215 Main Road,JOHANNESBURG 2000, P.O. Box 7430,
601 Milner twe., SCARBOROUGH, Ontario, 1.41 B 11.48 Tel. (011)470-5434. Fax. (011)4705494
Tel. (416) 292-5161. SpaIn: PHilIPS COMPONENTS, Balmes 22, 08007 BARCELONA.
(IC Products) SIGNETICS CANADA LTD., 1 Eva Road, Suite411, Tel. (03)3016312. Fax.033014243
ETOBICOKE, Ontario, M9C4Z5, Tel. (416) 6~76 Sweden: PHILIPS COMPONENTS, A.B., Tegeluddsvagen 1, 5-11584
Chili: PHILIPSCHLENA SA, Av. Santa Maria, Casilla 0760, SANTIAGO, STOCKHOLM, Tel. (0)8-7821000
Tel. (OZ) on 3816 Swhzeriand: PHILIPS AG., Components Dept., Allmendstmssel4O-142,
Colombia: IPRELENSO LTDA, Carrera 21 No. 56-17, BOGOTA. D.E., CH-8027 zORICH, Tel. (01) 4882211
P.O. Box n621, Tel. (01) 2497624 Tatwan: PHILIPS TAIWAN LTD., 581 Min Sheng East Road, P.O. Box 22978,
Denlllll1<: PHILIPS COMPONENTS AIS, Prags Boolevard sO, PB1919, DK-2300 TAIPEI 10446, Taiwan, Tel. 886-2-509-7666. Fax. 886 2 500 5899
COPENHAGEN S, Tel. 32-883333 ThaHand: PHILIPS ELECTRICAL CO. Of THAILAND LTD., 283 Silon Road,
Finland: PHILIPS COMPONENTS, Sinikalliontie 3, SF-()2630 ESPOO P.O. Box 961, BANGKOK, Tel. (02) 233-6330-9
Tel. 358-l1-50261 Tur1<ey: TORK PHILIPS TICARET AS., Philips Components,
France: PHILI'S COMPOSANTS, 117 Quai du President Roosevelt, Talatpasa Ced. No.5, 90640 LEv.ENT/ISTANBUL. Tel. (01) 179 2770
92134ISSY-LE5-MOULINEAUX Cedex, Tel. (01) 40938000.
Unhed Kingdom: PHILIPS COMPONENTS LTD., Mullard Hoose,
Fax_ 01 40938692 Torrington Place, LONDON WC1E 7HD, Tel. (071) 5806633,
Genmany: PHILIPS COMPONENTS UB dar Philips G.m.b.H., Fax. (071) 436 2196
Burc:hardstmsseI9, 0-2 HAMBURG 1, Tel. (040) 3296-0, Fax. 040 3296912. Unhed Stat..: (Colo< Pidure Tubes - Monochrome & Colour Display Tubes)
GMce: PHLIPS HEUfNIOUE S.A, Components Di~sion, PHILIPS DISPLAY COMPONENTS COMPANY, 1600 Huron Parkway,
No. 15, 25th March SlT6et, GR lmSTAv.ROS, Tel. (01) 4894339/489491t P.O. Box 963, ANN ARBOR, M~higan 48106, Tel. (313) 996-9400
Hong Kong: PHILIPS HONG KONG LTD., Components Div., (IC Products) SIGNETICS COMPANY, 811 East Arques Avenue,
l5IF Philips Ind. Bldg., 24 Kung YipSt., KWAI CHUNG, Tel. (0)-4245121 SUNNYVALE, CA 94088-3409, Tel. (800) 227-1817, Ext. 900
Inella: PEICO ELECTRONICS & ELECTRICAlS LTD., Components Dept., (Passive Components, D~crete Semiccnduc1Ors, Matenals and Professional
Shivsagar Estate 'A' Block, P.O. Bo,6598, 254-lJ Dr. Annie Besant Rd., Components & LCD) PHILIPS SEMICONDUCTORS, D.crete Products
BOMBAY-40018 Tel. (022)492151»-4921515. Fax. 022 49419063 Div.ion, 2001 West Blue Heron Blvd., P.O. Box 10330, RIVIERA BEACH.
IndonRla: P.T. PHILIPs-RALIN ELECTRONICS, Components Div., Florida 33404, Tel. (407) 881-3200
SetiabtJdi II Building, 6th Fl., Jalan H.R Rasuna Said (P.O. Box 223<1<BY) Urugu.y: PHILIPS COMPONENTS, Coronel Mora 433, MONTEVIDEO,
Kuningan, JAKARTA, 12910, Tel. (021) 517995 Tel. (02) 70-4044
lrellnd: PHILIPS ELECTRONICS (IRElAND) LTD., ComponenlS Div~ion, Venezuela: MAGNETICA SA, Caile 6, Ed. Las Tres Jotas, CARACAS 1074A.
Newstead, Cionskeagh, DUBLIN 14, Tel. (01)693355 App. PoSl78117, Tel. (02)2417509
holy: PHILIPS S.pA, Philips Components, Piazza IV Novembre 3, Zimbabwe: PHILIPS ELECTRICAL (PVT) LTD., 62 Mutare Road, HARARE,
1-20124 MILANO, Tel. (02) 6752.1, Fax. 02 67522642 P.O. Box 994, Tel. 47211
Japan: PHILIPS JAPAN LTD., Components Di~ion, Philips Bldg. 1~7,
Kohnan 2-dlome, Minab-ku, TOKYO 108, Tel. (03) 81~740-5030.
Fax. 03 81337400570 For aft other countries apply to: Philips Components, Marketing Communica-
K.... (Republic o~: PHILIPS INDUSTRIES (KOREA) LTD., Components Divi- tions, P.O. Box 218, 5600 MD EINDHOv.EN, The Netherlands,
sion, Philips House, 260-199 haewon-dong, Yongsan-ku, SEOUL, Telex 35000 pht"'l, Fax +31-40·724825
Tel. (02) 794-5011 ADS92 ©Philips Export B.V. 1992
Malayall: PHILIPS MALAYSIA SON SHD, Components Div.,
3JalanSSI512ASUBANG,47500 PETALlNGJAYA. Tel. (03) 7345511 All rights are reserved. Reproduction in whole or in pert is prohibited witheut the
Mexico: PHILI'S COMPONENTS, Pas.. Tnunfo de Ia Republ~ No 215 prior written consent of the rol'frighl owner.
Local 5, Cd Juarez CHIHUAHUA 32340 MEXICO, Tel. (16) 11l-07-()1 102 The information presented in this document does not form part of any quotation or
Netht~andt: PHILIPS NEDERlAND B.V., Mar1<tgrnep Philips Components, contrac\ " believed to be accurate and "'liable and may be changed without
Postbus 90050, 5600 PB EINDHOv.EN, Tel. (040) 783749 notice. No liability will be accepted 1'1' the publisher for any consequence of its use.
New ulland: PHILIPS NEW ZEAlAND LTD., Components Division, Publication thereof does nol rorwey nor imply any license under patent-or
2 wagener Place, C.P.O. Box 1041, AUCKLAND, Tel. (09) 894-160, industrial or intellectual property rights.
Fax. (09) 897-811 1I12S'91
\ Phili~s
PHILIPS