Project:

ecgc

Date:

07/03/2023

New semester -> new plan

The new semester started and with it a new plan. I am able to work on this project, but I'll have to limit myself to a certain goal like the previous semester with the SPI programmer. I also have some updates regarding the DRAM issues.

DRAM issues

I mentioned last post that I had some issues with the DRAM. There are some errors during the tests which I have little idea on how to fix.

I've since changed the tests to save the expected and actual values somewhere in RAM. There I saw that the errors have no noticeable bit-pattern. For example, when expecting 0x8E I get 0x00, but when expecting 0x00, I get 0x35. It seems that the DRAM controller in the cartridge fails to write some values, since I get non-zero values during the zero read test and zero values during the random read test.

This is odd, since the write timeout doesn't trigger. It did trigger intermittently because of some electrical bug, but I have fixed this issue since and get no write timeouts anymore (see issue #6).

I have resolved to look at the DRAM signals, but I can't probe it using an external logic analyser. It takes forever to hook everything up and I constantly have to add VHDL to route signals to external pins. The FPGA software I use does have a menu for inserting logic analyser cores, but I have yet to get this working. I get weird compilation bugs that I don't understand, so I've sent Lattice a service request.

I am now waiting for a response...

Semester project

The next semester is revolved around signals and how to analyse them (Fourier analysis, basic electronics, the lot). This semester also has the option of working on a personal project, only this time 2 days a week (jeej)!

I've asked my teacher if I could continue working on this project and I got greenlit. I do have to do something regarding signals, so I wanted to start on the DAC.

On the project page, I mentioned as a could (in the MoSCoW sense) that I wanted to implement a some sort of sound card on the cartridge. I thought this to be an interesting thing to work on and it would enhance the Gameboy's sound capabilities.

Short crash course on Gameboy sound. The image below shows a functional overview of the sound architecture. The image and explanation was taken from the Gameboy Pandocs.

sound-arch
Figure 1. Functional diagram of Gameboy's sound architecture

The Game Boy has four sound generation units, called channels 1 through 4, notated "CH1", "CH2", etc. Each sound channel is specialized in a way largely different from the other channels.

Each channel generates an electronic signal; these signals are then mixed into two new channels (for stereo: one for the left ear, one for the right ear), which are then individually amplified, and then output either to the headphone jack, or the speaker1.

Channels 1 and 2, the "pulse channels", produce pulse width modulated waves with 4 fixed pulse width settings. Channel 3, the "wave" channel, produces arbitrary user-supplied waves. Channel 4 is the "noise" channel, producing a pseudo-random wave.

The VIN channel is an analog signal received directly from the cartridge, allowing external hardware to supply a fifth sound channel. No licensed games used this feature, and it was omitted from the Game Boy Advance.

Now I wanted to use this VIN pin on the cartridge to pass an audio signal to the Gameboy and use it for music playback. It sounded like a cool idea to have better music playback or fully automated audio playback on the cartridge. This frees up CPU overhead from audio handling, leading to more flexibility. Since I can use the development of such a system as learning proof this semester, I plan to work on this point.

Closing remarks

Before starting on the sound card though, I want to fix the DRAM issues. The DRAM is an essential part of the system, while the sound card is only a could level priority issue.

Anyhow, since I am stuck on the DRAM, I will probably start researching stuff like:

  • What kinds of features do I want?
  • What is possible on the Gameboy?
  • What kind of extra hardware do I need?
    • How does that hardware work?
    • How does a DAC work?

Let's hope for the best and you'll hear from me when the time comes.

<-- Previous post

All posts

Next post -->