MicroSD Card Adapter for SC126 and others

398 views
Skip to first unread message

Radek Hnilica

unread,
May 15, 2020, 12:42:08 PM5/15/20
to retro-comp
Hello colleagues,

I remember from some thread, there is an issue with non-three state output of this adapter, effectively blocking usage of second adapter or any other SPI device connected on second port.
I can't find the thread now but I get some time, and try to look at the SD adapter in question.

First I note, the chip used the V125 (I assume  low voltage 74LVT125 or similar) is four three state gates.  So the potential is there.  Then I try to trace CS signal and MISO signals.  My finding is
- connector CS pin goes to R_1 (3k3) and then to pin 9 of V125 which is signal 3A.  I did not found any other trace of CS signal anywhere.
- connector MISO pin goes to pin 11 of V125 which is signal 4Y - so the output of fourth gate.  The !OE signal of that gate on pin 13 of 74LVC125 is grounded, thus the gate will never go to 3rd state.

I never went beyond this as my eyesight corresponds to my age and will not go better.  The chip on the adapter is very very small, and probing the pins is hard for me.
My original idea was, try to rewire the CS signal so MISO will go three state.  Now ...... it is not for my eyes and hands.

Did someone already have the schematics of this SD card adapter.

However next idea is to put and a piece of silicon in between the computer ports and adapters.
I search for 74HCT125 as it sounds right, and is in DIP.  or at least SO package.  I put this chip on my list so next round I'm ordering something I buy few of them.

NOTE: my motivation is not the storage.  There is enough of it on one card.  It is:
- two cards means one could be used for "transfer" of date between computers, or I can prepare working card for another computer.
- or maybe some interesting SPI device, I don't have an on my mind now, could be connected.





Alan Cox

unread,
May 15, 2020, 2:26:47 PM5/15/20
to retro-comp


On Friday, 15 May 2020 17:42:08 UTC+1, Radek Hnilica wrote:
Hello colleagues,

I remember from some thread, there is an issue with non-three state output of this adapter, effectively blocking usage of second adapter or any other SPI device connected on second port.
I can't find the thread now but I get some time, and try to look at the SD adapter in question.

There are two problems with the interface, one with the SC126 side, one with the SD card side.

Firstly not all SD cards (or indeed other SPI devices) necessarily tristate the MISO line when they are not selected, thus two will interfere and fight on the MISO line. SD cards are generally well behaved in this area other stuff less so. Eg the ethernet controller I have is not.

Secondly on power up the SC126 pulls both chip selects low so the chips fight one another. I built a little adapter for my SC126 that allows you to have 3 or 4 SPI devices and deals with these problems using a mux and demux.


I built a little PCB that plugs over the SC126 but it's only two chips so could easily be dead-bugged or strip boarded. For well behaved SD cards (ie most of them) you only need the 138 or a 139 or similar.

Alan

Greg Holdren

unread,
May 15, 2020, 2:33:00 PM5/15/20
to retro-comp
Radek,


Here is the schematic for the unit that Steve ships with the kit. I've attached the one for the SD adapter.

Yes, The ground connection for pin 13 needs to be removed. Unfortunately the ground trace can not be cut next to the pin because ground is also feed to pin 13's pad from the inside (under) part too. Pin 13 needs to be lifted and then connected to the CS pin of the SIP connector. 5V (pin 9) or 3.3V (pin 8) can be used as the part is 5V tolerant.

I believe that RomWBW needs more support for the second SD adapter that is not currently there. Steve's ROM doesn't use SPI at this time.

Greg
SD_SPI.jpg

Wayne Warthen

unread,
May 15, 2020, 2:43:21 PM5/15/20
to retro-comp
On Friday, May 15, 2020 at 11:33:00 AM UTC-7, Greg Holdren wrote:

I believe that RomWBW needs more support for the second SD adapter that is not currently there. Steve's ROM doesn't use SPI at this time. 

Actually, RomWBW fully supports both SPI positions of the SC126.  You just need to change the SDCNT config variable to 2 instead of 1.  I leave it at 1 for the pre-built ROMs because I can't assume someone has made the hardware mods required.

Thanks,

Wayne 

Greg Holdren

unread,
May 15, 2020, 3:40:46 PM5/15/20
to retro-comp
Wayne,

Is the second enable only for SD cards at this time or can it be used for other HW as it sits today? I think I saw some conversation about this awhile back about having an option for the second select to be decoupled from storage use. That would be a nice option.

I started to look in to the code awhile back and noticed that the second CS is being deactivated. Wasn't aware of the SDCNT (or don't remember). My plan is get a SPI to CAN chip running on the SC126 however the SPI like interface is operating a Mode 3 (if I remember) SPI like operation. (clk idle high, data on rising edge) I need Mode 0 or 1 so the Z180 CSIO is out.

I'm looking at modifying the SPI65 Xilinx HDL to work on the Intel/Zilog bus or just write a simpler dedicated Mode 0 SPI interface for my Xilinx RC2014 card. http://www.6502.org/users/andre/spi65b/index.html

Greg

Jim McGinnis

unread,
May 15, 2020, 4:05:21 PM5/15/20
to retro-comp
Just confirming what Wayne has stated about RomWBW - I am using the Adafruit uSD Card modules and I can connect two to the SC126 and they work swimmingly well.

Cheers

Jim

(If this is a repeat, I blame my phone!  Safari really doesn't handle the google groups well - at least my current version of iPhone iOS...)

Tadeusz Pycio

unread,
May 15, 2020, 4:37:35 PM5/15/20
to retro-comp

I'm looking at modifying the SPI65 Xilinx HDL to work on the Intel/Zilog bus or just write a simpler dedicated Mode 0 SPI interface for my Xilinx RC2014 card.


Hi Greg,

Check TP3465.

Chris Odorjan

unread,
May 15, 2020, 6:07:38 PM5/15/20
to retro-comp
On Friday, 15 May 2020 16:37:35 UTC-4, Tadeusz Pycio wrote:
Check TP3465.

I've got a board for RC2014 bus based upon one of these in the works right now, mostly because I have more SD than CF cards. :-)
(It's known to work for a single MicroSD card but I haven't tested any other SPI devices yet.)

I made the same discovery as the OP regarding the Catalex adapters always driving MISO (I have one and a Pololu adapter that work fine on their own, but together the Pololu one politely gets out of the way when deselected while the Catalex one rudely continues talking). As the chip select lines are set to inputs by the MID upon reset, I'm thinking I can add pull-ups to them and use a 74HCT125 to selectively drive MISO. This doesn't prevent multiple CS lines from being set at once, though. (I suppose I could take things to the extreme and demultiplex them for 16 separate card selects. Redundant Array of Inexpensive SD Cards? :-D )

--
Chris Odorjan

Nick Brok

unread,
May 16, 2020, 12:12:59 AM5/16/20
to retro...@googlegroups.com
Hi,

I had this problem too. I solved it with a 74HCT125 gate between MISO from SD-card to MISO on CPU. The CS of the specific SD-card is tied to the enable input of the 74HCT125 gate used for the same SD-card. My Scrumpel7d and 7C uses this principle. I can use two SD-cards and more SPI devices on the same bus.
At reset the CS lines are all zero, but these are directly initialized to one direct after reset.
The modification for the SC126 is easy to do.  Alan's modification does also the job.

To show  how I solved it, I publish the schematic diagram of my Scrumpel 7D.

Greetings,

Nick




scrumpel7d.pdf

Greg Holdren

unread,
May 16, 2020, 1:29:49 AM5/16/20
to retro-comp
Thanks for the heads up on this device. I'll check it out.  Are you aware of any RC2014 boards created for it?

Greg

David Richards

unread,
Sep 26, 2020, 5:21:30 PM9/26/20
to retro-comp
Hi everyone,
Using the information Greg posted here I have modified a couple of sd card adapters, this together with a small change to RomWbw to enable the second card has given me a system with two working sd card devices.
Lifting the pins on the chip was managed using a fine tipped iron and a small sewing needle to bend the chip leg.
I messed up on the first board but I found and fixed the short i created, the second one converted without problem. copying from one sd slice to another is working.
Thanks for the instructions, David.

On Friday, 15 May 2020 19:33:00 UTC+1, Greg Holdren wrote:

Here is the schematic for the unit that Steve ships with the kit. I've attached the one for the SD adapter.

Yes, The ground connection for pin 13 needs to be removed. Unfortunately the ground trace can not be cut next to the pin because ground is also feed to pin 13's pad from the inside (under) part too. Pin 13 needs to be lifted and then connected to the CS pin of the SIP connector. 5V (pin 9) or 3.3V (pin 8) can be used as the part is 5V tolerant.


IMG_20200926_215642-COLLAGE.jpg

Reply all
Reply to author
Forward
0 new messages