W79E804A/803A/802A Data Sheet
8-BIT MICROCONTROLLER
Table of Contents-
1.
2.
3.
4.
5.
6.
GENERAL DESCRIPTION ......................................................................................................... 4
FEATURES ................................................................................................................................. 5
PARTS INFORMATION LIST ..................................................................................................... 6
3.1
Lead Free (RoHS) Parts information list......................................................................... 6
PIN CONFIGURATION ............................................................................................................... 7
PIN DESCRIPTION..................................................................................................................... 8
FUNCTIONAL DESCRIPTION.................................................................................................... 9
6.1
On-Chip Flash EPROM .................................................................................................. 9
6.2
I/O Ports.......................................................................................................................... 9
6.3
Serial I/O ......................................................................................................................... 9
6.4
Timers ............................................................................................................................. 9
6.5
Interrupts......................................................................................................................... 9
6.6
Data Pointers ................................................................................................................ 10
6.7
Architecture................................................................................................................... 10
6.7.1
6.7.2
6.7.3
6.7.4
6.7.5
6.7.6
ALU ................................................................................................................................10
Accumulator ...................................................................................................................10
B Register.......................................................................................................................10
Program Status Word: ....................................................................................................10
Scratch-pad RAM ...........................................................................................................11
Stack Pointer ..................................................................................................................11
7.
8.
9.
10.
11.
6.8
Power Management...................................................................................................... 11
MEMORY ORGANIZATION...................................................................................................... 12
7.1
Program Memory (on-chip Flash) ................................................................................. 12
7.2
Data Memory ................................................................................................................ 12
7.3
Register Map................................................................................................................. 13
7.4
Working Registers......................................................................................................... 15
7.5
Bit addressable Locations............................................................................................. 15
7.6
Stack ............................................................................................................................. 15
SPECIAL FUNCTION REGISTERS ......................................................................................... 16
INSTRUCTION SET.................................................................................................................. 45
9.1
Instruction Timing.......................................................................................................... 53
POWER MANAGEMENT.......................................................................................................... 56
10.1 Idle Mode ...................................................................................................................... 56
10.2 Power Down Mode ....................................................................................................... 56
RESET CONDITIONS............................................................................................................... 57
11.1 Sources of reset............................................................................................................ 57
11.1.1
External Reset ..............................................................................................................57
-1-
Publication Release Date: July 16, 2007
Revision A2
W79E804A/803A/802A
11.1.2
11.1.3
Power-On Reset (POR)................................................................................................57
Watchdog Timer Reset.................................................................................................57
12.
13.
11.2 Reset State ................................................................................................................... 57
INTERRUPTS ........................................................................................................................... 60
12.1 Interrupt Sources .......................................................................................................... 60
12.2 Priority Level Structure ................................................................................................. 62
12.3 Response Time............................................................................................................. 63
12.4 Interrupt Inputs.............................................................................................................. 64
PROGRAMMABLE TIMERS/COUNTERS ............................................................................... 66
13.1 Timer/Counters 0 & 1.................................................................................................... 66
13.1.1
13.1.2
13.1.3
13.1.4
13.1.5
Time-Base Selection ....................................................................................................66
Mode 0 .........................................................................................................................66
Mode 1 .........................................................................................................................67
Mode 2 .........................................................................................................................68
Mode 3 .........................................................................................................................68
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
NVM MEMORY ......................................................................................................................... 70
WATCHDOG TIMER................................................................................................................. 71
15.1 WATCHDOG CONTROL.............................................................................................. 72
15.2 CLOCK CONTROL of Watchdog.................................................................................. 73
SERIAL PORT (UART) ............................................................................................................. 74
16.1 MODE 0 ........................................................................................................................ 74
16.2 MODE 1 ........................................................................................................................ 75
16.3 MODE 2 ........................................................................................................................ 77
16.4 MODE 3 ........................................................................................................................ 78
16.5 Framing Error Detection ............................................................................................... 79
16.6 Multiprocessor Communications................................................................................... 79
TIME ACCESS PROCTECTION .............................................................................................. 81
KEYBOARD INTERRUPT (KBI) ............................................................................................... 83
ANALOG COMPARATORS ...................................................................................................... 84
I/O PORT CONFIGURATION ................................................................................................... 85
20.1 Quasi-Bidirectional Output Configuration ..................................................................... 85
20.2 Open Drain Output Configuration ................................................................................. 86
20.3 Push-Pull Output Configuration .................................................................................... 87
20.4 Input Only Configuration ............................................................................................... 87
OSCILLATOR ........................................................................................................................... 88
21.1 On-Chip RC Oscillator Option....................................................................................... 88
21.2 External Clock Input Option .......................................................................................... 88
21.3 CPU Clock Rate select ................................................................................................. 89
POWER MONITORING FUNCTION ........................................................................................ 90
22.1 Power On Detect........................................................................................................... 90
22.2 Brownout Detect ........................................................................................................... 90
PULSE-WIDTH-MODULATED (PWM) OUTPUTS ................................................................... 91
-2-
W79E804A/803A/802A
24.
I2C SERIAL CONTROL ............................................................................................................ 95
24.1 SIO Port ........................................................................................................................ 95
24.2 The I2C Control Registers: ........................................................................................... 96
24.2.1
24.2.2
24.2.3
24.2.4
24.2.5
The Address Registers, I2ADDR ..................................................................................96
The Data Register, I2DAT ............................................................................................96
The Control Register, I2CON .......................................................................................97
The Status Register, I2STATUS...................................................................................97
The I2C Clock Baud Rate Bits, I2CLK ..........................................................................97
Master Transmitter Mode .............................................................................................98
Master Receiver Mode .................................................................................................98
Slave Receiver Mode ...................................................................................................99
Slave Transmitter Mode ...............................................................................................99
24.3
Modes of Operation ...................................................................................................... 98
24.3.1
24.3.2
24.3.3
24.3.4
25.
26.
27.
28.
29.
24.4 Data Transfer Flow in Five Operating Modes............................................................... 99
ICP (IN-CIRCUIT PROGRAM) FLASH PROGRAM ............................................................... 105
CONFIG BITS ......................................................................................................................... 106
26.1 CONFIG1 .................................................................................................................... 106
26.2 CONFIG2 .................................................................................................................... 107
ELECTRICAL CHARACTERISTICS....................................................................................... 108
27.1 Absolute Maximum Ratings ........................................................................................ 108
27.2 DC ELECTRICAL CHARACTERISTICS .................................................................... 108
27.3 The COMPARATOR ELECTRICAL CHARACTERISTICS ........................................ 110
27.4 AC ELECTRICAL CHARACTERISTICS .................................................................... 110
27.5 EXTERNAL CLOCK CHARACTERISTICS ................................................................ 110
27.6 AC SPECIFICATION .................................................................................................. 111
27.7 TYPICAL APPLICATION CIRCUITS .......................................................................... 111
PACKAGE DIMENSIONS ....................................................................................................... 112
28.1 20L SOP-300mil.......................................................................................................... 112
28.2 20L PDIP 300mil ......................................................................................................... 113
REVISION HISTORY .............................................................................................................. 114
-3-
Publication Release Date: July 16, 2007
Revision A2
W79E804A/803A/802A
1. GENERAL DESCRIPTION
The W79E804 series are an 8-bit Turbo 51 microcontroller which has an in-system programmable
Flash EPROM which Flash EPROM can program by ICP (In Circuit Program) or by
hardware
writer.
The instruction set of the W79E804 series are fully compatible with the standard 8052. The W79E804
series contain a
8K/4K/2K
bytes of main Flash EPROM; a
256
bytes of RAM;
256
bytes NVM Data
Flash EPROM; two 8-bit bi-directional, one 2-bit bi-directional and bit-addressable I/O ports; two 16-bit
timer/counters; 4-channel 10-bit PWM; two serial ports that include a I2C and an enhanced full duplex
serial port. These peripherals are supported by 12 sources four-level interrupt capability. To facilitate
programming and verification, the Flash EPROM inside the W79E804 series allow the program
memory to be programmed and read electronically. Once the code is confirmed, the user can protect
the code for security.
-4-
W79E804A/803A/802A
2. FEATURES
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Fully static design 8-bit Turbo 51 CMOS microcontroller up to 20MHz when VDD=4.5V to 5.5V,
12MHz when VDD=2.7V to 5.5V
8K/4K/2K
bytes of AP Flash EPROM, with ICP and external writer programmable mode.
256
bytes of on-chip RAM.
256
bytes NVM Data Flash EPROM for customer data storage used and 10K writer cycles.
Instruction-set compatible with MSC-51.
On-chip configurable RC oscillator (6MHz).
Two 8-bit bi-directional and one 2-bit bi-directional ports.
Two 16-bit timer/counters.
12 interrupts source with four levels of priority.
One enhanced full duplex serial port with framing error detection and automatic address
recognition.
The 4 outputs mode and TTL/Schmitt trigger selectable Port.
Programmable Watchdog Timer.
Four-channel 10-bit PWM (Pulse Width Modulator).
One I2C communication port (Master / Slave).
Eight keypad interrupt inputs.
Two analog comparators.
Configurable on-chip oscillator.
LED drive capability (20mA) on all port pins.
Low Voltage Detect interrupt and reset.
Development Tools:
—
JTAG ICE(In Circuit Emulation) tool
—
ICP(In Circuit Programming) writer
•
Packages:
—
Lead Free (RoHS) DIP 20:
—
Lead Free (RoHS) SOP 20:
—
Lead Free (RoHS) DIP 20:
—
Lead Free (RoHS) SOP 20:
—
Lead Free (RoHS) DIP 20:
—
Lead Free (RoHS) SOP 20:
W79E804ADG
W79E804ASG
W79E803ADG
W79E803ASG
W79E802ADG
W79E802ASG
-5-
Publication Release Date: July 16, 2007
Revision A2