TOP Contributors

  1. MIKROE (2658 codes)
  2. Alcides Ramos (355 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136935 times)
  2. FAT32 Library (70058 times)
  3. Network Ethernet Library (56013 times)
  4. USB Device Library (46328 times)
  5. Network WiFi Library (41936 times)
  6. FT800 Library (41261 times)
  7. GSM click (29046 times)
  8. mikroSDK (26454 times)
  9. PID Library (26435 times)
  10. microSD click (25391 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

STM32F1 series RTC

Rating:

5

Author: him sha

Last Updated: 2014-08-08

Package Version: 1.0.0.0

Category: Communication

Downloaded: 1490 times

Not followed.

License: MIT license  

Hi guys,
Below is the STM32F1xx series code example for RTC date/time write and read operation.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "STM32F1 series RTC" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "STM32F1 series RTC" changes.

Do you want to report abuse regarding "STM32F1 series RTC".

  • Information
  • Comments (4)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Library Blog

//Main source file contain below functions

#include "Main.h"

void rtc_second_interrupt() iv IVT_INT_RTC_WKUP ics ICS_AUTO {
  SECF_bit = 0;
  redrawtime = 1; // time has changed,
}

void main(void){

     //Initialize STM32F10x internal RTC
     vRTC_Init();
     //Set date and time    
     vRTC_SetDate(2,4,14);//(Day, Month, Year)
     vRTC_SetTime(12,11,0);//(Hour, Minute, Second)

     while (1){          
       //Read Date and Time    
           ucDay= ucRTC_GetDay();
       ucMonth= ucRTC_GetMonth();
       uiYear= uiRTC_GetYear();
       ucHour=ucRTC_GetHour();
       ucMinute=ucRTC_GetMinute();
       ucSecond=ucRTC_GetSecond();

       //Further display function
     }
}


/*******************************************************************************
* Function Name          : Get RTC Counter Value
* Description            : To Read RTC_CNTL value from RTC
* Input                  : None
* Output                 : Hour, Minute, Second
* Return                 : Time Values read from RTC
* Written By             : Himanshu
* Date                   : April 1, 2014
*********************************************************************************/
unsigned int RTC_Counter_Value(void){
     if (redrawtime == 1){
        uiRTC_Counter_Value = RTC_CNTL;
        redrawtime = 0; // new time has rewritten on TFT
     }
     return (uiRTC_Counter_Value);
}

RELATED CODES

Webserver - Full Featured

5

Example of what can be done with the Ethernet library. Server serves both dynamic / static content, retrieves time from NTP servers, downloads files from remote servers. Requires: Ethernet Library, FAT32 Library, Standard Bool Library

[Learn More]

X10 Transmit/Receive Demo Program

5

This program Reads X10 Codes from PSC05 PowerLine Interface and Displays House Code, Channel and Device ON/OFF on 2X16 Character Display. It also can Transmit X10 Data to PSC05 or PCS04 PowerLine Interface. Example written for P16F887. Most MCU's should work. Enjoy.

[Learn More]

I2C_Addres_Scanner

0

Using a raspberry pi pico(RP2040) and lcd2x16 we can build an address scanner for i2c devices

[Learn More]