PWM Generating at expanded GPIO

Humam Helfawi
Posts: 19
Joined: Tue May 29, 2018 10:24 pm

PWM Generating at expanded GPIO

Postby Humam Helfawi » Fri Dec 06, 2019 1:06 pm

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!

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: PWM Generating at expanded GPIO

Postby WiFive » Sat Dec 07, 2019 1:57 am

The best way is use an expander that has a built in led driver

Humam Helfawi
Posts: 19
Joined: Tue May 29, 2018 10:24 pm

Re: PWM Generating at expanded GPIO

Postby Humam Helfawi » 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?

Humam Helfawi
Posts: 19
Joined: Tue May 29, 2018 10:24 pm

Re: PWM Generating at expanded GPIO

Postby Humam Helfawi » Sat Dec 07, 2019 11:20 am

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.

Who is online

Users browsing this forum: No registered users and 76 guests