Fujitsu MB89950/950A Pager User Manual


 
142
CHAPTER 8 PULSE WIDTH COUNT TIMER (PWC)
8.1 Overview of Pulse Width Count Timer
The pulse width count timer (PWC) can be selected to function as either an interval
timer or the pulse width measurement. The interval timer function counts down in
synchronous with one of three internal count clocks. The pulse width measurement
function measures the width of pulses input to an external pin.
Therefore, the PWC can be used as an input capture by continuously measuring the
pulse width of an external input.
Interval timer function
The interval timer function generates repeated interrupts at variable time intervals.
The interval timer can operate with a cycle among 1 and 2
8
times the internal count clock cycle.
The internal count clock can be selected from three different clocks.
Two operating modes are available: reload timer mode (continuous operation) and one-shot mode (one-
time operation).
Table 8.1-1 "Interval time range" lists the available interval time and square wave output ranges.
The following shows an example of the interval time.
For a 5 MHz main clock oscillation (F
CH
), a PWC reload buffer register (RLBR) value of "DD
H
(221)",
and a count clock cycle of one instruction cycle, the interval time and square wave output frequency are
calculated as follows:
Table 8.1-1 Interval time range
Internal count clock cycle Interval time Square wave output (Hz)
1 t
inst
1 t
inst
to 2
8
t
inst
1/(2 t
inst
) to 1/(2
9
t
inst
)
4 t
inst
2
2
t
inst
to 2
10
t
inst
1/(2
3
t
inst
) to 1/(2
11
t
inst
)
32 t
inst
2
5
t
inst
to 2
13
t
inst
1/(2
6
t
inst
) to 1/(2
14
t
inst
)
t
inst
: Instruction cycle (divide-by-four main clock oscillation)
Interval time = (1 x 4/FCH) x (RLBR register value)
= (4/5 MHz) x 221
= 176.8 s
RLBR register value of "00H" is assumed as 256.