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.

CC2540 interfacing with SPI, BLE and USB

Other Parts Discussed in Thread: CC2540, CC2541

I have some questions at the moment:

I am planning to use the IAR Embedded Workbench for 8051 with the TI CC2540 Microcontroller. Are there any other IDEs I can use for this? Also once the code is compiled and a HEX file generated using IAR can I use the TI SmartRF Flash Programmer?

For my actual question, at the moment, I am looking into how to interface with other device modules through SPI. The CC2540 acts as the SPI master and communicates to the other devices. The CC2540 is supposed to relay the information either via Bluetooth (smartphone) or USB (PC) and acts as a slave device.

When I was looking at the BLE Software Stack and Tools for sample codes, I noticed that the USB and Bluetooth slave functionalities are never used together. I have the CC2541 mini dev kit and would like to know if you can point me to sample codes that makes use of the interfaces I am planning to use.

Thanks!

  • Hi Danson,

    Officially only IAR Workbench support CC2540 platform. And yes, once the code is built, the hex file can be downloaded using SmartRF Flash Programmer.

    For USB + BLE slave, please see e2e.ti.com/.../127207.

    - Cetri
  • Hi Cetri,

    I would like to clarify again. I am unsure what Anping Wang's question was with regards to CC2540 USB dongle to Slave mode.

    Is the device originally a USB Master? I thought that the dongle serves as a USB slave and Bluetooth Master for the original demo. Also from what I understand, I need to initialize

    uint8 initial_advertising_enable = TRUE;

    to make the CC2540 MCU device discoverable on a BLE smartphone. Is this correct?

    Also, for the SPI, I believe I just need to reference my design with the CC2541 keyfob (accelerator interfacing). Is this correct?

    Thank you for replying so promptly.

    Best regards,

    Danson

  • Hi Danson,

    The 'Slave' meant Bluetooth Slave, not USB Slave, in that context. Of course, the dongle is basically USB slave. Anyway, I apologize for having confused you. The post I referred to is very old. In the past we used to have separated HostTestRelease images for master and slave, but the newer version one has both capabilities. From BTool, initialize the dongle using GAP_DeviceInit with peripheralProfileRole=Enable and centralProfileRole=Disable, then the dongle will be intialized as a slave. After that, set the ADV data using GAP_UpdateAdvertisingData and send GAP_MakeDiscoverable with proper parameters. You will see the dongle discoverable.

    And yes, please refer to Keyfob's accelometer driver implementation, regarding SPI.

    - Cetri