This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F SPI bitRate

Other Parts Discussed in Thread: CC2640R2F

我在跟着官方的SPI例程做OLED通信的时候,发现有个

 *      spiParams.bitRate     = 1000000;
 *      spiParams.frameFormat = SPI_POL1_PHA1;
 *      spiParams.mode        = SPI_MASTER;
 *      spiParams.dataSize    = transferSize;
 *      spiParams.transferMode = SPI_MODE_CALLBACK;
 *      spiParams.transferCallbackFxn = transferCallback

我以前做STM32通信的时候往往都要设置时钟频率,这个bitrate是跟时钟频率一样的吗?如果不是一样的,那时钟频率在哪里设置呢?已知OLED最大支持30MHZ的时钟频率,我该如何对代码调整符合的时钟频率呢?

  • 是一样的概念,SPI的比特率 = 时钟频率 / 分频系数
  • spiParams.bitRate就是設置SPI时钟频率

  • 你好,我还在CC2640R2F技术手册上看到了TI-的SPI外设他是每传输一个字节片选引脚都会拉高:

    For a single-word transmission after all bits of the data word are transferred, the SSIn_FSS line is returned
    to its IDLE high state one SSIn_CLK period after the last bit is captured.
    For continuous back-to-back transmissions, the SSIn_FSS signal must pulse high between each data
    word transfer because the slave-select pin freezes the data in its serial peripheral register and does not
    allow altering of the data if the SPH bit is clear. The master device must raise the SSIn_FSS pin of the
    slave device between each data transfer to enable the serial peripheral data write. When the continuous
    transfer completes, the SSIn_FSS pin is returned to its IDLE state one SSIn_CLK period after the last bit
    is captured.

    ,但是我没有在SPICC26XXDMA_transfer()看到片选信号拉高的操作。这样不会造成寄存器中的数据冻结吗?因为要连续写操作,我要确保每次写入的数据有效,就要在每个字节拉高片选引脚,如果有片选信号拉高的操作,那么实际存在那个函数呢?