cancel
Showing results for 
Search instead for 
Did you mean: 

Would it be possible to calibrate the M48T12 memory using an STM32?

Not applicable

Hello,

The M48T12 memory outputs a test signal at 512Hz, with a deviation of 0.001Hz.

I tried to read this deviation using a 24MHz sampling logic analyzer, but there was still a fluctuation in the reading of the thousandths of a Hz.

I think maybe a 100MHz logic analyzer might have better capability, so I thought of a 168MHz microcontroller.

Has anyone had experience with this?

Found this "reciprocal frequency counter", has anyone tried this?

https://www.instructables.com/High-Resolution-Frequency-Counter/

7 REPLIES 7

> there was still a fluctuation in the reading of the thousandths of a Hz.

It's the same underlying reason as here https://community.st.com/s/question/0D53W00001KzRS7SAN/would-it-be-possible-to-calibrate-the-m48t12-memory-using-an-stm32 [EDIT]https://community.st.com/s/question/0D53W00001KyZJaSAN/bad-jitter-on-lse-over-01s-time-scales [/EDIT] i.e. uncertainty of the comparator "digitizing" the crystal oscillator's output.

The purpose of RTC is to provide a stable signal in long term, not to provide millisecond-precise pulses.

JW

Nikita91
Lead II

A deviation from what reference? To measure a frequency you must have a more precise reference than the one you need to measure. In your case you may be measuring the fluctuations of your logic analyzer.

Measuring with an STM32 that uses a PLL will give roughly the same result.

It is not for nothing that frequency meters use precise sources (TCXO, OCXO...), and precisely measure the position of the fronts with a vernier. A logic input with Schmitt trigger cannot be precise except for long-term measurements (several seconds or minutes).

Hi,

I didn't understand what you meant in the line "It's the same underlying reason as here" followed by the link, because this link you provided returns to this same question.

About the fluctuation is in the order of 0.001Hz to 0.002Hz, I understand that there is some fluctuation in the logical analyzer. I hope it's not a fluctuation generated by the RTC, because this signal is the calibration reference. I believe that the test frequency should remain constant as long as the power and temperature conditions remain the same.

Thanks.

Not applicable

Hi,

Yes, I know about the PLL fluctuation, unfortunately I momentarily forgot about it, at the time of asking the question.

About the best precision oscillator, it really is necessary.

Really averaging many measurements may be necessary,

Thanks.

Not applicable

I found this article:

The equal precision frequency measurement is also known as multi-cycle synchronous frequency measurement method. Its most prominent feature is that the actual gate time is not a fixed value, but a value related with the measured signal, it is exactly an integer multiple of the measured signal period. Within the time allowed counting, we count pulse numbers of the standard signal and the measured signal at the same time, then derive the frequency of the measured signal through mathematical formula.

https://file.scirp.org/pdf/ENG20121000003_88356912.pdf

And this other one:

Time-to-digital converter (TDC) is a device used to measure time interval, which converts the time interval into the digital output. Digital TDCs use internal propagation delays of signals through gates to measure time intervals with very high resolution [19]. A start pulse propagates through the delay line, and its statuses along the delay line will be recorded by flip-flops triggered upon the arrival of a stop pulse. Then, the time interval between the start and stop pulse is obtained by decoding the statuses [20]. In view of this, the proposed method uses FPGA and TDC to accurately measure the time of multiple cycles of the measured signal.

https://www.jstage.jst.go.jp/article/elex/advpub/0/advpub_16.20190310/_pdf/-char/ja

The FPGA seems to be more attractive for this type of service than the microcontroller. I'm going to try this project with Attiny2313, previously mentioned link, then I'll see if I can do it with EPM240, as I already have a board with a dedicated 50MHz oscillator.

Thank you.

Sorry, I fixed the link above.

JW

Nikita91
Lead II

If you use an external component, it is possible to be very precise. But you still need a good quality reference clock. The TDC7201 datasheet indicates this.

TDC7201

MAX35101

TDC on Wikipedia

An interesting Reciprocal frequency counter with a STM32G4 here