![Atmel AT90S8414 Скачать руководство пользователя страница 47](http://html1.mh-extra.com/html/atmel/at90s8414/at90s8414_manual_3003427047.webp)
AT90S8414
Preliminary
4-47
low to select an individual SPI device as a slave. When PB4( SS ) is set high, the SPI port is deactivated and the
PB6(MOSI) pin can be used as an input. Slave/Master mode can also be selected in software by clearing or setting the
MSTR bit in the SPI Control Register.
The two shift registers in the Master and the Slave can be considered as one distributed 16-bit circular shift register. This
is shown in Figure 39. When data is shifted from the master to the slave, data is also shifted in the opposite direction,
simultaneously. This means that during one shift cycle, data in the master and the slave are interchanged.
Figure 39: SPI Master-Slave Interconnection
The system is single buffered in the transmit direction and double buffered in the receive direction. This means that
characters to be transmitted cannot be written to the SPI Data Register before the entire shift cycle is completed. When
receiving data, however, a received character must be read from the SPI Data Register before the next character has been
completely shifted in. Otherwise, the first character is lost.
When the SPI is enabled, the DDB5-DDB7 bits in Data Direction Register B (DDRB) are overridden and have no effect.
For the PB4( SS ) pin, however, DDB4 is assigned the following functionality when the SPI is enabled.
·
When DDB4 is cleared (zero) another SPI device can act as master by setting SS low. As long as SS is held high, the
MSTR bit in SPCR selects Master/Slave. If SS is set low, MSTR will be forced low.
·
When DDB4 is set (one), the PB4( SS ) pin can be used as a general output. The MSTR bit selects Master/Slave.
There are four combinations of SCK phase and polarity with respect to serial data, which are determined by control bits
CPHA and CPOL. The SPI data transfer formats are shown in Figure 40 and Figure 41.
Содержание 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...