Arduino 線路 : D10, D11, D12,D13
wire :
- SS – digital 10. You can use other digital pins, but 10 is generally the default as it is next to the other SPI pins;
- MOSI – digital 11;
- MISO – digital 12;
- SCK – digital 13;
RPI pin 腳
Rabpberry Pi Signal | Serial 7-seg Signal |
GND | GND |
3.3V | VCC |
CE1 | SS (Shift Select) |
SCK | SCK |
MOSI | SDI |
MISO | SDO |
pin number
MOSI P1-19
MISO P1-21
SCLK P1-23 P1-24 CE0
GND P1-25 P1-26 CE1
如果是用 /dev/spi0.0 就是接 CE0 到 SS
如果是用 /dev/spi0.1 就是接 CE1 到 SS
P1-24 接到 D10
P1 -19 接到 D11
P1-21 串一個1K 電阻接到 D12
P1-23 接到 D13
SPI序列周邊介面匯流排
SPI (Serial Peripheral Interface Bus),類似I²C,是一種4線同步序列資料協定,適用於可攜式裝置平臺系統,但使用率較 I²C少。SPI匯流排定義四組 logic signals:
‧ SCLK—Serial Clock(自master輸出)
‧ MOSI/SIMO—Master Output, Slave Input(自master輸出)
‧ MISO/SOMI—Master Input, Slave Output(自slave輸出)
‧ SS—Slave Select(active low;自master輸出)
沒有留言:
張貼留言