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

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,094
    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,084
    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+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,713
    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,094
    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
    220
    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,138
    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,138
    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,338
    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.

Posting Permissions

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