cancel
Showing results for 
Search instead for 
Did you mean: 

How to count periods and wait for specific time?

Endika Caño de Miguel
Associate II
Posted on June 30, 2017 at 10:38

Hello: 

Thank in advance for reading this, 

I have to count 7 periods out of an 8MHz signal and then wait for the next period 64KHz( 15,625us). I�m using an STM32L432 Nucleo device. I have generated the 8MHz signal using TIM1 as a PWM generator, but I don�t know how to follow up my project.

I�m pretty newbie using this kind of devices so I �m a bit lost. Any help would mean a world to me.

If you have any question let me know, please

0690X00000603vEQAQ.jpg

#mhz #counter #stm32l432 #nucleo-32 #period #pwm #tim
3 REPLIES 3
S.Ma
Principal
Posted on June 30, 2017 at 11:47

My take: Make a timer overflowing at 64kHz, use a GPIO toggling from one of the timer output compare. Feed the output compare from DMA which scans a table generating the required pulses.

Posted on June 30, 2017 at 12:38

Circular DMA buffer with 125 entries, driving a TIM in PWM at 8 MHz with 7x 50/50 value and the rest 0 as in OFF. Values loading at Update signal.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 03, 2017 at 09:31

I´m sorry, but as I said, I´m pretty newbie with this kind of devices (2 months ago I was learning how to blink a LED) so I haven´t understand it all. 

This is what I get from your message. Make a timer overflowing at 64KHz. Then I use GPIO Toggle to count the pulses I need from the 8MHz signal???

After this I haven´t understand what  do I have to do, sorry.