Fair enough, but what about this when x >= 16
Code:if topline[x]=32 or botline[x]=32 then a=0 if topline[x+1]=32 or botline[x+1]=32 then b=0 'blanker
Fair enough, but what about this when x >= 16
Code:if topline[x]=32 or botline[x]=32 then a=0 if topline[x+1]=32 or botline[x+1]=32 then b=0 'blanker
I don't see any relation
I modified code and X now changes from 0 to 14 - still same issue.
You've been using x, y, and z to get values to set a and b.
You've been shoving invalid data out to the lcd and wondering why the display is wrong.
It's probably still wrong.
LOL.
I'm trying to explain that if I add one extra array definition, another array gets screwed. How this is related to LCD?
I just wrote another code, which simply reads values of array and writes data on 1602LCD.
Issue still exists - data in array gets damaged, if total array length exceeds 24 bytes.
I just did this with an 18F45K80
When it gets to the end, topline and botline arrays are exactly as specified... each is 16 chars "0"-"F"Code:' device = 18F45K80 topline var byte [16] 'top part of the screen array botline var byte [16] 'bottom part of screen ix var byte ct var byte cb var byte ' clear arrays for ix = 0 to 15 topline[ix] = 0 botline[ix] = 0 next ix ' read array data arraywrite topline,["0123456789ABCDEF"] arraywrite botline,["0123456789ABCDEF"] ix = 0 'read array char by char for ix = 0 to 15 ct = topline[ix] cb = botline[ix] next ix ix = 0
Reading the arrays byte by byte also does as expected.
I even added a third array of 16 chars... works too.
Your problem is elsewhere... not with the arrays themselves.
Thanks, have you tried to read the same array several times?
Problem is definitely in arrays, because if I make say topline 4 bytes and botline 16 bytes (even without writing anything to any of them) - there are no problems, but as soon their total "length" exceeds 24 bytes, issues start to appear.
just saying... "Problem is definitely in arrays... but as soon their total length exceeds 24 bytes, issues start to appear. " doesn't seem to pan out.
The following reads three 16-byte arrays (48 bytes total) 20K times and verifies the arrayreads. No errors.
Same with the original two 16-byte arrays.
Tried both PBP 3.16 and PBPL. No difference.Code:' device = 18F45K80 topline var byte [16] 'top part of the screen array botline var byte [16] 'bottom part of screen line3 var byte [16] 'more array data ix var byte ct var byte cb var byte c3 var byte i var word fail var word fail = 0 for i = 0 to 20000 ' clear arrays for ix = 0 to 15 topline[ix] = 0 botline[ix] = 0 line3[ix] = 0 next ix ' read array data arraywrite topline,["ABCDEFGHIJKLMNOP"] arraywrite botline,["QRSTUVWXYZ[\]^_`"] arraywrite line3, ["abcdefghijklmnop"] 'read array char by char and check for ix = 0 to 15 ct = topline[ix] if (ct-"A" <> ix) then fail = fail + 1 cb = botline[ix] if (cb-"Q" <> ix) then fail = fail + 1 c3 = line3[ix] if (c3-"a" <> ix) then fail = fail + 1 next ix next i ' check for failure if (fail > 0) then i = fail endif
Post the complete code that doesn't work.I just wrote another code, which simply reads values of array and writes data on 1602LCD.
Issue still exists
Bookmarks