![Hitachi H8/3152 Hardware Manual Download Page 70](http://html.mh-extra.com/html/hitachi/h8-3152/h8-3152_hardware-manual_140481070.webp)
66
instruction are correct. If they are not correct, EEPROM will be incorrectly written to due to
invalid register settings.
In this case, system operation can be stopped by writing 1 to the HLT flag, or the external systems
can be notified of the abnormal operation by outputting a signal to an I/O pin.
--- Example of program in EWE interrupt routine ---
EWEentry:
BTST #6, @TCSR ; reconfirmation
BEQ ERROR
MOV.W @(2,SP), R0
MOV.W #H'7B5C, R1
MOV.W #H'598F, R2
MOV.W @R0, R3
CMP.W R1, R3 ; EEPMOV instruction line check
BNE ERROR
MOV.W @(2,R0), R3
CMP.W R2, R3
BNE ERROR
MOV.W @(-18,R0), R2
CMP.W R2,R5 ; R5 set value check
BNE ERROR
RTE
ERROR:
MOV.B #H'FF, R0L
MOV.B R0L, @TCSR ; system halt
--- End ---