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