The Telephone Message Watchdog is an H8S/2398-based message-forwarding system for home telephones. The touch-tone detection system triggers when your answering machine picks up a call. After the caller hangs up, the system contacts you on your cell phone or pager.
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.
PHONE LINE INTERFACE
The telephone message watchdog system contains the H8S/2398 evaluation board from the kit and analog telephone interface circuitry. The MCU in the evaluation board handles touch-tone signal processing.
Figure 1 is a simplified diagram of the device interface to a telephone line. In compliance with part 68 of the FCC rules, the MCU circuitry is isolated from the telephone line by an isolation transformer and optocouplers. An AC optocoupler (IC2), which is connected between the telephone input line and the answering machine, serves as a line loop-current detector. When the answering machine engages the line, a 20-mA loop current flows through the optocoupler LED emitter, causing the optically coupled photosensitive transistor to conduct. The transistor collector voltage VCE drops and triggers the MCU to enter the touch-tone detection state.
The telephone tone dialing system is called dual-tone multi-frequency (DTMF) signaling. It’s a standard telecommunication system developed by Bell Laboratories. In this system, a matrix is used to compose a signal, which consists of a lower frequency group, containing four distinct frequencies that are below 1 kHz, and a high-frequency group, containing four distinct frequencies above 1 kHz (see Table 1). Each telephone key is represented by a pair of simultaneous low- and high-frequency tones.
The DTMF tone generator is implemented using a D/A converter and sine wave look-up table, which is a 50-entry byte array representing a complete precalculated sine wave. Two 16-bit timer units drive D/A converters with accurate clock rates. When a DTMF tone is requested, the two basic frequencies are selected. The clock rate for each DAC is determined with the following equation:
For example, 38,500 Hz = 770 Hz × 50. The timer units are set to generate the required clock rate for each frequency. Two channels of DAC output are mixed at the op-amp in the telephone line interface circuit. MCU OPERATION
We mixed H8S/2600 assembly and C languages. Figure 3 is the program flow chart. When the device is powered on, the MCU starts a reset process and sets up the on-chip peripheral I/O modules, including 16-bit timer units, an ADC, a DMA controller, D/A converters, and I/O pins. The MCU then enters Sleep mode.
USAGE and PRESETTING
You have to preset your pager and home numbers before use. To do so, first connect a regular telephone to the presetting port J1. After the device is powered on, push in the mode switch (S1) to enter Presetting mode. The device now waits for you to enter the pager number and phone number using the telephone’s keypad . Punching the 0 key followed by the * key enters Pager Number Setting mode. The 1 key followed by the * key enters Home Phone Number Setting mode. Then the pager or home phone number can be entered and terminated by pressing the # key.
The LCD will show the number you entered. Each number entered is instantly saved even if the mode switch is changed back to Normal mode before the # key is pressed to stop either of the setting modes.
Connect J2 to the telephone port and J3 to an answering machine. After the system is preset, switch S1 back to normal. Now the system is ready to use. To test it, you can use a second line or cellular phone to dial this line number. After the answering machine triggers and waits for a message, you can punch in a callback number. The LCD should correctly display the number you entered. After you hang up the phone, the system will enter Information Forwarding mode and dial out the pager number as well as the number you entered. To monitor Information Forwarding mode, you can add an audio monitoring circuit to the system (see Figure 5). You can then hear the generated touch-tone.
Visit Here for more.