
96
CHAPTER 5 APPLICATIONS OF 16-BIT TIMER/EVENT COUNTER
(2) Example of use
PUBLIC CSTM
EXTRN
EXTBIT RPT,RMDTSET,IPDTFG
RMDATA,RPTCT
CSTM
EQU
9DH
CR00=#6290
TCL0=#00100000B
TMC0=#00001100B
SCS=#00000011B
CLR1
CLR1
CLR1
CLR1
PPR0
RPT
IPDTFG
RMDTSET
CLR1
EI
TMMK0
DT_TEST:
if_bit(RMDTSET)
CLR1
if_bit(RPT)
RMDTSET
;
;
;
Repeat processing
else
;
;
;
Processing when there is input
endif
else
if_bit(!RPT)
;
;
;
Processing when there is no input
endif
endif
; Remote controller custom code
; Sets 1.5 ms
; f
X
/128 as INTP0 sampling clock
; INTP0 with high priority
; Clears flag
; Enables timer interrupt