3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to use the Dragon Rider 500 with your AVR Dragon

Step 5Advanced LCD and Button usage: The Big Clock

Advanced LCD and Button usage: The Big Clock
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.
« Previous StepDownload PDFView All StepsNext Step »
3 comments
Jun 3, 2010. 6:53 PMdav1dr4y says:
Very cool! Any chance of getting the source? I would like to port/compile to other micros.
Jun 4, 2010. 8:21 AMdav1dr4y says:
Excellent! Thanks. /David

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
41
Followers
6
Author:barney_1