Go Down

Topic: Pins floating after reset? (Read 698 times) previous topic - next topic

nilton61

I suspect that the pins are floating after a reset. I wrote this code for checking
Code: [Select]
void setup() {
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
digitalWrite(11, 0);
digitalWrite(12, 0);

}

void loop() {
  // put your main code here, to run repeatedly:

}


and connected my digilent analog discovery to gnd, di0-PIN12, di1-pin11.
The attached picture shows the result. The time seems to be the same for pin 13 to come on.
Is there any way to prevent this?

Peter_n

No, that is how it is, and that is how it should be.

If you want a pin to stay low during reset, use a pulldown resistor.

CrossRoads

Or a pullup if you want them high, say for keeping a High Side switch (PNP, P-channel MOSFT) turned off.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

DrAzzy

#3
Jun 25, 2015, 09:06 pm Last Edit: Jun 25, 2015, 09:07 pm by DrAzzy
Why... why are those pins pulsing in that attached image? It looks like they ought to be static. Were you resetting it during that time, and are objecting to the delay between the reset, and the signal being reasserted? In that case, use a pulldown/pullup resistor as suggested above. You could reduce the length of that delay after the end of reset if you programmed it via ISP instead of normal serial, and removed the bootloader (the bootloader runs right after reset, and waits a very short time to see if you're trying to program it). But that makes reprogramming it considerably less pleasant.

Or is your problem that the board was resetting at all during that time?
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

nilton61

I believe the pins seem to be pulsating because they are high impedance so the analyzer picks up any kind of disturbance.
My problem was that i wanted to do some timing analysis on interrupts but the false triggering made that very difficult. I found some 10k sils lying around, that solved the problem.

Peter_n

#5
Jun 26, 2015, 10:00 am Last Edit: Jun 26, 2015, 10:00 am by Peter_n
Nice fix :)

MarkT

I believe the pins seem to be pulsating because they are high impedance so the analyzer picks up any kind of disturbance.
To be precise 50Hz mains frequency if you measure the traces!
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up