Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
en:netzer:spi-master [2015/12/23 17:10] svesch [Communication] |
en:netzer:spi-master [2015/12/23 17:22] svesch [Firmware pro version] Added single slave example |
||
---|---|---|---|
Line 123: | Line 123: | ||
| T | 0x54 | Wait 1\ ms till processing of the next character. | 1.5 | | | T | 0x54 | Wait 1\ ms till processing of the next character. | 1.5 | | ||
| All others | Character is transparently transmitted. | | | All others | Character is transparently transmitted. | | ||
+ | |||
+ | |||
+ | ===== SPI master in single slave operation ===== | ||
+ | |||
+ | For using this SPI master in a single slave environment this example is provided here. | ||
+ | We assume that the slave is connected with the SPI_CS wire like shown below. | ||
+ | The SPI_CS shall be low active - a low level selects the slave. | ||
+ | The data string <code>01 23 45 67 89</code> shall be sent to the SPI slave. | ||
+ | |||
+ | The command for controlling the SPI_CS line is an escape sequence consisting of two bytes: | ||
+ | <code>5c 69</code> for setting SPI_CS to low and | ||
+ | <code>5c 49</code> for setting SPI_CS to high. | ||
+ | |||
+ | The final code together: | ||
+ | <code>5c 69 01 23 45 67 89 5c 49</code> | ||