MicroSD Card Adapter for SC126 and others

604 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

Mark Pruden

unread,
Feb 23, 2026, 10:10:40 PMFeb 23
to retro-comp
Old thread I know, but...

I recently came across what looks like an updated SD card module with identical pinout the the board we all know so well. Whats the chance this board solves the issue ?

https://www.aliexpress.com/item/32787679017.html

Richard Deane

unread,
Feb 24, 2026, 7:29:18 AMFeb 24
to Mark Pruden, retro-comp
Are you aware of this Alan Cox / Etched Pixels design to fix the dual SD problem on SC126?

Richard

--
You received this message because you are subscribed to the Google Groups "retro-comp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-comp+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/retro-comp/7f0d9a6f-f2fe-48bc-af1f-7d0972458e5fn%40googlegroups.com.

Greg Holdren

unread,
Feb 24, 2026, 10:45:02 PMFeb 24
to retro-comp

Mark,

The interface pinout appear to be the same with the Open-Smart micro-SD card, as shown in the link, most likely will function like the SC card adapter shipped the SC126 (and the like). The Open-Smart unit looks like the same design based on the parts on the board. Does it have the same issue as the one shipped with the SC126 MISO collision? Don't know. Need the schematic for it or get a unit and see if the /CS pin on the tri-state driver is tied to GND or not and do the mod if so as described in my first post of the thread.

It depends on how many devices you want to run on the SC126 SPI bus. If two then it would be easier to just mod the SD adapters otherwise use Alan's adapter board. 

Greg

Alan Cox

unread,
Feb 25, 2026, 3:52:23 AMFeb 25
to Greg Holdren, retro-comp
Modifying the adapters on the SC126 is insufficient. It will power up with both active and it can crash with both active.
The risk is pretty low but it can destroy an SD card if that happens enough. I killed a 16GB card that way.

If anyone needs one in the UK I ought to have a couple of spares in my bits drawer 

--
You received this message because you are subscribed to the Google Groups "retro-comp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-comp+...@googlegroups.com.

Mark Pruden

unread,
Feb 25, 2026, 7:36:57 PMFeb 25
to retro-comp
Hi. I came up with a different solution for 2 SD cards, was easier to solder than the other recommendation

https://groups.google.com/g/rc2014-z80/c/bBBkKsrYzZs/m/hrw55ln5AAAJ

However the reason I posted was to see If? the newer card "solved" the issue, and if it did would be a better card going forward.

Greg Holdren

unread,
Feb 25, 2026, 7:44:17 PMFeb 25
to retro-comp
Alan,

It is good to fix the MISO contention issue on these SD adapters for those who want to use it on the SC126 as well as other HW on the same SPI bus.

Yeah, I see the problem now with both of the SD /CS selection line being low and thus selected. The 74LS273 (U6) /CLR (pin 1) is asserted when a /reset happens. (poweron)  
This selects both /CS lines by /SD_CS1 and /SD_CS2/ being driven low for about 400 - 500ms until ROMWBW gets around to it.

I have not looked at the ROMWBW code but setting the '273 (pins 6 and 9) high early in the code execution probably would fix this instead of waiting 400-500ms.
Maybe Wayne could look at this and you (or I) test it.

Greg
Message has been deleted

Greg Holdren

unread,
Feb 25, 2026, 10:48:34 PMFeb 25
to retro-comp
Better power on measurement and reset to CS0 going high. Spends most of the time in reset.

5V -> SC_CS0 (high):                     330 ms
/reset (high) -> SD_CS0 (high):    1.54 ms

Greg

Wayne Warthen

unread,
Feb 26, 2026, 11:13:04 AMFeb 26
to retro-comp
On Wednesday, February 25, 2026 at 7:44:17 PM UTC-5 Greg Holdren wrote:
I have not looked at the ROMWBW code but setting the '273 (pins 6 and 9) high early in the code execution probably would fix this instead of waiting 400-500ms.
Maybe Wayne could look at this and you (or I) test it.

Hmmm... Those lines are supposed to be initialized by RomWBW almost immediately after reset.  Something is amiss.  I will look at it, but I am out of town for another week.  Not sure if I can figure this out remotely.

Thanks, Wayne

Wayne Warthen

unread,
Feb 26, 2026, 11:48:26 AMFeb 26
to retro-comp
On Wednesday, February 25, 2026 at 10:48:34 PM UTC-5 Greg Holdren wrote:
Better power on measurement and reset to CS0 going high. Spends most of the time in reset.

5V -> SC_CS0 (high):                     330 ms
/reset (high) -> SD_CS0 (high):    1.54 ms

OK, this makes sense.  Not much I can do about the reset time.  I could reduce the /reset -> SD_CS0 time if that would help, but is clearly dwarfed by the reset time.

Thanks, Wayne 

Greg Holdren

unread,
Feb 26, 2026, 12:19:44 PMFeb 26
to retro-comp
Wayne,

Thanks for looking at this. I had brain blockage in my fist assessment (4:44PM) of the problem above and forgot about the HW reset time in my comment.

I'm thinking on a HW fix for this*. One idea is to disconnect pin 1 from reset and pull up. Not sure what state the CS pins would be in but random I'm sure. Another is to add a GAL chip adapter for U6 '273 socket and drive the CS pins high when 5V comes up. This sounds like a more plausible solution. 

* Alan's fix is elegant/functional and less hacky but HW intensive.

Greg 

Mark T

unread,
Feb 26, 2026, 1:38:45 PMFeb 26
to retro-comp
Rather than hacking the SC126 it might be better to have a small pcb with Alan’s fix that plugs onto P2 and P3 of SC126.

Greg Holdren

unread,
Feb 26, 2026, 1:57:09 PMFeb 26
to retro-comp
Probably the way to go just trying to find a quick fix for the onboard connectors. Looks like I will add Alan's gerbers to the next JLCPCB order. ;)

Greg
Reply all
Reply to author
Forward
0 new messages