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.

CC2530: using timer interrupt on simpliciti

Part Number: CC2530
Other Parts Discussed in Thread: SIMPLICITI,

Hi friends

I'm using cc2530 simpliciti to make a simple network using broadcast. I need timer interrupt to increase my time variable each seconds on my program but I don't have any reference about using interrupt and timers on simpliciti. which timer is free on simpliciti? how should i set them? what is interrupt function format on simpliciti? where should i see some example or reference about it?

Regards 

  • 
    

    Navid,

    SimpliciTI uses 1 timer and the timer used is configurable. Please see bsp_board.def.h for the implementation.

    Here I include the section for your reference.

    And please have a look at the example code that we have published for the CC2530, it will help you get started on using the Timer for your own requirements.

    http://www.ti.com/product/CC2530/toolssoftware

    Regards,
    /TA

    #ifdef MRFI_TIMER_ALWAYS_ACTIVE
    
      #ifndef BSP_TIMER_USED
        #if defined MRFI_CC2530 || defined MRFI_CC2531 || defined MRFI_CC2533
          #define BSP_TIMER_USED 1
        #else
          #error "ERROR: Chip is unknown or not defined."
        #endif
      #else // if BSP_TIMER_USED was user defined
        #if BSP_TIMER_USED != 1 && BSP_TIMER_USED != 3 && BSP_TIMER_USED != 4
          #error "ERROR: The selected timer is invalid, must be 1, 3, or 4."
        #endif
      #endif
    
      #if BSP_TIMER_USED == 1
        #define BSP_TIMER_VECTOR T1_VECTOR
        #define BSP_TIMER_SIZE 16
      #elif BSP_TIMER_USED == 3
        #define BSP_TIMER_VECTOR T3_VECTOR
        #define BSP_TIMER_SIZE 8
      #elif BSP_TIMER_USED == 4
        #define BSP_TIMER_VECTOR T4_VECTOR
        #define BSP_TIMER_SIZE 8
      #endif