This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

i need to generate pwm with in interrupt



I need  to generate a pwm and another pwm in interrupt with same frequencies  ,here i do like this

 1. In main 1 timer interrupt is enabled and pwm initialization function called.

2. And in timer interrupt function i toggled 1 port pin ......, but it can not go into that interrupt , what i do.

  give me the code  for generating 2 pwms 1 in main and 1 more in interrupt  on two different ports .........