Solid Wood Digital Clock

 by J_Hodgie
Featured

Step 8: 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.
 
Remove these adsRemove these ads by Signing Up
yaly says: Jul 21, 2011. 10:48 AM
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

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!