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.

CCS/CC1350: Timer error: Declaration incompatible

Part Number: CC1350


Tool/software: Code Composer Studio

Hi, 

I am setting up a timer on CC1350 using Drivers and Timer.h file.

When I use the same code as in the Timer.h example I get an error with Timer_Params_init function:

My code:

Timer_Handle handle;
Timer_Params params;
Timer_Params_init(&params);
params.periodUnits = Timer_PERIOD_HZ;
params.period = 1000;
params.timerMode  = Timer_CONTINUOUS_CALLBACK;
params.timerCallback = someTimerCallbackFunction;

Error:

Header reference:

/*!
 *  @brief  Function to initialize the Timer_Params struct to its defaults.
 *
 *  @param  params      A pointer to Timer_Params structure for
 *                      initialization.
 *
 *  Defaults values are:
 *      timerMode = Timer_ONESHOT_BLOCKING
 *      periodUnit = Timer_PERIOD_COUNTS
 *      timerCallback = NULL
 *      period = (uint16_t) ~0
 */
extern void Timer_Params_init(Timer_Params *params);

-------------------------------------------------------------------------------------------------

Why is this error happening when I´m passing the right argument (function takes pointer as an argument) ??

Thank you!

  • I pasted the following into the empty project and did not get any errors:

        Timer_Handle    handle;
        Timer_Params    params;
        Timer_Params_init(&params);
        params.periodUnits = Timer_PERIOD_HZ;
        params.period = 1000;
        params.timerMode  = Timer_CONTINUOUS_CALLBACK;

    Did you define someTimerCallbackFunction somewhere? Or in other words, did you create a call back function? 

  • Looks like you deleted the last message that you wrote. Just a note to the usecase: Remember that the timer has a given resolution. Is it good enough for your usecase?
  • 
    

    hey, I deleted it ,because I realized it was a "stupid" question and I had an answer to it. Regarding the timer, yes it´s good enough. I put these lines of code in the right place now and it works. The thing is that I´m trying to measure the time needed for Tx to send a packet to Rx in the PacketTx and PacketRx examples. So, in the MAIN (VOID) I´ve declared the timer and everything :

        Timer_Handle    handle;
        Timer_Params    params;
        Timer_Params_init(&params);
        params.periodUnits = Timer_PERIOD_US;
        params.period = 10;
        params.timerMode  = Timer_FREE_RUNNING;

    And now I´m gonna start the timer just before the transmission starts and stop the timer just after the last packet is sent.

    So , is this a good way?

  • Before answering than question, what you are going to use this number for?
  • I want to compare it to the number I´ve got by measuring the timer using hardware interrupt. I measured the time of a packet being sent using LED blinking and Oscilloscope. Now I want to do it through the software and compare . Essentialy, we want to see how big the "latency" is . Sending a packet of 1 byte data at 500kbps rate
  • I believe that using LED blinking and a scope would give the most accurate answer since starting the timer/ timer accuracy will add delays etc.
  • exactly, I was thinking the same but I wanted to check it anyways. Plus, I think that if I could somehow convert the C code into assembly and see how many lines of code are there between the Timer.Init and Start -> End, and I know the crystal frequency ,I could calculate and substract the amount of delays that come with the software. Because in assembly each line is done according to the clockspeed and Program Counter, as far as I know.
  • Hi,

    you have two already running timers:

    There are two timer modules in the kernel. I cannot recommend any of them.

    • The CC26xx Timer module MUST NOT be used because it is exclusively used by the Clock module.
    • The Cortex-M3 Timer module could be probably used, but it is based upon an internal CPU timer and forbids standby.

    However, measuring the time you need for TX is not needed in software because you can calculate it based on the RF parameters. You could even use absolute timing for the TX command. Or you could measure it once by routing out the PA signal to a GPIO.