|
//---- Init SPI (pin SSEL in master mode should be log "1") ------
//-- SSEL = 15:14, MOSI = 12:13, MISO = 11:10, SCK = 9:8
rPCB_PINSEL0 |= (0x1<<14) | (0x1<<12) | (0x1<<10) | (0x1<<8);
rSPI_SPCCR = 32;
rSPI_SPCR = (1<<5); // | (1<<4) | (1<<3);
rSPI_SPDR = 0xAA; //-- Send
while(!(rSPI_SPSR & (1<<7))); //-- SPIF - bit7
rx_data1 = rSPI_SPDR; //-- Get what slave sended
E-mail: info@telesys.ru