ESP8266 Frequencies: Crystal Frequency, CPU Frequency, Flash Frequency

Hi all

I installed Arduino IDE v1.8.9,
and on it installed ESP8266 Core for Arduino.

Looking at the tools menu, I see 3 different Frequency Settings for the board:

  • Crystal Frequency
  • CPU Frequency
  • Flash Frequency

I would like to understand how to correctly choose the value for each of these 3.

1) Crystal Frequency:
I will start with Crystal Frequency because that's the easiest.
You look on the PCB, you find the crystal for the ESP8266,
and in most cases you will see it's a 26MHz crystal,
and so, that is the correct value to set for this setting.

Now we're left with the other 2:

2) Flash Frequency:
I assume that what is called "Flash Frequency" in Arduino IDE,
is called "SPI Speed" in Espressif's Flashing Tool (the GUI Based one).

In Espressif's Flashing Tool it's always set on 40MHz.
In Arduino IDE it is also by default on 40MHz.
So should I leave it like that, and remember that the value for this setting is always 40MHz?
Have you encountered a case where it was a different value?

3) CPU Frequency:
This setting does not exist in Espressif's Flashing Tool.
The default for this setting in Arduino IDE is 80MHz..
From what I remember, the ESP8266EX MCU can work on both 80MHz and 160MHz,
but it seems that 80MHz is the common value..

So should this always be set to 80MHz?

And how come the CPU can work on a Frequency different than the Crystal, which is 26MHz?
If the Crystal is 26MHz, then what runs in 26MHz if not the CPU?

Thank you

1 Like