NEC V854 UPD703006 User Manual page 202

32/16-bit single-chip microcontroller hardware
Table of Contents

Advertisement

CHAPTER 7 TIMER/COUNTER FUNCTION (REAL-TIME PULSE UNIT)
Figure 7-31. Example of Set-up Procedure for Frequency Measurement
Figure 7-32. Example of Interrupt Request Processing Routine Calculating Cycle
202
Cycle measurement initial setting
Setting of TMC00 register
Setting of TMC01 register
TMC01. CMS00 ← 0
Setting of INTM1 register
INTM1. ES01 ← 0
INTM1. ES00 ← 1
Initialization of buffer memory
for capture data storage
X0 ← 0
Count starts
TMC00. CE0 ← 1
Enables interrupt
INTP00 interrupt
INTP00 interrupt processing
Calculation of cycle
Yn1 = (10000H – X
) + CC00
n–1
tn = Yn x count clock cycle
Stores nth capture data to
buffer memory
Xn ← CC00
RETI
User's Manual U11969EJ3V0UM00
; Specifies count clock of TM0
; Specifies CC00 register
as capture register
; Specifies rising edge as valid
edge of INTP00 signal
; Sets CE0 bit to 1
; tn : cycle

Advertisement

Table of Contents
loading

Table of Contents