Shop OBEX P1 Docs P2 Docs Learn Events
NS_eeprom_drv_011 and 24FC1025 — Parallax Forums

NS_eeprom_drv_011 and 24FC1025

nicolad76nicolad76 Posts: 164
edited 2008-04-27 15:22 in Propeller 1
Hi,
I have found above driver (designed for AT24C1024) and I adapted it for 24FC1025. It seems working fine..only thing I did was to proprly change the device_address·to properly address my chip.
I have run the below test
imgtc is defined as byte imgt[noparse][[/noparse]512]

· 'start eeprom driver
· eeprom.start(8, 9, 0)
· debug.start(31,30)
·
· ' put some data in array
· repeat c from 0 to 511
·· imgt[noparse][[/noparse]c]:=c // 255

· 'write·to EEPROM
· eeprom.write(@imgt, $00, 512)
· repeat until eeprom.IsDone

· 'clean up array
· repeat c from 0 to 511
·· imgt[noparse][[/noparse]c]:=$00

· 'read back array
· eeprom.read(@imgt, $00, 512)
· repeat until eeprom.IsDone

· repeat c from 0 to 511
·· debug.bin(imgt[noparse][[/noparse]c],8)


well...the output shows like this one
·[noparse][[/noparse]10000001]
·[noparse][[/noparse]10000010]
·[noparse][[/noparse]10000011]
·[noparse][[/noparse]10000100]
·[noparse][[/noparse]10000101]
·[noparse][[/noparse]10000110]
·[noparse][[/noparse]10000111]
·[noparse][[/noparse]10001000]
·[noparse][[/noparse]10001001]
·[noparse][[/noparse]10001010]
·[noparse][[/noparse]10001011]

it seems taking the first bit as sign??? which means it takes 7 bit data...
am I doing anything wrong here or I should work on the driver?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-27 14:52
    The 24FC1025 has a 128 byte page buffer while the AT24C1024 has a 256 byte page buffer and the original NS_eeprom_drv_010 driver is written for a 256 page buffer. As you write the 2nd page of 128 bytes, you'll overwrite the 1st 128 bytes which is what gets written to the EEPROM. Try writing only 128 bytes at a time and pausing 5ms after each write.
  • nicolad76nicolad76 Posts: 164
    edited 2008-04-27 15:22
    Hi Mike...of course you were right smilewinkgrin.gif

    I have replaced

    ··················· test··· param_eeprom_address,#$FF· wz··········· 'test if crossing a 256-byte page boundary··

    with

    ··················· test··· param_eeprom_address,#$7F· wz··········· 'test if crossing a 128-byte page boundary··



    and I was able to write 3168 bytes in a single call.

    It seems the driver takes care of splitting the array to fit the right size of page and perform multiple calls to write them all....well at the end it worked!!

    Thanks Mike
Sign In or Register to comment.