OK lets start from the beginning
i needed a bench top square wave generator with an adjustable output and adjustable duty cycle
i obtained an AD9850 jellybean DDS generator dev board complete with 8 stage LC filter ... it outputs a 1.2v p-p DC sine wave .. i need a square wave
so first off we need to convert this in a square wave and there was a few ways to do this but i decided to go with an AD8561 high speed comparator (as of suggestion by someone on here) and using a pot i could adjust the level that it trips off of ... the lowest voltage i can put in here is well below the offset that the AD9850 DDS generator creates ... because a sinewave is used this wont be a perfect linear slide but will work good enough for me and i can use some math in the micro to estimate the duty because the output of the POT is buffered with a gain of 3 in to an ADC pin of the micro (see below) ... the pot that controls the duty will be supplied by a cheap 2.5v LM4128 reference (that i have a ton of) than brought down to a max voltage of 1.25 via a 50k resistor and a 50k pot ... this prevents changes in duty by the flux of the power supply when it reaches that point (that can be dodgy)
that is then outputted in to 2 counters acting as dividers with x/10 making an x/100 divider that can each be shorted threw 2 reed relays (not the model shown but high bandwidth ones i have taken out of a dead pocket scope) diving an x/1 , x/10 or x/100 output that can give me finer control of the HZ steps (1hz at x/1, 0.1hz at x/10 and 0.01hz at x/100) ... the reed relays are controllable by the micro Edit: That is outputted in to 1 counter that is acting as an x/10 divider that can be shorted out using a reed relay (not the model shown but high bandwidth ones i have taken out of a dead pocket scope) and give both finer control and higher stability (thanks to user cosmos)
that is than taken in to a MAX4428 highspeed MOSFET driver ... this operates from 4.5v to 18v in a stable way but i think its safe to bring it down to 3.5v without a problem tho i might need to divide the input voltage by half (will run tests ... i bought 4 of them with expectation to kill a few) this driver provides a buffered and an inverted output at the input voltage supplied at as much as 1.5A (will only run to 1A each and i will probably glue a small heatsink to it for good measure) than as of now that is taken in to 50ohm resistors than right in to BNC connectors threw a short peace of 2A coaxe
For the power i start with a linear external supply that provides 18v at 2A and 7V at 1.2A that is ground isolated ... that is brought in to the box and brought in to an LM7805 and an LM317 ... the LM317 uses a 500R R1 and a 5K pot with a 1K resistor on R2 to give me ~15v max and ~3.5v minimum (that might be upped to give a minimum of 4.5v) ... because the lower the voltage out is the hotter it will get i want to have the option to use the 5V supply on the output so i added a switch to allow me to enable the LM317 and use that or just use the LM7805 with the LM317 disabled ... the voltage is divided with an attenuation factor of 2.2 than put in to an ADC pin of the micro to monitor that ... the output is than switched
this is brought in to a 0.1R resistor and a couple of opamps to give me up to 1A current feedback on the micro so i can monitor the output even the micro can switch off the output if it gets too high
the micro im using DEAD SIMPLE Arduino bootloader in an ATMEGA328 with an LCD and a simple single rotary encoder with a single pushbutton on it ... also an FTDI programming cable is used and will also be used for computer control ... the micro is running off of 5V and a 16mhz clock ... i might add in a MAX232 and a serial port but i dont think thats really necessary ...
The AD9850 dev board was a $8 ebay find ... i was so iffy about the cost of this i made a few checks and mods ... i checked and verified all the components inside ... i had to replace 2 inductors and i also put in a much better input cap and i soldered 0.1uf SMD caps right to the inputs (so C10 and C31 won't be used) ... i also replaced the input pullup resistors but that was rather unnecessary ... i also replaced the 125mhz crystal with another more expensive one that would probably add stability and it has some heat protection to prevent drift (but its no TCO or OCO ... dont need that)
i have tested the DDS module, rotary encoder and the LCD with basic code and that works fine
i made the schematic in eagle so its nice and cluttered but you get the basic idea ...

EDIT: schematic updated (2:36pm 5/15/13)
EDIT: WOOPS ... found that PTC 1 and PTC 2 are swapped ... woops ... the 1.5A should be on the 18v output ... sorry about that
Found another where a trace is overlapped on the micro ... you can figure it out i dont think i need to update the image on here but i am fixing it for the final Tell me what you guys think about it ... i will be building it up when the parts come in just a few days! There probably will be some mistakes ... there will be some spelling mistakes ... you can ask for clarification but im not here to get lectured on proper schematic layouts or my grammar ... thank you!EDIT2 : User: cosmos pointed out to me that the datasheet says it has a "resolution of 0.0291 Hz for a 125 MHz reference clock" ... i have NO IDEA where i got 1hz ... i WILL be removing one of the dividers i have removed one of the dividers but i will keep one for some stability and even finer control purposes ... thanks allot!