English
Language : 

HD6433308 Datasheet, PDF (161/349 Pages) Hitachi Semiconductor – Hitachi Single-Chip MicroComputer
6.5 Interrupts
The free-running timer channel 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-3 lists information about these
interrupts.
Table 6-3. Free-Running Timer Interrupts
Interrupt
ICIA
ICIB
ICIC
ICID
OCIA
OCIB
FOVI
Description
Requested when ICFA and ICIAE are set
Requested when ICFB and ICIBE are set
Requested when ICFC and ICICE are set
Requested when ICFD and ICIDE are set
Requested when OCFA and OCIAE are set
Requested when OCFB and OCIBE are set
Requested when OVF and OVIE are set
Priority
High
Low
6.6 Sample Application
In the example below, the free-running timer channel is used to generate two square-wave outputs
with a 50% duty factor 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
FRC
Clear counter
FTOA
FTOB
Figure 6-20. Square-Wave Output (Example)
146