177
CHAPTER 7 8-BIT TIMERS A0, B0
User’s Manual U15798EJ2V0UD
(2) Operation as external event counter with 16-bit resolution
The external event counter counts the number of external clock pulses input to the TMIB0/P07/TOA0 pin by TMA0
and TMB0.
To operate as an external event counter with 16-bit resolution, settings must be made in the following sequence.
<1>
Disable operation of 8-bit timer counter A0 (TMA0) and 8-bit timer counter B0 (TMB0) (TCEA0 = 0,
TCEB0 = 0).
<2>
Disable timer output of TOA0 and TOB0 (TOEA0 = 0, TOEB0 = 0).
<3>
Set P07 to input mode (PM07 = 1).
<4>
Select the external input clock for timer B0 (see
Table 7-6
).
<5>
Set the operation mode of timer A0 and timer B0 to 16-bit timer counter mode (see
Figures 7-4
and
7-
5
).
<6>
Set a count value in CRA0 and CRB0.
<7>
Enable the operation of TMA0 and TMB0 (TCEB0 = 1
Note
).
Note
Start and clear of the timer in the 16-bit timer counter mode are controlled by TCEB0 (the value of TCEA0
is invalid).
Each time the valid edge is input, the values of TMA0 and TMB0 are incremented.
When the count values of TMA0 and TMB0 simultaneously match the values set in CRA0 and CRB0 respectively,
both TMA0 and TMB0 are cleared to 00H and counting continues. At the same time, an interrupt request signal
(INTTMB0) is generated (INTTMA0 is not generated).
Figure 7-17 shows the timing of the external event counter operation.
Caution Be sure to stop the timer operation before overwriting the count clock with different data.
Содержание mPD780344 Series
Страница 2: ...2 User s Manual U15798EJ2V0UD MEMO...