I'm using a teensy 4.1 for synchronizing and time-stamping of sensors, as such consistency of the timestamping is important.
I bought an RV3028 RTC (1ppm, https://shop.pimoroni.com/products/rv3028-real-time-clock-rtc-breakout?variant=27926940549203) with the goal of more accurate timestamping, without realizing it provides stamp down to the second. My output signals will be something on the order of 20-200 Hz, therefore timestamp precision in the order of sub- to 1-millisecond precision is necessary. How should I solve this problem?
One potential solution I can think of is using the 32.768 kHz clkout signal to increment a counter and use this to augment the stamping. This approach should have a resolution of 0.030517578 ms, but I'm worried that it might be taxing for the system to have to read and increment a variable at this rate. Of course I could use a lower clkout signal rate (e.g. 8192 Hz -> 0.122070313 ms resolution) but this also seems like an imperfect solution for the same reasons
Is it possible to synchronize the `millis` on the teensy with the RTC? Is there a better approach which I'm not considering?
I bought an RV3028 RTC (1ppm, https://shop.pimoroni.com/products/rv3028-real-time-clock-rtc-breakout?variant=27926940549203) with the goal of more accurate timestamping, without realizing it provides stamp down to the second. My output signals will be something on the order of 20-200 Hz, therefore timestamp precision in the order of sub- to 1-millisecond precision is necessary. How should I solve this problem?
One potential solution I can think of is using the 32.768 kHz clkout signal to increment a counter and use this to augment the stamping. This approach should have a resolution of 0.030517578 ms, but I'm worried that it might be taxing for the system to have to read and increment a variable at this rate. Of course I could use a lower clkout signal rate (e.g. 8192 Hz -> 0.122070313 ms resolution) but this also seems like an imperfect solution for the same reasons
Is it possible to synchronize the `millis` on the teensy with the RTC? Is there a better approach which I'm not considering?