Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] WinAVR GCC timers and interrupts

2004-01-19 by Rogier Schouten

Hi,
I only know assembler, so this may not be what you are looking for:
You should enable the timer interrupt in TIMSK (don't know which bit right now) and all interrupts using SEI.
Rogier
----- Original Message -----
From: Adrian
Sent: Monday, January 19, 2004 9:36 AM
Subject: [AVR-Chat] WinAVR GCC timers and interrupts

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<
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

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.