Skip to main content
GPavl
Associate
August 7, 2019
Question

How to generate pulse with timer and comparator STM32F0

  • August 7, 2019
  • 1 reply
  • 590 views

Hi!

I have STM32F051K4Tx mcu. I would like to generate a short pulse of different width at each comparator event without using interrupt. Is this possible? How would I setup timer / comparator for this to work?

Thanks.

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
August 7, 2019

The answer to this question depends on the answer to this question.

If red, it's easy-peasy, just set it up as with triggering pulse with any external trigger.

If blue, which I suspect is more likely, then, well, it has to be changed so it's like red, and I suspect the easiest way to do that is to output the comparator's output to a pin and externally connect to the timer's input pin. There might be an alternative way using TRGO-TRGI to a linked timer and then generate the pulse there.

JW