Yahoo Groups archive

AVR-Chat

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

Message

RE: [AVR-Chat] Re: Atmega16 Real time clock

2005-06-01 by stevech

Computers 101: One should not do printf() or any other complicated
processing from within an interrupt service routine.


-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of ttse7
Sent: Tuesday, May 31, 2005 6: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 Links

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.