Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4476

General discussion • Use RPi to measure crystal deviation

$
0
0
I am building a small MCU controlled clock. The MCU uses a 32.768 crystal for timing. I use RPi Zero 2W to temporarily connect to the MCU and set time. When setting the time I would also like to measure the crystal deviation from ideal value. Is it possible to do it on the RPi without external HW? So far I have the program written in Python and I would like to keep it.

I did consider MCU sending a square wave and RPi measuring its frequency. Is there a way to precisely capture time of an edge?
Another option for RPi to send a precise square wave and the MCU to measure it and compare to its own clock - is there a way for RPi to send precise frequency?

I would like to get to 1 ppm precision on the RPi side. If the precision is within 1 ms (which should be possible using NTP?) I need 1000 seconds ~ 1/4 of hour which is reasonable time. But I don't know if it is possible to guarantee the timestamp of an edge is not delayed by some other process interrupting Python.

(Of course another option is to use GPS/DS3231 pps signal as the time reference for the MCU but I would like to avoid this.)

Statistics: Posted by Smajdalf — Wed Jun 12, 2024 9:23 am — Replies 0 — Views 19



Viewing all articles
Browse latest Browse all 4476

Trending Articles