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.

TIMER_setPreScaler not work?

Other Parts Discussed in Thread: CONTROLSUITE

Dear All,

as title.

I use "controlSUITE\device_support\f2802x\v210\f2802x_examples\cpu_timer" to test CPU Timer0.

TIMER_setPreScaler(myTimer0, 40); didn't make TPR of Timer0 change to 40, why?

The source code of this function from timer.c as below:

=================================================

void TIMER_setPreScaler(TIMER_Handle timerHandle, 

const uint16_t preScaler)
{
TIMER_Obj *timer = (TIMER_Obj *)timerHandle;


// set the bits
timer->TPR |=
((uint32_t)(preScaler & 0xFF00) << 16) | ((uint32_t)(preScaler & 0x00FF) << 8);

return;
} // end of TIMER_setPreScaler() function

===============================================

Thank you.

Abby