DTMF Decoder using the HamStack Project Board and 8870 decoder chip
This project uses standard features of the HamStack Project Board. The board includes
an 8870 DTMF decoder chip. Receiver audio is fed into the decoder chip. The output
of the decoder chip is 5 digital signals, 4 to represent the 16 possible DTMF digits
and one (DV pin) to indicate that a valid DTMF digit is being decoded. The software
example code scans the DV pin and when a digit is decoded, the other 4 data pins
are read. The four data pins, D1, D2, D3, D4 represent bits 0, 1, 2, and 3. Bit
0 has a value of 1, bit 2 has a value of 2, bit 3 has a value of 4 and bit 3 has
a value of 8. So if bits 2 and 4 are active, that represents 2 + 4 which equals
6. A value of 6 represents the DTMF digit 6. The rest of the DTMF digits are as
4 bit value DTMF digit
Although the Project Board kit includes a front and back panel that can be routed
out to fit the LCD, in this project we make custom front and back panels our of black
plastic to make it look really nice. We also added a 3.5mm stereo mini jack to connect
the receiver audio. Otherwise all the components are included in the Project Board
Project box and LCD display
Inside view of the 8870 DTMF decoder chip, crystal, resistors and other parts are
on the left of this photo. When installed, the CPU board will be mounted above this
Inside view of the Project Box. Viewed from the back, you can see the CPU board
installed in the middle and the back of the LCD at the top of the photo.
The LCD board is mounted to the front panel with nylon standoffs superglued to the
back of the front panel. First, screw the standoffs to the LCD board. Then dab
some superglue gel to the end of the standoffs and then set the standoffs against
the back of the front panel.
Viewed from the front, the LCD interface cable plugs into the 10 pin header in the
back of the project board.
The test receiver is plugged into the completed decoder.
Below, the back of the chassis shows the audio input connector added to the back
panel in the upper left. The other connectors, from left to right, are
RCA - Opto isolator or solid state switch output
3.5mm Stereo jack - Tone generator output
3.5mm Stereo jack - 2 digital inputs
DB9 - RS-232 serial port
DC coaxial power input (7-14 VDC)
As DTMF digits are decoded, the last decoded digit is displayed in the upper right
corner. As digits are decoded, they displayed in order on line 2 of the LCD display.
The example program will automatically flush the input buffer if no data is entered
after about 5 seconds.
In this example, if the command “123” is decoded, the program will activate the reed
relay output. If the command “456” is decoded, the relay will de-activate.
' HamStack DTMF Decoder using the 8870 chip
' This program listens to the output of a 8870 DTMF decoder and will
' send each digit to the LCD display
' Version 1.0
Device = 18F4620 ' Set the CPU type to a Microchip 18F4620
Clock = 10 ' Set CPU clock frequency to 10 MHz
#option LCD_DATA = PORTD.0
#option LCD_RS = PORTD.4
#option LCD_EN = PORTD.5
Include "usart.bas" ' Include the RS232 UART subroutines