Analogin, Comp, or AD Convertor
![rolleyes.gif](http://forums.parallax.com/images/smilies/rolleyes.gif)
·· Should I use the SX comparator or an AD convertor maybe even an encoder?
I am going to scale down the freqout max to lets say from 500hz to
5000 Khz. I was wondering what would be the best way to go on this.
I need it to be pretty accurate and I want to be able to dail any number with in the specified range. Thanks
Comments
If you can use it just a pair of "UP" "DOWN" buttons would be the easiest to interface.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
Thanks
Push button - Moves 1 Hz
If button is held for 0.5 seconds, then start moving 1Hz every 0.1 seconds
If button is held for 2 seconds, then start moving 10Hz every 0.1 seconds
If button is held for 4 seconds, then start moving 100Hz every 0.1 seconds
A coarse and fine encoder would probably make it easier for the user to select a frequency. But encoder are not cheap.
A quick search on Digikey turned up part # P10860-ND,·24 pulses per revolution and only $1.52 !
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
I am not too concerned about the encoders for $1.52. I will use two as long as the unit is easy to operate and dial in the desired freqout is what I am after. I am going to overnight the encoders and test them.
Bean it looks like the encoder has a max of 24 pulses per 360 degrees. So if my range is from 500hz to 20Khz I have to divide the 360 by 20 which equals 15. SO every 15 degrees or every 1.5 pulses is equal to 1khz. Then my other encoder I can scale to make it easy to dail in increments of 1hz at a time. . I guess now I have to find info on how to scale an encoder. I remember scaling the POT on the BS2 but the SX is a lot diff. Thanks for all your help now I will hunt down the information so I can finish my project..
I just checked my spare parts and I two of these from digikey ECW1JB24BC0024-ND . They are only $3.46 each and they are nice. I would assume they would work just about the same way as the other ones I mentioned before.
I have some code to read they encoders that I wrote for a client, but it uses a periodic interrupt which you cannot use since you are using the interrupt to generate the frequency. But they aren't too hard to read, I think Jon Williams has some code posted that does it. Try a search.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
The second encoder can be used to adjust the frequency in steps of 1Hz yielding 100 intervals between values reachable by the first encoder. (100 intervals) / (24 intervals/revolution) = 4.167 revolutions. So you would need to rotate the second encoder four and a sixth revolutions to cover your fine frequency range.
This might be more straightforward to program if you do not mind using two encoders.
- Sparks