
Rev.2.00
Aug 28, 2006
page 20 of 148
7641 Group
REJ09B0336-0200
APPLICATION
2.2 Timer
2.2.3 Timer application examples
(1) Basic functions and uses
[Function 1] Control of event interval (Timer 1 to Timer 3, Timer X and Y: Timer mode)
When a certain time, by setting a count value to each timer, has passed, the timer interrupt request occurs.
<Use>
Generating of an output signal timing
Generating of a wait time
[Function 2] Control of cyclic operation (Timer 1 to Timer 3, Timer X and Y: Timer mode)
The value of the timer latch is automatically written to the corresponding timer each time the timer
underflows, and each timer interrupt request occurs in cycles.
<Use>
Generating of cyclic interrupts
Clock function (measurement of 1 s); see “(2) Timer application example 1”
Control of a main routine cycle
[Function 3] Output of rectangular waveform
(Timer 1, Timer 2, Timer X: Pulse output mode; Timer Y: TYOUT output)
The output levels of the TOUT, CNTR0 and CNTR1 pins are inverted each time the timer underflows.
<Use>
Piezoelectric buzzer output; see “(3) Timer application example 2”
Generating of the remote control carrier waveforms
[Function 4] Count of external pulses (Timer X, Timer Y: Event counter mode)
External pulses input to the CNTR0 pin and CNTR1 pin are respectively counted as the timer count
source (in the event counter mode).
<Use>
Frequency measurement; see “(4) Timer application example 3”
Division of external pulses
Generating of interrupts due to a cycle using external pulses as the count source; count of a reel pulse
[Function 5] Measurement of external pulse width 1 (Timer X: Pulse width measurement mode)
The “H” or “L” level width of external pulses input to CNTR0 pin is measured.
<Use>
Measurement of external pulse frequency (measurement of pulse width of FG pulse for a motor);
see “(5) Timer application example 4”
Measurement of external pulse duty (when the frequency is fixed)
FG pulse: Pulse used for detecting the motor speed to control the motor speed.
[Function 6] Measurement of external pulse width 2 (Timer Y: Period measurement mode)
The external pulse width input to CNTR1 pin is measured.
<Use>
Measurement of phase control signal; see “(6) Timer application example 5”