Program slots
Archiver
Posts: 46,084
I have a program that runs fine on a BS2P40 in program slot 0. But
if I load this program in slot 3, and call it from slot 0, the
results are incorrect. I am printing the results from within the
program, whether in slot 0 or slot 3, but getting different results.
The results when run in slot 0 are correct. What am I doing wrong?
Jim
if I load this program in slot 3, and call it from slot 0, the
results are incorrect. I am printing the results from within the
program, whether in slot 0 or slot 3, but getting different results.
The results when run in slot 0 are correct. What am I doing wrong?
Jim
Comments
For one thing, make sure all the variables and cons in slot 0 are also in
slot 3.
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
> I have a program that runs fine on a BS2P40 in program slot 0. But
> if I load this program in slot 3, and call it from slot 0, the
> results are incorrect. I am printing the results from within the
> program, whether in slot 0 or slot 3, but getting different
results.
> The results when run in slot 0 are correct. What am I doing wrong?
>
> Jim
Hi Jim:
Last year, I went through torture with this one. I spend two days up
at Parallax trying to find the answer. John Barrowman finally found
it. Under certain conditions, the program would crash at a "RUN"
command. It turned out [noparse][[/noparse]after many hours of testing] that immediately
before, during and just after the RUN, if there is anything moving on
the SERIN line, the firmware interprets that as a programming
command. I had to put a transmission gate [noparse][[/noparse] CMOS 4066] between the
SERIN line and the outside world. Trning off the TG cleaned up that
line, and the problem disappeared. what the oterrs are saying it also
true. Have exactly the same stack of vars declared in each slot. BUT,
if the SERIN line has anything on it, watch out!
I use the commercial version - separate interpreter chip, memory,
etc, not the module. I don't know if this is true for the modules.
George
eliminate this problem. The I2CIN and I2COUT syntax was also updated to be
made a bit more flexible.
-- Jon Williams
-- Parallax
In a message dated 6/15/02 5:46:09 PM Central Daylight Time,
csiaero1@p... writes:
> --- In basicstamps@y..., "jcfjr007" <j71950@a...> wrote:
> > I have a program that runs fine on a BS2P40 in program slot 0. But
> > if I load this program in slot 3, and call it from slot 0, the
> > results are incorrect. I am printing the results from within the
> > program, whether in slot 0 or slot 3, but getting different
> results.
> > The results when run in slot 0 are correct. What am I doing wrong?
> >
> > Jim
>
> Hi Jim:
>
> Last year, I went through torture with this one. I spend two days up
> at Parallax trying to find the answer. John Barrowman finally found
> it. Under certain conditions, the program would crash at a "RUN"
> command. It turned out [noparse][[/noparse]after many hours of testing] that immediately
> before, during and just after the RUN, if there is anything moving on
> the SERIN line, the firmware interprets that as a programming
> command. I had to put a transmission gate [noparse][[/noparse] CMOS 4066] between the
> SERIN line and the outside world. Trning off the TG cleaned up that
> line, and the problem disappeared. what the oterrs are saying it also
> true. Have exactly the same stack of vars declared in each slot. BUT,
> if the SERIN line has anything on it, watch out!
>
> I use the commercial version - separate interpreter chip, memory,
> etc, not the module. I don't know if this is true for the modules.
> George
>
[noparse][[/noparse]Non-text portions of this message have been removed]
I think the problem I had was lining up var in each slot. I did not want to
use the same variables in each slot (program) because I had run out of space.
So I used different variables in each slot and passed info via scratchpad.
This cleared up the problem, so I assumed it was not working because I did
not have variables lined up. By using scratchpad and different variable
names in each slot, I saved alot of space and passed my data without
bothering to line up vars.
Program slot 0
a var word
b var word
Put 1, a
Put 2, b
Run 1
Program slot 1
c var word
d var word
Get 1, c
Get 2, d
This causes c=a and b=d in slot 1
Could have been what you suggested also, I have a serial backpack on my LCD,
but it works fine now with above approach.
Thanks,
Jim
[noparse][[/noparse]Non-text portions of this message have been removed]