RTC Real Time Clock
Last updated
Last updated
Free Wili includes a real time clock powered by the MCP7940N IC. The real time clock is used by the file system to timestamp files. The RTC also can be accessed by wasm for custom scripts such as logging files or doing tasks on alarms.
The RTC time is shown on the main screen. Also from the about app there is a RTC view.
The about app will display the current RTC. The current time is shown as well as the time Free Wil-i started.
The RTC is currently set from the main USB serial interface (this will be supported in both CPUs in the future).
The settings include a trim setting. This setting is loaded into the MCP7940N Trim (OSCTRIM) register. Please see the data sheet below for an explanation of this value.
The API supports querying and setting the RTC. The setRTC allows you to set the current time. The getRTC causes the RTC to be read and provided via an event.
The MCP7940N IC is used to implement the RTC. The data sheet is below. The RTC is always powered from the Lithium ION battery. When Free Wili shuts down the battery will continue to supply power (about 1 micro amp) to the RTC until the battery is physically exhausted. At that point the RTC value will be lost.