Page 1 of 1

PWM Generating at expanded GPIO

Posted: Fri Dec 06, 2019 1:06 pm
by Humam Helfawi
Hi,

I have I2C GPIO expander. I used to generate PWM using

Code: Select all

ledc_channel_config
,

Code: Select all

ledc_set_duty 
and

Code: Select all

ledc_update_duty
at one of the original GPIOs of the ESP32.

Is it possible to use those function to generate PWM at GPIO in the expander? If not, what s the best way to do this manually? I tried to start new task

Code: Select all

xCreateTask
and do the generating manually via sending LOW and HIGH signals to the external GPIO but it was very slow and killing the ESP processor (I need 5KHZ frequency PWM).

Any suggestion?
Thanks!

Re: PWM Generating at expanded GPIO

Posted: Sat Dec 07, 2019 1:57 am
by WiFive
The best way is use an expander that has a built in led driver

Re: PWM Generating at expanded GPIO

Posted: Sat Dec 07, 2019 11:09 am
by Humam Helfawi
WiFive wrote:
Sat Dec 07, 2019 1:57 am
The best way is use an expander that has a built in led driver
Thanks for your reply! Do you have any suggestion?

Re: PWM Generating at expanded GPIO

Posted: Sat Dec 07, 2019 11:20 am
by Humam Helfawi
Humam Helfawi wrote:
Sat Dec 07, 2019 11:09 am
WiFive wrote:
Sat Dec 07, 2019 1:57 am
The best way is use an expander that has a built in led driver
Thanks for your reply! Do you have any suggestion?
I found this one http://www.ti.com/lit/an/snva287a/snva287a.pdf. but I think it is overkill (16 IOs). I am looking for at max 4 IOs only single one of them should have PWM ability.