Application Examples (16-Bit Timer/Event Counter) - NEC V850ES/SA2 UPD703201 Manual

32-bit single-chip microcontrollers
Table of Contents

Advertisement

7.1.6

Application examples (16-bit timer/event counter)

(1) Interval timer
By setting the TMCn0 and TMCn1 registers as shown in Figure 7-9, the 16-bit timer/event counter operates as
an interval timer that repeatedly generates interrupt requests with the value that was preset in the CCn0
register as the interval.
When the counter value of the TMn register matches the setting value of the CCn0 register, the TMn register is
cleared (0000H) and an interrupt request signal (INTCCn0) is generated at the same time that the count
operation resumes.
Remark n = 0, 1
Figure 7-9. Contents of Register Settings When 16-Bit Timer/Event Counter Is Used as Interval Timer
OVFn
CSn2 CSn1 CSn0
0/1
0/1
TMCn0
OSTn ENTOn ALVn ETIn CCLRn
TMCn1
0
0/1
Remarks 1. 0/1: Set to 0 or 1 as necessary
2. n = 0, 1
CHAPTER 7 TIMER/COUNTER FUNCTION
TMCEn TMCAEn
0/1
0/1
0
0
ECLRn
CMSn1 CMSn0
0/1
0/1
1
0
0/1
Preliminary User's Manual U15905EJ1V0UD
1
1
Supply input clocks to internal units
Enable count operation
1
Use CCn0 register as compare register
Clear TMn register due to match with
CCn0 register
Continue counting after TMn register
overflows
233

Advertisement

Table of Contents
loading

Table of Contents