Need help to get I2CRead woriking


Results 1 to 4 of 4

Threaded View

  1. #2
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    If you read carefully page 48 of the manual, you will find that you should first declare a variable for the values you want to write. Either a byte or word variable. Then you use this variable within the I2CWrite command.

    Most EEPROM have page write and byte write capability. Your should either try to write a full page, or go one byte/word after the other (that's a single 'value' at a time). Anything else will result in 'strange' problems. See your EEPROM datasheet to make sure it support page write first, you will also find the size of the write buffer for your chip. But to stay on the safe side I would suggest you to go one byte or word at a time.


    This: I2CWRITE SDA,SLC,I2CDevice,I2CAddress,[%10101010, %01010101]

    should then be:

    WordVar VAR WORD
    ...
    WordVar = put any value here
    I2CWRITE SDA,SLC,I2CDevice,I2CAddress,[WordVar]

    OR

    ByteVar VAR BYTE
    ...
    ByteVar = put any value here
    I2CWRITE SDA,SLC,I2CDevice,I2CAddress,[ByteVar]



    Also, without the schematic I can only point some area for you to check:

    -Since I2CDevice = $A0 = %10100000, you should make sure the A2,A1 and A0 pins of your EEPROM are at Vss (Ground)

    -Are you using pull-up resistors on SCL and SDA line ?

    -Did you make sure you turned off analog mode for SDA an SCL pins you're using? (if applicable)


    Hope this will help.

    J-P
    Last edited by GrandPa; - 29th November 2007 at 04:50.

Similar Threads

  1. I2CRead and USART interrupt
    By HenrikBuhl in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th January 2007, 13:04
  2. I2cwrite - I2cread
    By savnik in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 5th July 2006, 01:12
  3. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th June 2006, 20:03
  4. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th June 2006, 18:32
  5. PFC8583 Connection and I2Cwrite I2cread!
    By uludere72 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 27th February 2006, 13:32

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