What is the frequency reference for the Linux clock, what crystal and oscillator is the source for the system clock on the NGW100 board?
i.e "date" command
The OSC0 is by default used to feed the PLL0. The date command reads the system time, which is clocked by the main CPU clock.
If you need more accurate time, use the rtc driver and hwclock application. Or if you have network, use ntpd.
We have an application sampling acoustic from TI ADS1274 ADC and storing to SD card. The files are named by date stamps from the system clock.
We observed that both the system clock and sample rate seems to lag some ppm (48 kHz became 47.995) and the system clock had a similar error.
When the NGW kit has an internet connection the system clock seems to be initilaized and corrected for the lag, so the file time stamps got out of sync compared to the sampling process.
This is not a big problem and without internet (NTP) sync the sample clock and time stamp stem from the same source which is good.
We have an RTC connected over the TWI bus. Is it possible to configure the system so everything that has to do with time will always be read directly from the RTC (and skipping the system time)?
Or is there a way to manually trim the system clock? I have seen discussions about adjtimex command but belive it is not available in busybox on the NGW100.
Our case now is that the file names (time stamps) should correspond to the actual UTC time as close as possible, but the equipment is offline when in use.
NGW100 include software and config that starts ntpdate and ntpd that syncronize the system clock to NTP servers. It is run from the scripts in /etc/init.d
Some observations that may be of interest (if you have system clock drift):
Booting NGW100 with internet access: The system clock is accurate compared to ie GPS
Booting NGW100 with internet access, but removing the Ethernet cable after two days, observing two following days when offline: system clock is accurate
Booting NGW100 without internet access: the system clock is drifting (probably free running from the main oscillator).
Question is why the system clock runs accurate offline for two days after the internet contact, but it will not run accurate if booted offline.
In both cases ntpd runs and seems to create statistics in files (loopstat and peerstat).
© 2020 Microchip Technology Inc.