Previous in Forum: Small Electronics Engineer or Gadget Maker   Next in Forum: Battery charger
Close
Close
Close
Rate Comments: Nested
Anonymous Poster #1

Rotary Encoder

12/02/2011 5:00 AM

I am wondering, have anyone tested speed for a polled program
decoding an rotary encoder ? Would an interrupt driven program

do better ? how would be the program in pic16f877a?

Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Cosmology - New Member Technical Fields - Technical Writing - New Member Engineering Fields - Energy Engineering - New Member Engineering Fields - Electrical Engineering - New Member Engineering Fields - Control Engineering - New Member Engineering Fields - Electromechanical Engineering - Old Member, New Association

Join Date: Apr 2008
Location: Lexington, KY
Posts: 1639
Good Answers: 73
#1

Re: Rotary Encoder

12/21/2011 2:07 PM

I have used PIC chips to monitor pulses from an encoder but I made sure that I was clocking much faster than my fastest pulse rate. Obviously one needs to know quite a bit about the specific application and you have not yet given that kind of detailed information.

You may need to perform some tests and measurements to determine your maximum encoder rate. A PIC running on a 2MHz clock will have lots of time to execute as much as 100 instructions for an encoder that only produces 10,000 pulses per second. In that case, an interrupt approach is fairly easy and repeatable since it only takes a fixed amount of time to respond to the change of state. If you are polling and doing other things in between, the response can become a little jittery.

Perhaps you will describe the technical specifics a little more?

__________________
A great troubleshooting tip...."When you eliminate the impossible, whatever remains, however improbable, must be the truth." Sir Arthur Conan Doyle
Reply
Reply to Forum Thread

Previous in Forum: Small Electronics Engineer or Gadget Maker   Next in Forum: Battery charger

Advertisement