SPI switch : 74HC244 3-state output buffer  OR  74HC4053 analog switch ? - Page 1
Forum section: electronics / projects

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: December 24, 2015, 09:22:47 am
content: 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 isolatedfrom 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

author: Ian.M
author_rank: Super Contributor
timestamp: December 24, 2015, 11:08:17 am
content: 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.

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: December 24, 2015, 10:27:18 pm
content: 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.

author: MarkF
author_rank: Super Contributor
timestamp: December 25, 2015, 12:18:34 am
content: Here's a table of minimum rise/fall times for each logic family. The HC series is one of the slowest.

author: Ian.M
author_rank: Super Contributor
timestamp: December 25, 2015, 12:54:41 am
content: .... 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.

author: Andreas
author_rank: Super Contributor
timestamp: December 25, 2015, 07:55:44 am
content: Quote from: MarkF on December 25, 2015, 12:18:34 amThe 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 regardsAndreas

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: December 25, 2015, 03:40:51 pm
content: 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.

author: bson
author_rank: Unknown
timestamp: December 25, 2015, 05:00:33 pm
content: 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.

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: December 25, 2015, 06:42:32 pm
content: What is then the way to look to the signal ?

author: Zero999
author_rank: Super Contributor
timestamp: December 26, 2015, 10:20:17 am
content: Quote from: JacquesBBB on December 25, 2015, 06:42:32 pmWith 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.