Code:
Array Var Byte [100]
AA Var Byte
Address Var Word
I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\64]
'This command will write one page of 64 bytes starting from address position
I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\10]
'This command will write 10 bytes starting from address position
I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\100]
'This command will NOT write 100 bytes starting from address position
'If you need to write 100 bytes then you will need two write instruction:
'First
I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\64]
'This command will write one page of 64 bytes starting from address position
Address = Address + 64
For AA = 0 to 35
Array[AA]=Array[AA+63]
next AA
' Moving remaing bytes in the low side of the array
I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\36]
[COLOR="Red"]'This command will write the remaining 36 bytes starting from
address but in the following page.
In the last example, since 100 is not a multiple of 63 will give you a lot of problem in writing the remaining pages since in the second page after the two writing sequence the space left in the second page is 64-36 = 28 Bytes.
Hoping now is sligtly more clear.
Al.
Bookmarks