Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • dundakitty's Avatar
    04-02-2023, 12:33 PM
    Here's the problem: const long SECS_PER_TICK32 = pow(10, 12) / pow(2, 32); const long SECS_PER_TICK15 = pow(10, 12) / pow(2, 15); ... ntp_fracPicos = fracSecs * SECS_PER_TICK32; ... int rtc_fracMicros...
    22 replies | 852 view(s)
  • dundakitty's Avatar
    04-01-2023, 01:11 PM
    The NTP packet does not include fractional time in nanoseconds. The 32-bit field for fractional time is in the full 32-bits. It counts from 0 - 4294967295, or about 233 picoseconds per tick. Dividing the fractional...
    22 replies | 852 view(s)
  • dundakitty's Avatar
    03-31-2023, 05:23 PM
    NTPv3 and below use 32-bit seconds and 32-bit fractional seconds. NTPv4 use 64-bit seconds and 64-bit fractional seconds. The Teensy 4 RTC has a 64-bit counter incremented 32768 times a second. If you take the...
    22 replies | 852 view(s)
  • dundakitty's Avatar
    03-31-2023, 11:12 AM
    The SNVS_HPRTCMR and SNVS_HPRTCLR registers together form a 64-bit counter incrementing 32768 times a second, asynchronously from the CPU clock. The lower 15 bits are returned in the readRTCfrac() call, which will...
    22 replies | 852 view(s)
  • dundakitty's Avatar
    03-30-2023, 11:09 AM
    Try this for your loop() void loop() { delay(1000); uint64_t tmi = rtc_get_64(); // Convert the time value to seconds uint64_t time_seconds = tmi >> 15; uint64_t time_microseconds = ((tmi &...
    22 replies | 852 view(s)
  • dundakitty's Avatar
    03-29-2023, 11:26 AM
    I suggest you read through https://forum.pjrc.com/threads/61665-RTC-Registers-and-Millisecond-Precision-from-Teensy-4-0 Turns out the SNVS_HPRTCMR and SNVS_HPRTCLR together form a 64-bit counter incrementing 32768...
    22 replies | 852 view(s)
No More Results
About dundakitty

Basic Information

Statistics


Total Posts
Total Posts
68
Posts Per Day
0.03
Last Post
Teensy 4.1 - NTP/PTP/RTC 04-02-2023 12:33 PM
General Information
Last Activity
04-02-2023 12:33 PM
Join Date
12-17-2016