Thursday, July 25, 2013

Update Jul-25-13

Here I am trying to learn gbz80 ASM (or Gameboy Assembly Language) and am just having a terrible horrible day! I have programmed in assemble for classes before and loved it, but nothing wants go correctly this time. First off, the cat is being a psycho-demon and tears through the room every few seconds, next the power went out for one minute last night losing data from the programs I was running, resetting the wireless printer and shutting off the coffee pot so the water had top warm up in the morning and to top it all off, I did my egg over-hard rather than over-easy! BAHHH!

In any case, my biggest problem is that the assembler included with RGBDS, the gameboy assembling environment, refuses to load one of the THOUSAND files that all run in sequence when you initiate the assembling of a ROM. To top it all off, you have to run it through a command prompt which just adds a whole new level of fun to the project.

 I have tried setting programs to admin mode, compat mode, and all other forms of configuration and yet nothing works. Get this, the program was written for Windows 95 so I probably can't use Windows 7 x64...

 Image Hosted by ImageShack.us

That is the error. RGBFix refuses to load after the batch file calls for it. Putting RGBFix into Admin mode just skips the error message and does nothing. I am supposed to have a *.gb file that runs on gameboy or in an emulator.

 I am not even beyond Hello-World yet because of this nonsense! If anyone knows how to get this assembler working in Windows 7 x64, let me know...

Tuesday, July 16, 2013

Using POV-RAY

Just a quick run-down of how to use POV-RAY after you have installed it. I assume you have installed it.


Hit RUN at the top of your board toolbar.



Image Hosted by ImageShack.us




Then run 3d41.ulp in the directory shown.




Image Hosted by ImageShack.us



The setting are extensive and somewhat confusing.
The defaults will work though. Click "Create POV-File and Exit".



Image Hosted by ImageShack.us




You will probably be prompted to add text and sockets to certain ICs. Do as you wish.



Image Hosted by ImageShack.us




There will also be parts that cannot be rendered because you do not have the 3D part files. Thats ok.



Image Hosted by ImageShack.us



 If there is something you would like changed for example size, angle, silkscreens, etc., change the settings a little bit. My silkscreens are in different layers than the default so I had to add these to the misc tab.



Image Hosted by ImageShack.us



Go ahead and load your output into POVray and click run to render the image. Play around with the options until you are satisfied.

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Monday, July 15, 2013

SID-Boy v1 Hardware Completion

As per the title of this post, I have completed the board. All of my necessary components are placed, routed and errors have been checked over and or fixed. I have even chosen to decorate the board a little with my QR code just because I can.

Here is the board before I corrected my errors. 855 ERRORS! Many of them were silkscreen errors where the silkscreening was too close to pads and vias. These were easily fixed.
The clearence errors were also fixed very easily by movig the traces a little farther from eachother or from vias and pads.

Image Hosted by ImageShack.us

Here is the board in its entirety, both with and without the ground planes.

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Lets view some of the board up close. Here are the two resistors, R4 and R5, that I added as described by the SwinSID website. 47Kohms between PWM and +5v and 47Kohms between PWM and the output which happens to be the Audio-IN pin on the gameboy. The board now contains both methods of audio output so that I may find out which is better.

Image Hosted by ImageShack.us

Here is my logo as I call it. It is just a QR code that I made which leads to this blog. Adding BMPs to a board is very simple. Beside that you can see a small block of text that describes the caps and resistors above. There was limited room next to them.

Image Hosted by ImageShack.us


My clock. This clock a larger than the clock I had been using before, but is more easily available. Pins 1 and 3 are the two terminals for the oscillation. I may need to change the sizes of caps and resistors depending on the availability of them in the future, but each has plenty of room for change.  I believe these caps were size 0603. Something of note is that the traces of the clock are distant and not of the same length from the MCU. This is something people would call poor design, but the clock speed of 24MHz is not terribly fast and the clock is isolated as much as possible from traces and other devices so that I do not believe any problems will arise.

Image Hosted by ImageShack.us

Here are my power rails. Yes, they are round. Why? Well, because I can. ;)

Image Hosted by ImageShack.us

The last thing to do would be to write a program that stores SID data to the RAM locations where I have placed the SID in the memory map. I will have to research the SID banks, commands and gameboy programming. Once I have my board printed and populated, I will test a known-working ROM such as mGB, the midi software just so I know the board is routed to the gameboy correctly.


LC the kitten likes my board. How nice of him to approve. :D

Image Hosted by ImageShack.us

I really really need an oscilloscope so that I can perform extensive testing with this and other projects. I think that it is currently my greatest downfall...

Friday, July 12, 2013

SID-Boy Update Jul-12-13

In continuation of this post:
http://jazz-disassemblies.blogspot.com/2013/07/sid-boy-cartridge-continuation.html

Since posting the above, I have been routing the traces and making final chip placements. Most of my connections are complete and all that is left would be to write a program and test it, scrap it, rewrite it and test, test, TEST!

Lets talk about my board thus far:


Image Hosted by ImageShack.us

I will start from the top left and work my way across the board.

The current audio output is connected to the stereo SMT 1/8" jack. The SwinSID emulates in stereo, which is not exactly true with the SID itself and not the best for my purposes using the audio-IN pin on the gameboy, but we will manage.

Next is an array of resistors and capacitors which are part of the audio filtering.

Then is the 16-bit DAC which converts the Digital data to Analog. This damnable components is the only part which is obsolete...something that we all must try to avoid when designing something cost effective and/or to produce in high quantities. 

I did just read on the SwinSID website: "You can use 8bit PWM output to playback sound without DAC, just connect B0 AVR pin with 4,7K resistor to AUDIO OUT SID socket pin. You also need to add bias by connecting 4,7K from +5V to AUDIO OUT pin. "

Doing this should save me time and money, but I plan on trying both methods to see which sounds better.

Next in the picture is the ICSP connector and the Atmega8515. I am also looking into the Atmega88, but have not placed one to see if it a better fit. This is where I can program any updates to the SwinSID while the chip is "In-Circuit" meaning I never have to remove it.

The middle-center has a large empty area. This is good. Every component has plenty enough room and I have space for modifications or additions later on! If you recall, I planned on adding RAM later on and RAM is nearly useless if you cannot back it up, so I also hope to fit a battery backup. I can't wait!

In the near-center of the board is the clock. This little crystal will be running at 24MHz, much higher than the gameboy itself and faster than any data traversing the traces surrounding it. The plan is to isolate it from any near-by traces to prevent bleeding or interference. Maybe I am exaggerating, but you can never be too careful.

In the bottom left is the MBC1b mapper chip. This allows for the gameboy's z80 microProcessor to address more memory whether in the form of RAM, ROM, or I/O (SID). The MBC1b is the oldest mapper designed for the gameboy, only allowing for a maximum of 16Mbit ROM and 8Kbyte RAM, but it is more than I will need while I utilize no RAM. When I redesign the program and board, I will use an MBC5 mapper chip which vastly increases the addressable memory.

And lastly in the bottom right corner is the ROM itself. Because I use an EEPROM, I may erase and reprogram the cartridge as many times as I like. The unfortunate part of having such a densely populated board is that I cannot socket the ROM if I enclose the cartridge in a shell so when I come to the point where I am finished programming, I will solder the EEPROM in place.

My biggest concern is in my address or I/O map. This is for lack of a better word a map of the binary or hex addresses of each and every device; where they are accessible and to what extent they are accessible. An example of the ROM address may be from $0000 to $3FFF and the SID may be from $4000 to $7FFF. These of course are not the actual addresses, but this is how it would look. The reason I am so concerned is because of how much trouble it is for me to determine the addresses! It is very confusing IMO.

Thanks for reading
-Jazz

p.s.


To clarify any confusion that may be looming over the project, this is not a replacement for the internal synth. This is not in place of the mysterious 5th sound channel and this will not be compatible with any official game without extensive patching. I am developing this board so that the gameboy can control 3 more channels on top of the four it already has, making it better for 8-bit musicians.


Tuesday, July 9, 2013

SID-Boy Cartridge Continuation

I could easily have written this post yesterday immediately after the last one because I was up working all night but so many components, arrangements, etc. changed. Now, I only minored in engineering at Central Michigan University but I plan on mastering in it eventually once my bills are caught up...anyhow, I decided to remove the RAM for the time being because it will make for an easier memory mapping. Both the SID and RAM are to be written to and there is no room for a battery backup, so whats the point of RAM at all? At least at this point in time.

Image Hosted by ImageShack.us
Currently I have the SwinSID, ROM, MBC5 mapper chip, components  and ICSP all placed. The TDA1543 DAC IC will remain through-hole because these chips are difficult to locate and the SMT version happens to be larger because of 8 unused pins! I have replaced the massive crystal with a tiny surface mounted one and will replace the resistors with SMT resistors as well. The PLCC socket will be removed because it is too large to fit inside of a gameboy but for the time being, I could only locate a 29f040/49f040 library file as through-hole.

Shortly, I will remove the logic chip that was never utilized and move the headphone jack to the other side because "if" the Audio-IN pin works as I hope it does, the traces would need to be on the other side.

If design goes as planned (for future versions) I will be able to support up to 64MegaBits of ROM! can you imagine a program that large!? However, RAM will probably be placed once I figure out how to add both the SID and RAM into the same 64Kbit addressing space. I may even decide to use a memory module that requires no battery backing, which would be a little more costly but less consuming of space.Hell, my program could easily be modified to support a YM2612 version if the project pans out. Just keep reading!

Also, if I manage to create a working prototype, I will be starting a kickstarter page for this project.

Monday, July 8, 2013

Gameboy and SID Interfacing Theory: Why Not?

Driving home after visiting the family on holiday and I had a wonderful idea. I was thinking about the computer that I am working on (and will post about extensively later on) and came up with another project I should be working on. "Why hasn't anyone else began this project," I thought to myself. So I quickly tore apart the box of candy bottle caps I had finished off and drew a quick size-representation of what one such device would look like on the dusty sugar-covered cardboard.

The gameboy is an 8-bit computer in the purest of form; ROM, RAM and simple I/O communication. Other devices have been designed for use with the gameboy both officially and unofficially, by Nintendo and by other devs. Adding any device should be as simple as hooking up the Address bus, data bus and placing said device somewhere in the existing memory map.

I have also been looking into pin 31 on the gameboy cartridge slot. This particular pin as far as I know has never been implemented in an official device and just goes to waste. It is referred to as the Audio-IN pin. All I know is that it connects to the z80 uP...I do not know which direction transfers occur nor do I know what kind of audio the trace can handle, amplified or otherwise. I will get back to this pin later on, now we shall discuss the connections and board layout.

My first sketch was simply to arrange the components without worrying about logic, power, or anything else.
Image Hosted by ImageShack.us
The second sketch realized the need to map the SID's address with logic, power the SID at +12v and add an audio ouput.
Image Hosted by ImageShack.us
Sketch three was made when I remembered that SwinSID would be a more reasonable build. The size and power supply will both more easily be designed.
Image Hosted by ImageShack.us
Sketch four, or version 2.1 is the board I will start to design in Eagle PCB. as you can see, I added mostly SMT components due to size restrictions. ROM will be in a socket as a PLCC. RAM and MBC (the memory mapping chip) will be the ordinary SOIC that comes in most GBC cartridges. I have yet to realize a battery backup because I have yet to determine how the ROM will be programmed; hence the socket.
Image Hosted by ImageShack.us

I believe 4Mbits (512Kbytes) will be sufficient size for the ROM to begin with. I only have 49f040 EEPROMs on hand right now anyhow. With the MBC5 chip, I can be a little more sloppy with the glue logic since there will be plenty of addressable bits left over. And lastly if the audio-IN pin works as I hope, there will be no need for an extra 1/8" headphone jack. How annoying would that be, amirite!

A few notes about SwinSID that make it choice for my project it is drop-in, pin-compatible with the original SID; both 6581 and 8581. It also runs on +5v rather than the 12 or 9 that the SIDs run on. It does however require its very own xtal but the gameboy has a clock pin running through the cartridge slot which is very slow. I will look into whether the speed is sufficient to run the SwinSid (probably not though).

More updates soon!

Tuesday, July 2, 2013

Update: Jul-2-13

Since my last post, I have not only acquired an Apple IIe but have set myself on a journey of self-betterment and creation. (Im gonna build something)


Image Hosted by ImageShack.us

Clearly my Apple is beaten up with keys missing and ... a makeshift floppy drive but it is one of the coolest things I have ever owned. The internals are simple enough to follow myself and the features are incredible. For the longest time I had been planning a new device to engineer and produce, but if it wasn't for the Apple II, I may still be at square one.

To begin with, the uP inside is the 6502. Quite powerful for its time and variants are still being produced today! For the device I am designing, I have chosen the 65c816 which is a higher processing faster uP than the 6502. It still keeps a certain amount of backwards compatibility too which may or may not come into play with my computer.

I am now studying the 65c816, latching process, addressing methods, etc. The thing can address up to 16Mbytes which is absolutely astounding! I have started looking into I/O options such as the DUART which I may use for MIDI and controlling an LCD module for serial output. This lead me to find the TellyMate which converts serial data to composite video. The TellyMate is in such a small package, that I have decided to fit one into the shell so that it can be put onto a television.

As for the main purpose, I am designing a computer to cater to the chiptune artist. There will be at least two synth chips (vintage of course) and an expansion port for other software. The expansion port I have decided will be not only used for software, but for addressing custom hardware devices designed by other people in the future. Gotta love them modders. I may design a docking system to connect a control board with buttons, pots and other components to control filtering, looping, controlled interference and other attributes of individual sound channels.

If you're a fan of LSDj and the DMG-01, then you may want to follow my blog. I will be starting a kickstarter eventually which will have all of the information and replace the gameboy entirely. My handheld computer will not only have more sound channels, but built-in midi control and the main focus is the modder. I will create the very most mod able toy ever.