PWM and serial possilbe on the same ESP8266?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

PWM and serial possilbe on the same ESP8266?

#1 Post by wim16 » 17 Sep 2022, 11:16

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...

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PWM and serial possilbe on the same ESP8266?

#2 Post by Ath » 17 Sep 2022, 11:55

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-)
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PWM and serial possilbe on the same ESP8266?

#3 Post by TD-er » 17 Sep 2022, 19:52

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.

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: PWM and serial possilbe on the same ESP8266?

#4 Post by wim16 » 18 Sep 2022, 11:48

Ok, I did a test and it is working so far. Thanks for the information.

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: PWM and serial possilbe on the same ESP8266?

#5 Post by wim16 » 20 Sep 2022, 15:27

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.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PWM and serial possilbe on the same ESP8266?

#6 Post by TD-er » 20 Sep 2022, 16:11

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.


wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: PWM and serial possilbe on the same ESP8266?

#8 Post by wim16 » 20 Sep 2022, 23:08

Thank you. I the mean time I will have to change my PCB to use another GPIO.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests