W79E825A/824A/823B/822B 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 .................................................................................................................. 9
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 ...........................................................................................................10
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......................................................................................................... 16
7.5
Bit addressable Locations............................................................................................. 16
7.6
Stack ............................................................................................................................. 16
SPECIAL FUNCTION REGISTERS ......................................................................................... 17
INSTRUCTION SET.................................................................................................................. 48
9.1
Instruction Timing.......................................................................................................... 56
POWER MANAGEMENT.......................................................................................................... 59
10.1 Idle Mode ...................................................................................................................... 59
10.2 Power Down Mode ....................................................................................................... 59
RESET CONDITIONS............................................................................................................... 60
11.1 Sources of reset............................................................................................................ 60
11.1.1
External Reset ..............................................................................................................60
-1-
Publication Release Date: February 21, 2008
Revision A9
W79E825A/824A/823B/822B Data Sheet
11.1.2
11.1.3
Power-On Reset (POR)................................................................................................60
Watchdog Timer Reset.................................................................................................60
12
13
11.2 Reset State ................................................................................................................... 60
INTERRUPTS ........................................................................................................................... 65
12.1 Interrupt Sources .......................................................................................................... 65
12.2 Priority Level Structure ................................................................................................. 67
12.3 Response Time............................................................................................................. 68
12.4 Interrupt Inputs.............................................................................................................. 69
PROGRAMMABLE TIMERS/COUNTERS ............................................................................... 71
13.1 Timer/Counters 0 & 1.................................................................................................... 71
13.1.1
13.1.2
13.1.3
13.1.4
13.1.5
Time-Base Selection ....................................................................................................71
Mode 0 .........................................................................................................................71
Mode 1 .........................................................................................................................72
Mode 2 .........................................................................................................................73
Mode 3 .........................................................................................................................73
14
15
16
17
18
19
20
21
22
23
NVM MEMORY ......................................................................................................................... 75
WATCHDOG TIMER................................................................................................................. 77
15.1 WATCHDOG CONTROL.............................................................................................. 78
15.2 CLOCK CONTROL of Watchdog.................................................................................. 79
SERIAL PORT (UART) ............................................................................................................. 80
16.1 MODE 0 ........................................................................................................................ 80
16.2 MODE 1 ........................................................................................................................ 81
16.3 MODE 2 ........................................................................................................................ 83
16.4 MODE 3 ........................................................................................................................ 84
16.5 Framing Error Detection ............................................................................................... 85
16.6 Multiprocessor Communications................................................................................... 85
TIME ACCESS PROCTECTION .............................................................................................. 87
KEYBOARD INTERRUPT (KBI) ............................................................................................... 89
ANALOG COMPARATORS ...................................................................................................... 90
I/O PORT CONFIGURATION ................................................................................................... 91
20.1 Quasi-Bidirectional Output Configuration ..................................................................... 91
20.2 Open Drain Output Configuration ................................................................................. 92
20.3 Push-Pull Output Configuration .................................................................................... 93
20.4 Input Only Configuration ............................................................................................... 93
OSCILLATOR ........................................................................................................................... 94
21.1 On-Chip RC Oscillator Option....................................................................................... 94
21.2 External Clock Input Option .......................................................................................... 95
21.3 CPU Clock Rate select ................................................................................................. 95
POWER MONITORING FUNCTION ........................................................................................ 96
22.1 Power On Detect........................................................................................................... 96
22.2 Brownout Detect ........................................................................................................... 96
PULSE-WIDTH-MODULATED (PWM) OUTPUTS ................................................................... 97
-2-
W79E825A/824A/823B/822B Data Sheet
24
25
ANALOG-TO-DIGITAL CONVERTER .................................................................................... 101
24.1 ADC Resolution and Analog Supply: .......................................................................... 102
I2C SERIAL CONTROL .......................................................................................................... 104
25.1 SIO Port ...................................................................................................................... 104
25.2 The I2C Control Registers: ......................................................................................... 105
25.2.1
25.2.2
25.2.3
25.2.4
25.2.5
The Address Registers, I2ADDR ................................................................................105
The Data Register, I2DAT ..........................................................................................105
The Control Register, I2CON .....................................................................................106
The Status Register, I2STATUS.................................................................................106
The I2C Clock Baud Rate Bits, I2CLK ........................................................................106
Master Transmitter Mode ...........................................................................................107
Master Receiver Mode ...............................................................................................107
Slave Receiver Mode .................................................................................................107
Slave Transmitter Mode .............................................................................................108
25.3
Modes of Operation .................................................................................................... 107
25.3.1
25.3.2
25.3.3
25.3.4
26
27
28
29
30
25.4 Data Transfer Flow in Five Operating Modes............................................................. 108
ICP(IN-CIRCUIT PROGRAM) FLASH PROGRAM ................................................................ 114
CONFIG BITS ......................................................................................................................... 115
27.1 CONFIG1 .................................................................................................................... 115
27.2 CONFIG2 .................................................................................................................... 116
ELECTRICAL CHARACTERISTICS....................................................................................... 118
28.1 Absolute Maximum Ratings ........................................................................................ 118
28.2 DC ELECTRICAL CHARACTERISTICS .................................................................... 119
28.3 The ADC Converter DC ELECTRICAL CHARACTERISTICS ................................... 121
28.4 The COMPARATOR ELECTRICAL CHARACTERISTICS ........................................ 121
28.5 AC ELECTRICAL CHARACTERISTICS .................................................................... 121
28.6 EXTERNAL CLOCK CHARACTERISTICS ................................................................ 122
28.7 AC SPECIFICATION .................................................................................................. 122
28.8 TYPICAL APPLICATION CIRCUITS .......................................................................... 122
PACKAGE DIMENSIONS ....................................................................................................... 123
29.1 20-pin SOP ................................................................................................................. 123
29.2 20-pin DIP ................................................................................................................... 124
REVISION HISTORY .............................................................................................................. 125
-3-
Publication Release Date: February 21, 2008
Revision A9
W79E825A/824A/823B/822B Data Sheet
1
GENERAL DESCRIPTION
The W79E825 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 W79E825 series are fully compatible with the standard 8052. The W79E825
series contain a
16K/8K/4K/2K
bytes of main Flash EPROM; a
256/128
bytes of RAM;
256/128
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 multiplexed 10-bit A/D convert; 4-channel 10-bit PWM; two
serial ports that include a I2C and an enhanced full duplex serial port. These peripherals are
supported by 13 sources four-level interrupt capability. To facilitate programming and verification, the
Flash EPROM inside the W79E825 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-
W79E825A/824A/823B/822B Data Sheet
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
16K/8K/4K/2K
bytes of AP Flash EPROM, with ICP and external writer programmable mode.
256/128
bytes of on-chip RAM.
256/128
bytes NVM Data Flash EPROM for customer data storage used and 10K writer cycles.
Instruction-set compatible with MSC-51.
Two 8-bit bi-directional and one 2-bit bi-directional ports.
Two 16-bit timer/counters.
13 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).
Four-channel multiplexed with 10-bits A/D convert.
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:
W79E825ADG
- Lead Free (RoHS) DIP 20:
W79E825ADG
- Lead Free (RoHS) SOP 20:
W79E825ASG
- Lead Free (RoHS) DIP 20:
W79E824ADG
- Lead Free (RoHS) SOP 20:
W79E824ASG
- Lead Free (RoHS) DIP 20:
W79E823BDG
- Lead Free (RoHS) SOP 20:
W79E823BSG
- Lead Free (RoHS) DIP 20:
W79E822BDG
- Lead Free (RoHS) SOP 20:
W79E822BSG
•
-5-
Publication Release Date: February 21, 2008
Revision A9