RTC GET_Time Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-06-08 9:14 AM
Plese
.
I have some problems with RTC Calendar.
I do not understand how to use it.
You can send me some examples for STM32f407VGTx Discovery. (HAL Library)
With HAL_RTC_SetTime (& hrtc, & sTime, RTC_FORMAT_BCD) I set the time: 05:05:00.
In the While loop, with HAL_RTC_GetTime (& hrtc, & sTime, RTC_FORMAT_BCD)
I would like to retrieve the time and see it increase but it is stopped.(05:05:00).
Thank you
Francesco Di Cecio.
/* Includes ------------------------------------------------------------------*/
#include 'main.h'
#include 'stm32f4xx_hal.h
RTC_HandleTypeDef hrtc;
void SystemClock_Config(void);
void Error_Handler(void);
static void MX_GPIO_Init(void);
static void MX_RTC_Init(void);
uint8_t Hour;
uint8_t Min;
uint8_t Sec;
int main(void)
{
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_RTC_Init();
/* USER CODE BEGIN 2 */
RTC_TimeTypeDef RTC_Time;
while (1)
{
HAL_RTC_GetTime(&hrtc, &RTC_Time, RTC_FORMAT_BCD);
Hour = RTC_Time.Hours;
Min = RTC_Time.Minutes;
Sec = RTC_Time.Seconds;
}
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-06-09 5:57 AM
Hi
Di_Cecio.Francesco
,Have a look to this example under the STM32F4 cube firmware package it may be very helpful:
STM32Cube_FW_F4_V1.0\Projects\STM324xG_EVAL\Examples\RTC\RTC_Calendar
-Nesrine-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-06-15 8:06 AM
Hello @
Di_Cecio.Francesco
,you have to refresh time and date each time ;
while(1)
{ RTC_DateTypeDef sDate; RTC_TimeTypeDef sTime;HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc, &sDate, RTC_FORMAT_BIN);Min=sTime.Minutes;
Hour=sTime.Hours; Sec=sTime.Seconds;}
And check your default clock for RTC, LSE (Low Speed External ) or LSI ( Low Speed Internal,
if you will use LSE, you have to add (weld) extra component on the pcb, Quartz 32,768khz and two 22pf capacitors,
without these
component, the RTC time will always be Paused.
Farouk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-06-15 8:23 AM
Have you read the manual?
And read RM0090, 26.3.6 Reading the calendar.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-07-02 7:27 PM
Hello
Waclawek.Jan
by the way, i want to ask you about this manual, from where did you get this format (*.hlp or *.cnt) ? (like in the screenshot)
all documents that i have are in pdf format!
thanks !!
Farouk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-07-05 4:52 PM
Farouk,
this screenshot is from [STM32Cube_FW_F4_V1.4.0]\Drivers\STM32F4xx_HAL_Driver\STM32F417xx_User_Manual.chm
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-07-09 12:53 AM
Big thanks Jan,
Farouk
