Skip to main content
amir_pdn
Associate II
May 7, 2021
Question

We are working on a project in which 50 pulses should be generated with a particular delay, and these pulses should be repeated in a period (0.02 seconds). We want to know how we could use the MCU's timers to produce such pulses?

  • May 7, 2021
  • 4 replies
  • 1000 views

Dear Sir/Madam,

I hope you are doing well,

We are working on a project in which 50 pulses should be generated with a particular delay, and these pulses should be repeated in a period (0.02 seconds).

We are using a Nucleo-F446RE board to do the project, 

We want to know how we could use the MCU's timers to produce such pulses?

Is there any way to use Timers with a specific delay to generate 50 pulses?

I am looking forward to hearing from you,

Many thanks.

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
May 7, 2021

The Advanced Timers can generate counted pulse trains using the Repetition Count option, triggered in a one-shot mode.

Other timers within the system can trigger the TIM

The timers are quite complex, review the chapters and associativity in the Reference Manual thoroughly

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
waclawek.jan
Super User
May 7, 2021

Another option would be using two timers in master-slave arrangement, slave generating the rapid pulses as PWM, being set to Gatd mode in the slave-mode controller; master generating the gating so that the active period (i.e. when slave is enabled) is exacty 50 slave cycles long.

JW

amir_pdn
amir_pdnAuthor
Associate II
May 8, 2021

In fact, we want to have 8 pure pulses at the end of the story.

But

These 8 pulses are produced from a total of several pulses.

That means we have 64 pulses in the beginning.

According to the definition we have, we come from the width of our different pulses (from the first 64) and pulsar (or) and make our final 8 pulses.

These pulses have a frequency of 50 and that 0.2 is the frequency of our pulses.

But we also have to put a delay between the pulses.

waclawek.jan
Super User
May 8, 2021

I don't understand your explanation. You may want to make a timing diagram.

But, at the end of the day, it's your task to get this going, so start playing with various settings of one timer, try then a master-slave arrangement between two timers. This all after reading the TIM chapter in RM thoroughly.

JW