Do you have any BRANCH instructions which may need to be changed to BRANCHL ?
Do you have any BRANCH instructions which may need to be changed to BRANCHL ?
Keith
www.diyha.co.uk
www.kat5.tv
Nope. Only old useful Goto and GOSUB. By the way I can't see anything strange with the LST file.
Mike
Check to see if you have a GOSUB to any routine that doesn't issue a
RETURN to get back.
Thank you for all ideas but still no luck in fixing the problem. The program jumps to the sub but the sub makes some really strange things before it jumps back to where should. If I just remove the new variable or make it a Byte size things are working. I will see what happenes if I make 2 new byte size variables, that should be similar to making one word variable and using a word variable becomes crap.
Later.....
Mike
Since we have to play 20 questions here...
Do you have any Assembly instructions in your code?
Adding a variable might move something to a different bank than the program is expecting.
<br>
DT
Sorry for playing "20 questions". I could not post the code because the code should not be public knowledge. Anyway the problem is solved and here is an update.
The problem is with RAM allocation, PBP has a problem when assigning RAM space to variables. In this case one byte of a WORD size variable was assigned to the last adress in BANKA and the other byte of the same Word variable to the first adress in BANK0. Variables can not span 2 banks and this is why strange things happend. Melabs helped me to find this and they are working on a fix for this. There is a workaround, assign any BYTE size variable to the last adress of each bank you are using. Check the .ASM file and you can see how many variables you are using. This problem can happen between all RAM banks not only BANKA and BANK0. For 18F4620 that I use I added
n Var Byte $7F
This prevents a WORD to be assigned to the last adress of BANKA and also solved the problem.
If you have a program with many variables this is something you would like to check. This problem is ALSO in current versions of 2.47!
Mike
Last edited by sinoteq; - 17th February 2007 at 04:34.
Bookmarks