Przekopałem już niejedno forum i na każdym z nich robią to na inną modłe...
Ale co bym nie tworzył to i tak nie działa...
Uprościłem program do min i nic...
Prosze niech ktoś mnie oświeci co jest nie tak...
Aha do portu PB1 podłączona dioda żeby było wiadomo, że coś się dzieje...
#include<avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <inttypes.h>
#define F_CPU 1000000
unsigned int c=0, s=0;
int main(void)
{
TCCR0 = 0b00000111; //(1 << CS02) | (1 << CS00); prescaler na 1024
// TIFR |= (1 << TOV0);
TIMSK |= (1 << TOIE0); // aktywne przerwanie overflow
// timer_enable_int(_BV(TOIE1));
TCNT0 = 0;
sei();
sbi(DDRB,PB1);
for(;
;
return(0);
}
SIGNAL (SIG_OVERFLOW)
{
sbi(PORTB,PB1);
}
Ale co bym nie tworzył to i tak nie działa...
Uprościłem program do min i nic...
Prosze niech ktoś mnie oświeci co jest nie tak...
Aha do portu PB1 podłączona dioda żeby było wiadomo, że coś się dzieje...
#include<avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <inttypes.h>
#define F_CPU 1000000
unsigned int c=0, s=0;
int main(void)
{
TCCR0 = 0b00000111; //(1 << CS02) | (1 << CS00); prescaler na 1024
// TIFR |= (1 << TOV0);
TIMSK |= (1 << TOIE0); // aktywne przerwanie overflow
// timer_enable_int(_BV(TOIE1));
TCNT0 = 0;
sei();
sbi(DDRB,PB1);
for(;
return(0);
}
SIGNAL (SIG_OVERFLOW)
{
sbi(PORTB,PB1);
}