1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

DTMF tone decoding using only a PIC? (no tone decoder chip)

Discussion in 'Microcontrollers' started by blueroomelectronics, Jun 29, 2007.

  1. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    I was wondering and googling and found plenty of DTMF tone decoding schematics with PICs but all used a tone decoder IC ie 8870.

    I'm sure a dsPIC could do the job but wondered if a 16 or 18 series PIC could.
     
  2. Papabravo

    Papabravo Well-Known Member

    Joined:
    Mar 9, 2006
    Messages:
    2,889
    Likes:
    25
    Location:
    Michigan, USA (GMT-5)
    The problem is that an incoming tone signal has multiple frequencies in it. That's what DTMF stands for after all. The problem is to separate the components. With a single tone you can just count zero crossings to get the frequency, but multiple tones makes that harder.

    You could build some analog filters for each of the tones but that would defeat the purpose of "86-ing" the tone decoder.

    You might have some hope with an anti-aliasing filter and a fixed point DFT; but that would need RAM that you dont have in most mid-level PICs.
     
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,205
    Likes:
    640
    Location:
    Derbyshire, UK
    If you check the PICList, there's an old project using a mid-range/top-range chip (long before 18F's) that does FFT in software and actually feeds a VGA monitor directly with a simple spectrum analyser type display. So certainly an 18F series chip should be easily capable of detecting DTMF - and I seem to have a vague recallection that I've even seen one somewhere using a 16F chip?.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA

    Did you come across this one in your search (below). It doesn't use a decoder IC but it does use a Microchip op-amp IC.

    DTMF Remote Control
     
  6. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    That's cool, you know I want to try it with the F88 and its build in comparator.
     
  7. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    I suspect that would work (after taking a very quick glance at the code)...
     
  8. phalanx

    phalanx Member

    Joined:
    Oct 22, 2003
    Messages:
    405
    Likes:
    7
    Location:
    New Hampshire, USA
    You should also check out Microchip application note 257 (AN257). It deals with DTMF detection on PIC18 devices.
     
  9. pc88

    pc88 New Member

    Joined:
    Jun 6, 2007
    Messages:
    179
    Likes:
    3
    Location:
    Minneapolis, MN
  10. Hero999

    Hero999 Banned

    Joined:
    Apr 6, 2006
    Messages:
    14,902
    Likes:
    79
    Location:
    England
    How's it normally done with a PIC?

    the only way I can think of is making a simple spectrum analyser but performing Fourier transforms but I don't think PICs are fast enough for that,
     
  11. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Appears the 18F can do it, the dsPICs are certanly fast enough an have some FFT instructions in the hardware. Hard to decide as a dsPIC3013 is not an expensive PIC (5V and DIP too)
     
  12. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,205
    Likes:
    640
    Location:
    Derbyshire, UK
    Perhaps you didn't read my previous post where I explained that it's perfectly possible and there is an example on the PICList?, to be exact it's at http://www.piclist.com/techref/microchip/fft/picspect.htm

    I'm not sure how old it is?, but i'm pretty sure it's back from last century, and uses a 17C756 - so an 18F should do it even easier.
     
  13. dramrattan

    dramrattan New Member

    Joined:
    Oct 22, 2008
    Messages:
    158
    Likes:
    3
    DTMF Monitor and controller

    How to monitor the start time, end time, call duration etc using a DTMF decoder and PIC as well as activating an external electrical device using the PIC and decoded DTMF signal?...There are circuits all over the net dooing them seoerately with the PIC16FXX and other microcontrollers but not both at the same time. Could anyone come up with a circuit to do both because i run out of ports when using the PIC16FXX...Tried using the PIC18FXX but still couldn't put together everything...
     
  14. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    How many pins is your 16Fxx? They do make em with plenty of I/O.
     
  15. dramrattan

    dramrattan New Member

    Joined:
    Oct 22, 2008
    Messages:
    158
    Likes:
    3
    Pic I/o

    Well the PIC16F84A was the one in consideration when i wrote the post but that only contains 13 I/O pins which wouldn't be enough for the question at hand. I saw the PIC16F877 have more I/O pins though but still can't connect everything into one circuit.
     
  16. dramrattan

    dramrattan New Member

    Joined:
    Oct 22, 2008
    Messages:
    158
    Likes:
    3
    Schematics

    These are the schematics in consideration that i was speaking about in the previous post. Probably you would be able to get a better idea from these attachments.
     

    Attached Files:

  17. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Well the 16F84 is really old and the 16F877 or newer 16F887 have plenty of I/O for your call logger. Why not just buy the kit you show in the second PDF?
     

Share This Page