| Electronic Components Datasheet Search |
|
ATPL00B Datasheet(PDF) 68 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
ATPL00B Datasheet(HTML) 68 Page - ATMEL Corporation |
|
68 / 152 page ![]() Atmel ATPL00B [datasheet] 43028A-ATPL - 9/12 68 If SPEN = 1, SSIG = 0 and MSTR = 1, the SPI0 is enabled in master mode. The SS pin is quasi-bidirectional. In this case, another master can drive this pin low to select this device as an SPI slave and start sending data to it. To avoid bus contention, the CPU becomes a slave. As a result of the observed SPI module becoming a slave, the MOSI and SPICLK pins are forced to be an input and MISO becomes an output. The SPIF flag in SPSTAT is set, and if the SPI interrupt is enabled an SPI interrupt will occur. User software should always check the MSTR bit. If this bit is cleared by a slave select and the user wants to continue to use the SPI as a master, the user must set the MSTR bit, otherwise it will stay in slave mode. 7.1.3 SPI0 write collision The SPI0 is single buffered in the transmit direction and double buffered in the receive direction. New data for transmission cannot be written to the shift register until the previous transaction is completed. The WCOL (SPSTAT.6) bit is set to indicate data collision when the data register is written during transmission. In this case, the data currently being transmitted will continue to be transmitted, but the new data, i.e., the one causing the collision, will be lost. While write collision is detected for either a master or a slave, it is uncommon for a master because the master has full control of the transfer in progress. The slave, however, has no control over transmission start by the master and therefore collision can occur. Receiver transfers received data into a parallel read data buffer so that the shift register is free to accept a second character. However, the received character must be read from the Data Register before the next character has been completely shifted in. Otherwise. the previous data is lost. WCOL can be cleared in software by writin g a „0‟ to this bit. 7.2 SPI Modes Tha communication using SPI in a single master system is simple and usually works as described below: Both master and slave(s) configure their SPIs to operate in the same mode (one of four available modes) and turn them on; a dditionally, the master has to select baud rate for the communication; slave uses master‟s serial clock to sample and shift data during the transfer Master selects desired slave unit(s) using its/their SS line(s) As soon as the master writes to its SPI buffer register (assuming that slave(s) has/have already loaded data into its/their buffer(s)), transfer is initiated; master‟s SPI module generates serial clock and master‟s and slave‟s data are exchanged After the end of transfer, an indication is generated in all participating SPI units, both the master and the slave(s) read received data from their buffers If there is more data to be exchanged, all units taking part in this communication prepare the new set of data and master initiates another round of transfer; if there is no more data to be exchanged, master deselects used SS line(s) and previously active slaves are deselected; this is the end of SPI transfer Typical connection in system using SPI is shown below. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |