Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

#1 2019-06-17 21:46:47

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 60
Website

DIY flashcart questions (ROM chip and PCB questions)

I'm planning to port the game I'm working on to a physical cartridge once I have completed it.

The game easily fits within a 32KB ROM file and doesn't utilize save functions, so I should be able to get away with a single chip board. The problem is that I can't find any Gerber files (which I can send off for production easily) that don't call for a specific chip which has been discontinued for years.

I was hoping to ask if anyone had a more recent flashcart design. I'm looking to assemble these in bulk because I plan to sell physical cartridges at conventions and start an online store of my homebrew games. I know how to solder, but I know nothing about designing PCBs or choosing what chips to solder onto said PCB. I'm trying to keep this cheap as I want to, hopefully, sell these cartridges for about $10.

The two boards I was looking at called for an SST27VF256 in a 28 pin DIP casing while another called for an AT49F040 in a PLCC32 casing. Both of these chips have been discontinued for some time, so I am unable to purchase them (at least not at the price of comparable chips that are currently available.) I don't want to just ask "what are suitable replacements for these chips" as a Google search will sometimes yield suitable chips (though those are often discontinued as well,) I would rather learn what makes these chips suitable so I can locate replacements on my own (and pick out larger chips when I make games that require a memory bank controller.)

As long as I pick out a suitable flasher for my potential chip, do I just need to match specific specifications with the intended chip (memory capacity, minimum voltage, maximum voltage, etc.) to find a replacement? Or are there other factors I need to consider?

As for the board itself, I've seen one or two boards I would like to use, but the creators don't provide files. Instead, they sell pre-assembled cartridges with their own designed boards at the exact price I was hoping to sell my game at (so buying their cartridges isn't an option without selling my game at a price above what I intended.)

I was looking at this one, but it shows that it has spacing set up for an MBC chip which confuses me and the readme doesn't address it so I'm at a loss as to how to handle this one. Do I just solder a ROM chip on and not solder an MBC chip to use it for a 32KB ROM? Or do I need to solder something else on? I'm not sure.
https://github.com/dwaq/Homebrew-Gamebo … kB-variant


Also known as Arvex in other places.

Interceptor (Demo)
https://arvex.itch.io/interceptor

Offline

 

#2 2019-06-18 16:59:29

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 60
Website

Re: DIY flashcart questions (ROM chip and PCB questions)

In a bout of frustration over not being able to find a single chip board that uses a PLCC32 chip, I downloaded EAGLE (apparently the developers are very enthusiastic about the name because it's all capital letters) and began learning what I needed to design a cartridge myself, but I've hit a few snags from limited documentation. I've needed to use Wayback Machine to get some information while some just can't be found.

In my designs, I'm currently using SST39SF010A by Microchip Technology which seems to have similar specifications (or something similar, may have grabbed the wrong one this time.) It's a PLCC32 packaged chip, but I don't quite know how some of the pins line up with the leads on the chip.

Do I need to do anything with the pin 32 on the cartridge (ground) to ground it or does that lead into grounding built into the Gameboy itself?

Which pin do I connect to Chip Enable (CE#) to? I have conflicting information on this. Two sources show I'm supposed to connect it to pin 21 on the cartridge, but another two sources says that is for address 15 and don't specify what should be connected to CE#. Since I don't have an MBC, I would think I would need to use every address pin available.

And, for future projects, would I connect pin 3 (Write) to Write Enable (WE#) if I was designing a cartridge for a game that used save data? Or would that be routed through another chip first?


Also known as Arvex in other places.

Interceptor (Demo)
https://arvex.itch.io/interceptor

Offline

 

#3 2019-06-20 10:22:52

bbbbbr
Member
Registered: 2019-03-04
Posts: 126

Re: DIY flashcart questions (ROM chip and PCB questions)

Have you considered this cartridge? It's 32K and $10 before shipping and with a shell, so close to your desired price. You could ask them whether they have bulk discounts.

https://catskullelectronics.com/32kcart

Last edited by bbbbbr (2019-06-20 10:23:17)

Offline

 

#4 2019-06-20 14:32:45

gekkio
Member
Registered: 2016-05-29
Posts: 16

Re: DIY flashcart questions (ROM chip and PCB questions)

I just released GB-CART32K-A, which sounds like what you need: https://github.com/gekkio/gb-hardware#gb-cart32k-a
It's all open source and kicad+gerbers+schematics are available in the repository. I haven't actually had this design manufactured yet, so if you decide to use it, maybe manufacture 5 first instead of 100 to be safe big_smile
But I've designed and succeeded with some carts and other GB hardware before, so this should work perfectly as well.

For the flash, you need a 5V PLCC-32 flash ROM that uses the standard JEDEC pin layout. For example, any SST39SF series chip will work (but remember that only 32kB will be usable).
In addition, you need one 0.1 uF SMD capacitor (0603, 0805, or 1206. Use X5R or X7R, rated 16V or higher), and one 47k resistor in SMD package (0603, 0805, or 1206).

Ardis wrote:

I would rather learn what makes these chips suitable

In case of flash chips, I can think of at least two things: VCC voltage and pinout. The supported pinout depends on the board, but let's take my board and some PLCC-32 flash chips as an example...

Firstly, Game Boy is 5V and there's no level shifting on my board, so only PLCC-32 chips that work with 5V are ok.
AT49F040: OK, because datasheet says "Single-voltage Operation 5V Read 5V Reprogramming"
AT49F001T: OK, because datasheet says "Single-voltage Operation 5V Read 5V Reprogramming"
SST39SF010A: OK, because datasheet says "Single 4.5-5.5V Read and Write Operations"
SST39SF020A: OK, same datasheet as previous
SST39SF040: OK, same datasheet as previous
SST39LF010: not OK, because datasheet says "3.0-3.6V for SST39LF010/020/040"
SST39VF010: not OK, because datasheet says "2.7-3.6V for SST39VF010/020/040"
GLS27SF010: seems OK, because datasheet says "4.5-5.5V Read Operation". Spoilers: it's actually not going to be ok
SST27VF256 (in DIP-28) that you mentioned earlier, is not a 5V chip so it's not OK in a Game Boy cartridge.

Secondly, the pinout. This requires understanding the board you're using. My board is for JEDEC pinouts, and while some signals aren't really used, none of them are left floating. This means in practice that you can use different sizes of flash ROMs and they all work the same (32 kB is usable).
On boards that have floating address pins, you can't use a larger ROM chip than what the board is designed for.
My board supports the pinout used by AT49F040, so basically you can look for PLCC-32 ROMs with the same pinout (some signal names might differ slightly), and this requirement will be satisfied.
AT49F040: OK
AT49F001T: OK, but it's not immediately obvious why it's OK. The pinout is otherwise the same, but this chip has a #RESET pin where A18 is on some other chips. My board pulls the unused A18 pin high, so this chip would not be in reset mode and would work fine. Some other boards would probably not be compatible with this chip if they leave this pin floating or pull it low.
SST39SF010A: OK, correct pinout. This is a 1Mbit chip instead of 4Mbit like AT49F040, so some address pins are NC but this is fine.
SST39SF020A: OK, correct pinout
SST39SF040: OK, correct pinout
SST39LF010: OK, correct pinout
SST39VF010: OK, correct pinout
GLS27SF010: at a quick glance seems to be OK, but the problem is pin 1, which is normally A18. On these chips it's Vpp, which is programming voltage. If you want to flash this chip, you need 12V on that pin, but my board isn't designed to support this. -> not OK

Offline

 

#5 2019-06-25 16:32:37

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 60
Website

Re: DIY flashcart questions (ROM chip and PCB questions)

I initially looked into purchasing cartridges that were available for sale online, but couldn't justify the price. I doubt I could arrange a deal of better than $2-$3 off per cartridge as I do not intend to buy in that high capacity (if they are even interested in producing in the capacity I need since they may hand solder the cartridges themselves.) And shipping costs are also a factor that will push this into a non-viable option if I want to stick to the price I have set.



Thank you for your help, Gekkio. I'm still going to try to see my design through to at least a prototype just for the sake of developing newly learned skills (I picked up the free version of EAGLE and created my GB cart within a day, though it doesn't seem to export Gerber files properly.) I might try your other cartridges out for future projects that need more than a 32KB chip. I would like to see if I'm at least able to complete this one, but I'm getting confused as I research this more due to conflicting information I'm finding.

I tried to alter mine a bit based on what I saw on yours, but don't quite understand some of it. It looks like you have multiple pins (top middle on the chip) hooked up to the same circuit. Is there a reason for this? I'm trying to understand what pins on the chip match up to which pins on the cartridge.

https://i.imgur.com/aoCcQhrt.png
Click for larger image. Schematic is here.

I also wanted to understand which pin should be connected to the CE# (Chip enable/chip select) input on the chip.

I should also note that, for my design, I plan to flash the chips before I solder them to the board, so I don't need to write to the cartridge (keeps my board a little simpler, I think?)


Also known as Arvex in other places.

Interceptor (Demo)
https://arvex.itch.io/interceptor

Offline

 

#6 2019-06-25 17:39:17

gekkio
Member
Registered: 2016-05-29
Posts: 16

Re: DIY flashcart questions (ROM chip and PCB questions)

Here's all the cartridge pins using names that I use:

1: +5V
2: PHI (clock generated by the CPU chip, but it's not the main clock)
3: #WR
4: #RD
5: #CS
6-20: A0-A14
21: A15
22-29: D0-D7
30: #RES (active-low reset signal. This is an open drain signal, which in practice means either the Game Boy or the cartridge can pull this low to reset both)
31: VIN (analog audio input, but this pin is often reused as flash #WR signal)
32: GND

Now, the main thing when designing anything that connects to these pins is to fully understand the purpose of the pins you connect to. The data bus pins are shared, which means multiple chips are connected to them and chip select signals are used to control which chip is allowed to drive the data bus.
This has two implications: 1. only one chip select signal must be active at a time, and 2. you must not drive the bus when your chip select signal is not active.
On the Game Boy, there are two memory areas from the CPU point of view that are reserved for the cartridge: $0000-7FFF, and $A000-BFFF. You'll notice in the pin list that there's a pin called #CS, but this name is slightly misleading, because the Game Boy pulls #CS low when the CPU is accessing $A000-$FDFF.
When accessing $0000-7FFF the correct chip select signal is actually A15, because A15 is low when accessing that memory area and high at all other times. So pin 21 is A15 but also fulfills the role of #ROM_CS at the same time, and you must use A15 as the chip select if you intend to respond to reads/writes in $0000-$7FFF.
(as a side note, if you wanted to respond to $A000-BFFF, you can't just use #CS because it's also active during $C000-$FDFF accesses)
If you're curious about how the different signals behave during reads and writes, check out appendix C of gbctr: https://gekkio.fi/files/gb-docs/gbctr.pdf

Now, if A15 goes to #CE, what about A15-A18 on the flash chip? Since you're only using 32kB, A0-A14 are the address pins and A15 is the chip select, and other address pins can't be used.
In chips based on CMOS technology (basically everything nowadays), you should not let pins float (= left unconnected). This is a bit technical but good source (from 1994!) that explains the topic: http://www.ti.com/lit/an/scba004d/scba004d.pdf
So, you're not really using A15-A18 for anything useful, but they must be connected to something. On CMOS chips you can connect inputs directly to +5V or GND to "lock them" to either low or high value. In my design I used high value, because this gives me compatibility with PLCC-32 chips that have #RESET in pin 1. But if you're using SST39SF010A, you could connect A15-A18 to GND instead if you wanted.
Note that you have another unused input on the flash chip: #WE. This *MUST* be connected to +5V or you will have problems. The reasoning is the same, but this time we can't connect it to GND, because that would basically keep the flash chip in "write mode" all the time since it's an active-low signal.


TL;DR
A15 is the ROM chip select
Connect unused inputs to +5V or GND
Connect flash chip #WE to +5V

Offline

 

#7 2019-06-25 22:51:57

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 60
Website

Re: DIY flashcart questions (ROM chip and PCB questions)

Your help has been wonderful. I'm glad that you don't just give me the answers without explanation, but also explain why it is. I'm going to read through those articles now.

I wasn't planning to leave any floating/unsoldered pins, mostly just so the chip was more secured to the board, but I'll make sure to connect them to +5V in case I want to switch chips in the future.


Also known as Arvex in other places.

Interceptor (Demo)
https://arvex.itch.io/interceptor

Offline

 

#8 2020-05-23 05:22:58

alanFJ
New member
From: Tokyo
Registered: 2020-05-23
Posts: 5

Re: DIY flashcart questions (ROM chip and PCB questions)

Hi everyone,
Sorry first time poster, I hope it's fine to post on this old thread but content wise it is fit. Please tell me if I should repost elsewhere.

So I made my own PCB (32kB only noDMGx chip) and it works fine after a few iterations but only on GB Color. DMG and pocket recognize it and read it (proper Nintendo logo on boot), I get the Di-ding! sound and blank screen.
I tried with my own game or commercial roms, same: works nicely on GB color, not on DMG nor pocket. Conclusion something is wrong with the PCB, not the EEPROM not the way I write it.
I tried tying AUdio-in to VCC via a 40kOhm resistor, no change (as expected but being systematic).
My next suspects are :
* /CS that I did no connect: I tied the /CE of the EEPROM to GND since I thought that it would make no difference since there's no DMGx chip
* /Reset that I did no connect: I tied the /Reset of the  EEPROM to VCC

The rest is wired "as expected" I think, but I listed it on the webpage of the project.
What is your bet guys? Any suggestion please?
Thanks for any help, it's getting frustrating (3rd iteration of that board). I will update once I find the solution, for the good of future generation of tinkerers smile

http://electrogeek.cc/gameboy%20homebre … ridge.html
http://electrogeek.cc/files/20200517_231808.jpg

Offline

 

#9 2020-05-23 11:47:47

Tauwasser
Member
Registered: 2010-10-23
Posts: 160

Re: DIY flashcart questions (ROM chip and PCB questions)

alanFJ wrote:

Sorry first time poster, I hope it's fine to post on this old thread but content wise it is fit. Please tell me if I should repost elsewhere.

You could have created your own thread instead of hijacking this one wink But anyways, what's done is done smile

alanFJ wrote:

So I made my own PCB (32kB only noDMGx chip) and it works fine after a few iterations but only on GB Color. DMG and pocket recognize it and read it (proper Nintendo logo on boot), I get the Di-ding! sound and blank screen.
I tried with my own game or commercial roms, same: works nicely on GB color, not on DMG nor pocket. Conclusion something is wrong with the PCB, not the EEPROM not the way I write it.
I tried tying AUdio-in to VCC via a 40kOhm resistor, no change (as expected but being systematic).
My next suspects are :
* /CS that I did no connect: I tied the /CE of the EEPROM to GND since I thought that it would make no difference since there's no DMGx chip
* /Reset that I did no connect: I tied the /Reset of the  EEPROM to VCC

Oookay... Umm, just a guess, but is the red LED of your GBC less bright when you turn on your GBC without your cartridge than it is with the cartridge plugged in?
It sounds to me like you have bus contention. The #RD signal is used for accesses to WRAM inside the Game Boy as well, so every time something other than the ROM is read, you basically create a short circuit via the data pins of the EEPROM and the data pins of the WRAM.

You should definitely connect A15 to #CE of the EEPROM for now in order not to (further) damage your CGB or DMG.

alanFJ wrote:

The rest is wired "as expected" I think, but I listed it on the webpage of the project.
What is your bet guys? Any suggestion please?
Thanks for any help, it's getting frustrating (3rd iteration of that board). I will update once I find the solution, for the good of future generation of tinkerers smile

I looked at your Eagle schematic. The Website mentions RESET being tied to GND, but the text says EEPROM reset is tied to VCC. Also the AT49F040 does not really have a reset, to begin with, so what EEPROM are you using that has a RESET pin where A18 is?

Regards,

Tauwasser

Last edited by Tauwasser (2020-05-23 11:47:59)

Offline

 

#10 2020-05-24 03:22:36

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 249

Re: DIY flashcart questions (ROM chip and PCB questions)

As pointed out, CS is really the CS for the RAM portion of the memory map. A15 works as CS for ROM, since it happens to be 0 when the address bus is in the range 0-0x7FFF. As your board is connected currently, there's a bus collision with the RAM chips in the Gameboy which are on the same physical address and data bus, and are now active at the same time! (Just repeating what has been said.)

Here's a suggestion for anyone you or anyone else making a 32k cart using bigger EEPROMs. Please make the cart hackable by connecting the through upper address bits through cuttable jumper links with solder pads, instead of connecting them directly to ground. The links can then be opened and connected for example to a set of DIP switches to make the cart a multi 32k cart in the future if desired. Refer to the jumper library in Eagle, parts SJ_2 and SJ_2W. Ground to one side, +5V to the other and the address pin to the middle. Those are supposed to be soldered in one or the other position, but you could also connect a thin trace between the address pad and the ground pad as a default that can be cut so you don't have to solder those pads on each cart for default use.

Edit: I typed that for no good reason since it seems your (Alan's) cart does do that. I was looking at the screenshot.

Last edited by nitro2k01 (2020-05-24 03:25:15)


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#11 2020-05-24 11:11:29

alanFJ
New member
From: Tokyo
Registered: 2020-05-23
Posts: 5

Re: DIY flashcart questions (ROM chip and PCB questions)

@Tauwasser, @nitro2k01,

You rocks guys, thank you very much.
The answer was as you kindly suggested to connect the cartridge A15 finger connector to the EEPROM /CE. Works like a charm now on and the GB Color and the Pocket and DMG! Thank you so much.
FYI I didn't notice any dimming of the LED per se.

Regarding /RESET it was a typo, for indeed as I wrote in the comment it's tied to VCC (fixed on the page), thanks for finding it!
Regarding the EEPROM it's not this part I'm using exactly, it's other PLCC32 JEDEC compatible EEPROM I could source. Presently I'm using some Microchip SST39SF010A, but I scored a bunch of OTP AT27C202 that I plan to try at some point.

I think I'll make another final version with the corrected connection, and as suggested some space for a SMD piano switch to control the EEPROM's A15-A17 so you can have multiple ROMS on the same EEPROM. I'll post as a new proper thread once done if it can be helpful to anyone.

Again, thank you so much! smile
Alan.

Offline

 

#12 2021-02-05 19:26:29

303monkey
New member
Registered: 2021-02-05
Posts: 1

Re: DIY flashcart questions (ROM chip and PCB questions)

Hello there I am new to the forum and could do with some help.

Is there anywhere I can purchase Game Cart Copper Clad PCB's with the Gold fingers ready to be etched?

Thanks

Brian

Offline

 

#13 2021-02-07 09:16:12

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 60
Website

Re: DIY flashcart questions (ROM chip and PCB questions)

You'll want to make your own thread for that question.


Also known as Arvex in other places.

Interceptor (Demo)
https://arvex.itch.io/interceptor

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson