cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring time between pulse edges (in 20 nanoseconds resolution or less)

arope99
Associate II
Posted on August 25, 2016 at 14:29

Hi all,

I'm still relatively new to development on MCU. So I'm hoping to get some help to start.

I need to measure time between pulses in 20 nanoseconds resolution or less. I then need to transfer the measured value to a host machines (preferably via Ethernet or USB).

Can anyone comment if any of the STM32 MCUs would be able to do this measurement?

If yes, can you give me a starting point where to start in regards to measuring the pulses?

If no, which other solutions that would be suitable for my use?

Thanks in advance.

5 REPLIES 5
Posted on August 25, 2016 at 15:13

The PWM Input mode can make such measurements. Get yourself a NUCLEO-F411RE, clocking at 100 MHz you'd get 10ns from 16-bit and 32-bit counters.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Walid FTITI_O
Senior II
Posted on August 26, 2016 at 17:19

Hi s.hidayat, 

STM32F4xx and STM32F7xx are suitable for your case. You can first select the device and the board (STM32F407x device, 

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/stm32f4discovery.html

).

 I recommend two firmware ressources:

* TIM_PWMInput example available in almost all STM32CubeFx packages. For

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef4.html

at this path:STM32Cube_FW_F4_V1.12.0\Projects\STM32F4-Discovery\Examples\TIM\TIM_PWMInput

* TIM_EXTCLK_ETR example in

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/91/01/84/3f/7c/67/41/3f/DM00236305/files/DM00236305.pdf/jcr:content/translations/en.DM00236305.pdf

which calculates the ppm of input signal using external clock. This examples and the theorie behind is well described in details in the application note. The package theat contains the example is at this Link

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-software/x-cube-timcooker.html

-Hannibal-
arope99
Associate II
Posted on August 31, 2016 at 03:32

Hi Hannibal,

Thanks for the suggestions.

A few more question. 

The pulse shall be ~50us and the pulses are at least 1us aparts. I need to send the time stamps of the pulses or the duration between pulses to another machine for processing (preferably via Ethernet or USB). I need at least 2.56Mbps between the processing machine and the MCU board.

Will these be achievable with a STM32F4xx evaluation board?

Does any of the evaluation boards have Ethernet interface?

I was looking at this one here from Olimex. What do you think?

http://www.digikey.com.au/catalog/en/partgroup/stm32f407-evaluation-board-stm32-e407/33818

Thanks in advance. Appreciate your help.

arope99
Associate II
Posted on August 31, 2016 at 03:46

Hi Hannibal,

Just found out that I could add expansion board with Ethernet to the discovery board.

I would appreciate if you could give a quick comment in the combination of the STM32F4DISCOVERY and STM32F4EXT-BB would suit my need.

Thanks.

Walid FTITI_O
Senior II
Posted on September 01, 2016 at 10:27

Hi s.hidayat,

Yes, the base board STM32F4DIS-BB would be the suitable expansion board for you.

You find related web page at this

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-3rd-party-evaluation-tools/stm32f4dis-ext.html

.

-Hannibal-