I ported the clock to the Arduino Duemilanove

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

I ported the clock to the Arduino Duemilanove

Post by mike31416 »

I used a 16x2 lcd for the display. Had to fiddle with the timer0 and timer2 interrupts a bit to scale since the clock is 16MHz. I installed a speaker and used a LED to show the boost brightness. Used a jumper for the alarm and install the three buttons. Also disabled the power down detection. Pretty much works like the Ice Tube Clock.

I did a reverse lookup to translate the display array to alpha numerics for the LCD (I guess I could go crazy and customize the LCD segments some time). Still have to add decimal point support for the number selection for date, alarm and time.

Now I can modify the clock code and test outside the Ice Tube Clock till I have what I want.

I still have to cleanup the code a bit to toggle between Ice Tube mode and Arduino mode via a define. Once I get it done, I'll post the changes.

One thing that is interesting is that it crashed sometimes when I change the brightness. Also saw this in the Ice Tube Clock but not sure if its an artifact of the port.

Who knew you could ever have so much fun with a clock!

Mike

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: I ported the clock to the Arduino Duemilanove

Post by adafruit »

interesting...pix and code or it didnt happen :D

User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

Re: I ported the clock to the Arduino Duemilanove

Post by mike31416 »

Here a a few pictures...
Attachments
Setting the time. The '->' replaces the decimal points.
Setting the time. The '->' replaces the decimal points.
IMG_0154.JPG (118.81 KiB) Viewed 5271 times
Set time menu
Set time menu
IMG_0151.JPG (119.08 KiB) Viewed 5271 times
Current time. The 'o' indicates pm
Current time. The 'o' indicates pm
IMG_0150.JPG (123.69 KiB) Viewed 5271 times

User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

Re: I ported the clock to the Arduino Duemilanove

Post by mike31416 »

And a few more...

Hope to post the code by Sunday. Needs to be cleaned up a bit to highlight the changes.

Mike
Attachments
My clock!
My clock!
IMG_0164.JPG (100.41 KiB) Viewed 5268 times
Layout
Layout
IMG_0160.JPG (138.44 KiB) Viewed 5268 times
Showing current date
Showing current date
IMG_0157.JPG (126.92 KiB) Viewed 5268 times

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: I ported the clock to the Arduino Duemilanove

Post by adafruit »

neat. and a good idea. the ice tube clock was prototyped all on a ice tube PCB. lots of unplugging the tube. ;)

User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

Re: I ported the clock to the Arduino Duemilanove

Post by mike31416 »

Here are the code changes...
Attachments
ITC Port.zip
Changes made to Sep 30 2009 firmware
(28.42 KiB) Downloaded 266 times
Last edited by mike31416 on Sun Oct 11, 2009 3:55 pm, edited 1 time in total.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: I ported the clock to the Arduino Duemilanove

Post by mtbf0 »

why not replace the crystal with a watch crystal?

well, first alter the fuses to use the internal oscillator, then burn a lilypad bootloader, then swap the crystal. probably have to swap a couple of caps, too.

User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

Re: I ported the clock to the Arduino Duemilanove

Post by mike31416 »

I am only using the Duemilanove as a test platform to check changes made to the clock code. No intention of using it as a clock.

Mike

User avatar
len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: I ported the clock to the Arduino Duemilanove

Post by len17 »

A couple of questions:

How did you download the Ice Tube firmware to the Arduino? Via ICSP or the USB bootloader?

If you use ICSP, does it wipe out the Arduino's bootloader?

(I want to make a clock based on Ice Tube firmware but using an old LED display. I haven't decided whether to wire it up from scratch or start with a Boarduino.)

User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

Re: I ported the clock to the Arduino Duemilanove

Post by mike31416 »

Mostly I use the USB. When I built my tinyisp, I tested it using the arduino and yes it did wipe the bootloader. I reloaded the bootloader and continue to use the USB. The USB/bootloader seems to load the firmware a bit faster.

Mike

User avatar
len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: I ported the clock to the Arduino Duemilanove

Post by len17 »

Thanks. Next question: :)

How do you download your compiled .hex file via USB? I can't figure out how to do that with avrdude or the Arduino software. (Unless you're using the Arduino environment to compile the firmware? Does that work?)

If I get past the breadboard stage, I'll change it to use a watch crystal and the internal CPU clock, at which point I might as well use the USBtiny and lose the bootloader.

User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

Re: I ported the clock to the Arduino Duemilanove

Post by mike31416 »

I use Eclipse & WinAVR to edit and compile and the following avrdude command command line to download:

avrdude -pm328p -cstk500v1 -PCOM3 -b57600 -Uflash:w:iv.hex:a

Mike

User avatar
len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: I ported the clock to the Arduino Duemilanove

Post by len17 »

Thanks, I get it now.

User avatar
mike31416
 
Posts: 126
Joined: Wed Aug 26, 2009 12:06 pm

Re: I ported the clock to the Arduino Duemilanove

Post by mike31416 »

Glad to help.

BTW... I found a small problem with the LCD driver. I was clearing the ports that the control and data outputs were using. This could cause problems if the LCDinit function were called after the application setup other bits in the ports for other uses. Updates is attached.

Mike
Attachments
LCD.zip
(3.34 KiB) Downloaded 220 times

Rotzog
 
Posts: 106
Joined: Mon Nov 23, 2009 10:10 pm

Re: I ported the clock to the Arduino Duemilanove

Post by Rotzog »

Cool. Ice cool!

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”