Shop OBEX P1 Docs P2 Docs Learn Events
Problems with eeprom — Parallax Forums

Problems with eeprom

OtmarOtmar Posts: 7
edited 2008-12-08 07:09 in Propeller 1
Hello all,

i have a problem with the NS_eeprom_drv.010 located on the Hydra CD.
The driver does not work correctly then i write more than 2^15 bytes (32768 bytes) to the eeprom.
I dont know if the read or the write function is not working.
Is their maybe a newer version of the driver?

I am using the Hydra-Board with the AT24C1024 eeprom.

Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-05 15:18
    You didn't give any details about what you were trying to do, but I assume you're trying to write a single block of data to EEPROM with one write operation. You can't really write more than 256 bytes at a time to an AT24C1024 EEPROM. The number of bytes varies from manufacturer to manufacturer and from EEPROM model to EEPROM model and is called the "page size". When you write to an EEPROM, the data goes into a page buffer. The buffer pointer wraps around at the next page boundary and overstores what has already been written into the buffer. At the end of the data transfer, the actual write is initiated. If you want to write more than a page of data, you have to split up the write operation respecting page boundaries if the write doesn't start on a boundary. None of the existing EEPROM drivers will manage this for you.
  • OtmarOtmar Posts: 7
    edited 2008-12-05 16:13
    I have two programms each stores different graphic data into the eeprom. With my main programm i load the data from the eeprom on the fly to the RAM of the propeller.
    The first programm stores 26720 bytes of data to the eeprom(start_adress=$1FFFF-26720 only one write cycle) -> everything works fine
    The second programm should store 9212 bytes (start_adress=$1FFFF-35932) -> only the data below $1FFFF-32768 is written

    Maybe the problem is that i am trying to write over a 32k bounce in one write cycle?

    Andr
  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-05 16:28
    I don't know why your first program works. It should fail. I'm not surprised that your second program fails (for the reasons I gave).
  • OtmarOtmar Posts: 7
    edited 2008-12-06 08:23
    So, i read the datasheet of the AT24C1024 to understand the mechanism of the eeprom.
    It looks like that the serial I2C eeproms from atmel support "page write mode" and "byte write mode".

    From the Datasheet:

    *BYTE WRITE: To select a data word in the 1024K memory requires a 17-bit word address. The
    word address field consists of the P0 bit of the device address, then the most significant word
    address followed by the least significant word address (see Figure 7-2 on page 11)

    A write operation requires the P0 bit and two 8-bit data word addresses following the device
    address word and acknowledgment. Upon receipt of this address, the EEPROM will again
    respond with a zero and then clock in the first 8-bit data word. Following receipt of the 8-bit data
    word, the EEPROM will output a zero. The addressing device, such as a microcontroller, then
    must terminate the write sequence with a stop condition. At this time the EEPROM enters an
    internally timed write cycle, TWR, to the nonvolatile memory. All inputs are disabled during this
    write cycle and the EEPROM will not respond until the write is complete (see Figure 7-2 on page
    11).

    This is why the first programm works-> the driver uses the "byte write mode"
  • OtmarOtmar Posts: 7
    edited 2008-12-08 07:09
    Problem is solved!

    In version 1.0 of the eeprom driver is a bug.
    One constant is wrong : addr_msb_mask long 1<<17 should be addr_msb_mask long 1<<16 then everything works fine.

    In version 1.1 the bug is solved. I found the version 1.1 in the package of the "HAM tool".

    Thanks for your help
Sign In or Register to comment.