Hardware:
Custom DA14683 Board
Latest SDK = 1.0.14.1081 (Last updated in 2018)
Situation:
This question applies to any demo, but lets take the BMS demo for an example.
From hw_rf.h, I can see where the tx power levels are defined in this enum:
typedef enum { HW_RF_PWR_LUT_0dbm = 0, /**< TX PWR attenuation 0 dbm */ HW_RF_PWR_LUT_m1dbm = 1, /**< TX PWR attenuation -1 dbm */ HW_RF_PWR_LUT_m2dbm = 2, /**< TX PWR attenuation -2 dbm */ HW_RF_PWR_LUT_m3dbm = 3, /**< TX PWR attenuation -3 dbm */ HW_RF_PWR_LUT_m4dbm = 4, /**< TX PWR attenuation -4 dbm */ } HW_RF_PWR_LUT_SETTING;
From hw_rf.c, I can see the function that sets the TX power level:
void hw_rf_set_tx_power_ble(HW_RF_PWR_LUT_SETTING lut) { RFCU->RF_TX_PWR_BLE_REG = lut; rf_tx_power_luts.tx_power_ble = lut; }
...But the "hw_rf_set_tx_power_ble()" function does not appear to be called anywhere.
...Also none of the enums from "HW_RF_PWR_LUT_SETTING" appear anywhere in the project.
It is unclear where the TX power is being defined. It is also unclear at what point in the power up sequence the TX power is being set.
Questions:
1) Where is the default TX Power level defined? (file and line please)
2) At what point in the BLE radio initialization sequence is the TX power level set? (file and line please)
3) If I wanted to change the BLE radio TX power level, what is the correct sequence of operations to do so? (do I need to power down the radio first?, just stop advertising?, etc)
Hi Nathan,
As mentioned in my previous reply and as described in the datasheet, the DA14683 has hardcoded tx power at 0 dBm. This answers all your questions.
The DA14683 has near-field feature that reduces the output power to -20dBm.
Datasheet page 464
https://www.renesas.com/eu/en/document/dst/da14683-datasheet
Note 42: To activate the "Near Field Mode", program address 0x50002230, bits 9:5 with the value 0x0. To stop NFC restore previous bitfield value.
Regards,
PM_Renesas
I'm going to have to push back on this. I'm trying to get my project finished and I don't much want to play semantic word games.
As documented above, Your SDK has a function called "hw_rf_set_tx_power_ble()"
The header comment for this function is as follows:
/** * \brief Set TX Power for BLE * This actually sets the index of the RF_TX_PWR_LUT_X_REG to use. * \param [in] lut The TX power attenuation setting * \warning Do not call this function before recommended settings are applied */ void hw_rf_set_tx_power_ble(HW_RF_PWR_LUT_SETTING lut);
From your post above: "The hw_rf_set_tx_power_ble() is changing the TX power attenuation setting."
If you didn't want your users to refer to the "TX Power Attenuator" as "TX Power" then you should not have named your functions "hw_rf_set_tx_power_ble()" and had comments such as "Set TX Power for BLE".
Or....
... Are you trying to say that the "hw_rf_set_tx_power_ble()" function actually doesn't work and has no effect on the TX power (though an attenuator or whatever) coming out of the antenna? If so, why is that function included (and called by other functions in your SDK)?
It would be great if we could get back on track. I will reword my questions to specifically mention the "TX Power Attenuator".
Also once we get back on track here, we can hopefully un-derail the train on the other thread about RF Master TX Power "ATTENUATOR" settings.
1) Where is the default TX Power ATTENUATOR level defined? (file and line please)
(Partial Answer. See Above. ) The rf_tx_power_luts struct is never initialized?
2) At what point in the BLE radio initialization sequence is the TX power ATTENUATOR level set? (file and line please)
Answer: hw_rf_set_tx_power_ble() is first called from ble_peripheral_start()
3) If I wanted to change the BLE radio TX power ATTENUATOR level, what is the correct sequence of operations to do so? (do I need to power down the radio first?, just stop advertising?, etc)
(Not Answered. Same Question)