I2C code to write the DAC MCP4725


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: I2C code to write the DAC MCP4725

    Yes. It is working in the Fast Mode.

    valuedac= 4095

    I2CWRITE sda,scl,%11000010,[valuedac.highbyte,valuedac.lowbyte]


    The above control byte in binary is from data sheet 1100 = device code
    0010 is the board with address code set to A0 = 1 . Most default boards are factory 0000. I have tied the user A0 bit to VCC in the board.
    Control and Address are in the same first byte.

    Data sheet says that second and third bytes may be repeated (valuedac may be repeated ) like
    I2CWRITE sda,scl,%11000010,[valuedac.highbyte,valuedac.lowbyte,valuedac.highby te,valuedac.lowbyte]
    This also works but seems be not necessary.

    I will try next days to write a code for other modes.

    Data Sheet link: https://ww1.microchip.com/downloads/...doc/22039d.pdf
    Last edited by acjacques; - 14th November 2023 at 01:22.

Similar Threads

  1. PicBasic Pro code to drive MCP4291 DAC?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th July 2015, 03:28
  2. I2C Read and Write
    By DerekMacom in forum mel PIC BASIC
    Replies: 14
    Last Post: - 21st April 2008, 15:44
  3. I2C write - value too big
    By ruijc in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 6th April 2008, 13:20
  4. i2c with a dac
    By fabritio in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 29th March 2006, 17:13
  5. I2C write
    By TonyCNC in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd January 2006, 10:40

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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