I need to use internal pullup of an AVR mcu for controlling push buttons without using extra 10k resistors. In arduino, it can be easily used by setting pinMode(pinNumber, INPUT_PULLUP), but I need to implement this code in pure avr program. I've looked for a while and no luck.
Any useful links, comments, advice or codes will be greatly appreciated.
Note: I am using ATmega8A for the project, I also have an ATmega328P [SMD] Breakout with chip and an ATmega32A.
DrAzzy is saying that you have to manipulate the DDRx and PORTx port registers. The former sets ports as inputs (0) or outputs (1), while the latter controls logic levels for outputs and toggles the internal pull-up resistors for inputs (which are enabled when the relevant bit is 1).