Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Question about 500Hz Maximum PWM Frequency #2

Closed
tonysmith55 opened this issue Nov 26, 2021 · 1 comment
Closed

Question about 500Hz Maximum PWM Frequency #2

tonysmith55 opened this issue Nov 26, 2021 · 1 comment
Labels
Support Library support

Comments

@tonysmith55
Copy link

Hello, Thanks for creating a great library, particularly its non-blocking feature.

I understand controllers and interrupt driven timers but don't have experience with the ESP32 family to fully understand its features and limitations.

Do you see a problem with extending the maximum frequency from 500Hz to 1,000Hz?

My simple testing seems to suggest it works but I don't have access to an Oscilloscope at the moment to confirm both the frequency and waveform.

@khoih-prog
Copy link
Owner

Thanks for your interest in the library and nice words.
The max 500Hz is just a conservative frequency to be sure there is no issue, but I think you can use up to multi 1000Hz or a little bit more w/o any issue, depending on how many PWM channels you're using.

To test using higher freq., you can modify this line ESP32_PWM_ISR.h#L110 to

if ( ( frequency > 0 ) )

from

if ( ( frequency > 0 ) && ( frequency <= 500 ) )

Having fun testing,

@khoih-prog khoih-prog added the Support Library support label Nov 26, 2021
khoih-prog added a commit that referenced this issue Jan 30, 2022
### Releases v1.2.1

1. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Library support
Projects
None yet
Development

No branches or pull requests

2 participants