atomic14 / esp32-i2s-mic-test

The Simplest Test Code for an I2S Microphone on the ESP32 I can Imagine
117 stars 19 forks source link

Problem for SPH0645LM4H #3

Open PaulAnurag opened 1 year ago

PaulAnurag commented 1 year ago

Mic Module : SPH0645LM4H Micro-controller ESP32.

Problem : I get 1 as my output.

Configurations (change in code) :

define SAMPLE_RATE 44100

// most microphones will probably default to left channel but you may need to tie the L/R pin low

define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_LEFT

// either wire your microphone to the same pins or change these to match your wiring

define I2S_MIC_SERIAL_CLOCK GPIO_NUM_4

define I2S_MIC_LEFT_RIGHT_CLOCK GPIO_NUM_0

define I2S_MIC_SERIAL_DATA GPIO_NUM_5

I have attached the logic analyzer png wherein data is being seen at the Din Pin of SPH0645Lm4H but the Esp32 is not able to read it.

image

Please help me if possible. I am stuck with this since 5 days now :(

Thanks Anurag Paul

xiaochutan123l commented 1 year ago

Hi, I encountered the same problem, but with INMP441, and the I2S data in oscilloscope also looked fine. If you are using Arduino IDE, just try to downgrade ESP32-Arduino core to an older (1.0.6 works for me) version in board manager. Hope it helps.

kadakadak commented 9 months ago

Same issue with a WROOM32. Returns only 1's.

kadakadak commented 9 months ago

Ah. The Adafruit I2S MEMS Microphone Breakout board uses the right channel. Use I2S_CHANNEL_FMT_ONLY_RIGHT in the config.

chinswain commented 4 months ago

For me only I2S_CHANNEL_FMT_RIGHT_LEFT works on the SPH0645. There's also a timing issue which is resolved by:

#include "soc/i2s_reg.h"
void setup() {
...
  REG_SET_BIT(I2S_TIMING_REG(i2s_num), BIT(9));   
  REG_SET_BIT(I2S_CONF_REG(i2s_num), I2S_RX_MSB_SHIFT);
...
Meandmybadself commented 3 months ago

For those arriving here, this may be of use to you: https://hackaday.io/project/162059-street-sense/log/160705-new-i2s-microphone