TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 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 (136713 times)
  2. FAT32 Library (69924 times)
  3. Network Ethernet Library (55936 times)
  4. USB Device Library (46259 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41149 times)
  7. GSM click (28979 times)
  8. PID Library (26410 times)
  9. mikroSDK (26355 times)
  10. microSD click (25353 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: 1487 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

Infrared Tx Rx Samsung Sharp NEC Sony RC5 RC6 MCE Toshiba JVC IR - EasyPIC7 - PIC12 - MMB18 - MMB33 - ARM - Fusion PIC32

5

Transmit IR on RC2 of EasyPIC7 or Decode IR protocols using 38KHz 3-pin receiver chip on RC0 of EasyPIC7 - also PIC12 IR Tx/Rx and MMB Tx. See C file header text for details. Now Beta PIC32 IRclick too.

[Learn More]

STM32 BH1750 Library

0

STM32 BH1750 Library Video: https://youtu.be/quEk1ARAXdU

[Learn More]

READ XY-MD02 SENSOR, LABVIEW MODBUS RS485

0

SHOWS HOW TO CONNECT VIA MODBUS RS385 TO THE XY-MD02 SENSOR AND LABVIEW Video: https://youtu.be/Rj6jUsCbwRs

[Learn More]