I was reading the datasheet on the ATMega328 and(as with PIC) i've noticed it has internal pull-ups in all ports individually selectable and so i was wondering:
¿When enabling a pin as digitalinput, does the pullup get automatically enabled?, if not, can i use the AVR-GCC config directives to enable them or will those break the Arduino port functions?
reference manual does not indicate anything about the pullups and i see that all the examples use external pullups/pulldowns
nitromuse:
Would you mind sharing this with the rest of the world?
Thanks,
Nitro,
there was a reply from a user that's now been deleted -who knows why- that had the answer, anyway, here it is:
If you do a digitalwrite HIGH on a pin configured as input, it enabled the 20K internal weak pull-up
check: digitalWrite() - Arduino Reference
" If the pin is configured as an INPUT, writing a HIGH value with digitalWrite() will enable an internal 20K pullup resistor "