Hi all, First of all, I really double check that crystal 32.768K is plugged between PC7 and PC6. Previously I did ont put the printf statement in the overflow function. Actually, I put a variable inside the overflow2 function, every time overflow occurs, the counter increases by 1. Then the main function keeps sending out the content of that counter. But I find the counter did not increase at all. Even I adjust the overflow period. Then I add one printf statement inside the overflow function to see what happen. Even I put the printf statement in the main loop. The counter remains the same. I think the problem is relates to the timer initialization. If the cross out the statement ASSR|=BV(AS2), every thing is OK. Where I put printf statement do not affect the program. It makes me belive the problem is comes from the timer initialization. So my original post just presents my timer initialization. Many experts here point out the problem of printf. It is really good I learn a lot. Wbounce, I apologize if my wording is strong. Once again, I really thank your kindly suggestions on it. I think I better voice out my needs here again: "Is anyone has any sucessful experience in using Atmega16 together with real time clock. Please share with me." The purpose of last message is just to get everyone on topic. --- In AVR-Chat@yahoogroups.com, Brian Dean <bsd@b...> wrote: > On Fri, Jun 03, 2005 at 02:01:29AM -0000, ttse7 wrote: > > > I really want to get back my question but not other stuffs,i.e. turn > > on the real time clock. Really thanks to those reply and offer help > > in this forum. > > As wbounce suggested, please let us know that you actually have an > actual RTC crystal connected to the TOSC1 and TOSC2 lines of your > controller (PORTC6 and PORTC7). Oh, and double check that you don't > initalized those pins for output or something. Without an actual > second crystal on those pins, there's no chance of the timer working > in asynchronous mode. > > -Brian > -- > Brian Dean > BDMICRO - ATmega128 Based MAVRIC Controllers > http://www.bdmicro.com/
Message
Re: Atmega16 Real time clock
2005-06-03 by ttse7
Attachments
- No local attachments were found for this message.