October
2004, Issue 171
Telephone
Message Watchdog
An
Intelligent Call-Forwarding System
by
Jingxi Zhang, Yang Zhang, & Huifang Ni
H8S/2398
ADVANTAGE
To
build this smart device, we knew we needed a microcontroller
to monitor and control the telephone calling process.
We decided not to use a hardware touch-tone detector
and generator in order to reduce the chip count, simplify
the hardware design, and lower the project’s overall
cost.
Using
software to detect and generate touch-tones requires
the MCU to meet particular criteria. First, the MCU
must contain an analog-to-digital converter (ADC) for
converting audio signals, including touch-tone signals,
to the digital domain. Because the telephone audio signal
frequency bandwidth is approximately 3 kHz, the embedded
ADC must be able to digitize the audio signal at a minimum
of 6,000 samples per second. (The sampling rate must
at least twice the highest signal frequency.)
Second,
the MCU should contain a two-channel digital-to-analog
converter (DAC) for the touch-tone generator. Both the
DAC and pulse width modulation (PWM) units can be used
for audio signal generation. However, the audio signal
generated from the DAC has less harmonic distortion
than that of the PWM unit. The touch-tone signal generated
with lower order harmonic frequencies is easier to distinguish
from voice signals.
Third,
the MCU’s CPU core should possess adequate computation
power to handle digital signal processing. In the touch-tone
detection process, the signal is fed to as many as eight
digital filters in a short period of time. Each digital
filter is implemented using a series of 16-bit fixed-point
multiplication and accumulation (MAC) operations. Therefore,
a fast 16-bit multiplier in the CPU core is required.
Based
on the aforementioned requirements, we selected the
Renesas H8S/2398 microcontroller, which contains an
eight-channel, 10-bit ADC converter with a sampling
rate of up to 150 kHz. It also has a two-channel, 8-bit
DAC converter.
The
H8S/2398’s CPU performance is attractive. The system
clock is 20 MHz, and a 16-bit addition operation takes
one cycle (50 ns). The CPU instructions contain signed
and unsigned multiplication and division operations.
The 16-bit multiplication takes 1 µs, which is adequate
for touch-tone detection.
An
embedded DMA controller further enhances the CPU’s performance.
With the DMA controller, the digitized data is transferred
automatically to the digital filter frame buffer without
CPU involvement. This feature liberates the CPU of the
burden of servicing frequent data transfer interrupts
and frees up power for the CPU to perform digital signal
processing. The 8 KB of RAM storage make the digital
filter frame buffers easier to design. There are 256
KB of flash memory for instruction storage, which is
plenty for a small MCU.
Of
course, the biggest incentive for selecting the H8S/2398
MCU was the H8 Renesas Design 2003 Contest. Renesas
offered a free H8 starter kit. We selected the H8S/2398
starter kit from Basic Micro. The kit came with an evaluation
board, LCD module, and software package for Renesas
MCU development. The evaluation board simplified the
hardware construction process.