I am building a high-torque steering servo. I am trying to use the Adafruit Feather M0, which has a CPU speed of 48MHz, to monitor a 2-phase encoder that has 2400 pulses per rotation. I have attached the encoder's 2 signal wires to interrupt pins on the Feather M0. I have it almost working, but sometimes it just stops responding or has a very delayed response. I have a suspicion that I'm overloading the CPU. There are some other factors at play, in addition to the encoder signals. I am also using serial communication to report the position information.

I am trying to get a grasp on determining the required micro-controller CPU speed for my project.

  • $\begingroup$ Its a 2 phase-encoder, meaning it has 2 signal outputs; phase A and phase B. This allows the microcontroller to determine the direction of rotation. I thought that was fairly clearly explained in my OP. $\endgroup$ – Shea Riley Aug 14 '19 at 18:59
  • $\begingroup$ you only need one interrupt ... the state of the two pins at the interrupt event determine the direction of rotation ... do you have any specific reason for using two interrupts? $\endgroup$ – jsotola Aug 15 '19 at 18:48
  • $\begingroup$ I think I see what you mean now. I'm sorry for being suspicious of your comment. I've seen some people just trying to get points by posting answers without clearly considering the OPs problem. I will try this and let you know how it goes. $\endgroup$ – Shea Riley Aug 18 '19 at 23:17
  • $\begingroup$ no need to apologize ... i understand your concern about answers ... i do not think that points are collected for comments $\endgroup$ – jsotola Aug 18 '19 at 23:36
  • $\begingroup$ I remove the second interrupt attachment and I'm sure that will help, but I'm still having the same issues. I don't know for sure, but it seems like the board is crashing while monitoring the encoder. All of a sudden the position value is reset back to zero. I have some logic that does reset the counter if it goes past the max pulses per rotation, but it doesn't ever appear to get to that point before resetting. $\endgroup$ – Shea Riley Aug 19 '19 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.