I2S PDM clock
Posted: Tue Dec 04, 2018 4:18 pm
Hi everyone,
I would like to capture audio via a mems microphone on the pdm bus.
I've already purchased an esp32-wroom-32 card with which I'm starting to try. using the configuration below I checked with the oscilloscope that the shape of the clock is poor and also has a duty cycle of 60% contrary to the PDM bus standard.
my question is: is the signal shape expected or is this shape indicative of a problem?
I'm using the configuration below.
Thanks, Paolo
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM,
.sample_rate = 48000,
.bits_per_sample = 16,
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_PCM,
.dma_buf_count = 2,
.dma_buf_len = 8,
.use_apll = 0,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1
};
pin_config = {
.ws_io_num = 4, //PDM clock
.data_in_num = 2, //PDM data
};
i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL);
i2s_set_pin(I2S_NUM_0, &pin_config);
I would like to capture audio via a mems microphone on the pdm bus.
I've already purchased an esp32-wroom-32 card with which I'm starting to try. using the configuration below I checked with the oscilloscope that the shape of the clock is poor and also has a duty cycle of 60% contrary to the PDM bus standard.
my question is: is the signal shape expected or is this shape indicative of a problem?
I'm using the configuration below.
Thanks, Paolo
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM,
.sample_rate = 48000,
.bits_per_sample = 16,
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_PCM,
.dma_buf_count = 2,
.dma_buf_len = 8,
.use_apll = 0,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1
};
pin_config = {
.ws_io_num = 4, //PDM clock
.data_in_num = 2, //PDM data
};
i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL);
i2s_set_pin(I2S_NUM_0, &pin_config);