Datasheet

18.3.2. Alternate Functions of Port B
The Port B pins with alternate functions are shown in the table below:
Table 18-6 Port B Pins Alternate Functions
Port Pin Alternate Functions
PB7 OC2/OC1C
(1)
(Output Compare and PWM Output for Timer/Counter2 or Output Compare and
PWM Output C for Timer/Counter1)
PB6 OC1B (Output Compare and PWM Output B for Timer/Counter1)
PB5 OC1A (Output Compare and PWM Output A for Timer/Counter1)
PB4 OC0 (Output Compare and PWM Output for Timer/Counter0)
PB3 MISO (SPI Bus Master Input/Slave Output)
PB2 MOSI (SPI Bus Master Output/Slave Input)
PB1 SCK (SPI Bus Serial Clock)
PB0 SS (SPI Slave Select input)
Note:  1. OC1C not applicable in ATmega103 compatibility mode.
The alternate pin configuration is as follows:
• OC2/OC1C – Port B, Bit 7
OC2, Output Compare Match output: The PB7 pin can serve as an external output for the Timer/Counter2
Output Compare. The pin has to be configured as an output (DDB7 set “one”) to serve this function. The
OC2 pin is also the output pin for the PWM mode timer function.
OC1C, Output Compare Match C output: The PB7 pin can serve as an external output for the Timer/
Counter1 Output Compare C. The pin has to be configured as an output (DDB7 set (one)) to serve this
function. The OC1C pin is also the output pin for the PWM mode timer function.
• OC1B – Port B, Bit 6
OC1B, Output Compare Match B output: The PB6 pin can serve as an external output for the Timer/
Counter1 Output Compare B. The pin has to be configured as an output (DDB6 set (one)) to serve this
function. The OC1B pin is also the output pin for the PWM mode timer function.
• OC1A – Port B, Bit 5
OC1A, Output Compare Match A output: The PB5 pin can serve as an external output for the Timer/
Counter1 Output Compare A. The pin has to be configured as an output (DDB5 set (one)) to serve this
function. The OC1A pin is also the output pin for the PWM mode timer function.
• OC0 – Port B, Bit 4
OC0, Output Compare Match output: The PB4 pin can serve as an external output for the Timer/Counter0
Output Compare. The pin has to be configured as an output (DDB4 set (one)) to serve this function. The
OC0 pin is also the output pin for the PWM mode timer function.
• MISO – Port B, Bit 3
MISO: Master Data input, Slave Data output pin for SPI channel. When the SPI is enabled as a master,
this pin is configured as an input regardless of the setting of DDB3. When the SPI is enabled as a slave,
the data direction of this pin is controlled by DDB3. When the pin is forced to be an input, the pull-up can
still be controlled by the PORTB3 bit.
Atmel ATmega64A [DATASHEET]
Atmel-8160E-ATmega64A_Datasheet_Complete-09/2015
100