Hi you all,
I use the atmega328p as master.
But I have some problem with I2C, it is working but not very well. I measure a temperature ussing a LM75A.
First I send all the settings to the slave that is going good, but after that it is ackting strange.
I send a start condition, than the adres of the slave with the metion that it has to send the data (only 1 byte).
This is also done and after that I repeat this cycle.
Than the strange things begin.
Sometimes it stops after the first time reading the temperature(it is the right value).
Sometimes it is running but the result is always the same even if the temperature is changed.
I think I do someting wrong with sending a NACK at the end, but I don't know what. Maybe one of you can help me?
The piece of the code that I included is the one that I use to read the temperature.