beautypg.com

Kontron PB-TIM2 User Manual

Page 15

background image

PB-TIM2 User’s Manual

Chapter 2 Functional Description

2.3.4 Period Measurement

The timer is cleared by the software which also authorizes counting. When input (B) is valid (level sensitive gate) i.e.
goes high, the timer starts counting until input (B) goes low again at which point an event interrupt is generated (IRQ
plus flag).

2.3.5 Frequency Measurement

The mode is the same as the one described in 2.3.4 above except that input (B) toggles on the rising and falling edges.

2.3.6 Square Wave Generation

The value of half the square wave period is stored in the comparator/preload register with the timer being reloaded and the
output toggling on each zero detection.

2.3.7 PWM Generation

For this mode, two of the three timers are required with each providing one part of the signal. The timer modes need to be
set to single shot with an internal link between the two timers. This procedure is explained in more detail in the section
on programming.

2.3.8 Input Signal Edge Sampling

After a reset, the timer operates in free run mode. At each edge detection on the (A) input, the current timer value is stored
in the counter register and an event interrupt is generated (IRQ and flag).

2.3.9 Event Signal Duration

After a reset, the timer operates in free run mode when the (B) gate input is active. A preset value can be placed in the
preset/comparator register that will react when the gate has been active for a given number of cycles. The counter value
returns the cumulated time of the active input (B) and in the event of an overrun, an external event interrupt can be
generated (IRQ and flag).

July 30, 1997

© 1996 PEP Modular Computers

Page 2-5