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: AdrianSent: Monday, January 19, 2004 9:36 AMSubject: [AVR-Chat] WinAVR GCC timers and interruptsHi,
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
- To visit your group on the web, go to:
http://groups.yahoo.com/group/AVR-Chat/
- To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.