Different behavious different PIC's
Posted: Mon Feb 22, 2010 4:51 pm
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?
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?