Other Parts Discussed in Thread: CC2543,
I'm studying CC2543 BLE broadcaster example code (swrc291), and want to port this example to CC2541.
there are 2 segments of code to set output power:
==== 1. in the function miniBlePhyInit in miniBLE_phy.c:
#if(chip == 2541)
TXPOWER = TXPOWER_0_DBM; // Set default output power: 0dBm.
TXFILTCFG = 0x03; // Set Tx filter bandwidth.
TXCTRL = 0x19; // Set DAC Current.
IVCTRL = 0x1B; // Set PA, mixer and DAC bias.
==== 2. in function miniBleSetOutputPower in miniBLE.c:
uint8 miniBleSetOutputPower(uint8 txpower) {
// Check if argument is valid, PA bias control must be set to 0x05 for CC2543.
#if(chip == 2543)
if((txpower & 0x05) != 0x05) {
#elif(chip == 2541)
if((txpower <MINUS_20_DBM) || (txpower >PLUS_0_DBM)) {
#endif
return MINIBLE_FAIL_INVALID_ARGUMENT;
}
uint8 intState;
HAL_INT_LOCK(intState); // Enter Critical section.
if(!miniBleAdvTxDone) { // Possible ongoing transmission?
HAL_INT_UNLOCK(intState); // Exit Critical section.
return MINIBLE_FAIL_RADIO_ACTIVE;
}
MINIBLE_PHY_SET_OUTPUT_POWER(txpower); // Set new TXPOWER setting.
HAL_INT_UNLOCK(intState); // Exit Critical section.
return MINIBLE_SUCCESS;
}
============
as the comment states in the first code segment:
Set PA, mixer and DAC bias.
and the comment states in the second code segment:
PA bias control must be set to 0x05 for CC2543.
so I guess TXCTRL and IVCTRL might need to be set to specific values for different output levels.
my question is "what values should be set for TXCTRL and IVCTRL for different output levels?"
for example to set output level at -20dbm, what values neet be set for TXCTRL and IVCTRL?
to set output level at -10dbm, what values neet be set for TXCTRL and IVCTRL? etc.