LOPY Timer interrup
I need to generate a square signal on a pin at a precise frequency as the PWM function could do.
But i need to adjust this frequency in real time .. mmm.. the goal is to generate a square signal to control a stepper motor including acceleration phases.
So, i'm searching something like a timer interrupt where i could adjust frequency outside the handler.
i found that :
but it doesnt compile on my LOPY ?
Could you please give me some help or ideas to solve my problem ?
thanks. I'll wait and try.
jmarcelino last edited by jmarcelino
thanks for this informations.
Is there a way to acheive my goal or have i to return on more real time uController ?
This post is deleted!
robert-hh last edited by
@easytryer The example you refer to is for a WiPy 1 device. That's not compatible to a WiPy 2 or LoPy. using a time interrupt is not recommended, since interrupts on the Lopy (and all the other Espressif devices) have a vary long and varying latency (see https://forum.pycom.io/topic/936/pin-interrupt-latency). The test was made for a Pin interrupt, but for timer interrupts you should expect the same behavior.