Does anyone know how to clock A Ricoh 2A03 "NES CPU" with an Arduino UNO. I was on this forum and saw someone with the same problem but, he just copied the NES clock. If anyone can help me thank you.
Links
Deceptive Forum: https://community.element14.com/technol ... k-and-2a03
PS
NES clock file below.
Clock A Ricoh 2A03 with an Arduino UNO
-
rowansimpson
- Posts: 2
- Joined: 09 Jan 2024
Re: Clock A Ricoh 2A03 with an Arduino UNO
I wouldn't think the UNO would be a great choice if you're using it to sniff the data/address busses of the 6502 (or related processor), that's because it is pretty slow in of itself at only about 16MHz. Also I doubt that Ricoh 2A03 is a static design, so you can't just hold the clock high/low arbitrarily like you can the more modern 65C02.
The Arduino Due is a bit faster at about 84Mhz; and the Teensy 4.1 runs at 600Mhz. These are 3.3V devices so you'll need a 74LVC245 to level shift the voltages.
The Arduino Due is a bit faster at about 84Mhz; and the Teensy 4.1 runs at 600Mhz. These are 3.3V devices so you'll need a 74LVC245 to level shift the voltages.
Re: Clock A Ricoh 2A03 with an Arduino UNO
It looks as if the person who "copied" the circuit copied the wrong transistor 
the original circuit passes the clock signal to two circuits, but it can be simplified or a functional equivalent designed.
For example this one https://www.circuitlab.com/editor/#?id=77hzacxtnxer
the original circuit passes the clock signal to two circuits, but it can be simplified or a functional equivalent designed.
For example this one https://www.circuitlab.com/editor/#?id=77hzacxtnxer
Re: Clock A Ricoh 2A03 with an Arduino UNO
rowansimpson wrote:
Does anyone know how to clock A Ricoh 2A03 "NES CPU" with an Arduino UNO. I was on this forum and saw someone with the same problem but, he just copied the NES clock. If anyone can help me thank you.
Driving that from an UNO isn't going to be easy.
You could feed it from a 1,2,4 or 8Mhz clock generated from a 16Mhz UNO without too much difficulty, but the whole thing will then run much slower by a factor of 12.
It's probably not the best 6502 variant to play with if you're doing the Ben Eater style Arduino analyser approach - a modern 65C02 would be much better as you can stop it and "hand crank" it without the worry of losing data.
-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Re: Clock A Ricoh 2A03 with an Arduino UNO
I think that this system does not need this clock at all and it would be better to connect one of the UNO pins instead and simulate its during read/write operation. In my opinion, core 6502 is not used in this project and its functions are simulated by UNO. In fact, only is used the sound circuit of 2A03
-
GlennSmith
- Posts: 162
- Joined: 26 Dec 2002
- Location: Occitanie, France
Re: Clock A Ricoh 2A03 with an Arduino UNO
Hi all
It is true that the internal processor runs at several hundred MHz, but the I/O system doesn't... I have tried to use a teensy 4 to do bus snooping, and it is not very easy. Internally it has to slow down & synchronize to be able to talk to internal devices, and generally has to slow down even to do port I/O. And the voltage translation adds extra delays unless you use FET buffers...
My 2cents worth.
Quote:
... and the Teensy 4.1 runs at 600Mhz. These are 3.3V devices so you'll need a 74LVC245 to level shift the voltages.
My 2cents worth.
Glenn-in-France
Re: Clock A Ricoh 2A03 with an Arduino UNO
GlennSmith wrote:
Hi all
It is true that the internal processor runs at several hundred MHz, but the I/O system doesn't... I have tried to use a teensy 4 to do bus snooping, and it is not very easy. Internally it has to slow down & synchronize to be able to talk to internal devices, and generally has to slow down even to do port I/O. And the voltage translation adds extra delays unless you use FET buffers...
My 2cents worth.
Quote:
... and the Teensy 4.1 runs at 600Mhz. These are 3.3V devices so you'll need a 74LVC245 to level shift the voltages.
My 2cents worth.
Really, if you're going for a logic probe, you'd be better served by using one of the many logic analyzers out there.
George Foot goes into detail about one such analyzer on his YouTube channel.
As drogon pointed out, and I concur, the 2A03 isn't going to be the best option if you're trying to learn about the 6502 in general. It was very purpose built to be used in the NES and not much else. Getting an inexpensive WDC65C02 from someone like Mouser or Jameco would be much easier to work with as you can single step the clock or run it off of a fairly slow 555 timer and still see what's going on.
Re: Clock A Ricoh 2A03 with an Arduino UNO
Welcome, rowansimpson!
It seems to me there are a few things going on with your original query and in the thread you linked to.
- as noted, if you want to run a NES-like system, you need to inject a rather fast and very specific clock frequency. You will have a free-running 6502-like core and your microcontroller will need to meet tight deadlines to serve memory accesses.
- if you do want a free-running core, you don't necessarily need exactly the circuit found in the NES, or anything like it. An oscillator, or clock can, in four pin format (full size or half size) is much more convenient than a crystal with components around it. It directly produces a clock with full swing voltage. For this specific frequency, there's nothing in stock at Mouser, but there are parts available on Ali Express. Shop around, with care.
- if, on the other hand, you want to drive and control the clock from your microcontroller, and if you just want to get a working 6502 which you can investigate, with no need for sound or video at NES rates, then a much slower clock, even an irregular clock, will be absolutely fine.
Hope this helps, and good luck with your project
(Using hoglet's protocol analyser with a very cheap logic analyser is a great technique and idea, and George's video is very good. In earlier times, "logic analyser" could mean a piece of equipment costing hundreds of dollars, and still a lot of human interpretation needed. Now, we're down to tens of dollars, and get a very high level result with minimum brain strain.)
It seems to me there are a few things going on with your original query and in the thread you linked to.
- as noted, if you want to run a NES-like system, you need to inject a rather fast and very specific clock frequency. You will have a free-running 6502-like core and your microcontroller will need to meet tight deadlines to serve memory accesses.
- if you do want a free-running core, you don't necessarily need exactly the circuit found in the NES, or anything like it. An oscillator, or clock can, in four pin format (full size or half size) is much more convenient than a crystal with components around it. It directly produces a clock with full swing voltage. For this specific frequency, there's nothing in stock at Mouser, but there are parts available on Ali Express. Shop around, with care.
- if, on the other hand, you want to drive and control the clock from your microcontroller, and if you just want to get a working 6502 which you can investigate, with no need for sound or video at NES rates, then a much slower clock, even an irregular clock, will be absolutely fine.
Hope this helps, and good luck with your project
(Using hoglet's protocol analyser with a very cheap logic analyser is a great technique and idea, and George's video is very good. In earlier times, "logic analyser" could mean a piece of equipment costing hundreds of dollars, and still a lot of human interpretation needed. Now, we're down to tens of dollars, and get a very high level result with minimum brain strain.)