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: 32 kHz clock is not running and timers are not working

Part Number: CC2530

I have a problem with getting 32 kHz oscillator to run. I suppose that either XOSC or RCOSC should run automatically after reset. However, SLEEPSTA.CLK32K stays low indefinitely. What is even more weird is that CLKCONSTA is always zero even if I write something to CLKCONCMD register.

So it seems that I've missed some initialize step somewhere but I cannot understand what. This code has been working earlier (it is part of a bigger project) so I don't understand why it's not working any more. Could there be some hardware issue (not probable since same HW is used in another project and it's working)? I have a CC debugger with IAR and I can verify that code is working except that 32 kHz clock is not running and therefore timers are not working. Any help would be greatly appreciated!

Here is a code snippet of affected code part:

CLKCONCMD = 0x98;                             // 32kHz RCOSC : 32MHz XOSC : Tick 4MHz : System 32 MHz

// Enable Interrupts and receiver;
P0IE = 1;                         // Enable Interrupts from Port 0 
IEN2 |= 0x10;                     // Enable Interrupts from Port 1
IEN2 |= 0x02;                     // Enable Interrupts from Port 2
__enable_interrupt();

if(SleepState > kSleepIdle) { 
          // wait for 32MHz clock to stabilize
        while((CLKCONSTA & 0x40)) {   // I have noticed that CLKCONSTA is always zero
          ;
        }
          // wait for positive transition on 32kHz clock (CLK32K bit) - Sleep timer register has been updated
        while((SLEEPSTA & 0x01)) {   // Wait for a low or already in a low
          ;
        }
        while(!(SLEEPSTA & 0x01)) {  // Wait for a high. Code never continues from here, because clock stays low!
          ;
        }
        Timer2SyncStart();  // Restart Timer2
      }

  • Hi Pauli,

    If CLKCONSTA is always 0 it sounds like there might be a problem with the device. It should at least reflect the updated tick speed.

    Are you seeing the same problem on multiple boards? Have you checked if there are any oscillations on the 32 MHz crystal? Is the crystal spec within the requirements in the CC2530 datasheet?

    Cheers,
    Fredrik
  • Hi Fredrik and thank you for your answer.

    Yes, this problem is on multiple boards. Crystal should be within requirements.

    I don't know how to check if there is oscillations on 32 MHz crystal. Can this be measured somehow with oscilloscope? I have only checked it via software and it seems that there is no life on RC oscillator.

    I tried to initialize clocks by following the software example (http://www.ti.com/lit/zip/swrc135) found on TI site. That example gets stuck on following lines in clock.c:

    At line 43:

    while (!CC2530_IS_HFRC_STABLE() || ((SLEEPSTA & SLEEP_OSC_PD_BM)!=0));// wait until the oscillator is stable 

    There it gets stuck in HFRC stable check and will not continue.

    At line 52:

    CC2530_WAIT_CLK_UPDATE();

    There it gets stuck again. What is interesting is that HFRC stable check checks SLEEPSTA bit 6 (hex 0x40) but according to User guide (http://www.ti.com/lit/ug/swru191f/swru191f.pdf) that bit is reserved. It might be correct way to read that bit but why it is not documented accordingly then?

    The second issue is more obvious and it stucks in point where it waits that CLKCONSTA reflects the configuration done in CLKCONCMD. But the reason why CLKCONSTA never updates itself is not clear to me. It is always just zero.

    Br, Pauli