atmega32u4-16mu ATMEL Corporation, atmega32u4-16mu Datasheet - Page 202

no-image

atmega32u4-16mu

Manufacturer Part Number
atmega32u4-16mu
Description
Atmega32u4 8-bit Avr Microcontroller With 32k Bytes Of Isp Flash And Usb Controller
Manufacturer
ATMEL Corporation
Datasheet
18.1.4
202
ATmega32U4
SPI Status Register – SPSR
and SPIF in SPSR will become set. The user will then have to set MSTR to re-enable SPI Mas-
ter mode.
• Bit 3 – CPOL: Clock Polarity
When this bit is written to one, SCK is high when idle. When CPOL is written to zero, SCK is low
when idle. Refer to
marized below:
Table 18-2.
• Bit 2 – CPHA: Clock Phase
The settings of the Clock Phase bit (CPHA) determine if data is sampled on the leading (first) or
trailing (last) edge of SCK. Refer to
functionality is summarized below:
Table 18-3.
• Bits 1, 0 – SPR1, SPR0: SPI Clock Rate Select 1 and 0
These two bits control the SCK rate of the device configured as a Master. SPR1 and SPR0 have
no effect on the Slave. The relationship between SCK and the Oscillator Clock frequency f
shown in the following table:
Table 18-4.
• Bit 7 – SPIF: SPI Interrupt Flag
Bit
Read/Write
Initial Value
SPI2X
0
0
0
0
1
1
1
1
CPOL
CPHA
0
1
0
1
7
SPIF
R
0
CPOL Functionality
CPHA Functionality
Relationship Between SCK and the Oscillator Frequency
Figure 18-3
6
WCOL
R
0
SPR1
0
0
1
1
0
0
1
1
5
R
0
and
Leading Edge
Leading Edge
Figure 18-4
Figure 18-3
4
R
0
Sample
Falling
Rising
Setup
SPR0
0
1
0
1
0
1
0
1
3
R
0
for an example. The CPOL functionality is sum-
and
SCK Frequency
f
f
f
f
f
f
f
f
osc
osc
osc
osc
osc
osc
osc
osc
2
R
0
Figure 18-4
/
/
/
/
/
/
/
/
4
16
64
128
2
8
32
64
1
R
0
Trailing Edge
Trailing Edge
for an example. The CPOL
Sample
Falling
Rising
Setup
0
SPI2X
R/W
0
SPSR
7766A–AVR–03/08
osc
is

Related parts for atmega32u4-16mu