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

Status
Not open for further replies.

jidagraphy

Active member
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 :(


IMG_6552.jpg
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
 
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.
 
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?
 
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.
 

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 :)
 
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.
 
Hi Jin,
This is an old animal but you can still buy them on Ebay: Philips TDA1543. DIP 8 package and I2S input.

Paul
 

Attachments

  • TDA1543.pdf
    102.1 KB · Views: 99
Finally, 5 months(?) after ordering on Ebay, 2pcs Philips TDA1543 in DIP8 package showed up in the mailbox today. TDA1543, not the TDA1543A.
The TDA1543 accepts regular I2S format, the TDA1543A accepts left-justified [aka Japanese] I2S format.

Got it to work on both a Teensy LC and a Teensy 3.2 using the audio library "AudioOutputI2S i2s1;".
Teensy LC: LRCK = 44.1 kHz, BCK = 1.4117 MHz [32*LRCK].
Teensy 3.2: LRCK = 44.1 kHz, BCK = 2.8224 MHz [64*LRCK].
Connected a 1K resistor from pin Vref to GND, 1K from left output to GND and 1K from right output to GND [so passive I/V conversion].

Here is the scope image for a 1kHz sine output:

SDS00035.png

Voltage swing 2.24Vp-p, zero at 3.02V.

Paul
 
Status
Not open for further replies.
Back
Top