Preliminary W79E217A DATA SHEET
8-bit Microcontroller
Table of Contents-
1.
2.
3.
4.
5.
6.
GENERAL DESCRIPTION ......................................................................................................... 5
FEATURES ................................................................................................................................. 6
PARTS INFORMATION LIST ..................................................................................................... 7
3.1
Lead Free (RoHS) Parts information list......................................................................... 7
PIN CONFIGURATION ............................................................................................................... 7
PIN DESCRIPTION..................................................................................................................... 8
5.1
Port 4 ............................................................................................................................ 11
MEMORY ORGANIZATION...................................................................................................... 12
6.1
Program Memory (on-chip Flash) ................................................................................. 12
6.2
Data Memory ................................................................................................................ 12
6.3
Auxiliary SRAM ............................................................................................................. 13
6.4
2-KB NVM Data Flash Memory .................................................................................... 13
6.4.1
Operation........................................................................................................................16
7.
8.
SPECIAL FUNCTION REGISTERS ......................................................................................... 18
INSTRUCTION SET.................................................................................................................. 72
8.1
Instruction Timing.......................................................................................................... 80
8.1.1
External Data Memory Access Timing............................................................................82
9.
10.
POWER MANAGEMENT.......................................................................................................... 85
9.1
Idle Mode ...................................................................................................................... 85
9.2
Power Down Mode ....................................................................................................... 85
RESET CONDITIONS............................................................................................................... 87
10.1 Sources of reset............................................................................................................ 87
10.1.1
10.1.2
10.1.3
External Reset ..............................................................................................................87
Power-On Reset (POR)................................................................................................87
Watchdog Timer Reset.................................................................................................87
11.
10.2 Reset State ................................................................................................................... 88
INTERRUPTS ........................................................................................................................... 89
11.1 Interrupt Sources .......................................................................................................... 89
11.2 Priority Level Structure ................................................................................................. 90
11.2.1
Response Time ............................................................................................................93
12.
PROGRAMMABLE TIMERS/COUNTERS ............................................................................... 94
12.1 Timer/Counters 0 & 1.................................................................................................... 94
12.1.1
12.1.2
12.1.3
12.1.4
12.1.5
Time-Base Selection ....................................................................................................94
Mode 0 .........................................................................................................................94
Mode 1 .........................................................................................................................95
Mode 2 .........................................................................................................................95
Mode 3 .........................................................................................................................96
-1-
Publication Release Date: December 14, 2007
Revision A3.0
Preliminary W79E217A Data Sheet
12.2
Timer/Counter 2 ............................................................................................................ 96
12.2.1
12.2.2
12.2.3
12.2.4
Capture Mode...............................................................................................................97
Auto-reload Mode, Counting up....................................................................................97
Auto-reload Mode, Counting Up/Down .........................................................................98
Baud Rate Generator Mode .........................................................................................99
13.
14.
15.
WATCHDOG TIMER............................................................................................................... 100
PULSE-WIDTH-MODULATED (PWM) OUTPUTS ................................................................. 103
14.1 PWM Features ............................................................................................................ 103
14.2 PWM Control Registers .............................................................................................. 104
14.3 PWM Pin Structures ................................................................................................... 106
14.4 Complementary PWM with Dead-time and Override functions .................................. 109
14.5 Dead-Time Insertion ................................................................................................... 110
14.6 PWM Output Override ................................................................................................ 111
14.7 Edge Aligned PWM (up-counter) ................................................................................ 114
14.8 Center Aligned PWM (up/down counter) .................................................................... 117
14.9 Single Shot (Up-Counter) ........................................................................................... 119
14.10
Smart Fault Detector .............................................................................................. 122
14.11
PWM Power-down/Wakeup Procedures ................................................................ 124
MOTION FEEDBACK MODULE............................................................................................. 126
15.1 Input Capture Module (IC) .......................................................................................... 126
15.1.1
15.1.2
Compare Mode...........................................................................................................134
Reload Mode ..............................................................................................................134
Free-counting mode ...................................................................................................136
Compare-counting mode ............................................................................................136
X2/X4 Counting modes...............................................................................................136
Direction of Count.......................................................................................................136
Up-Counting ...............................................................................................................138
Down-Counting...........................................................................................................138
15.2
Quadrature Encoder Interface (QEI) .......................................................................... 134
15.2.1
15.2.2
15.2.3
15.2.4
15.2.5
15.2.6
16.
17.
SERIAL PORT ........................................................................................................................ 139
16.1 Mode 0 ........................................................................................................................ 139
16.2 Mode 1 ........................................................................................................................ 140
16.3 Mode 2 ........................................................................................................................ 141
16.4 Mode 3 ........................................................................................................................ 142
16.5 Framing Error Detection ............................................................................................. 142
16.6 Multiprocessor Communications................................................................................. 143
I2C SERIAL PORTS ............................................................................................................... 144
17.1 SIO Port ...................................................................................................................... 144
17.2 The I2C Control Registers .......................................................................................... 144
17.2.1
17.2.2
17.2.3
Slave Address Registers, I2ADDR .............................................................................145
Data Register, I2DAT .................................................................................................145
Control Register, I2CON.............................................................................................146
-2-
Publication Release Date: December 14, 2007
Revision A3.0
Preliminary W79E217A Data Sheet
17.2.4
17.2.5
17.2.6
17.2.7
Status Register, I2STATUS........................................................................................146
I2C Clock Baud Rate Control, I2CLK..........................................................................146
I2C Time-out Counter, I2Timer ...................................................................................146
I2C Maskable Slave Address .....................................................................................147
Master Transmitter Mode ...........................................................................................147
Master Receiver Mode ...............................................................................................148
Slave Receiver Mode .................................................................................................148
Slave Transmitter Mode .............................................................................................148
Master/Transmitter Mode ...........................................................................................149
Master/Receiver Mode ...............................................................................................150
Slave/Transmitter Mode .............................................................................................151
Slave/Receiver Mode .................................................................................................152
GC Mode ....................................................................................................................153
17.3
Modes of Operation .................................................................................................... 147
17.3.1
17.3.2
17.3.3
17.3.4
17.4
Data Transfer Flow in Five Operating Modes............................................................. 148
17.4.1
17.4.2
17.4.3
17.4.4
17.4.5
18.
SERIAL PERIPHERAL INTERFACE (SPI)............................................................................. 154
18.1 General descriptions................................................................................................... 154
18.2 Block descriptions ....................................................................................................... 154
18.3 Functional descriptions ............................................................................................... 156
18.3.1
18.3.2
18.3.3
18.3.4
18.3.5
18.3.6
18.3.7
18.3.8
18.3.9
18.3.10
18.3.11
Master mode ..............................................................................................................156
Slave Mode ................................................................................................................159
Slave select ................................................................................................................163
/SS output...................................................................................................................163
SPI I/O pins mode ......................................................................................................164
Programmable serial clock’s phase and polarity ........................................................165
Receive double buffered data register........................................................................165
LSB first enable ..........................................................................................................166
Write Collision detection .............................................................................................166
Transfer complete interrupt ......................................................................................166
Mode Fault ...............................................................................................................166
19.
20.
21.
22.
23.
ANALOG-TO-DIGITAL CONVERTER .................................................................................... 169
19.1 Operation of ADC ....................................................................................................... 169
19.2 ADC Resolution and Analog Supply ........................................................................... 170
LCD DISPLAY......................................................................................................................... 171
20.1 LCD Features.............................................................................................................. 171
20.2 LCD Frequency........................................................................................................... 172
20.3 LCD Power Connection .............................................................................................. 177
20.4 LCD Option Bits .......................................................................................................... 179
20.5 LCD Display ................................................................................................................ 179
TIMED ACCESS PROTECTION ............................................................................................ 182
PORT 4 STRUCTURE ............................................................................................................ 184
IN-SYSTEM PROGRAMMING................................................................................................ 187
23.1 The Loader Program Locates at LDFlash Memory .................................................... 187
Publication Release Date: December 14, 2007
Revision A3.0
-3-
Preliminary W79E217A Data Sheet
23.2 The Loader Program Locates at APFlash Memory .................................................... 187
OPTION BITS ......................................................................................................................... 188
24.1 Config0........................................................................................................................ 188
24.2 Config1........................................................................................................................ 189
ELECTRICAL CHARACTERISTICS....................................................................................... 190
25.1 Absolute Maximum Ratings ........................................................................................ 190
25.2 DC Characteristics ...................................................................................................... 190
25.3 AC Characteristics ...................................................................................................... 193
25.3.1
25.3.2
25.3.3
External Clock Characteristics....................................................................................193
AC Specification .........................................................................................................193
MOVX Characteristics Using Stretch Memory Cycle ..................................................194
24.
25.
26.
27.
28.
29.
25.4 The ADC Converter DC ELECTRICAL CHARACTERISTICS ................................... 196
25.5 I2C Bus Timing Characteristics .................................................................................. 196
25.6 Program Memory Read Cycle .................................................................................... 197
25.7 Data Memory Read Cycle........................................................................................... 198
25.8 Data Memory Write Cycle........................................................................................... 198
TYPICAL APPLICATION CIRCUITS ...................................................................................... 199
26.1 Crystal connections .................................................................................................... 199
26.2 Expanded External Data Memory and Oscillator........................................................ 199
PACKAGE DIMENSION ......................................................................................................... 200
27.1 100L QFP (14x20x2.75mm footprint 3.2mm) ............................................................. 200
APPLICATION NOTE ............................................................................................................. 201
REVISION HISTORY .............................................................................................................. 207
-4-
Publication Release Date: December 14, 2007
Revision A3.0
Preliminary W79E217A Data Sheet
1. GENERAL DESCRIPTION
The W79E217 is a fast, 8051/52-compatible microcontroller with a redesigned processor core that
eliminates wasted clock and memory cycles. Typically, the W79E217 executes instructions 1.5 to 3
times faster than that of the traditional 8051/52, depending on the type of instruction, and the overall
performance is about 2.5 times better at the same crystal speed. As a result, with the fully-static
CMOS design, the W79E217 can accomplish the same throughput with a lower clock speed, reducing
power consumption.
The W79E217 provides
256
bytes of on-chip RAM;
2-KB
of NVM memory Flash EPROM;
2-KB
of
auxiliary RAM;
seven
8-bit, bi-directional and bit-addressable I/O ports; an additional
4-bit
port P4;
three
16-bit timer/counters; Motion Feedback Module support;
2
UART serial ports;
1
channels of I2C
with master/slave capability;
1
channels of Serial Peripheral Interface (SPI),
8
channels of
12
bit PWM
with configurable dead time and
8
channels of 10-bit ADC. These peripherals are all supported by
20
interrupt sources with
4
levels of priority.
The W79E217 also contains a
64-KB
Flash EPROM whose contents may be updated in-system by a
loader program stored in an auxiliary,
4-KB
Flash EPROM. Once the contents are confirmed, it can be
protected for security.
-5-
Publication Release Date: December 14, 2007
Revision A3.0