Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • dundakitty's Avatar
    Today, 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...
    15 replies | 342 view(s)
  • dundakitty's Avatar
    Today, 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...
    15 replies | 342 view(s)
  • dundakitty's Avatar
    Yesterday, 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 &...
    15 replies | 342 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...
    15 replies | 342 view(s)
  • dundakitty's Avatar
    03-28-2023, 08:43 PM
    The code I submitted works for either Teensy 4 or Teensy 3, controlled by a "#define TEENSY4" if you want Teensy 4. Here's the readRTCFrac() code for only Teensy 4: #include <imxrt.h> ...
    15 replies | 342 view(s)
  • dundakitty's Avatar
    03-28-2023, 01:00 PM
    Paul posted this code: extern "C" int _gettimeofday(struct timeval *tv, void *ignore) { uint32_t hi1 = SNVS_HPRTCMR; uint32_t lo1 = SNVS_HPRTCLR; while (1) { uint32_t hi2 = SNVS_HPRTCMR; // ref manual...
    15 replies | 342 view(s)
  • dundakitty's Avatar
    02-15-2023, 11:26 AM
    I've had success using a 0.5F capacitor tied to VBAT. I charge the capacitor using a schottky diode tied to the Teensy's 3.3v pin. The capacitor keeps the RTC running for over a day without power. I've not tried a...
    9 replies | 361 view(s)
No More Results
About dundakitty

Basic Information

Statistics


Total Posts
Total Posts
66
Posts Per Day
0.03
Last Post
Teensy 4.1 - NTP/PTP/RTC Today 05:23 PM
General Information
Last Activity
Today 05:23 PM
Join Date
12-17-2016