W921E840
4-BIT MICROCONTROLLER
Table of Contents-
1. GENERAL DESCRIPTION .........................................................................................................................3
2. FEATURES.................................................................................................................................................3
3. PIN CONFIGURATION ...............................................................................................................................6
40-pin DIP ..................................................................................................................................................6
48-pin QFP.................................................................................................................................................7
4. PIN DESCRIPTION.....................................................................................................................................9
5. BLOCK DIAGRAM ....................................................................................................................................10
6. FUNCTIONAL DESCRIPTION .................................................................................................................11
6.1 ROM Memory Map ...........................................................................................................................11
6.2 RAM Memory Map............................................................................................................................12
6.2.1 Special Control Register Area .................................................................................................12
6.2.2 Stack Register Area ................................................................................................................14
6.2.3 Working Register Area............................................................................................................15
6.3 Internal Oscillator Circuit ...................................................................................................................15
6.4 Initial State ........................................................................................................................................16
6.5 Input/Output ......................................................................................................................................17
6.5.1 Normal/Special Function Selection of I/O ................................................................................17
6.5.2 Pull High and Open Drain Control of I/O ................................................................................. 19
6.6 Serial Port .........................................................................................................................................21
6.7 DTMF Generator...............................................................................................................................24
6.8 Beep Tone Generator .......................................................................................................................25
6.9 D/A Converter ...................................................................................................................................26
6.10 Comparator.....................................................................................................................................27
6.11 Timer/Counter .................................................................................................................................28
6.11.1 TM0......................................................................................................................................28
6.11.2 TM1......................................................................................................................................30
6.11.3 TM2......................................................................................................................................31
6.11.4 TM3......................................................................................................................................34
6.11.5 Arbitrary Waveform Generator ..............................................................................................35
6.12 Interrupt...........................................................................................................................................35
6.12.1 Interrupt Control Register......................................................................................................36
6.12.2 Interrupt Enable Flag ............................................................................................................36
6.13 Operating Mode ..............................................................................................................................37
6.13.1 Normal Mode ........................................................................................................................37
-1-
Publication Release Date: August 1997
Revision A1
W921E840
6.13.2 Hold Mode ............................................................................................................................37
6.13.3 Stop Mode ............................................................................................................................40
6.14 Reset ..............................................................................................................................................43
6.14.1 Reset by RESET ..................................................................................................................43
6.14.2 Reset by Watch Dog Timer ...................................................................................................43
7. EEPROM FUNCTION...............................................................................................................................43
7.1 Pin Description of EEPROM Function...............................................................................................43
7.2 EEPROM Program/Erase Mode Selection .......................................................................................44
7.3 Initial Condition Registers Program Method ......................................................................................45
Programming Waveforms.................................................................................................................45
Erase Waveforms.............................................................................................................................46
7.4 Internal ROM -- EEPROM (Super EPROM) Program Method .........................................................46
Programming Waveforms.................................................................................................................46
Erase Waveforms.............................................................................................................................47
8. ABSOLUTION MAXIMUM RATINGS .......................................................................................................47
9. ELECTRICAL CHARACTERISTICS.........................................................................................................47
9.1 DC Characteristics ............................................................................................................................47
9.2 AC Characteristics ............................................................................................................................48
8.3 DC Characteristics of Programming/Erase Operation ......................................................................50
9.4 AC Characteristics of Programming/Erase Operation.......................................................................50
10. ADDRESSING MODE ............................................................................................................................51
10.1 ROM Addressing Mode...................................................................................................................51
10.1.1 Short Jump Addressing Mode: (1 word/1 cycle for JMPS)......................................................51
10.1.2 Indirect Call Addressing Mode: (1 word/2 cycles) ..................................................................51
10.1.3 Long Call/Jump Addressing Mode: (2 words/2 cycles) ...........................................................52
10.2 RAM Addressing Mode ...................................................................................................................52
10.2.1 Direct Addressing Mode: (2 words/2 cycles) ..........................................................................52
10.2.2 Indirect Addressing Mode: (1 word/1 cycle) ...........................................................................52
10.2.3 Working Register Addressing Mode: (1 word/1 cycle) ............................................................53
10.3 Look-up Table Addressing Mode (1 word/2 cycles) ........................................................................53
11. INSTRUCTION CODE MAP ...................................................................................................................55
12. INSTRUCTION SET SUMMARY ............................................................................................................59
13. PACKAGE DIMENSIONS.......................................................................................................................63
40-pin DIP ................................................................................................................................................63
48-pin QFP...............................................................................................................................................63
-2-
W921E840
1. GENERAL DESCRIPTION
The W921E840 is a single-chip CMOS 4-bit microcontroller that is a subset of W921E880. It features
four multi-function timers, one channel DTMF generator, an 8-bit D/A converter circuit, eight interrupt
sources, 48-level subroutine nesting, and built in four by one channel comparator circuit. Two power
down modes, hold and stop mode, reduce power dissipation. The excellent memory structure, 8K
super EPROM for program code and 512 x 4 bit RAM minimize the need for external memory
devices.
W921E840 is a powerful microcontroller for wide range consuming applications, requiring few
external components, which is especially suited for telecommunication design.
2. FEATURES
Operating Voltage
•
2.7 to 5.5 V operating voltage
Operating Frequency
•
Crystal or RC for main system clock
−
Crystal for 400K, 800K, 2M, 3.58M, 4MHz
−
RC up to 4MHz
Memory
•
•
8K
×
10-bit ROM (super EPROM)
512
×
4-bit RAM
−
64
×
4-bit special registers
−
16
×
4-bit working registers
−
128
×
4-bit general registers
−
304
×
4-bit multi-purpose registers
Stack
•
8-bit stack pointer
I/O Pins
•
20 bidirectional and individually controllable I/O lines
−
P2 Port: P2.0 to P2.3 large sink current pins and open drain option
−
P3 Port: P3.0 to P3.3 multi-function I/O
−
P4 Port: P4.0 to P4.3 open drain and pull high resistor option, multi-function I/O
−
P5 Port: P5.0 to P5.3 multi-function I/O
−
P6 Port: P6.0 to P6.3 open drain and pull high resistor option, multi-function I/O
•
14 bidirectional I/O lines
−
PA Port: PA.0 to PA.3 open drain and pull high resistor option
Publication Publication Release Date: August 1997
-3-
Revision A1
W921E840
−
PB Port: PB.0 to PB.3 open drain and pull high resistor option
−
PC Port: PC.1 to PC.3 open drain and pull high resistor option
−
PD Port: PD.0 to PD.1 open drain and pull high resistor option
Serial I/O Interface
•
Clock synchronous multi-nibbles serial transmitter/receiver interface
DTMF Generator
•
One channel DTMF generator
Beep Tone Generator
•
One channel beep tone generator
8-bit D/A Converter
•
One channel 8-bit D/A converter
Voltage Comparator
•
Multiplexed four channel voltage comparator
Timer/Counter
•
•
•
•
Timer 0: 2 to 19 order divider, auto-reload timer, watch-dog timer
Timer 1: 2 to 19 order divider, auto-reload timer, arbitrary waveform generator, external event
counter
Timer 2: 2 to 19 order divider, auto-reload timer, arbitrary waveform generator, period/pulse width
measurement function
Timer 3: 2 to 19 order divider, auto-reload timer
Interrupt
•
•
Two external sources: INT0 (P4.3), P4 Port (P4.0 to P4.2)
Six internal sources: Timer 0, Timer 1, Timer 2, Timer 3, Comparator, Serial Port
Operating Mode (System Clock)
•
•
•
Normal mode: system clock operating
HOLD mode: no operation except for oscillator (system clock stops only)
STOP mode: no operation including oscillator
Addressing Mode
•
ROM: Short jump addressing mode
-4-
W921E840
Indirect Call Addressing Mode
Long jump/call addressing mode
•
RAM: Direct addressing mode
Indirect Addressing Mode
Working register addressing mode
•
Look-up table addressing mode
Instruction Sets
•
108 instruction sets
40-pin DIP, 48-pin QFP
Package Type
•
The W921E840 microcontroller series are shown in the following table:
PART NO.
W921E840
W921E841
W921E842
W921E843
W921E844
PACKAGE TYPE
40-pin DIP
40-pin DIP
40-pin DIP
40-pin DIP
48-pin QFP
FUNCTION
With pin PD.0, PD.1, BTG without dual clock
XT
, XT,
PC.0
With dual clock
XT
, XT, PC.0 without pin PD.0, PD.1,
BTG
With pin PD.0, PD.1, PC.0 without dual clock
XT
, XT,
BTG
With dual clock
XT
, XT, BTG without pin PD.0, PD.1,
PC.0
With pin PD.0, PD.1, PC.0, BTG, dual clock
XT
, XT
Publication Publication Release Date: August 1997
-5-
Revision A1