Interrupts; Sample Application - Hitachi H8/329 Series Hardware Manual

Single-chip microcomputer
Table of Contents

Advertisement

6.5 Interrupts

The free-running timer can request seven types of interrupts: input capture A to D (ICIA, ICIB,
ICIC, ICID), output compare A and B (OCIA and OCIB), and overflow (FOVI). Each interrupt is
requested when the corresponding enable and flag bits are set. Independent signals are sent to the
interrupt controller for each type of interrupt. Table 6-4 lists information about these interrupts.
Table 6-4. Free-Running Timer Interrupts
Interrupt
Description
ICIA
Requested when ICFA and ICIAE are set
ICIB
Requested when ICFB and ICIBE are set
ICIC
Requested when ICFC and ICICE are set
ICID
Requested when ICFD and ICIDE are set
OCIA
Requested when OCFA and OCIAE are set
OCIB
Requested when OCFB and OCIBE are set
FOVI
Requested when OVF and OVIE are set

6.6 Sample Application

In the example below, the free-running timer is used to generate two square-wave outputs with a
50% duty cycle and arbitrary phase relationship. The programming is as follows:
(1) The CCLRA bit in the TCSR is set to "1."
(2) Each time a compare-match interrupt occurs, software inverts the corresponding output level
bit in TOCR (OLVLA or OLVLB).
H'FFFF
OCRA
OCRB
H'0000
FTOA
FTOB
FRC
Figure 6-17. Square-Wave Output (Example)
137
Priority
High
Low
Clear counter

Advertisement

Table of Contents
loading

Table of Contents