Hi Tom,
assuming the variables used are declared as:
B0 VAR WORD
B1 VAR BYTE
B2 VAR BYTE
the code is ok.
If you are using a fast crystal (20MHz), add these two DEFINEs:
DEFINE I2C_SLOW 1
DEFINE I2C_SCLOUT 1
Add pullups (4k7) to the data and clock line and it should work.
(it might work with a pullup on the data line only)
rgds
Bookmarks