Datasheet

• MOSI – Port B, Bit 2
MOSI: SPI Master Data output, Slave Data input for SPI channel. When the SPI is enabled as a slave,
this pin is configured as an input regardless of the setting of DDB2. When the SPI is enabled as a master,
the data direction of this pin is controlled by DDB2. When the pin is forced to be an input, the pull-up can
still be controlled by the PORTB2 bit.
• SCK – Port B, Bit 1
SCK: Master Clock output, Slave Clock input pin for SPI channel. When the SPI is enabled as a slave,
this pin is configured as an input regardless of the setting of DDB1. When the SPI is enabled as a master,
the data direction of this pin is controlled by DDB1. When the pin is forced to be an input, the pull-up can
still be controlled by the PORTB1 bit.
• SS – Port B, Bit 0
SS: Slave Port Select input. When the SPI is enabled as a slave, this pin is configured as an input
regardless of the setting of DDB0. As a slave, the SPI is activated when this pin is driven low. When the
SPI is enabled as a master, the data direction of this pin is controlled by DDB0. When the pin is forced to
be an input, the pull-up can still be controlled by the PORTB0 bit.
The tables below relate the alternate functions of Port B to the overriding signals shown in the figure in
section Alternate Port Functions on page 96. SPI MSTR INPUT and SPI SLAVE OUTPUT constitute the
MISO signal, while MOSI is divided into SPI MSTR OUTPUT and SPI SLAVE INPUT.
Table 18-7 Overriding Signals for Alternate Functions in PB7:PB4
Signal
Name
PB7/OC2/OC1C PB6/OC1B PB5/OC1A PB4/OC0
PUOE 0 0 0 0
PUOV 0 0 0 0
DDOE 0 0 0 0
DDOV 0 0 0 0
PVOE OC2/OC1C ENABLE
(1)
OC1B ENABLE OC1A ENABLE OC0 ENABLE
PVOV OC2/OC1C
(1)
OC1B OC1A OC0B
DIEOE 0 0 0 0
DIEOV 0 0 0 0
DI
AIO
Note:  1. See Output Compare Modulator (OCM1C2) for details. OC1C does not exist in ATmega103
compatibility mode.
Table 18-8 Overriding Signals for Alternate Functions in PB3:PB0
Signal
Name
PB3/MISO PB2/MOSI PB1/SCK PB0/SS
PUOE SPE • MSTR SPE • MSTR SPE • MSTR SPE • MSTR
PUOV PORTB3 • PUD PORTB2 • PUD PORTB1 • PUD PORTB0 • PUD
Atmel ATmega64A [DATASHEET]
Atmel-8160E-ATmega64A_Datasheet_Complete-09/2015
101