Hi harshad gami,
1. Did you check the communicate SPI wave? Whether the slave return the correct data? You can use the oscilloscope check the SPI wave.
2. check the SPI clock, whether it is in the range of your EEPROM.
3. Use bit SPI_SR[RFDF] to wait the received data, eg
uint8 temp;
while(!(SPI0_SR & SPI_SR_RFDF_MASK)){}
temp= SPI0_POPR;
SPI0_SR |= SPI_SR_RFDF_MASK;
return temp;
Wish it helps you!
If you still have question, please let me know!
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------