Hi Eric,
Yes I would say that the pattern is like your drawing, well it is if I can turn the encoder with perfect precision, wish I had a very low geared motor, I would motorise one of the little buggers and take human error out of the equation!
So if I am getting the trace you drew what is it telling you?
I', beginning to wonder if these encoders are all they're cracked up to be.
Regards..............Al
hi Al,Hi Eric,
I was thinking that I could gear up the motion of the seat so as to for example give maybe 2 rotations of the encoder from end to end, I will also try and build a little mechanical "slack" into the gearing so that the encoder won't stop between detents hopefully!
Do the readings tell you anything specific about the encoders? I was thinking that the mentioned version that was not absolute was more in keeping with the results but I can't get my head round the reason for this type as opposed to the absolute ones?
Regards.............Al
BTW for Mikebits, the data I have on the encoders is in the ebay link I posted, and I cannot find the actual makers sheet as there ane no markings on them.
Al
The ones with detents and built-in push-button switch on the shaft are intended for use as data entry or data input devices. For example, you could use the encoder to increase or decrease a value displayed on an LCD or 7-segment display or to move through an LCD menu of options. You might also detect "short" or "long" push-button switch presses. So you see you might be able to perform all user input on a particular product using a rotary encoder and 3 PIC pins...I', beginning to wonder if these encoders are all they're cracked up to be.
This may sound like a simple thing to some of you but since I'm fairly (read very) inexperienced with PICs I have to ask. How do I determine whether AB or BA has occurred? I cannot get my head round the way to do it at all, specially since there is no actual timing as such that I can rely on, the motor speed will vary according to load and other circumstances, even the weather! So I can't poll the bits at a particular interval as I don't know what it will be!
Al
Thanks for all the input so far Guys,
I am at the moment tending to agree with some ot the posts about these encoders, that they are not absolute and in fact have no grey code as such, just a simple A - AB - B or in reverse B - BA - A sequence between Every detent!
This may sound like a simple thing to some of you but since I'm fairly (read very) inexperienced with PICs I have to ask. How do I determine whether AB or BA has occurred? I cannot get my head round the way to do it at all, specially since there is no actual timing as such that I can rely on, the motor speed will vary according to load and other circumstances, even the weather! So I can't poll the bits at a particular interval as I don't know what it will be!
WaitLow btfss PORTA,0 ;A
goto WaitLow ;wait for A = 0
WaitHigh btfsc PORTA,0 ;A
goto WaitHigh ;wait for A = 1
btfss PORTA,1 ;B = 0
incf Count,F ;clockwise
btfsc PORTA,1 ;B = 1
decf Count,F ;anticlockwise
goto WaitLow
WaitLow btfss PORTA,0 ;A
goto WaitLow ;wait for A = 0
btfsc PORTA,1 ;B = 1
incf Count,F ;clockwise
btfss PORTA,1 ;B = 0
decf Count,F ;anticlockwise
WaitHigh btfsc PORTA,0 ;A
goto WaitHigh ;wait for A = 1
btfss PORTA,1 ;B = 0
incf Count,F ;clockwise
btfsc PORTA,1 ;B = 1
decf Count,F ;anticlockwise
goto WaitLow
hi Al,
Looking thru some PIC application notes I found this pdf which will help regarding the encoder... Pages 23+
Also other useful information on PIC usage/applications.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?