NEC 78GK0S/K 1+ Series Application Note page 29

Sample program (watchdog timer) 131 ms interval runaway detection
Table of Contents

Advertisement

RETI
;-----------------------------------------------------------------------------
;
Subroutine for a 1 ms wait (for 4 MHz operation)
;
;This is a subroutine for performing a rendezvous in ms units by using
;software.
;This subroutine is called by the number of times required when performing a
;rendezvous in ms units.
;The time in ms units that is indicated with #num can be measured more
;accurately by setting as follows.
;area)
;
MOV
saddr,
;loopxx:
;
CALL
!WAIT_1MS
;
DBNZ
saddr,
;-----------------------------------------------------------------------------
WAIT_1MS:
PUSH
BC
MOV
B,
LOOP_220:
NOP
NOP
NOP
NOP
NOP
NOP
DBNZ
B,
NOP
NOP
POP
BC
RET
end
APPENDIX A PROGRAM LIST
; Return from interrupt servicing
#num
$loopxx
; Save the BC register data to the stack
#220
; Assign the 220-time loop count value
$LOOP_220
; 220-time loop for a 1 ms wait
; Restore the BC register data
; Return from the subroutine
Application Note U18847EJ1V0AN
(saddr: short direct addressable memory
29

Advertisement

Table of Contents
loading

This manual is also suitable for:

78k0s/ka1+78k0s/kb1+78k0s/ku1+78k0s/ky1+

Table of Contents