PDM for simple audio ouput (no i2s DAC)

Status
Not open for further replies.

dirkenstein

Active member
Based on an idea from here:

https://www.hackster.io/janost/audio-hacking-on-the-esp8266-fa9464

I've just built a filter you can place in front of an AudioInterfaceI2S object that converts a single AudioStream stream to a PDM modulated stream with half the bits on one and half the bits on the other output channel.

When used with an i2s DAC this of course produces some fairly horrible noises, but when your DAC is replaced with a simple RC low-pass filter the output is passable audio.

Could this be useful for low-component-count Teensy 4.0 projects or for any Teensy unable to use a 12bit DAC for audio output?

It basically makes a pretend mono 16-bit DAC with a single resistor and capacitor directly connected to the i2s output.
 
The Teensy 4.0 has already something like that integrated. The internal SAI3 can be combined with a so-called Medium Quality Audio Output which works based on PWM/PDM with internal oversampling and filtering.
 
The internal SAI3 can be combined with a so-called Medium Quality Audio Output which works based on PWM/PDM with internal oversampling and filtering.
Sorry wasn't aware of MQS or the output_mqs class in the audio library (it's not in the audio design tool).
I keep on finding useful things that I wish I knew about!
Might still be useful for two-channel output (1 via MQS, 1 via i2s) but you're right, it's redundant.

Dirk
 
Can confirm that MQS works nicely, but there still may be a use for the PDM Filter: the MQS pins are the same as the hardware SPI so unless those can be remapped, this could allow the use of SPI at the same time.
 
Can confirm that MQS works nicely, but there still may be a use for the PDM Filter: the MQS pins are the same as the hardware SPI so unless those can be remapped, this could allow the use of SPI at the same time.

Or use the other 2 SPI buses.

To use SPI1, you need to connect pads for pins #26-27 from underneath the Teensy 4.0 (and use pins 0/1, which means you can't use Serial1). Note, the pinout card unfortunately does not show that pin 1 is MISO1 and pin 0 is CS1.

To use SPI2, you need to solder the 1mm pads for pins #34-39.

Over in the 'General Discussion' forum there are discussions about several different breakout boards to access some/all of the underneath pads.

At some point in the future, pins 14/15 might be used for S/PDIF in/out. However, the Teensy 4.0 software is not written for that yet.
 
Status
Not open for further replies.
Back
Top