I'm planning to use a raspberry pi to move DC motors using a PID programmed on the raspberry pi. the question is can I interrupt the raspberry pi by hardware, The idea is to interrupt it depending on the encoder signal.

taking a look at this post

mmc0: Timeout waiting for hardware interrupt trigger watchdog

I know that raspberry pi has them, but can I use them???

tx in advance

1 Answer 1


It depends on how you want to program.

If you write "bare-metal", i.e. with no operating system, you can handle gpio interrupts yourself.

If you are running under Linux you can't directly receive interrupts as Linux handles all interrupts. However you can request that you are notified of gpio interrupts. That will add a latency of say 50-70 microseconds from the time of the gpio interrupt to the time your process receives notification.

A graph plotting interrupt latency in microseconds for 5000 gpio interrupts on the Raspberry Pi (C using the poll I/F).

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.