I need to store approx 300 words elements (600 bytes) in a table.
It looks like Lookup2 craps out at 256 words, and Lookup does the same at 256 bytes.
Any workarounds? (That EXT modifier looks kinda scary)
I need to store approx 300 words elements (600 bytes) in a table.
It looks like Lookup2 craps out at 256 words, and Lookup does the same at 256 bytes.
Any workarounds? (That EXT modifier looks kinda scary)
One work around is to use two lookup2 statements. Placed one right after the other.
Example, 150 in each words table,
Code:Gosub MYTABLE MYTABLE: If INDEX > 150 then MYTABLE2 LOOKUP2 INDEX, [1,....150],VAR goto endtable MYTABLE2: INDEX = INDEX - 150 LOOKUP2 INDEX,[151...300],VAR endtable: Return
Last edited by mark_s; - 27th March 2011 at 21:28.
The holy manual says "Up to 255 (1024 for pic18fxxx) constants are allowed in the list" thats for Lookup.
Lookup2 it states "Up to 85(1024 for pic18fxxx) values are allowed in the list"
So, I guess it depends on what pic you are using 18f or 16f?
I saw that also, after creating my LOOKUP2 table, but I'm using the new 16F1827, and the compiler didn't start balking until I got over 255 or 256 words (can't remember which).
I whittled the table down to 253 words, and it's compiling fine. I figured there'd been an "undocumented capacity update" since the manual was last printed.
I haven't yet down loaded any code to the device so we will see what happens then.
Bookmarks