Operation Of 16-Bit Timer/Event Counter 00; Interval Timer Operation - NEC 78K0 User Manual

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0:
Table of Contents

Advertisement

6.4 Operation of 16-Bit Timer/Event Counter 00

6.4.1 Interval timer operation

Setting 16-bit timer mode control register 00 (TMC00) and capture/compare control register 00 (CRC00) as shown
in Figure 6-10 allows operation as an interval timer.
Setting
The basic operation setting procedure is as follows.
<1> Set the CRC00 register (see Figure 6-10 for the set value).
<2> Set any value to the CR000 register.
<3> Set the count clock by using the PRM00 register.
<4> Set the TMC00 register to start the operation (see Figure 6-10 for the set value).
Caution CR000 cannot be rewritten during TM00 operation.
Remark For how to enable the INTTM000 interrupt, see CHAPTER 15 INTERRUPT FUNCTIONS.
Interrupt requests are generated repeatedly using the count value preset in 16-bit timer capture/compare register
000 (CR000) as the interval.
When the count value of 16-bit timer counter 00 (TM00) matches the value set in CR000, counting continues with
the TM00 value cleared to 0 and the interrupt request signal (INTTM000) is generated.
The count clock of 16-bit timer/event counter 00 can be selected with bits 0 and 1 (PRM000, PRM001) of prescaler
mode register 00 (PRM00).
Figure 6-10. Control Register Settings for Interval Timer Operation (1/2)
7
6
TMC00
0
0
7
6
CRC00
0
0
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
(a) 16-bit timer mode control register 00 (TMC00)
5
4
TMC003
TMC002
TMC001
0
0
1
1
0/1
(b) Capture/compare control register 00 (CRC00)
5
4
3
CRC002
CRC001
0
0
0
1
0/1
User's Manual U16227EJ2V0UD
OVF00
0
Clears and starts on match between TM00 and CR000.
CRC000
0
CR000 used as compare register
CR010 used as capture register
135

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

78kc1

Table of Contents