On Thu, 11 Sep 1997, Mike Smith wrote: > Dids't you mean this to go to PICLIST it went direct to me. (seems > to happen to me when I don't want it to sometimes...) Yup, I meant it for the list, so I am sending the whole kit and kaboodle to the list -- my original, your reply, and my reply to that. > > On 10 Sep 97 at 14:04, Pierce Nichols wrote: > > > On Thu, 11 Sep 1997, Mike Smith wrote: > > > > > > Somewhat difficult on the average PIC, these FFT's! > > > > Well, there's always the ever-popular look-up table. I also > > thought of another one that is a little less processor intensive. It > > is still a raw idea, but bear with me: > > Even lookup tables are inefficient on the PIC, with its non-readable > code forcing the retlw nn and some dancing around to get it. > I find spi EEPROMS to be more efficient sometimes. > In this case, I don't think it would matter because a PIC is *light years* faster than DTMF tones, which max out at about 10 tones/sec. You are right in general of course. > > > > The DTMF tones are on the scale of one kHz -- no problem for the > > average PIC to sample accurately. You put a filter with its passband > > straddling the DTMF range right in front of the ADC input. You then > > count the period between maximum peaks (i.e., when the two tones are > > in phase) to bring out the beat frequency, which should tell you > > which tone-pair is on the line, because the tones were selected by > > bell labs so that their beat frequencies are all different. You > > stick that into a lookup table and read off the hex digit. As I > > said, it's off the cuff, but it ought to work. OTH, a DTMF decoder > > chip is very cheap, and they generally have a 4-bit parallel > > interface. > > > > Sounds feasible. Maybe the person who wanted to do it would like to > try. Me, I'd use the dedicated chip unless I was making 1000's, and > they had to cost next to nothing. DTMF decoders are cheaper than most PICs, I think, but I am not sure. Doing it with a PIC is awfully klugey, but it might be a fun thing to try... Pierce