NC pins and Reset pin diode protection

Hello, I have read similar posts, and want to take a final decision about this.
My project is up and running at real work in my farm.
Is a controller that send signals for a solar cattle feeder.
It runs on small a Kicad PCB, and has no instability issues.
Reads initial work parameters from a CellPhone connected with HC05.

The questions are:

A. we have 9 not connected pins: 4, 13, 14, 15, 18, 23, 24, 25 and 26.
In PCB they are not wired, in soft they are not programmed.
Any recommendation ?

B. reset pin has a 10k pull up resistor, but not the protecting diode that Arduino R3 has in parallel with the resistor. We use the reset line only when uploading code to the micro, when in service it is not used. Need I ti include the diode anyway ? Any special diode ?

I attach the circuit

Thanks very much,
Best regards,
Horacio

A. I would configure them as input with pull up resistors enabled.

B. It's not a protection diode. It's to discharge the capacitor forcibly when the power is removed. That is to guarantee a reset when the power goes down for a very short time interval.

It doesn't make sense to say you never use the reset in normal use, you have to reset the device when power is first applied, any time power is applied.

1 Like

Hi,
@HARRIS46 circuit;

Your CAD should be able to export your circuit as a jpg file.

Tom... :smiley: :+1: :coffee: :australia:

I see... you're using the internal reset. Okay. Personally, I would not depend on that, unless I was really sure of the stability of the power supply during turn on.

Although the R3 and other schematics are in the public domain, AFAIK there has never been any authoritative source documentation explaining the design decisions.

Thanks for the answers.
I will add the discharge diode and program the internal resistors as suggested.

Have a very nice day !
Horacio

B. reset pin has a 10k pull up resistor, but not the protecting diode that Arduino R3 has in parallel with the resistor. We use the reset line only when uploading code to the micro, when in service it is not used. Need I ti include the diode anyway ? Any special diode ?

The UNO has an auto-reset circuit (C5, 10K, D2) that is controlled by the DTR signal of the USB serial interface IC used for programming and for the serial monitor and plotter. The diode you're referring to is used to clamp the 10V spike that would occur if no diode is present and the DTR signal returns high (goes from 0V to 5V). It prevents the USB serial interface (ATMEGA16U2) from triggering or using high voltage programming to reset or modify the fuses.

What about OUTPUT and digitalWrite(0) to them?

It's okay unless the pins become shorted somehow. As input, they're safe that way.

1:0 in Your favour.

You don't want to leave them floating... it has no effect on software but IIRC it can cause very small current dissipation in some circumstances. So it's more important with battery or low power apps.

Also I guess I'm 0:1 for the other question. Ah well...

Yes. My idea was that even if 10 k pullup is rather safe using GND would be even stronger. But as You said, any low impedance connection will blow the transistor.

True. Although hopefully one would not be running around shorting one's boards, would one? Heh, although I did burn up a 2N7002 this week. :slight_smile:

1 Like

Hello

I included:

pinMode(2, INPUT_PULLUP); // IC PIN 4
pinMode(7, INPUT_PULLUP); // IC PIN 13
pinMode(8, INPUT_PULLUP); // IC PIN 14
pinMode(9, INPUT_PULLUP); // IC PIN 15
pinMode(12, INPUT_PULLUP); // IC PIN 18

pinMode(A0, INPUT_PULLUP); // IC PIN 23
pinMode(A1, INPUT_PULLUP); // IC PIN 24
pinMode(A2, INPUT_PULLUP); // IC PIN 25
pinMode(A3, INPUT_PULLUP); // IC PIN 26

to define the behavior of not connected pins. IC number on the comment refers to the micro pin number. Compiled well, uploaded and runs all functions normally. I think I am right. First time using INPUT_PULLUP.

Thanks again !

So if it does not matter if the pins you do use are pulled up at boot, you can use a loop to set all pins to INPUT_PULLUP before you define the ones that are outputs. :+1:

Thanks for the advice, I replaced prior definition with:

byte arPins [ ] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17};
void setup()
{

for(int a = 0; a < sizeof(arPins); a++){
pinMode(arPins[a], INPUT_PULLUP);
}//end for

I did not include 18 and 19 because they are used at boot.
Runs perfect.
Thank you