I have written some code (My main file is about 250 lines long) and I have been trying to test it. If I comment all except the first little bit of my code, it performs exactly as I expect when I test it on the LCD and keypad. Naturally then I uncomment a little bit more, and when I try to test it, part way through the operation, it reverts back to the beginning of the code. 
I was thinking there was an error in the code I had written, so I tried debugging it in a number of different ways but I could not find any problem with it. So I instead tried commenting out the beginning part of my code, and then testing it and it performed perfectly. This led me to believe the problem was something to do with the length of my code. To test my theory I tried putting blank spaces or "nop's" into my code and as the code got longer, it reverted back to the first line of code earlier and earlier through operation (what I mean by earlier through operation is that since I am dealing with the user interface, I am progressing screen by screen as a user would. As I include more nop statements, it gets through less screens before jumping back to the first line [the standby screen]).
Any ideas on how to deal with this?

Views: 125

Replies are closed for this discussion.

Replies to This Discussion

Are you sure your code is only 250 lines long? If your code keeps reverting back to the beginning it may mean that you've filled up a page. But each page should be approximately 2000 instructions long, so if the entire code is only 250 lines this shouldn't be the problem. If you have macros, check how many times you're calling them in your code. Otherwise it might indeed be an error in your code.

check the blog "Code too long?"http://www.pml4all.org/profiles/blogs/code-too-long


It explains everything, basically you need to put the tabling at the top of your code, so that when your PC increments, it won't over flow the 0x256 size limit.


© 2021   Created by PML.   Powered by

Badges  |  Report an Issue  |  Terms of Service