getting there, but still puzzled
Steve,
I took your concepte and I'm getting somewhere, but I've hit a problem which I can't figure out.
The manual provides the following information when using the DATA statement
Quote:
{Label} DATA {@Location,}Constant{,Constant...}
If the optional Location value is omitted, the first DATA
statement starts storing at address 0 and subsequent statements store
at the following locations.
so I followed the format and used patt1, patt2 etc as the lable and ommitted the address, thus causing patt1 to sit at address 0 by default. The manual then gives an example of how to store three numbers in the EEPROM memory
Quote:
Store 10, 20 and 30 starting at location 4
DATA @4,10,20,30
Ok as I've used the default address and ommited the location my data statement looks like:
Code:
patt1 DATA 17,16,1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1
which also includes the number of steps as the first digit as suggested
So far so good.... moving on to the READ statement the manual states
Quote:
READ Address,Var
Read a byte from the on-chip EEPROM at the specified Address and
stores the result in Var.
Using your concept code the program fell over when it encountered the line "READ Patt1, steps" so logic suggested that its looking for a location rather than the lable patt1. so I changed the patt1 to read "READ 4, steps" and that compiled OK.
Now the part that is confusing me is how to read back all the values in the data statement. It would be nice if the manual used the same example in the READ statement that it featued in the DATA statenment showing how to get back the digits 10, 20, 30. If I used your concept of "READ patt1 + count" with the correct syntax it gives
However would this then read the first byte of the DATA statement at the next address, as it would be interpreted as READ 1, temp... READ 2,temp etc or is the next address (1) be the next byte in the same DATA statement. If so I would then need to know the exact address for the start of the second DATA statement, and the Third etc
Also do I need to use hexdecimal for address locations, or can I stick to decimal, so that the second DATA statement would thus start at address 18
I'm now totally confused ??
With regards to Bruce's post, a lot of that was in assemble, and at my current level of understanding with Pics and PBP I would much rather stick with PBP.. which is a steep enough learning curve as it is, without having to get my head round asm code !