Wednesday, September 25, 2013

Using the Gameboy Programmer Board

Granted you have either bought a complete board from me or followed my DIY setup guide to a 'T', you are ready to use your Programmer/Reader board.

You'll need the software for the PC-side communication. You can find it on the author's site here:
http://www.reinerziegler.de/readplus.htm#Home made programming systems

Click the link "GB Cart Flasher programming software V1.1" and download the files. Install it where ever you like. If you are using Windows 7, you may need to run it in compatibility mode for Windows XP. I do and it works. If you don't know how to do that, right click on the shortcut and click properties, then check the box for compat mode and choose Windows XP. Then hit OK.

Image Hosted by ImageShack.us

Ready!

READING DATA

Plug in your device and then start the program. I like to make the window larger because there is a readout of what is happening. The readout should state that the program has started, whether it finds the device and then what firmware version is running on the device.


Image Hosted by ImageShack.us

Plug in a cartridge and hit "Cart info" to make sure that the cart has a proper connection. If everything is unknown and there is no "--ROM/FLASH content information" then remove your cart, clean the contacts and try it again.

Eventually, you should get a good connection and it will look something like this:


Image Hosted by ImageShack.us

take this info and set the boxes on the left to reflect it. In this case, we can see that the ROM is 512KBs, the RAM is 8KBs and the MBC is MBC1. It may not be necessary, but I will change the MBC to MBC1 rather than Auto just to be safe. Set those boxes, hit "Read Flash" and designate a save location.

The progress bar starts moving and the readout states that it is reading. After a time depending on the ROM size, you'll see ">Success!" Follow the same method to backup your save files but hit "Read RAM" instead.

Image Hosted by ImageShack.us

As you can see above, I backed up both files. Save files are not compatible with all emulators, but they are good to keep on hand since the internal batteries are dropping like flies now-a-days.


Image Hosted by ImageShack.us


WRITING

The method to write ROMs and RAMs is the same, but just with two different buttons.
Plug in your "flashable" cartridge and click on "Cart Info" again. You'll either be given the contents as before or you'll be given the "Cartridge is blank, damaged or not connected" message. Hopefully, it is just blank. ;)


Image Hosted by ImageShack.us

In any case, hit "Erase FLASH" and wait for the process to complete, otherwise you will get a timeout error if the ROM is already full.


Image Hosted by ImageShack.us

Once it succeeds, press "Write FLASH" and browse for your ROM. It will go through the process and complete.


Image Hosted by ImageShack.us

Thanks for reading and Enjoy your gameboy!
~Jazz

Sunday, September 22, 2013

Populating the GB-Programmer (Jazz-Assembly #1)

The board has been designed to accommodate different methods of programming the Atmega8515 (hereby simply called 8515). Once programmed, you may never choose to reprogram it again because there may never be updates to the firmware anytime in the future.

Step 0.
Admire your beautiful new toy. 

It shall prove to be very useful regardless of your individual purposes. Also, at no time should you power your board until I say so.

Step 1.
Soldering both SMT ICs

The picture below is of two board prior to me cutting them apart. To reduce cost, I panelized my design.


Image Hosted by ImageShack.us

You may choose to solder one IC at a time or both at once depending on your skill and resources. It would be highly suggested to use either a hot air gun or some type of oven and solder paste. Soldering by iron is perfectly possible, but creates more chance for failure. If you are a frequent reader, you should know that I now own an awesome hot air station, so I also bought a tube of solder paste.

Simply apply a very small amount of solder paste to the bare pads and carefully place your IC over top of them. Make sure that it is aligned as closely as possible, not forgetting to orient pin 1 in the right direction. Pin 1 is designated by the white circle on the board.

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Once you finish both ICs, make sure that there are no shorts in places that they may not be. If you find one, attempt to draw the solder off of the pins with your iron or solder wick. Check it again and once satisfied, move on.

Step 2.
Through-hole components.

As much as I had hoped not to use any through-hole components, my audience insisted. The through-hole components required include:

2x 0.1uF ceramic capacitors (may be labelled 104)
1x 4.7uF electrolytic capacitor
1x 10K ohm resistor
1x 1K ohm resistor
2x 220 ohm resistors
2x LEDs (two colors)
1x female USB type B connector
1x gameboy cartridge connector

For the time being, do not populate C4, R6 and R7. These are not relevant at this time. You may choose to use a 6MHz ceramic oscillator, but I suggest saving the money and moving on. If you do though, cut the trace leading from it to the FDTI chip.

Start by placing the leads into the holes and bending them away from center so that they stay in place. Sodler each component on the underside and clip the legs at the board. Some people would suggest to clip them before soldering though.

Also make sure that the electrolytic capacitor (C3) faces negative lead down as shown below. Each components has the appropriate value marked on the board, so you cannot go wrong. Seating the gameboy cartridge connector may be the most difficult through-hole component. It has the most pins and each of these pins could be slightly bent from originally removing it. Take your time and do not stress.

Image Hosted by ImageShack.us

The LEDs can be any color you like, but know that the one farthest from the resistor is power and the other one is activity. I prefer my toys to have a green power LEd. ;)

Image Hosted by ImageShack.us


Step 3. 
PC Connection

Check your SMT soldering ONE MORE TIME. If and only if there are no shorts between pins, connect the board to your PC and cross your fingers... IF all is well, the LED should light up and a driver should automatically install for your device. It will also be given a COM port number.


Image Hosted by ImageShack.us

Step 4.
Programming the FT232RL and 8515

Thats right, you're going to program both ICs. There is only one modification that needs to be made to the FT232RL (hereby simply called 232) which is to make it output a 6 MHz clock rate. This is for the 8515 to run on.

First, the 232's internal eeprom must be modified. To do this, we will use FT_Prog found on the FTDI website here:
http://www.ftdichip.com/Support/Utilities.htm#FT_Prog

Only one modification must be made and that is to change the CBUS0 pin to act as a 6 MHz clock. We will not worry about the other pins because they are all unconnected. CBUS0 is one of five programmable I/O pins and there are many options to choose from, but I am not going to cover these here.

Install FT_Prog and run it. You'll be greeted by a well designed GUI ... just don't touch anything. plug in your device and it should install a driver if it has not already. Once "Your device is ready to use" go ahead and click "Scan and Parse" which looks like a magnifying glass. Your device should pop up in the dialog box under device tree like this:

Image Hosted by ImageShack.us

You can see that your device is already programmed, but we must now change one function. Expand the device tree as such:
FT EEPROM -> Device Specific -> IO Controls -> C0
Use the drop-down to select CLK6 in the C0 bus only. The other pins are all useless as they are not connected to anything. Ignore them.

Image Hosted by ImageShack.us

Click on the lightning bolt which is the program button, make sure your device is selected and press "program" if and only if you are positive you did not change any other settings.
The bottom of the window will say finished and then ready. Close the window and close FT_Prog, then disconnect your programmer.

Image Hosted by ImageShack.us

Reconnect your device once more and it should install the drivers again and give it a new COM port. You can now move on, but if you were to open your device in FT_Prog again, you would notice that C0 is still set to CLK6. Good job!

Just a note, but the reason you should not touch any other options in the eeprom settings is because there are too many settings that can be set incorrectly. For example, if you were to program your device to use an external oscillator, it would be rendered useless and you spent a lot of time and energy soldering that chip perfectly! So be careful!

Step 5.
Programming the 8515.

The easiest way to program the 8515 is via FTDI BitBang. It is a totally new concept to me, but incredibly useful considering how much people want to charge for ordinary ICSP programming kits. It may be a tad bit slower at programming, but since you will only program the 8515 once, it does not matter.

I put together a file-pack to get you started. This pack  includes AVR_DUDE, my custom config file special for this programmer and the hex file which needs programmed to your 8515. I am writing the guide on the GUI version of AVR-DUDE. Everything is easier with a GUI, though you have to show a little love for the tried and true command prompt. ;)

Download it here:
http://www.noisechannel.org/wp-content/uploads/2013/09/GB-Progger-kit.zip

Lets get started.

Go ahead and hook up your programmer if it is not already. Open avrdude-GUI.exe.
1. Direct the first box to your avrdude.exe
In our case, we will be using the avrdude-serjtag that you downloaded.
2. Pull down the "Programmer" Box and select the "FT232R Synchronous BitBang for Jazz (GBProgger)."
3. Leave the port drop box blank.
4. Locate "ATmega8515 (m8515)" under the "Device" drop-down.
5. Type "-P ft0 -B 4800" in the "Command line Option" box. It should look just like this below:


Image Hosted by ImageShack.us

6. Click the "Read" button under Fuse. This will show you the fuse bits on your 8515 which must be changed. It does not matter what they are now.


Image Hosted by ImageShack.us

7. Change the fuse bits to C910 as pictured and hit write. It will be very fast and just ask you if it went well.


Image Hosted by ImageShack.us

8. Now erase "-B 4800" from the "Command line Option" and browse for the hex file under Flash then hit write. It is also fast, too fast for me to get a screenshot even.


Image Hosted by ImageShack.us

9. Exit and done. Disconnect your device and reconnect it. If all went as planned, you now own a GB Programmer and Dumper for whatever needs you may have.

Lets test it out, shall we? That is another blog post, for another time. See you then! :D

 Cheers,
Jazz

Acclaim Custom IC - Sega Genesis/MegaDrive

While viewing different game cartridge boards for the Sega Genesis, I came across a few Acclaim boards. I no longer can remember what games they were because I have long removed the Mask ROMs, but one board has three 74-series ICs and a 2k eeprom for saving purposes. The fact that they utilize both parallel and serial communication methods causes problems for me, but we will get to that later on. In any case, the second board contains the 20-pin "Acclaim LZ95A53" IC (datecode 9453 A). this board also contains a 24lc04, which is double the size of the 24lc02 on the other board.

While searching the custom chip, I found that there is little information on it. I can only come to the conclusion that it is a custom memory mapper AND parallel to serial data conversion IC.

The three ICs on the first board from Acclaim are the 74ALS138 decoder used on many many other boards for memory expansion, a 74ALS74 Dual D-type flip flop and a 74ALS125: Quad bus buffer with three states. I cannot prove this theory yet, but I believe the Acclaim LZ95A53 is all three of these ICs built into one. 20 pins could easily achieve this since many pins are shared and many others are not used at all on the other chips.

Here is the first circuit board with all four ICs. Four ceramic capacitors, one electrolytic and two resistors. The board originally had only one mask ROM so I assume it was a game of 2MBytes.

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

And here is the circuit board with only two ICs. The custom "Acclaim LZ95A53" can be seen at the top right. By reducing the three chips into one, they also reduced the required space on the board, reduced component count and most likely cost. They also switched from their own board to a board made by Liteon. There are several improvements that I can see on the board when they made the switch. Not only is the copper much more smooth but the solder mask is shiner and they even tented the vias. I rarely see tented vias on game boards. The drills are also smaller and less sharp. The previous board has splintering around all of the drills.

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Looking at the revision designators on the boards, the liteon is newer. One more thing that I noticed about both boards is that neither have break marks to show that they were panelized. Acclaim chose to finish off the sides very nicely which is odd. Game boards were technically not supposed to be seen by the end user, but they took the extra time and effort to clean them up as opposed to (looks over at other boards on desk) konami and Capcom. A third Acclaim board that I own which is yet older than the two in detail above has also been finished on all four sides.

In conclusion, Acclaim seemed to have cared a little more about the games that they produced. Going the extra mile to make their boards of higher quality and to develop proprietary ICs. I can respect them for this though I never had any doubt about them. EA on the other hand...made boards that I despise. I may post about them another time. For now I will be following the pins on the LZ95A53 back to their origins and proving whether or not it is simply a combination of three 74-series ICs. Granted it is, I will have a pinout shortly there after.

EDIT:

I have since begun following pins on the board from the custom chip to other locations. So far it would seem that I was correct, mostly. The chip is definitely decoding ROM address and possibly RAM addresses (granted your board requires parallel RAM) and has connections with the Serial RAM; however, it is also making connections to the !AS pin on the 68000 and the !LDSW and !UDSW pins. these pins are beyond me, but I have read they have to do with writing only a single byte at once rather than the full 2-bytes (16-bits) that it capable of.

I will continue to edit the diagram below once I have more information:


          __  __                  
A20    1=|      |=20   VCC     
A21    2=|      |=19   NC 
/C_OE  3=|      |=18   !OE2(ROM2)     
/C_CE  4=|      |=17   !OE1(ROM1)     
/AS    5=|      |=16   NC
D0     6=|      |=15   NC     
/RES   7=|      |=14   NC     
/LDSW  8=|      |=13   NC
/UDSW  9=|      |=12   SDA(24lc04)
GND   10=|      |=11   SCL(24lc04)
         |______|

Also note that pin 12 which connects to SDA of the serial eeprom is also connected to VCC via a 10K ohm resistor. I assume this is a pull-up resistor for data  

Tuesday, September 17, 2013

Gameboy Cartridge Reader Update

It has been a long and wonderful journey since the beginning of this project and if given the chance, I would do it all over again. For any readers who did not purchase a board, we are closing in on the end of the project. All of my boards and parts have arrived and I am simply pumping out completed board one after the other. Surface mounted components are very easy to do granted you have a hot air station, which I clearly do! Now that I have a little practice on the machine, SMT components take less time than through hole components. An FT232RL chip takes me less time to solder than a Through-hole resistor! Who would have guessed?

Anyhow, I know that all you're waiting for is pictures, so here they are:
In rough order from delivery to completion.

  Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Tuesday, September 10, 2013

GameGear CPLD Cartridge

After researching PLD for my Atari dev cart, I remembered a time when I was trying to figure out a Gamegear flash cartridge. It is simple enough, but I had little luck because I was still very unlearned at the time when it came to Addressing bits.

Anyhow, I came across a Caesar's Palace Cartridge by Majesco which utilizes a CPLD! At the time I figured that I would never see one again, nor would I care at all if I were to. Now I care very much because they are pretty damn incredible devices!

The pictured CPLD is by Xilinx and now that I think about it, I really should locate it once more and dump the program on the CPLD. I dumped the game ROM, but it was exactly bit for bit the same as one I ... erm ... 'found' online.

Image Hosted by ImageShack.us Image Hosted by ImageShack.us Image Hosted by ImageShack.us

below is some pictuyres I took when I was trying to make that flash cart. I really wanted to play the Translated Phantasy Star on actual hardware, but I never got to before dropping the project.

Image Hosted by ImageShack.us

My drawing is flawed in that the highest address pins are connected to VCC and I programmed the ROM at the lowest bank which would place it at a point where the highest Address pins would all be low. Haha, silly me. had I simply filled in the extra ROM space with the ROm over and over again, it would have worked. I'll try again in the near future, no worries.

Below are more pictures of the bare board. Good times. lol
See how I ruined a few pins by pulling the pads up? That was a long time ago and I am proud to say that I can do much better.

Image Hosted by ImageShack.us


Image Hosted by ImageShack.us

Even though the game gear is a terrible handheld, battery- and longevity-wise, it uses some great technology. Some things I like the most are the fact that it has all of the fingers on one side of the board, such as the gameboy. The atari the fingers on two sides, which gets annoying when designing a board. You'll also notice that every component is Surface Mounted; caps and Mask ROM included. This makes the size of the complete board much smaller and able to fit inside of the cartridge shell much more comfortably.

I may try to make a flash cartridge in the near future. One such cartridge that will use a CPLD so we can address higher memory addresses and will utilize saving features with a battery just because it is easier. If I stuck with those parameters, it should be able to support more official games as well as any homebrew titles.

I really like looking back on past projects and seeing how I could have done them better with what I know now. I am still rather new to EE, but I have every last bit of motivation and hunger for learning. I hope I can go back to school soon. I would really like to pursue my Master's degree next if not at least another BS degree.

Thanks for reading,
Jazz

Atari 2600 Development Cartridge *Super Deluxe*~!

So I decided to design another dev cart for the Atari fully aware that there are so many others already out there. What can I add, what can I change, how can I make it smaller, cheaper and more reliable?

To begin with, I decided to go with the very most basic design: A ROM. Thats it, just ROM. As everyone else puts it, the current number of ROM chips are all low enable whereas the Atari originally used high-enable Mask ROMs for whatever reason. This means that the /CE pin must be connected to a low output, but GND may not suffice if there are timing difference with the program (or so others say). basically, the low input must be that of a low output from the address bus. Fair enough, lets sacrifice the A12 pin since most games are not above 4 Kbytes anyhow.

A12 is technically the 13th Address pin so to calculate the total addressable memory, we take A0 through A11; which is 12 pins. The numbers one and zero are the 2 useable addressing bits, so 2 to the power of 12 = 4,096. But there are 8 data pins, so 4,096 x 8-bits or 4Kbytes. That was easy! This cartridge will be able to hold software up to 4,096 bytes.

So what makes my cartridge different than others? Mostly component choices. I have a different flash rom than others use and I am also getting into SMD components. A year ago while I was working on Gameboy flash cartridges (hand-built, not professionally printed) I made a few successful carts and on a whim clouded by pure excitement I bought 50 49f040 512KByte eeproms. They were so cheap that it didn't make much of a difference...unfortunately I have been sitting on them for the entirety of that year. These chips are in the PLCC package, meaning they are surface mounted or placed in a socket. My NOT gate is also SMD. I chose the 74HCTG04 because there is only one gate and it is tiny! My decoupling cap is also SMD, but I placed the option for a through hole cap too just because I had to get the VCC trace to the bottom of the board and why not?


Image Hosted by ImageShack.us Image Hosted by ImageShack.us

So...I made a mistake. Can you see it? I chose the closest library file I could find and went with it. The 27c040 has a different pin-put than the 29f040 and 49f040. VPP is non-existent and the /WR pin is in place of A18 which has been moved to where VPP was. VPP is the programming voltage which is around +12v or something. Besides, who uses PLCC chips with UV windows anymore? lol


Image Hosted by ImageShack.us Image Hosted by ImageShack.us

Can you see the difference in the board? Probably not since it is so incredibly small of a change. Again, A18 was moved but still connects to GND and I pulled /WE high since we don't want any accidental programming. /WE is right next to VCC, so there is a tiny bridge between them.


Image Hosted by ImageShack.us Image Hosted by ImageShack.us

Here are the 3D images I created. You will notice that my QR code has holes from the drills, but actually my through-holes are all tented which means the solder mask (green stuff) goes over them. Pov-ray doesn't seem to want to display this but they are indeed. I need to figure out text though, because each time I add my URL, it is moved to the right. It bothers me and gets messed up in the gerbers and on actual boards....hmm... Another problem I have with Pov-ray is the limited 3D images. My inverter above the caps is not displayed and I have no clue on how to add more images.

Now that that board is out of the way, lets improve it! 4Kbytes is sad to program for if you have a really great idea for a game or software. How does 8Kbytes sound? Now how about 16KB or even 32KB sound!? NOW HOW ABOUT 64.....we'll do that one later. ;)

J. Grand (or Pixel Past) with Grand Idea Studios created a cartridge that uses a SPLD or Simple Programmable Logic device to add up to 32KB of addressable memory. This can be used many different ways, however the main idea is that you may access 8 banks of 4KBs by addressing "hot spots" to switch banks.

The only problem is that he wrote a program for a now-obsolete PLD. Sadly I did not find that out until after I had redesigned the above board to accommodate it. I made my own Library files and everything...

Up to this point I have a board that supports 32KBs of ROM...but the PLD cannot be found even on ebay, or at least not in the SO24 package...

By the way, if any of the readers want a library file I use or created, just ask. I would be happy to help.

Image Hosted by ImageShack.us Image Hosted by ImageShack.us Image Hosted by ImageShack.us Image Hosted by ImageShack.us
So what does one do when they need an obsolete component? Find a replacement. I went to mouser and searched thier PLD's, filtered by SPLD and again filtered by price from lowest to highest. I got rid of Through-hole ICs and found the cheapest SMT SPLD with at least 9 inputs. The result was the ATF22V10C-10SU. It has all of the pins I need, plus some and according to the datasheet is nearly a drop-in replacement for the obsolete chip!

I first created the library file based on the datasheet and an existing SO24 footprint, then I imported it into the Schematic file and removed the old PLD. Since I thought I would have to write the entire PLD program myself, I decided to move around the I/O pins to better my PLCC ROM.

Image Hosted by ImageShack.us

Not bad if I do say so myself. :) Unfortunately this is where the bad news comes in. I further looked into J. Grand and it turns out he already crated a 64KB board and ... used the same PLD as I found. Looking into his pin diagrams, he even used the same pinout as me, shy of A0 and A10 being switched. He also has the entire PLD program available for free. Here I was really excited to be able to write one of my own, but I may as well swap the two address pins and use his design...Thats right:
http://www.grandideastudio.com/wp-content/uploads/pp_atari2600_64k_schematic.pdf

He beat me to it...in 2004. Haha...

This is alright though, because I never planned on making a ROM-only cartridge anyhow. I am working my way toward a Cartridge that is capable of storing data! Yes, an Atari 2600 cartridge that will save files, progress and any other data the game dev wishes.

How can that be done...? Well, all you need is a /Write enable pin pin to go low when the /Output Enable pin goes high. And inverter you may ask? Well, sure! Why not? That could easily work, but we have an entire PLD at our disposal, so the plan is to use that and save the extra $0.05 for an inverter. This board will use the EEPROM as RAM and ROM which makes the RAM non-volatile like other cartridges that use SRAM. SRAM requires a battery to hold the data once power is disconnected.

If I design the my board around his 64KB cart, then I can switch the addressable memory to be something like 32K RAM, 32K ROM or possibly 8K ROM, 56K RAM. it would be as simple as changing a few outputs on the PLD in software so the same board could be programmed for any one of my above combinations of ROM/RAM!

Plus, the board is tiny; less than 5cmx5cm which means it can be printed cheaply! The main goal is to have some skilled person program a musical software that utilizes the save feature. I was thinking Paul Slocum, the writer of Synthcart. He has another project called Loopcart which is pretty much exactly what I want and it already can save...but unfortunately can only save with the AtariVox; an expensive and complicated attachment for atari homebrew carts which allows saving and vocal synthesis. Really cool, but beyond the requirements of my little project.

Loopcart;
http://www.qotile.net/loopcart.html

AtariVox:
http://www.richard.hutchinson.dsl.pipex.com/new_page_5.htm

AtariVox may not even be available anymore...

Going to contact Paul now. Thanks for reading!

Cheers,
Jazz