Pong Clock PDF Print E-mail
User Rating: / 68
PoorBest 
Thursday, 11 February 2010 19:19

 

Jump To Downloads: click here

 

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.

Dim lights Download Embed Embed this video on your site

Both paddles working.

Dim lights Download Embed Embed this video on your site

 

From there I started working on getting the numbers for the clock portion working, and allowing the ball to pass through the numbers without disappearing. Two pictures and a video below.

Dim lights Download Embed Embed this video on your site

 

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.

Dim lights Download Embed Embed this video on your site

 


 

Update: April 2011

I finally got around to making a PCB for this design. Pictures of the front and back below.

 

I also picked up some acrylic sheets and starting making my own case to house everything.

 

I finished populating the board and mounting everything in the case on 04/14/11. Pictures of the front / back of the completed project as well as a new video below.

 

Dim lights Download Embed Embed this video on your site

 

 



Downloads:

Contact: 

Source Code, Schematics, Hex Files:

  • gLCD_PongClock_1.01 - (05/07/11)
    • Updated Code. Ball movement will be slightly more random.
    • Remapped Control Pins [This is the version seen in the PCB above. Please note since I remapped the control pins you can not directly upgrade from 1.00 to 1.01 without updating wiring.]
  • gLCD_PongClock_1.00 - (02/19/10)
    • Original Release

 

Schematic V1.01:

 

 

Last Updated on Sunday, 28 October 2012 10:36