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 chip select pin goes high then low after transmitted one byte

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Hi All,
I'm working on SPI of CC2640R2_LAUNCHXL (master) to read a pressure sensor.
When I transfer writing two bytes and

case 1:
set transaction.count = 2, (or transaction.count less than 10), then the chip select pin goes high after transmitted one byte, then goes low again to send the second byte.

case 2:
set transaction.count = 10 or higher, then the chip select pin keeps low until it completed the transaction.

Do you know why this happens?
Thanks,

Jack

  • Hi,

    To me both cases are spec compliant. Is one of them causing troubles for you?

    The reason behind this behavior is the DMA use. When all bytes are sent using DMA, then CSn will NOT be pulled high between bytes. Here, I bet the value of spiCC26XXDMAHWAttrs.minDmaTransferSize is 10. So for shorter transfer the DMA cannot be used and the CSn line pulled high between bytes.

    You can modify the value of spiCC26XXDMAHWAttrs.minDmaTransferSize within the file CC2640R2_LAUNCHXL.c.

    If needed, you can also handle the CSn line using the GPIO/PIN driver. Please refer to the driver documentation for details.

    Best regards,

  • Hi Clement,

    In my case, I don't use DMA. My understanding is that the CSn line only pulls high when the transmit is completed.

    In my observation, the CSn line pulled high between bytes. So the SPI design in CC2640 is: when transmit, the CSn line pulled high between bytes?

    Any effect between the CSn line pulls high between bytes and the CSn line doesn't pull high between bytes?

    Thanks a lot for your sharing knowledge,

    Jack

  • Hi,

    Any effect between the CSn line pulls high between bytes and the CSn line doesn't pull high between bytes?

    Again, both are spec compliant, so none should cause an issue.

    In my case, I don't use DMA.

    If you are using the SPI driver we provide in our SDK, then you are using DMA.

    Regards,

  • Hi Clement,

    It's an excellent, knowledgeable answer.

    Thanks a lot for your time,

    Jack