That's on a Teensy 4.1.
My code is:
I put the code in a loop and drop the pins at the beginning. I've also setup the timers outside the loop. I'm using the Arduino IDE.
That seems to take around 39 nanoseconds. That seems slow to me. Since everything is a constant, reading the timer should only be one instruction. When I comment out the TMR... line, it takes 3 nsec from leading edge to leading edge.
Where would I find out how long that should take?
(I should comment, that there may be something funky about my measurement setup. It might be a PICNIC -- Problem In Chair, Not In Computer problem.)
Thanks,
Ken
My code is:
Code:
digitalWriteFast(READING_start_pin, HIGH); // create a leading edge
// capture the counters by reading one
TMR3->CH[0].CNTR; // get all the values into TMR3->CH[n].HOLD
digitalWriteFast(READING_end_pin, HIGH); // create a leading edge
That seems to take around 39 nanoseconds. That seems slow to me. Since everything is a constant, reading the timer should only be one instruction. When I comment out the TMR... line, it takes 3 nsec from leading edge to leading edge.
Where would I find out how long that should take?
(I should comment, that there may be something funky about my measurement setup. It might be a PICNIC -- Problem In Chair, Not In Computer problem.)
Thanks,
Ken