I'm new to this site and this is my first post. I have started a SD card project where I want to interface the SD card with my MCU. I am using a PIC18F8520 MCU. Well before I started working with the SD, I worked on the DAC module successfully (I mentioned this because DAC uses SPI communication as well). The code for the SD card works until I reach the the command to check if the SPI transmit bit has been set (to check if transmit is complete) and it forms an infinite loop there. Now even the DAC module (with the same working code and set up) is not working. Is it possible to have a faulty SPI module. If possible can someone please send me a code in C? I'm as of now formatting the SD in FAT32 format in my desktop before trying to read it. I'm not sure if I'v given sufficient information, didn't exactly know what details to post. Thanks in advance.