NEC 78K0S/KB1+ User Manual page 319

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0S/KB1+:
Table of Contents

Advertisement

An example of a program when the interrupt-disabled time (from erasure to blank check) should be minimized in
self programming mode is shown below.
;---------------------------------------------------------------------
;START
;---------------------------------------------------------------------
FlashBlockErase:
; Sets erase command
MOV
FLCMD,#03H
MOV
FLAPH,#07H
MOV
FLAPL,#00H
MOV
FLAPHC,#07H
MOV
FLAPLC,#00H
CALL
!ModeOn
; Execution of erase command
MOV
PFS,#00H
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
CMP
A,#00H
BNZ
$StatusError
CALL
!ModeOff
; Sets blank check command
MOV
FLCMD,#04H
MOV
FLAPH,#07H
MOV
FLAPL,#00H
MOV
FLAPHC,#07H
MOV
FLAPLC,#0FFH
CALL
!ModeOn
; Execution of blank check command
MOV
PFS,#00H
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
CMP
A,#00H
BNZ
$StatusError
CHAPTER 19 FLASH MEMORY
; Sets flash control command (block erase)
; Sets number of block to be erased (block 7 is specified here)
; Fixes FLAPL to "00H"
; Sets erase block compare number (same value as that of FLAPH)
; Fixes FLAPLC to "00H"
; Shift to self programming mode
; Clears flash status register
; Clears & restarts WDT
; Self programming is started
; Checks erase error
; Performs abnormal termination processing when an error
; occurs
; Shift to normal mode
; Sets flash control command (block blank check)
; Sets block number for blank check (block 7 is specified here)
; Fixes FLAPL to "00H"
; Sets blank check block compare number (same value as that of
; FLAPH)
; Fixes FLAPLC to "FFH"
; Shift to self programming mode
; Clears flash status register
; Clears & restarts WDT
; Self programming is started
; Checks blank check error
; Performs abnormal termination processing when an error occurs
User's Manual U17446EJ3V1UD
319

Advertisement

Table of Contents
loading

Table of Contents