at43usb320a ATMEL Corporation, at43usb320a Datasheet - Page 53

no-image

at43usb320a

Manufacturer Part Number
at43usb320a
Description
Full-speed Usb Microcontroller With An Embedded Hub
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
at43usb320a-AC
Manufacturer:
Atmel
Quantity:
10 000
Figure 16. SPI Master/Slave Interconnection
1443E–USB–4/04
Clock Generator
SPI
MSB
The interconnection between master and slave CPUs with SPI is shown in Figure 16. The
PB7(SCK) pin is the clock output in the master mode and is the clock input in the slave mode.
Writing to the SPI data register of the master CPU starts the SPI clock generator, and the data
written shifts out of the PB5(MOSI) pin and into the PB5(MOSI) pin of the slave CPU. After
shifting one byte, the SPI clock generator stops, setting the end of transmission flag (SPIF). If
the SPI interrupt enable bit (SPIE) in the SPCR register is set, an interrupt is requested. The
Slave Select input, PB4(SS), is set low to select an individual slave SPI device. 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 16. 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.
The system is single buffered in the transmit direction and double buffered in the receive direc-
tion. This means that bytes to be transmitted cannot be written to the SPI Data Register before
the entire shift cycle is completed. When receiving data, however, a received byte must be
read from the SPI Data Register before the next byte has been completely shifted in. Other-
wise, the first byte is lost.
When the SPI is enabled, the data direction of the MOSI, MISO, SCK and SS pins is overrid-
den according to the following table:
Table 20. SPI Pin Overrides
Note:
Pin
MOSI
MISO
SCK
SSN
8-bit Shift Register
See “Port B” on page 64. for a detailed description of how to define the direction of the user
defined SPI pins.
MASTER
LSB
Direction, Master SPI
User Defined
Input
User Defined
User Defined
SCK
SS
MISO MISO
MOSI MOSI
V
CC
SCK
SS
MSB
8-bit Shift Register
Direction, Slave SPI
Input
User Defined
Input
Input
SLAVE
AT43USB320A
LSB
53

Related parts for at43usb320a