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.

CC2530 32kHz clock and crystal setting

Other Parts Discussed in Thread: Z-STACK

Hi All,

one little question. Does the register CLKCONSTA only reflect the state of the clock settings or does it also show that a clock is stable? I am considering removing the 32kHz crystal and wonder whether this is possible without changes in the TI startup code that enables the crystal and polls for CLKCONSTA to be set. A quick test shows that it is possible to remove the crystal and get  CLKCONSTA.OSC32K = 0. 

Thanks in advance.

Best regards,


Tobias

  • The SW solution is Z-stack? If it so, you simply can add OSC32K_CRYSTAL_INSTALLED=FALSE

    in defined symbols.

  • Hi Igor,

    thanks for your answer. Actually I do not want to change my software ;-) It is not Z-Stack, but it uses the startup procedures from TI. Within these procedures it activates the 32kHz crystal and waits with "while (CLKCONSTA != (CLKCONCMD_32MHZ | OSC_32KHZ));"

    I think that the CLKCONSTA only reflects the state of the actual clock settings, but I would like to have the confirmation that this register does NOT indicate the stability or the presence of the crystal.

    Best regards,

    Tobias

  • Let me please reword my question:

    What does the CLKCONSTA register tell me with the bits OSC32K and OSC. Does it tell me that the clocks are active and stable or does it just tell me that the register settings for the clocks have been successfully written?

    Best regards,

    Tobias

  • Hey,

    Well, that is not official statement, but from my own experience I got the feeling it tells whether

    the clock is active and stable.I have no any HW to test it on, but you can do it pretty quickly, just

    remove the XTAL caps (the clock won't be stabilizing)

  • Hi Igor,

    I tested it on my hardware. I disconnected the watch crystal. To my surprise the OSCAL32 is reset to 0 (32-kHz XOSC) without any problems. I would conclude that this register only tells me that the settings have been correctly written. Can I get an official confirmation for this in this forum?

    Thanks and best regards,

    Tobias

  • Hi,

    The CLKCONSTA register tells which clock source is actually used as clock input for the given clock. For both clocks, there is a state machine involved in the change, so you will see a delay (and in some cases, a condition that prevents the change to take place).

    The 32 MHz XOSC and the 32 kHz XOSC behave differently in that switch to the 32 MHz XOSC is done only after the 32 MHz XOSC is determined to be stable. Switch to the 32 kHz XOSC, on the other hand, is done without waiting for the clock to be stable. This means that after switching clock source, you have to wait approximately 500 ms before you can trust the sleep timer and watchdog timer to be accurate.

  • Hi Hec,

    THANKS for your answer. Then I can remove the 32kHz crystal without changing the software, since it will not be used but in the startup.

    Best regards,

    Tobias