Confused about variable memory for different stamps
Gobias
Posts: 5
Hi, I'm writing code for an RFID application that uses breadth first search to calculate a "route" for a certain placement of a given number of tags. The number of nodes(tags) is 7 total right now, but I need to expand that number to 15-20.
For variables, I need to declare many 1 x 7 array to set up an adjacency matrix, etc. I only have a BS2 and I'm already running out of memory for declaring variables. Here are my current variable declarations:
#IF __No_SPRAM #THEN
buf VAR Byte(10) ' RFID bytes buffer
#ELSE
chkChar VAR Byte ' character to test
#ENDIF
tagNum VAR Nib ' from EEPROM table
idx VAR Byte ' tag byte index
char VAR Byte ' character from table
currentPos VAR Nib ' current position
previousPos VAR Nib ' previous position
maxPos VAR Nib ' maximum position aka destination
AdjI VAR Bit(7) 'adjacency matrices for tags/nodes I-VII
AdjI(1) = 1
AdjI(6) = 1
AdjII VAR Bit(7)
AdjII(0) = 1
AdjII(2) = 1
AdjIII VAR Bit(7)
AdjIII(1) = 1
AdjIII(3) = 1
AdjIV VAR Bit(7)
AdjIV(2) = 1
AdjIV(4) = 1
AdjV VAR Bit(7)
AdjV(3) = 1
AdjV(5) = 1
AdjVI VAR Bit(7)
AdjVI(4) = 1
AdjVI(6) = 1
AdjVII VAR Bit(7)
AdjVII(0) = 1
AdjVII(5) = 1
buffer VAR Bit(7)
color VAR Nib(7)
parent VAR Nib(7)
d VAR Nib(7)
search VAR Nib
search1 VAR Nib
destTag VAR Nib
In the Stamp Editor when I run it in BS2 mode it gives the "out of variable space" error, but not in modes BS2p, BS2pe, and BS2Px. When I look at the product page, every stamp has a 26 bytes for variables... So if they all have the same space reserved for variables, why will the BS2p stamps accept my code and regular BS2 won't? Do the BS2p stamps actually have more variable memory?
For variables, I need to declare many 1 x 7 array to set up an adjacency matrix, etc. I only have a BS2 and I'm already running out of memory for declaring variables. Here are my current variable declarations:
#IF __No_SPRAM #THEN
buf VAR Byte(10) ' RFID bytes buffer
#ELSE
chkChar VAR Byte ' character to test
#ENDIF
tagNum VAR Nib ' from EEPROM table
idx VAR Byte ' tag byte index
char VAR Byte ' character from table
currentPos VAR Nib ' current position
previousPos VAR Nib ' previous position
maxPos VAR Nib ' maximum position aka destination
AdjI VAR Bit(7) 'adjacency matrices for tags/nodes I-VII
AdjI(1) = 1
AdjI(6) = 1
AdjII VAR Bit(7)
AdjII(0) = 1
AdjII(2) = 1
AdjIII VAR Bit(7)
AdjIII(1) = 1
AdjIII(3) = 1
AdjIV VAR Bit(7)
AdjIV(2) = 1
AdjIV(4) = 1
AdjV VAR Bit(7)
AdjV(3) = 1
AdjV(5) = 1
AdjVI VAR Bit(7)
AdjVI(4) = 1
AdjVI(6) = 1
AdjVII VAR Bit(7)
AdjVII(0) = 1
AdjVII(5) = 1
buffer VAR Bit(7)
color VAR Nib(7)
parent VAR Nib(7)
d VAR Nib(7)
search VAR Nib
search1 VAR Nib
destTag VAR Nib
In the Stamp Editor when I run it in BS2 mode it gives the "out of variable space" error, but not in modes BS2p, BS2pe, and BS2Px. When I look at the product page, every stamp has a 26 bytes for variables... So if they all have the same space reserved for variables, why will the BS2p stamps accept my code and regular BS2 won't? Do the BS2p stamps actually have more variable memory?
Comments
Even so, I guess it would be impossible to implement my 20 tag system on a BS2 as it would require several 20-byte sized arrays. Do you know of anything else that the Parallax serial RFID reader can interface with? I did see the thread about connecting it to a computer, but my project needs the reader to be mobile.
Thanks for your help.
Now I need to decide which to purchase: BS2p or BSpe... BS2p has twice the program execution speed as BS2pe, but its current draw @ 5V is more than twice also.
Can you guys tell from my attached code (it's about 80% done) if it will run super slow on the BS2p?