There's another problem, I have modified the code adding timer0 because I had to put in output a waveform and when the master decides the waveform to send in output after some seconds the I2C stop wor ...
I think I found the errors, or so it seems. I added all the features you said in your posts but the things that made this work was changing the conditions in the slave with ...