2014-06-19 08:40 AM
HI, i want to configure the RTC alarm with LCD, to goal is to display the time in a LCD. I set the LCD and RTC but I do not know commant display the time on the LCD
This is my code to configure the RTC alarm2014-06-19 08:52 AM
Perhaps you can use
http://www.cplusplus.com/reference/cstdio/sprintf/
to compose a string in the format you want, and then print the string to the LCD.2014-06-19 09:16 AM
Thank you , i have a problem with ''
PWR_BackupAccessCmd(ENABLE);'' than keil give me this erreur ''.\TIM_PWM_Output\TIM_PWM_Output.axf: Error: L6218E: Undefined symbol PWR_BackupAccessCmd (referred from main.o).'' i use the stm32f4 discovery library
2014-06-19 09:57 AM
Make sure you have the library file stm32f4xx_pwr.c in your project
2014-06-21 10:21 AM
2014-06-21 01:37 PM
And what Board and LCD are we talking about? Are there no demos/examples for your board using the LCD? STemWin, etc?
STM32F4xx_DSP_StdPeriph_Lib_V1.0.0\Project\STM32F4xx_StdPeriph_Examples\RTC\RTC_StopWatch\main.c/* Get the Curent time */
RTC_GetTime(RTC_Format_BCD, &RTC_TimeStruct);
/* Display the curent time and the sub second on the LCD */
RTC_Time_display(Line2, Black , RTC_Get_Time(Secondfraction , &RTC_TimeStruct));
2014-06-21 03:49 PM
I work with keil ARM bord, i was connected an LCD 16*2 to my stm32f4
2014-06-21 04:43 PM
Ok, and can you output characters and strings to your display?
And can you use sprintf() to create a string to send to the display from the time structure read from the RTC?2014-06-21 06:57 PM
To write in LCD i use this function, but that is no work with RTC
2014-06-21 07:21 PM
Wouldn't something like this suffice?
{
char String[16];
RTC_TimeTypeDef RTC_TimeStruct;
/* Get the Curent time */
RTC_GetTime(RTC_Format_BCD, &RTC_TimeStruct);
sprintf(String,''%02X:%02X:%02X'',
RTC_TimeStruct.RTC_Hours,
RTC_TimeStruct.RTC_Minutes,
RTC_TimeStruct.RTC_Seconds);
LCD_Print(String);
}