Thanks a lot those remind me not to put printf statement in the
overflow function. In fact, it is just a test statement. Don't be
so serious.
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.
--- InAVR-Chat@yahoogroups.com, "wbounce" <wbounce@s...> wrote:
> Sorry I thought you said you were using an external clock source. ASSR
> is only used for and external clock ie not the chips clock.
>
> Also is is a bad idea to put the printf statement in because it will
> actaully take several ms to send all that to the uart
>
>
>
> -----Original Message-----
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
> Behalf Of ttse7
> Sent: Tuesday, May 31, 2005 9:58 PM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] Re: Atmega16 Real time clock
>
>
> In atmega16, the real time clock corresponds to timer2. I put two
> statements inside the overflow function
>
> SIGNAL (SIG_OVERFLOW2)
> {
> counter0++;
> printf("Counter 2 is %lu\n", counter0);
> }
>
> and write the code to initialize the real time clock posted here by
> wbounce. However, I find UART no longer function and nothing prints
> out.
>
> If I delete the statement ASSR|=_BV(AS2). The UART functions again.
>
> I do not use JTAG. I download the hex code to Mega16 via parallel ISP.
>
> Tse To Yap
>
>
>
> --- In AVR-Chat@yahoogroups.com, "Graham Davies" <YahooGroups@e...>
> wrote:
> > --- In AVR-Chat@yahoogroups.com, "ttse7" <ttse7@y...> wrote:
> >
> > > ... it still fails to use
> > > the real time clock ...
> >
> > Well, what does happen? Does the counter not run at all? Does it use
> > some other clock frequency? You're not giving us much to go on. Do you
>
> > have a debug interface such as the JTAG ICE?
> >
> > Graham.
>
>
>
>
>
> Yahoo! Groups LinksMessage
Re: Atmega16 Real time clock
2005-06-03 by ttse7
Attachments
- No local attachments were found for this message.