Panasonic F77G User Manual page 297

Microcomputer mn101c series
Table of Contents

Advertisement

7-9-2
Setup Example
Capture Function Setup Example (Timer 7)
Pulse width measurement is enabled by storing the value of the binary counter to the capture register at
the interrupt generation edge of the external interrupt 0 input signal with timer 7. The interrupt generation
edge is specified to be the rising edge.
An example setup procedure, with a description of each step is shown below.
External interrupt 0
IRQ 0 input
Figure 7-9-3
Setup Procedure
(1) Stop the counter.
TM7MD1 (x'3F78')
bp4
(2) Select the condition for timer clear.
TM7MD2 (x'3F79')
bp5
(3) Select the count clock source.
TM7MD1 (x'3F78')
bp1-0
bp3-2
(4) Select the capture trigger generation
interrupt source.
TM7MD2 (x'3F79')
bp1-0
(5) Select the interrupt generation valid
edge.
IRQ0ICR (x'3FE2')
bp5
Pulse Width Measurement of External Interrupt 0
: TM7EN
= 0
: TM7BCR = 1
: TM7CK1-0 = 00
: TM7PS1-0 = 00
: T7ICT1-0 = 00
: REDG0
= 1
interrupt
Pulse width to be measured
Description
(1) Set the TM7EN flag of the timer 7 mode
register 1 (TM7MD1) to "0" to stop timer 7
counting.
(2) Set the TM7BCR flag of the timer 7 mode
register 2 (TM7MD2) to "1" to select the
compare match as a clear source of binary
counter.
(3) Select fosc as clock source by the TM7CK1-0
flag of the TM7MD1 register. And select 1/1
(no dividing) of fosc as count clock source by
the TM7PS1-0 flag.
(4) Select the external interrupt 0 (IRQ0) input as
a generation source of capture trigger by the
T7ICT1-0 flag of the TM7MD2 register.
(5) Set the REDG0 flag of the external interrupt 0
control register (IRQ0ICR) to "1" to select the
rising edge as the interrupt generation valid
edge.
Chapter 7 16-bit Timer
interrupt
VII - 37
16-bit Timer Capture

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Panaxseries mn101c77cPanaxseries mn101f77g

Table of Contents