Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Atmega16 Real time clock

2005-05-31 by ttse7

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.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.