Page 1 of 1

PWM and serial possilbe on the same ESP8266?

Posted: 17 Sep 2022, 11:16
by wim16
Hi,

I am thinking of implementing a serial (P1) interface AND PWM-output (LED-dimmer) on 1 single ESP8266.
Will this work or will the PWM interfere with the serial timing? In that case I will have to use seperate ESP's for each of the functions.
Of course I can just try to see if it works but maybe someone has experience and save me some work...

Re: PWM and serial possilbe on the same ESP8266?

Posted: 17 Sep 2022, 11:55
by Ath
I can't see why that wouldn't work? These ESP's pack more CPU power than business-grade computers of the 1980's and 1990's 8-)

Re: PWM and serial possilbe on the same ESP8266?

Posted: 17 Sep 2022, 19:52
by TD-er
Just make sure to use Hardware Serial, like Serial0 or Serial0_swapped.
This doesn't use software but will use dedicated hardware to fill up a buffer.

Re: PWM and serial possilbe on the same ESP8266?

Posted: 18 Sep 2022, 11:48
by wim16
Ok, I did a test and it is working so far. Thanks for the information.

Re: PWM and serial possilbe on the same ESP8266?

Posted: 20 Sep 2022, 15:27
by wim16
Well, I have to correct my previous post....
It looks like the P1-device uses a P044_STATUS_LED on GPIO12, which 'of course' is the GPIO I intended use for the dimmer.
Now the dimmer value (PWM) is interrupted by the status led of the P1 device.
It would be nice if the status led GPIO was configurable but currently it is not.

Re: PWM and serial possilbe on the same ESP8266?

Posted: 20 Sep 2022, 16:11
by TD-er
Hmm, that's -as far as I know- the first time someone mentions this.

I guess we can make it configurable (and even allow to disable the status LED for this plugin) but that does require some code changes.

Re: PWM and serial possilbe on the same ESP8266?

Posted: 20 Sep 2022, 16:26
by TD-er

Re: PWM and serial possilbe on the same ESP8266?

Posted: 20 Sep 2022, 23:08
by wim16
Thank you. I the mean time I will have to change my PCB to use another GPIO.