It is currently Tue Aug 14, 2018 1:48 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Thu Jun 14, 2018 2:59 pm 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
So I have desoldered the program ROM from a UNROM pcb and put jumper headers in its place.

All I want to do in this first experiment is see if I can load the data from the controller rather than EPROM. File I/O is likely slow so I'll load the data into a byte array.

Firstly is there likely to be any issues here with actually doing this? Clock issues?

Secondly what's the best way to get just the program data from the UNROM NES file?

Many thanks

Chris


Top
 Profile  
 
PostPosted: Thu Jun 14, 2018 3:10 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7380
Location: Seattle
The device that you are attempting to make is called a "ROM emulator".

A Raspberry Pi or an arduino are completely unsuitable for this task; they simply lack the ability to respond dynamically to the 2A03 with low enough delay.

The Atari 2600 has a device (the "Harmony Cart") that uses a microcontroller as a ROM emulator, but it's using one with drastically lower latency than the RPi / most other ARM cores, and the 2600's CPU is 2/3 the speed of the NES's CPU.


Top
 Profile  
 
PostPosted: Thu Jun 14, 2018 3:27 pm 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
Thanks for the response, I thought that was maybe going to be the answer. Yes the Pi is slow, experience there but I thought the atmega chip at least had some sort of capable speed? The Arduino is reasonably low level compared to the Pi.

What sort of chips and circuitry are the likes of the NES ever drive using to get that sort of speed?

Perhaps an alternative solution would be using the Arduino to program a chip on the fly, but that sounds not much different to just programming the chip manually on a donor.


Top
 Profile  
 
PostPosted: Thu Jun 14, 2018 3:40 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7380
Location: Seattle
Milesy303 wrote:
Thanks for the response, I thought that was maybe going to be the answer. Yes the Pi is slow, experience there but I thought the atmega chip at least had some sort of capable speed? The Arduino is reasonably low level compared to the Pi.
Yeah, still no.

It turns out that usually when you get a microcontroller that's fast enough to serve as a ROM emulator, it also grows enough complexity that it can't manage the latency.

Quote:
What sort of chips and circuitry are the likes of the NES ever drive using to get that sort of speed?
RAMs and an FPGA to emulate mapper hardware.

Quote:
Perhaps an alternative solution would be using the Arduino to program a chip on the fly, but that sounds not much different to just programming the chip manually on a donor.
It's true, but not having to physically unplug things and replug things does make it more convenient.


Top
 Profile  
 
PostPosted: Thu Jun 14, 2018 8:49 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3541
Location: Indianapolis
A while back I traced out and drew an (incomplete) schematic of the ROM emulator I used to always use. Wasn't something I built, it was designed in '93 and I bought a used one in '99. Connected to target board with an IDC to DIP adapter, you'd just plug that into an EPROM socket. On the other end, it connected to a PC's parallel port through an RJ6 cable, the "in" connector on the schematic. The "out" connector is so you could chain several of the boards together to emulate multiple EPROMs. Pretty sure there are buffers on the other side of the RAM chip that I didn't trace out and put in the schematic.
edit: also, those "reset" outputs are used to reset the CPU on the target board

That's pretty much the type of circuit you'd need to control the ROM with an MCU. Obviously could be done differently and better with an MCU instead of a few pins from a parallel port. If it's not helpful, I hope it's at least interesting.

Here's a currently available product that does this. At $175 + $12 it's kinda spendy, but it is very niche.
https://www.moates.net/ostrich-20-the-new-breed-p-169.html
http://www.moates.net/emuc3206-emulation-cable-32pin-6inch-p-168.html?cPath=32


Attachments:
TurboROM schematic.PDF [64.77 KiB]
Downloaded 59 times
Top
 Profile  
 
PostPosted: Sun Jun 17, 2018 4:33 pm 
Offline

Joined: Sun Jun 12, 2011 12:06 pm
Posts: 354
Location: Poland
Then you can put Atmega16/32, USB, RAM (628512 - 4 MBit), battery backup and you got perfect EPROM emulator, you can project the PCB to make the EPROM pinout like for DIL28 NES Mask Roms or any DIP32.
Atmega has 32 pins, 2 for controlling USB and 30 for controlling RAM (A0-A18, D0-D7, /CE, /OE, /WE).
Atmega has 3 state outputs so it will perfectly act in this role (put all memory-pins in three state mode at powerup and set them to outputs only when receiving command from USB)

With V-USB you can have 7kB/s real transfer rate so filling whole memory would take around minute.

Building cost should not exceed 5$.


Top
 Profile  
 
PostPosted: Mon Jun 18, 2018 1:43 am 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
lidnariq wrote:
Milesy303 wrote:
Thanks for the response, I thought that was maybe going to be the answer. Yes the Pi is slow, experience there but I thought the atmega chip at least had some sort of capable speed? The Arduino is reasonably low level compared to the Pi.
Yeah, still no.

It turns out that usually when you get a microcontroller that's fast enough to serve as a ROM emulator, it also grows enough complexity that it can't manage the latency.

Quote:
What sort of chips and circuitry are the likes of the NES ever drive using to get that sort of speed?
RAMs and an FPGA to emulate mapper hardware.

Quote:
Perhaps an alternative solution would be using the Arduino to program a chip on the fly, but that sounds not much different to just programming the chip manually on a donor.
It's true, but not having to physically unplug things and replug things does make it more convenient.


Thank you. I might just write something to play games on my C64 instead haha.


Top
 Profile  
 
PostPosted: Mon Jun 18, 2018 1:46 am 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
Memblers wrote:
A while back I traced out and drew an (incomplete) schematic of the ROM emulator I used to always use. Wasn't something I built, it was designed in '93 and I bought a used one in '99. Connected to target board with an IDC to DIP adapter, you'd just plug that into an EPROM socket. On the other end, it connected to a PC's parallel port through an RJ6 cable, the "in" connector on the schematic. The "out" connector is so you could chain several of the boards together to emulate multiple EPROMs. Pretty sure there are buffers on the other side of the RAM chip that I didn't trace out and put in the schematic.
edit: also, those "reset" outputs are used to reset the CPU on the target board

That's pretty much the type of circuit you'd need to control the ROM with an MCU. Obviously could be done differently and better with an MCU instead of a few pins from a parallel port. If it's not helpful, I hope it's at least interesting.

Here's a currently available product that does this. At $175 + $12 it's kinda spendy, but it is very niche.
https://www.moates.net/ostrich-20-the-new-breed-p-169.html
http://www.moates.net/emuc3206-emulation-cable-32pin-6inch-p-168.html?cPath=32



Thank you I will look into this option.


Top
 Profile  
 
PostPosted: Mon Jun 18, 2018 1:48 am 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
krzysiobal wrote:
Then you can put Atmega16/32, USB, RAM (628512 - 4 MBit), battery backup and you got perfect EPROM emulator, you can project the PCB to make the EPROM pinout like for DIL28 NES Mask Roms or any DIP32.
Atmega has 32 pins, 2 for controlling USB and 30 for controlling RAM (A0-A18, D0-D7, /CE, /OE, /WE).
Atmega has 3 state outputs so it will perfectly act in this role (put all memory-pins in three state mode at powerup and set them to outputs only when receiving command from USB)

With V-USB you can have 7kB/s real transfer rate so filling whole memory would take around minute.

Building cost should not exceed 5$.


I had considered using a couple of shift registers to reduce the number of pins needed. Thanks.


Top
 Profile  
 
PostPosted: Mon Jun 18, 2018 2:33 pm 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
Could you do something with PFGA fast enough?


Top
 Profile  
 
PostPosted: Thu Jun 21, 2018 4:59 pm 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
Can anyone recommend a FPGA dev board that would be suitable for this project?

I see the everdrive N8 only uses a Cyclone II chip so should be cheaper than the IV to do something similar with that.

What about the cheaper Chinese boards?


Top
 Profile  
 
PostPosted: Thu Jun 21, 2018 5:10 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7380
Location: Seattle
All preëxisting current FPGA dev boards are strictly 3V only; the NES is 5V. You can't directly connect the two without damaging one or both.

You might be able to find a historical one? I don't know.

The PowerPak contains an (by now very) old XC2S30 ("Spartan-2"), two 512 KiB SRAMs, a 32 KiB SRAM, and a 64 KiB chunk of flash. Nowadays the cheap iCE40 FPGAs are comparable in ability, but will need voltage translation.


Top
 Profile  
 
PostPosted: Fri Jun 22, 2018 1:42 am 
Offline

Joined: Thu Jun 14, 2018 2:50 pm
Posts: 9
This one takes 7.5 input. Can't see much about levels within though.

https://www.digikey.co.uk/product-detai ... gK2PfD_BwE


Top
 Profile  
 
PostPosted: Fri Jun 22, 2018 10:16 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7380
Location: Seattle
Sadly, even as old as that IC is, it's still not 5V tolerant.

( https://www.altera.com/products/fpga/cy ... pport.html § Cyclone II Device Handbook (All Sections) ; chapter 5 "DC Characteristics and Timing Specifications" says it supports a maximum voltage of 4.6V and makes no mention of tolerance of higher voltage (so it isn't).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group