can anyone give any figures on how long a Pro mini takes to get into the first line of setup()?
I have a random glitch on a project connected to pins 8 and 9 of a pro mini.
no matter if that delay is there or not I have the problem.
The pcb conencted to it is providing regulated 5V to the pro mini, and it is receiving inputs from pins 8 and 9 and driving a power circuit.
There is an RC delay built into the connected PCB of 100ms. yet every now and then I see the glitch. Even if i set the delay in that snippet to 10s, the glitch is always just at powerup and for maybe 2 or 3 ms.
Hi, the standard is to declare the I/O first. Then making them HIGH/LOW. I can see that in your setup function You have declared your pin modes in 3rd and 4th lines. Kindly, do this task at the beginning.
hi , thanks for the reply,
I have tried both ways, I have read in the forums that if you write them low first, then the bit is alrady set when they are set as outputs and this can help avoid "glitching"
You don't have to do that. The reason to make them HIGH (not LOW) first before the pinMode() is that it prevents connected devices from reacting on them (glitching).
By default IO pins are input and will not be able to drive anything connected to them; switching them to output will make them LOW as the internal pullup is not active. Making the pin HIGH first will activate the internal pullup and after the pinMode() statement the output is immediately HIGH.
I don't know how long the bootloader on a Pro Mini takes. If it poses a problem, you can upload code via ICSP using a programmer or other Arduino and get rid of the bootloader.
I have a power LED on the output of them , and I would estimate that every 10 or so power cycles, the LED goes briefly full power, before the LED on pin 13 gives the first flash,
So it may indeed be the bootloader.
What do you want the signal to be when the bootlaoder is active. If you want to make sure that they are at a certain level, use an external pulldown resistor (if you want the signal to be LOW) or pullup resistor (if you want the signal to be HIGH).
Pins 8 and 9 are input while the bootloader is active so will not be able to drive anything. It however is possible that your power led picks up rubbish signals from the environment and reacts on that. What is the power led (datasheet please).
Note:
I only now see that this is about the Portenta H7. I think that the above does apply but I have no experience with them.
sorry, in the wrong section , this problem is a pro mini , not h7
the pins from the pro mini go to a driver pcb made by a buddy, I have added pull down resistors to that pcb. no change
If it's running the original bootloader, it can take close to 10seconds in the bootloader, waiting for upload traffic that won't happen. During that time, pin 8 and 9 should be "floating" (in their default state as "inputs.")
For future reference, the problem was not with the arduino. I purchased a scope and found an issue in the PCB driving the power LED.
thanks for all of your help