WiP Raspberry Pico Microdrive Hardware Emulator
WiP Raspberry Pico Microdrive Hardware Emulator
Decided to take the plunge and learn how to program a Raspberry Pico Micro Controller and, after messing around a lot with Oqtadrive, decided to create a hardware emulator for the Microdrive as my first project because two obviously isn't enough
I wanted to mirror the Pi1541 project whereas the solution is standalone with a mini screen, SD Card to house all the files and it is all controlled by a few buttons, and that is exactly what I've made.
Introducing the ZX PicoMD (I may come up with a better name!)
All you need is a Raspberry Pico (or Pico W) which luckily are easy to get hold of and very cheap at around £4.
The prototype is a bit messy but works great. It can LOAD, SAVE, ERASE, FORMAT and use a menu system to insert new cartridges into one of the 8 drives. You basically load up the SD Card with all your favourite games (all converted with Z80onMDR of course) and off you go.
The menu system can also power off (not really needed as I always close the files once the drive has stopped so nothing should be in cache), eject the SD Card (so you can load more games), format the cartridges, show cartridge info (simple CAT to the OLED) & save your work to SD card. It works with fat32 and exFat formatted cards as well.
In terms of coding I've taken advantage of the two cores on the Pico, one for handling the Menu, OLED & SD Card access and the other to run the emulation which needs critical timing i.e. no interrupts.
I'm in the process of creating a PCB to house it all, similar to the ones I've created for Oqtadrive. Circuit is relatively simple, but it does need a logic level converter for the data lines (need input & output) & 9v reducing to 5v to power the Pico. Rest is handled by diodes & pull ups (write protect can be added or simply connect it to the 9v line so it is always unprotected)
Still a few bits to-do before full release, mainly the PCB with 3D case and porting Z80onMDR. I'm also looking at adding wifi access via the Pico W, focusing on file transfer, but might not bother as the SD card is easy enough.
Open to other suggestions if you have any and once the PCBs arrive I'll advertise for some beta testers if anybody is interested in giving it a go.
Finally big shout out to Alex for his help in troubleshooting and open sourcing Oqtadrive which was a massive help.
TomD
I wanted to mirror the Pi1541 project whereas the solution is standalone with a mini screen, SD Card to house all the files and it is all controlled by a few buttons, and that is exactly what I've made.
Introducing the ZX PicoMD (I may come up with a better name!)
All you need is a Raspberry Pico (or Pico W) which luckily are easy to get hold of and very cheap at around £4.
The prototype is a bit messy but works great. It can LOAD, SAVE, ERASE, FORMAT and use a menu system to insert new cartridges into one of the 8 drives. You basically load up the SD Card with all your favourite games (all converted with Z80onMDR of course) and off you go.
The menu system can also power off (not really needed as I always close the files once the drive has stopped so nothing should be in cache), eject the SD Card (so you can load more games), format the cartridges, show cartridge info (simple CAT to the OLED) & save your work to SD card. It works with fat32 and exFat formatted cards as well.
In terms of coding I've taken advantage of the two cores on the Pico, one for handling the Menu, OLED & SD Card access and the other to run the emulation which needs critical timing i.e. no interrupts.
I'm in the process of creating a PCB to house it all, similar to the ones I've created for Oqtadrive. Circuit is relatively simple, but it does need a logic level converter for the data lines (need input & output) & 9v reducing to 5v to power the Pico. Rest is handled by diodes & pull ups (write protect can be added or simply connect it to the 9v line so it is always unprotected)
Still a few bits to-do before full release, mainly the PCB with 3D case and porting Z80onMDR. I'm also looking at adding wifi access via the Pico W, focusing on file transfer, but might not bother as the SD card is easy enough.
Open to other suggestions if you have any and once the PCBs arrive I'll advertise for some beta testers if anybody is interested in giving it a go.
Finally big shout out to Alex for his help in troubleshooting and open sourcing Oqtadrive which was a massive help.
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
-
- Dizzy
- Posts: 67
- Joined: Wed Feb 02, 2022 10:53 am
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Looks interesting, I assume it requires Interface 1?
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Yes it does. Emulating an IF1 would definitely make an interesting project after this one...
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
@TomD Great to see OqtaDrive has a little brother now Looking forward to testing it!
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Excellent work @TomD. Are you programming the Pico in C? It's great you able to use the Pico as it's cheap, and easily available (unlike other Raspberry Pi models).
If you can include WiFi, I personally feel that would be a huge plus.
Do you hope to offer a construction service?
If you can include WiFi, I personally feel that would be a huge plus.
Do you hope to offer a construction service?
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Yes using the C SDK to program instead of Micro Python, mainly as I don't know how to program in Python but also not sure it would be fast enough due to the interpreter overhead and the Microdrive needing 6us precision (may be fine as not tested). I didn't go as far as using the PIO, although that does look very interesting. Luckily for me somebody has already ported FatFS which made the SD Card part a lot easier.PeterJ wrote: ↑Wed Oct 05, 2022 7:31 am Excellent work @TomD. Are you programming the Pico in C? It's great you able to use the Pico as it's cheap, and easily available (unlike other Raspberry Pi models).
If you can include WiFi, I personally feel that would be a huge plus.
Do you hope to offer a construction service?
Once I get the PCBs I will definitely offer them out and can make some up if required. All you'll need to do then is pop the Pico in or I could even supply fully built if there is demand. I bought enough stuff to make up 5 as cheaper to buy the bits in bulk.
WiFi on the list.
Cheers
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Are you planning to release the source of your microdrive emulator? Pico code and gerbers?
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Initially I will release the UF2s and pop the PCB on PCBWay shared projects so people can make their own. Eventually I'll open source once I've tidied up my code
There are also a few things I want to add/change such as the current PCB doesn't allow downstream comms to other Microdrives yet and I'd like to fix that before putting it out there.
If you are in the UK and fancy have a mess around with one (beta test it for me) I can send you a prototype PCB once they arrive?
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
OK, good to know.
I have a couple of Pico based Spectrum projects at the PCB stage (boards currently on their way from China) and when they are done I was thinking about a hardware IF1 emulator based on a Pico. That should be relatively straightforward compared to what you've done. Clearly, pairing such a thing up to your microdrive emulation would be highly desirable so you might be planning that yourself.
Unfortunately I don't have an IF1 (which is at least part of the reason I want an emulated one), but when I start work on an emulated one I'll be after one of your "Pico microdrives". I can get one made if you've opened the source and design, which is why I asked. If you happen to have spares so much the better! But not just yet...
I have a couple of Pico based Spectrum projects at the PCB stage (boards currently on their way from China) and when they are done I was thinking about a hardware IF1 emulator based on a Pico. That should be relatively straightforward compared to what you've done. Clearly, pairing such a thing up to your microdrive emulation would be highly desirable so you might be planning that yourself.
Unfortunately I don't have an IF1 (which is at least part of the reason I want an emulated one), but when I start work on an emulated one I'll be after one of your "Pico microdrives". I can get one made if you've opened the source and design, which is why I asked. If you happen to have spares so much the better! But not just yet...
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Re: WiP Raspberry Pico Microdrive Hardware Emulator
PCBs have arrived and all working well, so far anyway.
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Just a week for the PCB fab? Where did you get that done?
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Re: WiP Raspberry Pico Microdrive Hardware Emulator
JLPCB, they are very fast although postage isn't cheap
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Oh right, they're the ones I use but I always use the postal service because I'm too cheap to pay the courier fees.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Re: WiP Raspberry Pico Microdrive Hardware Emulator
I've created a gitHub repository so if you are interested in building your own all the files will be on there (eventually)
https://github.com/TomDDG/ZXPicoMD
TomD
https://github.com/TomDDG/ZXPicoMD
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Works well with the Multiface
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
I've put the PCB on PCBWay if you would like to purchase. Also entered it into the compo if you fancy voting for it
https://www.pcbway.com/project/sharepro ... 50e81.html
https://www.pcbway.com/project/sharepro ... 50e81.html
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
and a, terrible, video of it in action https://www.youtube.com/shorts/1t1uLbgz_Y4
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
New version released adding a rudimentary filename selector when saving cartridges to the SD card. Grab it at the usual place https://github.com/TomDDG/ZXPicoMD
TomD
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Thanks @TomD,
It's a great device.
Please could you go through the process of updating the firmware. Via Windows or Ubuntu is fine. I'm familiar with the Raspberry Pi, but not the Pico.
I've downloaded the document you mention in your GitHub page, but I'm not sure where to start.
Thanks
It's a great device.
Please could you go through the process of updating the firmware. Via Windows or Ubuntu is fine. I'm familiar with the Raspberry Pi, but not the Pico.
I've downloaded the document you mention in your GitHub page, but I'm not sure where to start.
Thanks
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Sure. The Pico is extremely easy to flash. Open the case using the two screws on the botton, then on top of the Pico board you will see a small white button. This is the boot selector. When connecting the Pico to a PC using a USB cable, press and hold the button down (before connecting). Once connected let go and a folder should appear on your desktop, similar to when you plug in a Flash drive. All you need to do now is drag & drop the UF2 file into the folder and the Pico will auto disconnect and reboot with the new code running.PeterJ wrote: ↑Fri Nov 25, 2022 5:25 pm Thanks @TomD,
It's a great device.
Please could you go through the process of updating the firmware. Via Windows or Ubuntu is fine. I'm familiar with the Raspberry Pi, but not the Pico.
I've downloaded the document you mention in your GitHub page, but I'm not sure where to start.
Thanks
As you've got a made up system you can also use the reset button on the case (far right). Connect the USB cable, hold down the boot select button on the Pico and press the reset button. Now let go of the boot select button and the folder should appear.
Hope that helps.
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Thanks @TomD,
Much appreciated.
Much appreciated.
Re: WiP Raspberry Pico Microdrive Hardware Emulator
New version released with support for adding real h/w Microdrives downstream of the ZXPicoMD, useful if you want to copy files off ailing cartridges. Having the ZXPicoMD device as 1st in the chain allows it to control the COMMs shift register which in turn allows the mix of virtual drives and real h/w drives with any drive combination. For example, you can have real drives set to 1 & 4 and the rest virtual. CAT 1 accesses the 1st real h/w drive, 4 the 2nd real h/w drive and all others access the emulated drives.
New menu options added to easily switch between real h/w & virtual:
I've only released this version as beta as I'm only able to partially test with real hardware. Unfortunately, I've only got 1 real MD connector block I did try it with a vDrive as the 2nd device and it was fine. Hopefully when others have tested with real h/w any bugs can be ironed out.
New version can be downloaded from GitHub along with instructions on how to use (https://github.com/TomDDG/ZXPicoMD)
TomD
New menu options added to easily switch between real h/w & virtual:
I've only released this version as beta as I'm only able to partially test with real hardware. Unfortunately, I've only got 1 real MD connector block I did try it with a vDrive as the 2nd device and it was fine. Hopefully when others have tested with real h/w any bugs can be ironed out.
New version can be downloaded from GitHub along with instructions on how to use (https://github.com/TomDDG/ZXPicoMD)
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: WiP Raspberry Pico Microdrive Hardware Emulator
Hello Tom, your device looks very interesting! Is it possible to tranfer .tap-files to the SD-Card or do you at least intend to extend your drive to this option?