Arduino Due - Quadrature Encoder Speed Measurement How?

I have been ben struggling with the SAM3X and its documentation for a couple of weeks now, and I just can't get my head around setting up the timers for "Speed Measurement" using a quadrature encoder. Everything is so disjoint to me. If any anyone has any experience or a library that supports this mode I would appreciate it.

Thanks in advance,



Look at Reply#42. Might help you get farther.

Thanks just saw this. Everything works fine up to 600 RPM. I was really hoping to get the hardware "Speed Measurement" working on Timer 2. Actually I have it working to some degree, just not properly.

If you are referring to Timer/Counter Channel 2 (from TC0), the code from Reply #42 already uses this. If you meant TC2, the code will still work, but most of the configuration bits will need to be changed to use TC2.

Using an 1800ppr encoder, I am able to go beyond 1000rpm with no troubles. Others have gone much faster.