Microcontrollers in Practice

This chapter contains the description of a device that interfaces a microcontroller to a telephone line, and is capable of receiving and decoding a series of DTMF signals, and to execute commands received this way.
Since telephone lines are available almost anywhere, it is interesting to design a device that, when connected to a phone line, is able to answer a call, and to recognize and execute a series of commands generated directly from the keypad of the telephone set that initiated the call.
This device operates according to the following set of rules:
The human operator initiates a call, using a regular telephone set.
The relay controller senses and counts the ring tones generated by the central office.
After a specified number of rings, the relay controller answers the call and transmits a specific audible tone over the telephone line to acknowledge its presence.
Using the telephone keypad, the operator generates a series of DTMF (Dual Tone Multi Frequency) tones, having a determined structure, which are received and decoded by the controller. The DTMF tones are audio signals, consisting of a combination of two sine waves, having precise frequencies in the range 697 1633 Hz. Each key of the telephone set keypad is associated with a distinct combination of frequencies, so that the receiving device can easily identify the key pressed.
The relay controller sends back to the operator distinct audible tones after the reception of correct, or erroneous...