cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the power level on the SPIRI1 sub GHz transceiver?

Anesh Kumar
Associate II

I have Contiki Coap server and client running on our two prototype boards with SPSGRF-915 module mounted on it. One node is on roof inside HVAC unit and second one is in the lab. The node on roof is not able to send data to the node in lab (in lab both nodes are communicating). I want to configure SPIRIT1 (SPSGRF-915) to maximum output power level.

This is how it is done currently;

#define POWER_DBM                   11.6
 
st_lib_spirit_radio_set_pa_level_dbm(0,POWER_DBM);
st_lib_spirit_radio_set_pa_level_max_index(0);
 
 
/**
* @brief  Sets a specific PA_LEVEL register, with a value given in dBm.
* @param  cIndex PA_LEVEL to set. This parameter shall be in the range [0:7].
* @param  fPowerdBm PA value to write expressed in dBm . Be sure that this values is in the
*         correct range [-PA_LOWER_LIMIT: PA_UPPER_LIMIT] dBm.
* @retval None.
* @note This function makes use of the @ref SpiritRadioGetdBm2Reg fcn to interpolate the 
*       power value.
*/
void SpiritRadioSetPALeveldBm(uint8_t cIndex, float fPowerdBm)
{
  uint8_t address, paLevelValue;
  
  /* Check the parameters */
  s_assert_param(IS_PA_MAX_INDEX(cIndex));
  s_assert_param(IS_PAPOWER_DBM(fPowerdBm));
  
  /* interpolate the power level */
  paLevelValue=SpiritRadioGetdBm2Reg(SpiritRadioGetFrequencyBase(),fPowerdBm);
 
  /* Sets the base address */
  address=PA_POWER8_BASE+7-cIndex;
  
  /* Configures the PA_LEVEL register */
  g_xStatus = SpiritSpiWriteRegisters(address, 1, &paLevelValue);
  
}
 
/**
* @brief  Sets a specific PA_LEVEL_MAX_INDEX.
* @param  cIndex PA_LEVEL_MAX_INDEX to set. This parameter shall be in the range [0:7].
* @retval None
*/
void SpiritRadioSetPALevelMaxIndex(uint8_t cIndex)
{
  uint8_t tempRegValue;
  
  /* Check the parameters */
  s_assert_param(IS_PA_MAX_INDEX(cIndex));
  
  /* Reads the PA_POWER_0 register */
  SpiritSpiReadRegisters(PA_POWER0_BASE, 1, &tempRegValue);
  
  /* Mask the PA_LEVEL_MAX_INDEX[1:0] field and write the new value */
  tempRegValue &= 0xF8;
  tempRegValue |= cIndex;
  
  /* Configures the PA_POWER_0 register */
  g_xStatus = SpiritSpiWriteRegisters(PA_POWER0_BASE, 1, &tempRegValue);
  
}
 
 

Is that configuring maximum power out of SPIRIT1? If not, please suggest correct way. Thanks!

-Anesh

3 REPLIES 3
Winfred LU
ST Employee

SpiritRadioSetPALeveldBm() would be what you need.

It is to configure the register PA_POWER[8] (address 0x10).

Please refer to datasheet, section 9 for more details about output power ramping configuration.

Hi Winfred,

Thank you for your reply.

#define PA_POWER8_BASE ((uint8_t)0x10) /*!< PA Power level for 8th slot of PA ramping or ASK modulation */

  1. It seems to me that PA_POWER[1] (address 0x17) is configured since cindex is 0(address=PA_POWER8_BASE+7-cIndex;).
  2. Power ramping is not enabled, as you see in this function void SpiritRadioSetPALevelMaxIndex(uint8_t cIndex) at this expression SpiritSpiReadRegisters(PA_POWER0_BASE, 1, &tempRegValue); I verified bit 5 was not 1.

0690X00000AtFbCQAV.png

Question:

  1. 0690X00000AtFdwQAF.pngFrom above table in last column what does that +12dBm, +6dBm... mean? Are those maximum power output in respective slots or power output during register reset?

2. Which slots/PA_POWER[x]/PA_LEVEL_x should I choose for maximum power output?

I am working on STM32CubeExpansion_SUBG1_V3.1.1 SDK and want my nodes to be configured at maximum output, so that data can reach from roof to inside lab. If you need more info, let me know. Thanks again for your help.

-Anesh

Can you please answer to my last reply? Thanks! -Anesh