DDS (generating sine waves) with onboard DAC using latest PIC 16F chips?


Results 1 to 40 of 77

Threaded View

  1. #16
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: DDS (generating sine waves) with onboard DAC using latest PIC 16F chips?

    Hi Bert,

    Quote Originally Posted by cncmachineguy View Post
    Seems like you should be able to do it with any basic device
    Agreed...even though I'm using a 16f1828 to practise with, my favourite low chip end of the moment is an 8 pin 12f1822. So a simple DDS program + servicing an odd interrupt (for frequency change)...should be a walk in the park. I also think even a low end 12f chip is going to be much more capable of outputting more than 5Khz...but I mentioned that frequency, only because it's all I need.

    Quote Originally Posted by cncmachineguy View Post
    1Hz-5KHz sine wave
    fixed amplitude
    A way to get its attention to change the freq.

    Do I have this correct?
    Correct, I would add, granularity to 0.01Hz or better (this is perhaps the most important requirement for me). That's where the larger accumulator is needed
    (see my other post - http://www.picbasic.co.uk/forum/show...887#post106887 )

    Without want to teach granny to suck eggs, the output frequency granularity is established from this formula...

    interrupt frequency/ accumulator

    So for an interrupt rate of say 20khz & a 16 bit accumulator, it'd be

    20,000/65536 = 0.30Hz granularity which is insufficient for my needs, which means either making the accumulator larger, or the sample rate smaller....I don't want to do the latter, hence wanting to make the accumulator larger, but I then start hitting my knowledge boundary dealing in 17 bit+ numbers witin the confines of picbasic.

    Also, there's likely to be a fair degree of floating point...which I'll have to work around. For example to set the required freqency, it's

    (required frequency/sinterrupt rate)*accumulator , so for 1500Hz

    (1500Hz/20,000) * 65536 ........clearly the first part of that equation is going to result in a decimal, so quite a few things impeding me at the moment!

    re no passive devices ...well, ideally no reactive passive devices (on account they alter the amplitude as the frequency changes)....using an R2R ladder would be cool, except the take up a lot of space & that's something I always try to avoid (I can't seem to locate anyone that sells prefabbed R2R ladders here in the UK)
    Last edited by HankMcSpank; - 26th August 2011 at 20:55.

Members who have read this thread : 1

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