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 (136925 times)
  2. FAT32 Library (70048 times)
  3. Network Ethernet Library (56012 times)
  4. USB Device Library (46313 times)
  5. Network WiFi Library (41935 times)
  6. FT800 Library (41241 times)
  7. GSM click (29029 times)
  8. PID Library (26435 times)
  9. mikroSDK (26415 times)
  10. microSD click (25390 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: 1488 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

WORKING WITH THE MONEY ACCEPTOR NV10

0

Show hoy WORKING WITH THE MONEY ACCEPTOR NV10 Video: https://youtu.be/wK0VOHq5MfE Subscribe to my youtube channel https://www.youtube.com/channel/UCAEmDP2EkFOVB6JCKJ9iGGw?view_as=subscriber

[Learn More]

Modbus Common Gateway Interface (CGI)

2

This is a modbus CGI which can be used with any Windows web-server. I used Apache 2.2 to develop and test this. It allows you to send requests to a modbus network using HTTP get requests.

[Learn More]

DS18X2X with MikroC AVR

0

This code demonstrates how to use onewire library with DS18x2x devices to extract the 64 bit ROM : 8bit CRC | 48bit SERIAL | 8bit Family and output the results on the UART1 as follows : DS_ROM = xx xx xx xx xx xx xx xx DS_CRC = xx DS_Family = xx --> If 10 --> DS1820 If 28 --> DS18B20 If 22 --> DS1822.

[Learn More]