Shop OBEX P1 Docs P2 Docs Learn Events
24LC256 EEPROM Schematics — Parallax Forums

24LC256 EEPROM Schematics

jeanjean Posts: 21
edited 2006-07-21 00:01 in BASIC Stamp
Hi,
Searching through the forum I noticed that there are different ways of connecting the 24LC256 EEPROM to the Basic Stamp
I would like to know which way is the most common if I wanna connect it to my BS2p40?
Right now I'm having problems with this sample code and this schematics without the PCF8583

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-20 19:44
    You need the 4.7K pullup resistors on P0 and P1 for the 24LC256. They're needed for the I2C bus regardless of what devices you have on the bus.
    I don't see any reason why you need the PCF8583.
  • jeanjean Posts: 21
    edited 2006-07-20 19:53
    thank you
    I'm actually using the 4.7k resistors, I'm not using the PCF8583. I just had to use this schematics to make my connections
    My question was about the A0 A1 and A2 pins. Do I make them high or low. I read that they are used for addressing but since I'm using only one EEPROM connected to my BS2p40 does the schematics work with my code?
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-20 20:10
    Most EEPROMs are designed so that, if you leave the address (An) pins unconnected, they will assume a low value. To be sure, you can ground them. Your code assumes a device address (DevAddr) of %001 which would require you to wire A0 high and A1/A2 low. When you combine different types of devices (like an EEPROM and a PCF8583), you can use the same device address because the device type (DevType) is different. Only if you have more than one of the same type of device do you need different addresses.

    I suggest changin your DevAddr to %000 and wiring your An pins to ground.
  • jeanjean Posts: 21
    edited 2006-07-20 21:16
    Ok, this is what I already have soldered together with the code
    can I still work with this or do I have to desolder everything?
    Or should I make modifications to the code?
    thank you
    2040 x 1583 - 260K
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-20 21:30
    You've got it set up for address %001 in hardware and in your code. I think the problem is that the Stamp requires the SDA to be pin 0 or pin 8 and SCL to be pin 1 or pin 9 only. The I2CIN and I2COUT statements will operate properly only with 0 or 8 as the pin number. If you change your pins on the Stamp, I think it will work. If, for some reason, you can't change the pins, there are examples of I2C communication for the BS2 without using the I2CIN and I2COUT statements. These will work with any pins and will work on the BS2p40.
  • jeanjean Posts: 21
    edited 2006-07-21 00:01
    THANK YOU!
    Yes it says on the help file for I2CIN (SDA 0 or 8)
    Now it works just fine
Sign In or Register to comment.