Application Examples - Hitachi H8/3664 Hardware Manual

Table of Contents

Advertisement

Table 11.4 Timer V Interrupt Sources
Interrupt
CMIA
CMIB
OVI
11.3.3

Application Examples

Pulse Output with Arbitrary Duty Cycle: Figure 11.9 shows an example of output of pulses
with an arbitrary duty cycle. To set up this output:
• Clear bit CCLR1 to 0 and set bit CCLR0 to 1 in TCRV0 so that TCNTV will be cleared by
compare match with TCORA.
• Set bits OS3 to OS0 to 0110 in TCSRV so that the output will go to 1 at compare match with
TCORA and to 0 at compare match with TCORB.
• Set bits CKS2 to CKS0 in TCRV0 and bit ICKS0 in TCRV1 to select the desired clock source.
With these settings, a waveform is output without further software intervention, with a period
determined by TCORA and a pulse width determined by TCORB.
H'FF
TCORA
TCORB
H'00
TMOV
Description
Generated from CMFA
Generated from CMFB
Generated from OVF
TCNTV
Figure 11.9 Pulse Output Example
Vector Address
H'0022
Counter cleared
183

Advertisement

Table of Contents
loading

Table of Contents