# How to set SD card clock frequency between 100 kHz - 400 kHz

I am interfacing a 32 GB microSD card with PIC32MX795F512L. I am following the examples provided in Lucio de Jasio's book.

As the author has described that to set a 250 kHz, they are driving their peripheral clock frequency by 144. Which means 36 MHz when divided by 144 gives 250 kHz. But then why are they setting the SPI1BRG = 71;? (SPI1BRG = SPI baudrate register.)

I am using 44 MHz as a peripheral clock frequency. What value should I use?

I am really confused in setting the clock frequency for the SD card.

• Thanks I got. I am using 44MHZ that means dividing it by 176 will give 250KHZ. So the value I have to put in register is 87 (87+1)*2=176 Is this correct.? – user007 Dec 22 '15 at 10:08
• Where did you find this equation divider = (BRG register value + 1)*2 – user007 Dec 22 '15 at 10:13