2-11
3802 GROUP USER’S MANUAL
APPLICATION
2.2 Timer
2.2.3 Timer application examples
(1) Basic functions and uses
[Function 1]
Control of Event interval (Timer X, Timer Y, Timer 1, Timer 2)
The Timer count stop bit is set to “0” after setting a count value to a timer. Then a timer interrupt
request occurs after a certain period.
[Use] Generation of an output signal timing
Generation of a waiting time
[Function 2] Control of Cyclic operation (Timer X, Timer Y, Timer 1, Timer 2)
The value of a timer latch is automatically written to a corresponding timer every time a timer
underflows, and each cyclic timer interrupt request occurs.
[Use] Generation of cyclic interrupts
Clock function (measurement of 250m second)
Application example 1
Control of a main routine cycle
[Function 3]
Output of Rectangular waveform (Timer X, Timer Y)
The output level of the CNTR pin is inverted every time a timer underflows (Pulse output mode).
[Use] A piezoelectric buzzer output
Application example 2
Generation of the remote-control carrier waveforms
[Function 4]
Count of External pulse (Timer X, Timer Y)
External pulses input to the CNTR pin are selected as a timer count source (Event counter
mode).
[Use] Measurement of frequency
Application example 3
Division of external pulses.
Generation of interrupts in a cycle based on an external pulse.
(count of a reel pulse)
[Function 5]
Measurement of External pulse width (Timer X, Timer Y)
The “H” or “L” level width of external pulses input to CNTR pin is measured (Pulse width
measurement mode).
[Use] Measurement of external pulse frequency (Measurement of pulse width of FG pulseV gener-
ated by motor)
Application example 4
Measurement of external pulse duty (when the frequency is fixed)
VFG pulse : Pulse used for detecting the motor speed to control the motor speed.