Page 1 of 1

I2S interface receiving TDM from ICS-52000 array

Posted: Thu Jul 30, 2020 2:55 pm
by mplanton
Hello,

I'm working on a project with an ESP32-dev-kit-C which should receive data from an ICS-52000 MEMS mic array.
Because the TDM format of the ICS-52000 is not directly supported by the IDF, I tried to invert the I2S-bit clock
for receiving stereo audio from 2 ICS-52000 in daisy chain.
In changed the I2S driver to set the I2S_TX_BCK_IN_INV bit in the I2S_TIMING_REG.
To test, if it worked, i read this bit and it can be set correctly.

I have to configure the I2S interface as master with

Code: Select all

i2s_config_t i2s_config = {
        .mode = I2S_MODE_MASTER | I2S_MODE_RX,
        .sample_rate =  I2S_SAMPLE_RATE,
        .bits_per_sample = I2S_SAMPLE_BITS,
	.communication_format = I2S_COMM_FORMAT_I2S,
	.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
	.intr_alloc_flags = 0,
	.dma_buf_count = 2,
	.dma_buf_len = 1024,
	.use_apll = 1,
	.bck_inv = 1 // invert i2s bit clock for TDM input
	 };
I measured the I2S signals with an oscilloscope and noticed, that there is no change when the I2S_TX_BCK_IN_INV bit is set like above.

So is this bit only for slave mode, when the I2S receives a bit clock in the wrong polarity?
Could you think of a way to implement a TDM format on the ESP32 like the one used by a ICS-52000 array?

I could not find any extra information about this bit outside of the technical reference manual, so I would really appreciate your help.

Re: I2S interface receiving TDM from ICS-52000 array

Posted: Fri Jul 31, 2020 7:29 am
by ESP_Sprite
No clue about the TDM format you're using specifically, but you can always invert the outgoing signal of a GPIO by setting a register. To quote a post from one of my colleagues:
costaud wrote:
Thu Jan 31, 2019 3:36 am
I think the best and easiest way to do that is to invert the GPIO output signal in esp32.

Refer to func_out_sel_cfg register in components/soc/esp32/include/soc/gpio_struct.h.
For example, if you want to invert GPIO18, you can use the following code to do that, after initializing light driver.

Code: Select all

GPIO.func_out_sel_cfg[18].inv_sel = 1;  // invert the output of GPIO matrix.
We will add an interface into idf for this kind of scenario.

Re: I2S interface receiving TDM from ICS-52000 array

Posted: Fri Jul 31, 2020 11:13 am
by mplanton
Thank you for your quick answer!
This worked perfectly. Now the bit clock is inverted and I did not have to change the i2s driver code.
Now there is some jitter on the WSO output of the first ICS52000, which distorts the audio signal, but
this is not an ESP32 issue.

Re: I2S interface receiving TDM from ICS-52000 array

Posted: Fri Aug 14, 2020 10:52 am
by mplanton
Just to close this topic, the jitter of the WSO signal from the first ICS52000 to the second could be removed by resoldering the IC.
So there was a bad solder joint.