Esp32 timer issue
Posted: Wed Jul 31, 2024 6:44 pm
Using the timer component on esp32.
GetRawCount ("gets instruction count") actually returns number of default time units (so for a standard timer on timer 0 - this is 1ms units)
It is possible to get the instruction count using xthal_get_ccount() in a code macro. This increments and about 240MHz (on my esp32 with a 1s delay I got 239971173 counts)
I wanted to check if >1us had passed since previous interrupt (so count >= 240)..
Martin
GetRawCount ("gets instruction count") actually returns number of default time units (so for a standard timer on timer 0 - this is 1ms units)
It is possible to get the instruction count using xthal_get_ccount() in a code macro. This increments and about 240MHz (on my esp32 with a 1s delay I got 239971173 counts)
I wanted to check if >1us had passed since previous interrupt (so count >= 240)..
Martin