CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: matronica on 07:37, 19 April 23

Title: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 07:37, 19 April 23
Hi,
I've been working on a project which I thought might be of interest. It's a ROM emulator using a Raspberry Pi Pico https://hackaday.io/project/190630-cpc-pico-rom-emulator
I've been using it with my 464, but it hasn't been tested on anything else. It's easy to build and my prototype is hand wired on a proto board. There are no active components other than the Pico.
Interested to see what others think of it.

Matt

Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: Gryzor on 08:14, 19 April 23
Oh so that's what it is 😁

Why "emulator" and not "manager"?
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 08:23, 19 April 23
Quote from: Gryzor on 08:14, 19 April 23Why "emulator" and not "manager"?
because it emulates the lower ROM and 8 upper ROMS using the RAM in the Pico
So it's like a ROM board
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: Gryzor on 09:02, 19 April 23
My memory is a bit fogged from illness and sleep deprivation, are the other boards called emulators? Maybe I'm having a mini stroke, just don't remember seeing the term used 😁
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: reidrac on 09:08, 19 April 23
"The Pico is overclocked to 225 MHZ, with one core providing ROM emulation whilst the other handles ROM switching and processing commands from the CPC (with the help of a PIO state machine)"

LOL 225 MHz!
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: eto on 09:25, 19 April 23
This is really, really interesting.

If that turns out to be a general case, the Pico might be a great choice for other projects too, e.g. a graphics card.
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: andycadley on 09:33, 19 April 23
Quote from: Gryzor on 09:02, 19 April 23My memory is a bit fogged from illness and sleep deprivation, are the other boards called emulators? Maybe I'm having a mini stroke, just don't remember seeing the term used 😁
I think they usually just map ROM access onto some actual memory via hardware, whereas this is actually running code quickly enough that it can pretend to be a ROM device. 
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 09:33, 19 April 23
Quote from: Gryzor on 09:02, 19 April 23My memory is a bit fogged from illness and sleep deprivation, are the other boards called emulators? Maybe I'm having a mini stroke, just don't remember seeing the term used 😁
They are probably not called emulators. The reason I call this an emulator is that the pico is emulating the rom chips that would normally be used.
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 09:35, 19 April 23
Quote from: reidrac on 09:08, 19 April 23"The Pico is overclocked to 225 MHZ, with one core providing ROM emulation whilst the other handles ROM switching and processing commands from the CPC (with the help of a PIO state machine)"

LOL 225 MHz!
Yes it's a bit crazy isn't it? A 225 mhz dual core processor to service a 4mhz z80. But the pico is cheap.
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 09:38, 19 April 23
Quote from: eto on 09:25, 19 April 23This is really, really interesting.

If that turns out to be a general case, the Pico might be a great choice for other projects too, e.g. a graphics card.
That could be possible.  The main limitation is the number of available io pins. I'm going to try creating some form of mass storage device next. (Using a second pico)
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: pelrun on 09:53, 19 April 23
Quote from: Gryzor on 09:02, 19 April 23My memory is a bit fogged from illness and sleep deprivation, are the other boards called emulators?

It's the correct term in the electronics/digital design space, we just don't tend to use it that way here. But yes, the M4/usifac/other peripheral that pretends to be ROM even though it's not actually physical EEPROMs are all ROM emulators.

Nice to see the Pico doesn't completely go up in flames when connected to the bus directly; it'd be nice to get rid of the level shifters on my current boards. Although there are some significant caveats (can't go above 5.000v flat *at all* etc etc). Although I've yet to see more than about 4.7V on the bus even when I'm feeding in 5.3v :D
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: HAL6128 on 10:26, 19 April 23
Quote from: eto on 09:25, 19 April 23This is really, really interesting.

If that turns out to be a general case, the Pico might be a great choice for other projects too, e.g. a graphics card.
There's already a display driver existing for other systems (to VGA). Can't remember which.
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: Gryzor on 12:26, 19 April 23
https://www.hackster.io/news/matt-callow-turns-a-raspberry-pi-pico-into-a-low-cost-rom-emulator-for-the-amstrad-cpc-family-cd82e984b9f8
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: abalore on 13:57, 19 April 23
Quote from: matronica on 07:37, 19 April 23Hi,
I've been working on a project which I thought might be of interest. It's a ROM emulator using a Raspberry Pi Pico https://hackaday.io/project/190630-cpc-pico-rom-emulator
I've been using it with my 464, but it hasn't been tested on anything else. It's easy to build and my prototype is hand wired on a proto board. There are no active components other than the Pico.
Interested to see what others think of it.

Matt



Do you plan to make a PCB with a socket for the Pico ?
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: genesis8 on 16:09, 19 April 23
Pico to VGA (https://shop.pimoroni.com/products/pimoroni-pico-vga-demo-base)

Personnally I am using a Pico Explorer (https://shop.pimoroni.com/products/pico-explorer-base) for a CO2 detector with the SCD41 (https://shop.pimoroni.com/products/scd41-co2-sensor-breakout)
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: Ynot.zer0 on 19:11, 19 April 23
the Pico is a pretty powerful board, I was playing around with it over xmas. GitHub repo here (https://github.com/pi-gram/pico_c/tree/main/MCUME_pico_picodemo_VGA)

whilst this is showing the MCUME loading and playing an Atari 800 XL game via VGA through the Pico Display board, you can also run the CPC emulator instead and output it via the VGA.  I might give it a re-compile and see if I can output the CPC ready screen. ;D

the problem I found was handling the wrapper for the keyboard processing.  and of course someone has the Speccie running on a Pico (https://github.com/fruit-bat/pico-zxspectrum) (actually it works well, and the VGA output is really clear and has all the colours!)


As to the OP, it is pretty awesome what you've done with a Pico & you are right, they are dirt cheap (<£10) and they are VERY powerful, just have to figure out the best way to use them.  I'm looking forward to see what you do next.
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: ajcasado on 22:19, 19 April 23
There is a ready to use library called PicoVGA with a lot of cool features that could be the base for a nice V9990 alternative.

PicoVGA library features

See more details here:  PicoVGA - VGA/TV display on Raspberry Pico (breatharian.eu) (http://www.breatharian.eu/hw/picovga/index_en.html)

I guess that it also could be modified to drive a RGB output to use the amstrad monitor.
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 10:38, 20 April 23
Quote from: abalore on 13:57, 19 April 23Do you plan to make a PCB with a socket for the Pico ?
No plans at the moment, but I might do in the future
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: zhulien on 23:30, 21 April 23
soon we'll have a CPC with 8 Raspberry Pis on it, 1 for ram/rom, 1 for sounds, 1 for gfx, 1 for ... 
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: pollito on 17:30, 07 May 23
@matronica thank you so much for your hard work on this. I'm very new at electronics, but I would really love to revive my CPC 464, have always wanted to make a ROM board, and your project looks perfect. So, I am going to try to build it.  :D

I have a few questions (I hope you don't mind):

1. I was looking at your components list (https://hackaday.io/project/190630/components) - for the 50 pin edge connector does it need to be a special one? There is a gap between pins 21/22 and 23/24 on the CPC (https://www.cpcwiki.eu/index.php/Connector:Expansion_port#CPC_Expansion_Port) so I'm wondering if an off-the-shelf connector would fit?

2. You mention an optional resistor, and I would like to add one for safety. What type of resistor should it be, and where should it go? What about the LED?

3. In the picture on Hackaday (https://hackaday.io/project/190630/gallery#64865b1967001a08235957a1f2319cd5) there is a dip switch, which is not listed in the parts list (although it doesn't appear to be connected unless it is connected on the reverse). There are also 3 push button switches rather than the 2 in the list. Are these extra parts no longer necessary?

4. I have a GroundStudio Marble Pico (https://ardushop.ro/ro/home/2652-marble-pico.html) with 8MB QSPI flash and a built in microSD card. Could these be used to store more ROMs?

5. Do you have this drawn up in KiCad or Gerber format? I'm worried that I might permanently damage my CPC so the more obvious everything can be, the better for me!  ;)

Many thanks in advance,
Nick
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 11:01, 08 May 23
Hi Nick,
Thanks for your interest in the project. I suggest you wait a bit, I have designed a PCB (as PCBWay offered to make some for me). So that will make construction easier. Once I've validated the board, I will add the schematic and gerbers to github.
In answer to your specific questions:
1 - I think any 2x25 pin 0.1inch edge connector will work. The gaps on the CPC board do not matter (although they would help with alignment)
2 - My prototype has a power LED which uses a resistor. Value it not too critical, something around 1K would be fine. Note: there is no LED on the PCB
3 - The DIP switch is used to switch ROMDIS on and off. This allows your to disable the Pico without removing the board. 3rd push button is not used
4 - I don't think you'll be able to use that Pico. All of the standard GPIOs are used. The Marble Pico seems to use some for I2C (with pullups) and microSD card. This will probably interfere with the operation.
5 - see above - a PCB and schematic is on the way.

Matt
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: pollito on 15:19, 08 May 23
@matronica thank you very much for your answers. I am eagerly watching the GitHub repo!  :)  
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: Devlin on 15:52, 30 October 23
Quote from: matronica on 11:01, 08 May 23Hi Nick,
Thanks for your interest in the project. I suggest you wait a bit, I have designed a PCB (as PCBWay offered to make some for me). So that will make construction easier. Once I've validated the board, I will add the schematic and gerbers to github.
In answer to your specific questions:
1 - I think any 2x25 pin 0.1inch edge connector will work. The gaps on the CPC board do not matter (although they would help with alignment)
2 - My prototype has a power LED which uses a resistor. Value it not too critical, something around 1K would be fine. Note: there is no LED on the PCB
3 - The DIP switch is used to switch ROMDIS on and off. This allows your to disable the Pico without removing the board. 3rd push button is not used
4 - I don't think you'll be able to use that Pico. All of the standard GPIOs are used. The Marble Pico seems to use some for I2C (with pullups) and microSD card. This will probably interfere with the operation.
5 - see above - a PCB and schematic is on the way.

Matt

Are boards available, or compiled code if I want to build one of my own?
Title: Re: CPC ROM emulator using a Raspberry Pi Pico
Post by: matronica on 02:46, 05 November 23
I've (finally) uploaded the PCB and schematics to github. https://github.com/mattcallow/CPC_PICOROM/
I do not plan to sell boards, but if you are in Australia, I have a few spares that I can send out for the cost of postage.
Regarding compiled code. I'm not sure if I can do that, since the image will include possibly copyrighted ROMs. Ideally, I'd like to develop a way to upload ROM images via USB, but don't know if I'll have the time to do that.

Powered by SMFPacks Menu Editor Mod