20.2.2.3 Flash Read Mode
Figure 20-4. Flow Chart for “Flash Read”
Start
ISPEN=1 (enable ISP function),
and initialize ISPCR[2:0]
Refer to Table 20-2
to initialize ISPCR[2:0]
IFMT=0x01 (select Read Mode)
Address=0x0000
Address=Address+1
IFADRH= High-byte of Byte_address
IFADRL= Low-byte of Byte_address
SCMD=0x46, then SCMD=0xB9
(trigger ISP processing by sequential
writing)
Now, the read data will exist in IFD
NO
Check if the
read data correct ?
YES
NO
End of address?
YES
ISP fail
ISP pass
Demo code for triggering the “Read Mode”
MOV
ISPCR,#10000011b ;ISPCR.7=1, enable ISP
;ISPCR[2:0]=011, suppose MPC82-series running @11.0592MHz
MOV
IFMT,#01h
;select Read Mode
MOV
MOV
IFADRH,??
IFADRL,??
;fill [IFADRH,IFADRL] with byte address
;
MOV
MOV
SCMD,#46h
SCMD,#0B9h
;trigger ISP processing
;
;Now, MCU will halt here until processing completed
MOV
CJNE
;...
A,IFD
A,??,isp_error
;now, the read data exists in IFD
;and, the user can check if the data is correct
isp_error:
JMP
$
101
MPC82G516A Data Sheet
MEGAWIN