Simple Electon MMC Interface
- sixxdog_uk
- Posts: 284
- Joined: Mon Feb 29, 2016 11:06 am
- Contact:
Re: Simple Electon MMC Interface
Nice Work. Very Nice.
- CMcDougall
- Posts: 7048
- Joined: Wed Feb 02, 2005 3:13 pm
- Location: Shadow in a Valley of Scotland
- Contact:
Re: Simple Electon MMC Interface
Evening Dave,hoglet wrote:Which flavour MMFS were you using, and how/where was it installed?
it does not matter if in slot 0/1 or 2/3
when I do a *. / *MMFS / *DIN 0 it just moves down a few lines then >_
sometimes get GETFORNEXTbla bla ,but not as often as the above.
setup as per pic, no plus3 (back in loft where it can rot )
using the new E/EMMFS1.30 from a few post up with SAVE fix you found.
- CMcDougall
- Posts: 7048
- Joined: Wed Feb 02, 2005 3:13 pm
- Location: Shadow in a Valley of Scotland
- Contact:
Re: Simple Electon MMC Interface
just had another go with ATI/ABR & same thing...
But, when MMFS rom image is not on the ATI/ABR, it works perfectly fine
ie I always have Hopper & Snapper images loaded onto it, & it's happy , even when in slot 01 or 23
done a speed test with Save /Load, saving is faster
But, when MMFS rom image is not on the ATI/ABR, it works perfectly fine
ie I always have Hopper & Snapper images loaded onto it, & it's happy , even when in slot 01 or 23
done a speed test with Save /Load, saving is faster
Re: Simple Electon MMC Interface
No idea what's going on here.CMcDougall wrote:just had another go with ATI/ABR & same thing...
But, when MMFS rom image is not on the ATI/ABR, it works perfectly fine
ie I always have Hopper & Snapper images loaded onto it, & it's happy , even when in slot 01 or 23
Can you try write protecting the ATI/ABR?
That very interesting. How much faster?CMcDougall wrote: done a speed test with Save /Load, saving is faster
The User Port code to write a bit is:
Code: Select all
2 ROL A
2 AND #&FD
6 STA iorb% ;; VIA &FE62
2 ORA #2
6 STA iorb%
Code: Select all
2 ROL A
2 AND #&FD
4 STA data% ;; Printer Port &FC71
2 ORA #2
4 STA data%
This would save 16us/byte, so a 20KB file would be ~330ms faster.
TurboMMC would be faster though (:ducks)
Dave
- daveejhitchins
- Posts: 7888
- Joined: Wed Jun 13, 2012 6:23 pm
- Location: Newton Aycliffe, County Durham
- Contact:
Re: Simple Electon MMC Interface
Dave, I'll get the latest schematics posted so soon as I get home.
Dave H
Dave H
Available: ARA II : ARA III-JR/PR : ABR : AP5 : AP6 : ABE : ATI : MGC : Plus 1 Support ROM : Plus 3 2nd DA : Prime's Plus 3 ROM/RAM : Pegasus 400 : Prime's MRB : ARCIN32 : Cross-32
- CMcDougall
- Posts: 7048
- Joined: Wed Feb 02, 2005 3:13 pm
- Location: Shadow in a Valley of Scotland
- Contact:
Re: Simple Electon MMC Interface
With *SA. dummy 1900 8000 & using T=TIME , time-T, load =465 & save =312
the AT I/ABR was always write protected....
the AT I/ABR was always write protected....
- CMcDougall
- Posts: 7048
- Joined: Wed Feb 02, 2005 3:13 pm
- Location: Shadow in a Valley of Scotland
- Contact:
Re: Simple Electon MMC Interface
here is all the elk MMB .SSDs I have made on my card:
they all each have a !BOOT &/or a menu for the game/s on each disc.
not all work, unless you are using the ESWMMFS which leaves page@E00
If you have ADT rom in another cart/socket, then most do work with *MRUN mainbit
they all each have a !BOOT &/or a menu for the game/s on each disc.
not all work, unless you are using the ESWMMFS which leaves page@E00
If you have ADT rom in another cart/socket, then most do work with *MRUN mainbit
- Attachments
-
- elkMMB.zip
- elk MMB file
- (1.48 MiB) Downloaded 131 times
Re: Simple Electon MMC Interface
Are you back home yet Dave?daveejhitchins wrote:Dave, I'll get the latest schematics posted so soon as I get home.
- daveejhitchins
- Posts: 7888
- Joined: Wed Jun 13, 2012 6:23 pm
- Location: Newton Aycliffe, County Durham
- Contact:
Re: Simple Electon MMC Interface
Yup! Back home . . .
Dave H
And working on getting the schematics out
Dave H
And working on getting the schematics out
Available: ARA II : ARA III-JR/PR : ABR : AP5 : AP6 : ABE : ATI : MGC : Plus 1 Support ROM : Plus 3 2nd DA : Prime's Plus 3 ROM/RAM : Pegasus 400 : Prime's MRB : ARCIN32 : Cross-32
- daveejhitchins
- Posts: 7888
- Joined: Wed Jun 13, 2012 6:23 pm
- Location: Newton Aycliffe, County Durham
- Contact:
Re: Simple Electon MMC Interface
Schematics updated - and can be found on the first page of the following threads:
I've also added the abbreviations e.g. ABR, to make searching easier.
ATI - here.
ARA MkII - here.
ABR - here.
AP6 - here.
MGC - here.
Dave H
I've also added the abbreviations e.g. ABR, to make searching easier.
ATI - here.
ARA MkII - here.
ABR - here.
AP6 - here.
MGC - here.
Dave H
Available: ARA II : ARA III-JR/PR : ABR : AP5 : AP6 : ABE : ATI : MGC : Plus 1 Support ROM : Plus 3 2nd DA : Prime's Plus 3 ROM/RAM : Pegasus 400 : Prime's MRB : ARCIN32 : Cross-32
- Elk Towers
- Posts: 527
- Joined: Sun Apr 23, 2006 3:10 am
- Location: Kettering, Northants
- Contact:
Re: Simple Electon MMC Interface
could someone give me a link to the sd interface please.
Nick
elk with mrb, mode 7 adaptor mk1, plus 3, plus 1, AP6, AP5,Econet,WIfi, AP34, E2P, RGB2HDMI
elk with mrb, mode 7 adaptor mk1, plus 3, plus 1, AP6, AP5,Econet,WIfi, AP34, E2P, RGB2HDMI
Re: Simple Electon MMC Interface
What about this link: http://www.stardot.org.uk/forums/viewto ... =8&t=12689
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN
MAN WOMAN
- Elk Towers
- Posts: 527
- Joined: Sun Apr 23, 2006 3:10 am
- Location: Kettering, Northants
- Contact:
Re: Simple Electon MMC Interface
I was actually after a 99p like the one Dave showed in the first post but thanks anyway.
Nick
elk with mrb, mode 7 adaptor mk1, plus 3, plus 1, AP6, AP5,Econet,WIfi, AP34, E2P, RGB2HDMI
elk with mrb, mode 7 adaptor mk1, plus 3, plus 1, AP6, AP5,Econet,WIfi, AP34, E2P, RGB2HDMI
- CMcDougall
- Posts: 7048
- Joined: Wed Feb 02, 2005 3:13 pm
- Location: Shadow in a Valley of Scotland
- Contact:
Re: Simple Electon MMC Interface
99p, rip off!Elk Towers wrote:I was actually after a 99p
buy them for about 33p each, and free post from China, about a 2-3 weeks to come, just search about on eBay
http://www.ebay.co.uk/sch/i.html?_from= ... e&_sacat=0
Arduino SD Card interface
don't you read this forum, it's 3 years old these things!
Re: Simple Electon MMC Interface
I made the printer port modification on a Plus1 and with the multi-coloured cable got it running fine.
This is OK for a permanent setup but not easy to move to another machine - having to write down/memorise the connections.
So having some unused printer cables I have made a printer to MMC card cable.
Ray
This is OK for a permanent setup but not easy to move to another machine - having to write down/memorise the connections.
So having some unused printer cables I have made a printer to MMC card cable.
Ray
Raycomp
Re: Simple Electon MMC Interface
I just got this to work using a hacked-up Elk PiTubeDirect cartridge with an SD socket taped to the top and jumper wires everywhere, attached to the Minus One -- VHDL and details here
Next step: implement the memory-mapped SD interface!
Next step: implement the memory-mapped SD interface!
SW/EE from New Zealand, now in Mountain View, CA, making Beeb/Elk/Arc hardware projects for fun.
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Re: Simple Electon MMC Interface
Nice work!
I look forward to the next instalment.
Dave
I look forward to the next instalment.
Dave
Re: Simple Electon MMC Interface
Thanks! Here's as far as I managed to get it last night. Seen this error before? I suspect that SCK is out of spec (SD cards need 100-400 kHz during initialization, and I'm using 1/2 PHI0, so either 500 kHz or 1 MHz, depending what's going on in the background). I also realized that I'm supposed to have a pull-up resistor on MISO, although the ElkPlus1 code worked fine without one, so I guess that's not a hard requirement.hoglet wrote:Nice work!
I look forward to the next instalment.
SW/EE from New Zealand, now in Mountain View, CA, making Beeb/Elk/Arc hardware projects for fun.
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Re: Simple Electon MMC Interface
The command that's failing is GET_CID (read's the card identifier).myelin wrote: Seen this error before?
That's a fair way through the initialization.
This card definitely works with the "Elk printer port" interface?
Can you post a link to your HDL for the MM interface?
Re: Simple Electon MMC Interface
Yes, it definitely works with the ElkPlus1 interface (build/E/EMMFS.rom and build/E/EMMFSDB.rom); with a BEEB.MMB file found somewhere else on here, Shift-BREAK does nothing, but CHAIN "MENU" brings up the menu, and I can load Arcadians and Elite just fine.hoglet wrote:The command that's failing is GET_CID (read's the card identifier).
That's a fair way through the initialization.
This card definitely works with the "Elk printer port" interface?
Can you post a link to your HDL for the MM interface?
I've pushed the latest HDL up to the GitHub repo -- thanks for taking a look!
One other thing -- I added a bunch more JSR donothing calls into MMC_MemoryMapped.asm, because it was expecting each byte transfer to finish in 12 clock cycles, and my HDL takes 16-17 because it divides PHI0 in half (toggling SCK on the falling edge of PHI0).
SW/EE from New Zealand, now in Mountain View, CA, making Beeb/Elk/Arc hardware projects for fun.
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Re: Simple Electon MMC Interface
I've a vague idea why it might be breaking at READ_CIDmyelin wrote: I've pushed the latest HDL up to the GitHub repo -- thanks for taking a look!
That's the first command that returns a data block following the response, so the response timing might be different.
The protocol is the same as "Single Block Read" here.
http://elm-chan.org/docs/mmc/mmc_e.html
What's interesting is that the command response is shown as FF:
0xFF4A00000000FF : FF
Which generally means the card has not responded, and MMFS has waited long enough.
I wonder if you are just not waiting long enough?
The timeout occurs in MMC_DoCommand, where Y manages to decrement to zero:
https://github.com/hoglet67/MMFS/blob/m ... ed.asm#L63
Do you get any further if you remove that DEY?
The other thought I had is that the memory mapped SPI driver works 8-bits at a time. What happens if the first bit of the command response (D7, always a zero) is not on the correct 8-bit boundary? I don't know if that can happen or not, but the other drivers deal with this by working 1-bit at a time when waiting for the response:
https://github.com/hoglet67/MMFS/blob/m ... s1.asm#L58
I don't think you are hitting this second issue yet. As an 0xFF is definitely a timeout. But remember, to my knowledge, this driver has never been used on read hardware (only in BeebEm)!
Dave
Re: Simple Electon MMC Interface
It it just me, or is that code repeatedly reading mmc% without pushing &FF to it to trigger a new transfer each time? Looks like maybe the STA mmc% needs to move below .wR1mm (and have an LDA #&FF added), if the intention of this code is to poll the card until it returns something without bit 7 set.hoglet wrote:I wonder if you are just not waiting long enough?
The timeout occurs in MMC_DoCommand, where Y manages to decrement to zero:
https://github.com/hoglet67/MMFS/blob/m ... ed.asm#L63
SW/EE from New Zealand, now in Mountain View, CA, making Beeb/Elk/Arc hardware projects for fun.
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Re: Simple Electon MMC Interface
Agreed.myelin wrote: It it just me, or is that code repeatedly reading mmc% without pushing &FF to it to trigger a new transfer each time? Looks like maybe the STA mmc% needs to move below .wR1mm (and have an LDA #&FF added), if the intention of this code is to poll the card until it returns something without bit 7 set.
I assume this works in BeebEm because it replies instantly.
Try changing it and see if that helps.
Re: Simple Electon MMC Interface
Perfect; will give that a go when I get home.hoglet wrote:Try changing it and see if that helps.
Re the other issue, it looks like the Arduino Sd2Card library, which also uses 8-bit SPI for everything, just looks at bit 7 of the response byte when waiting, so I guess that's okay.
SW/EE from New Zealand, now in Mountain View, CA, making Beeb/Elk/Arc hardware projects for fun.
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Re: Simple Electon MMC Interface
OK! That got it a bit further. It can now get as far as mostly loading a BASIC file from a disk image, although it looks like it must have truncated the file. Continuing to debug
Update: The memory-mapped interface kept being flaky, so I tried converting the code in MMC_ElkPlus1.asm bit by bit. I've now got *that* code working using the memory-mapped interface, and it seems fairly reliable. It fails randomly when the SPI clock is PHI0/2, but seems okay with PHI0/4, and is still a bit quicker than the parallel port version (it loads Codename: Droid in ~8.5s, and the parallel port code takes about 21s). There seem to be some odd timing issues, and if the card loses sync, it needs a power cycle to recover, but it feels like it's mostly there.
Is there an MMFS test suite / stress test of some kind that I can run to smoke out any more bugs?
Update: The memory-mapped interface kept being flaky, so I tried converting the code in MMC_ElkPlus1.asm bit by bit. I've now got *that* code working using the memory-mapped interface, and it seems fairly reliable. It fails randomly when the SPI clock is PHI0/2, but seems okay with PHI0/4, and is still a bit quicker than the parallel port version (it loads Codename: Droid in ~8.5s, and the parallel port code takes about 21s). There seem to be some odd timing issues, and if the card loses sync, it needs a power cycle to recover, but it feels like it's mostly there.
Is there an MMFS test suite / stress test of some kind that I can run to smoke out any more bugs?
SW/EE from New Zealand, now in Mountain View, CA, making Beeb/Elk/Arc hardware projects for fun.
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
Most interesting: Arcflash, POST Box, Ultimate Electron Upgrade
- daveejhitchins
- Posts: 7888
- Joined: Wed Jun 13, 2012 6:23 pm
- Location: Newton Aycliffe, County Durham
- Contact:
Re: Simple Electon MMC Interface
To the "press Space to Start" screen, MGC does it in 3smyelin wrote:(it loads Codename: Droid in ~8.5s, and the parallel port code takes about 21s).
Dave H
Available: ARA II : ARA III-JR/PR : ABR : AP5 : AP6 : ABE : ATI : MGC : Plus 1 Support ROM : Plus 3 2nd DA : Prime's Plus 3 ROM/RAM : Pegasus 400 : Prime's MRB : ARCIN32 : Cross-32
Re: Simple Electon MMC Interface
Not that I am aware of.myelin wrote: Is there an MMFS test suite / stress test of some kind that I can run to smoke out any more bugs?
This would be a very useful addition, if anyone feels like a little project.
It wouldn't need to be MMFS specific, as it just needs to exercise the standard MOS file systems APIs.
Jonathan (jgharston) might have something like this?
Dave
- flaxcottage
- Posts: 5723
- Joined: Thu Dec 13, 2012 8:46 pm
- Location: Derbyshire
- Contact:
Re: Simple Electon MMC Interface
Having re-entered the wonderful world of the Electron with a Plus 1 interface I was looking to add MMFS functionality to it.
Thanks to this thread and Dave's efforts (Hoglet) I have managed the task quite nicely.
The SD card adapter works really well albeit somewhat slowly. However, the Elk is not a pacey machine so that is OK.
Using MMBImager I can add software in the form of SSD disk images on my PC. A Datacentre equipped Master lets me easily create SSD images of software I want to transfer.
So the cute, little Electron can now 'play with the big boys'.
PS: Yes, I have used Blu-Tack as a third hand. I even used it to 'glue' the SD PCB onto the lid of the black box.
Thanks to this thread and Dave's efforts (Hoglet) I have managed the task quite nicely.
The SD card adapter works really well albeit somewhat slowly. However, the Elk is not a pacey machine so that is OK.
Using MMBImager I can add software in the form of SSD disk images on my PC. A Datacentre equipped Master lets me easily create SSD images of software I want to transfer.
So the cute, little Electron can now 'play with the big boys'.
PS: Yes, I have used Blu-Tack as a third hand. I even used it to 'glue' the SD PCB onto the lid of the black box.
Re: Simple Electon MMC Interface
After acquiring my first Electron less than a month ago I set out to design a bit of hardware to bung in the back of it. Working on the old principle of walking before you run, I decided on a very simple one-socket sideways ROM card. At the weekend I got the board up and running and was pleased to be able to declare 'mission accomplished'!
But I remembered reading this thread and thought... hmm, would an SD reader work? I had run the four spare I/O pins I had left on the CPLD out to a header for testing purposes. If I mapped those pins to simulate the Plus 1 printer port, would it work?
Yes, indeedy, it does
A few lines of verilog and a ribbon cable later and it works just fine.
Big, big thanks to Dave for his work. Being able to attach an SD reader with so little work is very, very cool.
But I remembered reading this thread and thought... hmm, would an SD reader work? I had run the four spare I/O pins I had left on the CPLD out to a header for testing purposes. If I mapped those pins to simulate the Plus 1 printer port, would it work?
Yes, indeedy, it does
A few lines of verilog and a ribbon cable later and it works just fine.
Big, big thanks to Dave for his work. Being able to attach an SD reader with so little work is very, very cool.
Gary
Re: Simple Electon MMC Interface
Very nice indeed!