I2CWRITE on a 24LC512


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Perhaps you forget "DEFINE I2C_SLOW 1"
    Ciao

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    oslinux, You don't need the "DEFINE I2C_SLOW 1" statement as the normal speed of this EEPROM is 400Khz.

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Mar 2007
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    No way, it's always writing the 90% (or less) of what it should...

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    oslinux, Try replacing the 4.7k pullups with 2.2k. Also, what are you doing with A0,A1, and A2 hardware address pins?

    Dave Purola,
    N8NTA

  5. #5
    Join Date
    Mar 2007
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    A0, A1, A2 and WP are grounded, same problem with the 2.2K resistors, only some address are writed.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by oslinux View Post
    A0, A1, A2 and WP are grounded, same problem with the 2.2K resistors, only some address are writed.
    Can you get rid of the 24LC512 and try a 24LC256 instead, or at least a smaller eeprom chip?

    Not that it would make a difference...but it might...ya never know.
    Only reason I mention it is because lots of people have used (are using) the '256, don't think I've heard of anybody using a '512 yet. They are a bit on the new-ish side (2-3 years old I'd guess, maybe...maybe not).

    Also, try writing the whole eeprom, start to finish, try all $00's, try all $ff's, try a few things in between. There will probably be some sort of failure pattern in the eeprom readback itself that we might be able to see from a dump from the chip that'll narrow down the problem.

  7. #7
    Join Date
    Mar 2007
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Tried with the 256, and it does the same, i mean it does not write everything, anyway i have to use a 512, and when i will get my sample from microchip i will test the 1025, that's because i need more than 256k :S

    Note that the 64 do the same thing...

    Now i've put the whole thing in PROTEUS ISIS and i'v having the same problem, but i can see the log of the eeprom:


    Code:
    212.727201m [RX_CMD     ]: Command received: 0xA0 (0b10100000). Device=0, Block=0x00, Address=0x0006 RD/WR=Write.
    223.593601m [RX_CMD     ]: Command received: 0xA0 (0b10100000). Device=0, Block=0x00, Address=0x0007 RD/WR=Write.
    234.460001m [RX_CMD     ]: Command received: 0xA0 (0b10100000). Device=0, Block=0x00, Address=0x0008 RD/WR=Write.
    245.326801m [RX_CMD     ]: Command received: 0xA0 (0b10100000). Device=0, Block=0x00, Address=0x0009 RD/WR=Write.
    256.192801m [RX_CMD     ]: Command received: 0xA0 (0b10100000). Device=0, Block=0x00, Address=0x000A RD/WR=Write.
    Until Here it's all good, but...
    Code:
    256.708801m [RX_CMD     ]: Command received: 0xEE (0b11101110). Device=7, Block=0x00, Address=0x0009 RD/WR=Write.
    256.708801m [RX_CMD     ]: Unknown command value (0xEE) received - command is ignored.
    
    266.934401m [RX_CMD     ]: Command received: 0xA0 (0b10100000). Device=0, Block=0x00, Address=0x0009 RD/WR=Write.
    267.134001m [RX_CMD     ]: Command received: 0x0A (0b00001010). Device=5, Block=0x00, Address=0x0026 RD/WR=Write.
    267.134001m [RX_CMD     ]: Unknown command value (0x0A) received - command is ignored.
    
    277.362001m [RX_CMD     ]: Command received: 0xEE (0b11101110). Device=7, Block=0x00, Address=0x0026 RD/WR=Write.
    277.362001m [RX_CMD     ]: Unknown command value (0xEE) received - command is ignored.
    Here it comes, it can't recognize the commands because for example, instead of receive this control byte:
    0b10100000

    it receive this:
    0b00001010
    or this:
    0b11101110

    it's like there's something missing, the eeprom don't receive the whole bytes, maybe the 10MHz OSC is not good?

    Thx...

    Luca

Similar Threads

  1. I2CRead & I2CWrite not working as expected
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 30
    Last Post: - 27th October 2021, 18:36
  2. PIC 18F4550 and MCP23017
    By DaveC3 in forum Code Examples
    Replies: 12
    Last Post: - 4th December 2010, 14:01
  3. Puzzling issue with I2CWRITE to 24LC512
    By aberco in forum General
    Replies: 4
    Last Post: - 22nd August 2008, 17:47
  4. My I2CWRITE - timings and tricks
    By FinchPJ in forum Code Examples
    Replies: 5
    Last Post: - 3rd March 2008, 21:40
  5. I2CWRITE and I2CREAD
    By Tomas in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd April 2004, 02:30

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