0

I ported the clock to the Arduino Duemilanove
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

I ported the clock to the Arduino Duemilanove

by mike31416 on Fri Oct 09, 2009 9:07 pm

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

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

Re: I ported the clock to the Arduino Duemilanove

by adafruit on Fri Oct 09, 2009 10:31 pm

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

adafruit
 
Posts: 12124
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: I ported the clock to the Arduino Duemilanove

by mike31416 on Sat Oct 10, 2009 12:36 am

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

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

Re: I ported the clock to the Arduino Duemilanove

by mike31416 on Sat Oct 10, 2009 12:44 am

And a few more...

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

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

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

Re: I ported the clock to the Arduino Duemilanove

by adafruit on Sat Oct 10, 2009 12:46 am

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

adafruit
 
Posts: 12124
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: I ported the clock to the Arduino Duemilanove

by mike31416 on Sun Oct 11, 2009 11:33 am

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

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

Re: I ported the clock to the Arduino Duemilanove

by mtbf0 on Sun Oct 11, 2009 2:36 pm

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.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: I ported the clock to the Arduino Duemilanove

by mike31416 on Sun Oct 11, 2009 3:57 pm

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

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

Re: I ported the clock to the Arduino Duemilanove

by len17 on Sun Nov 22, 2009 1:37 am

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.)

len17
 
Posts: 393
Joined: Sat Mar 14, 2009 7:20 pm

Re: I ported the clock to the Arduino Duemilanove

by mike31416 on Mon Nov 23, 2009 8:26 am

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

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

Re: I ported the clock to the Arduino Duemilanove

by len17 on Mon Nov 23, 2009 12:51 pm

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.

len17
 
Posts: 393
Joined: Sat Mar 14, 2009 7:20 pm

Re: I ported the clock to the Arduino Duemilanove

by mike31416 on Mon Nov 23, 2009 4:37 pm

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

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

Re: I ported the clock to the Arduino Duemilanove

by len17 on Mon Nov 23, 2009 5:52 pm

Thanks, I get it now.

len17
 
Posts: 393
Joined: Sat Mar 14, 2009 7:20 pm

Re: I ported the clock to the Arduino Duemilanove

by mike31416 on Tue Nov 24, 2009 9:08 am

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 193 times

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

Re: I ported the clock to the Arduino Duemilanove

by Rotzog on Thu Dec 17, 2009 12:12 am

Cool. Ice cool!
Rotzog
 
Posts: 106
Joined: Mon Nov 23, 2009 10:10 pm

Please be positive and constructive with your questions and comments.