SPI-Interface

The SPI bus specifies four logic signals:

  • SCLK: Serial Clock (output from master)
  • MOSI: Master Out Slave In (data output from master)
  • MISO: Master In Slave Out (data output from slave)
  • SS: Slave Select (often active low, output from master)

MOSI on a master connects to MOSI on a slave. MISO on a master connects to MISO on a slave. Slave Select has the same functionality as chip select and is used instead of an addressing concept.

Note: on a slave-only device, MOSI may be labeled as SDI (Slave Data In) and MISO may be labeled as SDO (Slave Data Out)

The signal names above can be used to label both the master and slave device pins as well as the signal lines between them in an unambiguous way, and are the most common in modern products. Pin names are always capitalized e.g. "Slave Select," not "slave select."

Older products can have nonstandard SPI pin names:

Serial Clock:

  • SCK

Master Output → Slave Input (MOSI):

  • SIMO, MTSR - correspond to MOSI on both master and slave devices, connects to each other
  • SDI, DI, DIN, SI - on slave devices; connects to MOSI on master, or to below connections
  • SDO, DO, DOUT, SO - on master devices; connects to MOSI on slave, or to above connections

Master Input ← Slave Output (MISO):

  • SOMI, MRST - correspond to MISO on both master and slave devices, connects to each other
  • SDO, DO, DOUT, SO - on slave devices; connects to MISO on master, or to below connections
  • SDI, DI, DIN, SI - on master devices; connects to MISO on slave, or to above connections

Slave Select:

  • SS, SS, SSEL, nSS, /SS, SS# (slave select)
  • CS, CS (chip select)
  • CSN (chip select/enable)
  • CE (chip enable)

1,硬件NSS,是指SPI自动控制SPI的片选信号,发送数据的时候,输出低电平,不发送的时候,是高电平,这个模式一般不用.因为这种方式只能1个SPI接1个从机,很是蛋疼. 
2,软件模式就是完全软件控制SPI片选,就是一个普通IO控制,你要SPI通信之前,必须先用软件的方式,控制SPI从机的片选为低电平,然后在发送数据.发完后,拉高. 一般用这个模式,因为可以一个SPI控制N多个从机...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

c_hnie

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值