|
HD6475328-CP10 Datasheet, PDF (235/459 Pages) Hitachi Semiconductor – original Hitachi CMOS microcomputer unit (MCU) | |||
|
◁ |
11.5 Sample Application
In the example below, the 8-bit timer is used to generate a pulse output with a selected duty factor.
The control bits are set as follows:
1. In the TCR, CCLR1 is cleared to â0â and CCLR0 is set to â1â so that the timer counter is
cleared when its value matches the constant in TCORA.
2. In the TCSR, bits OS3 to OS0 are set to â0110,â causing the output to change to â1â on
compare-match A and to â0â on compare-match B.
With these settings, the 8-bit timer provides output of pulses at a rate determined by TCORA with
a pulse width determined by TCORB. No software intervention is required.
HâFF
TCORA
TCORB
Hâ00
TMO pin
TCNT
Clear counter
Figure 11-8 Example of Pulse Output
219
|
▷ |