atmega161-4pi ATMEL Corporation, atmega161-4pi Datasheet - Page 66

no-image

atmega161-4pi

Manufacturer Part Number
atmega161-4pi
Description
8-bit Microcontroller With 16k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
SPI Control Register – SPCR
66
ATmega161(L)
Figure 43. SPI Transfer Format with CPHA = 1 and DORD = 0
• Bit 7
This bit causes the SPI interrupt to be executed if SPIF bit in the SPSR Register is set
and if the global interrupt enable bit in SREG is set.
• Bit 6
When the SPE bit is set (one), the SPI is enabled. This bit must be set to enable any SPI
operations.
• Bit 5
When the DORD bit is set (one), the LSB of the data word is transmitted first.
When the DORD bit is cleared (zero), the MSB of the data word is transmitted first.
• Bit 4
This bit selects Master SPI mode when set (one), and Slave SPI mode when cleared
(zero). If SS is configured as an input and is driven low while MSTR is set, MSTR will be
cleared and SPIF in SPSR will become set. The user will then have to set MSTR to re-
enable SPI Master mode.
• Bit 3
When this bit is set (one), SCK is high when idle. When CPOL is cleared (zero), SCK is
low when idle. Refer to Figure 42 and Figure 43 for additional information.
• Bit 2
Refer to Figure 42 or Figure 43 for the functionality of this bit.
Bit
$0D ($2D)
Read/Write
Initial Value
SPIE: SPI Interrupt Enable
SPE: SPI Enable
DORD: Data Order
MSTR: Master/Slave Select
CPOL: Clock Polarity
CPHA: Clock Phase
SPIE
R/W
7
0
SPE
R/W
6
0
DORD
R/W
5
0
MSTR
R/W
4
0
CPOL
R/W
3
0
CPHA
R/W
2
0
SPR1
R/W
1
0
SPR0
R/W
1228D–AVR–02/07
0
0
SPCR

Related parts for atmega161-4pi