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.

Timer64Plus write to Timer Count Registers while counting?

Guru 15580 points

Is it legal to write to TIM12 or TIM34 while the counter is actively counting? Will there be any negative effects?

Thx,

MikeH

 

  • Hi MikeH,

    On OMAPL1x processors, TIM12 and TIM34 are protected by hardware and cannot be written to while the timer is active.  Please refer to section 2.1.5.2 Writing to Registers of an Active Timer in the Timer User Guide (http://www.ti.com/lit/ug/spruh77/spruh77.pdf).

    Regards,

    Melissa

  • Melissa,

    Thanks for pointing this out. I completely missed it in SPRUFM5.pdf.

    Is there any way to pause the timer, change the value of TIM12, then continue counting with the updated value?

    Mike

     

  • Hi Mike,

    You can disable or pause the timer by writing 0 to the ENAMODE12 bit of the TCR register.  Then write a new value to TIM12.  When the timer is re-enabled (by writing 1 to the ENAMODE12 bit), the timer will begin counting from this new counter value.

    Regards,

    Melissa

  • Melissa,

    mwatkins said:
    You can disable or pause the timer by writing 0 to the ENAMODE12 bit of the TCR register.  Then write a new value to TIM12.  When the timer is re-enabled (by writing 1 to the ENAMODE12 bit), the timer will begin counting from this new counter value.

    Perfect! Thanks.

    MikeH