bigal_scorpio
Active Member
Hi to all,
I have for quite a while being scouring the net for a way to use a Rotary Encoder on a PIC microcontroller.
The problem I'm having isn't a lack of info, just different ways of doing it keep popping up and I don't know which is best!
I have seen or gates used and even diodes to get the 2 bits of grey code to the single interrupt pin of the PIC, and seeing as this is the first time I have used an Encoder and I am certainly NOT a PIC genius I thought I would ask the experts, some of you no doubt have experience of these.
Is there a tried and trusted or should I say widely accepted method of doing this?
The encoder will be used to determine the position of a car seat moved by a motor. The Encoder is a standard type with 20 detents and will not be turning fast, I'm guessing about 10RPM and maybe a couple of complete rotations from limit to limit, depending on how I gear the linkage, giving me about 40 positions in all. Hopefully I will have 3 control switches for the positions, 2 giving me the separate positions and the third to let me set the position in memory.
So which is the best way in this forums opinion.
Your humble student...........Al
I have for quite a while being scouring the net for a way to use a Rotary Encoder on a PIC microcontroller.
The problem I'm having isn't a lack of info, just different ways of doing it keep popping up and I don't know which is best!
I have seen or gates used and even diodes to get the 2 bits of grey code to the single interrupt pin of the PIC, and seeing as this is the first time I have used an Encoder and I am certainly NOT a PIC genius I thought I would ask the experts, some of you no doubt have experience of these.
Is there a tried and trusted or should I say widely accepted method of doing this?
The encoder will be used to determine the position of a car seat moved by a motor. The Encoder is a standard type with 20 detents and will not be turning fast, I'm guessing about 10RPM and maybe a couple of complete rotations from limit to limit, depending on how I gear the linkage, giving me about 40 positions in all. Hopefully I will have 3 control switches for the positions, 2 giving me the separate positions and the third to let me set the position in memory.
So which is the best way in this forums opinion.
Your humble student...........Al