Sunday, March 6, 2011

AVR Clock

So I have been tinkering with AVR micro-controllers since some time & finally decided to sit down & create a project that's simple enough & uses a few basic components.

Enter the AVR Clock.

Main Parts -
1) Arduino Deumilanove
2) DS1307 Real Time Clock (RTC)
3) 16x2 LCD Screen

Arduino is a low-cost AVR powered platform having a huge online support group & is quite popular amongst hobbyist, artists & educationists. The Arduino community has even created a programming language that reduces the learning curve for people who have no background in coding. I however decided not to use the IDE since I already knew how to program the AVR using avr-gcc based tools.

DS1307 is low power consuming, battery backed chip that can be programmed to hold time & date for a really long time. According to the datasheet, a 3.3v Lithium Ion cell will last for approximately 9 years !!! Plus it communicates to the controller over I2C protocol, further reducing wiring footprints. Sparkfun offers another chip, DS3231, which has an inbuilt temperature sensor & works on 3.3v instead of 5v. I would recommend the DS3231 in case you plan to buy a RTC. I picked the DS1307 code from AVRfreaks.

The LCD uses an industry standard controller & I picked up the code from avr-libc examples itself.

AVR Clock

Code hosted at github.com - https://github.com/roguehit/avrclock

Now that the breadboard prototype works correctly, I will create a custom PCB for the AVR Clock next week.

7 comments:

akshay said...

arduino sucks

Rohit Nair said...

Why does it suck ? After all its just plain AVR.

sethu madhav said...

Nice.. How did u upload the hex file .. avrdude? Can it be done without RTC module..

Rohit Nair said...
This comment has been removed by the author.
Rohit Nair said...

I used a device called as avrispmkII. It burns *.hex over USB & uses avrdude.

sethu madhav said...

So you connect the AVRISP mkll to the ICSP headers on the arduino ?

Rohit Nair said...

Yes that's what I did.

There is another way where the chip can be programmed.

The Arduino ships with a bootloader and the board also has a FTDI (USB to Serial) chip on it. So the chip can be programmed over USB without using the ISP. This is what the Arduino IDE does.