EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: JacquesBBB on December 24, 2015, 09:22:47 am
-
I want to use two SD cards on a SPI bus, with two different CS pins, but want the two SD cards to be really isolated
from the SPI bus when they are not active ( I toggle from one to the other for continuous recording),
so I can remove the non active one without any trouble.
Indeed, in a first setting, I relied only on the CS pin, and there was some unwanted behaviour.
I see two solutions for doing that, for switching the MOSI, MISO, SCK lines :
- One is to use 74HC244 3-state output buffer with a digital connection.
- The other is to use simply a 74HC4053 analog switch to toggle the 3 lines from SD1 to SD2.
Which one do you recommend ? Everything is in 3.3V so I do not have level problems, and the SCK frequency is 21 Mhz
( on an arduino DUE).
Thanks
-
I'd go for the Tristate buffers. The analog switch could have issues with a 21MHz SCLK if there are more than a few tens of pF capacitance on the card side of it.
-
I have tried with the 74HC244 3-state buffer, but it was not able to follow the 21 Mhz SCK frequency. It works with half frequency, at 10.5 Mhz.
My setting is not final, but experimental, but with all connections soldered.
I will try tomorrow with the analog switch. I could also try the 74LVC244 when I receive it.
-
Here's a table of minimum rise/fall times for each logic family. The HC series is one of the slowest.
-
.... and far worse with low Vdd.
Sorry I should have spotted that HC logic was going to be too slow. I was concerned that the RC time constant of the switch on resistance with stray capacitance round the SD card socket would cause excessive skew of the clock edges with respect to the card's data out.
-
Here's a table of minimum rise/fall times for each logic family. The HC series is one of the slowest.
The table is referred as minimum requirement for the input.
(Stability for oscillation).
It has nothing to do with switching speed.
A 74HC(T) has rise/fall times of around 5ns @5V at the output.
Ok propagation delay is around 5 times more.
So you should watch mainly for the propagation delay times in this application.
With best regards
Andreas
-
IN fact I made an error the other night.
The frequency of the DUE is 84 Mhz. So the nominal SPI speed is 42 Mhz. With a direct link, even with a 15 cm ribbon cable,
the sd card is happy with this.
Now, with indirect connection,
with the 74HC244 3-state output buffer I reach only 21 Mhz whatever I do. I may try 74LVC when I get it.
with the 74HC4053 analog switch, it seems that I can get 42 Mhz in a steady way, but if I hook the scope to watch the clock signal,
it falls to 21 Mhz ( On error, the software adjust to lower speed).
At this speed, I have a clean SCK signal : 1: original SCK ; 2 : after the 74HC244. probe with ground hook.
(https://www.eevblog.com/forum/projects/spi-switch-74hc244-3-state-output-buffer-or-74hc4053-analog-switch/?action=dlattach;attach=189492)
-
The probe capacitance adds a load on the driver. It now has to charge and discharge not only the downstream gate but also the probe.
-
What is then the way to look to the signal ?
-
What is then the way to look to the signal ?
With a proper low impedance probe.
You can make your own. You need a piece of 50 Ohm co-axial cable and a BNC connector. On the end, connected to your circuit, you need a 450R resistor (180R & 270R in series, if you can't get one) connected in series with the centre conductor and (since the Rigol DS1054Z doesn't have a 50Ohm input impedance option) you need a 50R resistor connected from the centre conductor to the screen, as near to the oscilloscope's input connector as possible.
The probe will have a total input impedance of 500R which may seem low compared to the usual high impedance x10 probe with an input impedance of 10M, but a high impedance probe also has 10pF or more in parallel, which will reduce the impedance at high frequencies. The 500R probe will start to have a lower impedance than the 10M probe at frequencies above around 30MHz.