Search found 7 matches

by andy_wharton_uk
Fri Dec 13, 2024 4:17 pm
Forum: Hardware
Topic: ESP32 will not output PWM signal
Replies: 10
Views: 4325

Re: ESP32 will not output PWM signal

Hi,

Good idea. I'll look at that for the final code.

Thanks for your help.

Andy
by andy_wharton_uk
Wed Dec 11, 2024 8:31 pm
Forum: Hardware
Topic: ESP32 will not output PWM signal
Replies: 10
Views: 4325

Re: ESP32 will not output PWM signal

Hi, I added more GPIO captures in and eventually spotted I had my case statements wrong - UP was 1, 2, 3,4 and DOWN is 0, 1, 2, 3. Doh!! I have working PWM signals now. I'm still unsure why or how I managed to lose them in the first place but at least I have something to work with now. I will go and...
by andy_wharton_uk
Wed Dec 11, 2024 4:20 pm
Forum: Hardware
Topic: ESP32 will not output PWM signal
Replies: 10
Views: 4325

Re: ESP32 will not output PWM signal

Hi, Update on this.... I've tried a brand new device and still got nothing however, in re-trying my original MCPWM code I now have the code generating a PWM signal from GPIO16 but ONLY when ramping DOWN from peak to 0 Duty cycle. It's the same call to ESP_ERROR_CHECK(mcpwm_comparator_set_compare_val...
by andy_wharton_uk
Tue Dec 03, 2024 7:02 pm
Forum: Hardware
Topic: ESP32 will not output PWM signal
Replies: 10
Views: 4325

Re: ESP32 will not output PWM signal

Hi, Thanks again, this is really helping. OK, I guess the numbers are right. Since my ESP-WROOM-32 only has a 40MHz clock I need to think practical so 100 steps would be fine putting resolution_hz at 1.6MHz and period_ticks at 100. I tried the same ESP32 with a simple blink LED automation using ESPH...
by andy_wharton_uk
Tue Dec 03, 2024 3:52 pm
Forum: Hardware
Topic: ESP32 will not output PWM signal
Replies: 10
Views: 4325

Re: ESP32 will not output PWM signal

Hi, Many thanks for your help. I never was great at the maths side of programming :-). Re-reading the Programming Guide I can see that the "tick resolution is set in resolution_hz" so that makes sense with what you are saying - in my case each period_tick is 950/16384 ~ 0.058 ~ 17Hz. I would still e...
by andy_wharton_uk
Mon Dec 02, 2024 9:20 am
Forum: Hardware
Topic: ESP32 will not output PWM signal
Replies: 10
Views: 4325

Re: ESP32 will not output PWM signal

Hi, Historical as the code was ported from Arduino where delay() is a blocking function. I didn't know it was non-blocking on ESP32 so thanks. All my debug output indicates that the code is working, just no PWM signal: 09:26:55.314 -> ESP32 MCPWM Debug Output - V1.20 09:26:55.751 -> Create Timers. 0...
by andy_wharton_uk
Sun Dec 01, 2024 3:33 pm
Forum: Hardware
Topic: ESP32 will not output PWM signal
Replies: 10
Views: 4325

ESP32 will not output PWM signal

Hi, I have a project developed using the Arduino IDE and an Arduino Nano to drive motors on an ROV. This code has been working for a couple of years in various versions. I now need to upgrade to an ESP32-WROOM-32 and, to drive the motors, have delved into the latest mcpwm API. It's taken my brain ce...