一個 SPI bus 包含四個訊號
- SCLK (SCK)
- MOSI (Master Out Slave In)
- MISO (Master In Slave Out):slave 輸出,大部份 slave 不在輸出時可以 tri-state,得以共接。
- SS:Slave Slect 來選擇一個 slave。
一般 SCLK、MOSI、MISO 共接,每個 slave 有各自的 SS。但也有共用 SS 的接法,採用 daisy chain 或 device 定址。
SCK 不一定要持續送,平常可維持在 high,falling 時送資料,rising 時取樣資料。
基本上 MOSI 跟 MISO 不會同時送訊號 (half-duplex),MISO 大多支援 tri-state,如果 MOSI 也支援 tri-state,這樣可以把 MISO 跟 MOSI 接在一起,變成只有兩條共用線。
MISO tri-state 的時機可能是最後 bit 後或 SS 結束
參考來源
- http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus
- TI SSP
- National Semiconductor Microwire
- Linux SPI
- https://ithelp.ithome.com.tw/articles/10245910
- https://ithelp.ithome.com.tw/articles/10246612 (device tree)
沒有留言:
張貼留言