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.

Default Value of TXPOWER

Other Parts Discussed in Thread: CC2530, CC2591, CC2590, CC2592, CSD

Hi ,

I am using the sample application generic app & Sensor demo app. I am trying to find the value of TXPOWER  set in this sample application. I am not able to locate the where is the TXPOWER has been set. I hope it is taking a default value. Please let me know the default value used in this application.

Thanks & regards

Biprangshu saha  

  • The default TX power of CC2530 is 0 dbm. You can use ZMacSetTransmitPower to change it if you want.

  • Hi Yikai
    does ZMacSetTransmitPower function could be used in samplexxx.c directly ????
    and is that ture The default TX power of CC2530 is 0 dbm?? where is the config of this default value in zstack?
  • It is OK to use it in SampleXxx.c. The default TX power is set in MAC_SetRadioRegTable().
  • Hi  Yikai

              where could i find the default TX power setting  in   MAC_SelectRadioRegTable()  function?

              it seems that the function only set the paLnaChip

              and i found that MAC_SelectRadioRegTable() was only used in MAC_RfFrontendSetup() function of  mac_rffrontend.c file

              

    /**************************************************************************************************
     * @fn          MAC_SelectRadioRegTable
     *
     * @brief       Select radio register table in case multiple register tables are included
     *              in the build
     *
     * @param       txPwrTblIdx - TX power register value table index
     * @param       rssiAdjIdx - RSSI adjustment value index
     *
     * @return      none
     **************************************************************************************************
     */
    extern void MAC_SetRadioRegTable ( uint8 txPwrTblIdx, uint8 rssiAdjIdx )
    {
      /* Depending on compile flags, the parameters may not be used */
      (void) txPwrTblIdx;
      (void) rssiAdjIdx;

    #if defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 ||  \
        defined MAC_RUNTIME_SE2431L || defined MAC_RUNTIME_CC2592
      if (txPwrTblIdx >= sizeof(macRadioDefsTxPwrTables)/sizeof(macRadioDefsTxPwrTables[0]))
      {
        txPwrTblIdx = 0;
      }
    #endif /* defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 */

    #if defined (MAC_RUNTIME_CC2591) || defined (MAC_RUNTIME_CC2590) || \
        defined (MAC_RUNTIME_SE2431L)  || defined (MAC_RUNTIME_CC2592) || \
        defined (HAL_PA_LNA) || defined (HAL_PA_LNA_CC2590) || \
        defined (HAL_PA_LNA_SE2431L)  || defined (HAL_PA_LNA_CC2592)
      if (rssiAdjIdx >= sizeof(macRadioDefsRssiAdj)/sizeof(macRadioDefsRssiAdj[0]))
      {
        rssiAdjIdx = 0;
      }

      macRadioDefsRefTableId = (txPwrTblIdx << 4) | rssiAdjIdx;

    #endif /* defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 || .. */
     
     
    #if defined (MAC_RUNTIME_CC2591) && defined (MAC_RUNTIME_CC2590) && \
        defined (MAC_RUNTIME_SE2431L) && defined (MAC_RUNTIME_CC2592)
    /* Determining PA LNA chip used from txPwrIdx*/ 
      switch (txPwrTblIdx)
      {
      case MAC_CC2591_TX_PWR_TABLE_IDX:
        paLnaChip = PA_LNA_CC2591;
        break;
       
      case MAC_CC2590_TX_PWR_TABLE_IDX:
        paLnaChip = PA_LNA_CC2590;
        break;
       
      case MAC_SE2431L_TX_PWR_TABLE_IDX:
        paLnaChip = PA_LNA_SE2431L;
        break;
     
      case MAC_CC2592_TX_PWR_TABLE_IDX:
        paLnaChip = PA_LNA_CC2592;
        break;
       
        default
          paLnaChip = PA_LNA_NONE;
        break;
      }
    #elif defined (MAC_RUNTIME_CC2591) || defined (HAL_PA_LNA)
      paLnaChip = PA_LNA_CC2591;
    #elif defined (MAC_RUNTIME_CC2590) || defined (HAL_PA_LNA_CC2590)
      paLnaChip = PA_LNA_CC2590;
    #elif defined (MAC_RUNTIME_SE2431L) || defined (HAL_PA_LNA_SE2431L)
      paLnaChip = PA_LNA_SE2431L;
    #elif defined (MAC_RUNTIME_CC2592) || defined (HAL_PA_LNA_CC2592)
      paLnaChip = PA_LNA_CC2592;
    #else
      paLnaChip = PA_LNA_NONE;
    #endif
     
      if (paLnaChip == PA_LNA_SE2431L)
      {
        /* Setting CPS as Output by setting P0DIR = 0x80 */
        CPS_DIR  |= CPS_PIN_OUTPUT;
       
        /* Setting CSD and Antenns Select as Output by setting P1DIR = 0x9 */
        ANT_CSD_SEL_DIR |= (CSD_PIN_OUTPUT | ANT_SEL_OUTPUT);
       
       /* Now EN or CSD line is controlled via software so setting it high here
        * to start the SE2431L frontend
        */
        HAL_PA_LNA_RX_CSD_HIGH();
      } 
    }

  • The default value is set in macRadioDefsTxPwrTables[]  which is defined in mac_radio_defs.c

  • Hi  Yikai

               which one is the default value ? i don't know which one  is choosed  on  macRadioDefsTxPwrTables  in  mac_radio_defs.c

             0xE5?     0XD5?

    #if defined HAL_PA_LNA || defined MAC_RUNTIME_CC2591
    const uint8 CODE macRadioDefsTxPwrCC2591[] =
    {
      20,  /* tramsmit power level of the first entry */
      (uint8)(int8)10, /* transmit power level of the last entry */
      /*  20 dBm */   0xE5,   /* characterized as 20 dBm in datasheet */
      /*  19 dBm */   0xD5,   /* characterized as 19 dBm in datasheet */
      /*  18 dBm */   0xC5,   /* characterized as 18 dBm in datasheet */
      /*  17 dBm */   0xB5,   /* characterized as 17 dBm in datasheet */
      /*  16 dBm */   0xA5,   /* characterized as 16 dBm in datasheet */
      /*  15 dBm */   0xA5,
      /*  14 dBm */   0x95,   /* characterized as 14.5 dBm in datasheet */
      /*  13 dBm */   0x85,   /* characterized as 13 dBm in datasheet */
      /*  12 dBm */   0x85,
      /*  11 dBm */   0x75,   /* characterized as 11.5 dBm in datasheet */
      /*  10 dBm */   0x65    /* characterized as 10 dBm in datasheet */
    };
    #endif

  • Do you enable HAL_PA_LNA or HAL_PA_LNA_CC2590?
  • HAL_PA_LNA
  • Then, the default value is 0xD5.
  • where could be got this information?
    how could you know that?
  • I had traced into source code and you can do the same to confirm this.
  • Hi Yikai
    where could you know the default value of TX power is OXD5 , while i define HAL_PA_LNA??
    i am so confused!!
  • You can set a breakpoint in MAC_SetRadioRegTable to check it.