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.

CC2650 BLE stack SPI Read issue

Other Parts Discussed in Thread: ADS1293, CC2650

Hello,

I am trying to interface ADS1293 EVM to SmartRF06+CC2650EM which is running BLE stack on it. 

I have written ADS1293 SPI driver as mentioned in BLE software developers guide. below is my code. 

SPI_Params_init(&SbpSpiParams);
SbpSpiParams.bitRate = 10000;
SbpSpiParams.frameFormat = SPI_POL0_PHA0;
SbpSpiParams.dataSize = 8;
SbpSpiHandle = SPI_open(CC2650_SPI1, &SbpSpiParams);

I am facing an issue while SPI read transaction. I observed read operation works alright for initial few commands. later sometime it stops working. 

In my code I need to read from the device very frequently. I tried different SPI bus frequencies from 20MHZ to 10 KHz without success. 

I am clueless on what is happening.

I put a  read instruction in a while loop/ periodical event to reproduce the issue and attached. 

Please help on this. 

Regards

Lakshmikanth. 

  • Moving to Bluetooth Low Energy Forum

    Regards,
    Gigi Joseph.
  • Hello all,

    Can anyone please look into this issue??

    Regards

    Lakshmikanth. 

  • Hi Lakshmikanth,

    Using the XDS100v3 debugger on the SmartRF06, do you see any issues with the read instruction during the while loop? Do you have a memory leak? Providing some results from a JTAG debugging session would be a good first step.

    Best wishes
  • Hi Lakshmikanth,

    As you probably can imagine it is impossible to provide an answer to your question with the current level of detail in your post.
    Could you please provide some more information on what "not working" means as well as details regarding your setup?

    Examples:
    - What software versions are you using?
    - How do you do a read? Do you use SPI_transfer? Can you provide a code sample showing the actual read as well?
    - What has happened if you halt the program with a debugger once the issue is seen?
    - Do you have any other running tasks? If so, do things start working if you do not run those?


    Regards,
    Svend
  • Hello Svend,

    Sorry for late reply. I was onto other prior thing.

    Below are my answers to your queries.

    1) I am using CCS version 6.1.1 with BLE stack vestion 2.0.1 for CC2650.

    2) Below is my SPI read transaction code. I  cannot exactly catch when can the SPI read transaction stop working i.e, i am not seeing any data on MISO line. For few Initial SPI read commands I am seeing data on MISO line and after that my MISO line is not seeing any data. I have checked the commands are going perfect. 

    static uint8 TI_ADS1293_SPIReadReg(uint8 addr,uint8 *out)

    {

        uint8 inst;

    uint8 txbuf[3];

    SPI_Transaction spiTransaction;

    inst = ADS1293_READ_BIT | addr;                                              // register address

    txbuf[0] = inst;

    txbuf[1] = 0xFF;

    spiTransaction.arg = NULL;

    spiTransaction.count = 2;

    spiTransaction.txBuf = txbuf;

    spiTransaction.rxBuf = out;

    PIN_setOutputValue(hAds1293Pins, ADS1293_SS, 0);                              // /CS enable

    SPI_transfer(SbpSpiHandle, &spiTransaction);

    PIN_setOutputValue(hAds1293Pins, ADS1293_SS, 1);  // /CS disable

    return 0;

    }

    3) But any time if I want to break the execution, I was getting below message in CCS. 

    4) For debugging purpose I am using infinite while loop like below.

    while(1)

     {

     TI_ADS1293_SPIReadReg(0x01,tmp_buf);

       for(counter=0;counter<10000;counter++);

     }

    Let me know anything wrong in what I am doing.

    Regards

    Lakshmikanth.

  • Hi Lakshmikanth,

    Thanks for the information. We may still need a little more to help you though. Are you basing your code off one of the example projects included in the SDK? Do you have any other threads running?

    The reason why there is no source available is because you are likely in ROM code when you hault the processor.
  • What I would suggest to do is possibly follow the TI-RTOS documentation, there are SPI examples in there and get that working reading your sensor before integrating with the BLE stack examples. This reduces the number of variables in your project and makes it easier to debug.
  • Hello Sean,

    I am using heartrate example to integrate my sensor.

    The one I follow for SPI driver is in BLE software developers guide (SWRU393A) which is for Simple BLE Peripheral. Are you referencing the same example? If not , can you please let me know where can I find TI-RTOs documentation.

    Regards
    Lakshmikanth.
  • TI RTOS documentation is naturally included with the TI RTOS installation. In the case of BLE SDK v2.1, that is here:
    C:/ti/tirtos_simplelink_2_13_00_06/docs/docs_overview.html