Hardware I2C


Closed Thread
Results 1 to 22 of 22

Thread: Hardware I2C

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I cant make much sense of the macros, but i'll just see what happens.

    Still waiting for the EEPROM chip to be delivered, but figured I can make a start on my code anyway.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    Still waiting for the EEPROM chip to be delivered, but figured I can make a start on my code anyway.
    I know I've been able to get a regular ol' 24LC256 working without a problem at 40Mhz.

    Before you start writing code (and failing! ), be sure to do a search here for the '512 types. There's a couple of small issues that seem to trip people up a lot.
    Last edited by skimask; - 12th March 2008 at 16:07.

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I've been reading the posts about it, and getting a pretty good idea of where to look if it doesn't work first time. I've written a test program just to write 32 bytes to the EEPROM and then read it back and check against the original data. Now just gotta wait for the chip to arrive.

    One thing I did notice is that people are saying you have to wait 10mS between writing and reading. Does this also apply to just reading? i.e. If I read 32 bytes with [STR string\32] and then do the same thing again to read the next 32 bytes, will I have to wait 10mS between? I'm sure this info must be in the data sheet, but i looked thru the data but couldnt work it out.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    One thing I did notice is that people are saying you have to wait 10mS between writing and reading. Does this also apply to just reading? i.e. If I read 32 bytes with [STR string\32] and then do the same thing again to read the next 32 bytes, will I have to wait 10mS between? I'm sure this info must be in the data sheet, but i looked thru the data but couldnt work it out.
    Only applies to the write. If you're using PBP 2.50a, also use the DEFINE that shuts off interrupts during writes.
    Use 10mS as a starting point for the 'after write' delay and make sure it all works fine.
    Then start backing off your delay until it fails, then bump it up a notch. You could get really picky and use pauseus for the delay.
    But I'd say poll the eeprom's busy bit itself for maximum performance.
    As far as multiple byte writes, depends on the eeprom. If the eeprom's page size is 32 bytes, then you write 32 bytes, wait 10mS, write 32, wait 10mS...etc...

  5. #5
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I'm glad that this only applies to writes, because in this particular application the PIC wont need to write to the EEPROM at all. I will fill it with data 1st, and the PIC will only need to read the data, not write it. So looks like I dont have to worry about timing. I'll just read the data whenever I need it.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    If you're using PBP 2.50a, also use the DEFINE that shuts off interrupts during writes.
    That only works with Writes to Internal EEPROM.
    Has no effect on I2CWRITE.
    DT

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    That only works with Writes to Internal EEPROM.
    Has no effect on I2CWRITE.
    'der....
    I knew that....

Similar Threads

  1. Hardware I2C
    By Toley00 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 3rd July 2022, 10:53
  2. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  3. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  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