English
Language : 

UPD17717 Datasheet, PDF (381/408 Pages) NEC – 4-BIT SINGLE-CHIP MICROCONTROLLERS WITH DEDICATED HARDWARE FOR DIGITAL TUNING SYSTEM
µPD17717, 17718, 17719
21.7.3 Power failure detection by RAM judgment method
By the RAM judgment method, a power failure is detected by judging whether the contents of the data memory
at a specific address are a specific value when the device has been reset.
An example of a program that detects a power failure by RAM judgment method is shown below.
By the RAM judgment method, a power failure is detected by comparing an “undefined” value and a “specific” value
because the contents of the data memory are “undefined” on application of supply voltage VDD.
Therefore, a power failure may be judged by mistake by this method as described in 21.7.4 Cautions on power
failure detection by RAM judgment method.
Example Program example of power failure detection by RAM judgment method
M012
M034
M056
M107
M128
M16F
DATA0
DATA1
DATA2
DATA3
DATA4
DATA5
MEM
MEM
MEM
MEM
MEM
MEM
DAT
DAT
DAT
DAT
DAT
DAT
0.12H
0.34H
0.56H
1.07H
1.28H
1.6FH
1010B
0101B
0110B
1001B
1100B
0011B
START:
; INITIAL:
SET2
SUB
SUB
SUB
BANK1
SUB
SUB
SUB
BANK0
SKF1
BR
CMP, Z
M012, #DATA0
M034, #DATA1
M056, #DATA2
M107, #DATA3
M128, #DATA4
M16F, #DATA5
Z
BACKUP
Initial processing
BACKUP:
MOV
MOV
MOV
BANK1
MOV
MOV
MOV
BR
M012, #DATA0
M034, #DATA1
M056, #DATA2
M107, #DATA3
M128, #DATA4
M16F, #DATA5
MAIN
Backup processing
MAIN:
Main processing
; If M012 = DATA0, and
; M034 = DATA1, and
; M056 = DATA2, and
; M107 = DATA3, and
; M128 = DATA4, and
; M16F = DATA5,
; branches to BACKUP
381