This is a project I started for fun on 02/06/10. It took approx two weekends to complete. I originally saw this project on HackADay.com and wanted to make my own with a PIC18F2520 and a graphical LCD (128x64, KS108B based). I used the internal oscillator running at 8MHz to run the program and an external 32.768kHz crystal to drive the Real Time clock. Below is the build log along with the source code and schematic.
A simple test pattern I used to learn to communicate with the display. (1st line, checkerboard pattern)
Next I started playing with drawing the pong ball and paddles.
The PIC18F2520 can provide Real-Time Clock (RTC) functionality with a watch crystal (32.768kHz), two capacitors (I used 33pF), and a bit of code. I added in the crystal and started testing the RTC.
However, I hit a roadblock. The RTC was running too fast. I hooked up my Oscilloscope to the crystal and got this waveform.
It turns out that routing signal wires next to the crystal is a bad idea. It recieved a lot of interference and caused the RTC to malfunction, seen above as the faint lines between the sine wave. After rewiring the breadboard and trying to keep all of the wires away from the crystal, I got a clean sine wave.
I now had all the pieces, after a bit more coding and some switches to set the time I was done.