PWM for Different Channels with timer ISR

nitesh2508
Posts: 13
Joined: Wed Jul 17, 2019 8:55 pm

PWM for Different Channels with timer ISR

Postby nitesh2508 » Mon Aug 12, 2019 4:38 pm

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.
Attachments
Tuo_mode_Module.c
(39.21 KiB) Downloaded 531 times

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: PWM for Different Channels with timer ISR

Postby ESP_Sprite » Thu Aug 15, 2019 2:06 am

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.

mikemoy
Posts: 599
Joined: Fri Jan 12, 2018 9:10 pm

Re: PWM for Different Channels with timer ISR

Postby mikemoy » Thu Aug 15, 2019 8:17 am

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.

Who is online

Users browsing this forum: No registered users and 100 guests