Beginner understanding t4.1 SPI w/DAC

rthorntn

Member
Hi,

So say I wanted to use two DAC8568 with a t4.1, I understand that the DACs are 16-bit but what frequency would I be able to run each channel at?

The DAC datasheet mentions up to 50MHz, can the teensy support that, what does that mean for frequency, can I run 16 channels at 44.1KHz?

I see that t4.1 supports 2 SPI with FIFO, not sure if FIFO is relevant.

Thanks.
Richard
 
First off, if you “just” want 16 channels of 16 bit audio, there are easier routes, e.g. this thread.

16 channels of 16-bit audio at 44.1kHz is 11.29Mbps. Teensy 4.x can do that, on the face of it. But … looking at the data sheet you can see it’s not really a SPI protocol, even if TI call it that; and it has an extra overhead of 16 bits for every sample. Now we’re at 22.58Mbps, which is still inside the Teensy’s SPI bus official limit of 30MHz. And you still have to persuade the LPSPI peripheral to generate the SYNC signal your DAC wants, which will require trying to understand the relevant part of the 3,500-page datasheet. Oh, and since you want two DACs, each one needs its own SYNC; that may or may not require you to use two SPI peripherals, but at least there are 3 on Teensy 4.x.

If that is possible, then the FIFO is very much relevant, although at only 16 words deep it’s still going to need refilling every 22us. That should be possible with DMA, there’s a bunch of code in the SPI driver, and also for asynchronous SPI displays, which you could review and adapt.

You will probably need to figure out how to adjust the SPI clock to get a sample rate of 44.1kHz - normally people don’t much care about the exact speed, and I think it’s an integer division of 240MHz by default, which you can’t really use.

Alternatively it may be possible to use the SAI audio peripheral to do what you want, if there’s some way of getting the word clock to provide the SYNC signal. In that case there’s lots of examples in the Audio library of driving hardware, and it has a 44.1kHz clock already.
 
You might look at the Ornament and Crime synth project. The Phazerville firmware has an optimized driver for DAC8568.

As I recall, DAC8568 has a protocol with quite a lot of headhead. In other words, maybe more than 16 bits transmitted just to get the 16 bit output updated. Of course, details are in its datasheet, so trust that info beyond anything I've said.
 
Back
Top