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.

Modifying SerialBLEbridge for non-handshake SPI

Other Parts Discussed in Thread: CC2540, CC2520

The serialBLEbridge project found here:

processors.wiki.ti.com/.../SerialBLEbridge_V_1.4.1

It is great... I have modified it to work on the keyfob kit with a CC2540.

I am working on creating a BLE -> Zigbee translator for a product.  I'll be using the CC2540 (SPI master) to communicate with a CC2520 (SPI slave) over SPI.

The SPI interface that is available in the SerialBLEbridge project requires hardware handshaking, which is not really normal for SPI.  I am having a little trouble getting the handshaking out of there as the whole library relies on the ready signal dropping to create an interrupt that handles various things required for the system to work.

Any advice for switching this to a normal SPI interface?  I have tried HAL_SPI = TRUE but it requires hal_spi.h which doesn't seem to exist in the BLE stack. Or is there a good way to wire the CC2540 -> CC2520 so that the handshaking requirement is satisfied.

Here's a copy of the comments from the top of _hal_uart_spi.c

5 GPIO lines are required: MOSI, MISO, SPI Clock, SPI CSn/MRDY, and SRDY.
MRDY/CS = SPI Master Ready to send and serves as a SPI Slave wakeup from sleep.
SRDY = SPI Slave Ready to send and serves as a SPI Master wakeup from sleep.

The SRDY output from SPI Slave to SPI Master will transition from high to low
if the SPI slave receives an MRDY falling edge ISR from the SPI Master. But, if
the SPI slave has nothing to send, the SRDY line will be pulled high again.

  • And below are the global defines I am using in the project to work on the CC2540 keyfob eval board:

    INT_HEAP_LEN=3072
    HALNODEBUG
    OSAL_CBTIMER_NUM_TASKS=1
    HAL_AES_DMA=TRUE
    HAL_DMA=TRUE
    xPOWER_SAVING
    HAL_LCD=FALSE
    HAL_LED=FALSE
    SERIAL_INTERFACE
    HAL_UART=TRUE
    HAL_KEY=FALSE
    NPI_UART_PORT=HAL_UART_PORT_0
    HAL_UART_SPI=1
    HAL_UART_DMA=0
    CC2540_MINIDK
    HAL_SPI_MASTER
    CC2540
  • Hi Justin,

    If you are using Low Power Modes on the CC2540, which I guess you are, you cannot remove the hand shake signals.

    Cheers,
    Fredrik