This is extremely strange.
If you have other 18F series chip, can you try it also?
Then maybe on support.melabs.com forum, Charles can see if this is a 18F specific bug.
Can you post your test code to have a look?
Ioannis
This is extremely strange.
If you have other 18F series chip, can you try it also?
Then maybe on support.melabs.com forum, Charles can see if this is a 18F specific bug.
Can you post your test code to have a look?
Ioannis
I have found in the past that whenever I see something like this in my program, I have not defined the array correctly - one less element than I need, or bytes instead of words. Just because it's not defined correctly, does not mean you can't write to it as if it was, and then overwrite something. Where you put the definition in the program defines whether or not you end up overwriting useful code, or unused space. That's why it is helpful to post the code, rather than a generic question. Somebody will spot this condition and point it out, rather than guessing about device bugs. Maybe you have found a bug... maybe not.
Further, variables aren't automatically initialized (ie set to a specific value).
Where in your code you put the declaration of the variable can change the ORDER of the variables in RAM so if, like Charlie says, you're somewhere writing outside of an array it's possible that the order in which the variables are declared makes important variables get corrupted in one case and not so important varaibles get corrupted in the other. In either case you have a potential problem that you need to find - provided that IS indeed what's happening of course.
For example
Classic error there, arrays are zero indexed so the last element of the SMS array is SMS[159]. In this case Index will be assigned the value "A" because Index is declared right after the SMS array. Now, that might not ALWAYS be the case depending on where it all ends up relative to RAM banks and such.Code:SMS VAR BYTE 160 Index VAR BYTE SMS[160] = "A"
Try to cut the code down to a minimal that still shows the error and post it.
/Henrik.
Last edited by HenrikOlsson; - 18th February 2021 at 14:45.
Bookmarks