I have two Atmega168's in my system and I want to transfer data between them both ways. I am using an SPI master on one sending commands and data to the other (SPI slave). I cannot get the SPI slave to work right. I have tried both interrupt driven and polling methods in the Slave, but can't get the state machine to work right.
I've even tried using the AVRJTAGICE MKII in DebugWire mode, but it doesn't seem to make sense either. In any case the IPC has to work in real time and as soon as you try to debug it, things go haywire.
Has anyone ever successfully achieved IPC using SPI?
I am sucessfully using the SPI master to also talk to an external FLASH memory chip and an SPI DAC.