Using two i2s interfaces with a custom board

aaronw
Posts: 14
Joined: Fri Apr 17, 2020 4:33 am

Using two i2s interfaces with a custom board

Postby aaronw » Mon Apr 27, 2020 6:48 am

Hi,

I have a custom board that I would like to work with the ADF but in my case I have a single microphone connected to the right channel of I2S bus 0 which uses 32-bits per sample. Although the microphone outputs 24 bits per sample if I use anything other than 32 bits I don't receive any output. I have a speaker connected to the left channel of I2S bus 1 that uses 16 bits per sample.

Without doing a major rewrite is it possible to support this? I don't want to rev my board if I don't have to (I'm a hobbyist and this board is quite complex) and there appears to be no way to combine them given that the microphone only works in 32-bit mode. It's as if the bitclock does not give 32-cycles if not in 32-bit mode. My board does not use any ADCs or DAC. While it will have added buttons in the future, they will be connected via an i2c GPIO expander since all of the GPIOs are already in use.

I am still pretty new to using the IDF. I was using the Arduino environment earlier though it's fairly obvious that the complexity of my project requires multiple processes spread between the cores in order to work properly.

-Aaron

birdwes
Posts: 4
Joined: Thu Mar 26, 2020 9:58 pm

Re: Using two i2s interfaces with a custom board

Postby birdwes » Tue May 05, 2020 2:41 am

What DAC and ADC are you using?

I had an earlier post about my setup: https://esp32.com/viewtopic.php?f=20&t=14905

My input PCM1808 ADC is only 24bit, but the bytes come in as 32 bit words. That's the way that the ESP32 driver works. It's also the way that the system clock works as SLAVE on some ADCs, unless you want to do non-standard clock rates. Some ADCs prefer a 64 or 32 BCK clock.

Simply throw away the remaining least significant bits (unless you want to round them).

If the ESP code reads MASTER, then your devices must operate as SLAVE.

Who is online

Users browsing this forum: No registered users and 24 guests