Page 1 of 1

Different behavious different PIC's

Posted: Mon Feb 22, 2010 4:51 pm
by Jan Lichtenbelt
I changed from PIC16F877a to PIC18F4520. And to my big surprise a very easy string manupulation does give the wrong result. That means in Flowcode simulation the simulation works correct, but when down loaded into the PIC, I get just one, unpredicted symbol.
I programmed a moving string with 3 strings. This is a kind of Rolling Left with Carry over of the 3 strings. Moving the symbols in string1 is like:

Index2 = Index1 + 1
MenuString1[Index1] = MenuString1[Index2]

Carry over of string 2 into string 1:
Index2 = Len1 - 1 // Len1= length string 1
MenuString1[Index2] = MenuString2[0]

Using PIC18F4250 this carry over results or introduction in strange symbols, or leaving the last symbol of string1 unchanged. At the end you see the LCD completely filled with the silly symbol.

It sound like the solution must be simple, but I do not see it. Who can help?

Re: Different behavious different PIC's

Posted: Mon Feb 22, 2010 5:26 pm
by Benj
Hello

Could be something to do with the configuration of the device. See if you have the extended CPU configuration options enabled and if so then try disabling it. Also check you do not have the Low Voltage Programming bit set and your program should work correctly.

Re: Different behavious different PIC's

Posted: Mon Feb 22, 2010 7:28 pm
by Jan Lichtenbelt
What can the world becomes wonderfull. I disabled the ext CPU and LVP and it works! Thanks a lot.