m37905 Renesas Electronics Corporation., m37905 Datasheet - Page 173

no-image

m37905

Manufacturer Part Number
m37905
Description
Mitsubishi 16-bit Single-chip Microcomputer 7700 Family / 7900 Series
Manufacturer
Renesas Electronics Corporation.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
m37905F8CSP
Manufacturer:
MIT
Quantity:
20 000
TIMER B
8.5 Pulse period/Pulse width measurement mode
Fig. 8.5.2 Initial setting example for registers relevant to pulse period/pulse width measurement mode
8-22
8.5.1 Setting for pulse period/pulse width measurement mode
Figure 8.5.2 shows an initial setting example for registers relevant to the pulse period/pulse width measurement
mode.
Note that when using interrupts, set up to enable the interrupts. For details, refer to “CHAPTER 6.
INTERRUPTS.”
Setting port P5 direction register
b7
b0
Pin TB0
Pin TB1
Pin TB2
Port P5 direction register (Address D
Notes 1: When using timer B2, be sure to clear the timer B2 clock source select bit (See Figure 8.4.2.) to “0.”
When a pin is allocated to a port P5 pin (Note 3)
b7
Setting interrupt priority level
Selecting pulse period/pulse width measurement mode and each function
b7
IN
IN
IN
2: The timer Bi overflow flag is a read-only bit. This bit is undefined after reset. When a value is written to the timer Bi mode register
3: By using bits 0 to 2 of the port P2 pin function control register (address AE
with the count start bit = “1,” this bit will be cleared to “0.”
Clear the coressponding bit to “0.”
Setting count start bit to “1”
b7
7905 Group User’s Manual Rev.1.0
1 0
b0
b0
Measurement mode select bits
Count source select bits
Selection of pulse period/pulse width measurement mode
b3 b2
0 0 : Pulse period measurement (Interval between falling edges
0 1 : Pulse period measurement (Interval between rising edges
1 0 : Pulse width measurement
1 1 : Do not select.
Count-type select bit
0: Counter clear type
1: Free-run type
Timer Bi overflow flag (Note 2)
0: No overflow
1: Overflowed
Timer Bi mode register (i = 0 to 2)
(Addresses 5B
b7b6
0 0 : f
0 1 : f
1 0 : f
1 1 : f
Interrupt priority level select bits
When using interrupts, set these bits to one of levels 1 to 7.
When disabling interrupts, set these bits to level 0.
Timer Bi interrupt control register (i = 0 to 2)
(Addresses 7A
16
of measurement pulse)
of measurement pulse)
b0
)
2
16
64
512
Timer B0 count start bit
Timer B1 count start bit
Timer B2 count start bit
Count start register 0
(Address 40
Setting port P2 direction register
16
b7
16
to 5D
to 7C
16
16
)
16
) (Note 1)
)
16
b0
), be sure to set the pin allocation. (See Figure 8.2.5.)
Pin TB0
Pin TB1
Pin TB2
Port P2 direction register (Address 8
When a pin is allocated to a port P2 pin (Note 3)
IN
IN
IN
Clear the coressponding bit to “0.”
Count starts.
16
)

Related parts for m37905