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

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

Image Hosted by

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

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

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

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:

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

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

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

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:

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

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

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

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

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


1 comment: