Shop OBEX P1 Docs P2 Docs Learn Events
How do you write to the upper pages of the 24LC256 EEprom chip? — Parallax Forums

How do you write to the upper pages of the 24LC256 EEprom chip?

dmacqdmacq Posts: 11
edited 2004-08-04 02:24 in BASIC Stamp
Hi:

I've hit the wall again
I think my basic understanding of the 24LC256 EEprom chip is flawed.

I've had great success using Jon Williams' EEprom writer code -- as long as I stick to the first page of the EEprom.
But writing to subsequent 7 pages has defeated me.

From what I can gather from the data sheets the upper pages are selected by bits in the control byte.
I thought it would be a simple matter of changing which bits were set in the DevAddr constant such as:

DevType CON %1010 << 4 ' device type
DevAddr CON %000 << 1 ' address = %000 -> %

and changing it to

DevAddr CON %001 << 1 ' for page 1
DevAddr CON %010 << 1 ' for page 2

etc.

But that doesn't work at all.
Writing and Reading to the first page works great. But I'm clearly missing something. Is here (yikes) a hardware component?

macq

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-26 17:02
    The A0 - A2 bits don't have anything to do with internal addresses -- they select which device (1 of 8) on your I2C will be accessed.· The 24LC256 requires two addres bytes, sent highbyte first.· The attached program should help you out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • dmacqdmacq Posts: 11
    edited 2004-07-26 18:22
    Actually Jon, I've been using your program and its enormously helpful.

    Let's say vital.

    But what I can't figure out is how to write to addresses higher than 32767
    How do I store data at address 123456? or 215689?
    I was sure it had something to do with those control bytes...

    Post Edited (dmacq) : 7/26/2004 6:33:56 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-26 18:51
    Maybe you're misreading the docs ... the 256 is 256 kBits (not Bytes), so that works out to 32K.

    In fact, I just opened the docs and it says right on page 1: 32K x 8·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • dmacqdmacq Posts: 11
    edited 2004-07-26 19:26
    Uh-oh.
    I've just discovered a parallax application note that suggests I've been misled (for sometime ) by the 24LC256's name.
    It says its merely a 32kb eeprom... in which case I've already max'ed it out.
    Do I really need to buy seven more of these things just to give me my 256k?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-07-26 19:33
    And if anyone else wants to play around with this chip (24LC256), you can get it for $2.05 from an eBay store.

    http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&category=50914&item=3814628072&rd=1&ssPageName=WD1V

    Hope the link works...I don't think Parallax has this particular chip, although they do have the 8k & 16k chips listed.· But good price, and I have purchased form this guy...He's reputable.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777
  • BriefmarkBriefmark Posts: 10
    edited 2004-07-26 19:54
    Randy at Glitchbuster·(http://www.glitchbuster.com/)· sells the 24LC256 for $1.98 each,·and his shipping is only $1.85 for any quantity.·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-07-26 20:10
    Breifmark said...
    Randy at Glitchbuster·(http://www.glitchbuster.com/)· sells the 24LC256 for $1.98 each,·and his shipping is only $1.85 for any quantity.·
    Good deal!· Now can you find me a MAX7219 for under $10.00???· shakehead.gif·· If so, let me know!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-26 21:14
    Yes -- and you'll need to address each separately with its address pins and in your software connections to the device.·
    dmacq said...
    Uh-oh.
    I've just discovered a parallax application note that suggests I've been misled (for sometime ) by the 24LC256's name.
    It says its merely a 32kb eeprom... in which case I've already max'ed it out.
    Do I really need to buy seven more of these things just to give me my 256k?
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • ionion Posts: 101
    edited 2004-08-03 03:00
    Hi Jon,
    as i read the code from your posted program looks to me (newbee) that i can use the i2c memories chip with a standard bs2p.
    I put the question because i just bought some pic16c57c from parallax and i discovered later that my original code for bs2p24 does not works because the chip does not have i2c command.
    How i can convert the old program from bs2p24 to the bs2p. there is any software to do that , or i have to do it line by line manualy.
    Thank you
    Ion George
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-03 16:14
    You're confusing parts. Any of our "p" models (there are three: BS2p24, BS2p40, and BS2pe24) have the I2CIN and I2COUT commands. The BS2, BS2e, or BS2sx do not have these commands and you have to write manual I2C code. This isn't that tough, and I've attached an example for you to work with. The interpreters you bought from us are standard BS2 cores. You can use the attached code with them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • ionion Posts: 101
    edited 2004-08-04 02:24
    Thank you Jon.

    I did a mistake in writing on my previous question. I wanted in fact to mean bs2 but i still have a big cloud in my head between daily work and moolighting the stamps, and my fingers are faster then my taughts.

    I will try your code today.

    Thanks for help

    Ion
Sign In or Register to comment.