1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

sine wave generator help

Discussion in 'Oshonsoft' started by georgetwo, Mar 14, 2011.

  1. georgetwo

    georgetwo Member

    Joined:
    Jul 30, 2009
    Messages:
    197
    Likes:
    8
    Location:
    DELTA state Nigeria
    HI
    I am about building my first pic16f628 based inverter as a school project,
    I was told that using square wave generator for inverters will reduce the efficiency of that inverter. I also notice that square wave inverter does not work well with inductive loads like fans and it generates a huming sound
    Please how can i write an oshonsoft program to generate a sine wave (or close) with pic16f628 or other pics?
    Thanks for your help
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    ONLINE
    Do you want good resolution? If not, use PORTB as an ADC output with 256 levels. Use a timer to shove a lookup table out of the port (you only need 127 values as each quarter cycle will be the same table!

    Cheers Ian
     
  3. georgetwo

    georgetwo Member

    Joined:
    Jul 30, 2009
    Messages:
    197
    Likes:
    8
    Location:
    DELTA state Nigeria
    If I get you right, I will then need a DAC to give me the output. I need two outputs to drive 3 mosfets each, can you give me a dac ic part number?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    ONLINE

    I would use an R2R ladder on PORTB for the sine wave (If your'e making an inverter, the sine wave can be smaller,less resolution, 4 bits ) this will give you 8 levels positive and 8 negative on two outputs. or you can just use an MCP4922 dual output dac. Why three mosfets on each output? The last inverter I made, I drove the coil with only 1.
     
  6. georgetwo

    georgetwo Member

    Joined:
    Jul 30, 2009
    Messages:
    197
    Likes:
    8
    Location:
    DELTA state Nigeria
    Thanks alot, i am going for Mcp4922. Get back to you if there is any problem. thanks
     

Share This Page