You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 29, 2023. It is now read-only.
Ardunio IDE 1.8.19
RP2040 core v2.5.2
RPI_PICO_TimerInterrupt 1.2.0
Adafruit Feather
Windows
Issue
I struggled to get a precise timing for repeating timer interrupts (using RPI_PICO_Timer X and X.setFrequency(.....) )
Eg. instead of expected 5000 hz, I get 4950 Hz, always little slower than intended (measured with Oszi)
Proposal
In the PICO SDK the function 4.2.14.4.2. add_repeating_timer_us has the option to pass the variable delay_us in positive and negative form. If positive values are passed and this leads to exact timing btw. end of timer interrupt call and the next timer interrupt call ( The way the libary is implemented (at least in setFrequency)
If negativ values are passed this leads to same intervalls btw. start of timer interrupt.
At least for me the passing negativ values to function add_repeating_timer_us solved the issue and the timer interrupt frequency is as expected.
Maybe you can give both options to set timers.