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
Esp32 timer issue
-
- Valued Contributor
- Posts: 1518
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 729 times
-
- Matrix Staff
- Posts: 1936
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 506 times
- Been thanked: 688 times
Re: Esp32 timer issue
Hi Martin,
Ooh thanks I'll see if we can use this function instead, that would be much better.
Ooh thanks I'll see if we can use this function instead, that would be much better.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel