Page 1 of 1

ESP32-S3 SYSTIMER clock source

Posted: Fri Nov 10, 2023 10:31 am
by palhinhaa
Hi,

On ESP32-S3 I'm using peripheral SYSTIMER to measure time. Using register SYSTIMER.unit_val[0].lo.timer_unit_value_lo to get 32bit counter. I've stated that this register is sourced by a 16MHz clock, how can I configure this SYSTIMER clock?
Currently CPU is running at 240MHz, is there a divider in the clock tree that I can configure to increase SYSTIMER clock? Or is it a fixed clock?

Thank you

Re: ESP32-S3 SYSTIMER clock source

Posted: Sat Nov 18, 2023 11:33 pm
by MicroController
From the TRM:
The counters and comparators are driven using XTAL_CLK. After scaled by a fractional divider, a fXTAL_CLK/3
clock is generated in one count cycle and a fXTAL_CLK/2 clock in another count cycle. The average clock
frequency is fXTAL_CLK/2.5, which is 16 MHz, i.e. the CNT_CLK in Figure 11-2. The timer counting is
incremented by 1/16 μs on each CNT_CLK cycle.
How about esp_cpu_get_cycle_count()?