Richard, I would do something like this (again in MikroC): // declare a couple of global variables // the scope must make them persist in both Interrupt and main Char counter, second_flg =3D0; //Timer1 //Prescaler 1:8; TMR1 Preload =3D 3036; Actual Interrupt Time : 100 ms =20 //Place/Copy this part in declaration section void InitTimer1(){ T1CON =3D 0x31; TMR1IF_bit =3D 0; TMR1H =3D 0x0B; TMR1L =3D 0xDC; TMR1IE_bit =3D 1; INTCON =3D 0xC0; } =20 void Interrupt(){ if (TMR1IF_bit){=20 TMR1IF_bit =3D 0; TMR1H =3D 0x0B; TMR1L =3D 0xDC; //Enter your code here counter =3D counter + 1; if(counter > 9){counter =3D 0; second_flg =3D 0xff;} } }=20 void Main{ InitTimer1(); turnOnPin(); // replace this with your actual code do{ if(second_flg){ TMR1IE_bit =3D 0; TMR1H =3D 0x0B; TMR1L =3D 0xDC; // reset the timer for the next round turnOffPin(); // again do this your way second_flg =3D 0; delay_ns(20); turnOnPin(); TMR1IE_bit =3D 1; // and do it again } }while(1) } > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of > Richard R. Pope > Sent: Saturday, July 19, 2014 3:32 PM > To: Microcontroller discussion list - Public. > Subject: Re: [Pic] Making a special timer! >=20 > Jan-Erik, > The interrupt happens every 100mS. So for a one second delay I need > to execute ten interrupts. But I just don't understand how to do this. > Argh, this is so frustrating. I wish I could get it. > Thanks, > rich! >=20 > What goes here?? > void Interrupt(){ > //if (TMR1IF_bit){ > TMR1IF_bit =3D 0; > TMR1H =3D 0x0B; > TMR1L =3D 0xDC; > //Enter your code here (and what goes here??) > } > } --=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 .