Shop OBEX P1 Docs P2 Docs Learn Events
Eeprom — Parallax Forums

Eeprom

goldfingerfifgoldfingerfif Posts: 18
edited 2006-07-19 20:10 in BASIC Stamp
I was wondering if someone had links or pictures or whatever to help me insterface a BASIC stamp to say a 1,4, or 64k eeprom, read in some data, say 8 bits to a serial in, parallel out shift register and blink 8 leds according to the 8 bits. Any help on this would be much appreciated.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-18 14:26
    Hello,

    ·· Being such a specific task it is unlikely there will be code to do exactly what you're trying to do.· However, there are examples of each thing independantly being demonstrated.· For example, here is a link to our 16K EEPROM which has sample code for using it (Read/Write).· You can also find plenty of examples of the 74HC595 Serial to Parallel Shift Register, especially for outputting data.· See the second link as an example.

    http://www.parallax.com/detail.asp?product_id=602-00013

    http://forums.parallax.com/showthread.php?p=552892

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • achilles03achilles03 Posts: 247
    edited 2006-07-18 15:24
    There's a lot of EEPROM's out there that can interface the BS2, like the one parallax stocks:

    http://www.parallax.com/detail.asp?product_id=602-00008

    As far as the LEDs, you don't need the serial to parallel converter if you have 8 free pins. You could just read in the byte from the eeprom, then set the outputs of those pins to the corrosponding bits of the byte (bit0=pin0, bit1=pin1...bit7=pin7). Make sure you don't source more than 5mA to each LED though... I'd put a 1k resistor in series between the LEDs and ground (you only need 1 resistor for all 8 LEDs this way). If all 8 are on, that limits your sourcing to 40mA.

    Alternatively, you could flip things and sink the current.

    Dave
  • goldfingerfifgoldfingerfif Posts: 18
    edited 2006-07-18 19:39
    Thanks but the one eeprom is discontinued and the other that Chris Savage recommended 16K-byte EEPROM (BASIC Stamp 2SX and BASIC Stamp 2P-DIP) says it is for the 2sx and 2p but not just the bs2. Will it work with the regular plain ol' bs2? I dunno if it makes certain basic commands that would not be recognized by the bs2 to communicate to the chip.
  • BamseBamse Posts: 561
    edited 2006-07-18 20:06
    There is also 24LC32A...

    http://www.parallax.com/detail.asp?product_id=604-00020

    See the attached code taken from the Stamp Works manual...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Living on the planet Earth might be expensive but it includes a free trip around the sun every year...

    Experience level:
    [noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
    [noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
    [noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
    [noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
    [noparse][[/noparse] ] I dream in SX28 assembler...

    /Bamse
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-18 20:08
    goldfinger -

    Here's the "trick" to that seeming incompatibility. ANY PBASIC Stamp can use any EEPROM which uses SPI or Microwire access protocals, as you can use SHIFTIN/SHIFTOUT to implement the access to them. Any EEPROMs which use the I2C protocal can most easily be accessed by the BS-2p? series, as they support the I2CIN/I2COUT commands.

    Now, this is NOT to say that BS-2 Stamps can NOT access I2C devices. It just means that it takes slightly more advanced techniques which I woudn't recommend for someone just starting out. Get your EEPROM feet wet with SPI/Microwire EEPROMs and graduate to I2C later on if you choose to. If money is a problem, you can always ask for SAMPLES!

    I hope that clears that up a bit.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • goldfingerfifgoldfingerfif Posts: 18
    edited 2006-07-18 20:50
    Thanks guys especially bruce that helps a lot. I am looking for basics on shift registers and memory to basically pull in something from an offsite (not on chip) EEPROM and then blink leds connected to a shift register according to the data in the eeprom. Even if it is only something simple like turn on leds 1,4,5,7,8 just to get the jist of it and move from there. And I want to do this all using a plain old BASIC Stamp 2.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-19 03:56
    goldfingerfif said...
    Thanks but the one eeprom is discontinued and the other that Chris Savage recommended 16K-byte EEPROM (BASIC Stamp 2SX and BASIC Stamp 2P-DIP) says it is for the 2sx and 2p but not just the bs2. Will it work with the regular plain ol' bs2? I dunno if it makes certain basic commands that would not be recognized by the bs2 to communicate to the chip.
    Hello,

    ·· Yes, it will work with the BS2.· If you look at the code you will see a BS2 demo code in there.· I hope this helps.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • goldfingerfifgoldfingerfif Posts: 18
    edited 2006-07-19 18:23
    Chris Savage (Parallax) said...
    goldfingerfif said...

    Thanks but the one eeprom is discontinued and the other that Chris Savage recommended 16K-byte EEPROM (BASIC Stamp 2SX and BASIC Stamp 2P-DIP) says it is for the 2sx and 2p but not just the bs2. Will it work with the regular plain ol' bs2? I dunno if it makes certain basic commands that would not be recognized by the bs2 to communicate to the chip.
    Hello,


    Yes, it will work with the BS2. If you look at the code you will see a BS2 demo code in there. I hope this helps. Take care.

    Yes it does, thanks a lot!
  • goldfingerfifgoldfingerfif Posts: 18
    edited 2006-07-19 18:32
    Any information on serial in, parallel out shift registers? My first test to get where I need to be the project I am working on is to wire the BS2 to an EEPROM and write say "11001100" then read it in and put it in a shift register causing LED's 1,2,5, and 6 to turn on for a cycle and then load in a new set of data or the same data. Sorry if I am a nuisance but I am just starting with this chip and not familiar with the resources or good places to look, but after I figure this small portion out I am hoping for smooth sailing from there, just not sure how to hook up and interface.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-19 19:53
    Look at the SHIFTOUT command documentation. Page 130 of the StampWorks book (downloadable free from the Parallax Store) goes through an example of exactly what you're trying to do.
  • goldfingerfifgoldfingerfif Posts: 18
    edited 2006-07-19 20:10
    Thanks so much everyone, this is a great forum! I haven't been helped this much in a while, hopefully I can return the favor.
Sign In or Register to comment.