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.

CC2541DK-MINI: Using SPI with the KeyFob demo code

Part Number: CC2541DK-MINI
Other Parts Discussed in Thread: CC2541, CC2540

In my setup, I am connecting MSP430 MCU (Slave) to the CC2541 keyfob (Master) USART0 SPI module. On the other hand, the CC2541 keyfob is connected to a mobile application to receive the data from it by BLE.

My objective is the following:

With each left key press, Send a certain value to the MSP430 via SPI. The MSP430 will echo this value back to the CC2540 and this received value send it via BLE to the mobile application.

But I can't get except (0xFF) value on the mobile application.

To debug this problem, I made a second setup where the MSP430 is the master and the CC2541 Keyfob is the slave. The MSP430 is continuously sending the same value (0x05) and with each left key press, the CC2541 receive a value from MSP430 and send it to the mobile application.

The result did not change. I still receive (0xFF) on the mobile phone.

In both setups, I used the CC Debugger and I got (0xFF) value whenever I receive a byte.

This is from the MSP430 debugger, so it receives the value (0x05) in the UCB0TXBUB register and sent it back (0x05) in the UCB0RXBUF. 

And this is from the CC2540 debugger, the value received in the U0DBUF register is shown on P1 just to see the value in the register watch during debugging.

  • Hi,

    Have you tried to take some traces (using a logic analyzer) to identify where the problem is coming from? It might help a lot.

    Here a list of elements you should verify:

    - there is no faulty connection

    - the right inputs / outputs are used

    - the MOSI / MISO are properly connected

    - the SS has the expected polarity

    - the configuration of the pins is correct (open drain)

    - clock polarity and phase correct

    I hope this will help,

    Regards,