"Newer" AVR series chips and app note AVR314 (DTMF generator)

[NOTE: @moderator(s): I don' know into which forum category this should go; feel free to move this to a more appropriate category but, if you do, please let me know in a PM, where it was moved. Thanks.]

I am wondering if anyone has implemented, or knows of an implementation of, a DTMF generator on any of the "newer" AVR series chips (e.g. the ATtiny 1-series or AVR Dx-series) that have on-chip "true" DACs (as opposed to outputting "analogue" signals with PWM). I know that the old Atmel app note AVR314 shows how to implement DTMF output using PWM, but wonder if using a "true" DAC output would be an improvement and if it would be worth developing (if it has not already been done)?

There are a few DTMF generator projects I found that use PWM output on the ATtiny85, but I want to use one of the ATtiny814 chips that I have on hand (or, possibly, an AVR16DD14), so wonder if it would be worth refactoring the code to use DAC instead of PWM output.

Assuming that using a "true" DAC would be significantly better (than using PWM), would using a 10-bit DAC (on an AVR Dx-series chip like the AVR16DD14) be an appreciable improvement over using an 8-bit DAC (on an ATtiny 1-series chip like the ATtiny814)?

And a related question: Has anyone successfully implemented a project using Spence's Dx-Core, and programming the target device with a simple DIY UPDI programmer (such as an Arduino running jtag2updi, or a serial adapter and running pymcuprog? I do have a SNAP (that has not yet had the firmware upgrade, or resistor-removal-mod), but I would rather use the Atmel IDE than MPLAB.

And one more question: would the internal oscillator (calibrated if necessary) of an AVR16DD14 be accurate enough to produce accurate DTMF signals?

FYI, my project is a dial-pulse to DTMF converter to allow use of old vintage rotary-dial phones in a modern network or analogue terminal adapter that does not accept pulse dialling. (Yes, I know it has been done using PWM output on a ATtiny85, but I want to implement it on one of the newer chips, and add a feature or two.) This could probably be done on an 8-pin device, but I want to have the ability to use a few extra pins for debugging, without changing the UPDI pin to a port pin, and I am not sure if a crystal or ceramic resonator would be needed. This is very much in the preliminary idea, "yes, I think I could do that," stage.

Thanks for any advice.
"DuinoSoar".

The DAC output should be cleaner audio (fewer harmonics), but the practical difference in an actual application might be marginal. Try it and let us know.

It ought to be much easier; perhaps not even justifying an app note. Surelt there are implementations documented using external DACs of various sorts that should be easily ported? (Hmm. https://ww1.microchip.com/downloads/en/AppNotes/00655a.pdf (PIC assembly language!) (AVR C: https://www.avrfreaks.net/s/topic/a5C3l000000USgvEAG/t124083 )

Assuming that using a "true" DAC would be significantly better

What does "better" mean, here? DTMF is already design to work well of pretty awful connections, albeit at low data rates. I'd bet that even square waves output on two pins and "mixed" analogically would work fine.

would the internal oscillator (calibrated if necessary) of an AVR16DD14 be accurate enough to produce accurate DTMF signals?

The DTMF frequencies are about 10% apart, and the internal oscillators are supposed to be good for +/-2% I suspect that that's OK.

The most definitely been a project implemented with Spence's Dx-Core, I have built an entire board on the Uno form factor based on the AVR128DA28.

If you would like to know more about that visit my github here => AVR128DA28 Uno, Github.
If you would like to buy one, please message me and I will give you the link.

Thank you, Bill (@westfw).

By "better," I meant more accurate waveform, etc., but from your comment, it seems like making the change from PWM output (appnote AVR314) to a "true" DAC output probably does not make much difference. And if I DO switch to using a newer vintage AVR chip, there would probably not be any appreciable difference between using an 8-bit DAC (ATtiny 1-series chips) or 10-bit DAC (AVR DD-series chips).

So, for refactoring/porting, I think all I would probably need to do is remove the code that sets up the PWM output, and just use the same 8-bit value that was the PWM pulsewidth, as the DAC value instead (as well as make other changes to switch from using a ATtiny85 to the less-expensive ATtiny412 or '814). Should be simple enough to do, I think. (I know: famous last words, and all that.)

Concerning the square wave output idea, I did see a project somewhere that just used the Arduino tones library on two different output pins out to a couple of LPF's, and mixed them together with potentiometers (to adjust for the DTMF "twist;" i.e. differences in amplitude between the high and low DTMF frequencies). However, I want to use the DTMF output with a "landline" Analogue Terminal Adapter (ATA), and I do not know how tolerant (or intolerant) those are for detecting DTMF. In any case, it would not hurt to make the DTMF output signal a little cleaner.

Thanks,
"DuinoSoar"

Thanks, Abel.

As I just noted above in reply to Bill's comment, I think I will use an ATtiny 1-series processor (probably the ATtiny412 or '814). My application will be using a "bare-metal" µC chip, on a small circuit board that needs to go into a limited space, so a full-fledged UNO-sized board would not do. Besides, for my application, using an AVR128DA28-based processor would be akin to sledge-hammer-fly-swatting. :slight_smile:

Thanks,
"DuinoSoar"

1 Like

No problems, I was just putting out another option.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.