Hi,
Ok, I am just doing my first SPI example on my ATmega328P with Amtel Studio 6.2 and I have run the debugging tool, but I can not get any value in the SPDR register. I have added a watch on "data", and single stepped through the program using the "IO view window" and the SPDR register never gets a value. Is this common when debugging none real time, or is this my fault. Below is the function sending the data, and also the SPI function.
thanks in advance.
Tuurbo46
spi_write(0x05); // Also tried spi_write('5'); // Both of these do not send a value to SPDR
void spi_write(byte data){ SPDR = data; // send the data while((SPSR & (1<<SPIF)) == 0); // wait until transmission is complete }