Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SD card, SD sniffers connected to FPGA

Status
Not open for further replies.

mnipsy

Newbie level 4
Joined
Jun 25, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,342
Hi Everyone,

I have one SD card, two SD Sniffers and an Actel Dev board. (Click for their products information)

What I wanna do is like this: insert one SD sniffer without a SD card into my computer, connect it to the FPGA board as input, then connect another SD sniffer with SD card to the FPGA board as output. The FPGA board will do nothing but work as a buffer. I expect that my computer could detect the SD card through above connection, however it doesn't work.

Below is my Verilog code:
module aa(sck,sck_o,MOSI,MOSI_o,MISO,MISo_O,gnd1,gnd3,vcc,vcc_o);
input sck,MOSI,MISO,vcc,gnd1;
output sck_o,MOSI_o,MISo_O,vcc_o,gnd3;

buf b1(sck_o,sck);
buf b2(MOSI_o,MOSI);
buf b3(MISo_O,MISO);
buf b4(gnd3,gnd1);
buf b5(vcc_o,vcc);

endmodule


I assign all the I/O to GPIO ports in the Dev board.

Could someone give me some suggestions why it doesn't work? I'm wondering whether I should assign ground=0 or something? And for the Vcc, should I provide specific voltage for it? At first, I thought since the input SD sniffer is connected to computer, it should provide the voltage it need itself.

Thanks in advance!

- - - Updated - - -

I will appreciate any advise plz! It has been troubling me for almost 2 weeks...
I just couldn't find the problem...and none around me can help me... :(
 

This won't work.

- You can only buffer undidirectional logic signals, not power supply lines (GND or VCC) which need to be connected by wires directly.
- Your computer is most likely using the regular SD card rather than SPI mode. If so, additional lines have to be connected. The signals are biddirectional and can't be easily buffered without decoding the protocol.
- Even if the computer would use SPI mode, your interface is missing the CS line.
 
  • Like
Reactions: mnipsy

    mnipsy

    Points: 2
    Helpful Answer Positive Rating
Thanks!

- I'll try to connect Vcc and GND directly between two SD sniffiers.

- How can I tell which mode my computer uses? Ingnoring the FPGA, I once connected two SD sniffers together directly, i.e, computer<----SD sniffier(no sd card)<-----SD sniffer ( with SD card). And I found that only 5 lines are needed; they are CMD(MOSI), GND, VDD, CLK, DAT0(MISO). There are two GND lines on the SD sniffer, but once one of them is connected, my computer can detect the SD card. That's the reason why I only buffer one GND line and don't include CS line.

This won't work.

- You can only buffer undidirectional logic signals, not power supply lines (GND or VCC) which need to be connected by wires directly.
- Your computer is most likely using the regular SD card rather than SPI mode. If so, additional lines have to be connected. The signals are biddirectional and can't be easily buffered without decoding the protocol.
- Even if the computer would use SPI mode, your interface is missing the CS line.
 

If the computer can work with the said 5 lines, it's using single data line SD card mode. In this case, DAT0 and CMD need to be bidirectional.
 

So how can I let my computer choose SPI mode so I can buffer DAT0 and CMD line?

If the computer can work with the said 5 lines, it's using single data line SD card mode. In this case, DAT0 and CMD need to be bidirectional.
 

SPI mode is mostly used by simple software SD card interfaces without dedicated interface controller. To keep up with the available SD card speed, computers or cameras are using SD interface mode with all 4 DATx lines. Single DAT line operation is apparently supported for downwards compatibility.

I don't think that SPI mode will be supported by any computer
 

New problem occurs.

DAT0 and CMD are bidirectional. Then how about the clock line and CS line? Can I just buffer these two lines through FPGA?
I tried to just buffer clock and CS line; it turned out that the computer could detect SD card, but it always ask to format the SD card.
I'm wondering why.

P.S. When I connect all the other lines of two SD sniffers directly except disconnecting the SS line, my computer also asks me to format the SD card.

If the computer can work with the said 5 lines, it's using single data line SD card mode. In this case, DAT0 and CMD need to be bidirectional.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top