Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 27

Thread: Teensy 4.1 DAC Output

  1. #1
    Junior Member
    Join Date
    Dec 2016
    Posts
    15

    Teensy 4.1 DAC Output

    Hi everyone,

    was amazed to see that there is a teensy 4.1 with similar pinout as the 3.5/3.6. But after byuing one, i realized, that there are no dac outputs. :/

    i'm having an almost builted sythesizer hardware for the 3.5/3.6 so i'm wondering if there is an alternative way to get a dac-like signal out of the 4.1?

    (and maybe, why would this feature not includet?)

    Greetings

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,434
    Simple part, why there is not a DAC pin on the T4 or T4.1... The IMXRT1060 hardware does not have one.

    Alternatives - External DAC of some type. Or external I2S device.

    There is another output possible using the Medium Quality Sound (MQS - Chapter 38). Which there are two pins MQSL and MQSR you will see in yellow on the card for left and right channel.

    I don't do much audio so don't remember the state of using these with the Audio library or other libraries that make use of these.

    Hopefully someone else might know more.

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,962
    KurtE is right, there is no direct DAC on the Teensy 4.0 or 4.1.

    As he mentions, there is the MQS system that provides a simple DAC like interface. However, the downside is it uses fixed pins 10 and 12 for the right and left channels. These pins are the primary CS pin and the MISO pin for the main SPI bus. So if you aren't using a SPI display, you could use them. With some SPI displays, you can use the second SPI bus (SPI1). On the Teensy 4.0, you would need to solder two wires to pads underneath the Teensy and use pins 0/1. On the Teensy 4.1, the two pads are now on pins 27 and 28. In addition you can switch the primary CS from pin 0 to pin 38, and the primary MISO1 to pin 39.

    There are other alternatives for sound output:


    I put together a list of some examples of the methods in the unofficial wiki:

  4. #4
    Member
    Join Date
    Sep 2020
    Location
    Massachusetts
    Posts
    99
    ...What are the electrical connections needed for MQS?

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,434
    Quote Originally Posted by MichaelMeissner View Post
    I put together a list of some examples of the methods in the unofficial wiki:
    Quote Originally Posted by blakeAlbion View Post
    ...What are the electrical connections needed for MQS?
    There is data in the Wiki page that MichaelMeissner linked to.

  6. #6
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,962
    Quote Originally Posted by blakeAlbion View Post
    ...What are the electrical connections needed for MQS?
    When I did my test, I just used an adafruit amplifier and speaker. I don't remember exactly the setup. Perhaps it was one of the amplifiers and two speakers:


    More recently, I have been using the integrated speaker and amplifier, particularly for DACs:


    For the boards that have headphone output (3 band 3.5mm audio cable), I tend to use some of the headphone speakers I've collected:

  7. #7
    Member
    Join Date
    Sep 2020
    Location
    Massachusetts
    Posts
    99
    Your tone sweep demo was extremely painful to listen to but super-helpful. This is just amazing.

  8. #8
    Junior Member
    Join Date
    Dec 2016
    Posts
    15
    Hi again,

    after fiddling arround with some i2c - dac modules, i managed to get an audio output from simple sketches. But in my mutch komplexer synth code i din't get it to work.

    I wonder if there could be conflicts between DIN-Midi-communication via RX1/TX1 (PIN 0, 1) on tennsy 4.1 an i2c audio output via RX5/TX5/RX2 (PIN 21, 20, 7)?

    any suggestions? Thx.

  9. #9
    Member
    Join Date
    Sep 2020
    Location
    Massachusetts
    Posts
    99
    I have a Teensy 4 in front of me here with MiDI on Serial1, and it's using the audio library with a Teensy Audio Board. In the garage I have a Teensy 4.1 using Serial1 and MQS audio simultaneously. The 4.1 was also using Serial5 for a seconds MIDI interface. during prototyping.
    Just suggesting that something else may be going on here. In my experience the Teensy 4.x has not produced "side effects" where using a pin for one library disables some other pins in an undocumented way. The only documented issue I know of is how some pins share PWM interrupts/frequencies.
    I hope my reply is less-than-useless, but eagerly awaiting the responses from others-in-the-know.

  10. #10
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    142
    Hallo friends

    I am looking for an inexpensive alternative to the PT8211 DAC for the Teensy 4.1 ?

    Thanks and Greatings from Germany. Rolf

  11. #11
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    7,913
    Quote Originally Posted by Rolfdegen View Post
    Hallo friends

    I am looking for an inexpensive alternative to the PT8211 DAC for the Teensy 4.1 ?

    Thanks and Greatings from Germany. Rolf
    Wow, cheaper than a PT8211 chip is difficult
    But there are the MQS Outputs on the T4.x, as mentioned in this thread. They cost nothing.
    (MQS =Medium Quality Sound)

  12. #12
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    142
    The PT8211 can only be bought on ebay. The MSQ (PWM) output is not a good alternative for me. I want to build a nice synth with 16Bit sound.

    I would like an equivalent alternative for the i2s output on the Teensy 4.1 without amplifier and audio input.

    I want buy to distributors like Mouser, TME, or others.

    Thanks for help. Rolf
    Last edited by Rolfdegen; 01-06-2021 at 11:18 AM.

  13. #13
    Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    93
    Quote Originally Posted by Rolfdegen View Post
    The PT8211 can only be bought on ebay. The MSQ (PWM) output is not a good alternative for me. I want to build a nice synth with 16Bit sound.

    I would like an equivalent alternative for the i2s output on the Teensy 4.1 without amplifier and audio input.

    I want buy to distributors like Mouser, TME, or others.

    Thanks for help. Rolf
    You can also order them via AliExpress for about 6ct/pc
    They are as cheap as resistors (nearly) so the easiest Solution is to just buy a few hundred PT8211 and keep them on Stock. At least if you dont plan to sell 100000s of your Synth.

  14. #14
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    142
    Quote Originally Posted by fdaniels View Post
    At least if you dont plan to sell 100000s of your Synth.
    That would be a nice dream

    Maybe there will soon be a "Teensy 4.2" including a 16-bit DAC

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,726
    Quote Originally Posted by Rolfdegen View Post
    including a 16-bit DAC
    Know anyone at NXP?

    As far as I'm aware, the highest resolution DAC they've ever put into these sorts of chips is 12 bits.

  16. #16
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    7,913
    Rolf, have you ever tried the MQS?
    Its not as bad as you night think.

    If you think about parts even cheaper than PT8211, I'd give it a try.

    The PT8211 is not high quality, too.

  17. #17
    Member
    Join Date
    Sep 2020
    Location
    Massachusetts
    Posts
    99
    I had an analog drum synth with a Teensy 4 delivering metal noise for cymbal and high hat sounds. Itís an insultingly simple task for the Teensy 4 I admit (trivial to add knobs and midi), but MQS works great for that and keeps the cost low.

  18. #18
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    142
    I tried MQS. But there is no good quality with high notes. 16bit sound is much better.

    I will stay with PT8211 with 4x oversampling. It's a better choice for good sound and cost.

    Greetings from germany. Rolf

  19. #19
    Member
    Join Date
    Sep 2020
    Location
    Massachusetts
    Posts
    99
    Understood! It will interesting to see where you land on this.

  20. #20
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    840
    For about $15, you can buy an external TOSLINK DAC box. Not the lowest cost option, but will probably outperform the PT8211.

  21. #21
    Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    93
    Quote Originally Posted by jonr View Post
    For about $15, you can buy an external TOSLINK DAC box. Not the lowest cost option, but will probably outperform the PT8211.
    Sadly this doesnt integrate well with most projects.....

  22. #22
    I just cant believe this...for f.. sake

  23. #23
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    7,913
    ..and you can remove the housing from these boxes and just use the board...

  24. #24
    Junior Member
    Join Date
    Dec 2016
    Posts
    15
    Hey guys,

    in case anyone else is one the search for a propper DAC for the teensy 4.x, i finally use the PCM5102A (PCM5102A Stereo DAC Decoder I2S 24bit Player Module) and connected as shown here . Maybe not the best choice, if you think of mass production, but for some hometesting it works well.

  25. #25
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    493
    In case you're interested; I did a bunch of measurements on several DAC's. See this thread.
    The PCM5102A is my favorite from a cost vs quality perspective.


    Paul

Posting Permissions

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