APPLICATION
2.3 Timer X and timer Y
3825 GROUP USER’S MANUAL
2–76
Fig. 2.3.35 Example of peripheral circuit
Fig. 2.3.36 Setting of related registers
(2) Pulse width measurement mode: Ringer signal detection
Outline : A telephone ringing pulseV is detected by applying the timer X interrupt and the pulse width
measurement mode.
Specifications : Whether a telephone call exists or not is judged by measuring a pulse width output
from the “H” active ringing pulse detection circuit.
f(XIN) = 8 MHz is used as the count source.
When the following condition is satisfied, it is regard as normal.
200 ms
≤ pulse width of a ringing pulse < 1.2 s
Figure 2.3.35 shows an example of a peripheral circuit, Figure 2.3.36, the setting of the related
registers, Figure 2.3.37, a ringing pulse waveform, Figure 2.3.38, an operation timing when a ringing
pulse is input, and Figure 2.3.39, the control procedure.
TXM : Timer X mode register [Address 2716]
b5, b4 : Timer X operating mode bits
1 1 : Pulse width measurement mode
b7 : Timer X stop control bit
1 : Count stop
P5D : Port P5 direction register [Address 0B16]
b7
b0
b4 : Bit corresponding to port P54
0 : Input mode
0
b7
b0
1
TXL : Timer X (low-order) [Address 2016]
TXH : Timer X (high-order) [Address 2116]
A716
6116
Set “division ratio – 1 (24999 : 61A716) ” in the timer X register
ICON1 : Interrupt control register 1 [Address 3E16]
b7
b0
b4 : Timer X interrupt enable bit
1 : Interrupt enabled
1
X
XX
X
XX
X
XX
0
X
XX
X
b6 : CNTR0 active edge switch bit
0 : Pulse width measurement mode (Measure “H” level width)
CNTR0 interrupt (Falling edge active)
ICON2 : Interrupt control register 2 [Address 3F16]
0
b7
b0
b0 : CNTR0 interrupt enable bit
1 : Interrupt enabled
XX
X
X1
X
Note : Write values in the order of
the low-order byte and the
high-order byte.
3825 group
CNTR0
Ringing pulse
detection
circuit
Telephone circuit
V Ringing pulse : Signal which is sent by turning on/off (make/break) the telephone line.
Each country has a different standard. In this case, Japanese domestic
standard is adopted as an example.