Reply To: Delay in PWM

Home Forums Microcontrollers PIC Microcontroller Delay in PWM Reply To: Delay in PWM

#11613

Shubham
Participant

Hi Ligo,
I have generated these two waves having different duty cycle.. but i want to general a delay of 10us between the start time of the two waves. i have tried to do it by delay function but it is not working. can you suggest me a method. the link you provided was not useful as it was difficult to interpret. can you help me by looking out this code?

void main(void)
{
  TRISC2_bit=0;
  PORTC=0;
  PWM1_Init(8000);
  PWM2_Init(8000);
  while(1)
  {
    PWM1_Start();
    PWM1_Set_Duty(2.04);
    Delay_us(10);
    PWM2_Start();
    PWM2_Set_Duty(32.64);
  }
}
string(7) "9898001"