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


Closed Thread
Results 1 to 40 of 77

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Do you think it might be possible to add 2 (or more) bits of precision to the DAC?

    Code:
    Interval  #1  #2  #3  #4
         DAC  00  00  00  00  -> 0.00v
         DAC  00  00  00  01  -> 0.04v
         DAC  00  00  01  01  -> 0.08v
         DAC  00  01  01  01  -> 0.12v
    
         DAC  01  01  01  01  -> 0.16v
         DAC  01  01  01  02  -> 0.20v
         DAC  01  01  02  02  -> 0.24v
         DAC  01  02  02  02  -> 0.28v
    
         DAC  02  02  02  02  -> 0.32v
         ........

  2. #2
    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?

    Quote Originally Posted by Mike, K8LH View Post
    Do you think it might be possible to add 2 (or more) bits of precision to the DAC?

    Code:
    Interval  #1  #2  #3  #4
         DAC  00  00  00  00  -> 0.00v
         DAC  00  00  00  01  -> 0.04v
         DAC  00  00  01  01  -> 0.08v
         DAC  00  01  01  01  -> 0.12v
     
         DAC  01  01  01  01  -> 0.16v
         DAC  01  01  01  02  -> 0.20v
         DAC  01  01  02  02  -> 0.24v
         DAC  01  02  02  02  -> 0.28v
     
         DAC  02  02  02  02  -> 0.32v
         ........
    This must have slipped past me - I'm not understanding what you're getting at?

    I was actually wondering myself whether it's possible in practise to squeeze another 2 bits of effective' resolution by switching the fixed voltage reference supply into the DAC resistor divider chain (ie feed 1.024V in for the first 32 voltage level steps, then 2.048, then 4.096V) - it might be a bit spikey (due to the FVR switching voltages), but if not that should mean we can squeeze 7 bits out of the PIC's DAC pin.

  3. #3
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

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

    Use a DDS chip.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  4. #4
    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?

    Quote Originally Posted by rmteo View Post
    Use a DDS chip.
    They're overkill for my needs (I only want an audio waveform at about 5khz frequency max! They typically go up to Mhz...so i'm paying handsomely for a feature I don't need) - I also want intricate 'control' over how to select the final waveform via my own control set (not be forced to follow theirs) ....plus if we all simply used dedicated hw ICs (at $15 a pop!) what would we ever learn?
    Last edited by HankMcSpank; - 26th August 2011 at 15:30.

  5. #5
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

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

    Using the right tool for the job is half the battle won - that is what you learn. Here is a 20KHz Sine Wave generated by using the built-in 12-bit DAC of the MCU which like any peripheral (such as a timer or ADC) uses little to no CPU resources once set up. Without a proper DAC, generating waveforms will consume substantial amounts of CPU resources. However, for any practical application, I would still use a DDS chip.
    Attached Images Attached Images  
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  6. #6
    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?

    Quote Originally Posted by rmteo View Post
    Using the right tool for the job is half the battle won - that is what you learn.
    Agreed, and paying $15 for a DDS IC, that I can (hopefully) get a $1 PIC to fulfill my (modest) needs means I am indeed trying to use the right tool for the job - i wouldn't use a rotavator to dig over my garden when for my tiny bit of soil a spade is just fine (while a rotavator clearly turns soil over, I'd say it wasn't the right tool for the job in that instance)

    Quote Originally Posted by rmteo View Post
    Here is a 20KHz Sine Wave generated by using the built-in 12-bit DAC of the MCU which like any peripheral (such as a timer or ADC) uses little to no CPU resources once set up.
    Again, I don't need to generate 20khz (that's 4 times higher than I need), I don't need 12 bits resolution (that's about 5 or 6 bits more than I need).

    But more importantly, I don't learn a thing if I go & buy a DDS IC (& at the end of the day, isn't that why most of us do this type of stuff?)
    Last edited by HankMcSpank; - 26th August 2011 at 16:08.

  7. #7
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

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

    Well I did use a $1 MCU to generate that sine wave. So by your logic, that would be the right tool for the job.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  8. #8
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

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

    On a side note I see there is a future product with an 8 bit DAC. Im on my phone, so I can't tell if there is even a dataxheet out for it. Pic16f1786 is one of them.

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