Thanks for the help.
I really am not sure what exactly is/was wrong. The only way for me to make it work is to write one byte on each I2CWRITE command. If I attempted to write more than one variable at a time there would be the occasional error in the written data. Maybe it's a wiring issue (although the mistakes were always at the same data points....?)
Here's what worked:
Code:For x = 1 To 200 ' Number of Steps equals number of bytes of data (so we don't overwrite) I2CWRITE DPIN,CPIN,$A0,I2CAddress,[B1.highbyte] ' Write each location's address to itself I2CAddress = I2CAddress + 1 Pause 10 I2CWRITE DPIN,CPIN,$A0,I2CAddress,[B1.lowbyte] ' Write each location's address to itself I2CAddress = I2CAddress + 1 Pause 10 I2CWRITE DPIN,CPIN,$A0,I2CAddress,[B2.highbyte] ' Write each location's address to itself I2CAddress = I2CAddress + 1 pause 10 I2CWRITE DPIN,CPIN,$A0,I2CAddress,[B2.lowbyte] ' Write each location's address to itself I2CAddress = I2CAddress + 1 pause 10 I2CWRITE DPIN,CPIN,$A0,I2CAddress,[B3.highbyte] ' Write each location's address to itself I2CAddress = I2CAddress + 1 Pause 10 ' Delay 10ms after each write I2CWRITE DPIN,CPIN,$A0,I2CAddress,[B3.lowbyte] ' Write each location's address to itself I2CAddress = I2CAddress + 1 Pause 10 ' Delay 10ms after each write B1 = B1 + 1 B2 = B2 + 3 B3 = B3 + 5 pause 10 Next x




Bookmarks