Skip to main content

Microcontrollers

Section 5.2 Alternate Pin Functions

All of the I/O pins on the ATmega328P microcontroller serve alternative purposes. This increases the functionality of the microcontroller without requiring extra space for extra pins. Some of these alternative functions include acting as sources for external interrupts, providing functionality for serial communication, converting analog to digital signals, etc. Each pin has extra hardware that allows for this extra functionality. Multiplexers route control signals to either have the pins act as regular I/O pins, or to function with their alternate purpose. The I/O pin multiplexers are shown schematically in Figure 5.2.1.
Schematic of alternate I/O port functionality. The port pin is connected to the output of a tri-state buffer. The enable of the tri-state buffer connects to the output of a 2 to 1 MUX whose control bit connects to "DDR override enable," data input 0 connects to "DDRxn," and data input 1 connects to "DDR override value." The input of the tri-state buffer connects to the output of a 2 to 1 MUX whose control bit connects to "PORT override enable," data input 0 connects to "PORTxn," and data input 1 connects to "PORT override value."
Figure 5.2.1. Hardware schematic of alternate I/O port functionality.