English
Language : 

DS80C320-MCG Datasheet, PDF (157/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
EXAMPLE: A TRANSIENT CAUSES THE WATCHDOG TO BE DISABLED
TABLE_READ:
C2D2 90 0A 00
MOV
DPTR, 0A00H
;LOAD TABLE POINTER
C2D5 79 FF
MOV R1, #0FFH
;LOAD COUNTER
C2D7 78 90
MOV R0, #90H
;DESTINATION POINTER
C2D9
C2DA
C2DB
C2DC
C2DD
E0
F6
06
A3
D9 C2 D9
LOOP:
MOVX
MOV
INC
INC
DJNZ
A, @DPTR
@R0, A
R0
DPTR
R1, LOOP
;READ DATA BYTE
;STORE IT IN RAM
;NEXT TABLE LOCATION
;NEXT DATA VALUE
;NEXT BYTE OR DONE ?
A transient occurs while the opcode is being fetched for the first instruction. The transient causes one bit
of the opcode in the first instruction to be read as a 0 instead of 1. The resulting program is what the
microcontroller would actually execute:
TABLE_READ:
C2D2 80 0A 00
C2D5 79 FF
C2D7 78 90
SJMP
MOV
MOV
0BH
R1, #0FFH
R0, #90H
;RELATIVE JUMP BY 10 LOCATIONS
;LOAD COUNTER
;DESTINATION POINTER
C2D9 E0
C2DA F6
C2DB 06
C2DC A3
C2DD D9 C2 D9
LOOP:
MOVX
MOV
INC
INC
DJNZ
A, @DPTR
@R0, A
R0
DPTR
R1, LOOP
;READ DATA BYTE
;STORE IT IN RAM
;NEXT TABLE LOCATION
;NEXT DATA VALUE
;NEXT BYTE OR DONE ?
The resulting jump is to address C2DE. This is not even a real opcode, but would be treated as such. The
resulting fetch is the value C2 D9. This is the opcode for CLR D9h. The bit addressable location D9h
corresponds to the EWT - Enable Watchdog Timer. If the Timed Access procedure did not prevent it,
this errant instruction would disable the Watchdog. Note that now, the program execution is completely
lost. Real opcodes are being replaced by operands, data and garbage. In the High-Speed Microcontroller,
the Watchdog will recover from this state as soon as it times out since it could not have been disabled in
this way.
In the High-Speed Microcontroller it is very hard to contrive a situation that will accidentally disable the
Watchdog. Note, the Timed Access prevents accidentally writing a bit. It can not prevent accidentally
calling the correct code that writes a bit. This is much more unlikely however.
157 of 175