As a rule, if you start repeating yourself, it's time to think about a subroutine... it might use less codespace in the long run... try it...
for CounterA = 0 TO 98 STEP 2 ' Loop 50 times
Address=CounterA
Data_In =Temp.LowByte ' Data_In is data TO EPPROM
Gosub WriteByte
address = address +1
Data_In =Temp.HighByte ' Data_In is data TO EPPROM
Gosub WriteByte
Temp =Temp + 100
Next CounterA
.. ..
writeByte:
I2CWrite SDA,SCL,%10100000,address,[Data_In]
Pause 10 ' Delay 10ms after each write
Return
Here's a tip... check the Datasheet for the external EEPROM you're using... you might only need a 5mS (or less) pause...
Bookmarks