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: 156
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

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: 156
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

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 37257 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.

dzungpv
Posts: 43
Joined: Thu Mar 26, 2020 4:52 am

Re: Logic analyzer on ESP32 for self-diagnostics

Postby dzungpv » Sat May 10, 2025 4:37 am

I use your project and it is great but 50k sample for ESP32 is limited with long signal.
It is possible to make sample with ESP32 to 128k like the project you mention in the github https://github.com/EUA/ESP32_LogicAnalyzer?

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

Re: Logic analyzer on ESP32 for self-diagnostics

Postby ok-home » Sat May 10, 2025 8:20 am

the size is limited by the free memory of the application
the analyzer is made to capture data with minimal impact on the running application,
if you need more free memory, you can use cli mode

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

Re: Logic analyzer on ESP32 for self-diagnostics

Postby ok-home » Thu Jul 10, 2025 3:59 pm

Added support for ESP32P4

  • Only CLI interface is supported
  • Data reading in parallel mode 8/16 bit by LCD/CAM module, one GPIO is required for PCLK signal
  • For sample rate less than 1 MHz, one LEDC channel is required
  • You can select IRQ/ETM trigger mode, ETM mode requires one more additional free GPIO
  • Maximum sampling rate does not depend on the number of channels and the type of memory for the buffer (Ram/Psram) and is 80 MHz (for PSRAM frequency = 200 MHz)
  • The number of samples is limited only by the size of free memory (Ram/Psram), The maximum number of samples can be 32,000,000 for modules with a Psram volume of 32 Mbyte.

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: Logic analyzer on ESP32 for self-diagnostics

Postby Sprite » Fri Jul 11, 2025 12:24 am

Added support for ESP32P4
Not sure if you're interested, but if you squirrel around in the SDK a bit, you can potentially make the P4 go much faster, probably up to 200MHz or so. Very high-level view: At least the PARLIO peripheral can also accept an external clock signal; I think this is specced for up to 80MHz but it can actually go a lot faster. (Possibly the LCDCAM module can do this as well, I haven't checked.) Additionally, if you make the PSRAM use the system PLL rather than the MPLL, you free that up for use as a random clock generator. You can then abuse the 50MHz output pin intended for Ethernet PHYs to output the clock signal; connect the PARLIO/LCDCAMs clock input pin to the same pin and it'll run on that clock signal. (But do note that on some silicon revs of the P4, the MPLLs clock frequency isn't quite stable: you may want to look into using other PLLs for that.)

Who is online

Users browsing this forum: No registered users and 1 guest