Creating an oscillator with a microcontroller?
I'm new to these forums, but here goes:
I had the ability to use a Basic Stamp microcontroller (breifly) at a recent camp I went to, and so when starting a recent project my thoughts turned towards it.
Would I be able to use any of the microcontrollers to create an oscillator that can change frequency rapidly based on input by the user? So, say, go from 2Hz and to 4Hz (its a very low frequency oscillator) fast enough to where the transition would be inaudible? (I probably should mention it will be used in an audio device)
I'm not yet sure on what sort of frequency or amplitude ranges I will need, but if this is possible what are the limits of the controller?
I had the ability to use a Basic Stamp microcontroller (breifly) at a recent camp I went to, and so when starting a recent project my thoughts turned towards it.
Would I be able to use any of the microcontrollers to create an oscillator that can change frequency rapidly based on input by the user? So, say, go from 2Hz and to 4Hz (its a very low frequency oscillator) fast enough to where the transition would be inaudible? (I probably should mention it will be used in an audio device)
I'm not yet sure on what sort of frequency or amplitude ranges I will need, but if this is possible what are the limits of the controller?
Comments
Is that what you meant? What do you need this for?
I would probably do tbis with a technique known as Direct Digital Synthisis (DDS) which is a simple loop writing samples from a table of sine wave values out to 8 or so pins. On the pins is a simple resistor network that creates the anog values required. Search these forums and the net for DDS to see how to do it.
But then the Propeller can output audio frequencies with far less pins search around the Prop forum for DAC.
120 Beats/minute x (1 note/beat) x (1 minute/60 seconds) = 2 notes per second, so a 2Hz frequency.
I think the range I will need is 0.2Hz-27Hz (From around whole notes at 50bpm to 32nds at 200bpm), but thats a best case scenario. The transition needs to be fast enough to be musically sound; what is the fastest transition between extreme ranges?
The Microcontroller will be controlled by a digital "pot" to select the bpm, and footswitches to select the note duration. Right now I think that i will need a total of 8 footswitches; 6 to select between whole to thirty-second notes, one to select a "triplet" option, and one to "dot" the note (extend its duration by half). The outputs will be the 8 bits for the oscillator, and however many will be needed to control a 3 digit readout, and then a way to light an LED next to the footswitch that is "on." I'm thinking I need to create a graphic at this point haha, I'll try to draw one up. The rest of the circuit will be analog, the microcontroller is just going to be the oscillator.
A friend of a friend mentioned using the DAC resistor ladder, that seems like an excellent idea, thank you!
All-in-all, a Propeller would be a better option?
As for now, it seems the Propeller is my controller of choice, and I just need to do some more research in the meantime. Thanks so much for the help!
Look at some of the "sticky threads" at the top of the thread list for the Propeller Forum. There are all sorts of beginner's links.
Just want to mention you all have been infintitely more helpful than the people on the other forum I've been using for this project; they've been a nightmare, this has been almost too easy haha. So thanks again!
Once I get this thing up and going I will make a project thread in the appropriate forum.