Interfacing Stamp with External Memory
Trang
Posts: 9
Hello experts,
I'm working on a project in which I collect data from an accelerometer for around 10 minutes to capture motion of my board. Therefore, I needed external EEPROM to store that data. I chose the 24LC256 memory chip and now I'm trying to interface it with the Stamp. (I'm using BS2e)
So I was wondering if anyone here has tried that kind of combination -- Stamp + an external memory chip -- and could possibly tell me if it's possible. I'm thinking about using the shiftin and shiftout commands as I did with a 12-bit AD converter. But what I was concerned about is that Stamp generates its own clock implicitly in those commands and whether it's gonna cause any incompatibility with the memory chip...
Has anyone done this before? Any feedback will be very much appreciated!
I'm working on a project in which I collect data from an accelerometer for around 10 minutes to capture motion of my board. Therefore, I needed external EEPROM to store that data. I chose the 24LC256 memory chip and now I'm trying to interface it with the Stamp. (I'm using BS2e)
So I was wondering if anyone here has tried that kind of combination -- Stamp + an external memory chip -- and could possibly tell me if it's possible. I'm thinking about using the shiftin and shiftout commands as I did with a 12-bit AD converter. But what I was concerned about is that Stamp generates its own clock implicitly in those commands and whether it's gonna cause any incompatibility with the memory chip...
Has anyone done this before? Any feedback will be very much appreciated!
Comments
However, with that chip, you'll probably need to use the I2C commands instead of the shiftin/out commands. The 2 main protocols to communicate with eeproms are SPI (shiftin and shiftout, like the ADCs you're familiar with) and I2C. It looks like the chip you chose uses I2C. You can make it easier on yourself and get an SPI eeprom, or stick with the 24LC256 and use the I2C commands. Your pick.
Hope that helps...
Dave
One more question since this was brought up: I'm really a newbie in this field, so could you also explain to me which between SPI and I2C is better to use? And if it were you, which direction would you go with? I know I picked SPI because of my Stamp chip, but if I can choose without constraints, what should I go with? --- just curious.
Thanks a lot for your help!
SPI is a not very standardized at all protocol that requires three or four I/O lines. Some of these lines can be shared among devices, but you always need a select line that's unique to each device. There are all sorts of variations on this protocol with minimal commonality among devices. It's very fast though, often with devices that can accept up to a 20MHz clock (although the Stamps are much slower than that).