Hy. I want to generate two diferent delays, using timer0 pic16f88. step 1 : led 1 stay ON 4 sec step 2 : led 1 stay OFF 3 sec By the way I use a Matrix multimedia development board. Look at my cod : in this moment the led 1 stay ON - 4 sec and then stay OFF - 4 sec. I know that my mistake is in interrupt function, but i am not able to correct this mistake.=20 #include #pragma DATA _CONFIG1, _EXTRC_CLKOUT & _WDT_OFF & _LVP_OFF unsigned int counter=3D0; void interrupt()=20 { =20 if(intcon & 0x04) =20 { =20 clear_bit(intcon, 2);=20 counter++; =20 if(counter =3D=3D 3906) =20 { portb =3D ~portb; counter=3D0; } } =20 } void main() { trisb =3D 0xf0; portb =3D 0; tmr0 =3D 0; cmcon =3D 0x07; option_reg =3D 0b00000001; // prescaler =3D 4 intcon =3D 0b10100000; while(1) { =09 }=20 } -- View this message in context: http://microcontrollers.2385.n7.nabble.com/PI= C-TIMER0-delay-tp183408.html Sent from the MicroControllers - PIC mailing list archive at Nabble.com. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .