Blog
ESP32 Clock Speed: Frequency, rwdt, u2rxd
The ESP32’s clock is the answer to half your timing mysteries — and the cause of the other half.
How Precise Is ESP32 Clock?
Typical crystal spec is ±20 ppm — about 1.5-2 seconds of drift per day, more as the board heats up. The 32kHz RTC crystal drifts worse and is temperature-sensitive, so anything timestamp-critical wants NTP sync. How precise is esp32 clock in practice: precise enough for UART and timers, not precise enough for timekeeping without correction.
How to Change ESP32 Clock Speed in Arduino?
setCpuFrequencyMhz(160) — one call, no reboot needed. How to change esp32 clock speed in arduino is exactly that line; valid values are 240, 160, 80, 40, 20, 10, and 2 MHz, it changes live while the sketch runs. The ceiling depends on the chip: the C3 tops out at 160, and some S3 builds won’t take 240.
How to Check ESP32 Clock Frequency in Arduino?
Print getCpuFrequencyMhz() from the Arduino core — it returns the current CPU frequency in MHz. How to check esp32 clock frequency in arduino is a one-liner: Serial.println(getCpuFrequencyMhz()). There’s also getXtalFrequencyMhz() for the crystal and getApbFrequencyMhz() for the peripheral bus, if you’re hunting a timing bug.
How to Check ESP32 Clock Speed in Arduino?
Same idea, one function: getCpuFrequencyMhz() reports the live clock. How to check esp32 clock speed in arduino: Serial.println(getCpuFrequencyMhz()); — if it prints something you didn’t set, an earlier sketch changed it.
How to Set Clock Speed on ESP32?
Two places: in code with setCpuFrequencyMhz() for runtime changes, or in Tools → CPU Frequency in Arduino IDE, which bakes the speed into the sketch at compile time. How to set clock speed on esp32 at build time is that dropdown — and the dropdown wins until the sketch overrides it.
How to Trigger RWDT ESP32?
RWDT is the RTC watchdog — it fires when the low-power clock domain stops responding, so you rarely trigger it on purpose. What people actually trigger is the task watchdog: block the loop with while(true){} or esp_task_wdt_init(1, true) for a one-second timeout. If RWDT fires, the boot log shows rst:0x10 (RTCWDT_RTC_RESET). How to trigger rwdt esp32 in tests: hang the RTC domain via a broken deep-sleep wake, and expect the chip to just reset.
What clock speed does the ESP32 run at by default?
240MHz for the classic ESP32 — dual XTensa cores behind a 40MHz crystal. The S3 also runs 240; the C3 tops at 160. Lowering it saves power; the under-the-hood FAQ covers the clock tree in detail.
Does lowering the clock speed break WiFi or Bluetooth?
Below 80MHz the radio timing falls apart — the WiFi/BT stack depends on the APB clock, and going lower produces dead air, disconnects, or a stack crash. Keep the CPU at 80 or above whenever the radio is on; drop to 40 or 20 only for pure compute or deep idle. Power trade-offs live in the ESP32 power FAQ.
Why is my serial monitor full of garbage characters?
Almost always a baud mismatch, not a broken chip: firmware prints at 115200 while the terminal listens at 9600, or vice versa. The boot log lists clock details and UART pin mappings (U0RXD, U2RXD) — if every line looks like mojibake, fix the baud, not the hardware. My U2RXD tap showed solid garbage until I matched the monitor to 115200.
Can I test clock-sensitive code in a simulator?
Simulators model CPU frequency, timing, and watchdog behavior well enough to catch the logic bugs — start in the free ESP32 simulator and keep the same sketch for hardware. Timing-critical bits still deserve a real-board pass, mostly because heat and power supply aren’t simulated.
Feel a Clock by Its Output
Frequency is easiest to understand as rhythm: blink prints LED ON/LED OFF every 500 ms — halve the delay, double the tempo, watch the Serial Monitor keep up. The CPU-speed debates in this FAQ are about how much fits between beats; the beat itself you can observe for free.