Sinewaves using interrupts.


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Sinewaves using interrupts.

    Ok, old thread of mine & hands up...short of dabbling with scalerobotics cool sinewave generation program I never actually progressed much further - but I keep coming back to this DDS issue....I reckon I can do so much cool stuff once I've mastered the art of generating sine waves under my control

    Now I'm never the brightest button in the sewing box, but I do have dogged determination (rough translation "a pest")...I'll often kludge my way through without necessary understanding every part of the process - So with this in mind, I hope to start soon again on this pesky DDS melarky.

    So some questions.....

    all this talk of a 24 bit accumulator - how do I achieve that on a 12LF1822 with PICbasic?!!!

    Would up to 4.8Khz be do-able in HPWM for the DAC aspect?

    Can I really expect to get granular with setting the frequency without recourse to floating point? (I want to be able to set the frequency via another PIC by fiielding an Eusart interrupt to the DDS PIC)

    There are those on the net, that have done this with other processors. The Atmel AT90S2313 seems to figure large due to the lower number of clock cycles it takes per instruction. This chap has posted a great webpage...


    http://www.myplace.nu/avr/minidds/index.htm

    Including code....

    http://www.myplace.nu/avr/minidds/minidds.asm

    for those that have a clue (rules me out), how much of an ordeal would it be to move that over to a PIC?

    Is this a project where I really ought to start learning assembly?
    Last edited by HankMcSpank; - 15th July 2011 at 23:03.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Sinewaves using interrupts.

    Hi Hank,

    Note that the avr project needs at least 8 I/O pins to drive the resistor ladder(DAC). So with a PIC12f series you are stuck using PWM, serial DAC or a dedicated DDS chip.

    I tried a spi DAC, too slow. Couldn't get over 600hz. It wouldn't be too hard to do the avr dds with a pic. Use a look up table and a loop and write each value to an 8bit port. Not sure how the speed would compare with an AVR?

    This is the best, but it is expensive
    http://www.sparkfun.com/products/9169

    I wrote some code for this in PBP if you are interested.

    cheers

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Sinewaves using interrupts.

    Hi Mark,

    Agreed about the 12lf1822's 6 Inputs & 5 outputs being insufficient for a resistor ladder ...I therefore have three options...

    1. Use HPWM
    2. Use the 12lf1822's internal 5 bit DAC (which while woeful, is handy from a low parts count & convenience/learning perspective)
    3. Go with a larger 14 pin sibling (eg 16lf1824) & use a reistor ladder.

    As much as I'd really like to just use the dedicated DDS chips, but they're way overkill for my modest needs, too expensive & also I'd like to lean how to roll my own so to speak.

    Just sounding the ground again here.
    Last edited by HankMcSpank; - 16th July 2011 at 01:34.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts