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.

Solid Wood Digital Clock

Step 8Program the Microcontroller

Program the Microcontroller
This step may sound simple, but it can be vary confusing is not done properly.

I loaded the program onto the atmega168 by using an avrisp mk II to circumvent the bootloader on most chips used with Arduino. This is because I wanted an instant startup, and it also allows for more program space(although, not much).

To do this, there are good resources here, here and here to burn a bootloader. In place of the bootloader just use the .hex file found in the applet folder of the arduino sketch folder (which is the one I have attached to this step and the introduction).

To change any aspects of the file, I have also included all of the commented code, just click 'upload to board' (you will get an error unless you have an arduino plugged in) to re-compile and the .hex file will change to the new code.

Odds are that your crystal won't be exactly 20.0Mhz, so it will need to be calibrated to keep accurate time. To do this, just change the oneMin variable in the code, mine is 60116.

The clock speed is currently compiled to run at 20 MHz. To change it you will need to change some numbers in the arduino preferences and board definition files, as found here.
« Previous StepDownload PDFView All StepsNext Step »
1 comment
Jul 21, 2011. 10:48 AMyaly says:
This laptop is IBM thinkpad R50 right?
Mine is IBM thinkpad R50E. Yay I always thought I'm the only one in the world that owns that laptop.

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!
98
Followers
11
Author:J_Hodgie
Currently doing masters in Mechatronics Engineering, but still create in my spare time