Arduino pin status at boot time

Hi all,

is Arduino bootloader configuring digital IO somehow ? Can I make any assumption with respect to the HIGH or LOW status of some pins at boot time, before my sketch is launched ?



I think all of the pins are configured as inputs at power on and the bootloader makes no changes to this state, except for the TX, RX, and digital13 pins. (Digital13 gets strobed to blink the LED.)

Thanks for the answer ;) In the meantime I've made some experiments and it looks like the behavior depends on the controller and/or the bootloader version. For example, pin 3 is set to HI on ATMEGA168, whereas it is set to LOW on ATMEGA8. Is the bootloader source available ?

Hmm... is pin 6 also high on your ATmega168? Are any other pins? paulb's been asking about this in another forum post, and I think it might be not the bootloader but the PWM / timer 0 code in the Arduino core's initialization (the init() function in wiring.c in lib/targets/arduino in the Arduino application directory).


here the results: on both Atmega8 and Atmega168 all pins are LOW with the exception of pin6 which is set to HIGH on Atmega168 only.

But not pin 3?

Nope, my mistake: was pin 6, not pin 3...