Eeprom
goldfingerfif
Posts: 18
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
·· 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
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
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
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 -->
·· 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
Yes it does, thanks a lot!