Skip to main content
JuM
Senior
December 11, 2017
Solved

STM32F072 Nucleo-64 - TIM16 problem

  • December 11, 2017
  • 3 replies
  • 1255 views
Posted on December 11, 2017 at 11:33

Trying to use TIM16 of a STM32F072 to generate a (software triggered) one shot high pulse at a GPIO pin.

As there are some screenshots, I have attached a PDF to show the problem.

I do not use any timer hardware beside of ARR and CNT, but get a 40 usec (first) pulse instead of a 200 usec pulse...

Running TIM16 as periodical timer with same initialization, second and all following pulses are 200 usec!?

Any idea?

Best regards Juergen.
    This topic has been closed for replies.
    Best answer by waclawek.jan
    Posted on December 11, 2017 at 11:59

    Without dwelling much upon your code: are you aware of the fact that PSC register is loaded into actual prescaler only upon update?

    JW

    3 replies

    waclawek.jan
    waclawek.janBest answer
    Super User
    December 11, 2017
    Posted on December 11, 2017 at 11:59

    Without dwelling much upon your code: are you aware of the fact that PSC register is loaded into actual prescaler only upon update?

    JW

    JuM
    JuMAuthor
    Senior
    December 11, 2017
    Posted on December 11, 2017 at 14:58

    You are - as nearly always - right, I was not aware...Have to read ST manuals much more 'wordwise'...

    Thank you for your support!
    waclawek.jan
    Super User
    December 11, 2017
    Posted on December 11, 2017 at 15:04

    How comes 'nearly'??? ;)

    Glad you got it working.

    JW