Cornell University ECE4760
Using LWIP to set the RTC

Pi Pico RP2040

 

Real_time clock (RTC) on RP2040 PicoW
The rp2040 has a RTC in which you can set hours, minutes, seconds, day, month, and year, then read back the current time later. Unfortunately the Pico board clock oscillator is rated at ±30 ppm, or accuracy of 3x10-5. Since there are 86400 seconds/day, this means up to 2.6 sec/day drift. This works out to about 15.8 minutes/year, not very good compared to the accuracy people expect from even $20 wrist watches! The solution is to use Network Time Protocol (NTP) to reset the RTC often, perhaps once or a few times per day. NTP is usually accurate to better than a few tens of milliseconds. The Picow has a WIFI module that can be used to connect to the internet, given a TCP/IP package running on the rp2040.


 


Copyright Cornell University June 24, 2023