WINBOND W79E4051_2051

W79E4051A/RA W79E2051A/RA
8- 1
2
3
4
5
6
7
8
9
10
-
....................................................................................................................................... 4
....................................................................................................................................... 4
......................................................................................................................... 5
(RoHS) ................................................................................... 5
3.1
................................................................................................................................ 6
................................................................................................................................ 7
................................................................................................................................ 8
6.1
I/O "! ...................................................................................................................... 8
#
! ........................................................................................................................... 8
6.2
$%'& ........................................................................................................................ 8
6.3
() ........................................................................................................................... 8
6.4
*+,- .................................................................................................................... 8
6.5
6.6
CPU ./ ................................................................................................................... 8
6.6.1 02143654748 ALU..............................................................................................................8
6.6.2 9;:2< (ACC) .....................................................................................................................9
6.6.3 B =6>2< ............................................................................................................................9
6.6.4 ?2@2A4B6C4=6>2< (PSW)...................................................................................................9
6.6.5 DEGF2H RAM....................................................................................................................9
6.6.6 I2J6K2L ............................................................................................................................9
M4NOP .............................................................................................................................. 10
QRSM4N .................................................................................................................. 10
7.1
*+ FlashN
T& ...................................................................................................... 10
7.2
UN
&VWX ........................................................................................................... 10
7.3
YZ
UN
& ............................................................................................................... 12
7.4
[\]^ .................................................................................................................. 12
7.5
_` ......................................................................................................................... 12
7.6
a
UN
& .................................................................................................................... 14
b4cd .............................................................................................................................. 17
eSf6g
h .................................................................................................................. 17
9.1
i"b6g
h .................................................................................................................. 17
9.2
j[kl .............................................................................................................................. 19
10.1 j[c ...................................................................................................................... 19
10.1.1 m4n2o6p ........................................................................................................................19
10.1.2 qrso6p
(POR) ..........................................................................................................19
-1-
Publication Release Date;July 10 2008
Revision.SC 7
W79E4051A/RA W79E2051A/RA
10.1.3
10.1.4
j[
}~ .................................................................................................................. 19
() ..................................................................................................................................... 22
(){c ...................................................................................................................... 22
11.1
(){€ ............................................................................................................... 23
11.2
()‚ƒ%„ ........................................................................................................... 25
11.3
…†Q
$%'& /‡*& ............................................................................................................ 25
12.1 $%'& / ‡*& 0&1 .................................................................................................... 25
%ˆ‰Š .................................................................................................................. 26
12.2
12.2.1 ‹Œ 0.............................................................................................................................27
12.2.2 ‹Œ 1.............................................................................................................................27
12.2.3 ‹Œ 2.............................................................................................................................28
12.2.4 ‹Œ 3.............................................................................................................................28
*+N
T& ........................................................................................................................... 29
Ž4 $
%'& ...................................................................................................................... 31
14.1 Ž2‘’ ............................................................................................................... 32
14.2 Ž2%'“‘’ ........................................................................................................ 33
#2”"! (UART) ..................................................................................................................... 34
15.1 g
h 0 ...................................................................................................................... 34
15.2 g
h 1 ....................................................................................................................... 35
15.3 g
h 2 ...................................................................................................................... 37
15.4 g
h 3 ...................................................................................................................... 38
•'–—˜™ ............................................................................................................... 39
15.5
š›œ .................................................................................................................. 39
15.6
žŸ’ (PWM) ................................................................................................................... 41
g ¡¢& ........................................................................................................................... 44
17.1 £V¤¥¦g ¡¢&() ....................................................................................... 45
%‘§©¨2ª
« ....................................................................................................................... 47
I/O¬!6 .......................................................................................................................... 48
19.1 ­
®©¯¬!6g
h ................................................................................................. 48
19.2 °±¬!6g
h ..................................................................................................... 49
²³& .................................................................................................................................. 51
20.1 ´M RC ²³&‰
µ ................................................................................................... 51
20.2 ¶·©%'“¸¹‰
µ ..................................................................................................... 51
b4cº» ....................................................................................................................... 52
21.1 ¼½˜™ .................................................................................................................. 52
21.2 ICP(¾¬b;¿†'Q ) FLASH †Q ................................................................................... 53
10.2
11
12
13
14
15
16
17
18
19
20
21
6t u4o6p (BOR) .............................................................................................................19
vwGx4y{z|<4o6p .........................................................................................................19
-2-
W79E4051A/RA W79E2051A/RA
22
23
24
25
26
27
28
[
.................................................................................................................................. 54
22.1
22.2
CONFIG0 ................................................................................................................. 54
CONFIG1 ................................................................................................................. 55
............................................................................................... 55
27.1
27.2
20-pin SOP .............................................................................................................. 89
20-pin DIP ................................................................................................................ 90
.............................................................................................................................. 91
a
UN
&À'·
,Á ..................................................................................................................................... 72
24.1 ,Á©%R .................................................................................................................. 81
b4Â .............................................................................................................................. 82
25.1 ÃÄ'Å* .................................................................................................................. 82
25.2 DC b4Â ............................................................................................................ 83
25.3 g ¡¢&Sb4Â ................................................................................................. 85
25.4 AC b6Â ............................................................................................................. 86
25.5 ¶·©%'“ ........................................................................................................... 86
25.6 RC OSC Æ AC ÇÈ ................................................................................................. 86
ɃÊ"b6¿ ....................................................................................................................... 87
ËÌÍÎ .............................................................................................................................. 89
ÏÐÑÒ
Ó ÔÖÕ×Ø©ÙÛÚÝÜÞàßáãâäå
Ú 8æ©çSèé ß uCêë©ìíîðïñ
òóSôõ
ö©÷øùúû 2299ü 27ý þ ÿ 200336 021-62365999
021-62365998
-3-
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
1
51"!$#%&(')
* (ICP)+,()- Flash EPROM .
!/,10324
#"1&65'1)87 W79E4051/2051 18*9
:"1&
;1<"=1>1?8* 8052 9
:@&
AB87
4K/2K
EPROM F 128 CD
* NVM GH Flash EPROM F 256 CD RAM F 2 8 IJ 1 2 IK
L I%CMD(NE * Flash
I/O O6PF 2 16- I%QSR / T(G
F 1 (U%VWX<(K(Y@ZSP7 1 [ 10 I PWM F]\^_` / a
I . 1 4bSc8de4 . f1g 9 h5(ij 4 k35(i@FBlS'S)4J1mSn , W79E4051/2051 4poq3* FLASH
EPROM )-hosrf%g@t]')uv@7wx)(-y%Qz4,{@!]|}~€(‚
7
2 ƒ…„
<†‡ 8I CMOSˆ 51(1(Rw‰Š(‹Œ 24MHZ F
•
•
VDD: 2.4~5.5V Œ 12MHz, 4.5~5.5V Œ 24MHz
• !$Ž%‘(’Rw‰j :
“q1”–• : —(˜ 24MHz ”–•JRw‰™Sš (Ž›%œI(/S ).
ž@oŸ•% : 22.1184/11.0592MHz ±2% (Ž›%œI‘’ , 5.0V t$^ 25°C W79E4051R_W79E2051R)
9:(= MCS-51AB
•
•
4K/2K CD("!$#%&')@* (ICP) +,)- Flash EPROM (AP Flash EPROM).
•
256 C(D%ž@o RAM
• W79E4051/2051 (¡ 128 CD NVM GH EPROM ¢£,{r(¤(GHw¥%2Œ 10K ¦ .
8 § . 16 CD%¨%§ .
•
1 8 I(O6P (Port1), 1 7 IOhP (Port3) 1 2 IO6P (P2.0 P2.1 aX,%¨ XT1 & XT2 ©ª )
«*–OpP–©ª(¬­(® LED *XX¯ (20mA) w«4©.ª(°S± 80mA.
•
•
2 16- ISQ4R / T(G
f(g [email protected] 4k
5iX²%³
•
•
1 <K%Y@ZSPw.´¡(µ¶·_`J¸Nº¹¼»(½(¾¿4
•
1 [ 10 I PWM
•
1 [bc3d$e
o$œ
t$jSÀÁb(Â
•
- t$jSaXI(>ÃI
- \^_` / aXI
YÄXÅ(Æ : -40~85 Ç
•
ÈÉ :
•
W79E4051/2051
-
Ê
Ê
Ê
Ê
Lead Free (RoHS) PDIP 20:
Lead Free (RoHS) SOP 20:
Lead Free (RoHS) PDIP 20:
Lead Free (RoHS) SOP 20:
W79E4051AKG
W79E4051ASG
W79E2051AKG
W79E2051ASG
Lead Free (RoHS) PDIP 20:
W79E4051RAKG
Lead Free (RoHS) SOP 20:
W79E4051RASG
Lead Free (RoHS) PDIP 20:
W79E2051RAKG
Lead Free (RoHS) SOP 20:
W79E2051RASG
-4-
W79E4051A/RA W79E2051A/RA
3
3.1
ËÍÌ3΅ÏpÐÒÑ
Ó6Ô (RoHS) Õ×ÖØÚÙ"ÛÜ3Ý8Þ
ßà .
EPROM
FLASH SIZE
RAM
NVM FLASH
EPROM
á]â
å(RC
æ(ç ãSä
èé
W79E4051AKG
4KB
256B
128B
±25%
PDIP-20
Pin
W79E4051ASG
4KB
256B
128B
±25%
SOP-20
Pin
W79E2051AKG
2KB
256B
128B
±25%
PDIP-20
Pin
W79E2051ASG
2KB
256B
128B
±25%
SOP-20
Pin
W79E4051RAKG
4KB
256B
128B
±2%
PDIP-20
Pin
W79E4051RASG
4KB
256B
128B
±2%
SOP-20
Pin
W79E2051RAKG
2KB
256B
128B
±2%
PDIP-20
Pin
W79E2051RASG
2KB
256B
128B
±2%
SOP-20
Pin
í
î `ïSð
: VDD=5.0V, TA = 25°C
ê
3-1:
ëìÈÉ
-5-
(RoHS)
ê
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
4
ñ8òºóÒô
MODE/RST
ö
RXD/P3.0
TXD/P3.1
XTAL2/P2.0
õ
ø
÷
ù
XTAL1/P2.1
ú
INT0/P3.2
INT1/P3.3
T0/P3.4
PWM0/T1/P3.5
GND
20 PIN
DIP/SOP
û
ü
ý
ÿõ þ
4-1:
-6-
öþ
õý
õü
õû
õú
õù
õø
õ÷
õþ
õõ
VCC
P1.7
P1.6
P1.5
P1.4
P1.3
P1.2
P1.1/AN1P1.0/AN0+
P3.7
W79E4051A/RA W79E2051A/RA
5
ñ8ò
à
1
2
(ICP
3
)
P2.1
X1
I
P2.0
X2/CLKOUT
O
VDD
-
P
VSS
-
P
RST
MODE
$
"#
,.-
I/O
P1.1
AN1-
I/O
P1.2
I/O
P1.3
I/O
P1.4
I/O
P1.5
I/O
P1.6
Data
I/O
P1.7
SCK
I/O
P3.0
RXD
I/O
P3.1
TXD
I/O
P3.2
/INT0
I/O
P3.3
/INT1
I/O
P3.4
T0
I/O
P3.5
T1
.
.
%'&
AN0+
)**˜@t+(/SaXI
: 2 (
.
1:
I K L wP @osq1243 . aXI(z
¨ b .
î
aX,(¿S :
AN0+ & AN1- bc"d$e .
GHJRw9
‰ 8 ICPb%
 :; .
8
I/O 0/
P1.0~P1.1 576
,.-
I K L P , /@osq1243
8=< P3.6 ; , P3.6,>b
c"d$e
*î ? .
aX,(¿S TXD & RXD (Uart),/INT03:
7
I/O
P3.0~P3.7
1, T0, T1/PWM0.
I/O
P3.6
S
P3.7
* Note : TYPE P:
”–•“q1Rw‰©
ª@!$›(œ%¨ I/O P .
• “q1R
‰ !©
CRYSTAL2: ”–
ª@!$›(œ%¨ I/O P .
CRYSTAL1: .
I
P1.0
PWM0
@BA
, I:
, O:
?
L
, I/O: K
I/O
, S:
-7-
oŸq™%š
.
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
6
CED
( Š
o J4Ir , 4K/2KCD Flash EPROM, 256CD RAM, 128 NVM
I%Q4R– TG 1<(K(Y@Z%PX7%o$q
* FLASH EPROM)(-3osr"!J
GH
@! Ÿ(,0S2 ICP042X0S27
 ST4U4O7T%BSlJ%˜VXWR0Y%ZO[{(#4\]^4_4` ICa%°\]^4b
ICP LM%/N4OPQ / R(k(
57(4cd(
!$¢(£
* Pe+(,)-@7
W79E4051/2051
4F
8051 HG
FLASH EPROM, 2 16/
NVM
FLASH EPROM 4K
GH
6.1
I/O
fhg
¡ 14 8- I , S 7- I3% 2- I I/O P$• %SJ@a(I4ªiY1S,
¨ I/O. < P1.0 J
%
«
*–OhPs@!Hj(Q%¨
o$q123b%Â .P1.0~P1.1, Ä%¨Xbc"d$e@*HXaXIzS¨576b(Â .
W79E4051/2051
P1.1,
6.2
klg
(U%VW@Z$€6P–w
*¿S=>? 8052 Zs€6Pnmo
7 W79E4051/2051 1*
Z$€6P]!\?W*–¢Âp€
%!HqT
Rw-mo@7(Z$€6PŸ¹ »¸(N(½¾J%µ¶(·_`
*–U%V¿S
W79E4051/2051
6.3
rtsu
2 16ISQ1Rw
%
v ¿S= 8051 w%5*.Q1Rx4o@7 . yXÄS¨Q1R%/,
R
z%{4j%œS¨| 6 @R‰4)*((€%S¦TSG1'4}| 12 R.‰4)4*(€S%¦TSG
7~I%,%{€b
p €*‚¢(Â
7
c 8052 Rw‰
6.4 ƒ„
W79E4051/2051 (
*%5i(&S=>(? 8052 …‡†7ˆ‰Š‹ŒŽ‡0‘‡’i“”•–—˜4™iš7›œ?ž†
ˆ'Ÿ? ¡›?†'ˆ?¢n¡4£¤¥¦˜§‡’
6.5 ¨ª©¬«®­
›
° 8052
»¯
¼½
¾4¿XÀ ±² W79E4051/2051 ‰³ MCU‹´µ 16¶ 7·¸¹ (DPTR) ’‹ AUXR1  DPS¶º?’
W79E4051/2051
ÉËÊÇÌËÆÎÍÐÏ Ñ
ÁÃÂÅÈ
½
6.6
CPU
ÁÃÂÅÈÓÒÔÑ
ÁÃÂÅÄÇÆ
ÁÃÂÅÈÕÒÅÖ
ÁÃÂÅÄÇÆ
6-1:
·¸¹
×ÙØ
W79E4051/2051 ‰³Úۍ”¯° 8052 ÜHÝiž– 8- ¶ ALU Þ?ßàá?âã4”Xä4å0•æ ·›çè4œ
Üé4ê7•ë?’ W79E4051/2051 ‰7³ìíîﯰ 8052 ¸ðà?’
ñiòXóiô!õXö ALU
ALU W79E4051/2051 ‰³ MCU 0Ý÷ž0ø‹ùú4ûù4›4ü4ýûù™Xšž'ø4þXÿ‹iˆ7›™
ši’
ì í ã ALU ž¸4ðë ALU ›øê7•4ëiûù?’
ALU !"#Xê'•ë ACC ›"#Xê'•ë B $%&(')ûù‡’ ALU *+,-.¯/iž01¯/•2
” -.3Xê0•ë (PSW) †’ .
6.6.1
-8-
W79E4051A/RA W79E2051A/RA
–C
6.6.2
456
(ACC)
87ü4ýû4ù970 ·:;=<>?†ž@?§ë
í=GIH¸ðJã?'§ë>KIL±M .
W79E4051/2051 ‰³? MCU †ù4úû
¾ ù
?0ê7•ë’ CPU
'§ë?ž
6.6.3
B
NO(6
!ãXê7•ë B Ú±µ
ãê'•ë7ã .
DFE=?
& / =' )ûù?†•2LPM ?’H–Qø¸ð†!ãê7•ë
8 ¶Xê'•ë!ž–
AB
(ACC) Ú±µ
>KI!
B ì‡í
(
R S*T(U(V8NO*6 (PSW)
PSW Ú4±4µ 8 ¶X¯/!ê•ë ž'•2 ALU IW4ù8‡’YXZF[I\¶¯*/¶]7@*\4¶¯(/¶^7'ã*4¯(/
¶97'ê'•ë_>`ab¶97c8dH¯/›ef¯/?’
6.6.5 gih=j*k RAM
m Üno . –?
Hîï?†ì?í'äå•2 ·?ž‹±µì¶pIq(rY!
s ž
W79E4051/2051 ÿ7‹ 256 3l
ìí7
ã’
6.6.6 t(u*v*w
y z?
{ ’ xy –no RAM r ž |}x!
y =~
W79E4051/2051
 “€} é RAM~ ‰³7‚‹ƒ ±µ ’ 8-¶ xy ¸¹!žø¸ ¢xi
6.6.4
-9-
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
7
„(…‡†‰ˆ
À
‰ ³Š‡Ü•K 2µ‹ŒIrs ‡Ü •(r0› ·•æë(r’‡Ü •9r㍕2
Ž!ž ·•æë*r0㍕2 · Ün•9‘?’
W79E4051/2051
•
“ ”—–˜
¾
W79E4051/2051 ‰³@™~‹ 4K/2K 3l?‡Ü • . ‹¸ð£š01*r=s†=›8dHî MOVC ¸ð
œ ²D^Ež01(rs!’
7.2 ¨ª© Flash˜iŸi W79E4051/205 ‰4³†0‹ 128 3l‡ NVM · Flash •æ4뢡¤£*¥ 16 3l•¦4’=§*¨é‡?Ü©ã
“MOVC A,@A+DPTR” [! NVMADDR, NVMDAT › NVMCON "#Xê'•ëª7 ·’
ü ü ÞØý.-äáúã åØæ ÿÏñ
ùâùÜùÜùÜÙ
,*-úáúã åØæ Ý î/#'Øå
#4$!
&('ØåÕû
µ
ö
Ø
è
ë
÷
ä
æ
Ø
å
ð
#4%"
ì³ïøðØåÕñóåõòóïõô á
&('Ø
å , ##5$5%"!
&('Ø
å + ##2$2%"!
ùõì³û¹ùÜÙ ü ÞØýþßÜáúã åØæ
(3!
&('Øå Ú
ÿñó³ñåõòóïõô á
(3$"
ø
ã
Õ
ù¹ì³×Ø×õÙ
&('Ø*
å ) ##0$0%"!
(1!
&('Øå Þ
(1$"
µ
ö
Ø
è
ë
÷
ä
æ
Ø
å
ð
!
ìµïØðØåÕñéå¹òóïõô á
&('Øå ü
"
#"$!
&('ØåÕ×
#"%"
×õùâùÜù¹ÙúÝ ×øûÜùÜùÜÙ
ÚÜÛÜçéÝ Þ¹èëÛàê ìÏßâÙØáäí îã åØæ
ì³çóÿ³ù 6 7 ü
ìµïØðØåÕñéå¹òóïõô á
ì³çóÿ³ù6 7·×
×Ø×Ø×Ø×¹Ù
«=¬®­°¯°±³²µ´·¶¹¸ ºµ²µ´·¶¼»¾½À¿ÂÁ¤Ã®Ä ÅÇÆ°È É¤Ê®ÃÌ˾ÍÏÎÑÐ³Ò Ó¾ÔÕŤɮÁÖÍ
7.1
½
7-1 W79E4051/2051
mÜ
·•æë
˜ :9<;>=
W79E4051/2051 ‰³‹‹Œ4•æ@?@A0›4 ·4•æB?@AX’Ym‡Ü 256/128 3lno RAM DC”4œ4é
ܕ?žøXZ‹"#4™Xšê7•ë ("#4™šê7•ë ) ’ SFR EXš0ãpqGFDHD^E QøYmÜ RAM ì í
p@q ìíIA=pqD^7E ’
7.3
8
- 10 -
W79E4051A/RA W79E2051A/RA
__e
gNde
f _e
d#de
^V_S
[ M O P#QYR
\
TVL#LWO P#XYX(M K/Z
`aK#b c
J K/LNM O P#Q!R
STU
TVL#LWO P#XYX(M K/Z
[\M O P#Q!R
]
J K/LNM O P#Q!R
STU
TVL#LWO P#XYX(M K/Z
h#i#j.klcYR P#XSTUnmWK/L^\_So[m(R m.UaPWpaqWO c^Vr/m#QYP
½
n»o¼!RAM
À E‹
256
•æ¥
yxtz8[–ã?å|{i
ž }G~@t8d€Xߒ|‚vƒ
7-2 W79E4051/205 256
3l!ž|}tsvu㔠·¡tw

3l
- 11 -
RAM & SFR
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
FFH
Indirect RAM
80H
7FH
Direct RAM
30H
2FH
7F
7E
7D
7C
7B
7A
79
78
2EH
77
76
75
74
73
72
71
70
2DH
6F
6E
6D
6C
6B
6A
69
68
2CH
67
66
65
64
63
62
61
60
2BH
5F
5E
5D
5C
5B
5A
59
58
2AH
57
56
55
54
53
52
51
50
29H
4F
4E
4D
4C
4B
4A
49
48
28H
47
46
45
44
43
42
41
40
27H
3F
3E
3D
3C
3B
3A
39
38
33
32
31
30
26H
37
36
35
34
25H
2F
2E
2D
2C
2B
2A
29
28
24H
27
26
25
24
23
22
21
20
23H
1F
1E
1D
1C
1B
1A
19
18
22H
17
16
15
14
13
12
11
10
21H
0F
0E
0D
0C
0B
0A
09
08
20H
1FH
07
06
05
04
03
02
01
00
Bank 3
18H
17H
Bank 2
10H
0FH
Bank 1
08H
07H
Bank 0
00H
½
7-3
no
RAM
˜i _>4ê'•ë‹ˆ‡=`iž£`‹ 8µ 8-¶ê7À •ë?’=`G‰¯tŠK À L 1`(7=L 2`(7L 3`(7=L 4`iž–`?†0ê0•
ëìíDF
E ’ê0•ëG‹tŒ‘K R0 7 R1 7 R2 7 R3 7 R4 7 R5 7 R6› R7 žtŽì?íH¸ ¢D‘±
`iž‹ PSW ê0•ë?† RS0 7 RS1  -. ‚ƒ ’ R0› R1 ê'•ëG’ã>>A=p@q?|“q?’
7.4
7.5
„†…
8
”–•†—™˜
no RAM r@š 20h š 2Fh rIs4ì‡í3l*p@q4ì íH¶*pq?žYD›Útœ–04µ9rIsì 힝¶*pq?ž¸4ð
ëJ™Ÿ¡ t¢¶¸ðþÚ@3l¸ð’–"#™šê7•ë¤£ž“q4Ú?í 0¥ 8 §¦!£ìí ¶p@q .
7.6 ¨ª©
no RAM ì íHã>xy!žI¨9rYs.“xy¸4¹ (SP) ¸ ƒ ž SP ڃ xyz{D“q ’I«§¬87§­ã®¥¤£7ˆt­
ã?寤°|“q4
2 –y?
z ž0– RAM £=x?
y ž±D²D“4q ÚG³‹ˆ´ žIµ¶xy ¸¹D¶t·Ú 07h ž 㮸
- 12 -
Â
W79E4051A/RA W79E2051A/RA
ìힹ·Dºv»®¼§½xy?ž±D²v“q’
J
SP GÃ 1.
€xyv¾™!|¿µtÀiž\tÁ
SP ¸ª¢
- 13 -
d=yÚ§8dy ƒ
SP § 1 ž
yÀ
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
8
•…:Ì
ÄÆřÇÉÈËÊ
"#
q
"#

™išê•ë ( 4™Xšê•ë ) 4çè›DÍG΍œû4ï›4œ4tÏ
W79E4051/2051 ‰³ MCU ÜHÝã
H’
™Xšê7•ë¶4” 80H-FFH y“ B?BAXÜ'žEXš0ã
|FDH
’±
4™šê7•
ëÚì¶ ž µ4™Xš 4‘t
u ã4”tEtÐGÑB¼ê7•ëˆ£|Ò4±¶tÓ GÔ@Õ ø¶|xtz‡’¾ì¶

¦ ’ W79E4051/2051 ‰³¤£ ‹¯° 8052 £
!
‹

™šê0•ë?ž v“ GÖD
‰ Ú?í 0 ¥ 8 §‡
GÙ
™Xšê•ëž ¼½ å §G‡
× â± 4—
™Xšê•ë’–4± ¥ãDxD!
z ž 8052 £Øt’
¶G’DÚDÛ
â—!™Xš4’
³ â W79E4051/2051 ‰³¤
£ 
™šê'•ë’
"#
"#
pq
=0
Y"
=
Q
q
œ Y
1
(d
F8
IP1
F0
B
E8
EIE
E0
ACC
D8
WDCON
PWMPL
PWM0L
D0
PSW
PWMPH
PWM0H
"#
p@q
1
"#
D^E 1"#
Q
pq
Z
"#
ƒ
B0
P3
A8
IE
A0
P2
98
SCON
90
P1
88
TCON
NVMCON
NVMDATA
NVMADDRL
TA
PWMCON3
C0
IP0
IP1H
PWMCON1
C8
B8
PCMPIDS
SADEN
P1M1
IP0H
SADDR
AUXR1
AUXR2
TMOD
TL0
TL1
SP
DPL
DPH
SBUF
80
½
8-1:
TH0
"#™š7ê'•ë³
Note:
1. ÜÞÝÞß¡àÞáâäãnånænçéè¡êìëéíîâðïnñnònóÞôoõìö
2. ÷¡øìæîù¡âðïnñnònóÞôoõìöûúüÞý¡þÿ 8 æ
1â
!
TH1
ø Þí - 14 -
ACCK
ACSR
CKCON
CLKREG
PCON
½
â
Ü¡ïnñnònóÞôoõìö¡õ ûú
W79E4051A/RA W79E2051A/RA
-/.
IP1
IP1H
PCMPIDS
B
EIE
ACC
PWMCON1
PWM0L
PWMPL
WDCON
PWMCON3
PWM0H
PWMPH
PSW
NVMDATA
NVMCON
TA
NVMADDRL
SADEN
IP0
IP0H
P1M1
P3
SADDR
IE
AUXR2
AUXR1
P2
SBUF
SCON
ACSR
ACCK
P1
CLKREG
CKCON
TH1
TH0
TL1
TL0
TMOD
TCON
PCON
DPH
DPL
SP
"$#$%'&)()*,+ :
021
8:9:;<=
8:9>:;<7=
?@BADC/EFGHI
J7K E
8:97L/M
N7OE
PQJ:K E
R5J:K E
ST E R5/JK E
U
VDW P/Q/J7K E
PQJ:K E
> 5J7K E
PQ > 5J7K E
XYZ[/\
T]
P/Q
^ P_a`cbd
3/4
efgh 34
8:9:;<=
8:9>:;<7=
?@ i/j
?@
ef 34
8:97L/M
k M JK E
k M J7K E
?@
1
1
B
1
PWM
PWM 0
PWM
1
PWM
PWM 0
PWM
3
NVM
NVM
NVM
0
0
1
3
1
2
1
AUX
AUX
2
lcm@on K
lcm@ P/Q
ip ADC/E PQ Z[ 7J K E
ip ADC/E/q7rs2^ut P Q
?@
^Bt PQ
v ^uE/> 5
v ^uE/> 5
v ^uE R5
v ^uE R5
v ^uE ij
v ^uE P/Q
wDxyz
T]{| > 5
T]{|/R5
}/~
&
1
1
0
1
0
34
F8H
F7H
F6H
F0H
E8H
E0H
DCH
DAH
D9H
D8H
D7H
D2H
D1H
D0H
CFH
CEH
C7H
C6H
B9H
B8H
B7H
B3H
B0H
A9H
A8H
A3H
A2H
A0H
99H
98H
97H
96H
90H
8FH
8EH
8DH
8CH
8BH
8AH
89H
88H
87H
83H
82H
81H
534 -.
MSB
(FF)
(F7)
(EF)
(E7)
PWMRUN
PWM0.7
PWMP0.7
(DF)
WDRUN
(D7)
CY
(FE)
PBOV
PBOVH
(F6)
(EE)
EBOV
(E6)
load
PWM0.6
PWMP0.6
(DE)
(D6)
AC
(FD)
PPWM
PPWMH
(F5)
(ED)
EPWM
(E5)
PWMF
PWM0.5
PWMP0.5
(DD)
WD1
(D5)
F0
(FC)
PWDI
PWDIH
(F4)
(EC)
EWDI
(E4)
CLRPWM
PWM0.4
PWMP0.4
(DC)
WD0
PWM0OE
(D4)
RS1
(FB)
(F3)
(EB)
(E3)
PWM0.3
PWMP0.3
(DB)
WDIF
(D3)
RS0
EER
TA.7
NVMADDR
.7
EWR
TA.6
NVMADDR.
6
TA.5
NVMADDR
.5
TA.4
NVMADDR
.4
TA.3
NVMADD
R.3
(BF)
(B7)
(BE)
PC
PCH
(B6)
(BD)
(B5)
T1
(BC)
PS
PSH
(B4)
T0
(BB)
PT1
PT1H
(B3)
INT1
(AF)
EA
(AE)
EC
(AD)
-
(AC)
ES
(AB)
ET1
BOF
(A7)
-
BOD
(A6)
-
BOI
(A5)
-
LPBOV
(A4)
-
SRST
(A3)
-
(9F)
SM0/FE
ENCLK
(97)
(9E)
SM1
(96)
(9D)
SM2
CIPE
(95)
(9C)
REN
CF
(94)
(9B)
TB8
CEN
(93)
-
-
-
T1M
T0M
GATE
(8F)
TF1
SMOD
C/T1#
(8E)
TR1
SMOD0
M1
(8D)
TF0
M0
(8C)
TR0
POR
GATE
(8B)
IE1
GF1
2
- 15 -
LSB
(FA)
(F9)
B1
(F2)
(F1)
(EA)
(E9)
(E2)
(E1)
PWM0.2 PWM0.1
PWMP0.2 PWMP0.1
(DA)
(D9)
WTRF
EWRST
FP1
PWM0.9
PWMP0.9
(D2)
(D1)
OV
F1
(F8)
B0
(F0)
(E8)
(E0)
PWM0I
PWM0.0
PWMP0.0
(D8)
WDCLR
FP0
PWM0.8
PWMP0.8
(D0)
P
675
x000 xxxxB
x000 xxxxB
xxxx 0000B
00000000B
xx000 xxxxB
00000000B
0000 0000B
0000 0000B
0000 0000B
0X00 0000B
0000 XX00B
XXXX XX00B
XXXX XX00B
00000000B
00000000B
00xxxxxxB
TA.1
TA.0
11111111B
NVMADD NVMADDR 00000000B
R.1
.0
00000000B
(BA)
(B9)
(B8)
x0x00000B
PX1
PT0
PX0
PX1H
PT0H
PX0H
x0x00000B
P1M1.1
P1M1.0
xxxx xx00B
(B2)
(B1)
(B0)
11111111B
INT0
TXD
RXD
00000000B
(AA)
(A9)
(A8)
00x00000B
EX1
ET0
EX0
DPS
xxxx xxx0B
3
3
BOV1
BOV0
BOS
0x00 0xx0B
(A2)
(A1)
(A0)
xxxx xxxxB
P2.1
P2.0
XTAL1
XTAL2
CLKOUT
xxxxxxxxB
(9A)
(99)
(98)
00000000B
RB8
TI
RI
CM2
CM1
CM0
xx000000B
CPCK2
CPCK1
CPCK0
0000 0000B
(92)
(91)
(90)
11111111B
PWDEX1 PWDEX0
Xxxx x00xB
xxx00xxxB
00000000B
00000000B
00000000B
00000000B
C/T0#
M1
M0
00000000B
(8A)
(89)
(88)
00000000B
IT1
IE0
IT0
GF0
PD
IDL
00xx0000B
00000000B
00000000B
00000111B
TA.2
NVMADD
R.2
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
½
} :
¶ “ ¯D‰ ( ) ¾
1. t
2. (BOV1,BOV0) µ'¶
q
K@¨¶t“q .
€t²‚iyÀ!
8-2:
"#™4šê'•ë
config0

(CBOV1,CBOV0)
- 16 -
ab
.
W79E4051A/RA W79E2051A/RA
9
ƒ…„‡†‰ˆ
W79E4051/2051
9.1
š‡›•œž
‰³‹‚Š‚‹lŒa‚Ž$ãGÃ,Œ Ÿ’‘”“!ž=l•ŒžÏGHK)–•ŒžÏDH(7?'—|ÏGH™˜
ã
!Š 1 ªv× PCON.0 žY‰Š\G¼ ×@?'—Ï®H?’ ŸX‰Š2G×@?'—Ï®H?¸ðXÚ4ƒ ‰Š–\D×B?'—ÏDH
¡ î
ï
™±,¢¸ð’–B?’—|ÏDH ž £,¤,¥ CPU å ¦t’,§'¨ž=Ú>£©¨7 åë(7'ªHשׂž­¯®
° 
ž Ï$±³²yw4뇏´
å ¦$µB_>‡’ 04² CPU ›\D×,¶-.][W ¡ ë97Yxy¸4¹87Y-.3]7
?Ȥ
ë Q4ø
± 1ê•4뇏X
Ü ©‚·$¸G½ ¯
’ ¹4
µ {ž«º$¸\G×B?…—ÏDH ü
ý -.‡» ’H‹ 2 ,DFDHì í
‰
Š šD?'—ÏDH>£ ¼]d4’“¤
” £”¨7çè$
ë ½¾
– _>!
ž |=}GD‘XšXG
 £©¨£ì‡í ‰‚
Š ¼]d?'—Ï
HI
’ «Y0²G
 £”¨)¿Xåž0‰
Š Š™Ÿn ‚À9'v?'—¶?´
ž ¼]d?'—ÏDH,Áª¢¤¥G
 £”¨”’Ç’Hˆ
– £”¨
Â$Ã@œ $Ä
á !ž0‰7
Š Š
– ‰
Š \G×®?$—ÏGH!y
 ¿,¢¸‚
ð Å,ƂÇ?û•
ï ˜
ƒ
µ7¶
²ì‡
í 4‰‚
Š ¼]d§?'—|ÏDH
’ $@%Bµ7¶y
 FDH‹– RST È,ɂÊG×G•ŒË?´
ž ɳŒµ'¶ í ,̍ÍÏÎ
µ эëX$
Þ Ò ¡ 8 µ”
å ¦’
Þ ÒF¦ž!
í nX‰4®
Š Š‘œ®
é µ$
¶ Ó
å0>
ë µ¶‡’0œ®
é µ¶å4@
ž GŒ ˒Ð$¾ 'º,¸ 2 $
ž
‹
£
@
I
°
€
š
D

²
‡
.
X
’
“
i
”
å
´
’
¦
t
Á
³
‹
,
$
Ô
Õ
_
8
>
=
|
}
‰?
’ µ7
¶ ¸¹4t
À*
K
0000H
SFR
¼
ƒ ë ½¾_>!ž |=} » €Ì³Í¯Î ƒ å¤
ƒ åJGë ’c
Œ™Öîï’B
– ?'—|ÏDH ž ̳ÍÏÎ å$
ë
”
£
€
¨
$
×
X
Ø
ž
´
³
Ì
Ï
Í
Î
ƒ
ƒ ë c^d”Á
dIJ9¤£€¨X‰4,Š ¼Fdv?ٗÏBH ´’ Ú$Û'ܒÝBµ’
¶ ÌÞÍ´Î å'ëž!
í n$
– ÌßÍ Î å0
å ¦4,
Þ ÒŠ‰®
Š µ'¶‡§
’ « W79E4051/2051 ‰³‡y
í µ7¶|
 FGHšD?'—|ÏDH¤£ ¼8d=iž'‰
Š Šš,à
512 µ!´
ØI²îï¸ð’
ƒ P1M1
é É$á]¦ , K 0 ¡³7‹œ€
é ɂáF¦ , ¥)â
º K ¯°? I/O ÏtH ¡â!4
P1.0 & P1.1 K 1 ¡ ‹4œ)
ãä$å,æ'()K*,G + . PCON
bit0 &bit1
Bit:
ë
7
SMOD
ì‚í
1
PD
0
IDL
ç,è
: 87h
6
5
4
3
2
1
0
SMOD0
-
POR
GF1
GF0
PD
IDL
%’&
é)ê
î´ï€ð‚ñ€ò,óôõ‚ö™÷ ø‚õ,ö€ù…ú´û‚ü…ý´þ‚ÿÙú
.
ò ´õ‚öÙ÷´ø‚õ‚ö,ùÙú CPU ‚ý þ‚
ÿ '
ú ,
ÿ ™÷
1 î© ï‚ð€ñ‚
ý €ý þ !‚ü€
ÿ Ùú"#$&%©
õ '()*+ .
1
2345,.6 -&1/1)7 0 ò PCON.1 ú8,ï€ð‚ñ‚ò‚óôõ,ö:9<;’ï€ð=€ò$ó•ôõ,ö>?@‚ï€ðA‚ñ‚ò,ó•ô¯õ,ö
BCD EF>?9<A$ó•ôõ,ö,ù…ú´ï‚ð€û‚ü:€ý´þG€ÿHI€ñ‚ò,ÿJKL9 ï€ð€û‚üL
]_^€G ÿ`bÙú
Z ô\[:
1 , INT0 , S:TU (Config0.WDTCK=0) &õVWYX (CIPE=1) "
a c+CMd NO9<AP"Q+eR ,fINT
g
€
'
ù
ú
i
h
k
j
L
l
m
n
o
p
SFR q_rts_uL9
B
2}~ j€L‚x„ƒ„z…€! ü ~ j€L<†L‡Yˆ‰x
CPU
& P1.1 vw&xy{z|p
Š 4 Œñ‚‹ò,ó•Ž_ô¯ õ,õ,ö ö{zP1.0
P1M1 ƒ’‘”“ ú P1M1 ”“’‘“• .
Q_6
Rž ‡Y³
– ô\—˜™:mš:D _¡+¢†:£ ‡<$
8 ï€ð+›L m 6ó•¤ ô¯õ‚ö:9 ~¢+ ¦ Q+R†$
œ ï)}ð›Lm ’
ú RSTj: ™
y ô
—
$ó™ôõ$ö'
ú
Ÿ
´
ý
L
þ
Y
9
¥
Ù
ú
§
A
$
•
ó
ô
,
õ
ö
€
´
ý
€
þ
ÿ
0000H
ú¨©ªL«<¬ ý
&%_­®Q_R$&% $
…
œ ï€ð›LÏm óôõ,öb9
9.2
- 17 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
¯ °g†L~‡ ±_²‚óôõ$ö…î ~ $ú BOR úSLTU³
¢ =™=ú0»”¼ ú ~õVWY_Xl‚´òz CIPE=1
d ô
¯ùµ EA=1
~ z WDTCK
ú
_
¶
H
‰
…
x
Y
ô
—
·
š
,
¸
ö
¹
º
o
L
p
:
j
½ ï)ð›Lm ó™ô¯õ,öL9 ¯µ j¾‚û¿LFÀÁ™úà ~ _l,òj,ü d ôY—ÄŅý€ú´øÄÅ
—6 6
¡8$
£Æ ý þ9HIÇÉÈYop:__Ê˅úA ISRÊËÌÍ D ú”ï€ð 6¤ 8$ï€ð€ñ€ò$ó•ôõ$öb
»Ñ FÒ>Ó+?ÔÎÕ DÏÐ L:
ç,è : 8Fh
CLKREG
Bit:
7
6
5
4
3
2
1
0
ë
-
-
-
-
-
PWDEX1
PWDEX0
-
é ê
)
ì‚í
2
PWDEX1
1
PWDEX0
ÚÛÜLÝYÞß
é)ê
Ö×
ó•ôYØ:ÙÏõ,ö
ó•Y
ô Ø:ÙÏõ,ö
:
PWDEX1 PWDEX0
0
0
0
1
1
x
é)ê
é)ê
.
ÚÛÜLÝYÞß
â㠁 INT0 or INT1 vwˆ‰Í d ôY—·š
±_²,ó™ô¯õ,öàzá~s :
±_,
² ó™ô¯õ,öàz äå  INT0 or INT1 vwd ˆ‰Í d ôY—·š
æç ± ²$ó•ôõ,ö . INT0 or INT1 vwˆ‰Í ôY—·š
è éê&ë 3 &
ì í+îïð , óñ òôõö
ø+ùúû
0, 0
(Mode1)
Low-level
0, 1
(Mode2)
Low-level
1, x
(Mode3)
Low-level
&Fallingedge
é)ê
.
W79E4051/2051
PWDEX[1:0]
é)ê
PWDEX1 & PWDEX0
üý_þbÿ
'(
)* +,-
).
÷
.
.
.
"!
#$ "%#&
: ;8<
=: ;8>
/(00
132 45,460
7
819
?A@ BDCE0"0
13F G
145A0
7 H 9"45IG3J&49"0
KLMF 2 2 NO 4
77 0H LPO N
7 O =
@ 7 4"Q
7 N
JR7 0"LS"JT0
U VWX
YU VWZ
[A\]^ _ _ `a b
cc d"e \Pa `
c a Y
f c b"g
c `
hRc d"\i"hTd
A‚õ,öqp2ù…ú ~ srj: d ô<—Ùýut vwuv }
Tpd
- 18 -
j bkAe _ dld
_
m`_ _ ^ ng"e d"o"g"d
úxw 2sy ssz|{}~+Ùý,ú
Tpd
€|x
2mS

W79E4051A/RA W79E2051A/RA
‚ ƒ†…†‡
23 üs„
ˆ ‰Œ‹ŒÀo&؎w¯| ž 6 W79E4051/2051 QRt9} E|’s“|”•‰q+
Š
r3 AQ+R D G 6—–u˜
¦
2
n|™ Ù
u ú¹
šQ+RLœ›s
9 ‚ü#ŒŸ RLJKŒ¡£¢ Q_RLœ›£9 †L‡¥¤|¦"#uŸ R
Œ§&Q+R¥›£9
10
10.1
¨ª©¬«
­Š®°¯±
ï€ðAŒ²|³u´µŒb
¶ ˜ C4K|· RST š‚ñ|¸ D Ð x¹ZL96L¨â<© ã RST š+j:,ô<— c|ºu»Œ¼Œ½ 2³u´â|
ã µ
¶Æ…ú&‡¿¾|
,
À
€
ï
Œ
ð
Œ
Á
Â
|
ü
:
Ã
y
Y
ô
:
—
9
Ÿ
_
Q

R
œ
ô
Ä
š
m
_
Q
R
Ä
'
Å
ú
¨
&
©
_
Q
R
@
E
³
RST
~ Q_RL9
…ú »|Å ý þA©Œ¶°
t
Œ
E
Æ
Œ
s

Ç
È
ï€Dð€ñ‚òQ RJ
K
‡ D úŽÉ » RSTj½ ô\—EuÆ&x y úDu»Ì ¼‚¤ ï)ð ` EuÆ¢+¥ ¦ } Q+RJK:9<~A  RSTÄ&ÅÊ
|
6
Ë
L9¿·
Q_R|
M ú©ï€ð( A 2³Œ´ŒµŒ¶s¿¾ }_Î Q+~ RJKÙúŸ
0000H ¥
“ ú!€üs_
…
‹ Έ|6
Í ~
:
¥Ÿ
R
Y
9
@
§
&
e
_
Q
R
J
K
)
G
ü
o
:
p
œ
|
Ÿ
R
r
Ù
A
ú
»
&
¼
Ã
Œ
n
Ï 2 ³ŒŸŒ 2
 Q_R|
R&xÑÙ
Ð ý‚ú†L‡
Ò x@uӌ:
Ò Q+Rfg:9
10.1.1
Ô¬Õѯ±
(POR)
D
À&As×|d ¡} POR Rt‡ &
v w Œ6 6 ˕n&–Ñf:˜ M'úÑØsÙ 6|ˣڕÛu˜6 ·bQRJ&KLË Ü§b9 ¯µ š£Ý,ó³ôfg
¼ ï)ð
Q+RJKL9+Ã'ô<[|ÞQ)*'ú©ï‚ð €ñEß+jôQ_RàuáâH
z VDD Vrst  ,»,
‰ PORŸ RL9 V €Œ 2.0V.
Ö
10.1.2
RST
Š
ã } ä°¯± 6Œ(BOR)
d
Ôï€ð•ô<P V , å ÝQ_R:
10.1.3
BOV
æèçŽé°êªë엯|±
ªÉ«¬ ¡¢ý&
@Euõ ³sí†|îŒïL
m‚ý|tñD ð §\6ŒL
ý9 23 †
‡<A|ò ž ýŽó¢ fb¯M ªÉ
«3s
¬ ÷ ýÙú
|ô
¦
|
Ë
å
¯
µ
µ
2
8ŒÏ
9+à ªÉ«<¬ ý|ï:m ú
ÝEu³L_{z
ø: uö 
”ªÉ«
¬ ý å ËÝQRÄ&Ù
Å ú»&¼A|
n ïLm z ø¶f|Ðtº|¼ù ½ 5 512³•ý´þ D ªÉ«¬ ý Ë|å ÝEu³b6&Q+R¤
ÄÅ:9"Z $
8 ï‚ð,ñ$òQRJK9
" ³JKi¿§ À
2 ³|´sµ¶:9Esú›m+QRJK™ú)ï‚ð
ûŒü
0000H ¥+Œ
10.1.4
10.2
¨ª©¬ý„þ
D –ј n|™ ¦
SFR A&õ Q+R
u
™:9&@Q
J KLÚ£9<ÛÜy ô|õ ¶H&x 0000H ú¹ºŒÉ » Q_RJKEu¼ŒÆŒ½ ¾ ½ úxÏ 6
Jd K:} 9 RAM¼|½ ÜÿA&õQ_R¶Št C
™9&@
0000H
õ R¦ Ë 9j ¯RAM
µ VDD
>™x 07H
ú
¨
©
cô\PɁ”ú
õ ¦ ` Ë 9¨©|
D RAM 2V õ z ¦
RAM
ú¹b¦,Åûô\
b
»
¼
E
+
ß
³
j
ô
_
Q
R

[
ôYP 2V ‡¯ù
RAM
D ú RAM Ñÿ 9
ý+:QR D ‰ ’1’, ß
R D WDCON ‘ 0x00 0000B.
j ô+QR D ¶
WTRF z WDCON.2 Aªi« ¬
Q’0’.
~

6
Q_R:°€g ù'úu
™ . EWRST (WDCON.1) ¶fbM z»e
WTRF (WDCON.2) A
QR  . Ö ÀbQR&G&†t‡f:M WDIF
(WDCON.3) R . WDCON SFR (WDRUN, WDCLR, EWRST,
# ¾R üØiU_x “ .
WDIF, WD0 & WD1) "u
õ
¼€s½‰
Œ
- 19 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
VDD Power
V BO3.8 (BOR Enable)
VBO3.8
V BO3.8 (BOR Enable)
WDG Normal Run
WDG RST
WDG Stop
System Normal Run
System Status
System in reset
System in reset
Crystal 65536 clocks
Crystal 65536 clocks
Internal RC 256 clocks
Internal RC 256 clocks
10-1:
s  Q R
& VDD
- 20 -
! ä ý
512
Watchdog
timer clocks
2 Watchdog
timer clocks
W79E4051A/RA W79E2051A/RA
RTSSUOWV4XY)+J
^t u&v w x y z-{CEU|-;/B+}+D 6/~
Z8[ &^T_T_
H8I4' )+J K4.8L&MA"$NPO-Q K
Z\[ ]4^T__
rA5\D 6/B/3(5/sqd&D @+d&f(3
1$2&3(5 6+7?>A@8< 7CB8D&EGF+;
"$#&%(' )+*,"-' ./' 0/%
1-243(5 687:9 ;=< 6+3(6/5
1-243b5 6+7:9 ;=< 6/3&645
`g ;4<5 24683(< ;/5 B8B+DbD4a+EGc/`Uc+]/h/aec+d&a=D @+d&d&D @+f(d&3 f(3
-1 243b5 687jik9 5 l+9 ;emW@4iY6+<W_G@&in;eok@+p/6
1-243b5 6+7:;/@45\9 ;qmW@&in6+<W_A@4in;eok@+p/6
`g ;&<5 2&6+3(< ;45 B+B8D(D&a/EGc+`Uc/]+h/a=c+d4a=D @/d4d4D @/fbd43 f(3
10-2:
~ Q_RÙý
- 21 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
11
€‚
ïu‘”
ƒ ü…„ :
³ +[àz IE0, BOF, WDIF, TF0, CF, IE1, TF1, TI+RI &PWMF  ²Œ³L
_[G€üop:‡†ˆ‰H‰R xú ŸŒ R:_:ȋŠ–8&% RL9 Î+~ ï)ð†‡<ØقŒö ¢ û€ü:_b9 .
W79E4051/2051
11.1
ŒŽñ«
~ INT0 INT1  IT0 IT1 H‰†L‡@’‘“·š‚@™ô<—·š:9 TCON IE0 IE1 R@ ~
 _ x»Ÿs R™úŽÁÂ" 2¯Rµ Jg†É‡•”’–@|Ø ˜ å ÝN ~ +:9A‘“·š,˜ õ’d öL€ú)ï,ðA|²|³
` Á´
µŒ˜ ¶G ¹Z INTx˜ 
9
A
Œ
E
|
³
|
µ
¶
|
—
¹
Z
•
y
<
ô
—
,
A
ù
Œ
E
|
³
Œ
µ
¶
|
—
¹
Z
<
ô
'
—
ú
&
»
,
¼
)
ï
ð
9b½§ } ï‚ðA²
 N Œ
E ³
y » ô— ~ d ô<—ɘ™™ú ©•ý o~p IExR&‰R•ú â ýÈ ï‚ð™˜d _c|ʺuË:
»¼|
³|´
µŒ¶G Æ ·
_) ñ|
¹™
Z ú¨©
_+,
l ò
y™d ô<—‚ ô<—
´µ
jL
Å [L
½ ˜ ï‚ðEŒ³Œ
Û p$
¶ . Iex R†
¶ ð fbM9 ¯µ w³
š ô<—·Ë š$
¸ ö…ú»&¼b ¯& µ
<
ô
—
Ä
Å
v
u
w
¾
ø:
~

:9$
A ñ,òɽ ++ÊËË ™
ý’ú Iex R&

¶ Às
f ÐÉ9
,
l ò&j’
ô—A_ÊbË&Ì
Í D› |
Ÿ ¾ ú”ï€ð æ眝 ø_+Œ ߀ñ‚ò â Z _ÊËL9
à TF0
TF1 Ÿ| R‰…
R ý ˌå Ý ý Ë 0 ý Æ 1 b9_à ý|
ï€m ý"Œ# ŸŒ R Ë ‰+RL9+Ã
ýL
_Ê&Ë+2 ™
ý‚ú"ä# Ÿ| R |
¶ À ð |
f ÐL9
ª«<¬ ý†‡ $
ï€ð! ‚@E ³Ë žŸ ¯ýµ L9 ‡ ž e,
¸ öË|å …
úà ý…
¡ ý D 9<ª
«<¬ ý Ÿ| WDIF z WDCON.3  ‰+Ù
R ú EIE.4=1 ú»¼Ù
" ý Ý+E ³:_b9
Ã:+23 £
¢ ³ÉÖ [£¤‚&š
¥ ú+°
š ÝÙ
ý¦§b$b%qr SCON RI TI ¶u ’1’ ÷”øR
è
% ð Æ
f ’0’ ú vw Àf ’0’ 9
ôŒõ ,
6 ùŒï å Ýb b
PWM 10 R
‰Ràz PWM +8% . PWMF45 À‰™
R úxÉ&% 45 Ö Àf ƒ’
PWMF Ÿ‰R
õVWYXl:‚
m ú CFŸ‰R D ú´õVWYX Œ6 å Ý_ . ø+R
&% 45 À‰…
R ú vw Ö ÀŒf Ð .
û‚ü: å Ýџ ¨†t¢ § À‰+R / Q_Ù
R ú â Z© Ö À ä6 å "#R‰R¢ †Ü‡ rš: b9 uª ³:_+†L‡§ IE
q_r:<opŒR Œö ‚Ø:Ù+9 IE Ï üE ³:¯_µ « Ù
R ú†L¥‡ ö 6 ‚Ø:ÏÙ û‚u üL
9
å
²Œ­ ³Œ´
µu¶ŒG ÁŒÂ_Ñ Ÿå ’†ˆ’¬9 Á¦ F+|
À À És Ý LCALL >Ù
? ú
Ÿ®
¯d &@ LÈ°Š®¯L
9Ë Ý â³LCALL
F
À
@
±
†ˆ‰C
D ö ² †ˆ‰ Xy†ˆ‰ Ê&Ë+
1. X
E ³|µŒ¶uÁ| Ÿ| u
2. A)_A>?
? âº
@ RETI.
3. )+A:>?
´µ7 IE IP IPH q_r>s
¯µ j¿L¥ ò ž uE ³FÀ
Á'
 ú LCALL ` Ë Û s
š Ý9YŒA ²ŒE ³>
? µŒ¶G Ë Á|Â:Ñ Ÿ :9 ¯µ ] j
¿ F‚
À üE ³
Á…
 ú¶+|
Ÿ ŸŒ R‰ ’1’ ú
&% p:_b9_ à û,ü:FÀGÁÂ:€N ú Ñ Ÿ| ¸¿· ù
ú´ø__
%_+¶ – p9
¥¹ Û puE ³,ü|Ãb @ 45 E ³ LCALL >? 6 Ǻ ˜ ” ò »®¯LÜ9 r‡¼Ë Ÿ| †&
%_¶fbM_€ ü†%_
¶fM&9+´Ã ñ€òL _Ê&Ë_ ý)ú: b TF0 TF1Ÿ| Œ¶ Àf
M&9 ~ INT0 INT1 ɀüŒA Ͻ:·šFÀ
š ݒý‡¾½:x ŸŒ ¶fbM9YL Ü Ÿ| &%:§ À
- 22 -
W79E4051A/RA W79E2051A/RA
f M&9<ª
b
«<¬ ý _џ WDIFvw€ü Ö ÀfM&9¥ÀE³Œv¿>?L9Ïø>?u¾r ôõ ˜
&sÁÀ
ú+
@ Œ¾rJK PSW 9_à +š|ݒý PC¶Ã€òL :ÈÁŠ®¯L9 _[:&ÈÁŠ®
¯Äˆ ¯ ù±
ŇÆǻȕÉÊ
Å‡Æ Ë
Ç»ÈÉÊ
Å‡Æ Ë
ǻȕÉÊ
~ 0
0003h
000Bh
Timer 0 ï:m
~ 1
0013h
001Bh
Timer 1 ï:m
0023h
002Bh
&
OP: 0033h
003Bh
õVWYX
-
0043h
-
004Bh
WDT
0053h
-
005Bh
-
0063h
PWM
006Bh
Ì 11-1: :È°Š®¯
:È°Š Ì @u¸ Ð _st,úœ¾ ÈÁŠ† 2}Í D åÎ ‡ÏЅý8 2 9
¤ ÈÁŠ®¯|¸ Ð ˜ RETI >?L9\¯ µ RETI>?¥¹–‡ × 6¤ÑÑ Ò m õ ¦âÃÓ ˜ PC>Ë 9 2 3
D
v wÔÕA€ñ‚òL r=&s À…ú : ’Ö …
ú
sÁÀØ·¿ùÙ_™ CPU
”’–
ú"Z 6uË r‡¼ÚۚÝb9
&sÁÀØ· ùÙ+™,ó'ú¹@)*+°g 6Ñ õ ¦,
à ò PC>…
11.2
ŒŽ‚ÜÞݙß
ï ‘)ü Œ
³ † ’ˆ½ ‰àáL9<"Z8 W79E4051/2051
ïu‘ äåâ &
‰ __[‚ü㌀
Ë
‡
â
²
‡äåæÙú
ï ‘’ç ‰Ë è 9³:ž _ [ .. +
öâ u
†ˆ‰ X&y’†ˆ‰
X y†ˆ‰:
_ÊË:_'÷ C y’†ˆ’:
¬ ¶|ò ö&'÷‡é’© ý ü 2³:_ |Å ú
W79E4051/2051
4
W79E4051/2051
ˆÊË+L9
’
©ëƒ)ìüí’îâ‡²ï †ˆ‰ â ý |Å 'úb§+s  üEu³!|Âêu£¢ : +ÊË+:³ê:9
óô : F7h
1 ð’ñò
IP1H
Bit:
÷
6
7
6
5
4
3
2
1
0
-
PBOVH
PPWMH
PWDIH
-
-
-
-
õ ö
’
øù
PBOVH
5
PPWMH
4
PWDIH
úû
õ’ö
õ’ö
õ’ö
õ’ö
H‰OP:å x C y†ˆ‰ . C
’‰’C †ˆ‰ yb
1: H‰ PWM ü
y:
1: H‰ª«<¬b ’ˆ‰
1:
- 23 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
ýþ ëì•îïÿ ð’ñò
Bit:
÷
6
óô
IP1
: F8h
7
6
5
4
3
2
1
0
-
PBOV
PPWM
PWDI
-
-
-
-
õ ö
’
øù
úû
PPWM
4
PWDI
õ’ö
õ’ö
õ’ö
H‰OP:†ˆ¬Xy .
‰ <S †ˆ¬X&y .
1: H
1: H‰ª«<¬b †ˆ¬X&y .
îï ÷
ëìîïÿ
PBOV
5
õ’ö
1:
IPxH
IPx
0
0
Level 0 (
0
1
Level 1
Cd
)
C y )
Ì 11-2: ‰ †ˆ‰
¯ ù Ì ûb&s À@± +[bxŸ| R&ÈÁŠ®¯ ÷ ”R³†ˆ¬R|‘…úÜâº
¿:N»Eu³
±_² CPU Ïó•ôõ,ö:9
!"# ÷
$%'&( )+*',
1
0
Level 2
1
1
Level 3 (
-
External
Interrupt 0
IE0
0003H
EX0 (IE0.0)
Edge:
Hardware,
Software;
IP0H.0, IP0.0
Level:
Follow the
inverse of pin
Brownout
Detect
BOF
002BH
EBOV (EIE.6)
IP1H.6, IP1.6 Software
2
Yes
Watchdog Timer WDIF
0053H
EWDI (EIE.4)
IP1H.4, IP1.4 Software
3
Yes
Timer 0
Interrupt
000BH
ET0 (IE.1)
IP0H.1, IP0.1
4
No
5
Yes
6
No
7
No
TF0
Hardware,
Software
External
Interrupt 1
IE1
0013H
EX1 (IE.2)
Edge:
Hardware,
Software;
IP0H.2, IP0.2
Level:
Follow the
inverse of pin
Timer 1
Interrupt
TF1
001BH
ET1 (IE.3)
IP0H.3, IP0.3
Serial Port Tx
TI & RI 0023H
ES (IE.4)
IP0H.4, IP0.4 Software
- 24 -
Hardware,
Software
1(highest)
Yes
(1)
W79E4051A/RA W79E2051A/RA
and Rx
Comparator
Interrupt
CF
PWM Period
Interrupt
PWMF 006BH
0033H
EC (IE.6)
IP0H.6, IP0.6 Software
EPWM (EIE.5) IP1H.5, IP1.5 Software
8
Yes
9(lowest)
No
(2)
.0/+132547698 RC :;+<=?>5@A7BC'DE>FG'H5I7J9KF'LNM9OP'QNRSUT9HV'WYXNZ
11.3 [N\^]0_a`cb
d'e5f0gYh3i0j5kl >'mnEo+p5q f'rs @3t g3huwv+xEy G5z'{ j|} Z~ 8 g3h
G RI+TI€
F'Ž5‚ j C3e5ƒf „…5†‡ˆ5‰ l0g3jhYgŠh+‹ Š'‹ Iex uŒ?f0jŽgYhY'›'+œ+‘“'’ ž ZDEf'>Ÿ5F 0G 1”0 • Š'u‹ Œ5¢¤€'£YF'¥¦ ‚ j C3
§ z{@'¨5©– 4f €€FF''‚0‚5Z—'ª˜ „« gYhYŠZ‹'tŽ5™+š ¬51|5}Ng3hY­'®5¯3°±²5³ @¨5¡ © 5Of €F'‚ . z{“@
´ ¥0j+k3l l'§
j
fŸ ef¸ž
0º»5¼'½¾?jg3h5¿ |}
g3hY­®5¯5° >mZ ´0ÀÁLUg3M9µ¤h5»¶  t'>™5m ·¿  |'}0š jgYh3­¤®+¯°?@tj¥'™+šÃ KZt¹ ™+—'˜€F'‚ ¿  |} z
»' { |}ÄÅ @ ±'Ɠj+k3l >5m (t™ ¸ 'Ç5È g3h“j­®5¯° )É £  W79E4051/2051 Ê+Ë
|{?}@3̨ IE, IP,zIP1
 G MUL Í DIV z{NZ g3hEg3h+iNj±¥“k3l >mYÎ 12 €5F‚“@Ç gÏÐ —5˜
Ñ IE, IP, IPH,ÒUÓ 2€F''‚“@ Ä'Ñ MUL DIV z5{ 5€F'‚G ÄÑ ¡ LCALL g
g3h 1€F'‚?@ Ä5IPH
h0ÔՏŽ
Ö× Î5Ø e+4f'€'Ù'F'Ú?5g‚0h Z Ê5Û g3h'kl >m3ÜÎ Æ p 5€'F'‚…† ¸Æ p 12€F'‚0Z ±'Æ?j»Â >5m
Î 12€F'‚EÝ+Î 48 >Þ''‚0Z . Šß 8051±à+»' >5mY; 8€F'‚¤Ý+Î 96 >Þ'5‚?Z ª'LUM9á ²
50% >ށ5‚0Z
12 âäãæåèçêé7ë / ì^í^ë
f 16 L'î ¯ D?>F /ï'ð'F'G ef Lî ¯ AñBC¤DE>3FUZA7BC¤D“>F jò
Ê
5
Ë
š
W79E4051/2051
2
}r V ¸Nº p5Ç'È 2f DE>F0Z
12.1 ó^`Nô / õcö÷ô 0&1
f 16 D“>F /ï'ð+F0@ª'ø'DE>F gù š 2f 8EúYû FUMü Ñ 160j ï'ð ú
W79E4051/2051
û FNZý'p'DE>F Ê0Ë+È'š ˆ2Î TH0
0j ú+û
Nj úYû F 5ZDE>F 1 Ö š 0j ï'ð úYû F TH1G TL1 ZLNM9þÿ¹ O'8È5ˆ ï'Ž ð ;5DE>F F G þ ý5TL0€Fþ  ‚8 } ï'ï'ð ð G
8 ï'ð5FUZ
~
OȈ Ž ;5D“>F ?@3dD“1>F5Oý0¬ >Þ8 '‚5ï'ð0Z+>Þ j i L0M¦ÎÊ5ۓ>Þ j 12  ÎÊ5ۓ>Þ j 4
NZï'úYð5û F'H'j V56 –? @ × —5e ˜ ~ ïð j df T j þ T0ýDE>F 0 @ T1e5ý'f D“>F
ð F
Z T0G T1 T €'F‚ C45ƒ'„?@t'™+ €5F'
1 Y@ï'
‚û5ƒ„ ¬ ¹?e !T 0@– e5f f €5F'‚ƒ„ &¬ '*U) !T ?#@ j "%$ × 3¦ & ' e5f !T ñ8 R¹ ¬ jj¦ ±' Æ @ï'ðF ú
Fj z e ZERp¨5© 2 €5F''‚ (
úY û !T ù @ +-j ,'~ e .*/
0Î5<
241 Z 23ÎDE¬?>j F 4Î++ï¦ ð+ F“ @ï'ð F ¬55§ €F¦ ‚ C3j f Z +,g D“2 >FHV –“@ T0 G T1 —˜ !T * 567—˜ !T " €'F‚ ïðF
1Z
8:9;
INT0
0
Bit:
<=>
TL0
7
6
5
4
3
2
1
TL0.7
TL0.6
TL0.5
TL0.4
TL0.3
TL0.2
TL0.1
- 25 -
?@
: 8Ah
0
TL0.0
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
8:9; 1< =>
Bit:
TL1
7
8:9; 0A =>
TL1.7
Bit:
Bit:
5
4
3
2
1
TL1.5
TL1.4
TL1.3
TL1.2
TL1.1
TH0
7
8:9; 1TH0.7
A =>
6
TL1.6
6
5
4
3
2
1
TH0.6
TH0.5
TH0.4
TH0.3
TH0.2
TH0.1
TH1
7
6
5
4
3
2
1
TH1.7
TH1.6
TH1.5
TH1.4
TH1.3
TH1.2
TH1.1
ú3û F gj C / T 

I
H
g 4J 2
ù
fVFDEG >F /ï'TMOD
ð5F LUM!F'D
:58:H'9V;.NOPQSRT;
R
TMOD
( & D DE>F /ï'ð5FUj#MK%BLC
FG ò5D“}'>r F /ï'g'ð+jF e 0 ò}
V
C(
4C
7
GATE
U
TIMER1
VW
7
GATE
6
C/ T
5
4
M1
M0
3
GATE
2
C/ T
1
0
M1
0
0
1
M1
M0
:
M0
0
1
0
1
1
NObcU
12.2
kSlnmpo
6
C/T
5
M1
4
M0
: 8Bh
0
TL1.0
?@
: 8Ch
0
TH0.0
?@
: 8Dh
0
TH1.0
r V D:0Z d'f DE>F /ïð5F ù šÈ uEj H
Í J 6 ( Fg Gj DE>F /ï'ð+ F 1 jMK%L Z-,'j ~ d
Z¤R TMOD M0 G M1 (FG¤DE>F D
TMOD
Bit:
?@
3
GATE
2
C/T
1
M1
?@
: 89h
0
M0
TIMER0
X%Y 
B!Z ; 1 > , DE>F /ïðòF } jò§5}“ ’[ TRxZ\'~4 j[ò}int³n[ Z\?@ j 1 TRxG int n ]
; 1 >3D“>F /ï'ð+F%^_ Z ; 0 >'@3D¤>F
TRx Z\
DE>F `/ïð} F*D5: r VFG / ; 0 >EMD“>F jr V ò}H ; 1 >ý TX j ¹ ¬ T! ïð
H'VFG 
H'VF G
B!Z ; 1 > , DE>F /ïðòF } jò§5}“ ’[ TRxZ\'~4 j[ò}int³n[ Z\?@ j 1 TRxG int n ]
; 1 >3D“>F /ï'ð+F%^_ Z ; 0 >'@3D¤>F
TRx Z\
DE>F `/ïð} F*5D : r VFG / ; 0 >EMD“>F jr V ò}H ; 1 >ý TX j ¹ ¬ T! ïð
H'VFG  t–a
H'VFG t–a
de
H'V 0: 8-  D¤>F“@š 5Nj 0µj N Z
H'V 1: 16- DE>F0gU@#uŒ5f gš h5 µ*0 Z
H'V 2: 8 « THx
DE[ >F
4
H'V 3: jþij p T0 TL0 Î D¤>F 0 Zr \ j 8 ¸ D“>F /ïð5FNZ TH0 Î [ D“>
F 1Z\ 8 D¤>F /ï'ðFNZD¤>F 1, V'– D :0Z
W79E4051/2051
qrstSu#vwx 2zy u#{|z}M~y*€
- 26 -
8051
u-{|I}‚qƒ„…†‡Iˆ
1/12
sŠ‰‹
W79E4051A/RA W79E2051A/RA
u#{|ŒyŽ‘’“”u•#–—*˜Š€Iˆ 8051~™S}#š* W79E4051/2051 qr›œIˆt:u
vzu#{|IŒžŸš ¢¡!£¤¥:u#{¡!¦§¢ˆ-‘ŽS}#Su*ˆ-‰‹zu-{|%qƒ„…†*‡Sˆ 1/6 }
¨©ª‰‹§*«¦¬” 3­IŒ%® CKCON ¯ˆ T0M° T1M ±£¤¦§‰‹²‘IŒ#³Š±´µs¶%s
0 }Mt:u#v„…·€ 8051 ²‘¸IŒ#¹ºŠžŸ»ª‰‹v¼*s¦§²‘zŒ
½¾¿À:ÁÂà CKCON
ÄÅ : 8Eh
Bit:
7
6
5
4
3
2
1
0
T1M
T0M
-ÆÇ
- ÆÇ
- ÆÇ
-ÆÇ
- ÆÇ
-ÆÇ
È ÉÊ
Ë:Ì
t:u#v 1 u#{£¤zÍ
4
T1M 0: t:u-v 1 ˆu#{£¤%s 1/12 qƒSuM{zŒ
1: t:u-v 1 ˆu#{£¤%s 1/6 qƒ:u#{IŒ
t:u#v 0 u#{£¤ :
3
T0M 0: t:u-v 0 ˆu#{£¤%s 1/12 qƒzu#{IŒ
1: t:u-v 0 ˆu#{£¤%s 1/6 qƒSu#{zŒ
12.2.1 ÎzÏ 0
²‘ 0¸S} 13±zˆt:u#v / ‰‹vS}z® 8±ˆ THx° TLx ˆ-Ð 5±*ÑÒS} TLx ˆMÓ 3±ÔÕ*Ö%Œ TLx×·zu
{|IˆØÙ¶*Ú¦~%}Û TLx ˆ-Üݱ® 1¶ 0´S} THx Þ߉‹IŒŠÛ THx ˆ-‹àá® FF¶%s 00 ¡´S}
TCON ¯ˆ-âzã#€ä± TFx ×屌
Û TRxå±æ GATEs 0ç INTx s 1 u}-‰*‹èéêëìIŒ C / T =0 u}t:uMv /‰‹víIu#{îïð‰
‹S} C / T =1 u#í P3.4 (T0) ¡!ñ P3.5 ò T1 ó!ôIˆ 1õ 0Ù¶ð‰‹IŒŠÛ 13±Iˆ#tSu#v‰‹à¶%s
ŒùIu#úûIˆ#âIã€ä±å±¹ºS¯ŠüŠý*Þ:}#ùzu#þ×ÿ~
1FFFH
t:u#v´S¯M}MüS¸Œ~öŠ‰*¹*‹º×ª÷øøž¶%…s tS0000H
u#v
:u#{| ¢¡-qƒzu#{îïSˆ 1/12ç 1/4 Œ
# !! $" %
C/T=TMOD.2
(C/T=TMOD.6)
0
1
T0=P3.4
(T1=P3.5)
TR0=TCON.4
TR1=TCON.6
GATE=TMOD.3
(GATE=TMOD.7)
/INT0=P3.2
(/INT1=P3.3)
TL0
(TL1)
0
4
7
TF0
(TF1)
0
7
TFx
Interrupt
&
TH0
(TH1)
Timer/Counter 0/1 Mode 0
12-1:
t:u-v /‰ ‹v ²‘
0
zÎ Ï 1
²*1 ‘ 1 ˜²*‘ 0 '(ú)I}+*²*‘ 1¸tSuMv /‰*‹v:s 16±Iˆ}-,' 13±¢Œ-©*/.ž THx° TLx ˆ0
16 ±*‰*‹¢ŒŠÛŠ‰*‹àá® FFFFH 2 0000H 34%´S}ú65ˆ-â¢ã#€%äå 1 }87ÿ9z¯ŠüSŒ-íIu{|¢ˆ#£
¤*˜²‘ 0 ¸Sˆ-‘~™S}:<;‘š>=²*‘ 0 ú?=Œ
12.2.2
- 27 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
DEFG
H KKLL MMNN MMOO PPQQ RT U
J
I
S
J
@A@B
IH
@ AC
C/T=TMOD.2
(C/T=TMOD.6)
0
0
1
T0=P3.4
(T1=P3.5)
TR0=TCON.4
TR1=TCON.6
GATE=TMOD.3
(GATE=TMOD.7)
/INT0=P3.2
(/INT1=P3.3)
4
7
TF0
(TF1)
0
7
TFx
Interrupt
TH0
(TH1)
Timer/Counter 0/1 Mode 1
&
ÎzÏ
TL0
(TL1)
12-2:
t:u#v /‰ ‹v ²‘
1
²‘ 2¸ t:u#v /‰‹v%sWVYXZ[²*‘zŒù²‘¸ TLx ~ 8±Iˆ-‰*‹vS} THx’/\/Z[‰‹àŒŠÛ
TLx ® FFH 2 00H âIã#´S} TCON ¯ˆ TFx €äå± THx ¯
]<^/Z/[/_ TLx }a`/b‰‹c/dŒ-Z8[/cdI¯
THx ]Šˆ-à’/ef¶ŒÛ TRx å±æ GATE s 0 ç INTx s 1 u}#‰‹vê/g6hÞ߄…zŒ=ø/i 2 y‘
– – ç 1/4 Œ-š í Tnjôzˆ-k/lè鉋 .
~¨z}-²*‘ 2 ˆu#{|* ¡#qƒSuM{îu‡mŒrïI„Šxˆ ¢‡Š1/12
ˆ†
žŸ ž¡ w utnŒr„m Šx¢{Š w ŠtŠt‹‹ ˆuu ‰„„y u{u{ŒŽŒŽrrˆˆ ’‘y
q›tœt
u{™m |
w u{u{zzm n y
žŸ n mn
m
o w pru{™‡qtn s y }~ € ‚ƒ~
u m„…‡–† ˆ ‰
ututštšxmn„„w utu‡u‡nŠŠ„ …‡–† ˆˆˆ ˜‰‘ y
m
o
w “x“x”t”tu{u{•‡•‡‹ || ––„„u{u{u‡ŒŽŒŽm„rr…{†ˆˆ ˆ†o’ y
t
u
t
v
m
w utvxn y
w ‹ u—n „…{†ˆ †y
12.2.3
2
&
Timer 0/1 Mode 2 (8-bit Auto-reload Mode)
12-3:
t:u#v /‰ ‹v ²‘
2
ÎzÏ 3
/£ ¤ 12.2.4
#ˆ ²‘ 3 ë¥f>=ˆM„…*‘IŒ-ítSuMv /‰*‹v 1 .²‘ 3 תø/¦/§?¨-ítSuMv /‰*‹v 06.
²‘ 3¸ TL0 ° TH0 2©/ª ˆ 8±‰‹6«¬\v¢Œ¸ &®­¯ y²‘¸Sˆ°±ûqSŒ²‘ 3¸ TL0ž*tSu
v 0 ˆ+;²*±¢ÍM¹ C / T , GATE, TR0, INT0 ° TF0 Œ TL01 ¡ž*%íuM{%î*ï*‰%‹ ò u{*|ˆ 1/12 ç
u{|*‰‹z}¬7÷ž:tSuv / ‰‹v 1 ˆ;6²±
1/4 ó¡-ñí T0 jô¢ˆ 1 õ 0 Ù¶‰‹Œ TH0 *
³í´]
ò TR1° TF1 óŒÛ8µ»/¶·zˆ 8±%t%u#vIuM I¡-÷ž²‘ 3 Œ ۊt%u#v 0Ú¸²*‘ 3 u}Št:u#v 1¹º* ¡#„*…·²:‘ 0 » 1 » 2¸}¬¼6iˆa½6¾¿
À%õ>Á+²ŒaÂ/º6Ã6Ä
ųÆá¡-Çe}a¼WÈf9³í TF1° TR1ð
;²¢ŒùIuŠtSu#v 1¹/º ¢¡-÷ž GATEñ INT1j¢ŒaÉ· ¢¡®ÊcªøËé*ç/Ì*Þ²*‘ 3 ˆ#*‘*ý*Þ
çû>Í®iŒ®i?=-¨ I¡ž…ÏΏWÐMˆ-Ñ҇Ó6ŠvŒ
- 28 -
W79E4051A/RA W79E2051A/RA
ØÛÿ
rÜ Ôêìëríìî ï
ÜÞüßÔxêÜrðÛóÙûÛî ï
øÛùßÜÞúrêÜáòÙóÙôÛî í
ñ â ûáÜáԐêçëÞíxî ÷
ÜÞüöÕtêÜrðÛóÙûÛî ý
ÜáÔxòÙêçð áðÛóÙûÛî í
þ þ ßÜ Õ—òõêçÔ ð
rðöóõûöî ï
ðÞñ Ü Ô ê—ÜÞòÙóõôöî ÷
Õ
þ Õ
Üáà—Ô
Ô
Ô
ÜÞÝßÔ
Ö
Ö
×ÙØÛÚ
â ã‡ä åçæ æ èé{ä
×ÙØõþ
â ã‡ä åçæ æ èé{ä
Timer 0/1 Mode 3 (Two 8-bit Counters)
&
12-4:
t:u#v /‰ ‹v ²‘
3
qrë
ˆ
‹ /\ v¢Œ
‹ /\ v *s }
&
 ¹¸ Œ
Ÿ/d * I¡
‹ \ vŒ
‹ ž
z} ‹ á® Ò Å³«
\v
}
°
Œ· 2
] \ ‹ z}
Mú5ˆ Œ-¼å
¡ Iã Ï] ´] \ *•MÐ
7
ˆ } ¼å
ˆ }
· 
*…ï:•ŠÚ vª V Xˆ;² ¦ d °
z}-·
´
~±á® ± Œ *u• s
2 NVM ] \ +‹ zB} 789¼å => °‹*=õ > NVMADDR ° NVMDAT }0H¼å EWR(NVMCON.6) +
‹ z} uCª %PX QK!… RTSS}‹ Ô+õ!YBZ }BK…[Ò´\±®]UVWJ;*}-º*´/`bI/d(¢Œ +
‹ Iˆu•  50us Œ
13
!"
%
$#
W79E4051/2051
128 NVM 128 NVM 8
&
16 '
(
*)!+ NVM ,) NVM -
1
MOVC A,@A+DPTR ./ 0+ 4
2
3
+
5
6
0
7
8
9
<
:
;
NVMADDR
NVMDAT
NVMCON
NVM
=>
-=>
*?@ BA DC@
!E
F-G NVMADDR
0H
NVMCON.7 EER
I
:J;BK
L
M
N
O
(
C
@
P
Q
<
:
;
T
R
S
:<;RTS
(
)
PC
%X
DUV W<;
:<;
5ms.
NVM ^_<`-ab
Bit:
c
NVMADDRL
^_ : C6h
7
6
5
4
3
2
1
0
NVMADD
R.7
NVMADD
R.6
NVMADD
R.5
NVMADD
R.4
NVMADD
R.3
NVMADD
R.2
NVMADD
R.1
NVMADD
R.0
de
fJg
7
NVMADDR.7
78
6~0
NVMADDR.[6:0]
NVM
NVM
Bit:
*s =0.>
:
«¬\v€hsAÏ]DC@ ]<\!E%•#Ð
‹ /\v
=>
NVM ijk`-ab
NVMCON
7
6
5
4
3
2
1
0
EER
EWR
-l-m
- l-m
- l-m
-l-m
-l-m
- l-m
.
^_ : CEh
- 29 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
c
de
f!g
7
EER
NVM :<;
0: :<; NVM
1: :<; NVM
NVMADDR
Q\./ BRTS
6
EWR
NVM
Bit:
±
f
Œ NVM‹\vëon }$# % & sqpTrsŒ®Êc
«a\v£¤ ´S}#·¼t\±*´S}$\ ª×ÔW<;*}-d(.tª×P
ˆ ¢Œ·/Ä./JRTS5´/d(.tªI¸~u./wv
NVM ‹ + ±
‹ .
0: f+ NVM Iˆ#‹ Œ<d (.tª× PQ\./I0ˆ RTSIŒ
1: x!yŠ±¼å*s ’1’ 2 NVM +~
·/Ä ./JRTS5´d (.tª I¸~ u./IŒ
z{w`-ab
NVMDATA
^_ : CFh
7
6
5
4
3
2
1
0
NVMDAT.
7
NVMDAT.
6
NVMDAT.
5
NVMDAT.
4
NVMDAT
3
NVMDAT.
2
NVMDAT.
1
NVMDAT.
0
À¬ÀÁÀÁÀŠ¥
½€²¤¾¯°®¤¸
´‡·¤¸¤®¹ƒ®Šº¿·Š¼ «
À ´ ¬ÀŠ¥Äà ©¬Åƪ¬«­ ®°¯
ǐȹ
À ´ £Š£¤¥ ɐʤ­ Ê¡¹®Šº»·Š¼ «
½€²¤¾¯°®¤¸
´‡·¤¸Š®¡¹ƒ®¬º»·Š¼ «
£¬À¬ÀÁÀŠ¥ ¨ £ŠÂ¬ÀÁÀŠ¥
£¤£¤£¤£Š¥
¦¢§Š¨ ©¢§ª¬« ­ ®°¯
±²°³ ´ ¥¤µ ¶
´‡·¤¸Š®¡¹ƒ®¬º»·Š¼ «
à ©¬Å¿ã¤« ­ ®°¯ÆǢȃ¹
à â¿ã°«­ ®°¯¨ ¶ ʊߤ®
Ù Ú¤è Ù Ü
ެʤߊ® Â
ÙÙ Ú¤Ú°éè ÝÙ ÜÜ
ެʤߊ®â
ÙÙ Ú°Ú°éæ ÝÙ ÜÜ
ެʤߊ®á
ÙÙ Ú°Úçæ ÝÙ ÜÜ
ެʤߊ®¿¦
ÙÙ ÚÚ°çä ÝÙ ÜÜ
ެʤߊ®à
ÙÙ Ú°Ú°äå ÝÙ ÜÜ
ެʤߊ®¿©
ÙÙ Ú°Ú¬å Û ÝÙ ÜÜ
ެʤߊ® Ã
ÙÙ Ú¬Ú°Ý Û ÝÙ ÜÜ
ެʤߊ® £
Ù Ú°Ý Ý Ü
˅ÌÍÏÎÐÁÑ ÐÍÒ¢ÓÕÔ¢Ö ×Ø¿Ö Ò¢Ð
´…±¿Ç ÁÀ ê ë Ã
´…±¿Ç ÁÀ ê 냣
|~}€ƒ‚…„‡†ˆŠ‰ ‹‡„‡†ˆŒŽ ‘€’‡“ ”–•ƒ— ˜‡™€’–šŽ›œŽž ŸŽ ¡”¢˜‡‘¢›
&
; ² ¯ì d (Í
NVM /
\
13-1: W79E4051/2051 Sfr NVMADDRL = 0xC6;
Sfr NVMCON = 0xCE;
Sfr NVMDATA = 0xCF;
NVMADDRL = 0x00;
NVMDATA = 0xAA;
£¤QK…Iˆ NVM"
» +éIˆ#‹
// ¼åµ
//
- 30 -
W79E4051A/RA W79E2051A/RA
NVMCON &= 0x7F;
NVMCON |= 0xBF;
14 íïî<ð
M£*t:ˆ NVM-" -"
‹ +é£tSˆ NVM
// ª
// :<;
: ôtSu-v*~ V Ž*t%u#vz}#žŸ* Ê/cõ8dªø¼å:sqƒö/;vI}u-ÃÓ6Švç÷V%t:u
,
vŒø\tSó u-v/Ã6¸~цó vS}#í*qƒSu-{†‡ðùŒø†vèIã#ó £z}¬7útâIãuó •Œâã
u}M¹º :,ôëì ò æ :*ô‰zuMvZtýÞIóŠ}#ªkû$ü%qƒ%³Š±Œ :,ôâIã¯üz¡!ñ :,ô%³Š±
Å
³Š *® ý-V¼å:}-ª 2þIˆ-Å60³ ÿ
7ç Ì ò ‚ ó ø: ôt:u-vâIã+7÷qƒ%³Š±¢¡!ñ ó ,: ôt:uMv
âIã,<f û+Óqƒ*³±óŒ
ó
f FG + 4683 - 70 mN9n: - 0 j
4 ( +,. 2!+,5
ñqò
!)
!#"*,+,-$. /1%'0 2#&3 (
p qsr tSu v w
f 6E687@7;( &) <=;= k ` j
PQSR@T U VEWX;Y@ZU [
>J_
>J`a>Jb
c c!c
c#dec f &G f * 6EG680 7@76 ( (;/1) A!0 +,=;& g1k h!j 2!i,j
K ^'T \ Q#]8U Y[ U f 687( ) =Dk d!j
!
C H 0 G 3 3 4!I 0
>
>J f :B:68C :7Dk l C j f 68L 7(KN) MO=D k c#j
>!>
&G * G 0
f 686877
( >,) ? 68=D7@k ,o l j :B6E&F9
f 6E7@( ) =;k > j
& 14-1: WDT
ó
:,ôtSó u-v/59ž WDCLRZxzy¬Xz}M’“ ó :øôt%u#vz{~ }| t~}€ÞߎIŒ WDCLR±
ž%³Š± :,ô*t:ó u-v¢Œø\±× V XW 0 }©.· ýV *2 \!± +é 1´S}qƒ× V Xx\±W%s 0 Œ!ª
:øôtSu#v×íIu#{îïð‰‹zŒ‚zuu•:® WD1° WD0±!út ò WDCON.5
RWT ±¼*s 1 ´S}
° WDCON.4 󌂁zuu•õI¡´:} WDIF(WDCON.3)±å±>$¨ 5´ ó ,: ôtSu-vª PQ 512 u-{î
ïSó }M¹º EWRST (WDCON.1)
Q… ïS•„ƒëí WDCLR ð
 K…:}-6 512 u-{*îï¡´×ÿ
=1 æ·P}
:,ôt:u#v:³Š±IŒ ³Š±×eb 2 vîï>=u WTRF(WDCON.2)€ä±å±S}BýV I¡žù
±†}‡*ˆ ó *: ô*t:uMv%³±Œ
ó
: ôtSu-v ¢¡!ž…~ z‰Š ˆMtSu#vSó }Mùzu¯üŠ°:³Š±Å6³ŠÔû>Í*Œ #*ö‹zuu•ó õI¡´ WDIF±
,
×ó 屌- I¡!í WDIF±ð ‹Œ}Ž ,: ôt:u#vˆ-âIã#˜ˆSó }a7ž RWT±*³Š± ø: ôt%uMvIŒ
: ôtSu-vš ž…~ ³‹‘‰Iuˆ#tSu#vz}#·y²‘¸ ,: ôt:u#v¯üŠëìS$} #*öâIãM´7
,
· EA=1 u#×ÿ6 ó ,: ôt:u#vI¯üSŒ
ó
: ôtSu-v}’»ž…~ | q-ƒ ö/;vS}-·”“:u-;/²Iˆ-5žI ¯–•%s8Z»¢Œ-¹ºz㖗™˜!|klš›ç™˜œ
,
š
Ú Lvª×Ž6f t:øˆ C@¢Œ-¹º/fñzužŽ}Ÿz}ž qƒ ³Š×‹¡}¢ŒžŸ ¡!· ýVI¯M÷ž
ó ›z}
:ó ôtSu-v¤£+§d (ŽIˆ‚¥ó ¦?¨-žŸ· ýVI¯–§zóÛ*ˆ = ”¨© ó ,: ô‰Iu#vZt8d (z$} #Sێ
,
õ ,: ô‰Su#v6Zt¬d (zu©ª ø: ôt%uMv%³Š±¤£-§ ,: ôtSu#v%³±zˆ-ÿSŒ-¹ºqƒÀõš}›z}
d (Ž6Óª6(:}Mqƒ© 6³¬f׎ ó ,: ôt:u#vˆ³Š± C@z}#ùzuqƒ©×Ô ó ,: ôt:u#v:³
±Œ
í¸/f>=ˆu#{§*‡:} ó ø: ôt:u#vª×ÿ8f>=ˆ-âãu•ŒÛ÷
³ ó ,: ô*t:u#v%³Š±´S}# ³Š±
- 31 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
×·øâã-7‹«/c
u#{îï´!R0SIŒ
¬ ­ ®°¯
WD1
WD0
512
time-out
0
0
0
1
1
0
2
17
2
20
2
23
time-out
±
´
±³²
@ 10 MHz
Number of
2
17
+ 512
131072
13.11 mS
2
20
+ 512
1048576
104.86 mS
2
23
+ 512
8388608
838.86 mS
6710.89 mS
­ 14-1: ó :*ôt:u#vâIã#à
ó
:,ôtSu-v·ô™˜!óç}µ¶˜M³Š±´‹·*ìS} ó :,ô|t:u#v:³Š±fó ×*û>Í ó :,ôtSu#vS}-¼×ªi/Zxzy
Xz}BýV5/Zxzy8X :,ô*t:u-vxi/Ëé*~ t:ˆž~€ . ,: ôtSu#vIˆ;/²±z¸‹¹¹¸IŒ
1
14.1
1
º¼»¾½À¿ÂÁ
2
26
2
26
+ 512
67108864
: ô t:u#vz¯üŠ€*äzŒŠÛ ó :øôt:u#v%t%u#âã}B\±%så ’1’ Œ-¹*º ó :,ôz¯ü
,
}©×*ÿ9S¯Šü ( ¹*º/0}ïüFG*±%å ’1’ æ}Äÿøi¢ˆ¯ŠüµÅ ) Œ$ýV:³±%çø6i:³
±÷ ± Œ
Æ ó B: ô‰uvZ%t€:ä¢ŒÛ ó :$ô%tzuŠvS³±:´*å ’1’ Œ0\±: ž%z†”‡S³±ˆžÇó
WTRF:
È ŒøýV*WDCON.2
I*¡ )O\±I}-¼ 78É/X W<;Œžµ¶˜#³±×ªù± Wk;%Œ-¹*º EWDRST = 0 }B\±f×À
:,ôt:uMvzˆžÊÌË%Œ ó
: ôt:u-v:³Š±÷
³±IŒs 1 uM÷
³ ó ,: ôtSu#v*³±Å³s 0 û>øÍ \Å6³*}Mù
ø
EWRST:
WDCON.1 Æ
ó
u ,: ô*t%u#v VM® Ž ó
: ô%tSuvS³±¢0Œ \±*ž
¸ ó Ww; ó $: ô%tSuv97ªiz³±BŒ \±*× ó V !X W
$
WDCLR:
WDCON.0 – ª
Í }M
· ýV ,2 \± +é 1´z}Mqƒ× V Xªi*å 0 Œ#¹*º ø: ô‰zu#v6Z*t÷
³%}+6 ýV78· ,: ô
tÏÑ:u#ЖvÒ âã-´ 512 u#{îïÏ]ª ó *: ôtSu#v W Í }ˆ}Ίª×ÿ
Š~ ó ø: ôtSu#v%³Š± .
^_ : D8h
ijk`-ab
WDCON
WDIF: WDCON.3 –
FG (IE1.4)=’1’
\ W ’0’
Bit:
c
7
6
5
4
3
2
1
0
WDRUN
- l-m
WD1
WD0
WDIF
WTRF
EWRST
WDCLR
de
7
5~4
3
2
1
ó
fJg
: ¦§
: Ž
: t%u#v£¤
: tSu#vI¯üŠ€äIÍ#¹º : z¯ü÷³}øUVת\±­å ¯ 1ó ­¯ ó :øôt:u
vI¯MüŠÿSŒ¹*º : tSÍ u#vI¯Müû>Í}+\±Iˆ#å±
:,ô*t:u#v ȝ«
zuŒ ± á® 
ˆ–Ç
È : Œ ‰I*u# v¡ Zt€äI±IÍ}Û¼ :‹É/t:X u#v%*³Œž±µÓ´˜#å³±±øŒ×\ª±ù ± žWk;*†Œ-‡%¹*³Šº ±I
EWT Ô
} ±6f×/À : *t%uMvIˆžÊ”Ë
Õ/§ : t:u#v:³±
: t:u#v:³±
ó
0: ,ô
ó
1: ,ô
.
ó
WD1~WD0
*ô
.
ó
ó
,ô
,ô
ó
WDIF
øô
ø\ 78 DýV W
ó
ó
,ô
,ô
WTRF
,ýV
*)ó O\
78
W<;
,ô
0 $\
ó
*ô
0:
.
EWRST
ó
*ô
1: F-G
.
WDRUN
- 32 -
W79E4051A/RA W79E2051A/RA
: ôtSu#vW ’0’ Í WDCON.0Í – ª ó :,ôt:uMv%³Š±Œø\±ž/¸Wk; ó :øôtSu
*
v6ó7Šª/i:³Š±IŒ$\±× V XW }#·ýV 2,\ó ±+é 1´S}qƒ× V X ª/iå 0 Œ-¹
0
WDCLR
º ,: ô‰zu-v6Zt÷³}+6ýV78· :,ô*t:u#vâIã#´ 512 u-{*îïÏ]
ª ó ,: ô*t:u-v W Í }ˆÎª×ÿ
~ ó :*ôtSu#v%³Š±
Ò1Å
³/«a\v WDCON·%³Š±´SˆžÖà* 0x0000x0B
Œ WTRF (WDCON.2) Ô¼å ’1’  ó :*ôtSu#v
1
³Š±z}#Ô¼å ’0’ ô¶˜M³Š±Œ WDIF (WDCON.3)· ³Š±/f yŠ¶¢Œ!ô™˜M³Š±zu PORÔ¼å ’1’ Œ!ô™˜M³
±zu EWRST (WDCON.1)Ô¼å ’0’ }Mø/i%³±/f/À}ʾË%Œ<Ò 1ų8«¬\v WDCON ˆ EWRST, WDIF°
Ø )K…/fÀ8;/²¢Œ„ÙÚÛ}ÜÌÝ TA «¬\v
WDCLR ±IˆB+-K…À TA «8\v;/²?¨-ø/i±f/À/;²z}ž×}
ˆž¸‹¹Œ
ó
14.2
TA
WDCON
MOV
MOV
SETB
REG
REG
TA, #AAH
TA, #55H
WDCON.0
C7H
D8H
ORL
MOV
MOV
ORL
WDCON, #00110000B
TA, #AAH
TA, #55H
WDCON, #00000010B
;
Š³ ± ó ,: ôó tSu-v
:,ô*t%u#v
; £¤ 26 ±
;
º¼»¾½ßÞÓàÀ¿áÁ
;
÷
³ ó ,: ô
ó
: ôt:u#v²*‘£¤±¢Œ! 2±ž£¤ ó :*ôtSu#vIˆ-âIãu
,
•*ŒM³Š±·t:uMvâzãa7‹«/c u-{*îï´/Ó6SŒ
›œIˆ : âãu•Š
#u {z}‹âãzˆ#âIãu•*Œ EWT,WDIF° RWT8ÀSu-;2 38Á²Iˆ-± Œ
y … ²* I¡£a§ 6/· Šµ
«¬\v±Œ–ä*s8Z»IˆM%}+iªÌ£+§·ûC@û>Í}y8X ó :øôt
u#vŒ
 é CONFIG «¬\vIˆ-Ü 7±I}#ù±%Šž}åå ó ,: ôtSu-vIˆu#{|6fæ* V-] 1 RCç”èv
WDTCK
Ó
1
þ*· çŒ
Û WDTCKó ±W 0û>Í!žŽ ó ø: ôSu#{ ó 500KHz uM{†‡IŒ%® ¸‰*‹vf Vêë ³Š÷ ó ,: ô*t:u#v
¯§ŒŠÛ ,: ô÷
³Më*ìS} WDCLR± W 0 ,: ôt:uMv,æ¸~ ./* CPU„…J· EzëMç þ}µ¶˜²*‘
 užì*©ë ³Šw÷ 3‚íÿ:Œ1 Ó6y‹îzïzˆ„ðÌñMå 1/W 0 WDCLR±zu ó ø: ô‰‹v
hŽ·Í f
=uu#{¤òžó ò CPU u#{° ] RC uM{óŒŠÛ WDCLR±¼å*s 1 }#»6Zx¼åi*÷‰‹v78W Œ
ñs*Û CPU
uM{/¦§ð!é E”ëMç þµ™˜²‘zu#‰‹v}ƒëzu-{¥/i Vôꢌžõ™Bˆ Rº© WDCLR~‹ö
å±/,æ ó ,: ô‰‹v*~‹ö¦Ó÷·Í 0 Œ‚ø ú~ 3íIˆ#ù© ö/; WDCLR±S}#’“·ë ./¥ CPU
ðé*õ E¾ë#ç þ}µ¶˜²*‘ 56W WDCLR Œ
WD1, WD0: CKCON.5, CKCON.4 –
512
ó
*ô
217
ý-V
)+
- 33 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
úÓûaü
15
(UART)
q rë~ 0ý„ÏÎ!WЌ W79E4051/2051
qrþwx¤þ#¦Iˆ+Å
³¹S} ÿ¥¦Ž »
V X ‹‡ ¤þ#¦/Å ³:Œ$\?ΏWÐ wx>= ñ}ª ʐ‘zŒ-·?= ²‘¸ÏÎ!WÐ ÿ
%u#{67I¡‹ý
„zˆ-‘„…IŒ-}· ª ²‘¸:}8³S¡®0ý„Iˆ-‘„…z}‚M I¡/=uӋ¢ŒÓz}
«a\vž
ˆ +Ó ‹ z}{ SBUF)%-)O‹ŒÎWÐ<³z¡ 4y/f>=ˆ#‘„… .
SBUF 243Œí SBUF 0
W79E4051/2051
=>
h P
b
z{
Bit:
c
7~0
Bit:
c
SBUF
^_ : 99h
7
6
5
4
3
2
1
0
SBUF.7
SBUF.6
SBUF.5
SBUF.4
SBUF.3
SBUF.2
SBUF.1
SBUF.0
de
fJg
SBUF
ijk`-ab
!Î WÐ
ç/Ózˆ#‹/Ë· «a\v¯Œž“#ô\ => ôë 2/©/ª ˆ 8±
«¬\vŒ-~ ž6¸
‹I}#~ ž6¸Ó*‹Œí/ið)K*…ª×
Ώ
‹z}#í/ið! +TK…zÎÓ?Î!‹
SCON
^_ : 98h
7
6
5
4
3
2
1
0
SM0/FE
SM1
SM2
REN
TB8
RB8
TI
RI
de
fJg
7
SM0/FE
6
SM1
5
SM2
4
REN
3
TB8
2
RB8
1
TI
Ώ Ð 0 }#²*‘ 0;/²±%ç ‹¥}¦€*ä±¢Œ PCONÒ16Å9³«8\v¯ˆ SMOD0±Jú
t­¯\±¢ ˆaÅ9³zŒM¸ " ×¾¸}¹ SM0 ˆ#Ž%
Å9³zŒÛŠž%…¥z¦*€%äIu*}T\±ˆå±
~ ·ìzˆ-¦/§±Œ$\±78®*ýVW<;
Î!WÐ ²*‘± 1
! z{"
#$%
SM0 SM1 =
u#{Iˆ 4ç 125~
0
0 0
8
ª ¶
0
1 1
10
ª u#{Iˆ 64ç 32-5*~
1
0 2
11
ª
¶ &102345
1
11
& … Ê 1/3;/(
² '-ª \±å 1 )Î÷³² * 2+,* 3 -/.
'6,* 27 3
-/)98: SM2 ; 1 )9<=>[email protected] RB8 F 0 .G() RIHIJ;C!'6,* 1
-8: SM2 ; 1 )9<=6KL@>?LM!.9NOCP RI FIJ;CQ.'6,* 0 -/)
STVUWYX9.Z9[!'8:\ 0 )9<=!U]WYX1.Z[F^_/Z[(. 12`aQb
SM2
cd ^C_Re
fgh 8052 ij!b98:kC; 1 )1<=(UWX.Z1[F^_/Z1[Q. 4 `
a/) cd5 elm!nop 23 .qr 45
s >t ); 1 Z9uv!U]WX s >
)wxy(zk 45
,* 2{ 3 |}~€!.ABCDE!b‚ƒQ„]…E†‡HkC; 17\ 0
,* 2{ 3 | s >?.ABCDE!b,* 1-/)ˆ SM2=0 x RB8 F s >?/.NOC!b
,* 0-kC‰Š‹
€Q|Œg(Ž9,* 0 -kgY‘‚6€’ 8 CDE“;C!)1”6•–,*6QU]W€?NOC/.1v—(Z9;C!bkC˜™V‘‚š\@›
ž
œ  0
k,*Ÿ f¡¢£¤¥WQop 23 .¦*!b6k,*-@)U‘WDE§
15.1
- 34 -
RXD
¨¥W>)”
TXD
¨©ª
W79E4051A/RA W79E2051A/RA
«¬­ C®@Z[Qb]6€7 s >Z TXD¯/.Z[§ W79E4051/2051 ^°Ÿ !b c± ¦*-F(„²³
´ .µ*¥W 23 )¶· s >7€ 8CDE!bDE(.¸¹C~¸º€7 s >)»¼½/¾1¿ÀÁÂÃ
a½/. 1/127 1/4 b»¼½§ SM2 Ä SCON.5 Å]CšÆ¿)Ç SM2=0
¼½ÀZ9[Ƚ/. 1/12 )Ç
45 FgZh »8051
Z
»
¼
½
À
9
Z
[
a
/
½
.
b
,
*
|
9
.
ƒ
É
Ê
»
¼
½
{ W79E4051/2051^°(.
SM2=1
1/4
0
ËÌÍ1Î
.
-(ÏF,* 0 . 45 ¦Ð!ÏbDE§ RXDÑ¥W>/b TXDÑ©šÒ(Ó ­ C®(Z[() ­ C­ ®(Z[©šÔ
€DE(bÕ SBUF .ÖHJ€­ DE()×@Z C®@Z9[Ø
W79E4051/2051
Ù DEÚ RXD¨QU‘^W °­ {ӕ)–ۣܤ(€U’ W 8s C> D/E!
b8: SM2=1 )6 TXD¨¯!. C®(Z[-ÝÞßP RXD
¯(
1
.
à
á
J
â
ã
@
ä
9
Z
[
å
/
æ
b
)
ß
“
¨
(
¯
åæ@)ߓ TXD¨¯QçÈÞ
1
TXD
é b8: SM2=0 ) RXD¯!.DE6 TXDÞ¹PJ.âç]ã È3Þä/¹Zè[âåã æ@2)9ä/ßZ“ [TXD
¯Vç]ÈJÞ¹ 6ä/Z[å
æ@)ߓêÞ é b cd eëì/n6 s >íDEƒ!„]6 TXD .¯îïð/op)6 TXD .-@ñ9ïð~ s > .
Internal
Data Bus
Write to
SBUF
Fcpu
Transmit Shift Register
PARIN
LOAD
SOUT
RXD
CLOCK
1/12
SM2
1/4
0
1
TX START
TX SHIFT
TX CLOCK
TI
RX CLOCK
RI
REN
Serial Interrupt
RI
SHIFT CLOCK
RX
START
TXD
LOAD SBUF
RX SHIFT
Serial Controllor
RXD
Read SBUF
CLOCK
Ï
SIN
15-1:
U]WYX,ò
PAROUT
SBUF
Internal
Data Bus
0
g C6€’­ ¸“ Ì CDE“!. C1ó; 1 )Ç REN=1 ô RI=0
Z@UWžX s >DEQb ­ C®!Z9[c ~Ø
­
Ù ) UWYXõJ6 C®(Z9[!.¯îïö¿DEQb¡¢Ì £¤}6 C®(Z9[!
.-/ñ1Ù
ïû
ð€(
ÓàáQb ä÷
c
ü
ý
Êãø? 8CDEù¢€’ú@b RI J6 TXD .¸“ ä-ñ1ïð; 1 ) Z s >
) RI}§]‚
\þ!b
15.2 œž 1
6,ò 1-@)UWYX1„ù³ ´ .¦ò ´ û bU]W 23 .9DEÿ! 10CDE@)6 RXD{ TXD¨¯¥W
>(b 10CDE8-/Ž—C Ä C 0 Å) 8CDE Ä ¸¹C6P(Å)OC Ä 1 Åb]6 s >í/)NO
C¥ SCON . RB8C!b]6k,ò-»¼½ƒÞ/)9»¼½ƒ!„F¿Z
1/Ó9½/. 1/167 1/32 bõª¿Z
1 .(Ó½ƒ!„†}£¿)×»¼½(.@b
ÙÌ € Ùû )U]WDE(.A Ì C6 Ì ä 16óD
!.A Ì “/. C1
SBUF ÖDE“HØ
TI
- 35 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
~€? TXD¨/)- Ì CDE6- Ì 16óD
“/. C1ó€Ü TXD¨!b×DE!.€f
có/ä )16
b6€’ 9CDE“/)J€NOC!b6 ó(.D
Qop@)”IFÛ s Ö s >1c í!.¬ SBUF
NOCÒ!Ó? TXD¨!„“@) TIJ6 C1û ó;CQb  6 SBUFÖDE“ d 16óD
(.A 11
„“(bÇ REN=1 Z9^_¥W s >! ) s >
Q„"»¼½@. 16#qr$ RXD¨ó
Ç REN=’1’ Z s >t 5 d )Ç RXD¨¯ s >? 1-0ÝÞeØ Ù s >
s >/b%&
Ì Û%& RXD )¥W 16
#ª»¼½@.q½$ )'(?-@ñ1ï@Z) 16ó¿Z)
\ ’0’ *9k¿Z)
©ª`+,-.0/b
6: L 3ä(Z47)9` Î 6A 8 8A 9 8A 10
16 ó12
3 1äCLM@Z49` 16 ä(Z4 5®/d )C'(¸
ä/Z4 3ä5®/Z49¯'( RXD¨!.ó/) 3 $ |9Ü9 2 o.;@)„ëì sÌ >h<Qb]6'(?
IÀ 0 )1x—C‰M/)>=C s >@ç?@)Ç1ê s >? 䧏 1-0 .ÝÞ/Z)@
RXD
A Ø Ù ¯(s .>>-@
!ñ1bï8“: ) s RXD
>;À 0 —CLM@) s >
v— s >B·.•C 3D b cdE FÀ@nŸ é UX
.FGHS¼IQb
DEQ„]“/)JH s > Ì äNOC/)¥ RB8 )9ߓ RI;C!bK”6 RI; ’1’ßP˜™£; :
L6 s .M>‚!n 8b CRI=0
)ô SM2=07 s >[email protected]À 1 ZNLM
8:¯OM‚PQ/)1xNOC¥ RB8 ) 8CDE¥ SBUF ) RI ;C/)1wxRS s >?/.1ÿDE!b6N
OC(.|4) s >
@Ø)v— A . Ì s >@b
Transmit Shift Register
Timer 1
Overflow
Internal
Data Bus
Write to
SBUF
1/2
1
STOP
0
START
LOAD
PARIN
SOUT
TXD
CLOCK
SMOD 0
TX START
1
1/16
1/16
TX SHIFT
TX CLOCK
Serial
Controllor
RX CLOCK
SAMPLE
1-To-0
DETECTOR
TI
Serial Interrupt
RI
RX
START
LOAD SBUF
RX SHIFT
Read SBUF
CLOCK PAROUT
RXD
BIT
DETECTOR
Ï
15-2:
SIN
D8
Receive Shift Register
U]WYXUTò
- 36 -
1
SBUF
RB8
Internal
Data Bus
W79E4051A/RA W79E2051A/RA
ž
œ  2
kTò© 11CDEš¥Wù³ ´V p 23 b-(ÏFÕW!. 45X O(bDE§U—CC Ä 0 Å) 8CDE
Ä ¸¹C6P!Å)9ƒÉ/.A 9CDE Ä TB8 Å{NO C (0)(bA 9CDE Ùs Ì> Ü RB8 b]»¼½F@Z[
aÌ ½/. 1/32
7 1/64 )@ PCON |. SMODCš/b SBUF |9ÖDEØ
€/) U]WDE(.A
C 6 Ì ä 16óD
(.A Ì “/. C1c ó()~€? TXD¨/)9- Ì CDE6- Ì 16óD
“/. C1ó€Ü TXD¨(b×DE!.€f ä 16ó(.D
!op/)”IFÛ s Ö s >1í(.
b6€’ 9CDE“/)J€NOC!b]6 NOCÒ/Ó9? TXD¨Q„“@) TIJ6 C1ó;C/) c  ¬
SBUF
„“/b Ù
6 SBUFÖDE“ 5 16óD
(.A 11
Ç REN=’1’ Z s >t d )Ç RXD¨¯ s >? 1-0ÝÞeØ s >
s >/b%&
Ì Û%& RXD )¥W 16
#ª»¼½@.q½$ )'(?-@ñ1ï@Z) 16ó¿Z)
\ ’0’ *9k¿Z)
©ª`+Î ,-.0/b
6L 3ä(Z47)9` 6A 8 8A 9 8A 10
16 ó12
3 1äCLM@Z49` 16 ä(Z4 5®/d )C'(¸
ä/Z4 3ä5®/Z49¯'( RXD¨!.ó/) 3 $ |9Ü9 2 : o.;@)„ëì sÌ >h<Qb]6'(?
IÀ 0 )1x—C‰M/)>=C s >@ç?@)Ç1ê s >? 䧏 1-0 .ÝÞ/Z)@
RXD
A Ø Ù ¯(s .>-@
!ñ1bï8“: ) s RXD
>;À 0 —CLM@) s >
v— s >B·.•C 3D b cdE FÀ@nŸ é UX
.FGHS¼IQb
15.3
Transmit Shift Register
1
TB8
Internal
Data Bus
0
Clock/2
Write to
SBUF
1/2
STOP
D8
PARIN
START
LOAD
SOUT
TXD
CLOCK
SMOD 0
TX START
1
1/16
1/16
TX SHIFT
TX CLOCK
Serial
Controllor
RX CLOCK
SAMPLE
1-To-0
DETECTOR
TI
Serial Interrupt
RI
LOAD SBUF
RX
START
RX SHIFT
Read SBUF
SBUF
CLOCK PAROUT
RXD
BIT
DETECTOR
Ï
SIN
Internal
Data Bus
RB8
D8
Receive Shift Register
15-3:
U]WYXUTò
- 37 -
2
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Ì
:
L6 s .M>‚!n 9b CDEQ„]“/)JH s > äNOC/)¥ RB8 )9ߓ RI;C!bK”6 RI; ’1’ßP˜™£;
RI=0 )ô SM2=0 7 s >?/.NOCÀ 1 Z)NLM
8:¯OM‚PQ/)1xNOC¥ RB8 ) 8CDE¥ SBUF ) RI ;C/)1wxRS s >?/.1ÿDE!b6N
OC(.|4) s >
@Ø)v— A . Ì s >@b
15.4 œž 3
Tò 3 |›n1Ù»û¼^½_ ƒÉÊ¡/)1•–¦YZfTò 2 : ob9©[˜™6¥WYUW 23 P\—] SFR 12
!b\—] Tò{»¼½(.Qb8:F©Tò 1 7Tò 3 )9<=¿Z)
Ù1Ì`}~\—c](b6"
s >(b Z TXD
LQ.)Tò(| SBUF ÖDEHØ ÙÌ €Vb6Tò 0 |Ç RI=0{ REN=1
ZØ
Ù
û
s
¨¯ÙJ!ÓaQop/Z9[()è6 RXD¨¯€ 8CDEQb263 •–Tò-/) > 6 REN=1ô s >?DE“
eØ b¡¢£¤!„]€—C/.¦òšv—QU]W
b
Transmit Shift Register
1
TB8
Internal
Data Bus
0
Timer 1
Overflow
Write to
SBUF
1/2
STOP
D8
PARIN
START
LOAD
SOUT
TXD
CLOCK
SMOD 0
TX START
1
1/16
1/16
TX SHIFT
TX CLOCK
Serial
Controllor
RX CLOCK
SAMPLE
1-To-0
DETECTOR
TI
Serial Interrupt
RI
LOAD SBUF
RX
START
RX SHIFT
Read SBUF
CLOCK PAROUT
RXD
BIT
DETECTOR
Ï
15-4:
SIN
D8
Receive Shift Register
U]WYXUTò
- 38 -
3
SBUF
RB8
Internal
Data Bus
W79E4051A/RA W79E2051A/RA
SM1
SM0
Tò
b c
op
V p
V p
V p
UXZ[
DEe ·d
—C
NOC
‰
A 9 C 45
‰
‰
7
‰
8C
0
1
1
1
1
¿ Z
1
10 C
1
0
2
1
1
0, 1
32 7 64TCLKS
11 C
1
1
3
1
1
0, 1
¿Z
1
11 C
f 15-1: U]WYX9.Tò
15.5 gihkjmlon
ÇKL'(? Ì 2ä3 LM(.NOC(Z)1ƒ 5 e(Óa(n Ì äÿpqQb cfrcÌ ± ä‰M(.U]Wàá s >@b 2s
pq()èHgC;C!)@„
pqF§UW
6ÑQ.)tuv!.b W79E4051/2051 ^°ƒQ„'(
‚¥W'(Qb
5>z Ä ÿpqg(Å Ä FE_1 Å :b]}6~gh 8051± kCÌ F SM0 )w6 Ì W79E4051/2051 ^
SCON.7 F FEg
4
°/
–Lyxl
À SM0/FE bW{•|F
.gCQb äF SM0 ) äF FE b€‚„ƒ)…
Ì ä|C
FV SMOD0 Ä PCON.6 ÅÆ¿@.bÇ SMOD0=1 Z‚iƒ FEgC@)Ç SMOD0=0 Z‚iƒ SM0C
FE g§õ ‚;Cô˜™Q]‚\ 0 b†Š6Õ FEgC¥W‡ÖZ) SMOD0 ˜™À 1 b8: FE ;
C/‰‹Š)<Œ=0-Žs >?.>ˆ<DEÿIJH•\@›bÕkC(.\›˜™V‘‚š’
‘’ : 87h
PCON
0
Bit:
•
7
6
0
0
4 12 TCLKS
7
6
5
4
3
2
1
0
SMOD
SMOD0
-
POR
GF1
GF0
PD
IDL
–—
SMOD
SMOD
0
˜™
“”
t!U]W§Xf6rTÌ ò 1 ) 2 ) 3-/.»¼½l# .
–F FE Ä ÿp: q!Å]g
0: SCON.7
45 äfÿgph q8052
| SCON.7 o .
1: SCON.7 .
1:
Ÿ1023šy ›©œoTž ò 2{Tò 3-/.ABCDE()6 W79E4051/2051 ^°(| RI¡6 s >@.DEÿ@.¢£¤ B 0 ¢£7^_¥W¥¦ 23 Z9;C!b]‚"€L(.¼I/))§›n}‚¥W¢£¨ Î .©ª!b
6 0Ÿ1023 Tò-)0Ç1A 9C; 1 Z)9€(.DEF¢£ÿ/bÇé« 0c¬ ÕÚ 0 5€DEÐ/)9–­º«€
Ú¬ .¢£Ùÿ)Ç1Ú Î64s5 >¢£ÿ@Z)W{(. SM2 C˜0 ™À b ¤ ëì«W¬ { 6 s >?¢£ÿZ
|1Œ@b„® ¢£¨
ëì¯L6 s >?@.¢£{B ¢£- ZN
|1Œ@b¢£i°‹±§õ‚š
’(b
~«
²£(
.9Ú£¤H SM2C\þ@)K“h¤v— s >DE!b SM2=0“)9¶@Ç s >? Ì äLMDEÿÚ 0 e
¬
Ì
J
ä/|1Œ/b³~²£!.Ú£¤IJ´?µ0¶)ÀW{6·¸¹®»º¢£!.9?š!b6Tò 1 |)A
B¼C½ FNOŽC,1 FLM/.NODE/b8: SM2=1<=¯L6 s >?LMDEô®»º~²£“ RINJ; 1
‘’
‘’ : A9h
SADDR
15.6
- 39 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Bit:
7
6
5
4
3
2
1
0
•
SADDR.7
SADDR.6
SADDR.5
SADDR.4
SADDR.3
SADDR.2
SADDR.1
SADDR.0
SADDR
SADDR
–—
7~0
˜0™
¼½ ‘’¾¿ÀÁ Ž
| L ÇÖ Ÿ1023 Z.¥¦¢£7FÚ 0 ¢£
‘’
SADEN
Bit:
7
6
5
4
3
2
1
0
•
-
-
-
-
-
-
-
-
˜0™
7~0 SADEN
k1>2
t 5 UX 0:.ÂL ® Ù ¢£¨ Î45 )Ç SADEN |.ÃC~;À 1 )<=
CJ!o s >[email protected]¥Wi°±/b8: SADEN.n~£À
SADDR 12
/|.
^«¬ _JÄÅ1ÕkC!.°‹±!b8: SADEN Àù 0 )<=Õª"L!.¢£·^
0 )<=
_ZJ
|1Œ@b
« 0 ƒž„©(Ú 0 ¢Æ£(šÆ„yI.‚¹0 ƒÚ 0 bƒž„©„¥Æ¦ž.¦!ò/š„²£Æ"(Lž.Ú 0 b:Ú L 0 .¢Æ£ 
¢£FV :SADDR
. 8CDE()98: SADEN | .C; 0 x
SADDR { SADEN
L .C1e2‰
M(šb¿¯‹/L@)9Ç Ú SADEN
L CÀ £1 ) ¿/SADDR
|
.
|.DENLM(b
SADDR |Õ
Ç Y(.ÈÉÊyË8Ì¿‹Ú 0 ¢£/)„‹Í²£I(o.Ú 0
Ú 0 1:
Ú 0
–—
: B9h
SADDR 1010 0100
SADEN 1111 1010
Given 1010 0x0x
2:
SADDR 1010 0111
SADEN 1111 1001
Given 1010 0xx1
0
0
0
0 2
3Ú . 1G/{ )2<.=¢W£¢6£¸D¹E(C.ðC I(1o1L ) kÀ 61Ú b81:|« k0 C}~fÄ"ÅL)Ú ”062Ú 3 )92 |<k=C¢L£M(DbE(.×C }0=1fÚôC 2
cd eµ/n¥¦¢£(b
1=0 b]C 3 ~ÄÅb
« 05 ©¥¦(.¦òš{"LŸ Ú 0L 23 )¤ ¢£F SADDR{ SADEN |DE/.ÎÏf/b 0 :LÐ C8:À
D ©Ñ )¥¦¢£F FFH )”6¯Y/.ÒÓ/|Ú 1 .¥¦¢£F
0 )<=kCe~Ä0 Å@b6d
Ä 1111111X Å)9Ú 2 .¥¦Î ¢£F Ä 11111111 Åb
.2¢3£4` 5 F A9h{ B9h b)=C“) 2ä12
(.;ÔÀ 0 * cd ¥¦¢£{Ô¿@.¢
SADDR { SADEN
c
d
1
Ÿ
0
£Z‰M@)
e~y!zb
- 40 -
W79E4051A/RA W79E2051A/RA
U]WYXRS\—] r Ò(Ž
TMOD&=0x00;
TMOD|=0x20;
TH1=0xFD;
TL1=0xFD;
¿Z
1 Tò 2
//11.0592M ÕÁ(.ZÖ»¼½À 9600
´ û 6Tò 1 ) s >t 5
SCON = 0x50;
// U]WYX
PCON|=0x80;
//SMOD ;C/)UW§X»¼½l#
Ù
¿Z
1
TR1=1;
// Ø
ES=1;
// uv(U]WYX9|9Œ
16 ×ÙØmÚÜÛ (PWM)
. ß PWM). PWM0 .ÒQüÓàÝá ¨À P3.5.
=C“ PWMä Ò!Ç Ó 2Þ À é
W79E4051/2051 ^°L 1 ?ƒÉÊQ
Ç
×@8: PWM Ý¨Ò§Ó “1” )˜™
Ï8 . ^°âã 10- C Ç PWM @D
PWM ݨ/Ö “1”.
()9–!.Z9[Ù ÃÀRS
(Z9[!b PWMD
(Z[ FCPU = FOSC/Prescaler bÇ>D
!Ó9“D
(.ã]jH¹® ç • ڎD 12
@ä .
‘’ : D1h
PWM åæ
PWMPH
Bit:
7
6
5
4
3
2
1
0
-
-
-
-
-
-
PWMP.9
PWMP.8
“ ”
–—
•
1-0
PWMP.[9:8]
•
1~0
PWM
Bit:
•
4
1~0
“”
˜0™
PWM
ç • Ž 
PWM 0
Bit:
//
“”
D
12
/.
“”
9~8
C
“”
“”
.
‘’
PWM0H
: D2h
7
6
5
4
3
2
1
0
-
-
-
-
-
-
PWM0.9
PWM0.8
“ ”
–—
PWM0.9~8
“”
˜0™
PWM 0
“”
1>2
9~8
C
“”
“”
“”
.
Œ0Ž
3 PWMCON3
7
6
5
4
3
2
1
0
-
-
-
PWM0OE
-
-
FP1
FP0
“ ”
–—
PWM0OE
FP1~0
“”
˜™
PWM0
èO5
1: t
‘’
“”
Ò(Ót 5 C
“”
“”
: D7h
.
Ò Ó .
(
é Z é PWM0 2 ÷
PWM0 Ò(Ó . Ç P3.5 £¿À
5 ê‹ëì é
Â
PWM a½C . Ç
PWMRUN=1, t
0:
.
PWM0
- 41 -
P3.5
Ò(Ó
.
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
FP1~0: PWM
íîïð •
FP[1:0]
00
01
10
11
PWM
Bit:
åæ ñ • Ž
:
Fpwm
FOSC
FOSC/2
FOSC/4
FOSC/16
‘’
PWMPL
: D9h
7
6
5
4
3
2
1
0
PWMP.7
PWMP.6
PWMP.5
PWP.4
PWMP.3
PWMP.2
PWMP.1
PWMP.1
•
–—
˜0™
7~0 PWMP
PWM D
/.¹C12
ñ
Ž


•
PWM 0
PWM0L
.r.
‘’
: DAh
Bit:
7
6
5
4
3
2
1
0
•
PWM0.7
PWM0.6
PWM0.5
PWM0.4
PWM0.3
PWM0.2
PWM0.1
PWM0.1
7~0
PWM
Bit:
–—
˜ ™
PWM0
PWM 0 ¹C12
ŒŽ 1 PWMCON1
..
‘’
: DCh
7
6
5
4
3
2
1
0
PWMRUN
Load
PWMF
CLRPWM
-
-
-
PWM0I
Bit
Name
Function
7
PWMRUN
6
Load
5
PWMF
4
CLRPWM
0
PWM0I
“”
“”
“”
KLòW .
D
òW
.;i°‹±
IJ~äó?D
{°‹±
1>2
!|* Ç Ì
0: PWMP 12
(
Ç
/Ó9“) PWMP 1>2
(.;HJäD
12
@) äåæ
1: 6D
‚ \ Ç ’0’ b
(ÓghC .
PWM
0: KL/Ó .
Ç
!Ó («¬ PWM |1Œ>ô‡)Ç PWM |1Œt 5 ).
1: PWM 10 CD
\ PWM D
1: \ PWM 10 CD
À 000H.
;C“V‘‚: ® Ù \@› .
Ò(Ó .
0: PWM0 ˆ
:
Ò(Ó .
1: PWM0 õ
0: PWM
1: PWM
- 42 -
W79E4051A/RA W79E2051A/RA
Ç
Ç
Ù
12
Ö/.9DE6J® . äó? PWMRUN ) CFgÀ 10-C D
!Ó) CF g
PWMP
6 Ç ÌÌ äåæ¹® Ù \›)Ç PWMP 12
~äó?D
1>2
()äóCH6 Ç äåæ~¹® Ù \@›b8
:A PWM Ò/ÓåæV Ù PWMP£¿) CLRPWM3 10-CD
£À 000H ) CF`J~\@›*K“£;
PWMRUN {äóCšØ
PWM b
¶ Ì ä PWMÒ(Óö÷/.>r§°‹±012
PWM0L{ PWM0H Æ¿@.)Ç PWM °ø±12
(.;dª 10CD
0 1>Ç 2
(Z) PWMÒ(Ó¹(b8:}Ò(ӃÞ/. PWMö)6Ö PWMn
12
“@)1˜™3äóC
; “1” ) /ÓZ3 PWMn 12
(.;äó?y°±12
(b PWM Ò(Ó é ö÷rF@Ž
tHI = (PWMP – PWM0+1)
ù
8:3i°‹±1>2
£; 000H ) PWMn
Ò(Ó é *8:y°‹±12
; 3FFH ) PWMnÒ(Ó¹(b
Ù
2. PWMP 12
Ç äåæ~® Ù Ö\@Q›.1b DE6JÜ® .)äó?@Ç PWMP 12
~äó?D
Æ12
/)>äóCH6
Ì ÛÀ “1” 7 “0” (úûg† 1).
PWMn Ò/Ó
äó (PWMRUN)
À 1.
Ç
·¸ PWMF ;C7 äóC (=0).
\ PWMRUN.
:
1.
- 43 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
VDD
PWMP Register
ÿ
D
load
SET
CLR
Counter Register
% & PWM Period Interrupt
Q
VDD
! " #$
Underflow
10-bit Down Counter
üþý ÿ
Clear
Counter
X
Y
--
RS ÒÊ/Ž
PWM
sfr PWMPH
= 0xD1;
sfr PWM0H
= 0xD2;
sfr PWMCON3 = 0xD7;
sfr PWMPL
= 0xD9;
sfr PWM0L
= 0xDA;
sfr PWMCON1 = 0xDC;
void main(void)
{
PWMPH = 0X03;
PWMPL = 0XFF;
PWM0H = 0X01;
PWM0L = 0X5D;
PWMCON3 = 0x10;
PWMCON1 = 0XE0;
while(1);
}
*,+
16-1: PWM
PWM0
(P3.5)
1
>
PWM0 register
Ï
0
PWM0I
+
+
PWM0OE
P3.5
Compare Register
17
PWMF
S/W Clear
'()!
Q
á Ï
°
)) ˆ Ò(Ó
//PWM
=35%
//Fpwm=FOSC
//
PWM
Ø Ù
-/.1032/4
^° MCUŸ 1䰋±
. °‹±
(.ÒÆ8Ì Ò(Ó{ ©[ƒQ„]…E†} ;!b1«Ç ¬
é
ˆ !ç]È ª @Z)0°‹±
/.Ò(Ó ’1’ )>õßÒ(Ó ’0’ b ¶ äi°±
Zƒ!á „]£;Ç /)ÇÒ(Ó Þ@Z
°‹±
(|Œ) ‰ T i°ø±
(.Ò/Ó1Fw{ CM[2:0] @) CFZ H;C . Ï8 Ž
;C CIPE(
°±
Idle Power-down t 5 ) ACSR.5CÀ é )T i°‹±
6 Idle { Power-down Tò Ç )
û
`H ©(b×T °‹±
(|9ŒƒQ„
Tò{ !ç‹Tò t.
W79E4051/2051
=<
6587
6>=<
A@
:9
:;
8?
AB
=B
CD;
FEHG
+JI
AB
6K
- 44 -
W79E4051A/RA W79E2051A/RA
RdVe fgNhfViXdVU d`S fVUNkj U lWj S
TgVj †S TVU‡|j S
a
…
Qc
Y Z\[] ^`_ba
^
M
Qc
Y Z\[] [_ba
[
N~€ ‚ƒ
œ
Ï
Q RS TVU U WXS
17-1:
Nk‹Œ€ ‚ƒ
Z
^„
T i°‹±
:B
PCMPIDS
: F6h
˜A™
7
6
5
4
3
2
1
0
-š‘›
-š‘›
- š‘›
- š‘›
-š‘›
-š‘›
B1
B0
:ž
ŸJ B1
PCMPIDS.1
P1.1
B0
PCMPIDS.0
17.1
N
^„
CEN
Bit:
NPO
L
mnopq rstuwvxoy oxz ty
Ž‘,’=“A”A•:–A—
Z‰ˆV] Š
TV|fbWRl`j Rg
{ N}fVRS U fVe
è OD,ÒC
P1.0 èOD,ÒC
. 0:
. 0:
¡‘¢
¡8¢
D, /T Ò
D, /T Ò
( 5‘7
( 5‘7
=B
:B
è OD,Ò
). 1: èOD,Ò
). 1:
1( >‘< )
ˆ
1( =< )
T i°‹±
/.ä 66 0 Îåæ $ d . ) ± 2 v—F6 Ç Ì äåæ\v—(.b T i°ø±
!.Ò± ƒ 5
Ý°‹±
/.Ò!Ó S()¼ F6¹q
. ÷£¿ ACSR(97H) 12
/. CM[2:0] Cƒ!„]L 8 |1Œ
Tò . Ç CPU6 normal/IdleTò Ç F š® Fosc; Ç CPU6 !ç‹Tò Ç F š® iã RC 22M/11M Hz
ÁÂ
.
@Z4
CPCK2 CPCK 1 CPCK 0
:B
£¥¤§¦§¨©«ª¬®­A¯«°²±§³
6´
‘µ
´
·¶
:B
´
K
DB
DB
¹¸
´
CM2
0
0
0
(3/FDB)*2~(4/FDB)*2
0
0
1
(3/FDB)*4~(4/FDB)*4
0
1
0
(3/FDB)*8~(4/FDB)*8
0
1
1
(3/FDB)*16~(4/FDB)*16
1
0
0
(3/FDB)*32~(4/FDB)*32
1
0
1
(3/FDB)*64~(4/FDB)*64
1
1
0
(3/FDB)*128~(4/FDB)*128
1
1
1
(3/FDB )*256~(4/FDB)*256
f
CM1
CM0
0
0
0
0
0
1
17-1:
°‹±
õÝÞ(Z4
°‹±
/|ŒTò
>‘<
¯îï
- 45 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
0
0
0
´=¶
:º
1
1
¶
1
:º
1
=<
± õ ÝÞTò©š @›F õÝÞD
=Cèv—
8:{i°‹±
(.Ò(Ó /)
»
S
1
1
¯îï õÝÞ
Ç ñ9ï
0
0
0
1
S
Ç ñ9ï õÝÞ
1
0
1
1
ˆ
Ï 17-2: °‹±
(|1Œ>Tò
@)6õÝÞTò Çü )Ç0°±
Ò/Ó)- ¤ ± õÝÞTò/¤ |. ̱ M‚(Z)
¯D(bÝÞÙ D ðJ Ì ‚' „°±
FÇ wJ- õÝÞM‚Qb
;C .wx CF H ÛÀ1¹ . ô
ώ
CF HY‚ ®
1
:¼
»
8½
HC8;
8¾
A¿
AÀ
AÁ=Â
ÐÑ\ÒÔÓwՌÖxÕw× Ñ\ÖkØÚÙ×ӉÙ×
ÛÝÜ\Þ Ñ}ٌ߇àwá ߇âäãåá Ò Ü Ö
Ðçæ
ÃVÄ ÅÆ Ä
ÇÈÉÊËÌÍÎ ÌÏ
Ï
17.2
17-2:
èVÌÇÊé
ÇÈÉÊËÌÍÎ ÌÏ
õÝÞ/.°±
Ç ñ9ï/|Œ
º
6íYXÝ1¨¯lVçj) 9Qç (. ­ b8!Ï
îðï®ñ6ò
Hó
õô
·ö
ÃbÄ ÅÆ Ä
18-3.
Figure 17-3:
°‹±
L ©Qç?
- 46 -
ê Ê ÌÇÎ Ä Î ÊÌ
ë ÅÄ ÍìÈí
W79E4051A/RA W79E2051A/RA
Ÿ
$&%'&(&)&*+!,
W79E4051/2051
.- // -10243&56 748 49 1:;<=4>?@;A4B.CROM
D4E4FH!GJ"IK# LMNOP!Q&RS
&
1T&U2V&W 9XY E&:;Z&[)HC\]1IK6&72 W79E4051/2051 ^_ ]`
a IKb*1>)*486721Sc Y CJ6 a IK&def1)4gHhJ>&ijC
klnmo&pqr TA
st : C7h
18
÷ùøûúýüÿþ
67
Bit:
7
6
5
4
3
2
1
0
u
TA.7
TA.6
TA.5
TA.4
TA.3
TA.2
TA.1
TA.0
xg.y hn1)zn{ )*84IK2
g
hC~Bg.hJIK~2
} …†‡ˆ‰S4„ 1Š†
|&€&4Ž‚ B4ƒ !G
: |1
n
z
{
&
S
„
4
b
49‹^4_ 3Œ
TA
AAH
55H
_|€ g.hJIK~2
C
 6 a‘&’4“ 84IK12~g.h1d4”!•*
CB8–4—=&Sc 1˜™!1)š.›œž4Ÿ ¡
¢Sc Y L£C¤¥¦§¨441)!š.› 4© 3Œ b&ŽC  3Œ bY Žf†1)š.›!ª¬«&M­4C
BŸ !)&š.›œ4ž ‚ ƒ TA zn{&S„ AAH ‰&S„ 55H C TAz{1®¯&d C7H “° ± 8
)zn{—4=gHh~²³NO´
4µ2 } C7H¶ 1zn{4 TA
TA
REG
0C7h
;
7-0
vw
TA.[7:0]
MOV
MOV
TA, #0Aah
TA, #055h
¤ ·4¦Hƒ TAS„ Aah†¸&¹& º¸¹!¸¹4Q$% 3Œ bŽ4>»” 55h ;D  3Œ b4&Ž
¼½»¾4¿] ˜&™!)!šH›ÀŸ C1)š.›½ 4© 3Œ bŽŽ |€ P GJ8IK
~2—=Á
SC`Â55h,
)šH›M­41˜™BA&0Ã4fÄ>gHh½IK~2
C
1)g.h4~ÅÆ´
Å 1 ´ £4g.h
Ç : M/C =bŽ
MOV TA, #0Aah
3 M/C
MOV TA, #055h
MOV WDCON, #00h
Å 2 ´ £4g.h
MOV TA, #0Aah
MOV TA, #055h
NOP
SETB EWT
Å 3 ´ £4g.h
3 M/C
3 M/C
3 M/C
3 M/C
1M/C
2 M/C
MOV TA, #0Aah
3 M/C
MOV TA, #055h
3 M/C
ORL WDCON, #00000010B 3M/C
- 47 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Å 4 ´ £4g.h
MOV TA, #0Aah
MOV TA, #055h
NOP
1 M/C
NOP
1 M/C
CLR
POR
3 M/C
3 M/C
MOV TA, #0Aah
NOP
MOV TA, #055h
SETB EWT
3 M/C
1 M/C
3 M/C
2 M/C
Å 5 ´L£4g.h
2 M/C
È ÅÆÉ184IK2Sd  bŽ
G&¼JÊË&C~Å É8IK2Sc d  )š
›
M­2†4Œ —=4Ì1EQ8I4K123Í&Œ Î4£DC Å 4 Éd Ï 4Œ 3b4Ž8I4K2Y —=&Snc Y Ð Ì&Sc YÑÒ L£C
19 I/O ÓÕÔ&ÖØ×
2 (P1), 1Œ 72 (P3) 1Œ 22 (P2) Ú › . Û P1.0 Ü P1.1, Ý Ú ›ÀÞP
G
4
Ù
4
Œ
W79E4051/2051
1
8
ßà \áâ.ƒJ㠒 . P2.0 (XTAL2) P
GJefä ENCLK=1ßà \åæ ± 4¤ Ù9 1åç&d
¼ RCè
é Zêë è é , æ ± ~ìí&\ 1/4
¼ RCè é Zêë è é .
îðïòñôóõö&÷ 1 P1M1
st : B3h
øù
øù
øù
øù
øù
u vøw ù
x!y ú㠒
1
P1M1.1
0: P1.1
. ( û4ü )
’
á
H
â
½
ƒ
ã
1: P1.1
ú㠒
0
P1M1.0
0: P1.0
áâHƒã .’ (û4ü )
Bit:
7
-
6
5
-
-
4
3
-
-
2
1
0
-
P1M1.1
P1M1.0
1: P1.0
¤ MCUýÿHþ-Z&02&† Ý&
Ú ›½Þ&d46 a 㠒 1æ ± 3á
„Z4æ ± E4B= ßà C P1.0~P1.1 \4 ú㠒 .
19.1
` 6 a 㠒 P.G» |&Y æ
ú !"
P1M1.Y
/
á4âHƒ
0
1
8051
#
19-1: I/O
Ú › ßà #
- 48 -
W79E4051A/RA W79E2051A/RA
¤ H-~Z02† Ý4 Ú ›ÀÞ&d6 a 㠒 æ ±$ 3á 8051`16 a 㠒 P
G%» |Y æ
„MCU
01Z4æ ú± æE± 4C1BE32= ßd à áCâ.¤&ƒ&'› æ 3± Œ \( 4
-)5* !$G%+46«!UE7,24P
G U ^| _C )* .-
-/16 Œ `
6 㠒 498:d 4 4
4 C 4 W= ? ¿ “1”>?)9@ $6
U Œ9} @9A ¾3B4Œ U | C¤ Ú ›.“ * C.' ”± j“; D9E “0””Ü ¿ “1”“< ; >? ” * “* 49F ”A Ÿ “0”2Œ >CPU
1å†M­ * 4C
¤æ„ Ú ›½9\ G
%- HZæ ± G!- H “; 4 ” Ÿ !.I4áâHƒ&› ^_ -/J9K4æ ± “1” Z4IK Ú › “0”’.
æ„ Ú ›I K “1”O P “<; 4 ” Ÿ MLæ„ Ú ›IK “0” “<; 4 ” M­C <; 4 ^_ @; - /4I KNC.'E
'(.CJáâHƒ Ú ›1 ßà “ #.C
¤ Ú Q› C'&\ ( , -- / R \ 20mA/10mA S V =5V/2.7V T .
DD
~v€v
`cf gi_ah]jl`cbekedmnf o]p
UWVYXv]Z[wxyxZ wxw Z z|{
U WZ X V‚^xƒ U ˆ‡ ~…„‚„sXw‚† ‰ U ‡ˆ„sw‚‰
}
UWVYX Z[U]\ ^
Š
q ^srstuZWviwxZ w
áâHƒ½æ ±
19.2 ‹Œ

Ž ß à M
­ ݏ 4
C&D Y \DEæ ± œžê4F 4
- 5 n ú Ú › ß à “
19-1:
- 49 -
.
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
i‘W’›€“]˜‚—s“ ˜‚˜ “ ™sš
]‘W’ “”€• –
œ
 –Yž‚Ÿ|“i›€˜‚“ ˜
Š
19-2:
úæ ±
- 50 -
W79E4051A/RA W79E2051A/RA
¢ ¡£

é
zn{
É1ä à .§¨´1.¼
æ
„
9
¥
¦
C
éè M¥N¦4êëHÙ9¤4å^æ_ „MŒ¥Nè ¦ ܪ©è!è é !æ„N¥M¦ðC ©nèè é æ„!ìíPÿG«NKN=
¿
EB.-5Z.-¬
°·¶ ¸s¹»º ¼[½|®·¹|¾s¿ ½ ¼sº ÀW¶
±Y±Wµ
³xËÍ°ÌYÀW¿ º ¹ÎÇYÄ|ɺ ÃW¿ ÆY¶ ÆY½ Ã
È Ä|º ÃW¶ Ä|¼W½|Én°Ê®·¹|¾s¿ ½ ¼sº ÀW¶
±”³‚µ
ÁWÂ|º ÃW¶ Äs¼W½»°²½ ÀY¾‚Åe¿ ÄYÆYÇxº
³Y³‚µ
20
W79E4051/2051
24MHz
3
CONFIG
(CONFIG0)
RC
4MHz
.
[­ ®e¯€°´³ ­[®e¯…°²±
ÏiÀsÒ·ÃW¶]ÓÔÀWÄY¿ º ÀW¶”ÉnÃY¹xº
ÏiÀsÒ·ÃW¶]ÕnÀsÒeÄ
Š
­Y×[ØxÙ
20-1:
è é 3d ÝâÞª4ߪì&àí á11.0592MHz/22.1184MHz +/- 2% ¤
.¼ RCÚÜè Û é RC
é ãä1å&P
G%= P2.0 (XTAL2) æ ± .
20.1
FOSC1
²° ÏnÐÑ°·½ ÀY¾‚Å
°²ÏiÃ[½ ÀY¶ ¾s¿ ÆYÅ ÖsÃW¶ ¼W½
FOSC0 = 01H
n
¼ RCè
åæ¢çéèêëàá 1åç'
¤ FOSC1,
PGQ=êë4æ„1å ìíìéíd 4Hz¿ 24MHz C1å
= '4
11H
(XTAL1)
P
G= P2.0FOSC0
æ
± «. Kå&æ !!¤¥îH¼ é &Z&ê&ëåæ&„¥¦
\]W
(XTAL2)
Ù ¤ MCU
W79E4051/2051 êëäï
2$ð± e&f ACCK.7 z4{&
RC è ENCLK 2&W XTAL2/CLKæ ± '&æ ±
Ù
¤
Ü
W79E4051/2051
å$ ñòóB è é è é 㠐 ’“ §¨ôMõã È ’ åæ ± ì&í\ 1/4 CPU å
C1D&\!].ö÷
-/ ô
õ1㠒 E nBåæ ± P.G —M„ ôõ㠒 M / åæ ± C1êëå4æ„$øP
GJæ ± å .
20.2
- 51 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
\ ]ùN úü û¢Hýÿ-þZ
-~ç&E ± j
W79E4051/2051Ù¤^_ 2Œ -~ç!!´H- Ü
.
21.1 d -çÿ- “ ¿ - " ! 2
&¥c î.Y CZ ¤!^&- _ - ç¿¥HCî$# W79E4051/2051
‹Ù¤
4%4ŒI K9 ¿ 2.4V,¿ 2.7V,3.8V
&
4.5V
BOV1-0
H- G~.C 2' ö.-~㠒
B$#­\ & 960/f ¤ V  (B.- ^G _ “ 1ìí :R LPBOV=1,
\ v 100K* V HZ ±50%. T
\ 64/f MVDD
M)#)*2*+, SFR AUXR1 @A2h. - Š “
.dEih
C
.0/;=13<>259 <>46?:189 7:9
P6[8eZf\^P6] _M[d` aMc b
0
.
5
E
F
@BA / ?>7 A 9
D G:G:H=HJP>I>Q KMHNLNRTKMSMO HVUNOXW SNO KVQ UZYNO
P6P6[^[0\ g
Š 21-1: - Š
21
BRC
BRC
DD
DD
lj tut
»ˆ{u{i§w†dz¡ „Jj©u{u~0~k‚z ¡ {=£Bƒ…} „=s
jlknmporq
jlknmpos
k‚N{0ƒ…„=sV{u†0zu‰›z kn=m…zZ†0‰ |
k‚kn {=mwƒ…v „=xBsVyp{iz†d{pz‡|0oˆ}i}J~ |=}B}=€zz ¸ ”^¾3”–ž
k‚ {=ƒ…kn„=mwsZ{iv xn†0ª³z‡z v {p„0z |=}i}uMM~ †B}B´d€zz ¶=·›¿
µn¼€¶=½n·›¾ ¸
’5“ ”–•€—d˜3™›š=œ> ž Ÿ5•€— ”
i’ “ ”–•€—d˜3™›š=œ> ž Ÿ5•€— ”
‰ˆ}=z‹ŠdŒŽˆi 0ƒ‘u }
›Œ0|dz }iM |¡ |‘¢={i~ z ¡£B}¤ |¥iŠ={i†dzu¦Byu§‘j©¨›ªT«Byi§¬j®­ {iu}B¡J¯pk›m±°²¢={i~ z ¡£B}¤~ }J¢=}i~
µ‡¶=·›¸¥¹ kˆ {0ƒ¥„=sZ{i†dz‡oˆ}J|=}=z‡°ˆ}i~ =Œ¥µ› §±}…ƒ¥ zM¯±uŠJ{i†dz5ºu§±‰
Š 21-2: - 52 -
W79E4051A/RA W79E2051A/RA
ÄƼ½Å { W
 ²- ÇÈ4ÀÂÄ ÁÃÄÆPÅ G)ÊFLASH
Ä
&
Ë
S
H
„
ICP(
G )XÉ W | “ Š C . |
P1.6 Ü P1.7 _ ICP XÉ
21.2 ICP(
 ä4¸U -Ç)#4ÍÌ
œ
ž
X É 4| €
|
ÇÎ
ICP RST
Vcc
ICP Power
Jumper
ICP
Writer Tool
ICP Connector
Vdd
Vdd
Vpp
RST
Data
P1.6
Clock
P1.7
Vss
2.
3.
App. device
App. device
System Board
Ï Ð NC$'Ñ»?Ò
Ӑ Ô NÈ4OÄÙÛ Ú†!ÜÝ&M­ œžÕ4-Jç ÞÜ&ß Ù9Ö× #Í1؅» †  ».-Jç
ÜICP
Ýà € Ñáâ=ã ÛÜ È9E Ù4ß9 à 2ä Œ ðICP
åXE4É BÕ
Š
1.
App. device
Vss
W79E4051/2051
Note:
Jumper
21-3: ICP
, RST, P1.6 & P1.7
.
.
.
- 53 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Ø
Ö ×æ
 .-½Š È ä à `ÂÄ
6
2
2
4
œ
ž
ß
à
ß
à
W79E4051/2051
l) ö
2Œ >&ÊË
Ë 4ºâ=çE! 4Ù9R¤9] C26Œ 7 <è d4(CONFIG0,
ef 2Œ flashCONFIG1
PHG
ß&à 6
é
EPROM
EPROM =
ÈÄ Üêë C NOÈÄ"ÙÛچN&OPHG~Fìíîïà “ 6 2Œé ö$#¹2Œ ðflash
W | MOVC
ñò
ó Ý #1®4¯Áô .
22.1 CONFIG0
ø õ=öZ÷Nø3þ ù ø6úNû:ü6ý ø6úNû6üVþ ÿ ÿ ú
ý þ
22
Figure 22-1: Config0 register bits
.~!1#1å4ç¥î2 ::
¼Jë 500KHz RCè é 1å Y \.J&!1å
0:
1å Y \nH~!1å .
1: CPU
- ¥î2 :
CBOV.1 CBOV.0
1
1
-- 2.4V
1
0
- 2.7V
0
1
- 3.8V
0
0
4.5V
1åf .
1åf .
0:
W 1åf .
1:
é ¥î2 1.
CPU è
é ¥î2 0.
CPU è
7
6~5
2
WDTCK
CBOV1
CBOV0
BPFR
1
Fosc1
0
Fosc0
!"$#%$&
.
è é :
Fosc1
Fosc0
0
0
0
1
¼½ë
© f è ßà
é
e
RC è
(
4MHz ~ 24MHz
22MHZ)
XT1 & XT2 f
1
0
1
1
I
('
S
CONFIG1.5
P2.1 & P2.0
ê4ë è é åæ„
T
.
- 54 -
2¥î
11MHz or
W79E4051A/RA W79E2051A/RA
22.2 CONFIG1
ÿ
)+4657 8 9:0
)+*
2
-/.10
ÿ
2
3
3
22-2: Config1 register bits
é öö¹ÄðË{ NO Fì&2 ÞF`ì 2Ž ´ 2&S
128 é
Ž 2 | >IK |€ # 128é ö#1¹ðNO
` Ž 2&S 0 128 é ö¹ð{ 4
¼Jë è é ¥î 22 MHz
1:
¼Jë è é ¥î 11 MHz
0:
I .
C7
6
#
;$<
7
)+,
(=
4K/2K
>
C6
?A@
=
5
FS1
0~4
-
0 Flash EPROM & CONFIG
>
(?A@
.
& CONFIG
2 ‹ E P
GJÁ&S
2 ‹ E P
G~Á&S
.
.
KLFM
BDCFEHGJI
N'
n?)Ò
Lock bits C7 and C6:
Bit 7
Bit 6
1
1
0
1
1
0
0
0
23
ö¹ð
é öÄËöNÄO Ë4128
é
NOFì
The
ìP
G½4K/2KB
ÁS é
E9«K .
öÄËNO 128é ö¹ð
4K/2KB é
ÞE4Fì P.G! Ï S4
! Ï S4 ICPÁ&SÞEP
G
(?H@
4K/2KB
=
(=
Á&SC .
ö¹ð EF
128 é
(O
PO
ICP
=
P?Q@
ÞFì EP.G! Ï 4S (?H@
=
(O
ICP
Á&S
.
RTSVUVWYX[Z]\_^V`Va[bYced
fhgij
Bit:
7
6
5
4
3
2
1
SP.7
SP.6
SP.5
SP.4
SP.3
SP.2
SP.1
klm
: SP
70
SP.[7:0]
no
ñ { {
p
>q
RAM
É
nho
#
ç
rstu(=
v$wxy
ñ
{z
o$|
0
®4¯
SP.0
: 81h
.
}$~h‚
i
ƒ$
j
€
- 55 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Bit:
7
6
5
4
3
2
1
DPL.7
DPL.6
DPL.5
DPL.4
DPL.3
DPL.2
DPL.1
„…†
‡
7-0
0
DPL.0
t$u
: DPL
ˆ$‰
Š‹
DPL.[7:0]
16
‡ŒŽ$‘“’”•
: 82h
.
}$~h‚ƒ–$€
Bit:
7
6
5
4
3
2
1
DPH.7
DPH.6
DPH.5
DPH.4
DPH.3
DPH.2
DPH.1
„…†
‡
7-0
0
DPH.0
tu
: DPH
ˆ$‰
Šh‹
DPH.[7:0]
16
7
6
5
4
3
2
1
SMOD
SMOD0
-
POR
GF1
GF0
PD
‡Œ$Ž‘A—˜”•
: 83h
.
™Fšh›œ
Bit:
„…†

ú
: PCON
žŸ
¡
SMOD
1:
6
SMOD
0
0: SCON.7 ²³´µh¶·¸¹
FE º»¶·¸‘¼F½h¾

1: SCON.7 Š‹¿½À 8052 Á SCON.7 ‘à .
5
-
ÄNÅ
4
POR
¢‘£F¤¦¥¨§©ª
0: Æ$ÇÈÉ(Ê
1: ËQÌhÍQÎÏHÐ

‡
“­$®h¯$°±
1 « 2 « 3¬
‡PÑAÒ
‡
ÇÓ
Ê
GF1
ÔÕ
2
GF0
ÔÕ
1
PD
1 ÖA×$ØÙ$ÚÛÏF©ªNÜHÝ©ª$¬P«AÞß
0
IDL
½h¾
‡
.
.
ÑAàáâhã$ä
«Håæçèé$ê¤ .
$ÑHàá$âãä
áâí
ØÙ$Úë
ìH©ª(ÜHÝ©ª$¬P« CPU
«“åæ
¤NÜî{£h¥Aï
1 ÖAð ×$ѓ
ñ
$ÑHàó
áâ
í
ïhÁQò
ß
«HôõŠ‹Q©ö÷øù
¤
.
7
6
5
4
3
2
1
TF1
TR1
TF0
TR0
IE1
IT1
IE0
TF1
¡
ðPÑQñ
0
IT0
t$u
: TCON
žŸ
7
½h¾
›$œ
„…†


: 87h
.
v
3
Bit:
IDL
t$u
7
ûQü
0
1 ý‘þA½¾‘Ü“§
ð(ÑQñ
1 ýþ
Ñ
- 56 -
Ý
‡
Ó
1 Ê$˘åæNÿ
ðPÑQñ
: 88h
1 Áò$êh¤Â

W79E4051A/RA W79E2051A/RA
6
ð
TR1
5
ú
0
1
0
10
!
1
1 "#%$ '& ()
int 1, * IE1+
.-*& 0 .
01(*)
)
1) /
1
0
'
2
.. 0
1 *".#.$ & .(%)
INT 0 3*
.
*
&
%
IE0 +
0
1 01()
4)
0 ) /
0
TR0
3
IE1
2
IT1
1
IE0
0
IT0
56
ѓñ
‡
Áò
È
ÖHÝ
ý‘þA½¾‘Ü“§
Ñ
‡
$åæ
«AÝ
ѓñ
È
‡
ÖHÝ
hª
Ü
Áò
’
Ö
ÁQò
Ì
ª
Ü
Ö
Ï
ÌNÁ˜ò
«
Ì
HÒ
Ç(Ó
Ì(Ü
’
Ö
Ü
Ï
PÓ
h¬
(̦Á
Ì
0
GATE
C/T
M1
M0
GATE
C/T
M1
M0
TIMER0
t$u
: TMOD
¡
7 &
1
&
Ñ
8
8
4
M0
©ª
3
GATE
‡
1
0F
M1
*AB
5M06GH *AB
Ï
Ñ
1 ,
/
ÑQðPÑHñ
ÑAñ
/
8
0
1
0
I*J
©ª
©ª
©ª
hª
‡
Ñ
Ñ
«Ë

ðÑAñNHí
«
HðPÑAñN
‘Ö
í
hª
¤
Ñ
¤‘Ü
Î
A—
$’
8
8
‡
.-9 TRx: 9 int n @TRx
; int n <
%=*/8 >
& 0
?9 TRx E
/ AB & 0 'C
/
& 1 TXD
ÑHñ
ŒñN“í
Ζ
Œ
Ù¤
í
¤‘Ê“Ý
hª
¤
‡
Ñ
Ñ
‘Ö
«
ðÑAñNHí
HðPÑAñN
hª
í
«Ë

¤
¤‘Ü
Ñ
Î
A—
$’
‡
©ª

ð
Œñhã$ä
©ª
M1, M0:
M1
M0
¤
¤‘Ê“Ý
‡
$‡
&
ŒñN“í
í
Œ
Ù¤
©ª
C/ T
8
: 89h
.-9 TRx: 9 int n @TRx
; int n <
%=*/8 >
& 0
?9 TRx E
/ AB & 0 'C
/
& 1 TXD
ÑHñ
Ζ
Œñhã$ä
/
0F
*AB
*AB
7 &
Ï
ð
ð
1 ,
/
ÑQðPÑHñ
ÑAñ
M1
1
$¬
1
5
0
hÓ
2
C/ T
0
ÑHñ
3
ð
0
Ü
È
’
Hð

Áò$êh¤Â
‡
4
$‡
1
Ï
Ñ
ÑHñ
ðPÑQñ
5
GATE
2
’
Ö
ÇhÓ
Hð
6
žŸ
6
FÒ
[Ï
TIMER1
7
Ê$˘åæNÿ
‡
‡
Ý
Ó
Ð
‡
7
„…†

Ó
Ñ
Φþ
Ð
ÈÉ
ÌNÜ
åæ
‡
Ó
ÈÉ
Ê
Ï
½(¾{ÜhË
ò«“ÙڑÁQò
‡
{Ï
È
‡
Ý
ÊÆÇç
‡
Ó
Æ$Ç
Îþ
˜åæ
ÊÆÇç
‡
Ó
Ñ
ýþ
Ý
Æ$Ç
ð(јñ
½¾NÜË
ÙÚ(ÁQò
Ì
‡
«AÝ
›œ
ûQü
Bit:
ÁQò
ð
Ñ
$åæ
ðPÑQñ
TF0
4
1
0
0
ÁQò
:
0: 8-
‡hðÑHñ
1: 16-
‡hð
O
2: 8
‡
ÑHñ
THx Á
«
ó
LKM*N
KMN
5
‡‘
5
«Aß
3PQ
ß
Ê
‡N
hð
Ê
ѓñ
- 57 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
1
ú
1
ûQü
ñ
1 SR8T U
3:Nº
©ª
Õ
T0 ¼
‡
ðÑHñ
/
8
TL0
Ζ
9
v
Ê
ðÑAñ
ðÑAñ
1 V/
0
§
N
8
‡hðPѓñ
ª¬$è
ãä
/
8
Œ$ñ
Ê
9
v
TH0
ðPÑ
Ê
€
0
Bit:
7
6
5
4
3
2
1
TL0.7
TL0.6
TL0.5
TL0.4
TL0.3
TL0.2
TL0.1
„…†

ú
¡
ð
TL0.[7:0]
ûQü
TL0.0
W
u
: TL0
žŸ
7-0
0
ÑHñ
0
’$”•
: 8Ah
.
€
1
Bit:
7
6
5
4
3
2
1
TL1.7
TL1.6
TL1.5
TL1.4
TL1.3
TL1.2
TL1.1
„…†

ú
TL1.[7:0]
ûQü
TL1.0
W
u
: TL1
žŸ
7-0
0
¡
ð
ÑHñ
1
’$”•
: 8Bh
.
–$€
0
Bit:
7
6
5
4
3
2
1
TH0.7
TH0.6
TH0.5
TH0.4
TH0.3
TH0.2
TH0.1
„…†

ú
¡
ð
TH0.[7:0]
ûQü
TH0.0
W
u
: TH0
žŸ
7-0
0
ѓñ
0
—”•
: 8Ch
.
–$€
1
Bit:
7
6
5
4
3
2
1
TH1.7
TH1.6
TH1.5
TH1.4
TH1.3
TH1.2
TH1.1
„…†

X
û
Bit:
TH1.0
W
u
: TH1
žŸ
7-0
0
TH1.[7:0]
ð
¡
ѓñ
1
—”•
: 8Dh
.
›œ
7
6
5
4
3
2
1
0
-
-
-
T1M
T0M
-
-
-
„…†
: CKCON
- 58 -
W
u
: 8Eh
W79E4051A/RA W79E2051A/RA

žŸ
7~5
¡
ÄNÅ
ð
4
T1M
ѓñ
ð
ÑHñ
ð
ÑHñ
0:
1:
ð
3
T0M
ѓñ
0:
1:
2~0
ð
ÑHñ
ð
ÑHñ
ÑHà
1
1
AB
(Ö
$ÑHà
$ÑHà
ѓà
0
AB
1/6 ×$Ø
AB%&
AB%&
$ѓà
0
1/12 ×$Ø
ÑAà
ѓà
:
$ѓà
0
AB&
AB&
Ê
Ê
ѓà
1/12 ×$Ø
Ê
ÑAà
1/6 ×$Ø
Ê
ÄNÅ
X'Y*Z
û
1
$ü
Bit:
7
6
5
4
3
2
1
-
-
-
-
-
PWDEX1
PWDEX0
„…†

-
ÄNÅ
2
PWDEX1
ۑÏ
1
PWDEX0
ۑÏ
L
^
\
]
56
[
©ª
.
©ª
.
.
[ L\^] 56
_`
ba @c
INT0 or INT1 def g
0)
_`
0)
INT0 or INT1 de*f g
h!i _`
.
0
)
INT0 or INT1 de*f g
:
PWDEX1 PWDEX0
0
™
0
ÛNÏ©ª
º
Ã
‘¼
’
Ó
0
1
ÛNÏ©ª
º
jlk
x
’
Ï
hÌ
Ï
hÌ
.
’
1
7
6
5
4
3
2
1
P1.7
P1.6
P1.5
P1.4
P1.3
P1.2
P1.1
„…†
m
P1.7-0:
r Ln xwy z*D
ÔÕ

.
hÌ
ۑÏF©ª
hÓ
Bit:
Nþ
Ï
¼
hÓ
1
: 8Fh
.
ÄNÅ
™
u
¡
7-5
0
-
W
: CLDREG
ž$Ÿ
0
¥
Œ”
«
žŸ
m
o'p
/ @n
{
: P1
Ú
þ
Õ
hÐ
Š
‹
¥Ê
P1.0
W : 90h
q C
r - t%u - v
u
q C ŒŽ
0
n
hôµ
rs
[¥JÙ¤
ä
«A§
AŽ
Á
$¬(Ö
¡
- 59 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
1
0
5|2}~
P1.1
P1.0
X
$ü(û
Bit:
›œ
7
6
5
4
3
2
1
ENCLK
-
-
-
-
CPCK2
CPCK1
„…†

AN1+
AN0-
: ACCK
žŸ
7
6-3
-
2
CPCK2
1
CPCK1
0
CPCK0
¡
N
ENCLK
1:
&
ÄNÅ
€
€
}~ !‚ƒ^„%…†‡
€
XTAL2
¢h‹
¯
D
1/4 CPU
ÑHà
(P2.0)
m
ѓà
Bit:
: 96h
þ$«
.
¬$²
.
¬$²
.
¬$²
.
:
CPCK2
&
CPCK0
u
.
ü
Š‹2ŒŽ
W
0
CPCK 1
CPCK 0
„…
ˆ‰
0
0
0
(4/FDB)*2
0
0
1
(4/FDB)*4
0
1
0
(4/FDB)*8
0
1
1
(4/FDB)*16
1
0
0
(4/FDB)*32
1
0
1
(4/FDB)*64
1
1
0
(4/FDB)*128
‘’%“”
Ž
7
6
5
4
3
2
1
0
-
-
CIPE
CF
CEN
CM2
CM1
CM0
•–— : ACSR
˜™ : 97h
š ›œ
'
 ž
Ÿ .
7-6 ¡%¢.£4¤¥§¦ ¨%© & ª^«4¬­^® .
5
CIPE
0: ¯° £0¤¥ ( ±² )
1: ¡¢.£0¤¥³¦ ¨%© & ª´«0¬­ ®
£0¤¥!µ¶·¸¹ . º CM[2:0] & CEN » ¹!¼'½x¾¿ » ¹ . À ¹ÁÂ2½4ÿÄ!Å
4
CF
µ¶*¡¢ /¯°ÆÇÈÉ /Ä'Å IE.6
- 60 -
.
W79E4051A/RA W79E2051A/RA
3
CEN
2
CM2
1
CM1
0
CM0
ŒŽ^ÍÎ*ŠÏ †‡
ÝÞlß
Bit:
¡%¢.£4¤¥
ÊËÌ .
ÊËÌ .
ÊËÌ .
:
CM2
CM1
CM0
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
ÍÎ*ŠÏ
Ð*Ñ
ÒÓÔ
ÕÖ×Ø*ÙÚ
ÒÓÔ×ØÙÚ
Ë.Û@Ô
ÕÖ
Ë.Û@Ô×ØÙÚ
ÜÑ
‘’
7
6
5
4
3
2
1
0
SM0/FE
SM1
SM2
REN
TB8
RB8
TI
RI
•–— : SCON
š
›œ
'àál
ž â
7
.
SM0/FE
6
SM1
5
SM2
4
REN
3
TB8
˜™
: 98h
0 ¼ ¬­ 0 ã Ö¹%äåæç·¸¹´è PCON éêë ¢ì*í¥^µî SMOD0 ¹'ï
É À ¹´î ë ¢!èËðñ'òó SM0 î@ô á ë ¢!è ºõ%ö åæç·%¸÷¼ À ¹2î » ¹
Ìà0áÿ
øùâ úûü!î@ý ° ¹^è À ¹ÁÂ2½0ÿþÄ.Å
¬­ ¹ Š1Ï
÷
î 4ä 12 ù
8
Ú
10
÷
î 64ä 32 ù
11
Æã Öè À ¹ » 1 ¼*¡'¢ 11¬­ 2¬­ 3 Ë!Ú î Æë ¢%è ¬­ 2ä 3
Ë!¼Ê SM2 » 1 ¼"!# $
%.î& '¹() RB8 * 0 î
+ ¼ RI ,ñ » ¹^è ¬­ 1
ËÊ SM2 » 1à¼"áÿ!-â #
. /0$%/%ü^îý ° à0¹ áÿ1 â RI * , ñ » ¹´î%è ¬%­ 0Ë!¼
¹
Ö
2
î
"
÷
^
è
Ê
Ä
"
¼
!
#
î
÷
ã
5 è
SM2
0
67 3
489 · : 8052; < èÊ À ¹ » 1 ¼!-# àLálâ î*÷3 4 *÷3
4 î ÷12´
î 4
5 ¼ 6
7 8=
>?@à0Æ
ál â î@A
B
C $*¡%¢¼ » 1 ÷"D
E
C $ ë ¢¼F GIH Àë ¢
N î&' ¹
(^) è@ÿ PORQ ) ST
À ¹ » 1äÄ 0
¬­ 2J 3 µKLM^
SM0
0
0
1
1
SM1
0 0
1 1
0 2
1 3
- 61 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
2
RB8
1
TI
ÝÞ
Bit:
_
`
Ë ¼U SM2=0 RB8 * C $%!îLý ° ¹^è
¬­ 2J 3 µ C $%'î&'¹ ()^è ¬­ 1!
¬ ­ 0Ë À ¹û V
W
MN´µ*¶*·%¸IX ¬­ 0 Ë À ·%¸ÿ½4¾¿ M NY 8¹ ( )Z » ¹^¼[ \ ] ¬­ Ë
à0á M
N%*ý ° ¹!îE^÷ » ¹^è À ¹Á Â2½4ÿþÄ.Å
Ž
7
6
5
4
3
2
1
0
SBUF.7
SBUF.6
SBUF.5
SBUF.4
SBUF.3
SBUF.2
SBUF.1
SBUF.0
•–— : SBUF
˜™ : 99h
š
›œ
 0à ž áÿâ
'
7~0 SBUF
C $*ä
M
N!î(
)a
b 6 'ú ìí¥^µèc-d@Ò À˜á™j
Òk / 2
ú e
fî à8á ¹
ìí¥^èLùú õ g C $()¼@ùú õ g MN ()^è@h
]i
ö ñ C $
()!¼ h
]
i álmk ö M
N à0á ( )
n ß
2
Bit:
7
6
5
4
3
2
1
0
-
-
-
-
-
-
P2.1
P2.0
•–— : P2
š ›œ
7-2
-
1
P2.1
0
P2.0
'ž
Ÿ XTAL1
Ž
XTAL2
J
÷
oIpq"r
CLK
˜™
: A0h
.
oIpmqrs õ
AUX
'ž“”
Bit:
7
6
5
4
3
2
1
0
BOF
BOD
BOI
LPBOV
SRST
BOV1
BOV0
BOS
1
•–— : AUXR1
š
›œ
'ž
7
BOF
6
BOD
5
BOI
4
LPBOV
0:
1:
Ã*¿Ä
t
º M uÒ « s¹wv"xys*¹0vxy^µ¶%÷@¾¿ » ¹^è
x
y
z
{ :
0: |m} x
y
z{ ë ¢ .
« € .
1: ¯° x
y
z{ ë ¢%¼~  R
x
y µ¶ :
{ µ¶ ë ¢ .
0: ¯° x
y
z
!
x yz
{ ë ¢%µ¶
1: ¯° x
y
z{0q0s¹!¼ |} «R€ x
y
z
{ ã Ö :
- 62 -
.
˜™
: A2h
W79E4051A/RA W79E2051A/RA
‡
ˆ º è BODL |} ¼û ‚
% Ü
ƒ ¬­
„ * ª´«0¬­ "¼ x
yz{ ë ¢*ù
…† g D E
"¼ GIH@Œ S 960/f , , Ž
1: º BOD=0 ¼"‰
Š!îxyz{ SK^î « y-‹ 64/f
O ~  15/16 x
y «@ .
ÿ s ¹ :
À ¹
 TA(Time Accessed) Ÿ
‘
s ¹ ’“ .
1: ¾¿
x
y « y”
• ¹ :
(BOV1,BOV0) (CBOV1,CBOV0)
BOV.1
BOV.0 –
—™˜@—
x
y « y 2.4V
0
0
x
y « y 2.7V
0
1
x
y « y 3.8V
1
0
x
y « y 4.5V
1
1
j
‡
ˆ
x
y ¹ (š )
0: V ›g V
1: V œg V
0:
BRC
3
SRST
2~1
BOV1,
BOV0
0
BOS
Ž
DD
BOR+
DD
BOR-
BRC
AUX
'ž“”
Bit:
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
DPS
2
•–— : AUXR2
š ›œ
'ž
Ÿ
7-1  0
DPS
ÍÎ
¡
Bit:
()žŸ
”
•
0: ”• DPTR ¦S·:
1: ”• DPTR1
8051
®
˜™
: A3h
.
7
6
5
4
3
2
1
0
EA
EC
-
ES
ET1
EX1
ET0
EX0
•–— : IE
š ›œ
7
EA
6
EC
5
-
'ž
¢
£µ¶ | } . |} /¯°
¤ /
¡%¢ ¬¥ 0£ ¤¥µ¶ t.
Ÿ ˜™
: A8h
.
.
- 63 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
| } à4á¦ÿâ µ¶
|}É ÷@¥ 1 µ¶ .
|}§
¨ µ¶ 1.
|} É ÷@¥ 0 µ¶ .
|}§
¨ µ¶ 0.
4
ES
3
ET1
2
EX1
1
ET0
0
EX0
Bit:
7
6
5
4
3
2
1
0
SADDR.7
SADDR.6
SADDR.5
SADDR.4
SADDR.3
SADDR.2
SADDR.1
SADDR.0
©
ª«¬
•–— : SADDR
š ›œ
'ž
7~0
n ß
Bit:
SADDR
µ­ º l® Æ ÷î@¯° ˜™ ä *± ˜™
SADDR
7
6
5
4
3
2
1
0
P3.7
CMP_O
P3.5
P3.4
P3.3
P3.2
P3.1
P3.0
â õ ë ¢ÊË*Ì
P3.7-0: Æõ I/O . s š ›œ
'ž
: P3
P3.7
6
CMP_O
5
P3.5
4
P3.4
3
P3.3
INT1
2
P3.2
INT0
1
0
P3.1
P3.0
TX
RX
ß µ¸·
¹ ŠÏ
n ¶
:
˜™
: B0h
š j . À ¹í
²^£0¤¥^î³I´
T1 ä PWM oIp
7
-
T0
1
7
6
5
4
3
2
1
0
-
-
-
-
-
-
P1M1.1
P1M1.0
•–— : P1M1
š ›œ
'ž
7-2 Ÿ! 1
: A9h
3
•–—
Bit:
˜™
P1M1.1
0: P1.1
1: P1.1
:
Eº™¬» ­ . (± ²
¬­
)
- 64 -
˜™
: B3h
W79E4051A/RA W79E2051A/RA
0
Eº™
¬» ­ . (±²

:
¬ ­
1: P1.0
P1M1.0
ÍÎ
¼½¾¿
Bit:
0: P1.0
0
7
6
5
4
3
2
1
0
-
PCH
-
PSH
PT1H
PX1H
PT0H
PX0H
•–— : IP0H
š ›œ
'
 ž
Ÿ 7
6
PCH
5
-
4
PSH
3
PT1H
2
PX1H
1
PT0H
0
PX0H
ÍÎm½0¾
Bit:
¡¢ ¬
¥ £4¤¥µ¶
‹À ›
Ÿ . à%âÂÁ
µ¶
‹À › .
1: ¡¢
÷ ÃÅÄ µ¶‹mÀ › .
1: ¡¢ É "
¶ Á ĸ‹À › .
1: ¡¢ §
¨ µÆ
÷ à µÁ ¶ ‹mÀ ›
1: ¡¢ É "
‹À › .
1: ¡¢ §
¨ µ¶
1:
˜™
: B7h
.
0
7
6
-
7
-
6
PC
5
-
4
PS
3
PT1
2
PX1
1
PT0
0
PX0
5
PC
•–— : IP0
š ›œ
4
-
3
PS
'ž j
Ÿ ¼ À ¹‹ › ´
1: ¡¢ ¬
¥ £4¤¥µ¶
‹¤ ›
Ÿ . j à%À â¹Á ‹ › ´
µ¶
‹*¤ › .
1: ¡¢
÷ ÃÅÄ µ
¶ ‹¤ › .
1: ¡¢ É "
¶ Á ĸ‹*¤ › .
1: ¡¢ §
¨ µÆ
÷ à µÁ ¶ ‹¤ ›
1: ¡¢ É "
¡
¢
µ
¶
*
‹
¤ › .
§
¨
1:
©
ª «¬ÇÈ ¡
Bit:
)
2
PT1
1
PX1
0
PT0
˜™
: B8h
.
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
•–—
PX0
: SADEN
- 65 -
˜™
: B9h
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
š
›œ
7~0
NVM
SADEN
«¬
Bit:
'ž
À ìí¥¡%¢ à%â 0 î™ÉËÊ ˜™Ì
Íë ¢¼ º SADEN
» ‹ 1 ¼!#
á £µ¤!î@èLÎʹ L SADEN.n
L È ‹
SADDR ìí¥!µîÏ
­¹ñ C $%
%.î"()i
¼0 ! # 34 ñÐÑh À ¹^î£0¤^èLÊ SADEN ‹m¢ 0 ¼! #h g¤ /^î ˜™ Ò
3
4 a*
ñ Ó-u'µ¶.è
7
6
5
4
3
2
1
0
NVMADD
R.7
NVMADD
R.6
NVMADD
R.5
NVMADD
R.4
NVMADD
R.3
NVMADD
R.2
NVMADD
R.1
NVMADD
R.0
•–— : NVMADDRL
š
›œ
'
 ž
Á ‹
7
NVMADDR.7
6~0
ÚÂÛ „
Bit:
NVMADDR.[6:0]
‘“*”
Ž
: C6h
0.
˜™ :
ìí¥· Ì ‹“PÔÖÕ
יÔ4í ¨ØœÙ ~ ˜™ NVM ()í²¥
NVM
.
7
6
5
4
3
2
1
0
TA.7
TA.6
TA.5
TA.4
TA.3
TA.2
TA.1
TA.0
•–— : TA
š ›œ
7-0
˜™
TA.[7:0]
%ž
˜™
: C7h
ÜÝ ÷ ã ìí¥ :
ÜPÝ ÷ ãl®ìí¥ õg*ã Ö
hŸ‘l¹® î ÜPÝ è K P
Ü Ý L Ÿ‘î¹! ¼ õ
Þ ßà K » TA
ìí¥
ä å 3ú ¥æ
Ãî*÷ Ø-O å
AAH ¼áZfIâ"ã
55H ¼ Z 3
4 õ
Þ ÜPÝ LŸ
‘^îL¹!è
NVM
‘’
Bit:
7
6
5
4
3
2
1
0
EER
EWR
-
-
-
-
-
-
•–— : NVMCON
š ›œ
%ž
7
EER
6
EWR
˜™
: CEh
çè Ź
, è Å ç
è Å ç è NVM()í
²¥
/Åé ú ç ¼ê ç
ëì ‹íÄmî Ù ~^è ÆÇ
ò À ž
ó^î"ômìõ´íè@¥
”
ö
• ž
ç ó-Z.ôm¼õ ÈZ
Éï
À ð
¹ ž
Z.Ÿ
¼ À ÷ ç á Ëñù
LøÄ.ž
ÅóI¼´ ïðž
Ÿ
ññ
l ¹
NVM ()
l NVM () .
0: ,
NVM
0:
NVM
1:
NVM
NVMADDR
- 66 -
W79E4051A/RA W79E2051A/RA
1:
5-0
-
NVM
Bit:
Ÿ ùú ¹ È» ‹ ’1’ » NVM l ùú Ù á ~ î(
)^èRïð
žŸññ ò À žóîômõè
öž
ó-ômõ Z
ï ðžŸ
÷ Ë ù
øžóè
.
7
6
5
4
3
2
1
0
NVMDAT.
7
NVMDAT.
6
NVMDAT.
5
NVMDAT.
4
NVMDAT
3
NVMDAT.
2
NVMDAT.
1
NVMDAT.
0
•–— : NVMDATA
š
›œ
'
l ž
j
7~0 NVMDATA[7:0]
NVM ()'ìí¥!¼
ûü  ý
Bit:
NVM
()¡ õ
MOVC
ž
ó
˜™
: CFh
.
7
6
5
4
3
2
1
0
CY
AC
F0
RS1
RS0
OV
F1
P
•–—
š ›œ
: PSW
˜™
: D0h
'
 ž
i¹·¸wX º ALUi á
þÿ ôþ þ Óumi¹ä¹!÷ » ¹
• i¹·¸wX ›Ù ~ô Óumi¹ä¹.÷ » ¹
6
AC
5
F0
õ
Þ ·¸ 0 X õ Þ
PO ¡ õ î Æõ ·¸*¹
4
RS1
ìí¥ ”
•¹
3
RS0
ìí¥ ”
•¹
p·¸ : ö ‹*ùú à k ö ¼ º &¹
[ , * &
¹
Óumi¹÷ À ·¸L È »
2
OV
1
F1
õ
Þ ·¸ 1: õ ÞO ¡ õ î Æõ ·¸¹
v·¸¹^è%½x¾¿ ã 0
P
Ö \ » ¹ 9 s¹^è õ
g Ìø = ¥µ “1” î"( ( „ * (
Ž †‡ š
RS.1-0: “*”
:
Ž «¬
RS1
RS0
“”
7
CY
Ž ¼ š
Ž
PWM “ ”
Bit:
7
6
0
0
1
1
0
1
0
1
5
0
1
2
3
00-07h
08-0Fh
10-17h
18-1Fh
4
3
- 67 -
2
1
0
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
-
-
-
•–— : PWMPH
š
›œ
'
 ž
7-2 Ÿ 1-0
PWMP.[9:8]
¼ š Ž
*
“ ”
PWM 0
Bit:
PWM
(*¥%ìí¥!î
.
2
1
0
-
-
-
-
-
-
PWM0.9
PWM0.8
Ž
PWM 0
ìí¥
9~8
¹
˜™
: D2h
.
3
7
6
5
4
3
2
1
0
-
-
-
PWM0OE
-
-
FP1
FP0
˜™
: PWMCON3
'ž
PWM0
PWM0OE
3~2
-
1~0
FP1~0
Bit:
: D1h
3
7
6
5
"!
˜™
PWMP.8
4
•–—
š
›œ
4
PWMP.9
5
‘’'“*”
Bit:
¹
-
6
PWM0.9~8
PWM
9~8
-
7
•–— : PWM0H
š
›œ
'ž
7~2 Ÿ 1~0
-
oIp@¡%¢¹
.
o p.
0: ¯°
PWM0 I
1: ¡%¢
PWM0 oIp . º P3.5 ÈÉ ‹ › ÷´ PWM0 ÆÇ
Ÿ .
• ¹ . º PWMRUN=1, ¡%¢´
PWM 5 ”
FP[1:0]
00
01
10
11
: D7h
†‡ š
FP1~0: PWM P3.5
oIp
.
:
Fpwm
FOSC
FOSC/2
FOSC/4
FOSC/16
‘’
7
6
5
4
3
- 68 -
2
1
0
W79E4051A/RA W79E2051A/RA
WDRUN
•–—
š ›œ
7
-
WD1
WD0
WDIF
WTRF
EWRST
: WDCON
'ž
WDRUN
0:
1:
#%$'& ý °á
#%$'& ô
˜™
WDCLR
: D8h
.
5~4 WD1~WD0 #%$& É ÷@¥
”
• .
#%$&É ÷@¥µ¶·¸wX
Ê #($"& µ¶*¡%¢¼¾¿ñ
À ¹ » 1 Ìø #$'&É ÷@¥µ¶Óu.èLÊ #$&
3
WDIF
É ÷@¥µ¶GIH¼!# À ¹^î » ¹Ìø #($"&É ÷@¥)*+!÷è À ¹ÁÂ2½4ÿ
þ
Ä t
#%$& ÷@¥, É ·¸
¥ s
¹ Z » ¹^è À ¹ õ þ. Í s¹^î/10.èLÿ O j2 À ¹!¼3
º-#%$'&É ÷@
2
WTRF
ÁÂ
4 ÊÄ.Å%è ª^« s*¹
ñ Ž ¹Ä!ÅèÊ EWT 5 0 ¼ À ¹,ñ
 #$&É ÷
¥î617
¥ s¹ .
0: ¯°#%$&É ÷L1
EWRST
¥ s¹ .
1: |}#%$&É ÷L&É ÷@¥Ä ’0’
¥ s¹è À ¹ õg Ä.Å #%$&É ÷@¥8
]-s¹è À ¹
WDCON.0 – #%$&É ÷
0
WDCLR
ñ É Ê
Ä t!¼ ÿ » À ¹ lm® 1Z!¼ 34 ñ É Ê
] » 0 èLÊ #%$& ÷¥, É
¡%¢¼ ! #ÿÁ
 #%$"&É ÷@¥ pZ 512ú!÷ æÃPÔÖ #%$'&É ÷@¥Ä
t!"¼ F
ñ Ó-u*ù*ú #%$"&É ÷@-¥ s¹
¹ Z.î
9 ³ * 0x0000x0B è WTRF (WDCON.2) L È*» ’1’ *:#$'&É ÷@¥
éêë ¢ìí¥ WDCONs
s¹!¼L È» ’0’ * Ò « s¹^è WDIF (WDCON.3)§
¨ s
¹ , ú Ú´è0Ò « s¹!÷ PORL È» ’1’ è0Ò « s
¹!÷ EWRST l(WDCON.1)
î EWRST, WDIFJ
k ö  TAì*L íÈ¥ » ã ’0’Ö("¼ ; \
\
]]s*¹ ¹ ,
,
 ã 61Ö!7%¼è <é= êj
ë k ¢*ö ì,í ¥ ã WDCON
Ö´è->?:@AB TA ìí¥
WDCLR ¹î
î@òó^è
6
-
TA
WDCON
MOV
MOV
SETB
ORL
MOV
MOV
ORL
PWM
Bit:
ŽC š
Ž
“ ”
7
6
REG
C7H
REG
D8H
TA, #AAH
TA, #55H
WDCON.0
WDCON, #00110000B
TA, #AAH
TA, #55H
WDCON, #00000010B
5
4
; To access protected bits
; Reset watchdog timer
; Select 26 bits watchdog timer
; Enable watchdog
3
- 69 -
2
1
0
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
PWMP.7
PWMP.6
PWMP.5
PWP.4
•–— : PWMPL
š
›œ
'ž
7~0 PWMP
C š
Ž PWM (¥!î œ ¹%ì*í¥
“*”
PWM 0
Bit:
7
2
1
0
PWM0.7
PWM0.6
PWM0.5
PWM0.4
PWM0.3
PWM0.2
PWM0.1
PWM0.1
: PWM0L
Ž
'ž
PWM 0
œ ¹%ìí¥
˜™
: DAh
..
1
7
6
5
4
3
2
1
0
PWMRUN
Load
PWMF
CLRPWM
-
-
-
PWM0I
˜™
: PWMCON1
Name
PWMRUN
Load
5
PWMF
4
CLRPWM
3~1
-
0
PWM0I
G:HŽ
: DCh
Function
./ô á .á
( ¥ô
1: PWM 0: PWMP ìí¥î³´£4¤¥ ,ñLDE % (¥ J
» Ë pZ'¼ PWMPìí¥!î³
ñD
1: (¥
¾¿Ä ’0’ è
»
PWM Ë pL·
:¹ .
0: ./ p .
» Ë p (Óu PWM µ¶F@T%¼
1: PWM 10 ¹ (*¥
Ä PWM ( ¥
Ä
( ¥‹ 000H.
1:
PWM 10 ¹ *
Z ½4¾¿ É Ê Ä.Å .
» ¹´
Ÿ 0: PWM0 ÜmÏ
oIp .
1: PWM0 ØÏ
oIp .
0: PWM
®£4¤ ¥%(ì¥íì*¥íµ¥!; ¼Ëùú æ
Ã
º
PWM
µ¶*¡%¢
).
7
6
5
4
3
2
1
0
ACC.7
ACC.6
ACC.5
ACC.4
ACC.3
ACC.2
ACC.1
ACC.0
•–—
š ›œ
7-0
.r.
3
6
Bit:
: D9h
4
•–—
Bit
˜™
PWMP.1
5
‘’%“”
Bit:
PWMP.1
6
PWM0
PWM
PWMP.2
7
•–—
š
›œ
7~0
PWMP.3
: ACC
ACC
'ž
ìí¥ * ·
:
8052
îI = ¥
.
- 70 -
˜™
: E0h
W79E4051A/RA W79E2051A/RA
ÍÎ
¡
Bit:
“*”
Ž
1
7
6
5
4
3
2
1
0
-
EBOV
EPWM
EWDI
-
-
-
-
•–— : EIE
š ›œ
'
 ž
Ÿ .
7
6
EBOV
0: ¯° x
y!µ¶0´
¢ x
y!µ¶ .
1: ¡%
5
EPWM
0: ¯° PWM Ë µ¶ .
1: ¡¢ PWM Ë µ¶ .
4
EWDI
0: ¯°#%$&É ÷@¥^µ¶
1: ¡¢ #%$&É ÷@¥^µ¶
Ÿ .
3-0 Ž
B “”
Bit:
.
.
6
5
4
3
2
1
0
B.7
B.6
B.5
B.4
B.3
B.2
B.1
B.0
:B
B
n ß ŒŽKLMN
Bit:
: E8h
7
•–—
š ›œ
7-0
˜™
'ž
J ìí¥ * ·
:
8052
µî • = ¥
˜™
: F0h
.
7
6
5
4
3
2
1
0
-
-
-
-
-
-
Bit1
Bit0
•–—
š ›œ
: PCMPIDS
7-2
-
1
PCMPIDS.1
0
PCMPIDS.0
ÍÎ
¼½¾
'ž
Ÿ ˜™
: F6h
¯° ( Ù o ® ¹ . ®
¬ ¥ o ).
0: ±² ( |m} ( Ù / ®
1: ¯° ( Ù o
1( Ð*Ñ )
®
¹ . ®
P1.0¯° ( Ù o
(
Ù /
¬ ¥ o ).
0: ±²
( |}
®
1: ¯° ( Ù o
1( ÜÑ )
P1.1
1
- 71 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Bit:
7
6
5
4
3
2
1
0
-
PBOVH
PPWMH
PWDIH
-
-
-
-
•–— : IP1H
š
›œ
'
 ž
Ÿ 7
-
˜™
: F7h
.
È» x
yµ¶
‹mÀ ›FOàP .
1: È» PWM ÕÖµ¶ P:O àP À › ´
1: È»#%$& µ¶ àP À › ´
Ÿ .
6
PBOVH
5
PPWMH
4
PWDIH
3-0
-
Bit:
7
6
5
4
3
2
1
0
-
PBOV
PPWM
PWDI
-
-
-
-
QR ÍÎ"½¾¿
•–— : IP1
š ›œ
7
-
6
PBOV
5
PPWM
4
PWDI
3-0
-
1:
'ž
Ÿ ˜™
: F8h
.
È» x
yµ¶ OàS ¤ › .
1: È» µ¶ O àS ¤ ›
1: È»#%$& µ¶ O àS ¤ ›
Ÿ .
1:
.
.
TVU
á 8032 ? 3:X †:Y¥^µî ¤ /^îž
óèž
óî ë ¢¼"h·¸¹ ‡ˆ ¹î-617
W79E4051/2051 3W ÷
Y¢ 9 · : 8032 †Y*¥^îž
óÏ è3 * ž
óî÷ðí
Z Í ;[K * / 2ú\  ¼&ù
3W ê 4ú÷ æ
Ë*ù*ú ¥æ
2 Ã.¼"[·
: 8032ê 12ú!÷ æà ‹ùúÑ2 \æ
Ãè
W79E4051/2051
] § W79E4051/2051
3W êú ¥æ
à š / ù*ú Ê ö ¼[2·: 8032 êú ¥ æ
Ã/ 2ú Ê ö è
3W î O^ g ½ g êú ¥
æà š /ùú Ê ö ¼ Ž h ë (ž
óþ_\ ¥æ
W79E4051/2051
Ãe
( J ]^î k ö (
(` Ï Rè [
h g Ùa Jb2 õ ž
ó!ò ¼ñc = ùú
ž
óæ
à õ™O' þd îï
𠘙 è ±
?Òþ_%¼ W79E4051/2051 3W fw
g ?¨ J ñ î æ
Ã.¼  [ä ›0?"34 îü è
24
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
NOP
00
1
1
4
12
3
- 72 -
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
ADD A, R0
28
1
1
4
12
3
ADD A, R1
29
1
1
4
12
3
ADD A, R2
2A
1
1
4
12
3
ADD A, R3
2B
1
1
4
12
3
ADD A, R4
2C
1
1
4
12
3
ADD A, R5
2D
1
1
4
12
3
ADD A, R6
2E
1
1
4
12
3
ADD A, R7
2F
1
1
4
12
3
ADD A, @R0
26
1
1
4
12
3
ADD A, @R1
27
1
1
4
12
3
ADD A, direct
25
2
2
8
12
1.5
ADD A, #data
24
2
2
8
12
1.5
ADDC A, R0
38
1
1
4
12
3
ADDC A, R1
39
1
1
4
12
3
ADDC A, R2
3A
1
1
4
12
3
ADDC A, R3
3B
1
1
4
12
3
ADDC A, R4
3C
1
1
4
12
3
ADDC A, R5
3D
1
1
4
12
3
ADDC A, R6
3E
1
1
4
12
3
ADDC A, R7
3F
1
1
4
12
3
ADDC A, @R0
36
1
1
4
12
3
ADDC A, @R1
37
1
1
4
12
3
ADDC A, direct
35
2
2
8
12
1.5
ADDC A, #data
34
2
2
8
12
1.5
SUBB A, R0
98
1
1
4
12
3
SUBB A, R1
99
1
1
4
12
3
SUBB A, R2
9A
1
1
4
12
3
SUBB A, R3
9B
1
1
4
12
3
SUBB A, R4
9C
1
1
4
12
3
SUBB A, R5
9D
1
1
4
12
3
SUBB A, R6
9E
1
1
4
12
3
SUBB A, R7
9F
1
1
4
12
3
SUBB A, @R0
96
1
1
4
12
3
- 73 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
SUBB A, @R1
97
1
1
4
12
3
SUBB A, direct
95
2
2
8
12
1.5
SUBB A, #data
94
2
2
8
12
1.5
INC A
04
1
1
4
12
3
INC R0
08
1
1
4
12
3
INC R1
09
1
1
4
12
3
INC R2
0A
1
1
4
12
3
INC R3
0B
1
1
4
12
3
INC R4
0C
1
1
4
12
3
INC R5
0D
1
1
4
12
3
INC R6
0E
1
1
4
12
3
INC R7
0F
1
1
4
12
3
INC @R0
06
1
1
4
12
3
INC @R1
07
1
1
4
12
3
INC direct
05
2
2
8
12
1.5
INC DPTR
A3
1
2
8
24
3
DEC A
14
1
1
4
12
3
DEC R0
18
1
1
4
12
3
DEC R1
19
1
1
4
12
3
DEC R2
1A
1
1
4
12
3
DEC R3
1B
1
1
4
12
3
DEC R4
1C
1
1
4
12
3
DEC R5
1D
1
1
4
12
3
DEC R6
1E
1
1
4
12
3
DEC R7
1F
1
1
4
12
3
DEC @R0
16
1
1
4
12
3
DEC @R1
17
1
1
4
12
3
DEC direct
15
2
2
8
12
1.5
MUL AB
A4
1
5
20
48
2.4
DIV AB
84
1
5
20
48
2.4
DA A
D4
1
1
4
12
3
ANL A, R0
58
1
1
4
12
3
ANL A, R1
59
1
1
4
12
3
- 74 -
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
ANL A, R2
5A
1
1
4
12
3
ANL A, R3
5B
1
1
4
12
3
ANL A, R4
5C
1
1
4
12
3
ANL A, R5
5D
1
1
4
12
3
ANL A, R6
5E
1
1
4
12
3
ANL A, R7
5F
1
1
4
12
3
ANL A, @R0
56
1
1
4
12
3
ANL A, @R1
57
1
1
4
12
3
ANL A, direct
55
2
2
8
12
1.5
ANL A, #data
54
2
2
8
12
1.5
ANL direct, A
52
2
2
8
12
1.5
ANL direct, #data
53
3
3
12
24
2
ORL A, R0
48
1
1
4
12
3
ORL A, R1
49
1
1
4
12
3
ORL A, R2
4A
1
1
4
12
3
ORL A, R3
4B
1
1
4
12
3
ORL A, R4
4C
1
1
4
12
3
ORL A, R5
4D
1
1
4
12
3
ORL A, R6
4E
1
1
4
12
3
ORL A, R7
4F
1
1
4
12
3
ORL A, @R0
46
1
1
4
12
3
ORL A, @R1
47
1
1
4
12
3
ORL A, direct
45
2
2
8
12
1.5
ORL A, #data
44
2
2
8
12
1.5
ORL direct, A
42
2
2
8
12
1.5
ORL direct, #data
43
3
3
12
24
2
XRL A, R0
68
1
1
4
12
3
XRL A, R1
69
1
1
4
12
3
XRL A, R2
6A
1
1
4
12
3
XRL A, R3
6B
1
1
4
12
3
XRL A, R4
6C
1
1
4
12
3
XRL A, R5
6D
1
1
4
12
3
XRL A, R6
6E
1
1
4
12
3
- 75 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
XRL A, R7
6F
1
1
4
12
3
XRL A, @R0
66
1
1
4
12
3
XRL A, @R1
67
1
1
4
12
3
XRL A, direct
65
2
2
8
12
1.5
XRL A, #data
64
2
2
8
12
1.5
XRL direct, A
62
2
2
8
12
1.5
XRL direct, #data
63
3
3
12
24
2
CLR A
E4
1
1
4
12
3
CPL A
F4
1
1
4
12
3
RL A
23
1
1
4
12
3
RLC A
33
1
1
4
12
3
RR A
03
1
1
4
12
3
RRC A
13
1
1
4
12
3
SWAP A
C4
1
1
4
12
3
MOV A, R0
E8
1
1
4
12
3
MOV A, R1
E9
1
1
4
12
3
MOV A, R2
EA
1
1
4
12
3
MOV A, R3
EB
1
1
4
12
3
MOV A, R4
EC
1
1
4
12
3
MOV A, R5
ED
1
1
4
12
3
MOV A, R6
EE
1
1
4
12
3
MOV A, R7
EF
1
1
4
12
3
MOV A, @R0
E6
1
1
4
12
3
MOV A, @R1
E7
1
1
4
12
3
MOV A, direct
E5
2
2
8
12
1.5
MOV A, #data
74
2
2
8
12
1.5
MOV R0, A
F8
1
1
4
12
3
MOV R1, A
F9
1
1
4
12
3
MOV R2, A
FA
1
1
4
12
3
MOV R3, A
FB
1
1
4
12
3
MOV R4, A
FC
1
1
4
12
3
MOV R5, A
FD
1
1
4
12
3
MOV R6, A
FE
1
1
4
12
3
- 76 -
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
MOV R7, A
FF
1
1
4
12
3
MOV R0, direct
A8
2
2
8
12
1.5
MOV R1, direct
A9
2
2
8
12
1.5
MOV R2, direct
AA
2
2
8
12
1.5
MOV R3, direct
AB
2
2
8
12
1.5
MOV R4, direct
AC
2
2
8
12
1.5
MOV R5, direct
AD
2
2
8
12
1.5
MOV R6, direct
AE
2
2
8
12
1.5
MOV R7, direct
AF
2
2
8
12
1.5
MOV R0, #data
78
2
2
8
12
1.5
MOV R1, #data
79
2
2
8
12
1.5
MOV R2, #data
7A
2
2
8
12
1.5
MOV R3, #data
7B
2
2
8
12
1.5
MOV R4, #data
7C
2
2
8
12
1.5
MOV R5, #data
7D
2
2
8
12
1.5
MOV R6, #data
7E
2
2
8
12
1.5
MOV R7, #data
7F
2
2
8
12
1.5
MOV @R0, A
F6
1
1
4
12
3
MOV @R1, A
F7
1
1
4
12
3
MOV @R0, direct
A6
2
2
8
12
1.5
MOV @R1, direct
A7
2
2
8
12
1.5
MOV @R0, #data
76
2
2
8
12
1.5
MOV @R1, #data
77
2
2
8
12
1.5
MOV direct, A
F5
2
2
8
12
1.5
MOV direct, R0
88
2
2
8
12
1.5
MOV direct, R1
89
2
2
8
12
1.5
MOV direct, R2
8A
2
2
8
12
1.5
MOV direct, R3
8B
2
2
8
12
1.5
MOV direct, R4
8C
2
2
8
12
1.5
MOV direct, R5
8D
2
2
8
12
1.5
MOV direct, R6
8E
2
2
8
12
1.5
MOV direct, R7
8F
2
2
8
12
1.5
MOV direct, @R0
86
2
2
8
12
1.5
- 77 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
MOV direct, @R1
87
2
2
8
12
1.5
MOV direct, direct
85
3
3
12
24
2
MOV direct, #data
75
3
3
12
24
2
MOV DPTR, #data 16
90
3
3
12
24
2
MOVC A, @A+DPTR
93
1
2
8
24
3
MOVC A, @A+PC
83
1
2
8
24
3
MOVX A, @R0
E2
1
2-9
8 - 36
24
3 - 0.66
MOVX A, @R1
E3
1
2-9
8 - 36
24
3 - 0.66
MOVX A, @DPTR
E0
1
2-9
8 - 36
24
3 - 0.66
MOVX @R0, A
F2
1
2-9
8 - 36
24
3 - 0.66
MOVX @R1, A
F3
1
2-9
8 - 36
24
3 - 0.66
MOVX @DPTR, A
F0
1
2-9
8 - 36
24
3 - 0.66
PUSH direct
C0
2
2
8
24
3
POP direct
D0
2
2
8
24
3
XCH A, R0
C8
1
1
4
12
3
XCH A, R1
C9
1
1
4
12
3
XCH A, R2
CA
1
1
4
12
3
XCH A, R3
CB
1
1
4
12
3
XCH A, R4
CC
1
1
4
12
3
XCH A, R5
CD
1
1
4
12
3
XCH A, R6
CE
1
1
4
12
3
XCH A, R7
CF
1
1
4
12
3
XCH A, @R0
C6
1
1
4
12
3
XCH A, @R1
C7
1
1
4
12
3
XCHD A, @R0
D6
1
1
4
12
3
XCHD A, @R1
D7
1
1
4
12
3
XCH A, direct
C5
2
2
8
12
1.5
CLR C
C3
1
1
4
12
3
CLR bit
C2
2
2
8
12
1.5
SETB C
D3
1
1
4
12
3
SETB bit
D2
2
2
8
12
1.5
CPL C
B3
1
1
4
12
3
CPL bit
B2
2
2
8
12
1.5
- 78 -
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
ANL C, bit
82
2
2
8
24
3
ANL C, /bit
B0
2
2
6
24
3
ORL C, bit
72
2
2
8
24
3
ORL C, /bit
A0
2
2
6
24
3
MOV C, bit
A2
2
2
8
12
1.5
MOV bit, C
92
2
2
8
24
3
ACALL addr11
71, 91, B1,
11, 31, 51,
D1, F1
2
3
12
24
2
LCALL addr16
12
3
4
16
24
1.5
RET
22
1
2
8
24
3
RETI
32
1
2
8
24
3
AJMP ADDR11
01, 21, 41,
61, 81, A1,
C1, E1
2
3
12
24
2
LJMP addr16
02
3
4
16
24
1.5
JMP @A+DPTR
73
1
2
6
24
3
SJMP rel
80
2
3
12
24
2
JZ rel
60
2
3
12
24
2
JNZ rel
70
2
3
12
24
2
JC rel
40
2
3
12
24
2
JNC rel
50
2
3
12
24
2
JB bit, rel
20
3
4
16
24
1.5
JNB bit, rel
30
3
4
16
24
1.5
JBC bit, rel
10
3
4
16
24
1.5
CJNE A, direct, rel
B5
3
4
16
24
1.5
CJNE A, #data, rel
B4
3
4
16
24
1.5
CJNE @R0, #data, rel
B6
3
4
16
24
1.5
CJNE @R1, #data, rel
B7
3
4
16
24
1.5
CJNE R0, #data, rel
B8
3
4
16
24
1.5
CJNE R1, #data, rel
B9
3
4
16
24
1.5
CJNE R2, #data, rel
BA
3
4
16
24
1.5
CJNE R3, #data, rel
BB
3
4
16
24
1.5
CJNE R4, #data, rel
BC
3
4
16
24
1.5
- 79 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Op-code
HEX Code
Bytes
W79E4051
/2051
series
Machine
Cycle
W79E4051
/2051
series
Clock
cycles
8032
Clock
cycles
W79E4051/205
1 series vs.
8032 Speed
Ratio
CJNE R5, #data, rel
BD
3
4
16
24
1.5
CJNE R6, #data, rel
BE
3
4
16
24
1.5
CJNE R7, #data, rel
BF
3
4
16
24
1.5
DJNZ R0, rel
D8
2
3
12
24
2
DJNZ R1, rel
D9
2
3
12
24
2
DJNZ R5, rel
DD
2
3
12
24
2
DJNZ R2, rel
DA
2
3
12
24
2
DJNZ R3, rel
DB
2
3
12
24
2
DJNZ R4, rel
DC
2
3
12
24
2
DJNZ R6, rel
DE
2
3
12
24
2
DJNZ R7, rel
DF
2
3
12
24
2
DJNZ direct, rel
D5
3
4
16
24
1.5
Ì
24-1: W79E4051/2051
- 80 -
ž
ó
W79E4051A/RA W79E2051A/RA
hjilkm
žr ó^÷ } h W79E4051/2051
3W þ1_ * ùúon,K´î éop ¼h gõ ÿ2î-q ­ þ Ó0u É ÷%î õ Þ
‹s,ÆK è ]ut » õÆÞ _w v W79E4051/2051 3lWÅ9 ·Å: 8032 ÷ ð Ò ‡ˆ îZ Í è W79E4051/2051
¥æý 4úx É 3î W ‡"µ ˆ êC1ú v C2¥ v æC3à * v 4C4úy÷z è%æ ½Ã!g ¼êêø ú÷"žó´æîÃ÷ a á * AùB úa x =É >Pî ? ¼ ¤Âè O ÷"Ž ^ùî ú 2
úÙÚ{
Ô a õ g Ô ¨ ÷ ð´è @Ž "÷ îo| ¨ £ C} g 50% ¼ O~ ÷ Ø Ò M uF€è
¥ æÃi á ù‚ Õ
× j
2 k ö ¼ Ž h ë (
ž
óþ_.¼÷ á ž
ó^î ê
ù
ú
:
3
W
W79E4051/2051
¥ æ
à 9 k ö ×^µî Ù ~(Ï è 3
4ƒF„ / 256 ú k ö ×!á ¼ \^@µ / 128 ú  *… æ
Þ
óè @Ž 3:W µ /ù î žóñ 4 ú÷ æÃPÔÖ÷ Y†!@è h ( Ù ~
ž
óþ_.¼žóî
W79E4051/2051
÷ á æà * 2 ú ¥ æ
Ãè3t /
ž
ó‹*ùú Ù ~3 æà * 2 ú!÷ æ
Ã!î@ćè
24.1
- 81 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
ˆ‰‹ŠsŒ
25.1 Ž‘j’
“ DC Ö
®o « « € y
k ö:š B
í ² š B
› «@
Ÿ ‰ « y
RAM À ë^@«  V
À ë^@«  V
… ú I/O ââ î €´
«R
›
… ú I/O â î R« 
¤ / I/O â î €´
R« 
›
¤ / I/O î «R
25
DD
”
VDD
•1–:—
•˜—
™ š
“ -0.3
+7.0
V
VIN
VSS-0.3
VDD+0.3
V
TA
-40
+85
°C
Tst
-55
+150
°C
ISK
-
95
mA
VRAM
1.4
+7.0
V
120
mA
120
mA
25
mA
25
mA
75
mA
75
mA
VDD−VSS
-
SS
- 82 -
W79E4051A/RA W79E2051A/RA
œŸž` v £‹ À ø¿
(TA = -40~85°C, ¡*é Í¢ “ ” .
k ö« y
V
k ö@« 
I
25.2 DC
DD
¨ ©«@
%
ª^««@
o ®® @«  P1, P2, P3
o ® «@ RST pin
o º « P1.0, P1.1(Open
Drain)
ª« 1 % 0a¬ «@ P1, P2, P3
o ® ´
œ « y P1, P2, P3 (TTL
input)
o ® › « y P1, P2, P3 (TTL
input)
o ® ´
œ « y XTAL1
o ® ›« y XTAL1
Ð*Ño Ø
(RST Schmitt input)
ÜÑo Ø
(RST Schmitt input)
­ Z « y
(RST Schmitt input)
€ «R P1, P2, P3
´
[1]
[*2]
[*2]
¤¥
.)
MIN.
TYP.
2.4
MAX.
5.5
¦§o¨©
™ š
V
VDD=2.4V ~ 5.5V @ 12MHz
VDD=4.5V ~ 5.5V @ 24MHz
DD1
2
3.5
mA
No load, RST = VDD, VDD= 3.0V
@ 12MHz
IDD2
8
12
mA
No load, RST = VDD, VDD= 5.0V
@ 24MHz
IIDLE1
1.6
2.5
mA
No load, VDD = 3.0V @ 12MHz
IIDLE2
6.5
7.5
mA
No load, VDD = 5.0V @ 24MHz
IPWDN1
0.5
2
µA
No load, VDD =
5.0/3.0V(Brownout detection is
disabled)
IPWDN2
-
14/25
µA
Average current at Brownout
detection(LPBOV=1, 1/16 mode)
active,
VDD = 3.0V/5.0V
IIN1
-50
-
+10
µA
VDD = 5.5V, VIN = 0V or VIN=VDD
IIN2
-55
-45
-30
µA
VDD = 5.5V, VIN = 0.45V
ILK
-1
-
+1
µA
VDD = 5.5V, 0<VIN<VDD
-450
-
-200
µA
VDD = 5.5V, VIN<2.0V
-93
-
-56
0
-
1.0
0
-
0.6
2.0
-
VDD +0.2
1.5
-
VDD +0.2
0
-
0.8
0
-
0.4
3.5
-
VDD +0.2
2.4
-
VDD +0.2
VILS
-0.5
-
0.3VDD
V
VIHS
0.7VDD
-
VDD+0.5
V
ITL
[*3]
VIL1
VIH1
VIL3
VIH3
VHY
ISR1
0.2VDD
-150
-210
- 83 -
Vdd=2.4 Vin = 1.3v
V
V
V
V
VDD = 4.5V
VDD = 2.4V
VDD = 5.5V
VDD = 2.4V
VDD = 4.5V
VDD = 3.0V
VDD = 5.5V
VDD = 3.0V
V
-360
µA
VDD = 4.5V, VS = 2.4V
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
 » ¬ ­ )
: ™
®¯±° P1, P2, P3
™» ¬­ )
(:
x
y « y BOV[1:0]=00
x
y « y BOV[1:0]=01
x
y « y BOV[1:0]=10
x
y « y BOV[1:0]=11
x
y « y «@
(
Hysterisis range
¯³²-´¶µ¯±·
x
y « y
Notes: *1. RST
-18
-27
-40
µA
VDD = 2.4V, VS = 2.0V
13
20
24
mA
VDD = 4.5V, VS = 0.45V
8
13
17
mA
VDD = 2.4V, VS = 0.45V
VBO2.4
2.25
2.4
2.55
V
VBO2.7
2.55
2.7
2.75
V
VBO3.8
3.65
3.8
3.90
V
VBO4.5
4.30
4.5
4.65
V
ISK1
IBO1
160/13
5
24/11
IBO2
µA
210/170
3215
µA
No load, VDD = 5.0/3.0V
Average current at Brownout
detection active (LPBOV=1, 1/16
mode)
VDD = 2.4V~5.5V,,LPBOD=0
VDD = 2.4V~5.5V,,LPBOD=0
VBh
35
10
-
150
60
mV
mV
VPOR
1.45
2.0
2.10
V
¸º¹³»±¼¾½±¿³À±Á¾ÂÄþų¸
¹³»±¼ CMOSþų¸
ƶÇÉȳ¸¾Ê±Ë³Ì±ÍºÎ³Ï³Í³ÐÒÑÄÓÉԱճ־׺ØÚÙ³ÛÜÞÝÒßÄà
*2. XTAL1
*3. P1, P2 & P3
- 84 -
No load, VDD = 5.0/3.0V
Average current at Brownout
detection active (LPBOV=0)
With Hysterisis ~= 450mV
á ѱÓÉÙ³Û'Üâݳã¾ä³å¾æ³ç
VIN 2V
.
W79E4051A/RA W79E2051A/RA
25.3
èjéëêìŸíuœŸžŸ “ (VDD−VSS = 3.0~5V±10%, TA = -40~85°C, Fosc = 24MHz,
« y´£0¤¥o ®÷ø
„¬ù Ö2£
7 ­!÷ Ø
£4¤¥ |} %op/ü.÷ Ø
£4¤¥
o ® º «
£4¤¥ Hysterisis « y
£4¤¥ offset « y
”
îðïÞñóòÞôöõ
MIN.
VCR
¤¥
.)
TYP.
0
CMRR
¦§o¨©
MAX.
UNIT
VDD-0.3
V
-50
dB
tRS
-
50
100
ns
tEN
-
1
5
us
IIL
-10
0
10
uA
VCHYS
60
80
mV
VOFF
8
10
mV
- 85 -
0< VIN <VDD
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
25.4 AC
œoŸž` tCLCL
tCLCH
tCLCX
tCHCL
tCHCX
Note: Duty cycle is 50%.
25.5
“ úŸûskýüþž` ”
Oscillator Frequency
“ Clock
Clock
Clock Rise
Clock Fall
÷ Ø
÷ Ø
ÿ
AC
0
18.8
-
-
nS
tCLCX
18.8
-
-
nS
tCLCH
-
-
10
nS
tCHCL
-
-
10
nS
Ô
… ¹
tCHCX
Min.
MHz
MAX.
A
(
¨
24
TYP.
W79E2051/W79E4051
… ¹
MAX.
MIN.
(VDD−VSS = 2.7~5V, TA = -40~85°C.)
W79E2051R/W79E4051R
RC
(Fosc = 22.1184MHz)
IO ÷
MIN.
”
25.6 RC OSC
O ÷
1/tCLCL
› ÷ Ø
œ ÷ Ø
Typ.
NOTES
{ ø¿
Max.
Unit
-25
25
%
VDD=2.4V~5.5V, TA = -40°C ~85°C
-2
2
%
VDD=5.0V, TA = 25°C
-5
5
%
VDD=2.4V~5.5V, TA = 0~85°C
-7
7
%
VDD=2.4V~5.5V, TA = -20~85°C
-10
10
%
VDD=2.4V~5.5V, TA = -40~85°C
256
clk
- 86 -
W79E4051A/RA W79E2051A/RA
,
2. !"$#%&'() ,RC !*,+)-(!.
Frequency Deviation (%)
1.
.
6
3
T=85C
0
T=50C
-3
T=25C
-6
T=0C
-9
T=-20C
-12
T=-40C
2.2
2.7
3.2
3.7
4.2
4.7
5.2
Supply Voltage (V)
26
/102436587
- 87 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
TB
T@
CRYSTAL
4MHz ~ 24 MHz
C1
V
9;:=<?>CB
9;:=<?>A@
DEGFIHKJMLGNKOQP
R LSNKO
U
C2
V
- 88 -
V
R
W79E4051A/RA W79E2051A/RA
27
W4XZY\[
27.1 20-pin SOP
_a`
bab
c
E
H
]
b`
^
L
D
0.25
O
A
Y
SEATING PLANE
e
GAUGE PLANE
b
cedgfihCjAdikIlemAnompfiqer dgf;qtsujvmwr fxnyrCk nomuhpmujgq{z
SYMBOL
A
A1
b
c
E
D
e
H
Y
L
θ
]
DIMENSION IN MM
MIN.
MAX.
2.35
2.65
0.10
0.30
0.51
0.33
0.23
0.32
7.40
7.60
13.00
12.60
1.27 BSC
10.65
10.00
0.10
0.40
1.27
0
8
.
A1
DIMENSION IN INCH
MIN.
MAX.
0.093
0.104
0.012
0.004
0.013
0.020
0.009
0.013
0.291
0.299
0.512
0.496
0.050 BSC
0.394
0.016
0
0.419
0.004
0.050
8
27-1: 20L SOP-300mil
- 89 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
27.2 20-pin DIP
D
20
11
1
10
1
E
E
S
1
2
AA
A
c
Base Plane
Seating Plane
L
B
|
e1
B1
Symbol
A
A1
A2
B
B1
c
D
E
E1
e1
L
|
eA
Dimension in inch
Min
Nom
Max
Dimension in mm
Min
Nom
0.010
Max
4.45
0.175
0.25
0.125
0.130
0.135
3.18
3.30
3.43
0.016
0.018
0.022
0.41
0.46
0.56
0.058
0.060
0.064
1.47
1.52
1.63
0.008
0.010
0.014
0.20
0.25
0.36
1.026
1.040
20.06
26.42
0.300
0.310
7.62
7.87
0.290
7.37
0.245
0.250
0.255
6.22
6.35
6.48
0.090
0.100
0.110
2.29
2.54
2.79
0.120
0.130
0.140
3.05
3.30
3.56
15
0
0.375
8.51
9.02
9.53
0
0.335
S
0.355
15
.
0.075
27-2: 20L DIP-300mil
- 90 -
1.91
eA
W79E4051A/RA W79E2051A/RA
28
‚
}1~14€
ƒ…„
SC1
March 25,
2008
SC 2
April 2,
2008
SC 3
April 16,
2008
SC 4
May 30, 2008
SC 5
June 16, 2008
SC 6
July 3
SC 7
Ö
July 10
†‡
ˆ‰
5
4~5
27
77
84
Ö
2008
2008
5
46
84
86
87
Š
‹Œ
!
Ž V >3.0V ‘’8“•”–˜—™šœ›žŸ ¡£¢
1. ¤˜¥¦!§ RC ¨
˜© 22.1184M/11.0592M
2. ESD=4KV
3. ª«£¬®­˜¯°±
4. ª«²³’´!µ
5. ª«·¶¸º¹»
6. ª«£¬®­¼½¾
1. Ž W79E4051RA/2051RA ¿ÀÁ
2. Â8Ã,¹Ä
–˜—ÅÆ NVMDDRH Á
3. ¤˜¥ ICP ÇÈÉ"ËÊ8Á
4. ¤˜¥!§®Ì RC ¨
ÍÎ .
ª«
ÅÏÆ
ÐÑ
´µ*•ÒÓÔÕ
ª«
×ØÙÚ!Á
ŽÛÜÝÞ Á
¤˜¥!§®Ì RC¨
+)
¤˜¥ CKCON ÅÆ*•ßà
¤˜¥áãâäÌå*•æ8çßà .
Â8Õèé
êŸ Þ .˾
Ž §®Ì RC ¨
ëì ;
Ž ¬®­ÇÈí"$Ê!. ;
Žî #ïÉ"ñð ;
¤˜¥ RC OSC .˾ ;
Ž "$#%&'( ,RC ¨
!*,+)!.ñ¾
DD
- 91 -
Publication Release Date: July 10,2008
Revision .SC7
W79E4051A/RA W79E2051A/RA
Important Notice
Nuvoton products are not designed, intended, authorized or warranted for use as components
in systems or equipment intended for surgical implantation, atomic energy control
instruments, airplane or spaceship instruments, transportation instruments, traffic signal
instruments, combustion control instruments, or for other applications intended to support or
sustain life. Further more, Nuvoton products are not intended for applications wherein failure
of Nuvoton products could result or lead to a situation wherein personal injury, death or severe
property or environmental damage could occur.
Nuvoton customers using or selling these products for use in such applications do so at their
own risk and agree to fully indemnify Nuvoton for any damages resulting from such improper
use or sales.
òôó·õÏöô÷8øúùGû˜üýþíÿ
ù
ý
ûôü8 uC!ù " ý
%
2299 27
200336
$õ #&
'( %
- 92 -
021-62365999
021-62365998