ESP32-S3 SYSTIMER clock source

palhinhaa
Posts: 1
Joined: Fri Nov 10, 2023 10:04 am

ESP32-S3 SYSTIMER clock source

Postby palhinhaa » Fri Nov 10, 2023 10:31 am

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

MicroController
Posts: 1735
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32-S3 SYSTIMER clock source

Postby MicroController » Sat Nov 18, 2023 11:33 pm

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()?

Who is online

Users browsing this forum: Corand and 77 guests