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

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0S/KU1+:
Table of Contents

Advertisement

Address: FF84H After reset: 00H R/W
Symbol
7
PMC2
0
PMC2n
0
1
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-11 allows operation as an interval timer.
Setting
The basic operation setting procedure is as follows.
<1> Set the CRC00 register (see Figure 6-11 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-11 for the set value).
Caution Changing the CR000 setting during TM00 operation may cause a malfunction. To change the
setting, refer to 6.5 Cautions Related to 16-Bit Timer/Event Counter 00 (17) Changing compare
register during timer operation.
Remark For how to enable the INTTM000 interrupt, see CHAPTER 10 INTERRUPT FUNCTIONS.
Interrupt requests are generated repeatedly using the count value set in 16-bit timer capture/compare register 000
(CR000) beforehand as the interval.
When the count value of 16-bit timer counter 00 (TM00) matches the value set to CR000, counting continues with
the TM00 value cleared to 0 and the interrupt request signal (INTTM000) is generated.
The count clock of the 16-bit timer/event counter can be selected using bits 0 and 1 (PRM000, PRM001) of
prescaler mode register 00 (PRM00).
92
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Figure 6-10. Format of Port Mode Control Register 2 (PMC2)
6
5
0
0
Port/Alternate-function (except A/D converter) mode
A/D converter mode
User's Manual U18172EJ2V0UD
4
3
0
PMC23
Specification of operation mode (n = 0 to 3)
2
1
PMC22
PMC21
PMC20
0

Advertisement

Table of Contents
loading

Table of Contents