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

Thread: Teensy 4.1 DAC Output

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

    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
    7,931
    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,887
    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
    61
    ...What are the electrical connections needed for MQS?

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,931
    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,887
    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
    61
    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
    14
    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
    61
    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.

Posting Permissions

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