[time-nuts] Re: pps pulse timestamp device

Jeremy Elson jelson at gmail.com
Sat Feb 17 19:28:00 UTC 2024


Hi Juan,

The STM32G4 is a great device for timestamping - it's what my timestamper
uses! It can run up to 170MHz which gives you a timing resolution of just
under 6ns.

As you noticed, some of the models (e.g. the STM32G474) do have the HRTIM
peripheral, and that was the source of my original excitement for
time-nuttery. It has a DLL of 32x on top of the 170MHz system clock, which
made me *think* I could use it to get 184ps resolution from a $10 chip.
Unfortunately when I sat down to finally write the code I realized that the
HRTIM only gives you that kind of resolution for *output* waveforms. Input
capture still runs at the system clock frequency.

In any case, I think it's still impressive to get 6ns resolution out of a
$5 chip (the STM32G431). My code and schematics are all open source; see:
https://github.com/jelson/rulos/blob/main/src/app/timestamper/timestamper.c
. My prototype board uses the STM32G431, with a 10MHz reference clock input
from the oscillator of your choice. I've used both GPSDOs and Rubidium
LPRO-101's. My board has a small analog circuit that changes the 0-centered
AC input of the reference clock to an above-zero waveform that can be used
as the stm32's system clock. The stm32 chip has an onboard PLL that I
configure to multiply the 10MHz ref clock up to a 170MHz system clock. Then
I use the input capture feature of the chip to acquire timestamps.

-Jeremy



On Thu, Feb 15, 2024 at 8:04 AM Juan Solano via time-nuts <
time-nuts at lists.febo.com> wrote:

> Thanks a lot guys for pointing me at the TICC, definitely I will have a
> look.
>
> Jeremy, interesting that you are using an STM32. I have an STM32G4
> lying around and I should have looked into it as I think it has some
> high resolution timer that perhaps could be handy for this kind of
> stuff, is that what you are using in your project? Your oscillator
> recomendation sounds great!
>
> Regards,
> Juan.
> _______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com
> To unsubscribe send an email to time-nuts-leave at lists.febo.com
>




More information about the Time-nuts_lists.febo.com mailing list