For a Teensy 4.1 with Arduino ---
I've got some situations where I need to do 10s of nanosecond delays. I've found the delayNanoseconds function, but the documentation is not detailed.
Is there a location with hard specifics on this functions operation? I know from the Teensy page it's stated it will not be exact, but are more specifics available somewhere? For example, for a constant, will it ever delay less than the requested amount? For any given constant delay, what's the maximum it can be off (based on clock)? This would be very helpful.
Also, I'm looking for a way to measure nanosecond that have passed -- kind of like a time_t. I'd like to do something like
uint32_t diff;
uint32_t start = getNanoseconds();
// do stuff
// do stuff
// do stuff
diff = getNanoseconds() - start // yes, I know there's about 4s and this would need to deal with wrapping
Thanks for any thoughts on either of these questions.
I've got some situations where I need to do 10s of nanosecond delays. I've found the delayNanoseconds function, but the documentation is not detailed.
Is there a location with hard specifics on this functions operation? I know from the Teensy page it's stated it will not be exact, but are more specifics available somewhere? For example, for a constant, will it ever delay less than the requested amount? For any given constant delay, what's the maximum it can be off (based on clock)? This would be very helpful.
Also, I'm looking for a way to measure nanosecond that have passed -- kind of like a time_t. I'd like to do something like
uint32_t diff;
uint32_t start = getNanoseconds();
// do stuff
// do stuff
// do stuff
diff = getNanoseconds() - start // yes, I know there's about 4s and this would need to deal with wrapping
Thanks for any thoughts on either of these questions.