DAC Function generator

Discussion in 'The Projects Forum' started by hashmaster, Mar 31, 2013.

  1. hashmaster

    Thread Starter Member

    May 30, 2012
    42
    0
    So I have been thinking recently could I take a DAC and make a function generator. I think it might be possible. And I have a slightly renewed interest in it as a project as I've started my microprocessor and microcontroller course. So I plan on making this as cheap and efficient as possible. I'm going to try an get samples for everything needed. My base for this if all goes well I will try and make it into a kit to sell to other students and hobbyists. So what I have so far is μcontroller, probably in the 8051 family since that's what my course is covering heavily, a DAC, a powered amp to boost voltage, a digital selection panel, and a power supply. I'm going to have to come back to this post later. Need to go to the park with the wife for easter. All thoughts questions comments concerns input are greatly appreciated. Thanks.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    Yes, very doable and I have done this before. This is useful for creating an arbitrary waveform generator.

    Before you get started you need to lay down some specifications:

    1) Maximum frequency
    2) Resolution, number of bits
    3) Voltage and power output

    For example, if you wish to generate a low distortion sine wave, you need the maximum number of bits with the maximum clock frequency. Sometimes these two parameters are in competition and one has to settle for a compromise. You may want to aim for something like a 12-bit DAC with less than 1μs or better settling time.

    The next thing you want to look at is the specifications of the microcontroller. Obviously you will need one with a fast clock and sufficient memory. If you are interfacing to a 12-bit DAC you will want an mcu with a 16-bit bus. An 8-bit mcu like an 8051 is going to limit your maximum capabilities.

    Finally, look at your output requirements. For extra power output, I have use an LM675 power amplifier to drive the output.
     
    hashmaster likes this.
  3. hashmaster

    Thread Starter Member

    May 30, 2012
    42
    0
    Well as far as output frequency I was thinking of upwards 50MHz for a sine wave, I do t know how well that would work for op amps to convert in to other waves tho. For voltage out I don't think I would need anything above about 20vpp , but would like just a little more voltage available just because. I see hour point on the 8051, but when I was looking up 8051's on one of the chips manufactures sites it returned some 8051's and some other MCU that were 16 and 32 bit and supposedly in the "8051" family. I don't know much about them yet. Resolution uh I don't know. Gonna have to brush back up again. I'm still in the creating a specifications list and block diagrams phase. I have to figure what I really want ideally, and what is realistic, and make a compromise. When I get back home I'll dig thru my books to see if I can start calculating some things out.
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    You're already pushing the limits, if not way beyond, asking for 50MHz sine wave and 20V p-p.
    50kHz and 15V p-p is more doable.
     
  5. hashmaster

    Thread Starter Member

    May 30, 2012
    42
    0
    Yeah I was thinking those number might be very high. I tend to do that in a lot of projects. Case in point I installed a shelf for my mother in law for 3 pictures and a couple little trinkets, it can support close to 500 lbs. I originally had it spec'd for 1200 lbs tho. I plan on trying to calculate out what such a system would require then find the parts that come closest , and redesign from there.
     
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    There's a lot of cheap ($29.95) ready made ones on ebay already, you should look at those before you do a lot of work designing a kit to sell;

    [​IMG]
    http://www.ebay.com/itm/NEW-AD9851-...50MHz-DDS-Source-SCM-DDS-Module-/220950183163

    From the look of them most of the ebay ones use the popular DDS IC that does all the waveform generation for you, and just needs a PIC or AVR to send a serial command to it to set the frequency.
     
    absf and JohnInTX like this.
  7. hashmaster

    Thread Starter Member

    May 30, 2012
    42
    0
    I've seen some of the ones on eBay and such back when I was looking for cheap lab equipment. If they are like some of the other ones I've read reviews on they weren't worth it. I've tried about everywhere for cheap equipment, kits and such and most turn up with bad reviews. Also I don't have a problem with the cheap premade Chinese kits, but there's so much more educational value, personal accomplishment, etc. And as far as the "kit" creation goes it would be something I would consider if I can drum enough attention, the other reason is I've noticed when asking for free samples the company will ask what you want to do with it. So I'm going to try and acquire most parts as samples. If I could get everything g as a sample my fg would be virtually free, and of a great quality. And if something goes wrong with it it should be a lot easier to fix, or just build a new one.
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    I think it's very educational building something yourself. Plus it's a lot more fun.
     
  9. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    Hola hashmaster,

    Yes, the first thing you need to have clear in your mind: the clock ticking in the MCU is goging to be a really fast one of much higher frequency than at the output.

    Obvious, I know, but better to stress here.
     
    Last edited: Apr 1, 2013
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    hashmaster and JohnInTX like this.
  11. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    The pre-made Chinese ones are fine, they use the industry standard DDS IC, which is exactly as good as if you made a kit with that same DDS IC.

    Have things changed? In post #1 you said "My base for this if all goes well I will try and make it into a kit to sell to other students and hobbyists. "

    From someone who has made kits and know how much work it is and how ridiculously small amount of money you will make, take my advice. NEVER make a kit for sale if there are already $25-$30 fully built Chinese ones from multiple suppliers all over ebay! :eek:

    You have said you want to make the prototype for free by getting free parts samples, and again that may be fine for building your own project for experience (which is a great thing to do) but please think carefully before committing to making kits as it sounds like you do not have much money or experience. :)

    For as low as $12-$16 you can buy a DDS IC module ready made, with all the tricky SMD soldering done, and you just connect your 8051 microcontroller to it to make a full function generator;

    [​IMG]

    That will still give you a lot of good "build your own" experience, but you will have a high chance of getting a reliable frequency out considering the special construction and PCB layout needed for a 0-70MHz freq range.
     
    absf likes this.
  12. hashmaster

    Thread Starter Member

    May 30, 2012
    42
    0
    I appreciate everyones help and input so far. Been a bit busy with school and wedding planning. Hopefully I can get a little more research and planning done this weekend.


    I can see your point on that one. I wasn't thinking it was gonna be a great money maker, just a kinda pay for it self type thing. Probably will stay out of the kit making buiseness. I might just try doing a greatly detailed paper.

    Ill have to look into one.

    Uh No the basic reasoning for this is most of the companies ask why you want free samples, and how many units you plan to make. I can understand why they are doing this but when you dont really have a production plan because your not a business, just a student, you need to give them something.
     
Loading...