NEC 78K0S/K 1+ Series Application Note page 20

External event counter
Hide thumbs Also See for 78K0S/K 1+ Series:
Table of Contents

Advertisement

[Excerpt from this sample program source]
An excerpt from
APPENDIX A PROGRAM
shown below (same contents as in
(1) Assembly language
EVENTCNT
XMAIN CSEG
RESET_START:
Setting the external
event counter
compare value
MOV
MOVW
MOVW
Setting the count
clock
MOV
TI000 pin
MOV
Starting timer
MOV
operation
match between TM00 and CR000)
MOV
CLR1
Clearing the
INTTM000
EI
interrupt request
flag
MAIN_LOOP:
NOP
BR
INTERRUPT_TM000:
XOR
RETI
interrupt servicing
end
by INTTM000
20
CHAPTER 4 SETTING METHODS
LIST, which is related to the 16-bit timer/event counter 00 function, is
[Example
1] mentioned above).
EQU
10
UNIT
CRC00, #00000000B
AX,
#EVENTCNT-1
CR000, AX
PRM00, #00000011B
TOC00, #00000000B
TMC00, #00001100B
IF0,
#00H
TMMK000
Enabling
INTTM000
interrupt
servicing
$MAIN_LOOP
P4,
#00000001B
Starting
interrupt
generation
Application Note U18888EJ1V0AN
; Timer 00 external event counter compare value
Setting the operation
mode of CR000 as a compare
register
; Use CR000 as a compare register
; Set the compare value
; Set the compare value
; Set the count clock as the falling edge of the
; Do not perform timer output
; Start the timer operation (clear & start upon a
; Clear invalid interrupt requests in advance
; Unmask INTTM000 interrupts
; Enable vector interrupt
; Go to the MAIN_LOOP
; Reverse the LED output
; Return from interrupt servicing

Advertisement

Table of Contents
loading

This manual is also suitable for:

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

Table of Contents