PDA

View Full Version : Interfacing with EEPROM



abcdefg
01-29-2007, 11:04 PM
Can I interface the BASIC stamp with EEPROM ICs like the ones I linked to? Is there any example code floating around for either of these?

http://ww1.microchip.com/downloads/en/DeviceDoc/21941C.pdf
http://ww1.microchip.com/downloads/en/DeviceDoc/21713F.pdf

Zoot
01-30-2007, 12:05 AM
Looks like it shouldn't be too much trouble. The chips are I2C (a two-wire serial interface protocol that is really, really common).

The BS2p supports I2C commands natively (see I2CIN and I2COUT in the Stamp manual). If you have a BS2 then you can "bit-bang" the I2C protocol using some subroutines to handle the data transfers. See this thread:

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

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST

abcdefg
01-30-2007, 08:28 PM
Zoot said...
Looks like it shouldn't be too much trouble. The chips are I2C (a two-wire serial interface protocol that is really, really common).

The BS2p supports I2C commands natively (see I2CIN and I2COUT in the Stamp manual). If you have a BS2 then you can "bit-bang" the I2C protocol using some subroutines to handle the data transfers. See this thread:

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


Just to be sure, can I write data from an analog-> digital converter onto the EEPROM and then later use the BASIC stamp to pull the data out and run it through a digital -> analog converter? Thanks!

Zoot
01-30-2007, 08:32 PM
I don't see why not, but that's basically a software/coding issue, not a hardware/electronics issue, i.e., you need to write your program so:

- you collect data into some variable(s)
- format and write the variable data to the EEPROM
- do other stuff for a while
- read some data from EEPROM into some variable(s)
- do stuff to the data
- output data to a D/A

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST