How to remove PWM signal from GPIO14?

User avatar
mbratch
Posts: 298
Joined: Fri Jun 11, 2021 1:51 pm

Re: How to remove PWM signal from GPIO14?

Postby mbratch » Fri May 20, 2022 7:53 pm

Thanks, that's great info, Craige. I will look at that portion of the documentation in more detail.

Btw, I have 8 LEDs connected (through a 330 ohm resistor, I think, each) all to individual GPIOs and three of them, at boot, do twitter dimly for a second-ish. Not quite as annoying as a 7-segment display twittering though. :)

User avatar
mbratch
Posts: 298
Joined: Fri Jun 11, 2021 1:51 pm

Re: How to remove PWM signal from GPIO14?

Postby mbratch » Sat May 21, 2022 4:24 pm

Craige Hales wrote:
Fri May 20, 2022 1:47 am
I studied some more and now understand my case. The document "ESP32 Series Datasheet" page 62, appendix A, "IO Mux" describes pins after reset, some not enabled, some Input enabled, and if input enabled with a weak pull up, pull down, or neither.
The weak pull up and weak pull down is sufficient to interact with the 7-segment matrix (4 digits, 7segs+decimal) until my code gets around to setting the GPIOs. Now that I understand, it would have been easy to swap some GPIOs around, during the board design. I might still initialize them sooner. (Yes. An input port, with an internal pull down will sink some current, or a pull up will source some current. Also looks like a zero or one.)
Hi Craige. I may have found a solution that also involves hardware, but doesn't require swapping GPIOs around to handle LEDs, which may or may not be very convenient even at design time.

Currently, my circuit has GPIO14 straight out to a 220 ohm resistor, through an LED, then to ground. It exhibits the dim light flutter immediately after reset. I was thinking that if GPIO14 has a weak pull-up, then if I could draw enough current to ground at start-up, I could eliminate the impact on the LED by not achieving the forward voltage or forward current requirement of the LED.

The idea is to add a resistor from the GPIO to ground in parallel with the existing resistor/LED path. I played with a couple of resistor values and, sure enough, it worked well in my case. Using a 1kohm practically eliminated the small voltage level seen at the resolution I had set on the scope trace (5V per major gradation) and didn't seem to diminish the intensity of the LED noticeably. I tried other values and found I could use as high as 8.3kohm and not see the LED light up dimly during boot although I could still see some voltage rise (about 0.6V) on the scope after reset, just not enough to turn on the LED. Using a higher resistance of course doesn't diminish the LED intensity as much and minimizes the current usage on the GPIO while it's on. But as I say, in my application, it's not noticeable either way. for a 7 segment display, you'd need to experiment with different resistance values. With multiple segments or LEDs, I'd use a resistor network component.

Here's the original trace before the resistor. Here's the new trace with an 8.3k resistor. IO15 shows the reset button press. IO14 shows the initial voltage rise (from the weak pull-up) followed by my code setting the LED on.

@Stomper this may be of interest to you as well.

Who is online

Users browsing this forum: Google [Bot], StanInexeon and 131 guests