ESP32S3 (WROOM) I2S question

PCRiscV
Posts: 11
Joined: Thu Jan 04, 2024 3:57 pm

ESP32S3 (WROOM) I2S question

Postby PCRiscV » Wed Jan 10, 2024 5:55 pm

Hello,

I am new to the ESP32 family but not new to embedded software programming. I am trying to get the I2S bus to work with MEMS microphone.

I have configured the I2S as follow:
  1.    
  2. i2s_std_config_t std_cfg = {
  3.         .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(48000),
  4.         .slot_cfg = I2S_STD_MSB_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_32BIT, I2S_SLOT_MODE_STEREO),
  5.         .gpio_cfg = {
  6.             .mclk = PIN_I2S_MCLK,
  7.             .bclk = PIN_I2S_BCLK,
  8.             .ws = PIN_I2S_WS,
  9.             .dout = I2S_GPIO_UNUSED,
  10.             .din = PIN_I2S_DIN,
  11.             .invert_flags = {
  12.                 .mclk_inv = false,
  13.                 .bclk_inv = false,
  14.                 .ws_inv = false,
  15.             },
  16.         },
  17.     };
During boot, I see the following messages:
I (300) mems: Starting the I2S bus
D (301) i2s_common: rx channel is registered on I2S0 successfully
D (301) i2s_common: MCLK is pinned to GPIO0 on I2S4
D (302) i2s_common: DMA malloc info: dma_desc_num = 6, dma_desc_buf_size = dma_frame_num * slot_num * data_bit_width = 1920
D (303) i2s_std: Clock division info: [sclk] 160000000 Hz [mdiv] 13 [mclk] 12288000 Hz [bdiv] 4 [bclk] 3072000 Hz
D (305) i2s_std: The rx channel on I2S0 has been initialized to STD mode successfully
D (306) i2s_common: i2s rx channel enabled
But when I look at the signal with the logic analyzer, I am seeing some bizarre things (see attachment #2). The WS signal is not good when low but is right when high.

Even the BCLK signal is not quite right. When the WS signal transition to high, the BCLK signal has a glitch (attachment #1)

Where should I look next?
Thanks.
Attachments
Screenshot 2024-01-10 at 12.50.23 PM.png
Attachment #2
Screenshot 2024-01-10 at 12.50.23 PM.png (239.97 KiB) Viewed 23199 times
Screenshot 2024-01-10 at 12.42.51 PM.png
Attachment #1
Screenshot 2024-01-10 at 12.42.51 PM.png (181.37 KiB) Viewed 23199 times

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

Re: ESP32S3 (WROOM) I2S question

Postby ESP_Sprite » Thu Jan 11, 2024 2:04 am

That honestly looks like measurement errors. Is your LA ground connected properly and is the threshold set appropriately? Long unshielded wires running in parallel can also lead to results like this.

PCRiscV
Posts: 11
Joined: Thu Jan 04, 2024 3:57 pm

Re: ESP32S3 (WROOM) I2S question

Postby PCRiscV » Thu Jan 11, 2024 10:36 pm

You are right! My mistake. I fixed my wiring and everything looks good on the logic analyzer.
Sorry about that.

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

Re: ESP32S3 (WROOM) I2S question

Postby ESP_Sprite » Fri Jan 12, 2024 3:00 am

No worries, things like that are kinda hard to recognize when they happen on a LA. Glad to hear you're getting more sane measurements now!

Who is online

Users browsing this forum: No registered users and 103 guests