1

I am trying to bit bang SPI for a SD Card, I went through this SD Card datasheet and I couldn't find any information regarding the mode that needs to be used. If I missed, please point it out.

Else what mode would be standard if nothing is mentioned? What CPOL and phase should I use?

MaNyYaCk
  • 1,448
  • 1
  • 13
  • 28
  • 1
    Shouldn't you be able to pull out that information from 3.4.5, the bus timing figure? – Scott Seidman Oct 08 '18 at 13:05
  • What do you mean by Mode ? if it's line polarity (active high/low) it's on the figure Figure 3-6. – Damien Oct 08 '18 at 13:08
  • @ScottSeidman Kinda confusing because regarding the phase, sampling and transitioning takes place on edges, that is what I know but this image says that the data should be set up before the rising edge and should be changed after rising edge. That is what I conclude. – MaNyYaCk Oct 08 '18 at 13:18
  • @ScottSeidman Ok. Mode 2 is my guess? – MaNyYaCk Oct 08 '18 at 13:21
  • @Damien I believe that is regarding the voltage level. – MaNyYaCk Oct 08 '18 at 13:22

1 Answers1

5

From the datasheet you link to enter image description here

The timing diagram at 3.4.5 shows that the clock idles low (CPOL=0), and that out changes on the clock trailing edge and in gets read on the rising edge (CPHA=0), which is SPI mode 0.

Scott Seidman
  • 29,274
  • 4
  • 44
  • 109
  • 1
    Thanks, Honestly I absolutely missed this diagram and was searching in the text if it is mentioned somewhere. This was a nice lesson @ reading datasheet – MaNyYaCk Oct 08 '18 at 13:54