why would they need to be turned off, presumably for a serial buf empty/has-room interrupt? wouldn't that interrupt just be services and possibly delaying an encoder interrupt?
During an interrupt no ISR can be called, if the interrupt gets called multiple times during that, the ISR will only be executed once. So delaying or even missing. Delaying should not be to bad, though it could mean a misinterpreted encoder state, missing would be worse i guess. 'turned off' may not be the correct terminology, but i think you get my drift (and are being a bit fussy imo)
How many position-changes do you estimate within the life-time of your device?
- a few hundred?
- a few thousands
- tenthousands of changes?
If it are more than a few thousands then a mechanical encoder like used for knobs is the wrong thing.
The contacts will wear out and the encoder will become unreliably
What makes the linear actor move?
- airpressure?
- oilpressure?
- a DC-motor?
- a stepper-motor?
- a pwm-pulsed current?
You should describe your whole project. It might well be that a very different easier to realise solution can be found
yes, interrupts don't interrupt interrupts in progress. Didn't understand why you said interrupts get turned off.
seems you're suggesting Serial interrupts are too long, longer that the time 2 encoder interrupt would occur. how long do you think serial interrupt takke?
That is a possibility, with a FIFO the size the esp32 has, it will be the amount of time it takes to transfer all bytes to the FIFO. On an AVR the FIFO is rather small (2 bytes i think) so the FiFO empty interrupt gets triggered for every byte. As i said it is not all that likely that this will cause issues, but it might. Actually if the time between 2 state changes is exceeded, the new state will not be the next state in the sequence causing a malfunction already.
But enough of this.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.