Shop OBEX P1 Docs P2 Docs Learn Events
I spend hours looking for how to use eeproms like (24LC256) with SXB — Parallax Forums

I spend hours looking for how to use eeproms like (24LC256) with SXB

Mark HubersMark Hubers Posts: 19
edited 2008-12-11 22:26 in General Discussion
I have spend hours on this forum on how to connect some eeproms to a SX and how to use it in SXB.· I need a way to store data that does not change much at all, but need to be there if power is restored to the SX.· Any help or pointers would be very helpful.··Right now I have a few 24LC256 on hand and hope it can be used with the SX. ·Thank you for your help.

Comments

  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-12-11 21:35
    The attached program will help -- I use this code all the time.
  • Mark HubersMark Hubers Posts: 19
    edited 2008-12-11 21:38
    I put down the wrong IC part number. I have some 24LC32A 4k eeproms.

    Regards,
    Mark
  • BeanBean Posts: 8,129
    edited 2008-12-11 21:55
    Mark,
    The code should be basically the same. Just a reduced address range.

    Make sure you have the pull-up resistors on the SDA and SCL lines. Or enable the SX pull-ups.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
    www.iElectronicDesigns.com

    ·
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-12-11 22:07
    Bean is right: the code is the same -- you just have to limit the address that you attempt to read from or write to. I use 4.7K pull-ups on the SDA and SCL pins. Be sure to download the tech docs for your part (i.e., don't trust my code, verify the interface for yourself with the documentation).
  • Mark HubersMark Hubers Posts: 19
    edited 2008-12-11 22:14
    Jonny and Bean,
    First let me say thanks for your help!

    Bean,
    I am new at building with elec components, but learning fast as I can. When you say put a pull-up on the two lines... Should I use something like a 4.7k? What is this doing, adding power to the lines? I was not going to add them, but thank for letting me know. I am trying to build a way to store IR data and replay them back later time. Somehting like thoses smart remotes they have out there. [noparse]:)[/noparse]

    Mark
  • BeanBean Posts: 8,129
    edited 2008-12-11 22:26
    Mark,
    I2C devices are only able to ground the SDA and SCL pins or let them float (this is because you can have several devices sharing the same two pins). So you need a pullup (yes a 4.7K to the supply will work fine). The internal pullups on the SX are enabled by adding the word "PULLUP" to the end of the PIN definition. The internal SX pullups are about 20K, but it works fine for me.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
    www.iElectronicDesigns.com

    ·
Sign In or Register to comment.