How to blink LEDs with different frequency?
Lets say your led's connected to RD0 RD1 &amp; RD2. First you need a exact 1sec delay. Following function will provide you 1sec delay

void Delayms( unsigned t)
{
  T1CON = 0x8000; 
  while (t--)
  { 
    TMR1 = 0;
    while (TMR1 &lt; FPB/1000);
  }
} 


Now you said that blink led for 1,2,4 or 8 times per second.That means to blink led 1 times per second means half of the 1sec, led will be on and half of 1sec led will be off, which you can do it like this:

int main()
{
  TRISD = 0; //making all led's output
  while(1)
  {
    PORTD = 1; //led's will be on
    Delayms(500) //led's will be on for 500ms
    PORTD = 0;//led's will be off
    Delayms(500); //led's will be off for 500ms
  }
}


Now blinking led's 2 times per second means led will be on for 250ms then led off for 250ms and again the same thing. You can do it by replacing the delay by 250ms.
So in this way you can blink led's for 4 or 8 times per second.