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,MIS,gnd1,gnd3,vcc,vcc_o);
input sck,MOSI,MISO,vcc,gnd1;
output sck_o,MOSI_o,MIS,vcc_o,gnd3;
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...
- 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.
- 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.
- 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.
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
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.