TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 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 (139266 times)
  2. FAT32 Library (71753 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47432 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42408 times)
  7. GSM click (29835 times)
  8. mikroSDK (28101 times)
  9. PID Library (26886 times)
  10. microSD click (26198 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: 1515 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

How To Associate Printf To Serial Port in STM32CubeIDE

0

How To Associate Printf To Serial Port in STM32CubeIDE Video: https://youtu.be/kgEUfcMg8yI

[Learn More]

stm32 uwTick; uses with low speed sensors dht11

0

stm32 uwTick; uses with low speed sensors dht11 Video: https://youtu.be/lklmy5J5Mu8

[Learn More]

Ethernet/Internet Applications for MultiMedia PIC32MX7

0

This is an example of Ethernet communications with Servers and Clients operating simultaneously. Both TCP and UDP protocols are tested. The microcontroller uses the Core Timer to implement a system clock with 1 millisecond resolution. Test programs for the PC are included.

[Learn More]