Reduce cpu frequency dynamically on ESP32

Hi,

I am using Arduino on ESP32 and my application requires WiFi and UART but not at same time. Its an always on data logger kind of application running on battery. My app does a long data transfer (periodically) over UART and so I want to reduce the speed to 80Mhz (or even lower if possible) to extend battery life. Occasionally the user presses a button to stop the data logging logic and switch on WiFi to see the data over html using a webserver at which time I can switch to full speed @240Mhz. After user disconnects the WiFi server will be shut off and the system will go back to 80Mhz (or lower).

I did not find any arduino example that shows dynamic switching between 80Mhz and 240Mhz. Can somebody please show me link to dynamic frequency switching example that I can try?

Thanks and Regards,
WonderfulIOT

Dynamic frequency scaling (DFS) and automatic light sleep can be enabled in an application by calling the function esp_pm_configure(). Its argument is a structure defining the frequency scaling settings, esp_pm_config_esp32_t. In this structure, three fields need to be initialized:.

Good luck.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.