can a routine library chip be used?
I know this is currently way over my head right now, but if I were to ever make my own stamp boards with I/O ports etc, would it also be possible to have an EPROM that has a library of my (future) common subroutines that I could use with a stamp rather than having to load them into the program memory?· Macintosh used to do something like this to save space on their computers.
Also, if a board were to have 2 or more BS2's on board operating independantly, is it possible to let them share a common memory space for variables and/or configuration settings?
Thanks.
Comments
Due to the way the compiler and BASIC Stamp work this is not possible. However, if you would like to have varying version of your program available to switch to without recompiling and downloading them you can preload them onto a BASIC Stamp 2e, 2sx, 2p, etc and simply run another slot. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
This provides a framework for using the slots on the larger Stamps in a way that should let you have, perhaps not libraries of routines, but libraries of programs and major functions. As Chris mentioned, the Basic Stamp and its compiler don't support libraries as such. In fact, they have limited support for subroutines in general (only simple GOSUB/RETURN ... no parameters).
Any answers to my second question?:
"Also, if a board were to have 2 or more BS2's on board operating independantly, is it possible to let them share a common memory space for variables and/or configuration settings?"
At the time the PIC was created, there were LOTS of 8 and 16 bit processors that used external RAM, external EEPROM, and external I/O devices. Thus this really wasn't a goal of the PIC processors. Oh, and the external EEPROM typically required a separate device to program it.
Now, Parallax has added value to this platform by enabling you to program this device in PBasic -- which is MUCH easier than PIC assembly -- and program it with merely a PC with a serial port.
I suppose you can attach I2C devices to the BS2, and 'share' information that way. But "sharing RAM", or "Sharing code storage" really isn't going to work.
2nd question: No. The variable space is stored internal to the processor and is not accessible externally.
You could have a shared external memory. You could use a Ramtrom FRAM which is an EEPROM-like memory that uses a ferroelectric effect to store bits. It's not subject to the write limitiations of normal EEPROM and the write speeds are as fast as the read speed. They come in sizes up to 64K x 8. You could use either I2C or SPI serial protocols with all Stamps connected in a "open-drain" fashion. You'd need some kind of "request/release" mechanism so only one Stamp at a time would try to access the shared memory.
Jeff