8-Bit Timers 50, 60 Operation; Operation As 8-Bit Timer Counter - NEC UPD789426 Series User Manual

8-bit single-chip microcontrollers
Table of Contents

Advertisement

7.4 8-Bit Timers 50, 60 Operation

7.4.1 Operation as 8-bit timer counter

Timer 50 and timer 60 can be independently used as 8-bit timer counters.
The following modes can be used for the 8-bit timer counter.
Interval timer with 8-bit resolution
External event counter with 8-bit resolution (timer 60 only)
Square wave output with 8-bit resolution
(1)
Operation as interval timer with 8-bit resolution
The interval timer with 8-bit resolution repeatedly generates an interrupt at a time interval specified by the
count value preset in 8-bit compare register n0 (CRn0).
To operate 8-bit timer n0 as an interval timer, settings must be made in the following sequence.
<1> Disable operation of 8-bit timer counter n0 (TMn0) (TCEn0 = 0).
<2> Disable timer output of TOn0 (TOEn0 = 0).
<3> Set a count value in CRn0.
<4> Set the operation mode of timer n0 to 8-bit timer counter mode (see Figures 7-4 and 7-5).
<5> Set the count clock for timer n0 (see Tables 7-3 and 7-4).
<6> Enable the operation of TMn0 (TCEn0 = 1).
When the count value of 8-bit timer counter n0 (TMn0) matches the value set in CRn0, TMn0 is cleared to
00H and continues counting. At the same time, an interrupt request signal (INTTMn0) is generated.
Tables 7-3 to 7-6 show interval time, and Figures 7-8 to 7-13 show the timing of the interval timer operation.
Caution Be sure to stop the timer operation before overwriting the count clock with different data.
Remark
n = 5, 6
150
CHAPTER 7 8-BIT TIMERS 50, 60
User's Manual U15075EJ2V1UD

Advertisement

Table of Contents
loading

Table of Contents