Started 7th February 2016
The STM32 board I used has a 32768 Hz crystal to allow operation of the the real time clock. To make use of this it is necessary to connect a 3 V battery to the VB (or VBAT) pin. I used a CR2032 and bearing in mind the warnings , connected it via a BAS 85 Schottky diode.
With the USB power disconnected current was 1.3 μA. Time keeping seems around a second per day.
The sketch below allows reading and setting the clock. With a serial connection, various commands can be used.
Read Time - show the current time
Write Year - set clock year
Write moNth - set clock month
Write Day of month
Write Hour (24 hour format)
- Archive of Arduino sketchbook rtc32 and libraries Simple real time clock (7th February 2016)
I used a lot of freely available software. Credit to the people who wrote it and made it available.
- Serial Command library by Stefan Rado