PicBasic Pro code to drive MCP4291 DAC?


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: PicBasic Pro code to drive MCP4291 DAC?

    I don't know what the OP's application is but using a PIC and a serial DAC (MCP4921) to generate sine waves is extremely inefficient. It consumes a tremendous amount of CPU resources and gives very poor performance - limited frequency range and resolution. Using a DDS chip such as the AD8937 (which incidentally costs about the same as then MCP4921) allows you to generate sine (and triangle and square) waveforms from 0-16MHz with 0.06Hz (28-bit) resolution. For low frequency applications (such as VFDs) you can use a lower speed clock - with a 1MHz clock you get 0-1MHz and 0.004Hz resolution. It uses the same SPI interface as the MCP4921 and the slowest 4MHz PIC will still be able to generate up to a 16MHz sine wave.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  2. #2
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: PicBasic Pro code to drive MCP4291 DAC?

    Quote Originally Posted by rmteo View Post
    I don't know what the OP's application is but using a PIC and a serial DAC (MCP4921) to generate sine waves is extremely inefficient. It consumes a tremendous amount of CPU resources and gives very poor performance - limited frequency range and resolution. Using a DDS chip such as the AD8937 (which incidentally costs about the same as then MCP4921) allows you to generate sine (and triangle and square) waveforms from 0-16MHz with 0.06Hz (28-bit) resolution. For low frequency applications (such as VFDs) you can use a lower speed clock - with a 1MHz clock you get 0-1MHz and 0.004Hz resolution. It uses the same SPI interface as the MCP4921 and the slowest 4MHz PIC will still be able to generate up to a 16MHz sine wave.
    rmteo, isn't AD9837?
    Thanks and Regards;
    Gadelhas

  3. #3
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: PicBasic Pro code to drive MCP4291 DAC?

    Yes, it is AD9837. Sorry for the typo.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  4. #4
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: PicBasic Pro code to drive MCP4291 DAC?

    Very interesting chip....
    Thanks and Regards;
    Gadelhas

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: PicBasic Pro code to drive MCP4291 DAC?

    rmteo,
    You are correct an spi dac is not suited for generating sine waves. My goal was to
    learn how to use this dac, which I did. I have used the AD9835 and AD9850 which are lower
    resolution versions of the AD9837, which you mentioned. The 28 bits of resolution is fantastic and
    I may request a sample since Digikey and Mouser don't stock the AD9837 yet.

    Regards

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