Datasheet

Table Of Contents
Section 13 Timer G
Rev. 2.00 Jul. 04, 2007 Page 269 of 692
REJ09B0309-0200
When the pin function is switched and an edge is generated in the input capture input signal, if this
edge matches the edge selected by the input capture interrupt select (IIEGS) bit, the interrupt
request flag will be set to 1. The interrupt request flag should therefore be cleared to 0 before use.
Figure 13.8 shows the procedure for handling of the port mode register and clearing of the
interrupt request flag. When switching the pin function, set the interrupt-disabled state before
handling the port mode register, then, after the port mode register operation has been performed,
wait for the time required to confirm the input capture input signal as an input capture signal (at
least two system clocks when the noise canceller is not in use; at least five sampling clocks when
the noise canceller is used), before clearing the interrupt enable flag to 0. There are two ways of
preventing interrupt request flag setting when the pin function is switched: by controlling the pin
level so that the conditions shown in tables 13.4 and 13.5 are not satisfied, or by setting the
opposite of the generated edge in the IIEGS bit in TMG.
Set I bit in CCR to 1
Manipulate port mode register
*
TMIG confirmation time
Clear interrupt request flag to 0
Clear I bit in CCR to 0
Disable interrupts. (Interrupts can also be disabled by
manipulating the interrupt enable bit in interrupt enable
register 2.)
After manipulating the port mode register, wait for the
TMIG confirmation time
*
(at least two system clocks when
the noise canceler is not used; at least five sampling
clocks when the noise canceler is used), then clear the
interrupt enable flag to 0.
Enable interrupts
Figure 13.8 Port Mode Register Manipulation and Interrupt Enable Flag Clearing
Procedure