Page 1 of 1

PWM for Different Channels with timer ISR

Posted: Mon Aug 12, 2019 4:38 pm
by nitesh2508
Hello all,
I am working on PWM which includes different channels i am updating the LUT values through GPIO using timer ISR every 1ms.I have configured different channels but only one channel works which is channel 0 and others don't show any changes.
I have attached my code for your reference.

Re: PWM for Different Channels with timer ISR

Posted: Thu Aug 15, 2019 2:06 am
by ESP_Sprite
Well, the fact that your timer ISR has ledc_set_duty/ledc_update_duty commented out for everything besides channel 0 probably isn't helping.

Re: PWM for Different Channels with timer ISR

Posted: Thu Aug 15, 2019 8:17 am
by mikemoy
Well, the fact that your timer ISR has ledc_set_duty/ledc_update_duty commented out for everything besides channel 0 probably isn't helping.
I am sure he knows that, and was probably just debugging by commenting things out.
I actually ran his code, and un-commented the next set. It's true, it does not work. using ledc_channel[0], works fine, once you add in ledc_channel[1] it breaks it. Moreover, if you comment out ledc_channel[0], and leave ledc_channel[1], then that works fine. But using 2 or more ledc_channels causes a problem.