13.4.3
Measurement of 8-Bit Timer Divided Waveform Period
The timer connection, TMR1, and FRT can be used to measure the period of an IHI signal divided
waveform. Since the TMR1 can be cleared by a rising edge of the inverted IVI signal, the rise and
fall of the IHI signal divided waveform can be synchronized with the IVI signal. This enables
period measurement to be carried out efficiently. Figure 13.8 shows a block diagram for the period
measurement of the 8-bit timer divided waveform.
To measure the period of an IHI signal divided waveform, TCNT of the TMR1 is set to count the
external clock (IHI signal) pulses and to be cleared on the rising edge of the external reset signal
(inverse of the IVI signal). The value to be used as the division ratio is written to TCORA, and the
TMO output method is specified by the OS bit in TCSR.
Examples of TCR and TCSR settings of the TMR1 and FRT are shown in table 13.7, and the
timing chart for measurement of the IVI signal and IHI signal divided waveform periods is shown
in figure 13.9. The period of the IHI signal divided waveform is given by (ICRD(3) – ICRD(2)) ×
resolution.
Internal clock
FRC
ICRB
Capture
Figure 13.8 Block Diagram for Measurement of 8-Bit Timer Divided Waveform Period
Control logic
FTIB
FRT
IVI signal
Clear
CMA
Control logic
TMO
Clear
CMB
TMR1
Rev. 1.00, 09/03, page 385 of 704
IHI signal
TCORA
Comparator A
TCNT
Clock
Comparator B
TCORB