Code is attached
Original Attachment has been moved to: SPI.c.zip
Original Attachment has been moved to: main.c.zip
Hi,
The initialization of SPI0 module pins and clock seems right. One problem can with the comparison in register_write()
if(SPI0_S == 0x20)
Instead of this comparison, try:
if((SPI0_S & 0x20) == 0x20)
(Because other bits in SPI0_S like SPRF, SPMF can also be 1. Then SPI0_S may not be 0x20 always)
Good luck
Thanks Vishakhan C. SPI0 working fine now!!!!
Good to know it helped you!