SERIN/SEROUT with READ/WRITE or GET/PUT or STORE?
Christina Keller
Posts: 8
I am using a BS2p24 to input, format, and output data from a GPS to a device that takes in ASCII and prints it over video (XBOB/Basic Overlay Board). I am using SERIN and SEROUT to transfer the data, but I am running out of variable or EEPROM room. I really just need more of one or the other: if I had more variables I would need less prg. space; if I had more prg. space I could reuse the variables more. I know about the 128 Scratchpad and the 8x2K bytes and external EEPROMs, but they seem to do me no good with SERIN and SEROUT (Those commands want variables, not READor GET). Or maybe I am not accessing them right? And what is up with the 8: are there really 8 EEPROMs in there? Can I get to them without READ/WRITE? or Maybe there are other ways to output serial data srtaight from the Scrtachpad or these mysterious 8 EEPROMS that I can't seem to access??
Comments
·· The SPSTR·function can be used to grab a string from SERIN and drop it into the scratchpad RAM.· Please see the help file under SEROUT for usage.· As for the mysterious 8 EEPROM slots, I had never heard it put quite that way.· But if you look up in the help file under the RUN command, you'll get some information on using these extra slots of memory.· Another place to get information on multiple EEPROM slots is the·Nuts & Volts·Column #87 (Multi-Bank Programming), which is available from our website as a free download.· Click Downloads\Nuts & Volts Columns\Volume 3.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
What you do is use a 16 K eeprom, but treat it like 8 2K eeproms, and use the 'run' option to switch between them. This preserves your old run-time library, yet gives you LOTS more memory for your programs.
How much data are you wanting to RX and display on your video overlay?· If you're using a standard GPS string like $GPRMC then buffering it into the Scratchpad and parsing it after is the way to go.· If you happen to be using a Garmin eTrex GPS, you can switch to formatted text output mode and capture data into variables on-the-fly.· I've done this with a BS2 (code attached).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
[noparse][[/noparse]subroutine]1rg1.bs2
for example, the way it is in the book.) However, the Nuts and Volts example appears to be all one file. Is that because it only uses RAM? Do I need to do some external wiring to access the different EEPROM slots??
I have only once run out of program space in a single slot -- turned out to be a GPS datalogger for my boss's model airplane. The program needed to store the data, the "print" it (using DEBUG) in a formatted fashion so we could pull it into Excel very easily.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
What you might consider is using Slot 0 as a simple menu program which launches Slot 1 or Slot 2 depending on what the user wants to do. That way you can keep the programs separate and conserve variable space.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Thanks for your help thus far, though.
Put this declaration in Menu.BSP:
' {$STAMP BS2p, GPS1.BSP, GPS2.BSP}
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax