Skip to main content
andreaspiezia9
Associate III
January 25, 2016
Question

TIM_OCxPreloadConfig

Posted on January 25, 2016 at 15:42

Hi all,

on the DM00068049 on pg. 452, is reported:

In case of PWM mode, this function is mandatory: TIM_OCxPreloadConfig(TIMx,

TIM_OCPreload_ENABLE);

But I see that timer works good also without recall this functions, why?
    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    January 25, 2016
    Posted on January 25, 2016 at 18:02

    The timers have a bunch of shadow registers that allow all parameters to be synchronously loaded at the Update event. Saves a bunch of race/phase/glitch issues where you'd otherwise have to reprogram things in the interrupt and hope your latency was low.

    By preloading, things push through the shadow registers immediately, and you don't have to wait a whole period of the timer for settings to become active. You really want everything set before Enabling the timer, so it starts as anticipated/desired.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..