Hello Everybody :)
I have started programming atmega8 recently in C lanuage and I have problem with timers.
I want to make precise Led blinking on port D using TIMER 2 (TCCR2). Presented below chunk of code is not working! What am I doing wrong ? Please help me
Adam
// Precised LED switching #include#include #include //#include Should I use this library or //not ?? unsigned char milliseconds=0; int main(void) { DDRD= 0xFF; TIMSK=(1<<OCIE2); //compare match is enabled on TCCR2 OCR2=125; TCCR2 = ((1<<WGM21)|(0<<WGM20)|(1<<CS21)); for(;;) { asm volatile( "WDR"::); } return(0); } SIGNAL(SIG_OUTPUT_COMPARE2) { PORTD =(milliseconds++); }