返回该小组首页 回复主题
christine

christine

小组等级:     E币:98  (E币换礼)

#1楼主:请教2线SPI收发切换问题

文章发表于:2008-08-11 05:12

SPI采用2线方式工作(数据收发共用MISO,即工作在从模式下),需要进行接收和发送操作,请问在切换的时候需要关闭SPI再进行切换吗?没有找到相关说明。切换过程如何操作可以给以说明吗?谢谢!

christine

   小组等级:    E币:98  (E币换礼)

#2

文章发表于:2008-08-14 15:39

没有高手知道吗? :(

STM32

   小组等级:    E币:4155  (E币换礼)

#3

文章发表于:2008-08-14 21:23

请看STM32技术参考手册中有关SPI的章节,下面是相关部分(第545页):

22.3.4 Simplex communication
The SPI is capable of operating in simplex mode in 2 configurations.
● 1 clock and 1 bidirectional data wire
● 1 clock and 1 data wire (receive-only in full-duplex mode)


1 clock and 1 bidirectional data wire
This mode is enabled by setting the BIDIMODE bit in the SPI_CR1 register. In this mode SCK is used for the clock and MOSI in master or MISO in slave mode is used for data communication. The transfer direction (Input/Output) is selected by the BIDIOE bit in the SPI_CR2 register. When this bit is 1, the data line is output otherwise it is input.

christine

   小组等级:    E币:98  (E币换礼)

#4

文章发表于:2008-08-21 12:42

自己回答一下吧,不必关闭SPI,可以直接切换方向,我试过了。

总共 , 当前 /

快速回复主题--如果想加入编辑器功能,建议使用 [高级回复]

您目前还不是小组成员,请先加入

回复贴子区

用户名:    您没有注册?

密码:    忘记了密码?

内容:

  • DesignDesign
  • HTMLHTML

浏览该小组的用户还看过...

设计资源与分销

所有小组精华文章