It is currently Tue Oct 17, 2017 10:48 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Mon Oct 29, 2012 12:31 am 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
I've been playing around with the idea of building a GB flash cart for awhile, and figured I'd combine a few of the interesting cart mods I've found online, namely nonvolatile saves and a clone MBC5 synthesized on a CPLD all onto one cart. Eventually, I'd also like to work out a flash ROM solution using an in-production part (preferably something larger than 512KByte...), but that's a low priority for the moment. I'm doing the MBC5 clone myself from scratch since it seems xzakox never open sourced his project like he said he would (though Google seems to have managed to find at least 2 different revisions of his VHDL posted to pastebin, but I have no idea how complete those versions were, they at least make good references). Would anyone be interested in such a cart? Perhaps as an LSDJ cart, for instance (I'd require proof of donation, but I could pre-load it)? I know flash carts tend to be frowned upon, but it isn't like the SNES with ripoff repros grabbing huge prices on Ebay, and there are legitimate uses, such as LSDJ, so I figure it's worth at least asking...

I have an initial board laid out, currently using a donor MBC5, but once I work out the Verilog simulations to my satisfaction, I'll do another layout with the CPLD instead.
Image


Top
 Profile  
 
PostPosted: Tue Oct 30, 2012 7:21 am 
Offline

Joined: Mon Oct 22, 2012 6:38 am
Posts: 20
Do you mean something like that?

http://derpcart.com/

it has a non-volatile memory and usb connection. It is sold for 100$ and it is out of stock everywhere.

So if you could mass-produce your cart with non-volatile save, CPLD (i assume with low power usage) and a practical way to flash roms preferably usb, you would sell a lot.

But if you have the knowledge, you can go for a SD cart based flash cart. As far as i know there is nothing on the market for gb/gbc with mini/micro SD. This would fetch quite good money and it would interest not only LSDJ people also the gb retrogamers. I would be interested in such a solution with SD cart.


Top
 Profile  
 
PostPosted: Tue Oct 30, 2012 2:03 pm 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
There will most likely be several iterations of this cart project. The first step would be the one I have above, using a donor MBC5, an AM29F032-B Flash ROM, and an F-RAM nonvolatile save chip. The next step will feature an MBC5 clone in a CPLD (I will be using the same Xilinx CPLD as the project I linked above, it seems to be the best option for the features needed and the price). Once that is done, I will most likely try to make the transition to 3.3v logic for all of the parts. The F-RAM chip I'm using is already compatible with 3.3v, and there is a 3.3v version of the CPLD I'll be using available as well, so the whole point in moving to 3.3v would be to use a 3.3v Flash ROM, so I can use in-production parts rather than relying on obsolete 29F* chips. Also, once I've migrated to 3.3v parts, that opens up the realm of 64/128Mbit ROMs and 1/2/4Mbit F-RAM for multi-bank carts. I don't really plan to add USB, but my plan is to be compatible with Reiner Ziegler's USB programmer, as well as the rival-corp cart dumper (which I can't seem to get a link for, as the site's server seems to be down). SD is even trickier. The biggest problem is the lack of space inside a gameboy cart. It would have to be MicroSD due to physical constraints, and I don't know if I feel like going that route anyway.


Top
 Profile  
 
PostPosted: Tue Oct 30, 2012 9:40 pm 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 1905
Location: WhereverIparkIt, USA
Interesting project you've got here. I've always been curious about the gameboy mappers and dev/flash cart possibilities. I was surprised to see that the MBC5 was planned to fit in such a small CPLD (36macrocells). Did a little research and looks like it is a fairly simple mapper when compared to NES mappers I've replicated on the same series of CPLDs.

Having done similar development with the NES I've got a few questions/food for thought for you. Take it or leave it. :)

Is there a good reason to start by desoldering and using an original MBC5? I don't see how this is really very helpful towards the end goal. Seems like a headache to desolder/resolder and in the end you've only proved you can make a PCB and solder components. If those are skills you're looking to acquire I guess this step makes a little more sense. But if that's the case I can't imagine the fine pitch MBC5 being a very good first timer's exercise. Soldering new components is drastically eaiser than desoldering and resoldering used ones.

Being pretty familiar with that CPLD I can say you're pretty safe with just routing pins to available I/O on the CPLD based on the datasheet. The JTAG pins can only be used for programming, so route those to a ISP connector don't send any signals to these pins. The Global pins can be used a general I/O, the only thing you might have is a clock signal (not familiar with the pinout/signals myself). You can assign all the signals to the proper pins once you've got the HDL written for the MBC.

Anyways all I'm trying to say is it seems like you'd be better off using the xilinx CPLD for the first rev and perhaps just shoot for the simipler mappers and work up to the MBC5. This is really where you'll pick up the needed knowledge to complete the project IMO.

Do you have goals for power consumption? I've found these CPLDs aren't the most power efficient. It depends on a lot of factors but based on my experience I'd guess you can expect around 20mW. Shouldn't be too bad I guess, but it's probably 2-5 times what the original MBC5 consumed if I were to take a SWAG.

If you've got any specific questions about the CPLD/xilinx webpack feel free to ask. Would you be willing to post/share the VHDL files? I'd be interested in taking a peek out of curiosity.

Good luck!

_________________
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers


Top
 Profile  
 
PostPosted: Wed Oct 31, 2012 2:35 pm 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
Honestly, the first revision is mostly just to get *something* working as well as to test any pc-side software I may write to talk to the cart. That way, I can guarantee that any issues aren't due to my Verilog. Also, I'd like to just have a working cart with minimal effort, since I don't currently own one. I'd like to have a working cart *now* so I don't have to wait until I get one working. Desoldering is easy, but I'm not looking to go out and buy a bunch of donor carts just to rip out the MBC's and then resell them, so I can almost certainly say I won't sell any carts with donor MBC5's. So yes, the first rev I'll be looking to sell will be one with a PLD MBC. Do you have any suggestions for alternative PLD's with better power consumption ratings? I'm considering the XC9536XL once I move to 3.3v logic, but I'm not sure if the XC*XL line has better power consumption than the XC* line. I've looked into Altera's offerings, and I didn't find anything that seemed convincingly better. About the closest I found was a MAX7000 series that was available in a QFP44 package, but it was twice as expensive as the Xilinx chip. If you have any suggestions, I'd be happy to look in to them, but the other guy I saw working on this using the same Xilinx PLD seemed to think the power consumption wasn't that high.


Top
 Profile  
 
PostPosted: Wed Oct 31, 2012 11:55 pm 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 1905
Location: WhereverIparkIt, USA
Can't you do the same thing by putting flash on a MBC5 board with less effort? You're already hacking up the one game... One interesting thought I had would be to layout the board for the MBC5 but then put though holes surrounding the MBC5 so that you could put the CPLD on a breakout/surf board and keep everything the same and pull out the MBC and drop in the CPLD. I only bring it up because it's a pain to have to have PCBs manufactured for each step along the development process.

You won't really find any other CPLDs near that price range. 20mW probably isn't that bad in actual use. I don't know what kind of power the GB consumes, but if you figured that out you could determine the actual comparative effect if the cart consumed 20-30mW more than original carts. Even if you lost 1 hour out of 8-10hrs of battery life I don't think it'd be a deal breaker. Just make sure you've got it in low power mode, you can verify that in the fitting reports after synthesizing. You could even do your own test with a dummy resistive load while playing your gameboy and determine how good/bad the consumption is assuming the CPLD will consume 20-30mW.

I'm also confused about the 3.3v conversion issue... With the GB @ 5V (I assume for the brick, and the GBC is 2.7-3.3v?), either way if you've got 5V tolerant parts (which this CPLD is) and the GB's Vih is presumably well below Voh of your CPLD and memory. So I don't see where the actual 'conversion' would be, it's inherently 3.3v logic once you move away from original GB cart parts, Right?

_________________
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers


Top
 Profile  
 
PostPosted: Thu Nov 01, 2012 12:08 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6277
Location: Seattle
infiniteneslives wrote:
With the GB @ 5V (I assume for the brick, and the GBC is 2.7-3.3v?)
Tangenting: no, everything until the GBA micro had a boost converter to run the cartridge at 5V. I suppose old ROMs weren't specified to work below 4.5V or whatever. Dwedit was clued in years ago that in the game boy micro, they still had the GBZ80, and had only removed the alternate power supply. But this is all irrelevant to your point.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2012 12:34 am 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
Yeah, lidnariq got to it before I did, but all of the chips on the GB(C) cart run at 5v logic, not 3.3v. The GBC may run on 2xAA batteries, which is a 3v power supply, but it internally boosts that up to 5v which it runs off of. The fact that it runs off of 2xAA batteries was just nice for the size of the handheld, everything still runs off the same voltage (up until the GBA, which IS 3.3v, and it has a switch to switch to 5v when you insert a GB(C) game). This is not just the voltage supply value, it also affects what voltages drive the logic to each and every I/O pin on each and every chip on the board. The reason that I want to transition to 3.3v logic is that 5v Flash ROMs are all obsolete above 512KByte (Except Micron *supposedly* still manufactures 1Mbyte and 2Mbyte chips, but I can't find them available at ANY of their licensed distributors). Current production Flash ROMs have all moved to 3.3v. This is also true of the higher density F-RAM, though 5v chips are available up to 32Kbyte, which is the same size as a single SRAM bank on Zelda DX (which, AFAIK is the largest RAM size used, but I have done VERY little research into it, so correct me if I'm wrong...). I've checked, and 3.3v Flash ROMs are NOT 5v tolerant, so I actually do need to add level shifting on the logic pins in order to use a 3.3v Flash ROM on the GB. So, if I'm going to have to level-shift all of the logic going in to the Flash ROM, it would actually just be easier to level shift the entire cartridge and use 3.3v parts for everything. That would make board tracing much easier, and open the door to larger-density F-RAM if I felt so inclined. The biggest benefit, however, is like I said, the ability to use current-gen, in-production Flash ROM chips. Not only is this just smarter, it's cheaper, and it opens the door for larger ROM chips as well as RAM chips, meaning potentially multi-bank carts. USB would be nice, and that Drag-N-Derp cart is a pretty sweet design, but I don't know if I really want to go that route. Of course, I say that now and may eventually eat my words, but if I did go that route, I would start by designing a separate USB programmer, THEN attempting to miniaturize it and pack it into the cart, so I DEFINITELY won't go straight for an on-cart USB solution.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2012 12:47 am 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
infiniteneslives wrote:
Can't you do the same thing by putting flash on a MBC5 board with less effort? You're already hacking up the one game...

No, I only have TSOP Flash ROMs, which are 0.5mm pitch. You really can't hand-wire them. I could solder it to a breakout board to get solder pads at a reasonable pitch for wires, but at that point I might as well just make a full PCB... I actually enjoy designing PCB's. They aren't really that much of a hassle, plus it just looks awesome to have a professional end product rather than a wiring ratsnest.

infiniteneslives wrote:
One interesting thought I had would be to layout the board for the MBC5 but then put though holes surrounding the MBC5 so that you could put the CPLD on a breakout/surf board and keep everything the same and pull out the MBC and drop in the CPLD. I only bring it up because it's a pain to have to have PCBs manufactured for each step along the development process.


Anything through-hole would be too thick to fit in the cart. Also, you can't have anything on the back side of the board or it doesn't fit right, which includes through-hole pins sticking through. And like I said, PCB's really aren't nearly as much of a pain as you think. The only annoying part is turnaround time. I already have the layout (posted above), so the work is done. Why not get boards made after putting the effort in to get this far?

infiniteneslives wrote:
Just make sure you've got it in low power mode, you can verify that in the fitting reports after synthesizing.


Yeah, I'll definitely be asking around on the Xilinx forums for best practices on power saving once I get that far.

infiniteneslives wrote:
I'm also confused about the 3.3v conversion issue... With the GB @ 5V (I assume for the brick, and the GBC is 2.7-3.3v?), either way if you've got 5V tolerant parts (which this CPLD is) and the GB's Vih is presumably well below Voh of your CPLD and memory. So I don't see where the actual 'conversion' would be, it's inherently 3.3v logic once you move away from original GB cart parts, Right?


The XC9536 is 5V tolerant, as is the F-RAM I'll be using, but 3.3v Flash ROMs are not, and there are no 5v Flash ROMs in production anymore (at least nothing large enough to be useful here). So I can either rely on obsolete parts or do the work to do it right and get it working with newer ROMs, which I really would like to do, especially considering how much the price of AM29F032's can fluctuate... and even at their best they're still dang expensive compared to, say an M29W320.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2012 10:50 am 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
Another thing about switching to 3.3v, I just looked at the datasheets a bit more and once I switch to 3.3v, I will also almost certainly be switching from the XC9536 to the XC9536XL, which should cut power consumption by up to 40% over the XC9536, so that'll be nice...


Top
 Profile  
 
PostPosted: Fri Nov 02, 2012 4:02 pm 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
I got the PLD's in today, and I noticed when I compared the footprints between the PLD and the MBC5, and I realized that the PLD is larger than the MBC5 by a large enough margin that the 2 footprints can sit one on top of the other without the pads overlapping. It will take some re-tracing, but this way I can eliminate the need for an extra PCB run, as I can develop both my first and second iterations on the same PCB layout. Here's what it looks like without rerouting any of the traces (so there are pads overlapping existing traces, but you can see the outlines will work out, once I've retraced everything going in to the MBC5). I haven't added the JTAG header yet, but that will go on here as well.

Image


Top
 Profile  
 
PostPosted: Sat Nov 03, 2012 7:02 pm 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 1905
Location: WhereverIparkIt, USA
Looking good, I like the idea of em on top of eachother's foot print!

Here are some 5v 1Mbyte: http://www.digikey.com/product-detail/e ... ND/2744704

I guess you do have to level shift for the 2MB or more... My guess is you'd have to get those parts directly through micron assuming they are even still in production. The good news is you're going down on MOST pins. So you could just use voltage dividers for all the memory address lines. No need to shift mapper inputs. So it sound's like you'd only need a single level shifter for the data bus.

Keep in mind for testing and such you could probably run those non-5v tolerant parts at 5V inputs and keep the 3.3V supply. It'll put added stress on the part and not a good idea for the long term. But you could get by short term probably for development and testing.

Why not just use the XC9636XL off the bat with your 5V cart? Your 5V memory will still see 3.3V as a logic '1'.

_________________
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers


Top
 Profile  
 
PostPosted: Sat Nov 03, 2012 11:51 pm 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
I want to use all 5v parts until I am satisfied with the MBC5 clone. Level shifting, whether by resistors or actual level shifter IC's, is just added complexity which I would rather not have in my first iteration. I have no problem designing and ordering PCB's between iterations, so I'd rather develop a solid design that I reasonably think will work, then go from there. Understand that this is my first from-scratch, non-academic PLD project, so I want to start with a design that I can be almost completely certain will work as I implement and test my MBC5 clone. That in and of itself is quite an undertaking for me (though I have enough experience that I feel I can say it is not outside my abilities), and I want to start with a really solid circuit design, even if that means that this first run of PCB's really isn't all that interesting. So you might think of this first board as simply a test board for my PLD synthesis testing, before I go on to build my final project around the PLD once the MBC5 clone is fully vetted. At least with this design, I have the freedom to switch between the MBC5 and the CPLD on the same PCB, but I don't want to use an XL on this board, because although the I/O's are 5v tolerant, Vcc is not (absolute max 4.0v on Vcc). The final goal is to use only 3v parts on the cart itself. From what I understand, the MBC5 supports up to 64Mbit ROM and 1Mbit RAM, so that's probably the sizes I'll go with once I make the switch to 3v, as I know I can obtain in-production parts in those capacities with 3v logic. I may consider "cheating" with resistors on the input pins and only properly shifting the I/O's (which should just be the data bus), but I'll have to run it by my ESET professors and see what they have to say about that idea. I'd trust their experience more than my own conjecture, and although it may "just work" there may be unintended consequences that I'm currently unaware of, so I really want to check out the pros and cons of each method first. All the more reason to hold off on a 3v version for now.


Top
 Profile  
 
PostPosted: Sun Nov 04, 2012 12:07 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6277
Location: Seattle
infiniteneslives wrote:
The good news is you're going down on MOST pins. So you could just use voltage dividers for all the memory address lines.
I'd be worried about PCB space for that—for 20 lines, fitting 40 resistors larger than 0201s would be hard (and soldering 0201s would be a bear). Resistor networks would work, but they don't seem to sell any that are the right topology for this out of the box.


Top
 Profile  
 
PostPosted: Sun Nov 04, 2012 12:13 am 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 1905
Location: WhereverIparkIt, USA
sorry i wasnt trying to convince you to go all 3.3V in my last post. Realizing 5V 2MB flash isn't really an option I agree your best bet is to stay 5V on the first iteration.

I was just saying adding a 3.3V regulator and the XL is effectively staying 5V on the cart, only the mappers outputs are 3.3V which 5V parts don't care about. But there isn't much difference between the XL and non-XL so it doesn't really matter much I guess. The non-XL parts are disappearing/discontinued so I just kinda ignore the fact they exist, but if you've got some go for it ;)

lidnariq wrote:
infiniteneslives wrote:
The good news is you're going down on MOST pins. So you could just use voltage dividers for all the memory address lines.

I'd be worried about PCB space for that—for 20 lines, fitting 40 resistors larger than 0201s would be hard (and soldering 0201s would be a bear). Resistor networks would work, but they don't seem to sell any that are the right topology for this out of the box.


You'll fit resistors in the layout better than level shifters I'd imagine... I was suggesting it because of that fact. You could use normal resistor networks in pairs for each line. One set could have common ground and the other full parallel. Perhaps they wouldn't be much benefit though, I agree they would be a PITA for assembly...

_________________
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group