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
71
IAP CALL
PARAMETER
PROGRAM STATUS BYTE
Input Parameters:
R0 = osc freq (integer)
R1 = 06h
R1 = 86h (WDT feed, Rx2, 66x only)
DPH = 00h
DPL = 00h – program status byte
ACC = status byte
Return Parameter
ACC = 00 if pass; not 00 if fails
Sample routine:
;***** Program Status Byte (SB) *****
;***** DPTR indicates program status byte *****
;***** ACC holds new value of Status Byte to program *****
WRSB:
MOV
MOV
MOV
MOV
MOV
CALL
RET
AUXR1,#20H
R0,#11
R1,#06H
DPTR,#0000h
A,NEW_SB
PGM_MTP
;set the ENBOOT bit
;FOSC
;program status byte or boot vector
;specify status byte
;
;execute the function
PROGRAM BOOT VECTOR
Input Parameters:
R0 = osc freq (integer)
R1 = 06h
R1 = 86h (WDT feed, Rx2 & 66x only)
DPH = 00h
DPL = 01h – program boot vector
ACC = boot vector
Return Parameter
ACC = 00 if pass; not 00 if fails
Sample routine:
;***** Program Boot Vector (BV) *****
;***** DPTR indicates program boot vector *****
;***** ACC holds new value of boot vector to program *****
WRBV:
MOV
MOV
MOV
MOV
MOV
CALL
RET
AUXR1,#20H
R0,#11
R1,#06H
DPTR,#0001h
A,NEW_SB
PGM_MTP
;set the ENBOOT bit
;FOSC
;program status byte or boot vector
;specify boot vector
;new value for the boot vector
;execute the function
READ DEVICE DATA
Input Parameters:
R1 = 03h
R1 = 83h (WDT feed, Rx2 & 66x only)
DPTR = address of byte to read
Return Parameter
ACC = value of byte read
Sample routine:
;*****reads the Device Data (DData) *****
;***** DData returned in ACC *****
;***** DPTR holds address of byte to read *****
RDData:
MOV
AUXR1,#20H
MOV
R0,#11
MOV
R1,#03H
MOV
DPTR,Address
CALL
PGM_MTP
RET
;set the ENBOOT bit
;FOSC
;read data function
;specify address of byte to read
;execute the function