2013-03-17 07:31 AM
Hi
I'm just wondering why the LSI on the STM32F4 Discovery board has inaccuracy's, I've searched the internet and application notes but can't seem to find the answer? My seconds on LCD jumps several times between 0-60, the time also counts up to 100 on seconds and what look likes 999 on mins and hours even though I've set 24 hour format as below: RTC_InitStruct.RTC_HourFormat = RTC_HourFormat_24;Any help appreciated. #lsi-rtc2013-03-17 07:43 AM
It uses an RC (resistor capacitor) network fabricated in polysilicon and metal layers on the die. It is effected by voltage, temperature, and fabrication process variations. ie as the values of V, T, R and C change, so does the frequency.
It also consumes more power, and it's speed will change as voltage drops and thresholds change, it is not usable to clock the RTC via battery in standby. Your issues with the minutes or seconds exceeding 0-59 sound more like coding errors, than subtle frequency anomalies with the LSI.2013-03-17 09:08 AM
Ok, thanks for info Clive, I'm hoping to change to LSE soon as I can I just need to get the required components as the device will hopefully be mobile at its final stage. I've just noticed using the software debugger the time (seconds) does count from 0-60 but the LCD display jumps values but changes 60 times as the debugger value changes. I'm just using the RTC_GetTime function, sprintf and then display to LCD??
RTC_GetTime(RTC_Format_BCD, &RTC_TimeStruct); sprintf((char*)time_display,''Time = %0.2d:%0.2d:%0.2d'', RTC_TimeStruct.RTC_Hours, RTC_TimeStruct.RTC_Minutes,RTC_TimeStruct.RTC_Seconds); LCD_DisplayStringLine(LINE(8),0,(unsigned char*)time_display);2013-03-17 09:32 AM
BCD is more akin to hexadecimal than decimal, ie 0x59 -> 89, so use %02X
If you want decimal 0..59 perhaps BIN format would be a better choice?2013-03-17 10:01 AM