【正文】
V for the highvoltage programming mode. 5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The bytewrite cycle is selftimed and typically takes no more than steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached. Data Polling: The AT89C51 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the plement of the written datum on . Once the write cycle has been pleted, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated. Ready/Busy: The progress of byte programming can also be monitored by the RDY/BSY output signal. is pulled low after ALE goes high during programming to indicate BUSY. is pulled high again when programming is done to indicate READY. Program Verify: If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled. Chip Erase: The entire Flash array is erased electrically by using the proper bination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be reprogrammed. Reading the Signature Bytes: The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that and must be pulled to a logic low. The values returned are as follows. (030H) = 1EH indicates manufactured by Atmel (031H) = 51H indicates 89C51 (032H) = FFH indicates 12V programming (032H) = 05H indicates 5V programming Programming Interface Every code byte in the Flash array can be written and the entire array can be erased by using the appropriate bination of control signals. The write operation cycle is selftimed and once initiated, will automatically time itself to pletion. All major programming vendors offer worldwide support for the Atmel microcontroller series. Please contact your local programming vendor for the appropriate software revision. 外文資料翻譯譯文 單片機(jī)基礎(chǔ) 摘要 : 單片機(jī)是電腦和集成電路發(fā)展的巔峰,有據(jù)可查的是它們也是 20 世紀(jì)最 意義的兩大發(fā)明。 AT89C51方框圖 引腳功能說(shuō)明 P1口: P1是一個(gè)帶內(nèi)部上拉電阻的 8位雙向 I/ O口, P1的輸出緩沖級(jí)可驅(qū)動(dòng)(吸收或輸出電流) 4個(gè) TTL邏輯門電路。在訪問(wèn) 8 位地址的外部數(shù)據(jù)存儲(chǔ)器(如執(zhí)行 MOVXRI 指令)時(shí), P2 口線上的內(nèi)容(也即特殊功能寄存器( SFR)區(qū)中 R2寄存器的內(nèi)容),在整個(gè)訪問(wèn)期間不 改變。 RST: 復(fù)位輸入。該位置位后,只有一 條 MOVX和 MOVC指令 ALE才會(huì)被激活。需注意的是:如果加密位 LB1被編程,復(fù)位時(shí)內(nèi) 部會(huì)鎖存 EA端狀態(tài)。 時(shí)鐘振蕩器: AT89C5l 中有一個(gè)用于構(gòu)成內(nèi)部振蕩器的高增益反相放大器,引腳 XTAL1 和 XTAL2 分別是該放大器的輸入端和輸出端。這種情況下,外部時(shí) 鐘脈沖接到 XTAL1端,即內(nèi)部時(shí)鐘發(fā)生器的輸入端, XTAL2則懸空。 IDL是空閑等待方式,當(dāng) IDL=1,激活空閑工作模式,單 片機(jī)進(jìn)入睡眠狀態(tài)。需要注意的是,當(dāng)由硬件復(fù)位來(lái)終止空閑工作模式時(shí), CPU 通常是從激活空閑模式那條指令的下一條指令開始繼續(xù)執(zhí)行程序的,要完成內(nèi)部復(fù)位操作,硬件復(fù)位脈沖要保持兩個(gè)機(jī)器周期( 24個(gè)時(shí)鐘周期)有效,在這種情況下,內(nèi)部禁止 CPU訪 問(wèn)片內(nèi) RAM,而允許訪問(wèn)其它端口。此外,加密位只能通過(guò)整片擦除的方法清除。 編程方法: 編程前,須按表 6和圖 6所示設(shè)置好地址、數(shù)據(jù)及控制信號(hào)。每個(gè)字節(jié)寫入周期是自身定時(shí)的,通常約為 。 程序校驗(yàn): 如果加密位 LB LB2沒(méi)有進(jìn)行編程,則代碼數(shù)據(jù)可通過(guò)地址和數(shù)據(jù)線讀回原編寫的數(shù)據(jù),采用下圖的電路,程序存儲(chǔ)器的地址 由 P1 和 P2 口的- ,數(shù)據(jù)由 P0口讀出, 、 、 , PSEN保持低電平, ALE、 EA和 RST保持高電平。編程完成后, 。 5.每對(duì) Flash存儲(chǔ)陣列寫入一個(gè)字節(jié)或每寫入一個(gè)程序加密位,加上一個(gè)ALE/ PROG編程脈沖。 AT89C51的程序存儲(chǔ)器陣列是采用字節(jié)寫入方式編程的,每次寫入一個(gè)字節(jié),要對(duì)整個(gè)芯片內(nèi)的 PEROM程序存儲(chǔ)器寫入一個(gè)非空字節(jié),必 須使用片擦除的方式將整個(gè)存儲(chǔ)器的內(nèi)容清除。 程序存儲(chǔ)器的加密: AT89C51 可使 用對(duì)芯片上的 3 個(gè)加密位 LB LB LB3 進(jìn)行編程( P)或不編程( U)來(lái)得到如下表所示的功能加密位保護(hù)功能表: 當(dāng)加密位 LB1 被編程時(shí),在復(fù)位期間, EA端的邏輯電平被采樣并鎖存,如果單片機(jī)上電后一直沒(méi)有復(fù)位,則鎖存起的初始值是一個(gè)隨機(jī)數(shù),且這個(gè)隨機(jī)數(shù)會(huì)一直保存到真正復(fù)位為止。程序會(huì)首先響應(yīng)中斷,進(jìn)入中斷服務(wù)程序,執(zhí)行完中斷服務(wù)程序并緊隨 RETI(中斷返回)指令后,下一條要執(zhí)行的指令就是使單片機(jī)進(jìn)入空閑模式那條指令后面的一條指令。這兩種方式是控制專用寄存器 PCON(即 電源控制寄存器)中的 PD( )和 IDL( )位來(lái)實(shí)現(xiàn)的。用戶也可以采用外部時(shí)鐘。 XTAL2: 振蕩器反相放大器的輸出端。 EA/ VPP: 外部訪問(wèn)允許。對(duì) Flash存儲(chǔ)器編程期間,該引腳還用于輸入編程脈沖( PROG)。 P3 口除了作為一般的 I/ O 口線外,更重要的用途是它的第二功能,如下表所示: P3口還接收一些用于 Fl