cancel
Showing results for 
Search instead for 
Did you mean: 

Generating 1 nanosecond update event using Timers - AN4013

Zaher
Senior II

According to AN4013 on using timers as time base generators, one could use a 16-bit timer to generate an update event from a nanosecond to a few minutes.

Well, take for example the STM32F429 clocked @ 180 MHz. If one cycle takes 5.56 ns, which is the fastest clock available for APB2 Timers, how to go beyond that to generate a 1 nanosecond intervals?

I know that 1 nanosecond = 32403240 CPU Ticks

Could it be done by measuring/calculating CPU Ticks?

Why I would need a timing base in the nanosecond range is beyond the scope of this question!

AN4013 for reference:

0693W00000D0FIqQAN.jpg 

Zaher

10 REPLIES 10

This is, of course, nonsense.

JW

Zaher
Senior II

What are you referring to? My question or what was mentioned on the Application note?

Your question is OK, of course. It's the "a nanosecond" in the AN which is nonsense.

The 'F373 [EDIT] 'F334 [/EDIT] and 'G47x can generate nanosecond and sub-nanosecond *delays* between signals, by using a delay line in the HRTIM.

JW

You can't generate interrupts at these rates, but you can tune the periodic into the 10s of nano-seconds at a granularity level (see APB, and 2xAPB clock for resolution), and toggle pins, and generate DMA/ADC triggering.

No STM32 MCU parts are clocking at 1 GHz, and most won't interrupts at rates beyond a few hundred KHz.

DMA should be drivable into the tens of MHz on most current platforms.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Zaher
Senior II

Thank you very much for the follow up. Yep, it seemed nonsensical for me, but I thought I might have missed something since it's an official ST's literature. That's why I wanted to ask in the first place. So, it could be done using hardware timers in new series. This sounds interesting to me. Can you provide references, document or AN to read about it on those lines of STM32 devices?

Your question too try explain

I know that 1 nanosecond = 32403240 CPU Ticks

And AN mean a nanosecond , what is not exact specified the one nanosecond, then can be interpreted as the nanoseconds...

Sorry, it's 'F334 not 'F373; but it's out there for quite a couple of years.

Read the HRTIM Cookbook, AN4539.

Note, that while the 'H7 do contain HRTIM, it is missing the delay line allowing the sub-ns delays.

JW

And your reply was pretty clear?

No problem. Thank you again for the AN. I will take a look and read about it!