Heppell wrote:
In my current design, I am sending data accross MOSI and then Enabling SPTIE, once the interupt fires I assume data has been sent and Disable SPTIE. I do this for every Transmit.
No. In master mode SPTIE interrupt fires when SPTEF is set. And SPTEF flag gets set not when transfer is complete, but when transmit buffer is ampty. SPTEF just tells you that you can buffer another byte to send. And SPIF is set when transfer is complete.
When I want to receive information I need to "clock" it, so I send dummy 8 bytes, and wait for received information which seems to set the SPIF flag and clear it before I read SPISR, or fire the interupt.
Hm. In master mode I always for transfer complete. And then, after transfer is complete (all 8 bits clocked), I expect new received data available in SPIDR.
You say you clear it (SPIF?) before you read SPISR. To clear SPIF you have to read SPISR, then read SPIDR.
Example:
EEPROM Read Operation:
1) Send Read Instruction, Enable SPTIE. (Interupt occurs after TX, disables SPTIE, goes to next operation)
No, in your case interrupt occurs during "TX", not after. You should enable not SPTIE, but SPIE. When SPIE interrupt fires you can go to 2).
2) Send Address, Enable SPTIE. (Interupt occurs after TX, disables SPTIE, goes to next operation)
SPIE.