Tom,
in this example you are using the BYTE size variable "Temp" as address.Code:Temp var byte I2Cread SDA,SCL,ROM,temp,[stuff],failr
Do you remember that the 25LC512 requires a WORD size variable as address ;-)
Tom,
in this example you are using the BYTE size variable "Temp" as address.Code:Temp var byte I2Cread SDA,SCL,ROM,temp,[stuff],failr
Do you remember that the 25LC512 requires a WORD size variable as address ;-)
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Argghh! Thanks very much.. I am sure that will make a difference.
Had a question also about the notion of Page Write vs Byte Write. I notice in the data sheets that the chip does either one.
For some reason I though the use of [ ] indicated a page write, and ( ) was for a byte write, but that does not seem to hold up. So -
How do you tell the memory to do a Byte write vs a Page write? In my program I am writing a STR FOO\XXX - and am incrementing the counter by 128, assuming this is approximating a page write. It seems to be.
However, when I just want to write values like:
"1" - needing only a 'byte' sized space..
or
"16472" - needing a 'word' sized space no doubt...
to specific memory locations, I'd assume I'd be writing these a byte or a word at a time.. How do we tell the program to write a Byte vs a Page?
Then, to get the data back out - I am OK on how to get a byte out, but for a word, i'd need to read the memory location, and memory location +1, reading the lowbyte and highbyte, correct? In this example, I need to retrieve "16472" which is more than a byte.
Tom
Tom,Then, to get the data back out - I am OK on how to get a byte out, but for a word, i'd need to read the memory location, and memory location +1, reading the lowbyte and highbyte, correct? In this example, I need to retrieve "16472" which is more than a byte.
looks like you are getting lost with bits, bytes and words.
you should take a break, have a cup of coffee or tea, and look at my last code example, it does read and write a word at a time.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
I figured it out. Thanks to all who contributed, it was a 'learning experience'..
The root of my mis-understanding was this:
1. WORDS can be stored with a simple I2Cwrite command, and it is not necessary to write variable.byte0, then variable.byte1 in order to do this. Writing a WORD at a memory location just STARTS there and goes forward to the next location (Byte). I did not get this.
2. If you leave out [ ] around what you are writing or reading, it will pass compiler, but not do anything. This was my biggest issue. I was just writing
I2Cread , Dpin, Cpin, Chip1, location , data, failroutine
This works fine, but does not write anything for 'data'... If you do this:
I2Cread , Dpin, Cpin, Chip1, location , [data], failroutine
It works PERFECTLY... Once I went back and added the brackets, and made sure I was dealing with WORDS, it all came together..
THANKS.
TOM
Good to hear you are back on track!
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Bookmarks