I2S communication using SPH0645LM4H-1Mic

Anurag Paul
Posts: 10
Joined: Thu Jul 14, 2022 5:07 am

I2S communication using SPH0645LM4H-1Mic

Postby Anurag Paul » Fri Nov 25, 2022 6:41 am

Hi Team

I am working on I2S communication and trying to read data from SPH0645LM4H Mic. I am using IDF version 4.4.

I have tried the https://github.com/espressif/esp-idf/tr ... der_sdcard example but changed the configuration for SPH0645 but it does not work.

My configuration for I2s for SPH0645 in the example code is:

static const i2s_port_t i2s_num = I2S_NUM_0;
static const i2s_config_t i2s_config = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),
.sample_rate = 44100,
.bits_per_sample = I2S_BITS_PER_SAMPLE_32BIT,
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
.communication_format = I2S_COMM_FORMAT_STAND_I2S,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // default interrupt priority
.dma_buf_count = 8,
.dma_buf_len = 64,
.use_apll = false
};

static const i2s_pin_config_t pin_config = {
.bck_io_num = BCLK,
.ws_io_num = WS,
.data_out_num = -1,
.data_in_num = DIN
};

i2s_driver_install(i2s_num, &i2s_config, 0, NULL); //install and start i2s driver
REG_SET_BIT( I2S_TIMING_REG(i2s_num),BIT(9)); /* #include "soc/i2s_reg.h" I2S_NUM -> 0 or 1*/
REG_SET_BIT( I2S_CONF_REG(i2s_num), I2S_RX_MSB_SHIFT);
i2s_set_pin(i2s_num, &pin_config);
i2s_set_clk(i2s_num, 16000, I2S_BITS_PER_SAMPLE_32BIT, I2S_CHANNEL_MONO);

If someone has worked on it. Please let me know.

Regards
Anurag Paul

Who is online

Users browsing this forum: No registered users and 108 guests