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.

mac timer related

Other Parts Discussed in Thread: CC2530

Hello! I''m using cc2530. According to some materials, timer2's period is 320us.I found some codes in zstack(osalTimeUpdate())

      elapsedMSec += MAXCALCTICKS * 8 / 25;

      remUsTicks += MAXCALCTICKS * 8 % 25;
    }
 
    // update converted number with remaining ticks from loop and the
    // accumulated remainder from loop
    tmp = (ticks320us * 8) + remUsTicks;
     
    // Convert the 320 us ticks into milliseconds and a remainder
    elapsedMSec += tmp / 25;
    remUsTicks = tmp % 25;

my question is:

1.why do we have to *8 and /25?  it seems 320*8/25=102,4(us) not 1ms.

2.where is the Initialization of timer2,i didn't find it in zstack.