Synchronized SPI communication

Sep 24, 2007 0 Replies

I am trying to implement interrupt based SPI communication between two Atmel microcontrollers. The data has to be transmitted from slave to master.



In master i continuously sends 0xff to the slave and master expects data from slave on each transfer.



char SPI_MasterTransfer(char cData) { uint8_t a; PORTB &= ~(_BV(PB4)); // Slave select a = SPDR; SPDR = cData; while(!(SPSR & (1


Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required