Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 15 of 15

Thread: No DAC on 4.0. Alternatives?

  1. #1

    No DAC on 4.0. Alternatives?

    I noticed my 4.0 doesn't have the DAC pin that the 3.2 had. Is it possible to use one of the other pins to do this?
    What do you guys recommend?

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,238
    maybe MQS (AudioOutputMQS) see https://forum.pjrc.com/threads/54711...l=1#post197727
    output on T4 pins 10 and 12

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,375
    I don't know if it will work, but you might try an i2s to speaker solution such as:


    Now obviously to use i2s you would need to use the audio library instead of just analogWrite.

    I know back in the days when I used Arduinos, I recall you could use the tone function on a PWM pin (and it was listed as working in the T4 beta list) to output a single frequency that you could hook up to a buzzer if you wanted just different sounds.

  4. #4
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,315
    I tested the tone function using a NonBlockingRTTTL library which allows you to play RTTTL melodies. Yes tone does work if you just want to send beeps. Link: https://github.com/end2endzone/NonBlockingRTTTL

  5. #5
    I just want to be able to get a small analog signal out after using the audio library. Can you verify that pins mentioned above will work? I'm planning for the device, I don't have it yet

  6. #6
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,238
    none of the solutions suggested above provide an "analog" voltage -- they all are generating square waves, and duty cycle determines "average voltage"

  7. #7
    Senior Member
    Join Date
    Dec 2013
    Posts
    238
    What about PT8211 Audio Kit for Teensy 3.x digital to analog converter (DAC) chip . ---> PT8211 Audio Kit

  8. #8
    I guess I'll just use the Pt8

    I have no problem using a self configured DAC, but i still don't know how to wire it up in the gui to a set of pins that would allow for this.

  9. #9
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,241
    I believe it can be used, but maybe not yet?

    But acording to Paul somewhere the DAC is only good for about 10 bits above its noise floor.

  10. #10
    Quote Originally Posted by oddson View Post
    I believe it can be used, but maybe not yet?

    But acording to Paul somewhere the adc is only good for about 10 bits above its noise floor.
    10 bits might would be fine for what I'm after. But still interested in knowing how to do the pre-DAC outpuits :-)

  11. #11
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,241
    I guess the DAC object in the audio library needs to be updated.

    I didn't follow the 4k of posts so I'll shut up now.

    Edit... might have been ADCs I'm remembering...

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,827
    Just to confirm (in case anyone needs to hear it directly from me), Teensy 4.0 does not have a true analog output DAC, like Teensy 3.2, 3.5 and 3.6 do. NXP simply did not put one inside this chip.

    If you need a true analog DAC, use the older boards, or plan on adding a DAC chip.

    You can use PWM or MSQ and analog low pass filtering for a "poor man's DAC", but the results are not as good as a real DAC, especially the PSRR spec.

  13. #13
    Wow finally, this one post from you finally cleared my heard. I know it is probably trivial, but how does one use an external DAC with the teensy for audio purposes, and what would the best DAC be. I could google it, but would just be crushed by the overflow of information. In a true sense, I am an actual beginner to the digital domain. Thank you

  14. #14
    You can use Audio Adaptor Board (rev D) at least, that's directly pin compatible with Teensy 4. Not sure if you could also use the PT8211 Audio Kit as well with T4 if you wire it differently?

  15. #15
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,375

    Cool

    Quote Originally Posted by Orhema View Post
    Wow finally, this one post from you finally cleared my heard. I know it is probably trivial, but how does one use an external DAC with the teensy for audio purposes, and what would the best DAC be. I could google it, but would just be crushed by the overflow of information. In a true sense, I am an actual beginner to the digital domain. Thank you
    It sort of depends on what you want to do. The most typical way is to use digital I2S and let the I2S device generate the sound. And for the Teensy 4.0, the main method it to get the version D audio shield and just attach it to the Teensy. This provides stereo output to either a headphone breakout or to unamplified speakers with L-G-R or L+/L- and R+/R- pins.

    For the headphone breakout, with a 3.5mm plug, there are various devices that take headphone and produce sound. You can find cheap versions of these speakers that are often called bomb speakers or hamburger speakers. They have some amount of battery, use USB charging, and can produce sounds:


    A little higher on the quality spectrum is the monoprice guitar amplifier. You have to remember to press a button after turning it on to switch it to playing sound from the headphone:


    If you go with the speaker output instead of headphone output, you need to apply proper amplification to the sound and then feed that into the speakers. I've used the amplifier and speakers from Adafruit that give decent sound if you are close to the Teensy:


    Alternatively, you can by-pass the audio shield, and use a direct I2S card that produces sound. For example, both Adafruit and Makerhawk makes a simple stereo I2S -> mono speaker card that includes an amplifier. So all you need is a cheap speaker. I'll put a link to one article I would about using the Makerhawk card below:


    Adafruit and HiLetgo also make I2S stereo decoders. Like the audio shield, it produces either headphone output to a 3.5mm jack or L+/G/R+ to unamplified speakers:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •