Panasonic MN101C77C, F77G user manual VI 38 Simple Pulse Width Measurement

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 252
Image 252

Chapter 6 8-bit Timers

 

Setup Procedure

 

 

Description

 

 

 

 

 

(7)

Enable the interrupt.

 

(7)

Set the IRQ2IE flag of the IRQ2ICR register to

 

IRQ2ICR (x'3FE4')

 

 

"1" to enable the interrupt.

 

bp1

:IRQ2IE

= 1

 

 

(8)

Enable the timer operation.

(8)

Set the TM0EN flag of the TM0MD register to

 

TM0MD (x'3F54')

 

 

"1" to enable timer 0 operation.

 

bp3

:TM0EN

= 1

 

 

 

 

 

 

 

 

TM0BC starts to count up with negative edge of the external interrupt 2 (IRQ2) input as a trigger. Timer 0 continues to count up during "L" period of IRQ2 input, then stop the counting with positive edge of IRQ2 input as a trigger. At the same time, reading the value of TM0BC by interrupt handling can detects "L" period.

VI - 38 Simple Pulse Width Measurement

Page 252
Image 252
Panasonic MN101C77C, F77G user manual VI 38 Simple Pulse Width Measurement