![Atmel AT90S8414 Скачать руководство пользователя страница 49](http://html1.mh-extra.com/html/atmel/at90s8414/at90s8414_manual_3003427049.webp)
AT90S8414
Preliminary
4-49
Bit 4 - MSTR : Master/Slave Select:
This bit selects Master SPI mode when set (one), and Slave SPI mode when cleared (zero). If SS on Device1 is set low
by Device2 while MSTR is set in Device1, MSTR will be forced low and Device1 will be a slave.
Bit 3 - CPOL : Clock POLarity:
When this bit is set (one), SCK is high when idle. When CPOL is cleared (zero), SCK is low when idle. Refer to Figure
40 and Figure 41 for additional information.
Bit 2 - CPHA : Clock PHAse:
Refer to Figure 40 or Figure 41 for the functionality of this bit.
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 SPR2 have no effect on the slave.
The relationship between SCK and the Oscillator Clock frequency f
cl
is shown in the following table:
Table 13: Relationship Between SCK and the Oscillator Frequency
SPR1
SPR0
SCK Frequency
0
0
f
cl
/4
0
1
f
cl
/16
1
0
f
cl
/64
1
1
f
cl
/128
THE SPI STATUS REGISTER - SPSR
Bit
7
6
5
4
3
2
1
0
$0E
SPIF
WCOL
-
-
-
-
-
-
SPSR
Read/Write
R
R
R
R
R
R
R
R
Initial value
0
0
0
0
0
0
0
0
Bit 7 - SPIF : SPI Interrupt Flag:
When a serial transfer is complete, the SPIF bit is set (one) and an interrupt is generated if SPIE in SPCR is set (one) and
global interrupts are enabled. SPIF is cleared by hardware when executing the corresponding interrupt handling vector.
Alternatively, the SPIF bit is cleared by first reading the SPI status register with SPIF set (one), then accessing the SPI
Data Register (SPDR).
Bit 6 - WCOL : Write COLlision flag:
The WCOL bit is set if the SPI data register (SPDR) is written during a data transfer. During data transfer, the result of
reading the SPDR register may be incorrect, and writing to it will have no effect. The WCOL bit (and the SPIF bit) are
cleared (zero) by first reading the SPI Status Register with WCOL set (one), and then accessing the SPI Data Register.
Bit 5..0 - Res : Reserved bits:
These bits are reserved bits in the AT90S8414 and will always read as zero.
The SPI interface on the AT90S8414 is also used for program memory and EEPROM downloading or uploading. See
Page 4-75 for serial programming and reading.
Содержание AT90S8414
Страница 4: ...4 4 AT90S8414 Preliminary...
Страница 6: ...4 6 AT90S8414 Preliminary Block Diagram Figure 1 The AT90S8414 Block Diagram...
Страница 65: ...AT90S8414 Preliminary 4 65 Figure 50 PORTB Schematic Diagram Pin PB5 Figure 51 PORTB Schematic Diagram Pin PB6...
Страница 68: ...4 68 AT90S8414 Preliminary Figure 53 PORTC Schematic Diagram Pins PC0 PC7...
Страница 87: ...AT90S8414 Preliminary 4 87...