max 128 + pic 16f877


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Location
    France
    Posts
    2

    Default max 128 + pic 16f877

    hello
    i want to use a max 128 (a i2c adc converter)with a pic 16f877 but i have a problem:
    the adress is a byte(8 bit) and the result is a world(16 bit)
    i don't know how i can do this
    have you an idea for me ???

    i link you the max 128 datasheet
    http://www.datasheetcatalog.org/data...127-MAX128.pdf
    look page 10_13

    excuse my english but i'm french

  2. #2
    Join Date
    Mar 2009
    Location
    France
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    hello it's me again

    may be i can use a byte adress and two byte value for the result, like this

    Code:
     
    DPIN    var     PORTA.0    ' I2C data pin
    CPIN    var     PORTA.1    ' I2C clock pin
    adres   var     byte       ' I2C adress
    ctrol   var     byte       ' I2C control
    B0      var     word
    B1      var     byte
    B2      var     byte
    
    
           I2CREAD DPIN,CPIN,ctrol,adres,[B1,B2]        ' Read 2 locations in a row
             B0.highbyte = B1	' Move HIGH byte of result to B0
             B0.lowbyte  = B2	' Move LOW byte of result to B0

Similar Threads

  1. how can I make 1 wire between two pic 16f877
    By povulon in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th July 2008, 15:44
  2. SPI Communication between two pic 16f877
    By anti83 in forum Serial
    Replies: 1
    Last Post: - 5th July 2008, 22:06
  3. PIC 16F877 I2C communications
    By sigmoideng in forum General
    Replies: 7
    Last Post: - 13th July 2007, 11:28
  4. serial communication between CMUcam and PIC 16F877
    By gengkeys in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th March 2007, 07:43
  5. Use the PIC 16f877 or 877A instead of shift registers.
    By tsanders in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2006, 18:23

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