| 数据搜索系统,热门电子元器件搜索 |
|
STC89LE52RC 数据表(PDF) 127 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC89LE52RC 数据表(HTML) 127 Page - STCmicro Technology Co,.Ltd |
|
127 / 165 page ![]() 9.3 IAP/EEPROM Assembly Language Program Introduction ; /*It is decided by the assembler/compiler used by users that whether the SFRs addresses are declared by the DATA or the EQU directive*/ ISP_DATA DATA 0E2H or ISP_DATA EQU 0E2H ISP_ADDRH DATA 0E3H or ISP_ADDRH EQU 0E3H ISP_ADDRL DATA 0E4H or ISP_ADDRL EQU 0E4H ISP_CMD DATA 0E5H or ISP_CMD EQU 0E5H ISP_TRIG DATA 0E6H or ISP_TRIG EQU 0E6H ISP_CONTR DATA 0E7H or ISP_CONTR EQU 0E7H ;/*Define ISP/IAP/EEPROM command and wait time*/ ISP_IAP_BYTE_READ EQU 1 ;Byte-Read ISP_IAP_BYTE_PROGRAM EQU 2 ;Byte-Program ISP_IAP_SECTOR_ERASE EQU 3 ;Sector-Erase WAIT_TIME EQU 0 ;Set wait time ;/*Byte-Read*/ MOV ISP_ADDRH, #BYTE_ADDR_HIGH ;Set ISP/IAP/EEPROM address high MOV ISP_ADDRL, #BYTE_ADDR_LOW ;Set ISP/IAP/EEPROM address low MOV ISP_CONTR, #WAIT_TIME ;Set wait time ORL ISP_CONTR, #10000000B ;Open ISP/IAP function MOV ISP_CMD, #ISP_IAP_BYTE_READ ;Set ISP/IAP Byte-Read command MOV ISP_TRIG, #46H ;Send trigger command1 (0x46) MOV IsP_TRIG, #0B9H ;Send trigger command2 (0xb9) NOP ;CPU will hold here until ISP/IAP/EEPROM operation complete MOV A, ISP_DATA ;Read ISP/IAP/EEPROM data ;/*Disable ISP/IAP/EEPROM function, make MCU in a safe state*/ MOV ISP_CONTR, #00000000B ;Close ISP/IAP/EEPROM function MOV ISP_CMD, #00000000B ;Clear ISP/IAP/EEPROM command ;MOV ISP_TRIG, #00000000B ;Clear trigger register to prevent mistrigger ;MOV ISP_ADDRH, #0 ;Set address high(00h), Data ptr point to non-EEPROM area ;MOV ISP_ADDRL, #0 ;Clear IAP address to prevent misuse SETB EA ;Set global enable bit ;/*Byte-Program, if the byte is null(0FFH), it can be programmed; else, MCU must operate Sector-Erase firstly, and then can operate Byte-Program.*/ MOV ISP_DATA, #ONE_DATA ;Write ISP/IAP/EEPROM data MOV ISP_ADDRH, #BYTE_ADDR_HIGH ;Set ISP/IAP/EEPROM address high MOV ISP_ADDRL, #BYTE_ADDR_LOW ;Set ISP/IAP/EEPROM address low MOV ISP_CONTR, #WAIT_TIME ;Set wait time ORL ISP_CONTR, #10000000B ;Open ISP/IAP function MOV ISP_CMD, #ISP_IAP_BYTE_READ ;Set ISP/IAP Byte-Read command MOV ISP_TRIG, #46H ;Send trigger command1 (0x46) MOV ISP_TRIG, #0B9H ;Send trigger command2 (0xb9) NOP ;CPU will hold here until ISP/IAP/EEPROM operation complete 127 |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |