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.

am335x timer register write error



when the   am335x run the follow:

/* Configure the DMTimer for Auto-reload and compare mode */

   DMTimerModeConfigure(SOC_DMTIMER_5_REGS, DMTIMER_AUTORLD_NOCMP_ENABLE);

    /* set pin as input */

   DMTimerGPOConfigure(SOC_DMTIMER_5_REGS, DMTIMER_GPO_CFG_1);

    /* Configure and enable capture feature of DMTimer */
    DMTimerCaptureConfigure(SOC_DMTIMER_5_REGS, DMTIMER_CAPTURE_BOTH, DMTIMER_CAPTURE_SINGLE );

The Auto-reload seting is failed. Why?

PICLKOCP: 100 MHz 。PICLKTIMER 24 MHz。

Write Non-Posted
This mode is functional regardless of the ratio between the OCP interface frequency and the functional
clock frequency. Recommended functional frequency range is freq (timer) >= freq (OCP)/4.

So the register must be Write Posted.

But why the starterware driver use Write Non-Posted?

  • Hi Zuobing,

    Thanks for bringing this up.

    By default POSTED mode is enabled(via hardware) in DMTimer and according to TRM, certain DMTimer registers need to be checked for "Write POSTED Status" before writing to them and in the DMTimer API "DMTimerModeConfigure" a write access is done to "DMTIMER_TCLR" register and DMTIMER_TCLR register is affected by POSTED mode (For more information on POSTED mode refer section 20.1.3.4 Write Registers Access in TRM).

    Before a write is performed to DMTIMER_TCLR register the field "W_PEND_TCLR" in Timer_Write_Posted_Status register needs to be polled till the status becomes '0'. On doing this change the Auto-Reload setting should work.

    Polling of Write POSTED status is not done in StarterWare 02.00.00.07 release code. Support will be present in the next release.

    Regards,

    Jeethan