PWM FC component for ESP ?

For general Flowcode discussion that does not belong in the other sections.
medelec35
Matrix Staff
Posts: 2086
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: PWM FC component for ESP ?

Post by medelec35 »

Hi thank you for the spot.
I have edited my post.
Martin

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: PWM FC component for ESP ?

Post by Xbiotec »

Hello,
I need to deliver a sample PCBA and firmware to my customer Thursday morning so I need to be able to change the frequency ASAP
thx
Seb

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: PWM FC component for ESP ?

Post by BenR »

Sorry for the delay.

Hopefully should work for you now. Note you need to set the frequency after the PWM output is enabled otherwise the enable function will default back to the frequency set in the component properties.

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: PWM FC component for ESP ?

Post by Xbiotec »

thx Ben , I will test it now :D
Seb

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: PWM FC component for ESP ?

Post by Xbiotec »

hi Ben,
The PWM component you modified is PWM (CAL) isn't ?
Seb

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: PWM FC component for ESP ?

Post by medelec35 »

Hello.
No, it is the PWM (internal) component, and the digital simulation had also got broken, so that has now been fixed.
Martin

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: PWM FC component for ESP ?

Post by Xbiotec »

ok
but when I check for update, the component new version is cal_pwm.
update.jpg
update.jpg (13.12 KiB) Viewed 4123 times
and what is duty cycle range now for ESP32 ?
Set frequency do not work on FC PWM (internal) component.
Please also check duty cycle because I need to setdutycycle10bit to 32 to get 50% duty cycle .
What must be the max value for period overflow ?
32 is very low!

The modification you made are also for ESP32 Wroom ?
Seb

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: PWM FC component for ESP ?

Post by BenR »

Hello,

The PWM period property can be set up to 65535 on the ESP32, The duty can be between 0 (full off) and the period (full on).

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: PWM FC component for ESP ?

Post by Xbiotec »

the update work's very well
thx Ben
Seb

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: PWM FC component for ESP ?

Post by Xbiotec »

hello Ben,
I want to use 8 PWM output, the frequencies and dutycycle could be differents.
On the print screen below only 4 are setup for the moment.
Channel used are 1 to 4
On PWM component it's wrote that all PWM linked to the same timer will share same periode and prescaler .
Capture d’écran 2024-10-16 095007.jpg
Capture d’écran 2024-10-16 095007.jpg (49.94 KiB) Viewed 4065 times
I have set all period overflow to 65535. ok for me
so the prescalers will be same

The problem is that when I change the frequency:
- on PWM:0 timer:0 pin:A, , the frequency also change on PWM:0 timer:0 pin:B
- on PWM:0 timer:1 pin:A, , the frequency also change on PWM:0 timer:1 pin:B
Seb

Post Reply