ZSTACK Launch power settings
一:
Discover ZSTACK 2530 RF transmitting powerActually notis set to the maximum, but 0xd5 (1 dbm )
maximum can be setTXPOWER=0XF5,(4.5dbm) ,SettingsLocationmain After the function starts,
osal_start_system(); // No Return from here before
2:
Background information:
1: http://nt1985.blog.163.com/blog/static/1232562702009629102438544/
Launch power:
The size of the
transmission range is related to the transmitting power and the channel environment, and there is no direct connection between the transmission rate and the transmission range. Therefore, appropriately increase the transmission range. But there are certain restrictions. For details, please refer to the DataSheet.
In mac_radio_def.h, you can set it:
#define MAC_RADIO_CHANNEL_DEFAULT 11
#define MAC_RADIO_TX_POWER_DEFAULT 0x1F
#define MAC_RADIO_TX_POWER_MAX_MINUS_DBM 25
These are just an example to explain, the meaning of these parameters, and where to modify it in Z-Stack. There are many other parameters that can view related source files.
[mac_radio_def.h]
#define MAC_RADIO_SET_CHANNEL(x) st( FSCTRLL = FREQ_2405MHZ + 5 * ((x) – 11); )
#define MAC_RADIO_SET_TX_POWER(x) st( TXCTRLL = x; )
#define MAC_RADIO_SET_PAN_ID(x) st( PANIDL = (x) & 0xFF; PANIDH = (x) >> 8; )
mac_radio_def.h file position:
mac_radio.c location
mac_radio.c
MAC_INTERNAL_API void macRadioSetTxPower(uint8 txPower)
{
。。。。。。。。。。
reqTxPower = pTable[index];
/* update the radio power setting */
macRadioUpdateTxPower();
}
MAC_INTERNAL_API void macRadioUpdateTxPower(void)
{
macPhyTxPower = reqTxPower;
MAC_RADIO_SET_TX_POWER(macPhyTxPower);
}
mac_radio_defs.h
#define MAC_RADIO_SET_TX_POWER(x) st( TXPOWER = x; )
three
and find a breakpoint running for the program and find that the transmitting power in ZSTACK is not set to the default value
The default value is defined in mac_radio_def.h:
#define MAC_RADIO_TX_POWER_DEFAULT 0x1F
but 0xd5 (1 dbm ), that’s itWhere
What aboutSettings?
Studies discovered
The transmitting power is determined by Macradiosettxpower function parameter TXPOWER in mac_radio.c
Since we can’t see whether the function Macradiosettxpower is called there, the setting of the transmitting power in ZSTACK is not clear. I don’t know where to set TXPOWER to0xd5。
So
The final solution ofis:
After the main function starts,
osal_start_system(); // No Return from here before
Settingstxpower = value you want, seeCC2530 Data Manual Page 21