Varying a Square Wave Frequency via Potentiometer

Has anyone worked with varying a square wave with a range from

25000hz to 30000hz varying 512 steps within that range. So minimum is 25000hz next step is 25010hz, 25020hz all the way up to 30000hz with a pot.

Is it possible?
Thanks :-/

You can wire a 555 timer up as an oscillator such that you can adjust the frequency with a pot. If you size everything right, you should be able to use a digital pot to give you more or less the range you want. Accuracy won't be great, because of the generally poor accuracy of the components, especially the capacitor in the circuit. See http://www.electronics-tutorials.ws/waveforms/555_oscillator.html for a tutorial on how to do this. It will also vary continuously, not by steps.

You can also use an Arduino's analog input to read the pot value and then use the tone() (http://arduino.cc/en/Reference/Tone) function to generate the square wave.

On the Arduino you can read analogue values with 10-bit precision, that's 1024 levels. However, how accurate your potentiometer will be is another question. If you really need precise steps, consider using an rotary encoder switch and to the counting in software.

Korman

Firsties - I needed a couple of frequency ranges: 22000khz - 27000khz and 26000khz-33000khz with good resolution such as 0 -1000.

I had mistaking thought the Arduino could easily do this but no way just 0 - 5 different frequnecies per range using the counter/timers. So I did some Googling and found AD9835 - too expensive and some other device also but just as costly and then I found ltc6903 with no external parts with more resolution than my 0 -1024 input potentiometer could produce, yeah! Datasheet, Chipcatalog - der Katalog für Cannabidiol und seine Komponenten - Chipcatalog

Wanting to get up and running quickly, I searched the web for Arduino and ltc6903. I found some blogging of how neat the ltc6903 was but no pde coding. Since have had great success with the Arduino and the ltc6903 here the link to my code,http://www.eastco-inc.com