I2S interface receiving TDM from ICS-52000 array

mplanton
Posts: 4
Joined: Thu Jul 30, 2020 2:26 pm

I2S interface receiving TDM from ICS-52000 array

Postby mplanton » Thu Jul 30, 2020 2:55 pm

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.

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: I2S interface receiving TDM from ICS-52000 array

Postby ESP_Sprite » Fri Jul 31, 2020 7:29 am

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.

mplanton
Posts: 4
Joined: Thu Jul 30, 2020 2:26 pm

Re: I2S interface receiving TDM from ICS-52000 array

Postby mplanton » Fri Jul 31, 2020 11:13 am

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.

mplanton
Posts: 4
Joined: Thu Jul 30, 2020 2:26 pm

Re: I2S interface receiving TDM from ICS-52000 array

Postby mplanton » Fri Aug 14, 2020 10:52 am

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.

Who is online

Users browsing this forum: BivvyCoder and 31 guests