read 10,Blue_on_Time.0 is bit 0 not the low byte
read 11,Blue_on_Time.1 is bit 1 not the high byte
you want
read 10,Blue_on_Time.lowbyte
read 11,Blue_on_Time.highbyte
read 10,Blue_on_Time.0 is bit 0 not the low byte
read 11,Blue_on_Time.1 is bit 1 not the high byte
you want
read 10,Blue_on_Time.lowbyte
read 11,Blue_on_Time.highbyte
Cheers Richard, will give that a go.
Guess I need to use the same method to write the value to memory ie write 10,blue_on_time.lowbyte and write 11,blue_on_time.highbyte
yes its hard to remember wether the data statement saves words as highbyte first or not
and then does the write word do the same ?, to read them back properly you must get it right.
but write 1 ,word wordvar and read 1, wordvar is the way to go if you can't be bothered understanding what happens
data @1 ,1,2 ; (wordvar.highbyte),( wordvar.lowbyte) $0102 =258 the question is ,is data @1,word 258 is it the same thing try it and see
the easy way out if your not sure about data is to :-
write 1, wordvar.highbyte, wordvar.lowbyte
read 1 , wordvar.highbyte,wordvar.lowbyte
its less efficient but it leaves no doubt.
you could always read the manual or just experiment to find out , the trick is though to be able to remember it
for next time
Uhmmm.
Just tried
write 10,Blue_on_Time.highbyte
and on compiling it complains of illegal character, with a code [108].
I've gone through the code and it compiles fine if I remove the .highbyte .... confused !!
Hi,
I copy/pasted the above line into a blank program, added Blue_On_Time VAR WORD to the top and it compiled just fine for a 16F628.Try removing the complete line, then re-enter it or copy/paste it from your own post. Perhaps there's some strange hidden character or something lurking. Like I said, compiles just fine here.Code:Blue_On_Time VAR WORD write 10,Blue_on_Time.highbyte END
/Henrik.
Bookmarks