#define F_CPU 12000000UL // 12 MHz #include #include #include #include #include /* frequency count 1st FGM */ unsigned long Freq; volatile unsigned int FreqCount, count; ISR(INT0_vect) { if ((PIND & (1<<2)) == 4) count++; //PD2 as INT0 PIN } ISR(TIMER1_COMPA_vect) { FreqCount = count; count=0; } void WriteByteSPI(unsigned char byte) { SPDR = byte; //Load byte to Data register while(!(SPSR & (1<>8)&0xff; WriteByteSPI(inbetween); } }