Wierd debug thingy
GICU812
Posts: 289
I am working on this project, to get right down to it, Im getting a number added to a variable that shouldnt be.
I should be toggling from dec 4 to dec 0 and back. Instead, im getting 515. Its a binary thing, the variable is a 16 bit word, each bit representing the status of a device.
Well in trying to figure this out, I found that I am getting debug output that isnt anywhere in my code. I've hacked the code up in looking for this, so dont look to much into the messyness, but Ive replaced "on" and "off" with "oneee" and "offeee", The words "on" and "off" do not appear anywhere in the debug code now. Yet, im getting "on" and "off" in the debug window at the same time my variable is getting messed up. Odd huh?
Heres the debug output I get when its working:
beep
3
2
98
98
·3oneeeoffeeee
goinghere
welcome
Temp = %0000000000000100
backStatus = %0000000000000100
test
Heres what I get when the varaible gets corrupted
beep
3
2
98
99
·3off
status = 515
=0000001000000011
Just now I noticed there is a problem in the good output, "oneeeoffeee" its irrelevant, I probably messed up the if-then, its irrelevant in my problem. You see in the second output, I get "3off", yet unless im missing something, the word "off" is nowhere in the program anymore
Ideas?
I should be toggling from dec 4 to dec 0 and back. Instead, im getting 515. Its a binary thing, the variable is a 16 bit word, each bit representing the status of a device.
Well in trying to figure this out, I found that I am getting debug output that isnt anywhere in my code. I've hacked the code up in looking for this, so dont look to much into the messyness, but Ive replaced "on" and "off" with "oneee" and "offeee", The words "on" and "off" do not appear anywhere in the debug code now. Yet, im getting "on" and "off" in the debug window at the same time my variable is getting messed up. Odd huh?
Heres the debug output I get when its working:
beep
3
2
98
98
·3oneeeoffeeee
goinghere
welcome
Temp = %0000000000000100
backStatus = %0000000000000100
test
Heres what I get when the varaible gets corrupted
beep
3
2
98
99
·3off
status = 515
=0000001000000011
Just now I noticed there is a problem in the good output, "oneeeoffeee" its irrelevant, I probably messed up the if-then, its irrelevant in my problem. You see in the second output, I get "3off", yet unless im missing something, the word "off" is nowhere in the program anymore
Ideas?
Comments
Thats interesting.
Its a multislot program, as you can see. Well I removed slot 1 and therefore, slot 2 became slot 1. Slot 2 no longer exists in the program, but its still in the Stamps' EEPROM because it does not erase unused slots. But I never changed the POLLRUN 2
So when the program activated from the POLLRUN command, it went to the old program in slot 2, but when it was triggered by the timer, it ran the correct slot 1.
Its odd the IDE would not check that you were POLLRUN-ing a valid slot, since it calls slot 2, which technically doesnt exist in the program.
So, problem solved.
Thanks for looking though.
(2) The variable lists for the Slots you show us don't have the same variables. One of them has word variable "Status" where the other has word variable "Tracker". These will interfere with each other, and I'll bet there's something interfering in Slot 2, too. You must declare the same variables, with the same sizes, in the same order, in all Slots.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net