Yahoo Groups archive

AVR-Chat

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

Message

WinAVR GCC timers and interrupts

2004-01-19 by Adrian

Hi,

I'm struggling to collate the info in the 2313
datasheet and the include files for winavr
distribution of GCC.

I want to learn to use the timers & interrupts. I
started off with a polled timer test (writing code
from memory so may not be precise) to add interruopt
driven later:

TCNT0=0;// set timer counter
TCCR0=1<<CS02|1<<CS00;// set to /1024

do {} while (~(TIFR & TOVR0)) // wait for overflow

This appeared to hang in loop for ever  - I'd expected
it to pass straight through after a miniscule pause.


Any ideas what's wrong?

As regards interrupts, I looked at docs avr/signal.h
and couldn't decide if an sei was required or not.

Is there a URL with GCC code fragment to show proper
usage of INTERRUPT macro etc?

TIA,

Adrian



=====
-
*********************************************

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

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.