user26003: I'm attempting to use the pin labeled 'ADC7' from the Atmega328p TQFP package. The Atmega documentation suggests that can be used either as an analog or digital I/O point. I'm trying to configure it as a digital output.
Referencing the documentation (and specifically arduino_pins.h), I determined the associated pin number was 21. Thus I called pinMode(21, OUTPUT). However, this pin does not appear to be working with my SPI device. I previously tested that the device worked, but I made a last second change of pin and am now using ADC7.
So my question, is there an additional step required to configure this pin as a digital output? I noticed that this pin doesn't exist on the DIP Atmega328p (used on the Arduino Uno), so I'm not sure if I have to add another line of code somewhere.
Any ideas?
Regards,

user2881: Those are analog pins only. They can't be used as outputs or digital inputs.

user3917: Gerben's answer probably is correct, but there are some interesting discrepancies in Atmel datasheets for various models of the ATmega168 and ATmega328, as outlined below.
Some Atmel datasheets refer to ADC6 and ADC7 as PE2 and PE3, while others just refer to them as ADC6 and ADC7.
Regarding port E, the 2014 ATmega168PA and 2015 ATmega168 datasheets say nothing, don't list any of PE0 to PE3, and don't specify port membership for ADC6 and ADC7.  They show pins 3 and 6 on the LQFP as Gnd and Vcc, vs PE0 and PE1 as in the ATmega168PB sheet.
Regarding port E, the 2015 ATmega168PB datasheet says: 
Table 15-12.  Port E Pins Alternate Functions
     Port Pin       Alternate Function
       PE3          ADC7 (ADC Input Channel 7)
       PE2          ADC6 (ADC Input Channel 6)
       PE1          NONE
       PE0          ACO (AC Output Channel 0)

Regarding port E, the 2016 ATmega168PB datasheet, Atmel-42176G-ATmega48PB/88PB/168PB_Datasheet_Complete-03/2016, says the following
and also lists several Alternate Functions while referring to
Timer/Counters 3 and 4 (although there seem to be no registers in the
register summary relevant to such Timer/Counters):
"Port E is an 4-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port E output buffers have
symmetrical drive characteristics with both high sink and source
capability. As inputs, Port E pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port E pins
are tri-stated when a reset condition becomes active, even if the clock is not running."
Table 19-12.  Port E Pins Alternate Functions
 Port Pin            Alternate Function
 PE3                 ADC7 (ADC Input Channel 7)
                     T3 (Timer/Counter 3 External Counter Input) & PCINT27
 PE2                 ADC6 (ADC Input Channel 6)
                     ICP3 (Timer/Counter3 Input Capture Input)
                     SS1 (SPI1 Bus Master Slave select) & PCINT26
 PE1                 T4 (Timer/Counter 4 External Counter Input)
                     SCL1 (2-wire Serial1 Bus Clock Line) & PCINT25
 PE0                 ACO (AC Output Channel 0)
                     ICP4 (Timer/Counter4 Input Capture Input)
                     SDA1 (2-wire Serial1 Bus Data Input/Output Line) & PCINT24


user4143: According to everything you can find in the datasheet about ADC6 and ADC7 they are analog only pins.
The pinout for the TQFP-32 as used on the Pro Mini shows those two pins as only having the analog functions:

I suspect the color coding of the pins may be wrong - they should be solid green. They have no port names on the pins, purely the ADCx designation.
The block diagram for the chip shows the ADC6/7 pins being separate from a port:

As you can see the other 6 pins are referred to by the digital port they share, but ADC6 and 7 are known purely as ADC6 and ADC7.
The pin function table, 6-1, shows ADC6 and ADC7 as the only functions on those pins. No digital port names, nothing - just purely analog input.
So in summary, for the ATMega328P chip used in the Arduino Pro Mini you cannot use those two pins for digital at all, only for analog input.

user67786: I appreciate this is an old question but those pins are subtly different on the ATMEGA328PB compared to the ATMEGA328P which I discovered recently. See the Microchip app note AT15007, page 3.
Microchip AT15007 app note

user62455: This may be a little left field, but I use the ADC6 and ADC7 inputs to detect switches.  I just don't use the digitalRead() function, but instead use analogRead() function.  Using a resistor network and switches and some decoder software code in our sketch, we can use a single input pin to interface with many more switches.  The switches can only be on one at a time, but in many instances, this would be OK.  

26003: <p>I'm attempting to use the pin labeled 'ADC7' from the Atmega328p TQFP package. The Atmega documentation suggests that can be used either as an analog or digital I/O point. I'm trying to configure it as a digital output.</p>

<p>Referencing the documentation (and specifically arduino_pins.h), I determined the associated pin number was 21. Thus I called pinMode(21, OUTPUT). However, this pin does not appear to be working with my SPI device. I previously tested that the device worked, but I made a last second change of pin and am now using ADC7.</p>

<p>So my question, is there an additional step required to configure this pin as a digital output? I noticed that this pin doesn't exist on the DIP Atmega328p (used on the Arduino Uno), so I'm not sure if I have to add another line of code somewhere.</p>

<p>Any ideas?</p>

<p>Regards,</p>
 2881: <p>Those are analog pins only. They can't be used as outputs or digital inputs.</p>
 3917: <p>Gerben's answer probably is correct, but there are some interesting discrepancies in Atmel datasheets for various models of the ATmega168 and ATmega328, as outlined below.</p>

<p>Some Atmel datasheets refer to ADC6 and ADC7 as PE2 and PE3, while others just refer to them as ADC6 and ADC7.</p>

<p>Regarding port E, the 2014 ATmega168PA and 2015 ATmega168 datasheets say nothing, don't list any of PE0 to PE3, and don't specify port membership for ADC6 and ADC7.  They show pins 3 and 6 on the LQFP as Gnd and Vcc, vs PE0 and PE1 as in the ATmega168PB sheet.</p>

<p>Regarding port E, the 2015 ATmega168PB datasheet says: </p>

<pre><code>Table 15-12.  Port E Pins Alternate Functions
     Port Pin       Alternate Function
       PE3          ADC7 (ADC Input Channel 7)
       PE2          ADC6 (ADC Input Channel 6)
       PE1          NONE
       PE0          ACO (AC Output Channel 0)
</code></pre>

<p>Regarding port E, the 2016 ATmega168PB datasheet, Atmel-42176G-ATmega48PB/88PB/168PB_Datasheet_Complete-03/2016, says the following
and also lists several Alternate Functions while referring to
Timer/Counters 3 and 4 (although there seem to be no registers in the
register summary relevant to such Timer/Counters):</p>

<p>"Port E is an 4-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port E output buffers have
symmetrical drive characteristics with both high sink and source
capability. As inputs, Port E pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port E pins
are tri-stated when a reset condition becomes active, even if the clock is not running."</p>

<pre><code>Table 19-12.  Port E Pins Alternate Functions
 Port Pin            Alternate Function
 PE3                 ADC7 (ADC Input Channel 7)
                     T3 (Timer/Counter 3 External Counter Input) &amp; PCINT27
 PE2                 ADC6 (ADC Input Channel 6)
                     ICP3 (Timer/Counter3 Input Capture Input)
                     SS1 (SPI1 Bus Master Slave select) &amp; PCINT26
 PE1                 T4 (Timer/Counter 4 External Counter Input)
                     SCL1 (2-wire Serial1 Bus Clock Line) &amp; PCINT25
 PE0                 ACO (AC Output Channel 0)
                     ICP4 (Timer/Counter4 Input Capture Input)
                     SDA1 (2-wire Serial1 Bus Data Input/Output Line) &amp; PCINT24
</code></pre>
 4143: <p>According to everything you can find in <a href="http://www.atmel.com/Images/Atmel-42735-8-bit-AVR-Microcontroller-ATmega328-328P_Datasheet.pdf" rel="nofollow noreferrer">the datasheet</a> about ADC6 and ADC7 they are analog only pins.</p>

<p>The pinout for the TQFP-32 as used on the Pro Mini shows those two pins as <em>only</em> having the analog functions:</p>

<p><a href="https://i.stack.imgur.com/NVdFq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NVdFq.png" alt="enter image description here"></a></p>

<p>I suspect the color coding of the pins may be wrong - they should be solid green. They have no port names on the pins, purely the ADCx designation.</p>

<p>The block diagram for the chip shows the ADC6/7 pins being separate from a port:</p>

<p><a href="https://i.stack.imgur.com/y2nqK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y2nqK.png" alt="enter image description here"></a></p>

<p>As you can see the other 6 pins are referred to by the digital port they share, but ADC6 and 7 are known purely as ADC6 and ADC7.</p>

<p>The pin function table, 6-1, shows ADC6 and ADC7 as the only functions on those pins. No digital port names, nothing - just purely analog input.</p>

<p>So in summary, for the ATMega328P chip used in the Arduino Pro Mini you cannot use those two pins for digital at all, only for analog input.</p>
 67786: <p>I appreciate this is an old question but those pins are subtly different on the ATMEGA328PB compared to the ATMEGA328P which I discovered recently. See the Microchip app note AT15007, page 3.</p>
<p><a href="http://ww1.microchip.com/downloads/en/Appnotes/Atmel-42559-Differences-between-ATmega328P-and-ATmega328PB_ApplicationNote_AT15007.pdf" rel="nofollow noreferrer">Microchip AT15007 app note</a></p>
 62455: <p>This may be a little left field, but I use the ADC6 and ADC7 inputs to detect switches.  I just don't use the digitalRead() function, but instead use analogRead() function.  Using a resistor network and switches and some decoder software code in our sketch, we can use a single input pin to interface with many more switches.  The switches can only be on one at a time, but in many instances, this would be OK.  </p>
