W78E516B-24 Winbond, W78E516B-24 Datasheet - Page 22

no-image

W78E516B-24

Manufacturer Part Number
W78E516B-24
Description
8-BIT MICROCONTROLLER
Manufacturer
Winbond
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
W78E516B-24
Quantity:
5 530
Part Number:
W78E516B-24
Manufacturer:
WINBOND
Quantity:
5 120
Part Number:
W78E516B-24
Manufacturer:
SAM
Quantity:
2 000
Part Number:
W78E516B-24
Manufacturer:
WINBOND/华邦
Quantity:
20 000
Application Note: In-system Programming Software Examples
This application note illustrates the in-system programmability of the Winbond W78E516B MTP-ROM
microcontroller. In this example, microcontroller will boot from 64 KB APROM bank and waiting for a
key to enter in-system programming mode for re-programming the contents of 64 KB APROM. While
entering in-system programming mode, microcontroller executes the loader program in 4KB LDROM
bank. The loader program erases the 64 KB APROM then reads the new code data from external
SRAM buffer (or through other interfaces) to update the 64KB APROM.
EXAMPLE 1:
;*******************************************************************************************************************
;* Example of 64K APROM program: Program will scan the P1.0. if P1.0 = 0, enters in-system
;* programming mode for updating the content of APROM code else executes the current ROM code.
;* XTAL = 40 MHz
;*******************************************************************************************************************
MAIN_64K:
PROGRAM_64K:
;************************************************************************
;* TIMER0 SERVICE VECTOR ORG = 000BH
;************************************************************************
;************************************************************************
;* 64K APROM MAIN PROGRAM
;************************************************************************
ORG 100H
MOV A,P1
ANL A,#01H
CJNE A,#01H,PROGRAM_64K ; IF P1.0 = 0, ENTER IN-SYSTEM PROGRAMMING MODE
JMP NORMAL_MODE
.chip 8052
.RAMCHK OFF
.symbols
CHPCON
CHPENR
SFRAL
SFRAH
SFRFD
SFRCN
ORG
LJMP
ORG
CLR
MOV
MOV
RETI
MOV TCON,#00H
MOV CHPENR,#87H
MOV CHPENR,#59H
MOV CHPCON,#03H
MOV IP,#00H
MOV IE,#82H
MOV R6,#FEH
00BH
0H
100H
TR0
TL0,R6
TH0,R7
EQU
EQU
EQU
EQU
EQU
EQU
C5H
BFH
F6H
C4H
C6H
C7H
; JUMP TO MAIN PROGRAM
; TR0 = 0, STOP TIMER0
; SCAN P1.0
; CHPENR = 87H, CHPCON REGISTER WRTE ENABLE
; CHPENR = 59H, CHPCON REGISTER WRITE ENABLE
; CHPCON = 03H, ENTER IN-SYSTEM PROGRAMMING MODE
; TR = 0 TIMER0 STOP
; IP = 00H
; TIMER0 INTERRUPT ENABLE FOR WAKE-UP FROM IDLE MODE
; TL0 = FEH
- 22 -
W78E516B

Related parts for W78E516B-24