Hi,
I am using the EXTI driver on a OLIMEX_STM32_H407 board to capture external events (i.e. data ready from a gyro).
What is the best/suggested way to grab an accurate time stamp for the event?
Since I do not need an RTC time stamp currently I am thinking to simply grab chTimeNow() within the EXTI routine;
is this a good way to have the most accurate time between two events (obtained subtracting the relevant time stamps of course)?
thanks in advance
Renzo
EXTI event timestamping newbie
Moderators: RoccoMarco, lbednarz, tfAteba
Re: EXTI event timestamping newbie
Without using an RTC, chTimeNow() is the best way that I know of. Maybe there is something else, but I don't know anything and chTimeNow() always worked great for me.
~ Tectu
~ Tectu
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: EXTI event timestamping newbie
Hi,
You may want to use the ICU driver instead, it allows accurate measurements of periods and pulse widths. Alternatively you can read the RT counter using halGetCounterValue() from the EXT callback however you will have a noticeable measurement jitter caused by the ISR latency.
Giovanni
You may want to use the ICU driver instead, it allows accurate measurements of periods and pulse widths. Alternatively you can read the RT counter using halGetCounterValue() from the EXT callback however you will have a noticeable measurement jitter caused by the ISR latency.
Giovanni