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 • !$%(Rwj : q1 : ( 24MHz JRwS (%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 *XX¯ (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+(/SaXI : 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- oq% . 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$6Pw *¿S=>? 8052 Zs6Pnmo 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 @R4)*((%S¦TSG1'4}| 12 R.4)4*(S%¦TSG 7~I%,%{b p *¢( 7 c 8052 Rw 6.4 W79E4051/2051 ( *%5i(&S=>(? 8052 70i4i7? '? ¡?'?¢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 Þ?ßàá?âã4Xä4å0æ ·çè4 Üé4ê7ë? W79E4051/2051 7³ìíîﯰ 8052 ¸ðà? ñiòXóiô!õXö ALU ALU W79E4051/2051 ³ MCU 0Ý÷0øùú4ûù44ü4ýûùX'ø4þXÿi7 i ì í ã ALU ¸4ðë ALU øê74ëiûù? ALU !"#Xê'ë ACC "#Xê'ë B $%&(')ûù ALU *+,-.¯/i01¯/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 ?HQø¸ð!ãê7ë 8 ¶Xê'ë! AB (ACC) Ú±µ >KI! B ìí ( R S*T(U(V8NO*6 (PSW) PSW Ú4±4µ 8 ¶X¯/!êë '2 ALU IW4ù8YXZF[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 · Ün9? W79E4051/2051 ¾ W79E4051/2051 ³@~ 4K/2K 3l?Ü . ¸ð£01*r=s=8dHîï MOVC ¸ð ²D^E01(rs! 7.2 ¨ª© Flashii 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æ@?@A04 ·4æB?@AXYmÜ 256/128 3lno RAM DC44é Ü?øXZ"#4Xê7ë ("#4ê7ë ) SFR EX0ã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~@t8dXß|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¯tK À L 1`(7=L 2`(7L 3`(7=L 4`i`?0ê0 ëìíDF E ê0ëGtK 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@q4ì íH¶*pq?YDÚt04µ9rIsì í¶*pq?¸4ð ëJ¡ t¢¶¸ðþÚ@3l¸ð"#ê7뤣q4Ú?í 0¥ 8 §¦!£ìí ¶p@q . 7.6 ¨ª© no RAM ì íHã>xy!I¨9rYs.xy¸4¹ (SP) ¸ SP Ú xyz{Dq I«§¬87§ã®¥¤£7t ã?寤°|q4 2 y? z 0 RAM £=x? y ±D²D4q ÚG³´ Iµ¶xy ¸¹D¶t·Ú 07h 㮸 - 12 -  W79E4051A/RA W79E2051A/RA ìí¹·Dºv»®¼§½xy?±D²vq 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êë ( 4Xêë ) 4çèDÍGÎû4ï44tÏ W79E4051/2051 ³ MCU ÜHÝã H Xê7ë¶4 80H-FFH y B?BAXÜ'EX0ã |FDH ± 4ê7 ëÚì¶ µ4X 4t u ã4tEtÐ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 ¶GDÚDÛ â!X4 ³ â 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@¨¶tq . t²iyÀ! 8-2: "#4ê'ë config0 (CBOV1,CBOV0) - 16 - ab . W79E4051A/RA W79E2051A/RA 9 W79E4051/2051 9.1 ³la$ãGÃ, !=lÏGHK)ÏDH(7?'|ÏGH ã ! 1 ªv× PCON.0 Y\G¼ ×@?'Ï®H? X2G×@?'Ï®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çè$ ë ½¾ _>! |=}GDXXG £©¨£ìí ¼]d?'Ï HI «Y0²G £¨)¿Xå0 n À9'v?'¶?´ ¼]d?'ÏDH,Áª¢¤¥G £¨ÂÃH £¨ Â$Ã@ $Ä á !07 \G×®?$ÏGH!y ¿,¢¸ ð Å,ÆÇ?û ï µ7¶ ²ì í 4 ¼]d§?'|ÏDH $@%Bµ7¶y FDH RST È,ÉÊG×GË?´ ɳµ'¶ í ,ÌÍÏÎ µ ÑëX$ Þ Ò ¡ 8 µ å ¦ Þ ÒF¦! í nX4® ® é µ$ ¶ Ó å0> ë µ¶0® é µ¶å4@ G ËÐ$¾ 'º,¸ 2 $ £ @ I ° D ² . X i å ´ ¦ t Á ³ , $ Ô Õ _ 8 > = | } ? µ7 ¶ ¸¹4t À* K 0000H SFR ¼ ë ½¾_>! |=} » Ì³Í¯Î å¤ åJGë c ÖîïB ?'|ÏDH ̳ÍÏÎ å$ ë £ ¨ $ × X Ø ´ ³ Ì Ï Í Î ë c^dÁ dIJ9¤£¨X4, ¼Fdv?ÙÏBH ´ Ú$Û'ÜÝBµ ¶ ÌÞÍ´Î å'ë! í n$ ÌßÍ Î å0 å ¦4, Þ Ò® µ'¶§ « W79E4051/2051 ³y í µ7¶| FGHD?'|Ï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}~ jLxz ! ü ~ jL<LYx 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 ú RSTj: 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 ¯ °gL~ ±_²óôõ$ö î ~ $ú 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ù ú ~ srj: 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 6u ¦ 2 n| Ù u ú¹ Q+RLs 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 úÉ » RSTj½ ô\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|Ë£ÚÛu6 ·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 ð §\6L ý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&tf: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@∈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:HR xú R:_:È8&% RL9 Î+~ ï)ð<ØÙö ¢ ûü:_b9 . W79E4051/2051 11.1 ñ« ~ INT0 INT1 IT0 IT1 HL@·@ô<·: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 ò yd ô< ô< ´µ 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 ú CFR D ú´õVWYX 6 å Ý_ . ø+R &% 45 À R ú vw Ö Àf Ð . ûü: å ÝÑ ¨t¢ § À+R / Q_Ù R ú â Z© Ö À ä6 å "#RR¢ Ü r: b9 uª ³:_+L§ IE q_r:<opR ö Ø:Ù+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 Ý9YA ²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 úû õö õö õö õö HOP:å 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 õö õö õö HOP:¬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 C3e5f 55 l0g3jhYgh+ ' Iex u?f0jgYhY''++' ZDEf'>5F 0G 10 'u 5¢¤'£YF'¥¦ j C3 § z{@'¨5© 4f FF''05Z'ª « gYhYZ't5+ ¬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È g3hj®5¯° )É £ W79E4051/2051 Ê+Ë |{?}@3̨ IE, IP,zIP1 G MUL Í DIV z{NZ g3hEg3h+iNj±¥k3l >mYÎ 12 5F@Ç gÏÐ 5 Ñ IE, IP, IPH,ÒUÓ 2F''@ Ä'Ñ MUL DIV z5{ 5F'G ÄÑ ¡ LCALL g g3h 1F'?@ Ä5IPH h0ÔÕ Ö× Î5Ø e+4f''Ù'F'Ú?5g0h Z Ê5Û g3h'kl >m3ÜÎ Æ p 5'F' ¸Æ p 12F'0Z ±'Æ?j»Â >5m Î 12F'EÝ+Î 48 >Þ''0Z . ß 8051±à+»' >5mY; 8F'¤Ý+Î 96 >Þ'5?Z ª'LUM9á ² 50% >Þ50Z 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 8EúYû FUMü Ñ 160j ï'ð ú 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 þ ý5TL0Fþ 8 } ï'ï'ð ð G 8 ï'ð5FUZ ~ OÈ ;5D>F ?@3dD1>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 D2 >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 ta H'VFG ta de H'V 0: 8- D¤>F@ 5Nj 0µj N Z H'V 1: 16- DE>F0gU@#u5f g h5 µ*0 Z H'V 2: 8 « THx DE[ >F 4 H'V 3: jþij 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#{|yu#*I 8051~S}#* W79E4051/2051 qrIt:u vzu#{|I ¢¡!£¤¥:u#{¡!¦§¢-S}#Su*-zu-{|%q *S 1/6 } ¨©ª§*«¦¬ 3I%® 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 qSuM{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 qzu#{I 1: t:u-v 0 u#{£¤%s 1/6 qSu#{z 12.2.1 ÎzÏ 0 ² 0¸S} 13±zt: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#{| ¢¡-qzu#{îï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`/bc/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#{|* ¡#qSuM{îumrïIx ¢1/12 ¡ w utnrm x¢{ w tt uu y u{u{rr y qtt u{m | w u{u{zzm n y n mn m o w pru{qtn s y }~ ~ u m ututtxmnw utuun y m o w xxttu{u{ || u{u{umrr { o y t u t v m w utvxn y w un { 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 06. ² 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¸}¬¼6ia½6¾¿ À%õ>Á+²aÂ/º6Ã6Ä Å³Æá¡-Çe}a¼WÈf9³í TF1° TR1ð ;²¢ùIutSu#v 1¹/º ¢¡-÷ GATEñ INT1j¢aÉ· ¢¡®ÊcªøËé*ç/Ì*Þ²* 3 #**ý*Þ çû>Í®i®i?=-¨ I¡ ÏÎWÐM-ÑÒÓ6v - 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(¢ + Iu 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.> : «¬\vhsAÏ]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-ÃÓ6vç÷V%t:u , vø\tSó u-v/Ã6¸~Ñó vS}#í*qSu-{ðùø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 WDCLRZxzy¬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#{îïðzzuu:® 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-5I ¯%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:ä¢Û ó :$ô%tzuvS³±:´*å ’1’ 0\±: %zS³±Çó WTRF: È øýV*WDCON.2 I*¡ )O\±I}-¼ 78É/X W<;µ¶#³±×ªù± Wk;%-¹*º EWDRST = 0 }B\±f×À :,ôt:uMvzÊÌË% ó : ôt:u-v:³±÷ ³±Is 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 ±IB+-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»IM%}+iªÌ£+§·ûC@û>Í}y8X ó :øôt u#v é CONFIG «¬\vI-Ü 7±I}#ù±%}åå ó ,: ôtSu-vIu#{|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 Ó6yî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³zM¸ " ×¾¸}¹ SM0 #% Å9³zÛ% ¥z¦*%äIu*}T\±å± ~ ·ìz-¦/§±$\±78®*ýVW<; Î!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!bQ] EHkC; 17\ 0 ,* 2{ 3 | s >?.ABCDE!b,* 1-/) SM2=0 x RB8 F s >?/.NOC!b ,* 0-kC Q|g(9,* 0 -kgY6 8 CDE;C!)16,*6QU]W?NOC/.1v(Z9;C!bkCV\@ 0 k,* f¡¢£¤¥WQop 23 .¦*!b6k,*-@)UWDE§ 15.1 - 34 - RXD ¨¥W>) TXD ¨©ª W79E4051A/RA W79E2051A/RA «¬ C®@Z[Qb]67 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@UWX 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 ÖDEHØ 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/)JNOC!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 )1xCM/)>=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!bK6 RI; ’1’ßP£; : L6 s .M>!n 8b CRI=0 )ô SM2=07 s >[email protected]À 1 ZNLM 8:¯OMPQ/)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§UCC Ä 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/)JNOC!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 )1xCM/)>=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!bK6 RI; ’1’ßP£; RI=0 )ô SM2=0 7 s >?/.NOCÀ 1 Z)NLM 8:¯OMPQ/)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/.¦òvQU]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()èHgC;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 .gCQb äF SM0 ) äF FE b) Ì ä|C FV SMOD0 Ä PCON.6 ÅÆ¿@.bÇ SMOD0=1 Zi FEgC@)Ç SMOD0=0 Zi SM0C FE g§õ ;CôQ]\ 0 b6Õ FEgC¥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: 1023y ©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 01023 Tò-)0Ç1A 9C; 1 Z)9(.DEF¢£ÿ/bÇé« 0c¬ ÕÚ 0 5DEÐ/)9º« Ú¬ .¢£Ùÿ)Ç1Ú Î64s5 >¢£ÿ@Z)W{(. SM2 C0 À b ¤ ëì«W¬ { 6 s >?¢£ÿZ |1@b® ¢£¨ ëì¯L6 s >?@.¢£{B ¢£- ZN |1@b¢£i°±§õ (b ~« ²£( .9Ú£¤H SM2C\þ@)Kh¤v s >DE!b SM2=0)9¶@Ç s >? Ì äLMDEÿÚ 0 e ¬ Ì J ä/|1/b³~²£!.Ú£¤IJ´?µ0¶)ÀW{6·¸¹®»º¢£!.9?!b6Tò 1 |)A B¼C½ FNOC,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 £ZM@) 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 !Ó9D (.ã]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 |1t 5 ). 1: PWM 10 CD \ PWM D 1: \ PWM 10 CD À 000H. ;CV: ® Ù \@ . Ò(Ó . 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 @)13äó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 °± (|9Q 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 ,=AA:A ZV] TV|fbWRl`j Rg { N}fVRS U fVe è OD,ÒC P1.0 èOD,ÒC . 0: . 0: ¡¢ ¡8¢ D, /T Ò D, /T Ò ( 57 ( 57 =B :B è OD,Ò ). 1: èOD,Ò ). 1: 1( >< ) 1( =< ) T i°± /.ä 66 0 Îåæ $ d . ) ± 2 vF6 Ç Ì äåæ\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- õÝÞMQb ;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!* CB84=&Sc 1!1).4 ¡ ¢Sc Y L£C¤¥¦§¨441)!. 4© 3 b&C 3 bY f1).!ª¬«&M4C 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 b4>» 55h ;D 3 b4& ¼½»¾4¿] &!)!HÀ C1).½ 4© 3 b | P GJ8IK ~2=Á SC`Â55h, )HM41BA&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 ) M24 =4Ì1EQ8I4K123Í& Î4£DC Å 4 Éd Ï 4 3b48I4K2Y =&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 ” MC <; 4 ^_ @; - /4I KNC.'E '(.CJáâH Ú 1 ßà #.C ¤ Ú Q C'&\ ( , -- / R \ 20mA/10mA S V =5V/2.7V T . DD ~vv `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 iW]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%4I 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§wdz¡ Jj©u{u~0~kz ¡ {=£B } =s jlknmporq jlknmpos kN{0 =sV{u0zuz kn=m zZ0 | kkn {=mw v =xBsVyp{izd{pz|0o}i}J~ |=}B}=zz ¸ ^¾3 k {= kn=mwsZ{iv xn0ª³zz v {p0z |=}i}uMM~ B}B´dzz ¶=·¿ µn¼¶=½n·¾ ¸ 5 d3=> 5 i d3=> 5 }=zdi 0u } 0|dz }iM |¡ |¢={i~ z ¡£B}¤ |¥i={idzu¦Byu§j©¨ªT«Byi§¬j® {iu}B¡J¯pkm±°²¢={i~ z ¡£B}¤~ }J¢=}i~ µ¶=·¸¥¹ k {0¥=sZ{idzo}J|=}=z°}i~ =¥µ §±} ¥ zM¯±uJ{idz5º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 . Fh 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ñNHí « 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ñNHí 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{0q0s¹!¼ |} «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*ã Ö hl¹® î Ü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 4F / 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