Juan Manuel Morales Acevedo

Loss of data between two MC9S08GT16A via SPI

Discussion created by Juan Manuel Morales Acevedo on Nov 10, 2007
Latest reply on Nov 27, 2007 by bigmac
Hi, I'm trying to communicate two HCS08GT16A through the SPI protocol.
This is the intended behavior of the system:
-Master sends a byte to slave and turns on a LED. It waits for confirmation from slave to send second byte.
-Slave turns on a LED when it receives THE byte Master sent. It then sends a byte of ACKnowledge to Master and waits for a second byte.
-Master then sends second byte, turns on LED and waits for second ACK from Slave.
-Slave receives second byte, turns on LED, sends ACK and waits for third byte.
-The process goes on forever...

I've accomplished bidirectional communication and the codes for both Master and Slave work just fine. The problem I have is that when it sends the 16th byte, the whole thing freezes for a while and then it starts again. I've tried different ways but always happens on the 16th byte.

Does anybody know the reason of this?

Outcomes