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.

How To configure 32kHz Crystal for CC2530

Other Parts Discussed in Thread: CC2530, CC2531, Z-STACK

Hello All,

In user guide of CC2530 it is mentioned in Timer2 section that "The timer can be started and stopped synchronously with the 32-kHz clock rising edge. Note that this event is derived from a 32-kHz clock signal, but is synchronous with the 32-MHz system clock and thus has a period approximately equal to that of the 32-kHz clock period."

Does that mean Timer 2 of CC2530 is using 32kHz crystal as a clock? If not, is there any other way to use 32kHz crystal with any of the timer module of CC2530

 

Can anyone update on this?

 

Harshal

  • Hi Harshal,

     

    Timer 2 isn't using 32Khz crystal as its clock source, quoting the cc253x users guide:

    "When Timer 2 is used together with the Sleep Timer, the timing function is provided even when the

    system enters low-power modes. The timer runs at a speed according to CLKCONSTA.CLKSPD.

    If Timer 2 is to be used with the Sleep Timer clock speed must be set to 32 MHz, and an external 32kHz

    XOSC should be used for accurate results".

    Where CLKCONSTA.CLKSPD can have 8 discrete values between 250KHz to 32MHz.

    "Timer start/stop synchronous with 32 kHz clock and timekeeping maintained by Sleep Timer."

     

    BR,

    Igor

     

    Figure 4-1. Clock System Overview (page 58)

  • HI Igor,

     

    Thanks For confirmation.

     

    In my application I want to use 32kHz external oscillator also for accurate timing measurement. Have you come across any such application, where both 32MHz and 32kHz crystals are used?

     

     

    With Regards,

    Harshal

  • Hi Harshal,

     

    Of course, for example, in my application there is a whole ZigBee network formed

    by ZigBee Coordinator (ZC), ZigBee Routers (ZRs) and ZigBee End Devices (ZEDs).

    All these logical devices based on cc2531 (which is cc2530 + USB interface) SoC.

    While ZC and ZRs are constantly powered from the electrical grid (32KHz CRY isn't

    used there), the ZEDs are battery powered, where power saving feature of ZEDs

    achieved by periodically entering to deep sleep power mode/s, in order to use this

    power mode along with Z-Stack an external 32KHz Crystal is a must (sleep timer).

     

    Br,

    Igor

  • Hello Igor,

     

    Sorry to say to but you have some confusion.

    I want to use 32kHz crystal for timer tick operation but how to select clock coming from 32kHz crystal for Timer1 Or Timer2 Or TIMER 3 or 4? As for CLKCONCMD.TICKSPD I can select various frequencies but there is nor setting to select clock source( OR to select crystal).

     

    If I can use 32kHz crystal for timer tick generation in run time then it would be easier for me to generate 10 minutes timing with this 32kHz as it will yield more accuracy and i will able to use both crystals 32kHz and 32MHz simultaneously.

     

    With Regards,

    Harshal

  • Hi Harshal,

     

    Indeed, my mistake... :)

    Try the sleep timer (24 bit counter) in Timer compare mode, its clock source is 32KHz.

    Please refer to  cc2530 Users guide for more details.

    Keep in mind though, using this timer to that purpose may be a problematic if you also

    want to use the sleep feature of cc2530.

     

    I haven't used this one to produce such a long time window (10 minutes), but you can give

    it a shot. You can quickly get a prove of concept with a little of configurations made.

     

    Br,

    Igor