![](http://datasheet.mmic.net.cn/30000/M37902FHCGP_datasheet_2360019/M37902FHCGP_186.png)
TIMER A
7902 Group User’s Manual
9-23
9.4 Event counter mode
9.4.4 Selectable functions
The following describes the selectable pulse output, and two-phase pulse signal processing functions.
(1)
Pulse output function
The pulse output function is selected by setting the pulse output function select bit (bit 2 at addresses
5616 to 5A16) to “1.” When this function is selected, the TAiOUT pin is forcibly set for the pulse output
pin regardless of the corresponding bits of the port P5 and port P6 direction registers. The TAiOUT pin
outputs pulses of which polarity is inverted each time a counter underflow or overflow occurs. (Refer
to Figure 9.3.5).
When the count start bit (address 4016) is “0” (count stopped), the TAiOUT pin outputs “L” level.
In order to make the TA2OUT and TA3OUT pins serve as pulse output pins, be sure not to select the
key input interrupt pins (KI0 and KI2 pins), which are multiplexed with the above pins. (Refer to
“CHAPTER 8. KEY INPUT INTERRUPT.”)
(2)
Two-phase pulse signal processing function (Timers A2 to A4)
For timers A2 to A4, the two-phase pulse signal processing function is selected by setting the two-
phase pulse signal processing select bits (bits 5 to 7 at address 4416) to “1.” (See Figure 9.4.5.)
Figure 9.4.6 shows the timer A2/A3/A4 mode registers when the two-phase pulse signal processing
function is selected.
For timers with two-phase pulse signal processing function selected, the timer counts two kinds of
pulses of which phases differ by 90 degrees. There are two types of the two-phase pulse signal
processing: normal processing and quadruple processing. In timer A2 and A3, normal processing is
performed; in timer A4, quadruple processing is performed.
For the port P5 and P6 direction registers’ bits corresponding to the pins used for two-phase pulse
input, be sure to set these bits for the input mode.
Fig. 9.4.6 Timer A2/A3/A4 mode registers when two-phase pulse signal processing function is selected
1
00
0
1
Timer A2 mode register (Address 5816)
Timer A3 mode register (Address 5916)
Timer A4 mode register (Address 5A16)
b7
b6
b5
b4
b3
b2
b1
b0
! : It may be either “0” or “1.”
!!