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.

Ads

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

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 16
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

Offline

 

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

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 16
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?

Offline

 

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

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

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
New member
Registered: 2016-05-29
Posts: 9

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: 16
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?)

Offline

 

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

gekkio
New member
Registered: 2016-05-29
Posts: 9

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: 16
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.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson