Logic analyzer on ESP32 for self-diagnostics

blade77
Posts: 8
Joined: Mon Sep 09, 2024 8:20 pm

Re: Logic analyzer on ESP32 for self-diagnostics

Postby blade77 » Thu Sep 12, 2024 7:41 am

Thanks a lot! Static 40 MHz sample rate seems to work fine for my use case. I would also like to send packages at 40 MHz as a kind of automation. I will try to figure out how.

blade77
Posts: 8
Joined: Mon Sep 09, 2024 8:20 pm

Re: Logic analyzer on ESP32 for self-diagnostics

Postby blade77 » Tue Sep 17, 2024 8:54 pm

I had to do the following changes for slave mode (using external clock) on ESP32:

Code: Select all

gpio_matrix_in(SD_CLOCK_PIN, I2S0I_WS_IN_IDX, false);

Code: Select all

I2SX.conf.rx_slave_mod = 1;

Code: Select all

//    logic_analyzer_ll_set_clock(sample_rate);
It seems to capture sd interface signals stable with 20 MHz clock.

User avatar
ok-home
Posts: 78
Joined: Sun May 02, 2021 7:23 pm
Location: Russia Novosibirsk
Contact:

Re: Logic analyzer on ESP32 for self-diagnostics

Postby ok-home » Wed Sep 18, 2024 8:54 am

blade77 wrote:
Tue Sep 17, 2024 8:54 pm
It seems to capture sd interface signals stable with 20 MHz clock.
I'm glad it worked out for you ))

blade77
Posts: 8
Joined: Mon Sep 09, 2024 8:20 pm

Re: Logic analyzer on ESP32 for self-diagnostics

Postby blade77 » Sun Oct 13, 2024 9:09 pm

on a side note via commenting

Code: Select all

//    logic_analyzer_ll_set_clock(sample_rate);
actually default values will be applied according the ESP32 technical reference manual. The default values are equivalent with these lines

Code: Select all

   I2SX.clkm_conf.clkm_div_num = 4;
   I2SX.sample_rate_conf.rx_bck_div_num = 6;
... actually I don't get why does it work on 20 MHz in slave mode...

User avatar
ok-home
Posts: 78
Joined: Sun May 02, 2021 7:23 pm
Location: Russia Novosibirsk
Contact:

Re: Logic analyzer on ESP32 for self-diagnostics

Postby ok-home » Mon Oct 14, 2024 1:50 am

blade77 wrote:
Sun Oct 13, 2024 9:09 pm
on a side note via commenting

Code: Select all

// logic_analyzer_ll_set_clock(sample_rate);
actually default values will be applied according to the ESP32 technical reference manual. The default values are equivalent with these lines

Code: Select all

 I2SX.clkm_conf.clkm_div_num = 4; I2SX.sample_rate_conf.rx_bck_div_num = 6;
.... actually I don't get why does it work on 20 MHz in slave mode...
I haven't looked into slave mode in detail I can only assume that
I2SX.clkm_conf.clkm_div_num = 4; clk -> 160/4 = 40 mHz
I2SX.sample_rate_conf.rx_bck_div_num = 6; -> not used because you are feeding external clk to WS_IN, maybe 40 mHz is enough to steadily capture 20 mHz samples
cameraslave.JPG
cameraslave.JPG (30.09 KiB) Viewed 14471 times

blade77
Posts: 8
Joined: Mon Sep 09, 2024 8:20 pm

Re: Logic analyzer on ESP32 for self-diagnostics

Postby blade77 » Sun Oct 20, 2024 9:07 pm

Thanks a lot! It is a very useful hint that actually rx_bck_div_num is not used in parallel slave mode.

Who is online

Users browsing this forum: No registered users and 27 guests