Trivial code sometimes takes 5ms and interrupts are missed

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
ArmyrAntSEC
Posts: 7
Joined: Sat Jul 17, 2021 7:26 pm

Re: Trivial code sometimes takes 5ms and interrupts are missed

Post by ArmyrAntSEC » Sun Jul 25, 2021 6:23 am

Thanks.

But am not convinced. But I will take this to the development forum, since it is about a change to micropython documentation and not a question about a raspberry pi-specific question.

danjperron
Posts: 51
Joined: Thu Dec 27, 2018 11:38 pm
Location: Québec, Canada

Re: Trivial code sometimes takes 5ms and interrupts are missed

Post by danjperron » Mon Jul 26, 2021 1:30 pm

Depending of your time resolution you want you are restricted with gc and the clock of the cpu and the code in your loop.
Hardware interrupt is a most for time critical operation.

B.T.W. Setting the cpu at 250Mhz and it works just fine! The Garbage collector and the floating point operation are fast enough for your millisecond accuracy.

machine.freq(250000000)

Post Reply