??? 06/12/08 07:15 Read: times |
#155725 - Help interfacing a home made rotary encoder |
Hello, I'm building a midi controller and want to put a rotary encoder on it, since there's no rotary encoders to buy in my city I thought I could build one, because of it's use, a burnt hard drive became as a very nice idea, nice shape to make audio and video scratch, would look some cool, has a really excellent bearing and cheap!
So I unmonted a old HD, in the last platter I glued a printed paper, yes, its some nasty to use paper, anyway... with black and white bars generated by a PC app specific to do this... two photo-diodes and two red leds pointed to the platter and 90 degrees out of phase, same as others (i think), the photo diodes are connected to a LM358 (OpAmp) inputs also a potentiometer to adjust the sensivity... the LM358 outputs are connected to 8051... Aparently no problem here, the encoder works! The problem is, many time when platter stop spinning, the uC send many "undesired" encoder data, like it was moving very fast to some direction, then gets normal, as it is, STOPED! I know and searched in this forum, to not use the A=clock B=direction, when I was coding I was thinking "i'm not doing that" but now I think i'm doing, and dont know other way to do this, how can I solve this? I can send schematics of photos if needed... the code i'm using is the following, its just a piece of it, JOG is a Dbit. Thanks! READJog: JNB JOG,JOGZer ;JOG=1 MOV C,P3.6 MOV JOG,C JMP JOGNC JOGZer: ;JOG=0 JNB P3.6,JOGNC ;JOG changed MOV C,P3.6 MOV JOG,C JNB P3.7,Fore Back: ;<<<<<<Back routine here JMP JOGNC Fore: ;<<<<<<Forward routine here JOGNC: ;JOG not changed, continue JMP READJog |
Topic | Author | Date |
Help interfacing a home made rotary encoder | 01/01/70 00:00 | |
use wheele mouse parts | 01/01/70 00:00 | |
use a timer interrupt... | 01/01/70 00:00 | |
Add hysteresis | 01/01/70 00:00 | |
comparitor | 01/01/70 00:00 | |
Why I'm not a novelist | 01/01/70 00:00 | |
Noob! | 01/01/70 00:00 | |
Start like this | 01/01/70 00:00 | |
I think I can barely understand... | 01/01/70 00:00 | |
PCB | 01/01/70 00:00 | |
Results | 01/01/70 00:00 | |
ABOUT THE ROTARY INCODER | 01/01/70 00:00 | |
Stop shouting, will you? | 01/01/70 00:00 | |
Software comment | 01/01/70 00:00 | |
I Agree | 01/01/70 00:00 | |
Thanks | 01/01/70 00:00 | |
Yes, it does | 01/01/70 00:00 | |
incorrect | 01/01/70 00:00 | |
Incorrect | 01/01/70 00:00 | |
Clarifying | 01/01/70 00:00 | |
Time between polls | 01/01/70 00:00 | |
here we go again | 01/01/70 00:00 | |
Mmmh... | 01/01/70 00:00 | |
I give up | 01/01/70 00:00 | |
Previosly commented | 01/01/70 00:00 | |
and contradicted | 01/01/70 00:00 | |
Picture![]() | 01/01/70 00:00 |