255
Chapter 9
Timer / Counter (Real Time Pulse Unit)
Preliminary User’s Manual U14913EE1V0UM00
9.1.6 Application
example
(1)
Interval timer
This section explains an example in which timer D is used as an interval timer with 16-bit precision.
Interrupt requests (TINTCMDn) are output at equal intervals (refer to Figure 9-6: TMD Compare
Operation Example). The setup procedure is shown below (n = 0, 1).
<1> Set (1) the CAE bit.
<2> Set each register.
• Select the count clock using the CS2 to CS0 bits of the TMCDn register.
• Set the compare value in the CMDn register.
<3> Start counting by setting (1) the CE bit.
<4> If the TMDn register and CMDn register values match, an TINTCMDn interrupt is generated.
<5> TINTCMDn interrupts are generated thereafter at equal intervals.
9.1.7 Precautions
Various precautions concerning timer D are shown below.
(1) To operate TMDn, first set (1) the CAE bit of the TMCDn register.
(2) Up
to
f
CPU
/2 clocks are required after a value is set in the CE bit of the TMCDn register until the
set value is transferred to internal units. When a count operation begins, the count cycle from
0000H to 0001H differs from subsequent count cycles.
(3) To initialize the TMDn register status and start counting again, clear (0) the CE bit and then set
(1) the CE bit after an interval of f
CPU
/2 clocks has elapsed.
(4) Up
to
f
CPU
/2 clocks are required until the value that was set in the CMDn register is transferred
to internal units. When writing continuously to the CMDn register, be sure to secure a time
interval of at least f
CPU
/2 clocks.
(5) The CMDn register can be overwritten only once during a timer/counter operation (from 0000H
until an TINTCMDn interrupt is generated due to a match of the TMDn register and CMDn reg-
ister). If this cannot be secured, make sure that the CMDn register is not overwritten during a
timer/counter operation.
(6) The count clock must not be changed during a timer operation. If the clock selection by CS2 to
CS0 bits is going to be changed, it should be overwritten after the CE bit is cleared (0). If the
count clock is changed during a timer operation, operation cannot be guaranteed.
(7) An TINTCMDn interrupt will be generated after an overflow if a value less than the counter
value is written in the CMDn register during TMDn register operation.
Remark:
n = 0, 1
Summary of Contents for V850E/CA1 ATOMIC
Page 6: ...6 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 52: ...52 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 144: ...144 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 162: ...162 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 224: ...224 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 308: ...308 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 512: ...512 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 564: ...564 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 566: ...566 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 584: ...584 Preliminary User s Manual U14913EE1V0UM00 MEMO ...