English
Language : 

UPD17072 Datasheet, PDF (192/226 Pages) NEC – 4-BIT SINGLE-CHIP MICROCONTROLLER WITH HARDWARE FOR DIGITAL TUNING SYSTEM
µPD17072,17073
Example 1.
R1
R2
R3
R4
M1
M2
MEM
MEM
MEM
MEM
MEM
MEM
0.01H
0.02H
0.03H
0.04H
0.11H
0.12H
; 1st digit of input data of security code
; 2nd digit of input data of security code
; Data of 1st digit when security code is changed
; Data of 2nd digit when security code is changed
; 1st digit of current security code
; 2nd digit of current security code
START:
MAIN:
Key input processing
R1 ← Key A contents
R2 ← Key B contents
SET2
CMP, Z
SUB
R1, M1
SUB
R2, M2
SKT1
Z
BR
ERROR
Key input processing
R3 ← Key C contents
R4 ← Key D contents
ST
M1, R3
ST
M2, R4
BR
MAIN
; <1>
; Waits for key input of
; security code
; Substitutes contents of pressed code into R1 and R2
; Compares security code with input data
; Input data is different from security code
; <2>
; <3>
; Security code rewriting mode
; Substitutes contents of
; pressed key into R3 and R4
; Rewrites security code
ERROR:
Does not operate
Suppose the security code is “12H” in this example. Then the contents of the data memory addresses M1 and
M2 are “1H” and “2H”, respectively.
When the CE reset is effected at this time, the contents of the key input in <1> are compared with the security code
“12H”, and if they are the same, the ordinary processing is performed.
When the security code is changed by the main processing, the new code is rewritten to M1 and M2 in <2> and
<3>.
Suppose the security code is changed to “34H”. Then “3H” and “4H” are written to M1 and M2 in <2> and <3>.
However, if the CE reset happens to occur when <2> has been executed, the program is started from address
0000H without <3> executed.
Consequently, the security code is changed to “32H”, which is not intended, and security cannot be released.
In this case, use the program shown in Example 2.
192