How can i will interface RTC chip with ATMEGA 16 microcontroller?
Hello,
I want to interface an I2C RTC ship with ATMEGA 16 microcontroller for designing digital watch which can show date, week, month, year and i have problem in programming.
Re: How can i will interface RTC chip with ATMEGA 16 microcontroller?
in which part of code your problem is?
you should firstly connect a 32kHz crystal to the TOSC pins
problem may be in initialization
When the AS2 bit in the ASSR Register is written to logic one, the clock source is taken from the Timer/Counter Oscillator connected to TOSC1 and TOSC2
ASSR=1<<AS2;
you should adjust the clock value and Modes of Operation
Ex.
// Clock value: PCK2/32
// Mode: CTC top=OCR2A at 1E(any value)
TCCR2=(0<<PWM2) | (0<<COM21) | (0<<COM20) | (1<<CTC2) | (0<<CS22) | (1<<CS21) | (1<<CS20);
OCR2=0x1E;
if initialization is right ==>> problem in code so i need to read it
Re: How can i will interface RTC chip with ATMEGA 16 microcontroller?
This morning I found some one wrote about a problem in writing code for real time clock using ATmega16 chip
there was little information about his problem so I wrote the above replay
and now his question disappeared and my replay shown as a first post !!
I don't understand what happened.
This morning I found some one wrote about a problem in writing code for real time clock using ATmega16 chip
there was little information about his problem so I wrote the above replay
and now his question disappeared and my replay shown as a first post !!
I don't understand what happened.
This happened because you answered while I moved the first post a similar thread started by the OP a few minutes before. Now both threads are finally merged. Sorry for the confusion.