Microcontroller › AVR › SPI (serial peripheral interface) using AVR microcontroller (ATmega16) Missing Code2 › The code available seems to
March 2, 2014 at 5:23 pm #11162
The code available seems to be of the receiver (slave) microcontroller and as you said the transmitter code is missing. But they have given the steps of the programme for the transmitter also. Here it is
1. Set SS, MOSI and SCK pin as output pins.
2. Enable MSTR bit to make it master device.
3. Program SPR [1:0] bits to select SCK frequency.
4. Set SPE bit to enable SPI.
5. Copy data in SPDR register to send.
6. Wait until SPI interrupt flag get set.