MMC card interface

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: MMC card interface

Postby SteveF » Wed Jan 20, 2016 11:54 pm

I hope this is the appropriate thread...

I had somehow managed to miss the possibility of this budget MMC card interface until hoglet's recent post about MMFS development and support; I think I didn't know what it was and/or assumed it was some expensive add-on. Anyway, my eyes have now been opened, so despite my limited construction skills I'm thinking about building one.

I have read the thread (honest!), but a lot of it is quite old. Could someone please point out a suitable ebay seller I can order the SD card adapter (and any other bits) off nowadays? I think I'd like one with the 3.3V/5V level shifters, but I'm not sure if this is necessary. I am inclined to put the SD card on the end of 30cm or so ribbon cable rather than build one of the micro-solutions that fit underneath the micro; I can imagine wanting to swap SD cards fairly often.

The other thing is - given the possible changes to MMFS over the next few days/weeks, is there any point holding off on constructing the hardware in case some small-but-desirable tweak is discovered? I'm a bit confused about how the TurboMMC hardware fits into this as well. I appreciate the hardware components are cheap enough it's not the end of the world to build one and then have to build a new and improved model later, but I thought I'd ask anyway!

Cheers.

Steve

User avatar
sweh
Posts: 1847
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: MMC card interface

Postby sweh » Thu Jan 21, 2016 2:53 am

TurboMMC is a custom board from Steve Picton. It's a totally 'out of the box' solution. He provides the board, the cables, the ROM, even sticky pads to let you mount it inside the case (I cut a hole in the back of my Beeb so it sticks out). It's not the cheapest solution, but it's the easiest. We found a bug in his ROM, but we have a patch if you can burn your own EPROM. It's possible he may incorporate the patch himself so newer purchases have the fixes (the bug only impacts OSword 7F calls via the Tube; that's why it's not been noticed before). Steve also provides additional utilitity ROMS (eg easy ways to image floppies onto the SD card), a tonne of documentation and other value adds. But it's not the cheapest solution. The software is also 'old' now, compare to Duikkie's stuff and so is limited in what SD cards can be used.

The cheapo boards are a LOT cheaper. 1 quid. You'll need to make your own cable. You'll need to burn your own EPROM. IMHO Duikkie's Smart SPI ROM is recommended, at present (it can handle many cards that the older code bases can't, have more images, work with different cabling etc etc), although MMFS is catching up fast :-) The changes are all software based, so if you build your own cheapo board then you probably(!) won't need to make any other hardware changes, but you may want a new EPROM. People here can help with EPROM programming if you can't do it yourself.

Ultimately I think the goal is for MMFS to support all current MMC variants, from Martin's original board through TurboMMC. TurboMMC has a buffer onboard which means it may always be most performant for writes (and it has the 'out of box' benefits) but you'll be happy with all variations... what Duikkie learned and what will be applied to MMFS means that you'll get good results out of any solution.

I bought TurboMMC when I resurrected my Beeb in 2012. If I was doing it today I might consider a cheapo board and Duikkie's software instead. But then I've learned a lot over the past 3 years :-)

ETA: this is just my personal opinion. I'm sure others have their own comments :-)
Rgds
Stephen

User avatar
DutchAcorn
Posts: 1631
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands

Re: MMC card interface

Postby DutchAcorn » Thu Jan 21, 2016 6:35 am

SteveF wrote:... Could someone please point out a suitable ebay seller I can order the SD card adapter (and any other bits) off nowadays? ...


There are quite a few sellers on eBay that have them one is here: http://m.ebay.co.uk/itm/Storage-Board-TF-Trans-flash-Card-Memory-Shield-Module-SPI-For-Arduino-GU-/351532338538

This has the level shifters, your SD cards will live longer with them.

I have not ordered any recently so I can't advise based on packing quality, shipping speed, etc. You could splash out and get two from different suppliers.


SteveF wrote:The other thing is - given the possible changes to MMFS over the next few days/weeks, is there any point holding off on constructing the hardware in case some small-but-desirable tweak is discovered?

One thing I can think of is using a different User Port data pair. That requires a different cable. For now it only seems relevant if you have Solidisk sideways ram fitted.
Paul

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: MMC card interface

Postby SteveF » Thu Jan 21, 2016 12:15 pm

Thanks guys, both your responses have been really helpful.

I've ordered the board suggested by DutchAcorn. If someone would care to suggest an alternate supplier I will splurge and buy one of those too.

I do currently have both working floppies on my Master and a PC capable of writing Acorn floppies, so I will dodge the EPROM question by loading the filing system into sideways RAM from disc for now. (But I'll probably be asking questions over in the EEPROM thread soon as well. :-) )

I understand IDC connectors at the user port end, but what sort of connector do I need to buy to connect to the pins on these SD card boards? And where's a good place to buy this sort of stuff? Maplin don't seem to sell IDC connectors any more. Farnell?

User avatar
danielj
Posts: 5337
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: MMC card interface

Postby danielj » Thu Jan 21, 2016 12:21 pm

CPC or Farnell - Farnell has free shipping on small orders at the moment. If you've got an RS trade counter near you, they're also worth checking.

for connecting to the board, you can either solder direct to it, or I've used these sorts of things: http://cpc.farnell.com/pro-signal/18689 ... dp/CN18765 (check number of pins!) then covered them in sugru or something. Frankly it's easier to use those than it is to try and crimp an IDC connector on the other end - it's very fiddly to get everything in the right place and it made me rather sweary :D

d.

User avatar
sydney
Posts: 1985
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

Re: MMC card interface

Postby sydney » Wed Jan 27, 2016 4:43 pm

I'm building an extra user port on my master and want to connect an sd card interface to it. My sd board has 2 rows of the following pins:

GND
3V3
5V
C3
MOSI
SCK
MISO
GND

Anyone want to tell me which pins from the 6522 connect to which pins on the sd board? I've read part way through the thread but came upon a reference to CB0 which isn't on a 6522 and lost hope a bit.

User avatar
hoglet
Posts: 6605
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: MMC card interface

Postby hoglet » Wed Jan 27, 2016 4:50 pm

sydney wrote:I'm building an extra user port on my master and want to connect an sd card interface to it. My sd board has 2 rows of the following pins:

GND
3V3
5V
C3
MOSI
SCK
MISO
GND

Anyone want to tell me which pins from the 6522 connect to which pins on the sd board? I've read part way through the thread but came upon a reference to CB0 which isn't on a 6522 and lost hope a bit.

Does the original diagram help?
http://swhs.home.xs4all.nl/bbc/mmbeeb/#mmchardware

If you have an adapter board with level shifers, you can ignore the resistors and just connect the signals directly:

Code: Select all

User Port     SD Card
 (Master)     (Slave)
=========     =======
  CB1/PB1 ==> SCK  (Clock)
      CB2 <== MISO (Dout)
      PB0 ==> MOSI (Din)
       0V ==> CS   (Select)

Plus of course power (to +5V) and ground (to GND).

Dave
Last edited by hoglet on Wed Jan 27, 2016 5:49 pm, edited 1 time in total.

User avatar
sydney
Posts: 1985
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

Re: MMC card interface

Postby sydney » Wed Jan 27, 2016 5:47 pm

Cheers Dave.
Forgive my typo C3 instead of CS - I think you knew what I meant though.
The original diagram didn't help as the sd card side had the markings for the sd card and not the adapter board I'm using. I'd read 2 or 3 different ways of wiring it up and just wanted some clarification - which your post has provided.
Thanks again.

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: MMC card interface

Postby SteveF » Sat Feb 13, 2016 9:16 pm

I can't believe it, I just finished wiring this up (following the diagram on page 10) and it worked first time. So thanks to everyone involved, it is amazingly cool to actually see it working and probably the best value for money hardware add-on I can imagine.

JonC
Posts: 624
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield

Re: MMC card interface

Postby JonC » Wed Mar 02, 2016 5:52 pm

hoglet wrote:
sydney wrote:I'm building an extra user port on my master and want to connect an sd card interface to it. My sd board has 2 rows of the following pins:

GND
3V3
5V
C3
MOSI
SCK
MISO
GND

Anyone want to tell me which pins from the 6522 connect to which pins on the sd board? I've read part way through the thread but came upon a reference to CB0 which isn't on a 6522 and lost hope a bit.

Does the original diagram help?
http://swhs.home.xs4all.nl/bbc/mmbeeb/#mmchardware

If you have an adapter board with level shifers, you can ignore the resistors and just connect the signals directly:

Code: Select all

User Port     SD Card
 (Master)     (Slave)
=========     =======
  CB1/PB1 ==> SCK  (Clock)
      CB2 <== MISO (Dout)
      PB0 ==> MOSI (Din)
       0V ==> CS   (Select)

Plus of course power (to +5V) and ground (to GND).

Dave



Ok, after much head scratching I'm on the verge of giving up. :cry:

I have wired up an Arduino based SD board using this (plus +5v and Ground) giving me 6 wires to the user port.
I've formatted the card to FAT16 (also tried FAT32) and placed the BEEB.MMB file on it.
I'm using Duikkies smartSPI in Slot 0 on one of DaveH's ARA II Cartridges.

Whatever command I issue I get the message 'Card?' can anyone tell me what I'm doing wrong? :oops:

Edit: Should probably add I'm using a master 128 which also has ANFS 4.25 on it in slot 8.
Jon
Image

duikkie
Posts: 2689
Joined: Fri Feb 07, 2014 3:28 pm

Re: MMC card interface

Postby duikkie » Wed Mar 02, 2016 6:03 pm

maybe take some pictures ?
and i don't know about the board you use ? what is the adress of the 6522 ??
maybe remove the anfs rom ?

JonC wrote:
hoglet wrote:
sydney wrote:I'm building an extra user port on my master and want to connect an sd card interface to it. My sd board has 2 rows of the following pins:

GND
3V3
5V
C3
MOSI
SCK
MISO
GND

Anyone want to tell me which pins from the 6522 connect to which pins on the sd board? I've read part way through the thread but came upon a reference to CB0 which isn't on a 6522 and lost hope a bit.

Does the original diagram help?
http://swhs.home.xs4all.nl/bbc/mmbeeb/#mmchardware

If you have an adapter board with level shifers, you can ignore the resistors and just connect the signals directly:

Code: Select all

User Port     SD Card
 (Master)     (Slave)
=========     =======
  CB1/PB1 ==> SCK  (Clock)
      CB2 <== MISO (Dout)
      PB0 ==> MOSI (Din)
       0V ==> CS   (Select)

Plus of course power (to +5V) and ground (to GND).

Dave



Ok, after much head scratching I'm on the verge of giving up. :cry:

I have wired up an Arduino based SD board using this (plus +5v and Ground) giving me 6 wires to the user port.
I've formatted the card to FAT16 (also tried FAT32) and placed the BEEB.MMB file on it.
I'm using Duikkies smartSPI in Slot 0 on one of DaveH's ARA II Cartridges.

Whatever command I issue I get the message 'Card?' can anyone tell me what I'm doing wrong? :oops:

Edit: Should probably add I'm using a master 128 which also has ANFS 4.25 on it in slot 8.

User avatar
CMcDougall
Posts: 5611
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland

Re: MMC card interface

Postby CMcDougall » Wed Mar 02, 2016 6:11 pm

Use the diagram on page10, it defo works!
Does not matter about M128 & Anfs4.25 rom as it worked on one of mine
Try SuperMMC or the new MMFS 1.21 they work also.
Also try other SD cards, mine all Sandisk 2/4gb
& try a joystick so you know 6522 chip is good
Last edited by CMcDougall on Wed Mar 02, 2016 6:13 pm, edited 1 time in total.
ImageImageImage

User avatar
hoglet
Posts: 6605
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: MMC card interface

Postby hoglet » Wed Mar 02, 2016 6:12 pm

Yes, as Duikkie says, please post a photo so we can see the connections.

A easy mistake to make is not connecting PB1 and CB1 together.

Dave

JonC
Posts: 624
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield

Re: MMC card interface

Postby JonC » Wed Mar 02, 2016 6:20 pm

hoglet wrote:Yes, as Duikkie says, please post a photo so we can see the connections.

A easy mistake to make is not connecting PB1 and CB1 together.

Dave


Yep missed that the first time round, however on both cables they are connected.

CMcDougall wrote:Use the diagram on page10, it defo works!
Does not matter about M128 & Anfs4.25 rom as it worked on one of mine
Try SuperMMC or the new MMFS 1.21 they work also.
Also try other SD cards, mine all Sandisk 2/4gb
& try a joystick so you know 6522 chip is good


I've checked againts the page 10 diagram and it looks correct.
I don't have the ability to burn the roms for SuperMMC and MMFS 1.21 - Not sure that will solve the issue as I'm sure SPI should work.
It's a 4gb Kingston SDHC card, seems to check out fine in windows.
I don't have a joystick to test the 6522 unfortunately, is there another way?

Photo's attached :)

Edit: I've also tried two other SD boards on the off chance they are faulty.
Attachments
20160302_181221.jpg
20160302_181244.jpg
20160302_181114.jpg
20160302_181704.jpg
20160302_181720.jpg
20160302_181732.jpg
20160302_181649.jpg
Jon
Image

User avatar
hoglet
Posts: 6605
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: MMC card interface

Postby hoglet » Wed Mar 02, 2016 6:48 pm

Jon,

Using your colours, the wiring should be:

Code: Select all

1 5V     Black    VCC
2 CB1    White    SCK
3 5V     <gap>
4 CB2    Grey     MISO
5 0V     Green    0V
6 PB0    Blue     MOSI
7 0v     Purple   CS
8 PB1    White    SCK (white wire looped back)

Looking at the last photo, I'm just wondering if the grey wire is correct, because you have split the cable between grey and green, where as I would expect it to split between white and grey.

Can you check the grey wire really does connect to pin 4 and not pin 3?

Do you have a multi meter to beep out all the connections?

Dave

JonC
Posts: 624
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield

Re: MMC card interface

Postby JonC » Wed Mar 02, 2016 7:00 pm

I think its just the play of the wires that makes it look that way.

I've ripped the connector apart and it looks ok to me.

Apologies for the poor photos my phone doesn't like doing close-ups!
Attachments
20160302_185650.jpg
20160302_185653.jpg
Jon
Image

User avatar
tricky
Posts: 1916
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: MMC card interface

Postby tricky » Wed Mar 02, 2016 7:02 pm

Have you checked the continuity between the actual IDC and the other end of the cable?
I have made quite a few of these and nearly every one has had a bad connection.
The pin where you have two wires connected would seem most likely to not be connected.
EDIT: The two posts above were added while I was typing.

JonC
Posts: 624
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield

Re: MMC card interface

Postby JonC » Wed Mar 02, 2016 7:09 pm

tricky wrote:Have you checked the continuity between the actual IDC and the other end of the cable?
I have made quite a few of these and nearly every one has had a bad connection.
The pin where you have two wires connected would seem most likely to not be connected.
EDIT: The two posts above were added while I was typing.


Regrettably my multimeter has yet to arrive, and I'd hoped to get something simple up and running while I had a bit of time. :lol: :oops:
It could well be continuity, although the cables seem well in on the IDC.

I've attached some better quality photos :)
Attachments
20160302_190431.jpg
20160302_190420.jpg
Jon
Image

duikkie
Posts: 2689
Joined: Fri Feb 07, 2014 3:28 pm

Re: MMC card interface

Postby duikkie » Wed Mar 02, 2016 7:10 pm

please check with multimeter ! and don't turn the connector around :) , is pin 1 realy pin 1 ? with multimeter check gnd sd card holder with computer gnd ( uhf connector or so)

duikkie
Posts: 2689
Joined: Fri Feb 07, 2014 3:28 pm

Re: MMC card interface

Postby duikkie » Wed Mar 02, 2016 7:13 pm

why not make the white wire longer ( not possible :)) make the other wires shorter , so that the white wire can make the loop to pin 8 #-o

duikkie
Posts: 2689
Joined: Fri Feb 07, 2014 3:28 pm

Re: MMC card interface

Postby duikkie » Wed Mar 02, 2016 7:16 pm

poorman's multimeter , use a battery and a led [-o< , the wire to check to burn the led :idea:

JonC
Posts: 624
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield

Re: MMC card interface

Postby JonC » Wed Mar 02, 2016 7:28 pm

Good tip on the loop wire, thanks.

Used a battery and bulb to test continuity, and all checks out...

Still no joy. :(
Jon
Image

User avatar
tricky
Posts: 1916
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: MMC card interface

Postby tricky » Wed Mar 02, 2016 8:44 pm

Check for shorts?

User avatar
DutchAcorn
Posts: 1631
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands

Re: MMC card interface

Postby DutchAcorn » Wed Mar 02, 2016 8:52 pm

JonC wrote:Good tip on the loop wire, thanks.

Used a battery and bulb to test continuity, and all checks out...

Still no joy. :(

Did you double check continuity between user port pins 2 and 8 (CB1 and PB1)? That's the most sensitive connection.
Paul

User avatar
CMcDougall
Posts: 5611
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland

Re: MMC card interface

Postby CMcDougall » Wed Mar 02, 2016 8:54 pm

JonC wrote:1)I don't have the ability to burn the roms for SuperMMC and MMFS 1.21 - Not sure that will solve the issue as I'm sure SPI should work.
2)It's a 4gb Kingston SDHC card, seems to check out fine in windows.
3)I don't have a joystick to test the 6522 unfortunately, is there another way?

1, just load it from disc to SWRAM banks 4,5,6 or 7 ((*SRLOAD r.rom 8000 7 Q) or can drop the Q)
2, those cards are crap, never worked for me either, so put it in a camera! try Sandisk /etc (not VodaCrap cards either)
3, does Upurs work /etc?
ImageImageImage

JonC
Posts: 624
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield

Re: MMC card interface

Postby JonC » Wed Mar 02, 2016 10:15 pm

The wiring all checks out ok, going to try a different SD card as suggested. Thanks all.
Jon
Image

nudelooney
Posts: 117
Joined: Tue Sep 23, 2003 8:41 pm
Contact:

Re: MMC card interface

Postby nudelooney » Thu Mar 03, 2016 4:44 pm

There's a BASIC program around that gives a bit of info of how the card identifies itself, reads the data on the card directly, and hex-dumps it to the screen. ISTR it has variables near the top for specifying base address of the 6522.

Might be worth using that rather than a ROM, just because it might give you slightly more debugging info. You'll need a way of getting that program onto your beeb, though. I use a serial link and a comms package to transfer it over.

Just a thought.

[Edit]
SSD of that program is here: https://swhs.home.xs4all.nl/bbc/mmbeeb/ ... 8-revX.ssd

JonC
Posts: 624
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield

Re: MMC card interface

Postby JonC » Sat Mar 05, 2016 10:38 pm

Ok, now well and truly flummoxed.
Wiring checks out, double checked with my new multimeter today.
User Port appears to be working (5.05v on pin 1 etc)
Found a sandisk 2gb card in my ebook reader so swapped it for the kingston.

Still getting the Card? error....

Think I will start again with brand new cable and IDC....


edit: nudelooney, I'll try that after I make a new cable up.
Jon
Image

User avatar
MartinB
Posts: 4555
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity

Re: MMC card interface

Postby MartinB » Sat Mar 05, 2016 11:45 pm

Jon wrote:User Port appears to be working (5.05v on pin 1 etc)

The presence of +5v on User Port Pins 1 and 3 doesn't validate the 6522, those lines are simply connected to the motherboard Vcc rail. To get confidence that the 6522 is working you really need to use a simple test program such as the quickie below. If you type this in and run it whilst monitoring the PBn pins with your DMM, you can at least see that the 6522 has basic functionaity. Either monitor directly on IC59 Pins 10-17 or on the User Port connector Pins 6, 8, 10, 12, 14, 16, 18, 20 and you should see the voltage on the given pins toggle between 0v and +5v at about 1Hz. There's a little more needed to check the CBn lines but seeing the port data bits toggling is a sure sign that the 6522 is ok.

Code: Select all

   10 REM * USER PORT 1HZ DATA TOGGLE *
   20 :
   30 ?&FE62=255:IO%=0
   40 REPEAT
   50  ?&FE60=IO%
   60  T%=TIME:REPEAT UNTIL T%=TIME-100
   70  IO%=IO% EOR 255
   80 UNTIL FALSE

duikkie
Posts: 2689
Joined: Fri Feb 07, 2014 3:28 pm

Re: MMC card interface

Postby duikkie » Sun Mar 06, 2016 6:59 am

maybe you can swap the 6522 with the keyboard 6522, if the keyboard still works then 6522 oke ?

not someone in the around there where you can check your sdcard experiment ?

MartinB wrote:
Jon wrote:User Port appears to be working (5.05v on pin 1 etc)

The presence of +5v on User Port Pins 1 and 3 doesn't validate the 6522, those lines are simply connected to the motherboard Vcc rail. To get confidence that the 6522 is working you really need to use a simple test program such as the quickie below. If you type this in and run it whilst monitoring the PBn pins with your DMM, you can at least see that the 6522 has basic functionaity. Either monitor directly on IC59 Pins 10-17 or on the User Port connector Pins 6, 8, 10, 12, 14, 16, 18, 20 and you should see the voltage on the given pins toggle between 0v and +5v at about 1Hz. There's a little more needed to check the CBn lines but seeing the port data bits toggling is a sure sign that the 6522 is ok.

Code: Select all

   10 REM * USER PORT 1HZ DATA TOGGLE *
   20 :
   30 ?&FE62=255:IO%=0
   40 REPEAT
   50  ?&FE60=IO%
   60  T%=TIME:REPEAT UNTIL T%=TIME-100
   70  IO%=IO% EOR 255
   80 UNTIL FALSE


Return to “hardware”

Who is online

Users browsing this forum: markdryan, northernbob and 7 guests