BS2 EEPROM / Datalogging Question
Progress
Posts: 11
Hi Guys,
I am using a BASIC Stamp BS2 to send servo signals [1-2 ms]. I need to record these servo positions for 2 signals. These are held in "Word" variables since the values for Pulsout range from [500-1000]. So far I've found this chip which seems to be sufficient for my project. However, I have a few questions:
1. Is it possible to export the values recorded in the EEPROM into a text file or any other file which I can open / analyze in EXCEL, MATLAB, etc?
2. Am I correct in assuming if I use 2 of these it will provide me with ~5 mins of datalogging [4000 instructions / s on the BS2, 50 instr in my code, Word = 16bit]
3. Is there any sample code available? I know Parallax usually posts it in the store, but I don't see any available this time that's why I ask.
4. Is there a simpler / more efficient [writing time is critical] alternative to using EEPROM? I've heard of using SD cards / USB memory sticks with the BS2 to log data. Would that be more efficient and simpler to implement?
Thanks.
I am using a BASIC Stamp BS2 to send servo signals [1-2 ms]. I need to record these servo positions for 2 signals. These are held in "Word" variables since the values for Pulsout range from [500-1000]. So far I've found this chip which seems to be sufficient for my project. However, I have a few questions:
1. Is it possible to export the values recorded in the EEPROM into a text file or any other file which I can open / analyze in EXCEL, MATLAB, etc?
2. Am I correct in assuming if I use 2 of these it will provide me with ~5 mins of datalogging [4000 instructions / s on the BS2, 50 instr in my code, Word = 16bit]
3. Is there any sample code available? I know Parallax usually posts it in the store, but I don't see any available this time that's why I ask.
4. Is there a simpler / more efficient [writing time is critical] alternative to using EEPROM? I've heard of using SD cards / USB memory sticks with the BS2 to log data. Would that be more efficient and simpler to implement?
Thanks.
Comments
2) Two will provide 128K bytes or 64K words. You can get bigger EEPROMs, up to 128K each and use up to 4 of them to get a total of 512K bytes or 256K words.
3) The BS2 does not have built-in I2C statement like the BS2p Stamp models. There's a Nuts and Volts Column that provides examples of subroutines that can be used to do I2C on a BS2. The Nuts and Volts Column index is under the Resources tab on the main Parallax webpage.
4) It takes about 5ms to write a byte to an EEPROM, You can write multiple bytes at once by using "page" mode, so you could write 4 bytes in about 5ms although the I2C routines will slow this down substantially. You'd be better off replacing the BS2 with one of the BS2p models since they wouldn't need the subroutines. SD cards and USB memory sticks have unpredictable delays in writing as the internal memory controller does its housekeeping. You can reduce the log size by storing one byte per servo. Subtract 500 from the PULSOUT value and shift right 1 bit. You'd represent the servo position by a value from 0-255. That's more than adequate given the mechanical resolution of most servos. You'd also gain from using a faster Stamp, like the BS2px.
There is a type of EEPROM called FRAM made by Ramtron. It uses a different technology for storage and is much faster for writing than EEPROM. It comes in both I2C and SPI versions. It's more expensive than EEPROM, but, if you need the speed, it may be worth it. Have a look at Ramtron's website.