|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc. |
|
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Apr 2005
Location: ShenZhen China
|
I want to use the Rotary Encoder to control the cs3310,but I don't known how to use the Rotary Encoder,Could anyone help me?
|
|
|
|
#2 |
|
diyAudio Member
|
You would need to use a microcontroller to decode the rotary control pulses and to write to the CS3310 registers. Have you ever done anything with microcontrollers?
Jan Didden
__________________
It is a capital mistake to theorise before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts - Sherlock Holmes Check out Linear Audio Vol 5! |
|
|
|
#3 |
|
diyAudio Member
Join Date: Apr 2005
Location: ShenZhen China
|
I just know about the 89s51(mcs51)
I want to use to 89s51 to connect Rotary Encoder |
|
|
|
#4 | |
|
diyAudio Member
Join Date: Aug 2002
Location: Sofia
|
Quote:
Use it if you want. Probably an overkill but will certainly do the job. |
|
|
|
|
#5 |
|
diyAudio Member
Join Date: Apr 2005
Location: ShenZhen China
|
but how to write the program???
|
|
|
|
#6 |
|
diyAudio Member
|
You only need two input lines. Here's a bit of documentation from a project I did once:
;--------System design notes------------------------------------- ; ; The encoders output a 2-bit value: ; the A-bit signals rotation, ; the B-bit signals the direction of rotation. ; encoder movement is detected by polling and debouncing in the b-port. ; ;CW channel A ___ ___ ___ [channel A leads channel B] ; ___| |___| |___| ; ; channel B ___ ___ ___ ; |___| |___| |___| ; ; ; ; CCW: channel A ___ ___ ___ [channel A trails channel B] ; ___| |___| |___| ; ; channel B ___ ___ ___ ; __| |___| |___| ; ; A-bit B-bit Direction ; 0>1 0 CW ; 1 CCW ; 1>0 0 CCW ; 1 CW You poll the A-bit (or hang it on an interrupt line) and then check the B-bit for direction of rotation. Ther's probably a ton of other ways to do this, this happened to work for me. Edit: I realize the formatting is screwed up, if needed I can email it to you. Jan Didden
__________________
It is a capital mistake to theorise before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts - Sherlock Holmes Check out Linear Audio Vol 5! |
|
|
|
#7 |
|
diyAudio Member
Join Date: Apr 2005
Location: ShenZhen China
|
I had try to write some,but it has dithering,so it is not steady
Could you send me the program you had write for MCS51 , I want to have a reference. my mail box is cacworld@126.com |
|
|
|
#8 |
|
diyAudio Member
|
You have to debounce the bits. At the moment the switches close/open they bang around some time, depending on the quality of the encoder, but they all do it. So once you detect bit change, you wait a couple of milliseconds (I forgot exactly how many, it's trial and error and depends as I said on the type/brand of encoder), then after the delay you check the bit values and do your processing.
Edit: I think I used 6 msec debounce. Can't take too long, else you miss some pulses if someone turns it real fast... Jan Didden
__________________
It is a capital mistake to theorise before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts - Sherlock Holmes Check out Linear Audio Vol 5! |
|
|
|
#9 |
|
diyAudio Member
Join Date: Apr 2005
Location: ShenZhen China
|
I think I start to understand what you have just say.
I get to try again ! Could you send me your program to me to be referance? Thank you very much !!! |
|
|
|
#10 | |
|
diyAudio Member
|
Quote:
I'm sorry but there is no 'program' to speak of... It depends on the microcontroller you use, in 'meta-speak', you can do (with polling): - see if the A bit is different from last time you looked; - if yes, wait the debounce period; - test the A-bit status (one or zero); - test the B-bit status; -depending on one of the four combinations, go to a routine to do whatever you want to do as action to the encoder movement. I did this in a PIC and it is just a bunch of bittest and goto statements, but embedded in the program so I can't really send it to you. But if you understand the process it should be a no-brainer. Jan Didden
__________________
It is a capital mistake to theorise before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts - Sherlock Holmes Check out Linear Audio Vol 5! |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| nice rotary encoder for audio? | h_a | Parts | 4 | 14th February 2009 10:43 AM |
| Rotary encoder instead of buttons | robmil | Parts | 11 | 16th April 2008 05:30 PM |
| Optical Rotary Encoder Volume Control unit using the Grayhill 62P | DJ Exprice | Everything Else | 17 | 1st January 2008 08:50 PM |
| Rotary Encoder. Need help very much! | vytas | Digital Source | 11 | 23rd November 2005 12:47 PM |
| Digital rotary encoder | rho | Parts | 17 | 3rd December 2003 03:39 PM |
| New To Site? | Need Help? |