esp32 get time with nanoseconds precision

akashdeepsingh
Posts: 9
Joined: Thu Feb 28, 2019 8:28 pm

esp32 get time with nanoseconds precision

Postby akashdeepsingh » Thu Feb 28, 2019 8:34 pm

Hi,

I am looking for a way to get the time since boot with nanoseconds precision. Currently, the best I can do is esp_timer_get_time() which returns time with microsecond precision. I connected my board to an oscilloscope and found out that it takes around 1.29 us for the esp_timer_get_time() function to return time. Can I do better and with higher precision.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: esp32 get time with nanoseconds precision

Postby WiFive » Fri Mar 01, 2019 1:20 am

At 240mhz cpu tick is 4ns so you can check ccount or portGET_RUN_TIME_COUNTER_VALUE

Who is online

Users browsing this forum: Bing [Bot] and 102 guests