First post, by FreddyV
ISA PicoMEM Extension board (For 8086/8088 PC, 286 and more to come)
Hi,
I wrote a post for my board initially on VCFED forum, but the number of "reactions" there is quite low.
I am "Known" (I Think) here for my Work on Mod Master XT and I come back with a Semi HW and SW Project.
After I released Mod Master XT 1.0, I needed another challenge and I wanted to work on 3 areas:
- Go back to Hardware (I an an electronic engineer, but did not practice since 20 years)
- Work on emulator code
- Code with modern dev tools (GitHub and so on)
After I saw the PiStorm project (68000 emulation on a Pi) I decided to do something equivalemt for the PC.
BUT:
- Pi was no more available, Pi is TOO much powerfull (Overkill) and expensive
- I did not want to do a CPU emulation, as we all know that if we want a more powerfulle 8088, we just take a 286....
I was also frustrated to see everywhere devices to use .ROM files on microSD on all the retro micro and not on the PC.
TI99, PET, ZX Spectrum, CPC, Commodore 64, Atari ST... All these machine has much more powerfull way to use images than the PC.
I started to work on Hardware design and some weeks after, @polpo released his PiGUS.
I contacted him and we shared some infos on how to better multiplex the data on the PicoGUS,.
Then I made my design based on a more complex multiplexing.
The use of a Pi Pico is Ian idea, as I never heard about it before. So, without Ian help, PicoMEM was impossible.
We now have a Discord server where we try to discuss with all the Pi Pico based retro makers.
Introduction
The PicoMEM is designed as a way to run Emulated ISA boards on a real PC.
The PicoMEM Board currently connect the full 8Bit Memory and I/O Bus plus an IRQ to a Raspberry Pi Pico, through some multiplexor/Level shifter chip.
The Pi Pico also has a 8Mbyte PSRAM connected in SPI and a MicroSD Slot.
The PicoMEM Board can be seen as both a working PC extention board as well as a Development platform.
Board description
Hardware :
- 2 Layers ISA Board connecting a Raspberry Pi Pico through some buffers/Multiplexor and inverter.
- The Pi Pico is connected to the full Memory and I/O Address space, and one IRQ. (No DMA)
- The Pi Pico is connected to a PSRAM (8Mb, 130MHz, PIO) and a MicroSD slot (20MHz, PIO) in SPI.
- The Pi Pico is used at 260MHz.
- The MicroSD connector share the SPI BUS of the PSRAM, adding some limitations. (We need to stop the PC IRQ during Disk Access)
Software :
- a Full BIOS with a "Phoenix BIOS Like" text interface in assembly.
- C/C++ Code in the Pi Pico
- Multiple other projects library used (List beloy)
- The PC can send multiple command to ask the Pico to perform tasks
- In the reverse, the Pico can also send commands to the Pico
Advantages
- The Board design is simple and the Pi Pico is available : Quite easy to produce, not expensive.
- As it is mainely software, the limits are only the imagination (And Time)
- If we check the currently available functions, even if one of them was working, it was worth to do the board.
- Can be used by anybody to experiment in coding, from ARM side and PC Side, in fact it is one of the main goal for me to do this board : Learn
- Can be used to test Emulation code on Real Hardware : This is a bridge between emulator and real hardware.
- This is not based on a super overpowered CPU that can do everything. There is a real challenge to have this working.
Current Functionality
- Memory emulation with 16Kb Address granularity:
> 128Kb of RAM can be emulated from the Pi Pico internal RAM with No Wait State. (4MHz ISA)
> We can emulate the whole 1Mb of RAM address space from the PSRAM. (With 6 Wait Stated for 4MHz ISA)
> EMS Emulation of Up to 6 / 7 MHz. (Only 4Mb for the moment as using the LoTech EMS Driver)
> Memory emulation is also used to add (4Kb of "Private" memory for the PicoMEM BIOS Usage)
> 16Kb of RAM is also added for disk access (Or other) even if 512Kb only is used for the moment.
- ROM Emulation for its internal BIOS and custom ROM loaded from the MicroSD.
- The Board has its own BIOS, used to automatically detect/Extend/Configure the RAM emulation, and select Floppy/Disk images
- Floppy and Disk emulation from .img files stored in uSD through FasFs and DosBOX int13h emulation code.
- Emulate 2 Floppy and 4 Disk (80h to 83h), Disk up to 4Gb (More later)
Future Functionality
- There is already a mecanism implemented so that the Pi Pico can send command to the PC, ve can have the Pi Pico taking "Virtually" the control of the PC.
> This can be used to perform ROM/RAM dump, Disk/Floppy DUMP/Write, display/kb redirection....
- USB Host mode to be added, I have difficulties to compile the TinyUSB Host code for the moment
- I added a connector on the board, that can open the door lor lot of stuff (More or less "Secret" for the moment, I need to keep some surprize for myself)
- Use the Pi PicoW to emulate network card and do some stuff remotely, why not Bluetooth joystick ? There is no guarantee it will be done.
- Any kind of board can be emulated if its interfacing and CPU power needs are satisfied. (No DMA, no emulation, no complex floating point calculation...)
- The board can be chaged
Compatibility/Limitations
The Board has been tested on machine with 4MHz ISA BUS Only. 8MHz ISA can work, but need some more code/test to be reliable.
The Board can't be used for Video emulation, as it require a way for the Pico to actually display something, and only 3 pins are "Free".
The Pi Pico is limmited in its speed, this is excellent and bad at the same time:
- Multiple complex function can't be emulated at the same time, choices need to be done.
- We can still program the Pico and Feel like doing coding on a "Retro" Machine, so we don't have the effect "Look, it is easy, he put a processor in the PC that can emulate the full PC"
Memory emulation:
Memory emulation with PSRAM is quite slow for the moment, but multiple mecanism like a 32b cache will improve this. (And Maybe DMA)
The emulated Memory does not support DMA, I did not proof it is not 100% feasible, but it require quite complex coding to be possible (Snif the DMA registers, change code that may add unstability)
Anyway:
- As the PicoMEM emulate the Floppy, we can disable temporarily the RAM emulation if the Disk access are not working.
- For SoundCard, if the PC has 512Kb of base RAM, it is really unlikely that the DMA Buffer will be placed in emulated RAM, it may work 90% of the time.
Disk emulation:
- uSD Disk access are really fast even compared to the XTIDE, but it it currently limitted by the uSD acces time for write.
- The Code reading multiple sectors failed in one of my uSD, so I did not enabled it for the moment.
Contributors / External Libraries
* Ian Scott (https://github.com/polpo/): Idea to use the Pi Pico instead of the not available Pi 2/4 and Zero plus help on the Hardware design.
* PSRAM Code by Ian Scott (https://github.com/polpo/rp2040-psram) : PSRAM PIO Code.
* FatFS by Chan (http://elm-chan.org/fsw/ff/00index_e.html) : ExFS Library for microcontrollers.
* FatFS by Carl J Kugler III (https://github.com/carlk3/no-OS-FatFS-SD-SPI-RPi-Pico) : FatFS for SD Access in SPI with a Pi Pico
* DOSBox (www.dosbox.com): DosBOX BIOS Int13h Code, heavily modified for ExFS support and PicoMEM Interface, with bug correction.
The PicoMEM Board in the Sinclair PC200
BIOS Menu : RAM config and image selection
DOS Boot: