Steen Jensen wrote: > I have included some code from AN554 in my program. > I have followed the test examples from Microchip, > but my program does not work I'm not surprised. Their app notes are pretty poor. I started from their AN557, and that has fundamental bugs. If the slave holds SCL low to wait-state the (PIC) master, then the AN557 code thinks this is an error state. I modifed the code to wait until SCL was high, and extended my application to handle errors properly. For example, if arbitration fails (SDA conflict) then back off and retry sending message from the start, and if negative ack, terminate message. If you tell us about the application & malfunctions, we may be able to guess a diagnosis. Good luck. BTW, not waiting for SCL to rise is a mistake one of my colleagues made in his code. Certain bits were misbehaving repeatably. He ran his code on his emulator, it got the data my PIC had sent. "Not my bug" he said. I wasted weeks combing my code for bugs. Eventually I said "look at the storage scope - the signals look perfect. Just what the F*** is wrong with it?". So he puts his emulator on, single steps, and no malfunction. Run in real time, malfunction. "Okay, maybe a timing bug" he says. Within 20 mins he notices his make-SCL-high macro does not wait for it to do so. Changed it to wait, malfunction vanishes! Next time it won't be my head I bash against the wall!