Shop OBEX P1 Docs P2 Docs Learn Events
questions concerning BS2 and 24LC16B EEPROM I2C — Parallax Forums

questions concerning BS2 and 24LC16B EEPROM I2C

beatsbeats Posts: 17
edited 2008-11-03 16:09 in BASIC Stamp
I am trying to learn to program onto my newly bought Basic Stamp 2, however I have been hung up with the whole EEPROM issue.
I have gone through WAM, BS Manuel, StampWorks, mostly all of the Nuts and Volts articles, endless threads..... and still I am as confused as a high schooler taking Quantum Physics freaked.gif


Ok, so the BS2 comes already with 24LC16B EEPROM integrated into its board, I see that from the schematics and from looking at the BS2 module. But I have read several articles/manuals/threads that contradict each other in one way or another. For example I went through some Nuts and Volts articles and they show the 24LC16B externally connecting SDA and SCL to the I/O PINs 0 and 1 of the BS2 and declaring them as PINs in their code; now how is this possible if the EEPROM is already integrated into the Basic Stamp 2??

I have also seen schematics and programs that show SDA and SCL declared as constants and connected externally to pins 14/15 or 8/9 of the BS2, although the EEPROM is already integrated inside the BS2.

My main point is the Basic Stamp 2 comes with the 24LC16B EEPROM already wired into its module, why am I seeing everywhere that it should be connected to BS2 I/O pins?
and declared: SDA PIN 0 ????
SCL PIN 1 ????


I hope i'm making sence, its been a long night redface.gif

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2008-11-03 15:32
    I suspect that you're looking at articles on the use of external additional EEPROMs. The EEPROM that is part of a BS2 does not need to be separately connected or declared in any way. But there are plenty of projects that call for additional external EEPROM (datalogging, for the most obvious example) when you don't want to share the memory space of the attached EEPROM.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-03 15:33
    The BS2 does indeed come with a 24LC16B EEPROM that is used to store the PBasic program. It can also be used by the program for data with the READ and WRITE statements and data can be stored in the EEPROM as part of your program with the DATA statement. Read the chapters in the PBasic Manual on these statements for details.

    You can also attach external EEPROMs like the 24LC16B or others to a BS2 using a pair of I/O pins for the SDA and SCL signals and the Nuts and Volts Columns and other information sources describe how to do this and how to program the BS2 to make it work. Reasons for doing this:

    1) When you download a new program to the Stamp, data stored in the built-in EEPROM might be erased. Normally the program is stored in the high end of the memory and data is stored in the low end, but, if the new program is larger than the old program, it might overlap with the area the previous program is using for data.

    2) You can attach much larger EEPROMs to a BS2 than its built-in 2K EEPROM and EEPROMs attached to I/O pins can't be erased just by downloading a new program.
  • beatsbeats Posts: 17
    edited 2008-11-03 15:54
    okay.... i will go over the manuals again. But just to be clear, I do not declare SDA and SCL signals in my code?
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-11-03 16:03
    logical said...
    okay.... i will go over the manuals again. But just to be clear, I do not declare SDA and SCL signals in my code?

    Nope, not unless you're using some external I2C device. I did a lot of BS2 programming before I ever had to mess with SDA and SCL.
  • beatsbeats Posts: 17
    edited 2008-11-03 16:09
    ok, thanks for your help
Sign In or Register to comment.