HI all!
I need to control a PWM via potentiameter in anothe project. First I test it in a simple testprogram. When I simulate the program it doesn´t work, I don´t see the PWM on the Graph. I have not test in real word yet, so I don´t know if it work,
What am I do wrong, please?
Br Jorgen
ESP32 PWM!
-
- Posts: 615
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 509 times
- Been thanked: 132 times
-
- Valued Contributor
- Posts: 1186
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 289 times
- Been thanked: 417 times
Re: ESP32 PWM!
Hi Jorgen
The PWM component needs to have a PWM Timer selected and has a period overflow of 255 for 8-bit devices and 65535 for 16-bit devices which also needs to be set according to your device.
I see your slider has a range of 0-4095 so you could perhaps use the Map component to scale to 0-255 for your Duty?
Hope this helps.
Regards
The PWM component needs to have a PWM Timer selected and has a period overflow of 255 for 8-bit devices and 65535 for 16-bit devices which also needs to be set according to your device.
I see your slider has a range of 0-4095 so you could perhaps use the Map component to scale to 0-255 for your Duty?
Hope this helps.
Regards
-
- Posts: 615
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 509 times
- Been thanked: 132 times
Re: ESP32 PWM!
Hi chipfryer27
Many thank´s for your help. Yes I managed to get it work in simulation after your advice. I have compile to chip, no uotput
I use theanalog (warm ) Analog 4 = pin 32 and for the PWM out I use CH4 with pin B3 = D11
Do you have any advice?
Many thank´s for your help. Yes I managed to get it work in simulation after your advice. I have compile to chip, no uotput
I use theanalog (warm ) Analog 4 = pin 32 and for the PWM out I use CH4 with pin B3 = D11
Do you have any advice?
- Attachments
-
- PWM_ESP.fcfx
- (11.53 KiB) Downloaded 16 times
-
- Valued Contributor
- Posts: 1186
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 289 times
- Been thanked: 417 times
Re: ESP32 PWM!
Hi Jorgen
I don't use the ESP32 that much but from what I see with View > Target (showing pins)
I agree that the Slider is connected to IO32 / ADC4 PortB.0 but I'm unsure where you get D11 for the PWM. Is that a typing error?
How are you measuring the output? You will need a scope or an analyser on the pin to see the duty change.
Regards
I don't use the ESP32 that much but from what I see with View > Target (showing pins)
I agree that the Slider is connected to IO32 / ADC4 PortB.0 but I'm unsure where you get D11 for the PWM. Is that a typing error?
How are you measuring the output? You will need a scope or an analyser on the pin to see the duty change.
Regards
-
- Posts: 615
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 509 times
- Been thanked: 132 times
Re: ESP32 PWM!
Hi again!
I disvoverd that if I change the channel I saw that Pin was changing Timer A and B so I try to use Channel 1 and pin A15 then I get fine PWM out
I not managed it by any of the BPins. But anyway, by help from you I can continue my project.
I think it is tricky with pinnumbers with ESP32, no logig
Again thank´s
Br Jorgen
I disvoverd that if I change the channel I saw that Pin was changing Timer A and B so I try to use Channel 1 and pin A15 then I get fine PWM out
I not managed it by any of the BPins. But anyway, by help from you I can continue my project.
I think it is tricky with pinnumbers with ESP32, no logig
Again thank´s
Br Jorgen
- Attachments
-
- PWM_ESP.fcfx
- (11.53 KiB) Downloaded 12 times
-
- Valued Contributor
- Posts: 1186
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 289 times
- Been thanked: 417 times
Re: ESP32 PWM!
Hi
Glad you have it working now.
Regards
It certainly seems that wayI think it is tricky with pinnumbers with ESP32, no logig
Glad you have it working now.
Regards