[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Problem with timer0 overflow interrupt in c language..
From: |
Sach |
Subject: |
[avr-gcc-list] Problem with timer0 overflow interrupt in c language.. |
Date: |
Tue, 4 Dec 2007 23:21:23 -0800 (PST) |
Hi friends,
I m programming with WinAVR for ATMega32 8-bit RISC from atmel.
I have tried to write timer overflow interrupt and LED toggle everytime when
timer0 overflows. In this code i have not got the output result. So please
help me with this issue. Here the code that i have written is given below:
#include <avr\io.h>
#include <avr\interrupt.h>
void main(void)
{
SP = 0x085F;
TCCR0 = (1<<CS02)|(1<<CS00);
TIFR = 1<<TOV0;
TIMSK = 1<<TOIE0;
DDRB = 0xFF;
sei();
while(1);
}
ISR (TIMER0_OVF_vect)
{
cli();
PORTB = ~PORTB; // Toggle pins on Port B
}
Best Regards,
Sach Rathod
--
View this message in context:
http://www.nabble.com/Problem-with-timer0-overflow-interrupt-in-c-language..-tf4947839.html#a14166401
Sent from the AVR - gcc mailing list archive at Nabble.com.
- [avr-gcc-list] Problem with timer0 overflow interrupt in c language..,
Sach <=