Skip to main content

Microcontrollers

Section 5.3 Internal Pull-Up Resistors

There are internal pull-up resistors built in to each digital I/O pin on the ATmega328P. They have a value of approximately 36 kΩ. In order to make use of the pull-up resistors, write a value of 1 to a pin using the PORTx register when it is configured as an input. The input pull-up resistors can be globally turned off by setting the pull-up disable (PUD) bit in the microcontroller control register (MCUCR), but by default this bit is configured to enable the usage of the internal pull-ups. The I/O pin hardware that controls the input pull-up is shown in Figure 5.3.1.
Schematic of I/O port input pull-up resistors. The I/O pin connects to one end of a resistor. The other end of the resistor connects to the source of a PMOS transistor. The drain of the PMOS transistor connects to VCC. The gate of the PMOS transistor connects to the output of a NAND gate. The inputs of the NAND gate are the complement of "PUD," the complement of "DDxn," and PORTxn.
Figure 5.3.1. Hardware schematic of I/O port input pull-up resistors.