I know...
The only reason I tried TRISB=0 is because I wanted to check if I could use the pins as a digital output.
In the meantime I found the problem. In fact, it had nothing to do with the i2cread/i2cwrite commands.
The crystal I used apparently had a low activity. Sometimes the oscillator was working, but most of the time it was not!
I changed the crystal and now it works! (Maybe changing the values of the capacitors would have worked, but I did not try that.)
Bookmarks