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

Thread: Audio output options for Teensy 4.0 *without* using the official audio adaptor

  1. #1

    Audio output options for Teensy 4.0 *without* using the official audio adaptor

    I've been researching and learning about this for a few days.. but I still can't get a grasp of the options I have.
    I can already sense that the most of the experts on this forum will be sick of hearing the 'teensy 4.0, no dac, panic' thread - yeah sorry in advance, I couldn't find a resolution


    Click image for larger version. 

Name:	IMG_6552.jpg 
Views:	10 
Size:	120.5 KB 
ID:	21110
    So right now :
    - I make tiny synth like the photo above. Uneducated circuit design but they work. They work on teensy 3.2, with teensy audio library and dac output on pin 14.
    - I've bought like 10 teensy 4.0 when it came out, not having read that it doesn't have a DAC like the stupid blob I am.
    - I'm trying to avoid using the teensy audio adaptor to minimize the amount of space my projects take on a board. Especially when the audio adaptor stacks on top of the teensy!
    - Back when I was using 3.2, line connection to pin 14 was just the right minimal set up I needed but... I gotta use my 4.0s somehow.

    And I learned :
    - I could use an external DAC chips. I found chips like MCP4822, MCP4922, MCP4728. they *look* like what I need but I can't seem to find anyone mentioning them with teensy to work with teensy audio library. And I can kind of see why - I thought I could connect them up somehow and just use the dac component in teensy audio library - but it looks like the dac component is specifically for the inbuilt dac (i.e. pin 14 on teensy 3.2).
    - some other chips like PCM5102A or STGL5000. They look okay but they're REALLY small! I was imagining a chip size that I can use on prototyping board or breadboards. And also they're either all sold out or I can't get them from where I live (S Korea)
    - PT8211 adaptor maybe? Except that my hands are noodles and I'm worried that I'll mess up the soldering of that tiny tiny chip... and also I will have no idea when I'll get international orders because of the pandemic... AND also because they stack, I'm trying to avoid.
    - I'm really reluctant to use MQS... I do want better sounds..


    My question is :
    - I believe MCP4822 is what I'm looking for.. but I can't find any projects that use audio library and the chip to output audio! Have I missed something?
    - Realistically, am I stuck in a needlessly strict specification? Maybe i'm being a tad stubborn and needy.

    Thank you guys,
    you guys are GREAT.

    Jin

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    348
    All I2S audio DACs/ADCs are SMT to my knowledge, modern chips are never released as DIP, that's last century's
    technology...

    For audio I2S is the standard, sounds like you need to find something on a breakout board, something like this
    (but note this is out of stock...) https://www.adafruit.com/product/3678

    The Audio library has I2S support of course... Many I2S DACs and ADCs can be configured in hardware and not need
    I2C or SPI programming.

  3. #3
    Quote Originally Posted by MarkT View Post
    All I2S audio DACs/ADCs are SMT to my knowledge, modern chips are never released as DIP, that's last century's
    technology...
    Oh right, I didn't know that..
    A quick search gives me the feeling that none of the MCP chips i mention are I2S dacs..
    Although I dont exactly know what I2S nor SPI means,
    I get the feeling that "SPI dacs" arent exactly for sound outputs? More suitable for CV outputs, am I correct?

    A different question out of curiosity : how does the inbuilt dac on teensy 3.2 work seamlessly with the audio library?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,520
    Quote Originally Posted by jidagraphy View Post
    I get the feeling that "SPI dacs" arent exactly for sound outputs? More suitable for CV outputs, am I correct?
    Yes, I2S is pretty much always meant for audio.

    SPI can be used in a variety of ways, and while it's theoretically possible to use SPI for audio, it's usually meant for non-audio stuff.


    A different question out of curiosity : how does the inbuilt dac on teensy 3.2 work seamlessly with the audio library?
    Yes.

    If you haven't seen the audio design tool, take a look at the stuff on the left side. Those are all the things the audio library offers. The outputs are all the ways to send audio signals from Teensy to the outside world. As you click on each one, the right side documentation panel explains how it works, including which boards support that feature. Browsing through the design tool is the best way to get an idea of the ways to can get audio output. As you can see in the design tool, there are a *lot* of ways!

    There's also a 31 page tutorial with a 45 minute walkthrough video which explains how all the basics work.

    https://www.pjrc.com/store/audio_tutorial_kit.html

    How to use the design tool starts on page 8.

  5. #5
    Quote Originally Posted by PaulStoffregen View Post
    Yes.
    Oh yes, I'm well aware of the audio design tool and the documents - my question was on *how* the inbuilt dac works in a low level, because it doesn't look like a I2S dac but it still works well as an audio output.
    But it's not important, I was just curious.

    And thank you Paul ! Your work is really appreciated

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,520
    Quote Originally Posted by jidagraphy View Post
    my question was on *how* the inbuilt dac works in a low level
    It works in a very similar way as I2S, where the audio library delivers blocks of samples which are copied to a DMA buffer that automatically moves the data to hardware as it's needed. But the DAC hardware creates an analog voltage when you (actually the DMA engine) write a number to its output register, whereas the I2S hardware puts the data bits into a shift register and transmits those bits together with the I2S clocks.

    If you look at the library source code, you'll see most of the code is nearly identical, except the startup stuff which configures the hardware.

  7. #7
    Senior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    124
    Hi Jin, I used a WM8731 on a custom board, it is small but not too difficult to solder
    https://forum.pjrc.com/threads/60924...m-PCB?p=244469

    Cheers Paul

  8. #8
    Thank you for the clarification!! I will have a look at it

  9. #9
    Quote Originally Posted by houtson View Post
    Hi Jin, I used a WM8731 on a custom board, it is small but not too difficult to solder
    https://forum.pjrc.com/threads/60924...m-PCB?p=244469

    Cheers Paul

    Alright, I will definitely have a look into that
    Thanks guys, really appreciate the help !

  10. #10
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    277
    Hi Jin,
    This is an old animal but you can still buy them on Ebay: Philips TDA1543. DIP 8 package and I2S input.

    Paul
    Attached Files Attached Files

Posting Permissions

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