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.

LAUNCHXL-F28379D: how to use a same cpu timer with different period values

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello there,

My question is somewhat related to this thread: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/880736/ccs-launchxl-f28379d-how-to-update-commands-for-cpu-timer

My question is how I can use same timer lets say CpuTimer0 with different period values?

Do I need to re-configure it every time with period values I want to use using function ConfigCpuTimer() ?

Also in this thread it says:

----------------------------------------------------------------------------------------------------------------------------------------

//
// To ensure precise timing, use write-only instructions to write to the
// entire register. Therefore, if any of the configuration bits are changed in
// ConfigCpuTimer and InitCpuTimers (in F2837xD_cputimervars.h), the below
// settings must also be updated.
//
    CpuTimer0Regs.TCR.all = 0x4000;
    CpuTimer1Regs.TCR.all = 0x4000;
    CpuTimer2Regs.TCR.all = 0x4000;

-----------------------------------------------------------------------------------

if this is true, what value it needs to be updated with?


Thanks,

  • Hi Sumit,

    The ConfigCpuTimer() in the C2000ware examples initializes all of the other timer configurations, along with the period. If you want to change this period during the run of your application, you could call configCPUTimer() with the new period and CPUTimer_startTimer() afterwards to adjust the period value.

    Can you explain more about your intended application? Which timer periods are looking to switch between and when?

    I would also suggest taking a look at the CPU timer register descriptions to understand which values need to be written for different periods. See the System Control and Interrupts >> System Control Registers >> CPU_TIMER_REGS Registers section of the F2837xD TRM linked here

    Best Regards,

    Delaney