STM32 RTC Internal How to Use It Using Arduino
Blue Pill STM32 RTC
STM32 RTC - This article will provide you with how Access STM32 RTC Data and display it to Arduino IDE Serial Monitor without reset.
This chip is now beginning to be favored by the Arduino programmers. How not, with the same chip size with Atmega328, the Blue Pill board STM32 chip has several advantages over Atmega328, one of which is the Internal RTC.
STM32 RTC Blue Pill
This is what I like the most, this chip is precisely the STM32F103C8T6 series has an Internal RTC, so this will make simple of the circuit that we will make, just add the clock source, the crystal oscillator.
Previously I have written a tutorial how to access the Internal RTC STM32F103 Blue Pill data, and it worked. But when the power is disconnected from the BLue Pill, the data stored properly is the Hour, Minute and Seconds data, while the Date, Month and Year will reset to 1-1-2000. A little annoying indeed, it turns out that Date, Month and Year data are stored in SRAM.
Date data needs to be saved to the backup register in the STM32F103C8T6 Blue Pill. Our friend from Gorontalo with the name "Zulns" has made the RTC STM32F1 library with data updates to the backup register. So even if the power is disconnected from STM32 or Blue Pill, the Date, Month and Year will not reset. Zulns, thanks for the library!
This article is an improvement article from the STM32F103 Bluepill Internal RTC article How to manage and display RTC data on the Arduino IDE Serial Monitor. The board that I use is BluePill STM32F103. The library that I use is Arduino_Core_STM32. You can download via this link, or click the button below.
ST Link V2 as a STM32F103C8T6 Programmer
To upload the program to stm32f103c8t6, I use ST Link V2 STM32 Programmer. Meanwhile, to see the results through the serial monitor on Arduino IDE, I use FTDI.
Zulns has made very good documentation from the STM32F1 RTC library on github, you can also read the stm32f1_rtc.h library download and the guide here.
PROGRAM FOR ACCESS AND TIME SETTINGS OF RTC INTERNAL STM32F103C8T6
If you feel that your RTC is late in counting of seconds, please do not connect anything to PC14 and PC15 pins.
If the header pin is still soldered on this pin, please remove it. This pin is connected directly to the RTC crystal.
This will disturb the oscillation of the crystal oscillator. Notice in the picture below, I cut on PCB path on pin PC14 and PC15. And now it runs normally.
I hope this can help you in developing STM32 RTC based electronic devices that require RTC. That's all.