Controlling 2A03 w/ Arduino

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

Post Reply
QuirkySquid
Posts: 2
Joined: Thu Jun 07, 2018 11:13 am

Controlling 2A03 w/ Arduino

Post by QuirkySquid »

Hey all,

I'm new to this forum, NES hardware, and really to electronics in general. I mostly work on the software side of things. I'm a musician, a coder, and a fan of classic chiptune, so I thought it would be really neat to try and build a synthesizer using an actual RP2A03.

I ordered a broken Famicom off of ebay, extracted the chip, and now my plan is to control it using an Arduino Mega 2560. My initial thoughts were to have the arduino do all the heavy lifting, sending the correct signals directly to the 2A03 without any additional hardware. My goal is to have the simplest design possible. However, I've looked at several other similar projects, and there's usually a bunch of extra hardware involved.

This is essentially what I had in mind:

Image

So here are my questions:
  1. 1. Is my plan feasible? Is it even possible to control the 2A03 with only an arduino?
  • 2. If it isn't possible, what additional hardware would be required?
  • 3. What are some good resources on how I could control the 2A03 (or any other required hardware)? In other words, where can I find out what signals to send from the arduino?

Thanks for reading, sorry if this is just basic stuff. I'm a complete noob to all this, so bear with me.
-QS
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Controlling 2A03 w/ Arduino

Post by tepples »

The MCU on your Arduino board will be acting as the 2A03's ROM and RAM. So you'll need to spoon-feed opcodes onto the eight data bus pins and react to what it outputs on M2 and a subset of the address lines. Most of these signals change at 1.8 MHz, one-twelfth of the input clock.
User avatar
pubby
Posts: 583
Joined: Thu Mar 31, 2016 11:15 am

Re: Controlling 2A03 w/ Arduino

Post by pubby »

The 2A03 is not a dedicated sound chip. It's a CPU with a sound chip tacked on, and you can't access the sound chip directly through the pins. You have to do everything by faking CPU data.

If you get stuck, you might find it easier to pick another sound chip. Here's an article of a guy controlling a commodore SID with nothing more than an arduino, for example: https://hatestheinternet.com/hackery/kr ... id-arduino
QuirkySquid
Posts: 2
Joined: Thu Jun 07, 2018 11:13 am

Re: Controlling 2A03 w/ Arduino

Post by QuirkySquid »

tepples wrote:The MCU on your Arduino board will be acting as the 2A03's ROM and RAM. So you'll need to spoon-feed opcodes onto the eight data bus pins and react to what it outputs on M2 and a subset of the address lines. Most of these signals change at 1.8 MHz, one-twelfth of the input clock.
pubby wrote:The 2A03 is not a dedicated sound chip. It's a CPU with a sound chip tacked on, and you can't access the sound chip directly through the pins. You have to do everything by faking CPU data.
Alright, that makes sense. I'll try to do some research on the opcodes so that I can figure out what signals I need to send. Thanks!
pubby wrote:If you get stuck, you might find it easier to pick another sound chip. Here's an article of a guy controlling a commodore SID with nothing more than an arduino, for example: https://hatestheinternet.com/hackery/kr ... id-arduino
I'd really like to get it working with the 2A03, but depending on how this project goes I might try to do something similar with the SID too.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Controlling 2A03 w/ Arduino

Post by lidnariq »

You basically will either have to
- Significantly underclock the 2A03 so that the arduino can serve as a ROM emulator. (You will additionally have to write this code possibly in asm, maybe C, and not using any of the convenience arduino methods)
- Provide some kind of ROM or ROM-like thing (examples: https://forums.nesdev.com/viewtopic.php?f=9&t=16964 https://forums.nesdev.com/viewtopic.php?p=30276#p30276 )
- Use one of the myriad sound ICs without also a CPU (YMZ284, SN76494, YMF262, &c)
User avatar
krzysiobal
Posts: 1036
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: Controlling 2A03 w/ Arduino

Post by krzysiobal »

Make atmega control CLK to the pin 29. This CLK pin should be connected to one of atmega's timer outputs.
During idle time (for example, when USB communication is in progress), you want to keep CLK at stable frequency to make generation of stable fruequency square/triangle sound waves. At that time, you also fed $4C to data bus to mimic JMP $4C4C opcode.

When executing special commands (like: play sound at frequency f), you programatically control CLK (and R/!W, address and data bus) to mimic feding asm opcodes.
Milesy303
Posts: 9
Joined: Thu Jun 14, 2018 2:50 pm

Re: Controlling 2A03 w/ Arduino

Post by Milesy303 »

I've controlled a C64 SID chip with a Pi. I a man going to use an Arduino soon.
Post Reply