Hello!
The question comes recurrently.
However, if I can figure out what you call send_byte and read_byte, I cannot know
if which direction your acknowledge travels. Just in case, if you send one byte, the
acknowledge should (of course!!!) come from the receiving device. So instead
of acknowledge, it might be better to call this function read_acknowledge();
Anyway, as you use acknowledge after read and after write, one is obviously wrong
in your code. What does the word "acknowledge" mean for you? Not in electronics,
but in plain english. Try with a dictionary. Now the meaning is the same in our case.
It means "I got it!". So if you send something to sombody, you don't tell him "got it!",
he will tell you.
You should wait for acknowledge after a write operation and send an acknowledge
after a read operation.
Dora.