array strange behaviour
Posted: Thu Apr 16, 2009 10:29 pm
On a 18F2550, the arrays sometimes don't react as they should.
On the attached file (Robot_ir_v4testbug2.fcf), I highlighted the problem. I test an array at the begginning of my software not modified (a line follower robot with RC5-IR remote control)
If I write in a calculation box:
--------------------
xcapt[1] = 7
c = 1
MODE = xcapt[c]
----------------------
If I ask for an output on the LCD, I have
xcapt[1] -> 7 on LCD
xcapt[c] -> 8 on LCD
MODE -> 8 on LCD
It should be should be 7/7/7. Simulation give 7/7/7
If I copy the code in a new program, the result is OK (7/7/7)
The same code in a bigger programm can sometime be OK (7/7/7) too. The result is OK on the file: Robot_ir_v8_0bug.fcf Somebody have an explanation for that?
On the attached file (Robot_ir_v4testbug2.fcf), I highlighted the problem. I test an array at the begginning of my software not modified (a line follower robot with RC5-IR remote control)
If I write in a calculation box:
--------------------
xcapt[1] = 7
c = 1
MODE = xcapt[c]
----------------------
If I ask for an output on the LCD, I have
xcapt[1] -> 7 on LCD
xcapt[c] -> 8 on LCD
MODE -> 8 on LCD
It should be should be 7/7/7. Simulation give 7/7/7
If I copy the code in a new program, the result is OK (7/7/7)
The same code in a bigger programm can sometime be OK (7/7/7) too. The result is OK on the file: Robot_ir_v8_0bug.fcf Somebody have an explanation for that?