DIGITAL GPIO start-up glitch

Hi,

The glitch also happens when the spark awakes from deep sleep. If you use sensors with negativ trigger logic like DHTxx you should change to analog pins (which a have to test now)

1 Like

Related but separate - pins D0-D2 on my Core sink current for about 7-8 seconds during program flashing (I just have LEDs fed from 3.3V through resistors to those pins). Is that normal? Is there a way to prevent that?

1 Like

Hi @SaratogaDude,

That’s a really interesting question. I’ll ping @satishgn / @mohit about that one in case they have a chance to chime in. I’m guessing it has to do with time spent in the bootloader in JTAG mode or something similar.

Thanks,
David

@Dave, @satishgn, @mohit, has anything been resolved/documented regarding the GPIO glitching on reset?

Heya @peekay123,

I know there’s been a ton of activity in firmware land, but I don’t know about this issue specifically, hopefully those guys can chime in. :slight_smile:

Thanks,
David

1 Like

In order to pull some threads about this issue together, I created a new topic in the troubleshooting section

Even in this old thread, since the issue is still a sore point in my - and other people’s - eyes

I solved this very simply by using the fast io functions to set the desired initial value before configuring as an output and thus driving the output line.

   pinSetFast(pin); // initialize to HIGH
   pinSetMode(pin, OUTPUT);  // enable output

or

   pinResetFast(pin); // initialize to LOW
   pinSetMode(pin, OUTPUT);  // enable output

In reality, the library should have a setPinMode that takes a third argument which is the initial value. In my case I have some outputs that are active low and some that are active hi so I wrote a generic wrapper so I can change an output from active high to active low later and not worry about spreading HIGH and LOW around my code:

See my post here for details,

2 Likes

As said there, that's not addressing the original problem.

And in order pull the discussion about this together into one thread I had opened the other thread.
So I'll now close this one to keep people from double posting.

2 Likes