English
Language : 

W77LE532_07 Datasheet, PDF (83/88 Pages) Winbond – 8-BIT MICROCONTROLLER
W77LE532/W77L532A
21. APPLICATION NOTE
In-system Programming Software Examples
This application note illustrates the in-system programmability of the Winbond W77L532 Flash
EPROM microcontroller. In this example, microcontroller will boot from 64 KB APFLASH bank and
waiting for a key to enter in-system programming mode for re-programming the contents of 64 KB
APFLASH. While entering in-system programming mode, microcontroller executes the loader program
in 4KB LDFLASH bank. The loader program erases the 64 KB APFLASH then reads the new code
data from external SRAM buffer (or through other interfaces) to update the 64KB APFLASH.
If the customer uses the reboot mode to update his program, please enable this b3 or b4 of security
bits from the writer. Please refer security bits for detail descrption
EXAMPLE 1:
;*******************************************************************************************************************
;* Example of 64K APFLASH program: Program will scan the P1.0. if P1.0 = 0, enters in-system
;* programming mode for updating the content of APFLASH code else executes the current ROM
code.
;* XTAL = 24 MHz
;*******************************************************************************************************************
.chip 8052
.RAMCHK OFF
.symbols
CHPCON
TA
SFRAL
SFRAH
SFRFD
SFRCN
EQU
EQU
EQU
EQU
EQU
EQU
9FH
C7H
ACH
ADH
AEH
AFH
ORG 0H
LJMP 100H
; JUMP TO MAIN PROGRAM
;************************************************************************
;* TIMER0 SERVICE VECTOR ORG = 000BH
;************************************************************************
ORG 00BH
CLR TR0
; TR0 = 0, STOP TIMER0
MOV TL0, R6
MOV TH0, R7
RETI
;************************************************************************
;* 64K APFLASH MAIN PROGRAM
;************************************************************************
ORG 100H
MAIN_64K:
MOV A,P1
; SCAN P1.0
ANL A, #01H
CJNE A, #01H,PROGRAM_64K
JMP NORMAL_MODE
; IF P1.0 = 0, ENTER IN-SYSTEM PROGRAMMING MODE
- 83 -
Publication Release Date: February 1, 2007
Revision A7