Philips Semiconductors
Product data
P89C660/P89C662/P89C664/
P89C668
80C51 8-bit Flash microcontroller family
16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM
2002 Oct 28
70
IAP CALL
PARAMETER
ERASE BOOT VECTOR &
STATUS BYTE
Input Parameters:
R0 = osc freq (integer)
R1 = 04h
R1 = 84h (WDT feed, Rx2 & 66x only)
DPH = 00h
DPL = don’t care
Return Parameter
none
Sample routine:
;***** Erase Boot Vector (BV) & Status Byte (SB) *****
;***** Note: This command erases BOTH the SB & BV
ERSBBV;
MOV
MOV
MOV
MOV
CALL
RET
AUXR1,#20H
R0, #11
R1,#04H
DPH,#00h
PGM_MTP
;set the ENBOOT bit
;FOSC
;erase status byte & boot vector
;we don’t care about DPL
;execute the function
PROGRAM SECURITY BIT
Input Parameters:
R0 = osc freq (integer)
R1 = 05h
R1 = 85h (WDT feed, Rx2 & 66x only)
DPH = 00h
DPL = 00h – security bit # 1 (inhibit writing to Flash)
01h – security bit # 2 (inhibit Flash verify)
02h – security bit # 3 (disable external memory)
Return Parameter
none
Sample routines:
;***** Program Security Bit1 *****
;***** DPTR indicates security bit to program *****
WRSB1:
MOV
MOV
MOV
MOV
CALL
RET
AUXR1,#20H
R0,#11
R1,#05H
DPTR,#0000h
PGM_MTP
;set the ENBOOT bit
;FOSC
;program security bit function
;specify security bit 1
;execute the function
;***** Program Security Bit2 *****
;***** DPTR indicates security bit to program *****
WRSB2:
MOV
MOV
MOV
MOV
CALL
RET
AUXR1,#20H
R0,#11
R1,#05H
DPTR,#0001h
PGM_MTP
;set the ENBOOT bit
;FOSC
;program security bit function
;specify security bit 2
;execute the function
;***** Program Security Bit3 *****
;***** DPTR indicates security bit to program *****
WRSB3:
MOV
MOV
MOV
MOV
CALL
RET
AUXR1,#20H
R0,#11
R1,#05H
DPTR,#0002h
PGM_MTP
;set the ENBOOT bit
;FOSC
;program security bit function
;specify security bit 3
;execute the function