TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (382 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139708 times)
  2. FAT32 Library (72098 times)
  3. Network Ethernet Library (57318 times)
  4. USB Device Library (47663 times)
  5. Network WiFi Library (43286 times)
  6. FT800 Library (42618 times)
  7. GSM click (29958 times)
  8. mikroSDK (28370 times)
  9. PID Library (26977 times)
  10. microSD click (26360 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: 1518 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

EnOcean Click + EnOcean 2 Click Fritzing Parts

0

Contains both Click-boards - EnOcean Click - EnOcean 2 Click as Parts for the Fritzing PCB Layout Editor.

[Learn More]

JoyStick to USB

0

The purpose of this project is to provide an interface between an “old” analog joystick (in this case a joystick from Quickshot with 2 buttons and an X and Y positioning), connected via a game port (DB15 connector) and a PC via USB.

[Learn More]

I2C LIBRARY BY HARWDARE NON-BLOCKING

0

I2C LIBRARY BY HARWDARE NON-BLOCKING Video: https://youtu.be/vwTd0uu6U0E

[Learn More]