p89c668hbbd NXP Semiconductors, p89c668hbbd Datasheet - Page 69

no-image

p89c668hbbd

Manufacturer Part Number
p89c668hbbd
Description
80c51 8-bit Flash Microcontroller Family
Manufacturer
NXP Semiconductors
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
P89C668HBBD
Manufacturer:
TI
Quantity:
25 600
Part Number:
P89C668HBBD
Manufacturer:
PHILPS
Quantity:
500
Company:
Part Number:
P89C668HBBD
Quantity:
271
Part Number:
p89c668hbbd/00,557
Manufacturer:
NXP Semiconductors
Quantity:
10 000
Philips Semiconductors
In Application Programming Method
Several In Application Programming (IAP) calls are available for use
by an application program to permit selective erasing and
programming of Flash sectors. All calls are made through a common
interface, PGM_MTP. The programming functions are selected by
setting up the microcontroller’s registers before making a call to
PGM_MTP at FFF0H. The oscillator frequency is an integer number
rounded down to the nearest megahertz. For example, set R0 to 11
for 11.0592 MHz. Results are returned in the registers. The IAP calls
are shown in Table 15.
Table 15. IAP calls
2002 Oct 28
80C51 8-bit Flash microcontroller family
16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM
PROGRAM DATA BYTE
ERASE BLOCK
IAP CALL
Input Parameters:
Return Parameter
Sample routine:
Input Parameters:
Return Parameter
Sample routine:
R0 = osc freq (integer)
R1 = 02h
R1 = 82h (WDT feed, Rx2 & 66x only)
DPTR = address of byte to program
ACC = byte to program
ACC = 00 if pass, !00 if fail
;***** Program Device Data (DData) *****
;***** ACC holds data to write
;***** DPTR holds address of byte to write *****
;***** Returns with ACC = 00h if successful, else ACC NEQ 00h
WRData:
R0 = osc freq (integer)
R0 = 0 (QUICK ERASE, Rx2 & 66x only)
R1 = 01h
R1 = 81h (WDT feed, Rx2 & 66x only; can only be used with Quick Erase)
DPH = block code as shown below:
DPL = 00h
none
;***** Erase Code Memory Block *****
;***** DPH (7:5) indicates which of the 5 blocks to erase
;***** DPTR values for the blocks are:
;
;
;
;
;
ERSBLK:
0000h = block 0
2000h = block 1
4000h = block 2
8000h = block 3
C000h = block 4
block 0,
block 1,
block 2, 16k to 32k, 40H
block 3, 32k to 48k, 80H
block 4, 48k to 64k, C0H
MOV
MOV
MOV
MOV
MOV
CALL
RET
MOV
MOV
MOV
MOV
CALL
RET
AUXR1,#20H
R0, #11
R1,#02H
A,Mydata
DPTR,Address
PGM_MTP
AUXR1,#20H
R0, #11
R1,#01H
DPTR,#BLk_NUM
PGM_MTP
0k to
8k to 16k, 20H
69
8k, 00H
Using the Watchdog Timer (WDT)
The 89C66x devices support the use of the WDT in IAP. The user
specifies that the WDT is to be fed by setting the most significant bit
of the function parameter passed in R1 prior to calling PGM_MTP.
The WDT function is only supported for Block Erase when using the
Quick Block Erase. The Quick Block Erase is specified by
performing a Block Erase with register R0 = 0. Requesting a WDT
feed during IAP should only be performed in applications that use
the WDT since the process of feeding the WDT will start the WDT if
the WDT was not working.
PARAMETER
;set the ENBOOT bit
;FOSC
;program data function
;data to write
;specify address of byte to read
;execute the function
;set the ENBOOT bit
;FOSC
;erase block
;specify which block
;execute the function
P89C660/P89C662/P89C664/
P89C668
Product data

Related parts for p89c668hbbd