I2c Ds1808


Closed Thread
Results 1 to 3 of 3

Thread: I2c Ds1808

  1. #1
    Join Date
    Feb 2005
    Posts
    67

    Smile I2c Ds1808

    Hi,
    Does the I2CWrite and I2CRead commands take care of the read write bit ?

    The DS1808 is a dual digital potentiometer.

    The command for I2C DS1808 is

    Control Bits 7,6,5,4 = 0101

    Address Bits 3,2,1 (A2, A1, A0)

    Read Write Bit 0, ie 1 = read, 0 = write

    Then the next two write/reads are data;

    Bits 7,6 00 = Pot 0, 01 = Pot 1

    (Courtisy of Melanie)

    Example: Write ...

    I2CAddress=0
    I2CWrite SDA,SCL,I2CDevice,I2CAddress,[DataA]

    PortA.0 con SDA ' Define Port A.0 to be the Data Line
    PortA.1 con SCL ' Define Port A.1 to be the Clock Line
    I2CDevice con $51 ' Device from Data sheet, leaving remaining bits 0's
    DataPot0=%00xxxxxx
    DataPot1=%01xxxxxx

    Will the command I2CWrite take care of the write bit ?
    Pete

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes indeed..... you need only 1 control byte
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2005
    Posts
    67


    Did you find this post helpful? Yes | No

    Smile

    Thanks Mr E
    Pete

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. PIC16F877 I2C programme
    By cooqo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 21st April 2008, 10:02
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

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