How to use the Dragon Rider 500 with your AVR Dragon

 by barney_1

Step 5: Advanced LCD and Button usage: The Big Clock

Big_Clock_1.JPG
This is a fun project that makes use of the LCD screen and buttons. We will be dealing with Real Time Clock functions and custom characters on the LCD.

In the picture at the bottom you can see the time 7:26:07pm displayed in large numbers on the LCD screen. Each number is using a 2x2 grid of the characters display to show the large number. This utilizes a font originally written by Xtinus for the XBMC project.

The buttons are used to set the clock. Left increments the hours, Up increments the minutes, Right toggles between 12 and 24-hour time, and Enter resets the seconds to zero.

The clock doesn't keep very good time as we are using the very inaccurate internal oscillator, but this program can easily be altered to use a much more accurate external crystal. See this in action in the video below.


An explaination of how this code works is in order, but I don't have the time right now.

For now, connect the LCD header (J31) to PORTD (J4) and the button header (J30) to PORTB (J2). Make sure you have both SW1 and SW2 in the off position. Connect the AVR Dragon to a usb cable and plug the other end of that cable into your computer. Turn on SW2 and program the ATmega8 with the programming software of your choice (hex file below; fuses burnt to factory settings).

NOTE: In order to utilize the Left and Up buttons you will need to remove the shunts from J22 and J24, do this while the power is off.
 
Remove these adsRemove these ads by Signing Up
dav1dr4y says: Jun 3, 2010. 6:53 PM
Very cool! Any chance of getting the source? I would like to port/compile to other micros.
barney_1 (author) in reply to dav1dr4yJun 3, 2010. 9:35 PM
 I think this is the source package. Good luck.
dav1dr4y in reply to barney_1Jun 4, 2010. 8:21 AM
Excellent! Thanks. /David
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!