As far as I know, SPI transmission for an SPI slave works like below:
- Master selects a slave using SS pin
- Master and slave send data to each other simultaneously
- Master starts clock and data transmission at the same time (there is no clock before write operation)
- Master stops transmission any time it wants (by stopping write operation and clock generation), even if slave has more data to send.
Is there any SPI slave configuration which allows slave to transmit data without permission of master?
I'm just thinking out loud. Assume that there is only one slave and a continuous clock is provided by master etc.
Even if assumed statement is true, don't master and slave lose byte synchronization (i.e. receives bit stream) since there is no start-stop bits for SPI?
I'm asking such a question because I've read the following section from this document.
2.2 SPI Example
The attached SPI example illustrates the use of the USART in
synchronous mode. USART1 is configured as slave, whereas USART2 is
master. The following transactions take place:
- Data transmission from master to slave.
- Data transmission from slave to master.
- Data transmission from master to slave and from slave to master simultaneously.
The document gives SPI example but realizes the example using USART devices. And I get that a USART slave can start a transmission without permission of master.
I couldn't find the source code that is referenced by the document.