DrPetter's homepage



Pong



A few weeks before Christmas 2004 I was playing around with a custom made AVR programmer. I successfully generated a video signal from my little Atmega8 microcontroller and started thinking about whether there was something cool you could do with that...
Pong was an obvious candidate (and partially inspired from PIC Pong), so I started working on that.

Progress was coming along nicely after a few days when I suddenly realized that this would make a great Christmas present for my younger brother. Only problem was that Christmas was only a few days away! I rushed to finish everything, and added the last decoupling capacitor just hours before I had to leave for my train.
I was very lucky to stumble over that solution actually, before adding the capacitor I was getting a horribly distorted TV signal. My earlier prototype was fine, but somehow the "production" version suffered from signal noise. The prototype was actually just finished about 24 hours before I had to leave, so I quickly rebuilt it in its tiny version (to fit in a matchbox) and would probably have left the noise in if I hadn't fixed it.

There were at least two obvious bugs that I didn't have time to fix. One of the controllers are very noisy and makes the paddle jump around several pixels up and down while playing. It's still playable, but a lot of precision is lost for that player (although that can be used as a handicap to cripple a more skilled player :)).
The other bug is with sound. I originally intended it to be square wave, but for some reason it ended up being very quiet and distorted. I couldn't figure out why and didn't have time to investigate further, so I left it like that. On the train I realised what the problem was. The sound was controlled by a bit on the same port that was generating the video signal, and just a few microseconds after flipping the bit to generate a square pulse (which was done during vblank), it was overwritten by the video signal starting to draw the next frame. Doh!

Some day I might fix these bugs, at least the sound. I'm not sure how to reduce the controller noise. Analog filtering didn't seem to help, and there's very little room for software filtering inside the AVR.

The third image below is of the AVR programmer/Pong prototype (a real spaghetti nightmare).


Features:

- Monochrome graphics calculated on the fly (no display memory)
- Blips of varying frequency
- Scoreboard
- Two analog controllers
- Fits in a matchbox


   
  




Back to all projects


Page updated on March 25   2010