This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What value for FREQTUNE is set by the BLE stack?

Other Parts Discussed in Thread: CC2541, CC2640

I am using the LSR TiWi-uB1 radio module, which uses the CC2541.  LSR recommends that the FREQTUNE be set to 0x07.  The CC2541 user manual states that on reset the FREQTUNE is set to 0x0F but I can't determine if the BLE stack use the reset value or sets a value.

1. What value does the BLE stack set/use?

2. Is there a recommendation for FREQTUNE values from the TI BLE developers?

Thanks.

Jay

  • The stack sets this to 0x0F by default (PHY_FREQ_TUNE_NO_CAP_LOAD). This is the recommended value.

    The HCI_EXT_SetFreqTuneCmd() command is only meant to be used during PTM testing. From the HCI Vendor Specific API guide:

    "This PTM-only command is used to set this device’s Frequency Tuning either up one step or down one step. When the current setting is already at its max value, then stepping up will have no effect. When the current setting is already at its min value, then stepping down will have no effect. This setting will only remain in effect until the device is reset unless HCI_EXT_SaveFreqTuneCmd is used to save it in non-volatile memory."
  • Further question on this subject?

    1/ My understanding is that once my firmware goes into PTM mode, I can ask my firmware to run this command anymore. The only way to executes the command would be sending HCI byte commands through the UART i/f. Is this correct? 

    2/ HCI_EXT_SaveFreqTuneCmd will save the tune frequency in flash. Where does it save to? Once leaving out PTM mode, will my firmware's BLE Stack still use the save frequency? How to revert the setting? Sorry for a bunch of questions. Your answer will help us to understand the tuning mechanism and thus to come up with a proper process in mass production. 

    3/ Does this method and process apply to CC2640 as well?

    thanks,

  • Hello.

    1. This is correct. By definition, PTM involves exposing UART / SPI lines to send and receive commands / event. See the PTM wiki for more information: processors.wiki.ti.com/.../PTM.

    2. The value will be saved to a flash location. You can see this location in the .map file:

    <BANKED_CODE,CODE_C> 1 (was CODE_C)
    Relative segment, address: CODE 00002D14 - 00002D17 (0x4 bytes), align: 2
    Segment part 8.
    ENTRY ADDRESS REF BY
    ===== ======= ======
    ptmFreqTune 00002D14 LL_EXT_SaveFreqTune (ll)
    llRfInit (ll_common)

    Since it is saved to a flash location in a code bank, there is no way to revert this without reprogramming the device. Therefore, the stack will always use this setting.

    The intent of this command was that it would be used at the factory to adjust the frequency up and down until you get the frequency the way they want. This depends on the hardware design. For the TI reference design, we use the default 0x0F as stated previously. The save frequency command would then be used to save the frequency. The Controller saves the final value in flash, so it can’t be changed or reverted after that. So if embedded code did this, that would be the value stored in flash and used all the time.

    If LSR is recommending that you use 0x07 for their module then they have probably gone through this procedure and I would recommend listening to them. I'm not familiar with the LSR module but if it isn't using the standard TI BLE stack (1.4.0) I would imagine that the value is already set to 0x07 or they have some other way of doing it besides using PTM.
  • Tim, thanks for the details. One more question:

    Does this apply to CC2640 as well -i.e. using the same method for the 24MHz external crystal tuning?
  • Hello. Those API's only apply to the CC254x. See the following page for adjusting the cc26xx 24 MHz internal crystal load capacitance:
    processors.wiki.ti.com/.../CC26xx_Tips_and_Tricks

    The CCFG is defined further in the TRM (www.ti.com/.../swcu117a.pdf) and described how to modify in the software developer's guide (www.ti.com/.../swru393.pdf).