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.

MSPM0G3519: MSPM0Gx51x PWM duty and period capture support and TIMER_ERR_01

Part Number: MSPM0G3519
Other Parts Discussed in Thread: SYSCONFIG

Per MSPM0Gx51x errata www.ti.com/.../slaz758 TIMER_ERR_01 is not present in those devices and thus manual reload workaround as described in https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1247735/faq-timer-capture-issue-in-period-capture-mode-for-mspm0-production-sample is not required. However, SysConfig as well as latest mspm0_sdk_2_10_00_04 do not account for it.

SysConfig relies on SDK dl_timers.c function DL_Timer_initCaptureCombinedMode() which contains following code:

    /*
     * Setting load condition to none due to GPTimer combined capture limitation
     */
    DL_Timer_setCaptureCompareCtl(gptimer, DL_TIMER_CC_MODE_CAPTURE,
        (DL_TIMER_CC_ZCOND_NONE | DL_TIMER_CC_ACOND_TIMCLK |
            DL_TIMER_CC_LCOND_NONE | DL_TIMER_CC_CCOND_TRIG_FALL),
        captConfig.index);
    DL_Timer_setCaptureCompareCtl(gptimer, DL_TIMER_CC_MODE_CAPTURE,
        (DL_TIMER_CC_ZCOND_NONE | DL_TIMER_CC_ACOND_TIMCLK |
            DL_TIMER_CC_LCOND_NONE | DL_TIMER_CC_CCOND_TRIG_RISE),
        captPairConfig.index);
SysConfig would also enable interrups for "Combined Capture ..." feature which is not required for MSPM0Gx51x devices.
 
Regards,
Eugene
  • Brian/TI,

    Can we please circle back on this thread from Eugene to obtain some level of initial feedback?

    TY,
    CY 

  • Hi Eugene,

    The code sets DL_TIMER_CC_LCOND_NONE because the GPTimer (General Purpose Timer) on the MSPM0 has a hardware limitation in Combined Capture Mode where it cannot perform an automatic load operation. So, in combined pulse-width and period capture, the timer counter does not automatically reset to a load value after a capture event. This forces you to either manually reload the counter in the Interrupt Service Routine (ISR) using DL_TIMER_setTimerCount() or manually calculate the difference between two successive capture values.
    If you are seeing unwanted interrupt code, ensure you have unchecked the specific "Combined Capture" interrupt flags in the Interrupt Configuration section of the Timer module in SysConfig. If the code persists:
    1. Verify you are on the latest MSPM0 SDK 
    2. If the automatic reload is critical for your timing, you must implement the manual reload workaround in your ISR:

               

    void TIMER_0_INST_IRQHandler(void) {
        // ... determine your capture event ...
        DL_Timer_setTimerCount(TIMER_0_INST, gLoadValue); 
    }

    Hope this helps!

    -Brian

  • Hi Brian,

    MSPM0Gx51x does not have this erratum and yet SDK forces suboptimal solution. Don't you think that SDK or Sysconfig  should be updated to allow better use of MSPM0Gx51x?

    Regards,

    Eugene

  • Hi Eugene, I think this is a fair point and will raise an action with our software team for a future improvement to our SDK.