Hi David,
I have two scenarios: one for testing only (using a special firmware from NXP) and one for communication (ZigBee 3.0 stack).
The testing set is the same described in JN-AN-1122. The firmware provided by NXP has the 4 levels limitation of the complete stack.
The ZigBee 3.0 stack firmware I'm using allows me to get 4 steps. My code is:
#define RADIO_TX_POWER (-9) // dBm
//=============================================================================
//! \brief Set radio power.
//=============================================================================
void Set_Radio_Power (void)
{
DBG_PRINTF_INFO ("Enabling PA+LNA and adjusting PA input to %d dBm\n", RADIO_TX_POWER);
// Enable PA+LNA
vAHI_HighPowerModuleEnable(TRUE, TRUE);
// Set JN5168 radio power output to -9 dBm
eAppApiPlmeSet(PHY_PIB_ATTR_TX_POWER, (uint32_t)RADIO_TX_POWER);
}
The document JN-UG-3087 says:
- 2.2.1 Transmission Power
The radio transmission power of a JN516x device can be varied. To set the
transmission power, you can use the function eAppApiPlmeSet()from the NXP
802.15.4 Stack API (supplied in AppApi.hin all the JN516x SDKs). The required
function call is:
eAppApiPlmeSet(PHY_PIB_ATTR_TX_POWER, x);
where x is a 6-bit two’s complement power level, corresponding to an input range of
-32 to 31 dBm. In practice, this value is mapped to an actual transmission level: - For JN5168, JN5164 and JN5161, it is mapped to one of four levels:
-32, -20, -9 and 0 dBm - For JN5169, it is mapped to the nearest of 26 levels in the range -32 to 10 dBm
Therefore, some positive input values will be truncated (to 10 dBm for the JN5169
device and to 0 dBm for the other JN516x devices).
My board has a +20 dBm PA flat. If I set the JN5168 to 0 dBm, I get +20 dBm (give or take) at the antenna. I need to control the power to achieve +18 dBm, +16 dBm, and so on. The function described above gives me the choice to have at the antenna only +20 dBm, +13 dBm, 0 dBm (-20 from JN5168 and + 20 from PA).
That's ridiculous. I cannot effectively control the transmit power - and by extension the consumption profile - of my board.
With access to the internal register that controls the output TX power of JN5168, I can fine tune my board. I know there is a register and I guess the guys who designed the chip would put more than 2 bits for controlling the TX power in that register (the doc says 6 bits - 64 steps).
I just couldn't figure out why they decided to give away only 4 steps - that are meaningless for effective power control.
Regards,
-- Nestor