#include #define xtal 8000000 interrupt[TIM0_COMP] void _1ms() { static unsigned char c1=0,c2=0; c1++; c2++; if(c1==5) { /* i++; // har 5ms yekbar in dastoor ejra mishavad */ } if(c2==10) { /* FNC(); //har 10ms yekbar in dastoor ejra mishavad */ } } void main() { TIMSK=0x02; //tim0_comp int on OCR0=124; TCCR0=0x0B; // CTC , p=64 OCR1A=128; OCR1B=192; TCCR1A=0xA1; // OC1A & OC1B on , phase correct 8-bit TCCR1B=0x01; // p=1 OCR2=64; // DutyCycle 25% TCCR2=0x61; while(1); }