News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

CPC ROM emulator using a Raspberry Pi Pico

Started by matronica, 07:37, 19 April 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

00WReX

#50
Quote from: matronica on 06/11/2024, 11:08:21
I was thinking about a 64K RAM upgrade to take a 464 to 128K, but I think it's not worth the effort.

-----

I personally think including a 64k RAM expansion for the 464 would be cool.

Nice project, I'm looking forward to seeing it evolve. 👍

Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

eto

Quote from: matronica on 07:46, 06 November 24yes, but I'm not aware of any dev boards with 30 GPIO. The RP2350B has 48 GPIO. Which is great, but I don't fancy soldering the tiny QFN package.
I guess that boards with the RP2350B will start to appear at some point.
The Pimorino PGA2350 was (afaik) the first available board that exposes all 48GPIOs. 
Unfortunately it was out of stock after a couple of days. https://shop.pimoroni.com/products/pga2350?variant=42092629229651



The 2350B should have enough GPIOs to provide ROM, mass storage and maybe even the logic for an additional SRAM with 512K-2MB (or add another 2350B as a pure RAM emulator). I would expect that schematics are or will be available, so designing a board that can be assembled by e.g. JLCPCB or PCBway could also be an option. That would open the possibility to make it an "internal" expansion that can be plugged into the CPU socket. 

ajcasado

This project is very interesting and promising. Keep it up, @matronica! I hope you keep making progress and manage to add all the fantastic features you have in mind.
Regarding the boards with the RP2350B, I found this: https://lectronz.com/products/rp2350-stamp-xl
CPC 664

Empiezas a envejecer cuando dejas de aprender.
You start to get old when you stop learning.

Philippe Lardenois

Quote from: matronica on 01:09, 06 November 24@Philippe Lardenois
QuoteWould be nice to expand the capabilities (like loading disks or bigger roms) - I would like to have the capabilities but old age...
What do you mean by bigger ROMs? I though that all CPC expansion ROMs were 16KB?
Sorry gor late reply. I meant for example 512Ko roms. But Maybe the PICO has a limited memory capabilities. Otherwise, I noticed tha twe can load 48K roms by mounting them consecutivly in a CFG file....

pollito

Quote from: matronica on 23:06, 05 November 24
Quote from: pollito on 22:03, 25 September 24I tried the same process several times, but it always leads to the same outcome. Do you have any idea what might be wrong?

Hi @pollito , I have made major changes to the firmware to make the process easier. I suggest you try the latest firmware on github. It allows you to copy ROMs via an emulated USB drive. Sorry for the late reply!
Sorry for the late reply; I've been really tied up lately building an enhanced Speccy clone. Thank you so much for updating the firmware, and instructions. I managed to make it boot my CPC into Noel's diagnostic ROM just to test it, and it is awesome!

Regarding the optional CH376S, which jumper settings are needed for this, and which ROMs?



Thanks again! :D

Philippe Lardenois

Quote from: matronica on 23:06, 05 November 24
Quote from: pollito on 22:03, 25 September 24I tried the same process several times, but it always leads to the same outcome. Do you have any idea what might be wrong?

Hi @pollito , I have made major changes to the firmware to make the process easier. I suggest you try the latest firmware on github. It allows you to copy ROMs via an emulated USB drive. Sorry for the late reply!
Hi Matt,
the new firmware is on your Github, to test the usb component ? Can't see it.
Thanks.

pollito

Quote from: Philippe Lardenois on 19:51, 16 November 24
Quote from: matronica on 23:06, 05 November 24
Quote from: pollito on 22:03, 25 September 24I tried the same process several times, but it always leads to the same outcome. Do you have any idea what might be wrong?

Hi @pollito , I have made major changes to the firmware to make the process easier. I suggest you try the latest firmware on github. It allows you to copy ROMs via an emulated USB drive. Sorry for the late reply!
Hi Matt,
the new firmware is on your Github, to test the usb component ? Can't see it.
Thanks.
Do you mean the CH376S module I mentioned above? If so, I think it passes through directly to the edge connector. After asking the question above, I saw that Matt has linked to this page from the CPC_PICOROM page. I will give it a go myself at some point in the next week or so.

pollito

#57
Just checked the schematic, and D0-D7 of the CH376 are actually connected to the Pico as per this documentation. Apologies for the misinformation.  :picard:

Brocky

#58
Quote from: pollito on 00:01, 17 November 24Just checked the schematic, and D0-D7 of the CH376 are actually connected to the Pico as per this documentation. Apologies for the misinformation.  :picard:
you should be able to connect it to the pico via SPI.. (SCS,SCK,MOSI/SDI,MISO/SDO).. so youre only using 4 lines instead of 12 data and control lines
but yes...the board is laid out with D0 to D7 and the control lines...
schematic is here to check for yourself!
https://github.com/mattcallow/CPC_PICOROM/blob/main/hardware/schematic.png

matronica

The CH376S is controlled by the CPC, not the pico. It's mapped to IO Addresses FE80 and FE81, so should work with any software that works with Albireo https://www.cpcwiki.eu/index.php/Albireo

I use unidos with the albireo driver.

Matt




Brocky

#60
Quote from: matronica on 11:31, 17 November 24The CH376S is controlled by the CPC, not the pico. It's mapped to IO Addresses FE80 and FE81, so should work with any software that works with Albireo https://www.cpcwiki.eu/index.php/Albireo

I use unidos with the albireo driver.

Matt




ooh that makes sense! derp!
..that said.. it should be theoretically possible to use one of your picorom boards just for the USB.. with no pico attached... (i already use M4 board for roms)..i still need to order a pinned connector to plug the picorom into MX4 board..

krusty_benediction

Hi !
I've discovered this thread few days ago. Interesting project I'll follow a bit.
I own most of the cards of @TotO, the M4, cpcbooster, usifac II but in fact I mainly use the M4 card because of this functionality : the ability to send a snapshot or a file from the PC to the CPC without even touching the CPC (so it is a pleasure to crossdev). As time fly I care less of ROMS and as I do not natively develop I have no need of extra RAM.

By adding a wifi module, would it be technically feasible to load snapshots in the CPC as with the M4 ? Or there are technical limitations for that and a second pico (or another hardware) would be needed ?
Depending on your answer, I may take time to look at the code of your project and understand how it works to eventually contribute.

Brocky

Quote from: krusty_benediction on 09:26, 20 November 24Hi !
I've discovered this thread few days ago. Interesting project I'll follow a bit.
I own most of the cards of @TotO, the M4, cpcbooster, usifac II but in fact I mainly use the M4 card because of this functionality : the ability to send a snapshot or a file from the PC to the CPC without even touching the CPC (so it is a pleasure to crossdev). As time fly I care less of ROMS and as I do not natively develop I have no need of extra RAM.

By adding a wifi module, would it be technically feasible to load snapshots in the CPC as with the M4 ? Or there are technical limitations for that and a second pico (or another hardware) would be needed ?
Depending on your answer, I may take time to look at the code of your project and understand how it works to eventually contribute.
looking at the schematic, theres not enough free pins left on the pico to add a wifi module.. but i guess you could use a Pico W for wifi....
just need to code the pico side and z80 asm for the rsx extensions..

matronica

Quote from: Brocky on 04:10, 21 November 24
Quote from: krusty_benediction on 09:26, 20 November 24Hi !
I've discovered this thread few days ago. Interesting project I'll follow a bit.
I own most of the cards of @TotO, the M4, cpcbooster, usifac II but in fact I mainly use the M4 card because of this functionality : the ability to send a snapshot or a file from the PC to the CPC without even touching the CPC (so it is a pleasure to crossdev). As time fly I care less of ROMS and as I do not natively develop I have no need of extra RAM.

By adding a wifi module, would it be technically feasible to load snapshots in the CPC as with the M4 ? Or there are technical limitations for that and a second pico (or another hardware) would be needed ?
Depending on your answer, I may take time to look at the code of your project and understand how it works to eventually contribute.
looking at the schematic, theres not enough free pins left on the pico to add a wifi module.. but i guess you could use a Pico W for wifi....
just need to code the pico side and z80 asm for the rsx extensions..
Correct. All the pins are used.  I did consider the PicoW, but the the API is pretty horrible unless you use an RTOS. Plus the only way to write the the Pico is via a single IO port which is also used for bank switching. So it is probably possible to add Wifi, but not really something I'm going to look at.  I don't know how the M4 loads snapshots, but I expect it has full access to all the CPC memory. The PicoROM can only act as ROM, and can't replace the RAM.

Brocky

#64
Quote from: matronica on 04:47, 21 November 24
Quote from: Brocky on 04:10, 21 November 24
Quote from: krusty_benediction on 09:26, 20 November 24Hi !
I've discovered this thread few days ago. Interesting project I'll follow a bit.
I own most of the cards of @TotO, the M4, cpcbooster, usifac II but in fact I mainly use the M4 card because of this functionality : the ability to send a snapshot or a file from the PC to the CPC without even touching the CPC (so it is a pleasure to crossdev). As time fly I care less of ROMS and as I do not natively develop I have no need of extra RAM.

By adding a wifi module, would it be technically feasible to load snapshots in the CPC as with the M4 ? Or there are technical limitations for that and a second pico (or another hardware) would be needed ?
Depending on your answer, I may take time to look at the code of your project and understand how it works to eventually contribute.
looking at the schematic, theres not enough free pins left on the pico to add a wifi module.. but i guess you could use a Pico W for wifi....
just need to code the pico side and z80 asm for the rsx extensions..
Correct. All the pins are used.  I did consider the PicoW, but the the API is pretty horrible unless you use an RTOS. Plus the only way to write the the Pico is via a single IO port which is also used for bank switching. So it is probably possible to add Wifi, but not really something I'm going to look at.  I don't know how the M4 loads snapshots, but I expect it has full access to all the CPC memory. The PicoROM can only act as ROM, and can't replace the RAM.

regarding the snapshots, they are just a dump of the memory and stack, so you just copy that file to the CPC memory which can be done very much like copying a rom to ram..
not sure if Albireo can load snapshots, but they theoretically should be able to be loaded from file on the CH376 USB... (but unfortunatly no direct connection like krusty would like)

pollito

@matronica I finally got around to testing my CPC Pico ROM outside of using it for diagnostics, but unfortunately I am having some problems with it, and I hope you might be able to offer some suggestions.

Whatever I seem to do, it recognises the OS and BASIC ROMs, essentially upgrading my 464, but it doesn't load any of the other ROMs, including picorom.rom - i.e. there is nothing on the boot screen that suggests any additional ROMs are being initialised.

I thought maybe it was the cheap 74LS688s I got from AliExpress, and I had the same behaviour from all 5 of that batch. I even had the same behaviour without any IC in the socket. So, I bought a replacement as part of my recent Mouser order, but nothing has changed.

I have also tried with 3 different Picos, but still no change in behaviour.

D2 is placed the reverse of that on the silkscreen, so that doesn't seem to be the problem either.

I believe I've reflowed everything on the board, but I'll do that again tomorrow, just in case.

Any ideas at all? I'm sure it's something simple, but I can't work it out! ;D

matronica

Quote from: pollito on 22:35, 18 December 24@matronica I finally got around to testing my CPC Pico ROM outside of using it for diagnostics, but unfortunately I am having some problems with it, and I hope you might be able to offer some suggestions.

Whatever I seem to do, it recognises the OS and BASIC ROMs, essentially upgrading my 464, but it doesn't load any of the other ROMs, including picorom.rom - i.e. there is nothing on the boot screen that suggests any additional ROMs are being initialised.

I thought maybe it was the cheap 74LS688s I got from AliExpress, and I had the same behaviour from all 5 of that batch. I even had the same behaviour without any IC in the socket. So, I bought a replacement as part of my recent Mouser order, but nothing has changed.

I have also tried with 3 different Picos, but still no change in behaviour.

D2 is placed the reverse of that on the silkscreen, so that doesn't seem to be the problem either.

I believe I've reflowed everything on the board, but I'll do that again tomorrow, just in case.

Any ideas at all? I'm sure it's something simple, but I can't work it out! ;D
The 74LS688 won't affect loading of the ROMs, it's only for the USB drive.
The fact that you can load the OS and basic ROM suggests that hardware is OK.
Which version of the firmware are you running?
What ROMs do you have loaded?
What is in your config file?

Matt

pollito

Quote from: matronica on 08:31, 19 December 24
Quote from: pollito on 22:35, 18 December 24@matronica I finally got around to testing my CPC Pico ROM outside of using it for diagnostics, but unfortunately I am having some problems with it, and I hope you might be able to offer some suggestions.

Whatever I seem to do, it recognises the OS and BASIC ROMs, essentially upgrading my 464, but it doesn't load any of the other ROMs, including picorom.rom - i.e. there is nothing on the boot screen that suggests any additional ROMs are being initialised.

I thought maybe it was the cheap 74LS688s I got from AliExpress, and I had the same behaviour from all 5 of that batch. I even had the same behaviour without any IC in the socket. So, I bought a replacement as part of my recent Mouser order, but nothing has changed.

I have also tried with 3 different Picos, but still no change in behaviour.

D2 is placed the reverse of that on the silkscreen, so that doesn't seem to be the problem either.

I believe I've reflowed everything on the board, but I'll do that again tomorrow, just in case.

Any ideas at all? I'm sure it's something simple, but I can't work it out! ;D
The 74LS688 won't affect loading of the ROMs, it's only for the USB drive.
The fact that you can load the OS and basic ROM suggests that hardware is OK.
Which version of the firmware are you running?
What ROMs do you have loaded?
What is in your config file?

Matt

Thank you for your reply. I am using the latest firmware from your Github repo. Before I loaded the firmware onto the Pico, I cleared it completely with flash_nuke.uf2.

The configs I have loaded are the same as your examples, but with the ROMs populated from the CPCWiki page. Here is the entire contents zipped.

pollito

Just an addition - it doesn't look like the 6128 OS and BASIC ROMs are working properly either. Although it shows 128K Microcomputer and BASIC 1.1, if I type fill it gives me a Syntax error rather than an Operand missing error.

I also reflowed all of the solder joints, just in case. The only thing I haven't changed trying to troubleshoot are the diodes and the edge connector! :D

Regarding writing the files to the Pico, I originally used FreeBSD, but the Pico seemed to eject itself before fusefs had finished writing the files, which meant the CPC would hang on boot. I am now using Windows 10.

matronica

@pollito  , how did you format the Pico when in USB mode? I would recommend getting the pico to do it. See README for details, but basically hold the bootsel button for about 10 seconds when in USB mode.
I re-flashed by pico with the uf2 image from github, formatted as above then copied all the files from your zip archive onto it. Mine works as expected. So i think your files and config are fine.


pollito

Quote from: matronica on 05:21, 21 December 24@pollito  , how did you format the Pico when in USB mode? I would recommend getting the pico to do it. See README for details, but basically hold the bootsel button for about 10 seconds when in USB mode.
I re-flashed by pico with the uf2 image from github, formatted as above then copied all the files from your zip archive onto it. Mine works as expected. So i think your files and config are fine.


I have been formatting the Pico by holding the BOOTSEL button as is described on your Github page.

Just in case it would help, I replaced the cheap AliExpress diodes with some I bought from Mouser, but couldn't see any difference in behaviour, other than the fill command now correctly returns Operator missing.

It seems that the 464 is only reading the lower ROM, and ROM 0. This is the same with my other 464. If I try the interface on my 6128, it goes into a reset loop after showing the copyright message.

I have now tried it with three different Picos, all which show the same behaviour:

2x Picos (marked 2020)
1x Pico H (marked 2021)

Which version Picos have you tested with? Perhaps this somehow makes a difference?

matronica

Quote from: pollito on 22:35, 21 December 24Which version Picos have you tested with? Perhaps this somehow makes a difference?

I use a (c) 2020 Pico.
Did you also raise the issue on github? https://github.com/mattcallow/CPC_PICOROM/issues/7

pollito

Quote from: matronica on 01:54, 24 December 24
Quote from: pollito on 22:35, 21 December 24Which version Picos have you tested with? Perhaps this somehow makes a difference?

I use a (c) 2020 Pico.
Did you also raise the issue on github? https://github.com/mattcallow/CPC_PICOROM/issues/7
No, not me. Interesting, though, as they are different symptoms to mine. Do you want me to put my findings on that Github thread / raise a new issue?

Brocky

#73
Quote from: matronica on 01:54, 24 December 24
Quote from: pollito on 22:35, 21 December 24Which version Picos have you tested with? Perhaps this somehow makes a difference?

I use a (c) 2020 Pico.
Did you also raise the issue on github? https://github.com/mattcallow/CPC_PICOROM/issues/7
i think you'll find that the pico has issues with its internal pullups...
https://forums.raspberrypi.com/viewtopic.php?t=375631

oops..thats actually pico2... but i think it goes back to the earlier chips aswell..

pelrun

No, the issue with high-impedance mode (*not* the internal pullups, the original defect reports were wrong) on the Pico2/RP2350 is isolated to that chip, the original Pico/RP2040 is completely unaffected.

Powered by SMFPacks Menu Editor Mod