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.

RTOS/LAUNCHXL-CC2650: How to use GPTimer to initiate an SPI transfer

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: IWR1443BOOST, CC2650

Tool/software: TI-RTOS

Hi everyone,

I am trying to sample the IWR1443Boost with the CC2650 Launchpad at 1Hz by using an SPI line to collect the data from the IWR. To reach this, I am attempting to use the timer driver to only perform an SPI transaction every 1 second. I am trying to implement the following code on my empty.c file.

I am running into a bunch of issues and confusion however. If anyone could answer the following questions I would very much appreciate it.

1. Type_freq is not defined in project empty. What can be done with this? Also, the website states that this is for a 1ms interrupt, but I am unsure how they get this value from the code.

2. I establish my SPI handles and Display handles in the task function that also establishes the GPTimer. In order to actually do the transaction however, I need to put this code in the callback function. I am unsure how to use the parameters that I had established in my current task function in the callback function.

Thanks for the help!

  • Gabriel,
    I will need to look into the Type_freq question in order to provide some feedback. With regard to the second item, I would recommend keeping the SPI communication within the context of the main thread and using semphores to control when the SPI portion is executed.

    Regards,
    Chris
  • Hi Chris,

    Thanks for your help with the Type_freq question. That should help get us back on track with the development of our code. As for the semphores, how would we be able to use them to actually control the SPI execution? Do you have any resources that you would be able to pass along to me so that I could catch up on the functionality of the actual data structure?

    Thanks
  • Here is an example of the semaphore pend and post: .

    Are you looking at the doxygen for the GPTimers?  I was able to find this description here for ClockP_FreqHz.

    in your code include

    #include <ti/drivers/ports/ClockP.h>

    In the example you cite above the CPU frequency is 48Mhz so the timer values of 47999 will create a period of about 1ms.

    Hope that helps,

    Chris