Log in

View Full Version : EDU Demo Code: Encoder Interfacing Using Interrupts


Kevin Watson
20-12-2003, 14:02
I'm writing a motor controller that I intend to release in the future, but because of the interest in interfacing encoders lately, I've put together a small example that shows the best way I know to interface a quadrature encoder to the EDU robot controller. With this code, I've been able to track an encoder generating a few thousand counts per second. The code can be found here: http://kevin.org/frc.

-Kevin

GregTheGreat
20-12-2003, 14:57
I'm writing a motor controller that I intend to release in the future, but because of the interest in interfacing encoders lately, I've put together a small example that shows the best way I know to interface a quadrature encoder to the EDU robot controller. With this code, I've been able to track an encoder generating a few thousand counts per second. The code can be found here: http://kevin.org/frc.

-Kevin


Very Kool.... This is definitely a great example of good programming.

Once again... Very Kool.

-Greg The Great

Caleb Fulton
22-12-2003, 01:09
Thanks!!

The more examples on how to use interrupts correctly and effectively, the better...

roknjohn
08-01-2004, 22:57
Kevin,

Thank you for all of the great interrupt examples for the EDU controller. They have been extremely educational. I've been racking my brain all year to figure out a simple way to use an encoder that had a useful resolution. This looks like an elegant solution with the new hardware.

My question is this: How does this translate to the full-size controller? I didn't see any interrupt pins on it.

Would we have to use a timer?

Kevin Watson
08-01-2004, 23:14
Kevin,

Thank you for all of the great interrupt examples for the EDU controller. They have been extremely educational. I've been racking my brain all year to figure out a simple way to use an encoder that had a useful resolution. This looks like an elegant solution with the new hardware. Thank you. I'm glad you're making use of the code.

My question is this: How does this translate to the full-size controller? I didn't see any interrupt pins on it.

Would we have to use a timer? Yes, we'll have interrupts on the new FRC controller. The port b interrupts on the EDU-RC directly map to the first six digital inputs on the new controller (i.e., Interrupt 1 = digital I/O 1, interrupt 2 = digital I/O 2,... interrupt 6 = digital I/O 6).

-Kevin