PDA

View Full Version : PollRun not transfering information



Cruzer_1
01-22-2010, 11:44 PM
hello,
i am using a BS2p24 micro in a project of mine.
In this program i am using
POLLIN 2, 1
POLLRUN 1
POLLMODE 4

However when poll run is activated and runs the program in slot one, the information from a variable in slot 0
is not carried through to the program in slot 1.
does any one have any idea on why the program is doing this and is there a solution?
any help will be greatly appreciated. thanks.

-cruzer

Mike Green
01-22-2010, 11:51 PM
The variables in the two slot programs have to be declared in exactly the same order and sizes. That's the only reason why one is not "carried through". When the Stamp is reset, all the variables are initialized to zero. When the Stamp switches from one slot to another, the variables in the Stamp's memory simply stay the way they are. If the two programs refer to the same locations, the values from the first slot will still be there and can be referred to by the 2nd slot's program.

The Stamp Editor's compiler allocates variables in the order they're declared in the program according to their sizes. I believe words come first, then bytes, then nibbles, then individual bits. If you have extra variables, that can throw things off.

There's a good explanation of multi-slot programming in one of the Nuts and Volts Columns (maybe #85). Look under the "Resources" tab on the main Parallax webpage. You'll find the link to the Nuts and Volts Columns index.