ESP32 max fast freq pin

stoumk
Posts: 11
Joined: Tue May 24, 2022 10:54 am

ESP32 max fast freq pin

Postby stoumk » Tue May 24, 2022 11:03 am

Hello guys
I'm trying to get the maximum GPIO output speed. This code gives an output of 8 MHz. Which corresponds to 125 ns.

Code: Select all

    REG_WRITE(GPIO_ENABLE_REG, BIT2 | BIT4 | BIT5); // GPIO out
while (1)
{ // 8 MHz
    REG_WRITE(GPIO_OUT_W1TC_REG, (1 << 2) | (1 << 4) | (1 << 5) );//GPIO HIGH
    REG_WRITE(GPIO_OUT_W1TS_REG, (1 << 2) | (1 << 4) | (1 << 5) );//GPIO LOW
}
I want to reach the minimum value(ns). The best option is 10-50ns ~ 20MHz. How can I achieve this on ESP32?

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

Re: ESP32 max fast freq pin

Postby ESP_Sprite » Wed May 25, 2022 1:54 am

On an ESP32, you can't, really, as GPIO writes need to go through the APB bus. Other ESP32-range chips do have some sort of fast GPIO functionality. Suggest you use a peripheral (RMT, I2S-parallel, ...) to generate the signal you need instead.

Who is online

Users browsing this forum: No registered users and 125 guests