Counting Operation If Timer Is Started When Tmi Is High - NEC PD789860 User Manual

8-bit single-chip microcontrollers pd789860 subseries; pd789861 subseries
Table of Contents

Advertisement

(2)
Count value if external clock input from TMI pin is selected
When the external clock signal input from the TMI pin is selected as the count clock, the count value may
start from 01H if the timer is enabled (TCE40 = 0 → 1) while the TMI pin is high. This is because the input
signal of the TMI pin is internally ANDed with the TCE40 signal. Consequently, the counter is incremented
because the rising edge of the count clock is input to the timer immediately when the TCE40 pin is set.
Depending on the delay timing, the count value is incremented by one if the rising edge is input after the
counter is cleared. Counting is not affected if the rising edge is input before the counter is cleared (the
counter operates normally).
Use the timer being aware that it has an error of one count, or take either of the following actions A or B.
<Action A> Always start the timer when the TMI pin is low.
<Action B> Save the count value to a control register when the timer is started, SUB the count value with the
count value saved to the control register when reading the count value, and take the result of
SUB as the true count value.
Figure 9-25. Counting Operation if Timer Is Started When TMI Is High
TCE40
flag
TMI
H
(3)
Setting of 8-bit compare register n0
8-bit compare register n0 (CRn0) can be cleared to 00H.
Therefore, one pulse can be counted when the 8-bit timer operates as an event counter.
Figure 9-26. Timing of Operation as External Event Counter (8-Bit Resolution)
TMI input
CR40
TM40
count value
Interrupt request flag
CHAPTER 9 8-BIT TIMERS 30 AND 40
Rising edge
detector
00H
User's Manual U14826EJ5V0UD
Increment
Counter
00H
00H
00H
Clear
00H
117

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd78e9861aPd78e9860aPd789860(a)Pd789861

Table of Contents