Some help with rewiring.

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

Some help with rewiring.

Post by xander »

Hello guys,

I'm trying my first NES reproduction tonight and I would like some advices on how to do the rewiring.

I am using EPROMS AM27C040 with the following shematics:

Image

I am trying to do a Bubble Bobble Part 2 from a Teenage Mutant Ninja Turtles 2. I desoldered the CHR and PRG Roms from the TNMT2 PCB and I am getting ready to try and solder my newly programmed EPROM on it.

My question is how do I know which pins from the EPROMs need to be rewired? I found lots of different schematic similar to the one of my AM27C040 but I'm not sure which one I have to use. Is the same pinout used for all PRG and CHR rom for every different mappers? Where can I find that information?

Thank you for your time.
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Some help with rewiring.

Post by Banshaku »

To my current understanding, the rewiring is not related to the mapper but related to the pin of the original mask rom. Once you know the pinout, you should be able to reroute the right pins regarding your current eprom.

I will try to help you with my current knowledge. I only know for now the rewiring of the PRG-ROM so let's start with this one.

I reused the chip diagram from my previous post and updated the chip on the left with your chip. This should make it even more easy to understand:

Code: Select all

AM27C040- 512KBytes (32pin):       PRG ROM - 512KBytes (32pin):

                  ---_---                      ---_---
           VPP - |01   32| - VCC    PRG A17 - |01   32| - +5V
           A16 - |02   31| - A18    PRG A18 - |02   31| - +5V
           A15 - |03   30| - A17    PRG A15 - |03   30| - +5V
           A12 - |04   29| - A14    PRG A12 - |04   29| - PRG A14
           A7  - |05   28| - A13    PRG A7  - |05   28| - PRG A13
           A6  - |06   27| - A8     PRG A6  - |06   27| - PRG A8
           A5  - |07   26| - A9     PRG A5  - |07   26| - PRG A9
           A4  - |08   25| - A11    PRG A4  - |08   25| - PRG A11
           A3  - |09   24| - /OE    PRG A3  - |09   24| - PRG A16
           A2  - |10   23| - A10    PRG A2  - |10   23| - PRG A10
           A1  - |11   22| - /CE    PRG A1  - |11   22| - PRG /CE
           A0  - |12   21| - O7     PRG A0  - |12   21| - PRG D7
           O0  - |13   20| - O6     PRG D0  - |13   20| - PRG D6
           O1  - |14   19| - O5     PRG D1  - |14   19| - PRG D5
           O2  - |15   18| - O4     PRG D2  - |15   18| - PRG D4
       GND     - |16   17| - O3     GND     - |16   17| - PRG D3
                  -------                      ------- 
Pin 01 (VPP) : This is the only one that I don't know. Since it's for programming and not a / pin, my guess is reroute to GND. But some else needs to confirms my guess
Pin 02 (A16) must me connected to hole 24
Pin 24 (/OE) must be connected to GND
Pin 30 (A17) must be connected to hole 01
Pin 31 (A17) must be connected to hole 02

Once you know the rewiring, you will have to decide if you bend the pins or cut the trace. Since it's your first try, I would suggest to bend the pins since the probability of making a mistake is high: I mixed one pin on my first try. But this is up to you and how comfortable you are with it.

As for the rewiring of the CHR-ROM, I don't know it yet but hope to learn it soon since I have another dev-cart on the way.

Hope this information will help you and that other people will contribute to this thread with the missing information (or correct my possible mistakes :lol: ).
xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

nice!

Post by xander »

Hi banshaku,

Thank you for your input.

The Vpp according to the datasheet of the AM27c040 is:
Vpp : Program Voltage Input. No real idea where to reroute this one either.

Thank you for the PRG chip diagram. Is it always the same diagram for all PRG chip accross every type of NES carts? Where did you find this diagram, it's exactly what I'm looking for (will also need the CHR one obviously :))
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

VPP should be connected to VCC when not programming.
Useless, lumbering half-wits don't scare us.
xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

Post by xander »

VPP should be connected to VCC when not programming.
Hmm.. so should I bend pin 01 (VPP) and pin 32 (VCC) and wire them together, leaving hole 01 and hole 32 empty?
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: nice!

Post by Banshaku »

xander wrote:Hi banshaku,
Thank you for the PRG chip diagram. Is it always the same diagram for all PRG chip accross every type of NES carts? Where did you find this diagram, it's exactly what I'm looking for (will also need the CHR one obviously :))
Yes, all roms are the same. They vary only depending on the size of the chip. I didn't know until recently. I found the information on the wiki:

Wiki page about pinouts

This page contain links about the pinout of the nes PRG/CHR roms (first one), eprom and other things too.
xander wrote:Hmm.. so should I bend pin 01 (VPP) and pin 32 (VCC) and wire them together, leaving hole 01 and hole 32 empty?
No. VCC must be connected to an electric source so it must still be connected to hole 32. VCC is the pin that gives power to the chip so if you don't connect it anywhere, it won't work :)

If you go with bending pins then:

Pin 1 (VPP) must be connected to hole 1 (or 2/3 since they are +5V holes too). You just past a cable from the bended pin 1 and connect it to an available hole or directly to pin 1. You don't have to bend pin 1.
xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

hmm

Post by xander »

Banshaku, that wiki link is invaluable, thank you!

Ok now I would like to try to clarify a point:

My donor board is TNMT2: 256Ko PRG, 256Ko CHR
My game to be reproduced is Bubble Bobble Part2: 128Ko PRG, 128Ko CHR.
My EPROM is an AM27c040: 512Ko.

When picking the right diagram to do the rewire (let's say PRG to keep the example simple), should I use the diagram of PRG Rom 128 Kbytes, PRG Rom 256 Kbytes or PRG Rom 512 Kbytes?

My guess would be to use the PRG Rom 256 Kbytes diagram, since it's the one of my donor board. Am I right?
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: hmm

Post by tokumaru »

xander wrote:My guess would be to use the PRG Rom 256 Kbytes diagram, since it's the one of my donor board. Am I right?
Yes, you could use that one. But since the board in question (TLROM, I believe) supports up to 512KB of PRG-ROM, you could use that one instead. Even though A18 (the highest address line) is not used by the game you mentioned, the board still has a hole for it.

It really depends on what you want to do. If you plan to use this board only with the 128KB game you mentioned, you should connect the 2 highest address lines (A17 and A18) to GND, write the 128KB code at the beginning of your 512KB chip and everything will work fine.

However, if you plan on making use of the full capacity of the board by installing a socket on it to run other games, you should wire A17 and A18 to their respective holes, following the diagram of the 512KB ROM. In this case, whenever you use a game smaller than 512KB, you'll have to replicate it to fill the entire chip.

Also keep in mind that CHR-ROM chips have different pin configurations than PRG-ROM ones.
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: hmm

Post by Banshaku »

xander wrote:My guess would be to use the PRG Rom 256 Kbytes diagram, since it's the one of my donor board. Am I right?
Yes and no. Like Tokumaru said, it depends what you want to do with it. If you do intend to use that board again for other games, then you should install sockets instead and wire it so you can use the full potential of the cart. In that case, you must rewire using the PRG-ROM 512k diagram and 256K for CHR-ROM. I forgot to mention that PRG-ROM and CHR-ROM are different wiring so check the wiki properly.

And you should check the wiki regarding your board too since it will make you understand what is the potential of it.

You can check about the specs of your board on the bootgod database: TMNT2 US board

If you're going to never change it again, you can just wire it the same way as the targeted chips. Like Tokumaru said, not used address pin (the extra A pins from your eprom) must be set to GND.

You make me interested to make my second dev-cart since it target the MMC3+CHR-ROM chip :) That way I would learn about the CHR-ROM wiring too.

One last (maybe) important comment, the mask roms (the chips on the nes carts) pin order will always be the same BUT the eprom/flash eprom and eeprom all have different ones. So if you decide to put sockets on it, you will always have to use the same kind of chips, always. So decide wisely which chips you want to use if you go that way. eprom always have to be erased with a special hardware so it kind of a pain. A flash eprom, the burner can do it so it quite convenient.

I'm still new to this but I hope the information will be useful for you.
xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

Post by xander »

If I understood everything correctly, in the present case of Bubble Bobble 2 being only 128Ko CHR and 128Ko PRG, my EPROM being 512Ko in size and my TLROM board supporting up to 256Ko CHR and 512 Ko PRG. I could have done my rewiring by using the diagram of 128Ko, 256Ko or 512Ko for my PRG and 128Ko or 256Ko for my CHR and any of those diagrams would have worked fine, it just depends on if I want to re-use the board or not. If I want to reuse the board, I should always aim for the highest capacity possible to increase my possibilities.

So, for my Bubble Bobble 2 on TNMT2 board, I will do the following:

Keeping in mind the following informations:

My donor board is TNMT2: 256Ko PRG, 256Ko CHR
My game to be reproduced is Bubble Bobble Part2: 128Ko PRG, 128Ko CHR.
My EPROM is an AM27c040: 512Ko.

I will:

Use the PRG diagram for 512Ko when I will do my re-wiring, and copy my Bubble Bobble Part 2 PRG file 4 times on my EPROM chip.
Use the CHR diagram for 256Ko when I will do my rewiring, and copy my Bubble Bobble Part 2 CHR file 2 times on my EPROM chip.

My reasonning behind this is that I am trying to find an "universal" technique to do my repros. Since my current EPROMs has a capacity that excede or match the maximum ROM size supported by the TLROM board, it's best to use the diagram for the biggest Rom possible, even if my game (Bubble Bobble Part 2: 128Ko CHR, 128Ko PRG) doesn't need as much. This way I will never really have to worry about deciding which diagrams I should use. I will simply always choose the one fitting the maximum capacity of the board (as long as my EPROMs' size match or excede that capacity).

Because I guess that if I would be using EPROMs of type 27c020 (256Ko) to do my PRG, I wouldn't be able to use the 512Ko diagram to do my rewiring, right?

As I was getting ready to finally try my hand at the rewiring yesterday, I noticed that sadly my EPROM programmer doesn't work =/. and I ordered a replacement, so my experiments are delayed until next week. I'll post a follow-up in this thread when I receive my new EPROM programmer.

If anything I've said in this post make poor sense or is wrong, please point it to me. I think I understood correctly but I want to be sure.

Thank you a lot for your time guys. I fully intend on producing detailed tutorials on the subject of reproductions and cartmodding in general once I get good enough on the topic. I understand that you guys have to deal with the same kind of questions about this stuff fairly regularly and it gets tiresome for you. Hopefully if my tutorials are detailed enough you will be able to direct new people to them.

So again, thank you for everything so far,

Alex.
Last edited by xander on Wed Dec 24, 2008 6:02 pm, edited 1 time in total.
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

I don't have time at the moment to post a long one (it's almost 2h here in japan) but basically your reasoning it fine: always try to use the max of the board. This way, you only have to worry about one rewiring schema. I will try to see if I missed anything about your email tomorrow.

And don't worry about being "annoying" and things like that: this is the newbie forum after all :) I ask all kind of similar questions too sometime.

Once you get better, if you do make a faq for beginners, we could put it in as a sticky thread and I'm sure it would contribute to everyone.

Edit:

Just to emphasize one point from your message: you won't use the max of the chip but the max of the board. For example, MMC3 board in general can support up to 512K or PRG-ROM but MMC1 ones is only 256k. In that case, you have to rewire for a 256k one.
xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

Hey guys

Post by xander »

Hello everyone!

I finally received my new EPROM programmer (a shiny GQ-4X) so I'm getting back at my first repro.

After some issues I think I finally did program the PRG EPROM correctly (I think so at least :)). I used tniNES to split my rom, but the result are two files of type .prg and .chr. Is it the good file extension to write on the chip? I tend to think the extension might be irrelevant since my impression is that the EPROM programmer will burn the content of the file, not the file in itself. So whatever the extension is, as long as the program controlling the EPROM programmer can open it and the content is in hex, everything should be fine. I am correct on this? Oh and I also used an hex editor to copy 4x the PRG file of Bubble Bobble 2, to get a 512Ko. file and fill the whole EPROM size.

Ok so. I'm standing there in front of my desoldered TNMT2 board with my PRG EPROM chip ready to be soldered back. I still want to make one last check with you guys before soldering it back. I'm not using a socket, and it will be my first big soldering job so I want to minimize my chances of screwing up. Desoldering all of this would be a pain.

I've made a little graphic based on what you guys said:

Image

So based on this:
  • Pin 01 would connect to hole 30
    Pin 02 would connect to hole 24
    Pin 24 would connect to hole 16
    Pin 30 would connect to hole 01
    Pin 31 would connect to hole 02
Which would leave hole 31 empty, and hole 16 would have connection from both pin 16 and pin 24. Anything wrong?

I know I still have the CHR rom to do, but I guess I will have the theory down on how to rewire an EPROM based on the PRG.

And thank you again for everything so far guys.
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Hey guys

Post by Banshaku »

xander wrote: Is it the good file extension to write on the chip?
No since it's binary data, so you don't have to worry about that.
xander wrote:Oh and I also used an hex editor to copy 4x the PRG file of Bubble Bobble 2, to get a 512Ko. file and fill the whole EPROM size.
This is one way of doing it. A simpler way (for me) is to just do a binary copy this way:

Code: Select all

copy myRom.prg 1

copy /b 1+1+1+1 finalRom.prg
xander wrote: I'm not using a socket, and it will be my first big soldering job so I want to minimize my chances of screwing up. Desoldering all of this would be a pain.
Just a personal comment but on your first try, the chances are very high that you will make a mistake so those things happens. So don't try to worry too much. You will learn from this one and after that the other ones will be easier. Just make sure you have a meter :)
xander wrote:Which would leave hole 31 empty, and hole 16 would have connection from both pin 16 and pin 24. Anything wrong?
I don't see anything wrong. The only thing different I did is instead of bending pin 16, the wire from bended bin 24 was soldered on pin 16 then the pin 16 was inserted into the hole. That would eliminate one wire BUT could make the chip a little bit higher.
xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

Post by xander »

Alright, thank you again for everything Banshaku, you're a prince man.

I'll wire it up friday and saturday and we will see how it goes, wish me luck :)
xander
Posts: 19
Joined: Wed Oct 22, 2008 9:03 am

SUCCESS!

Post by xander »

10 days later, a ruined PCB and EPROM later the final result is a big success!

Rewiring used:

Image

Image

Here are some pics of the final product:

Image

Image

Image

Image

Image

In the last picture you can see that with the pins bended that way I cannot close the case anymore. I'll try bending them downward or cutting them shorter. Anyway, lesson learned for my next project :).

A BIG thank you to Banshaku, tokumaru and Bregalad for your help.

When I'll be more used to everything I'll start building my tutorials on how to do some cartmodding. Thank you again for everything guys!
Post Reply