Coincidently in your first post, the first number you have in each row appears to be the count of the following bytes of data. i.e., it looks like this data already has SteveB's suggestion built in? I will assume it does – if it does not, add it in like Steve suggested.
What PIC are you using? If you are using the 16F628, which has 128 bytes of EEPROM you could do something like this (although a tad wasteful).
;patt1
Data @0, 16,1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1
;patt2
Data @20, 8,129,66,36,24,24,36,66,129
;patt3
Data @40, 16,1,3,2,6,4,12,8,24,16,48,32,96,64,192,128,0
;patt4
Data @60, 16,1,128,2,64,4,32,8,16,8,32,4,64,2,128,1,0
etc.
;The data could be found and read as follows (for patt3 for example)
patt VAR BYTE ; pattern of interest
EEadr VAR BYTE ; EEPROM address
dataloop VAR BYTE ; number of data bytes (SteveB's suggestion)
pattern VAR BYTE[20]
i var byte ; temp counter
patt = 3; want to get pattern 3 from EEPROM for example
EEadr = 20*(patt-1) ; = 40, patt1 would be at 0, patt 4 would be at 60, etc.
Read EEadr, dataloop ; find out how many data bytes to follow
if dataloop > 19 then error ; can't have more than 19 or goes into next patt area
FOR x = 1 TO dataloop
EEadr = EEadr + 1
READ EEadr, pattern[x]
next x
Do something with numbers here
error:
END
Paul Borgmeier
Salt Lake City, Utah
USA
Bookmarks