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.

Running BLE stack on 32M not advertising

Other Parts Discussed in Thread: CC2541, CC2540

Hi,

I want to know on what cpu clock frequency ble stack runs 32M or 16M?

Long back one of TI employee had told me that it runs on 32M but i can't find definition for cpu running on 32M

Following are some of parameters defined in hal_mcu.h

/* CLKCONCMD bit definitions */
#define OSC              BV(6)
#define TICKSPD(x)       (x << 3)
#define CLKSPD(x)        (x << 0)
#define CLKCONCMD_32MHZ  (0)
#define CLKCONCMD_16MHZ  (CLKSPD(1) | TICKSPD(1) | OSC)

There is no definition for clock setting for 32M as marked above. I am working on voice recording and playing using timer3 PWM . If i do not use stack and play message using 32M cpu clock then message is played as usual but using stack its playing twice faster. if i try to define the above definition for 32M then ble device doesn't advertise at all.

can anyone please suggest me for above doubt?

thanks

  • Hello Kumar,
    For CC2540 and CC2541 the 32 MHz is the main clock speed (sourced from the 32 MHz oscillator with the external 32 MHz XTAL). But right after startup the 16 MHz internal RCOSC is used until the 32 MHz clock is started and stable (Start up time defined in data sheet). The Radio require the 32 MHz oscillator to run to be able to do any RF operation.

    What might have happened is that, in your standalone application, you never start the 32 MHz oscillator in which case you are running from the 16 MHz RCOSC.
  • Hi Eirik,
    Thanks for clarifying about clock settings in detail. Now i got about clock functionality. In my standalone application i am using 32M clock only as defined below
    // Set system clock source to HS XOSC, with no pre-scaling.
    CLKCONCMD = (CLKCONCMD & ~(CLKCON_OSC | CLKCON_CLKSPD)) | CLKCON_CLKSPD_32M;
    // Wait until clock source has changed.
    while (CLKCONSTA & CLKCON_OSC);

    Will check if there is some other problem or clash in registers of SPI configuration or timer3 configuration used by my application and ble. I don't think there should be register clash because if am not wrong, ble doesn't use either spi or time3. will find if there is some other reason for such behaviour.