2016-09-14 10:08 AM
Dear Gents,
I am using a STM32L476VG for my application. The RTC can be powered by Vbat provided by an external battery in case that VDD drops off. In this mode, when the MCU is powered by Vbat, only the RTC works, keeping track of time. Is there any way to detect if Vbat is going to drop under the needed voltage with the RTC? #rtc #stm32l4 #time2016-09-14 10:36 AM
Check the reference manual section on the A/D converter. There is an internal ADC channel connected to VBAT through a 1/3 divider (VBAT may be higher than VREF). You can sample the pin voltage to determine the state of the battery. If you use the internal VBAT charger make sure it's off.
Jack Peacock
2016-09-15 04:28 AM
Hi mejrissi.chiheb,
As mentioned in the STM32L4x6 reference manual, in page 500, part “16.3.32 Vbat supply monitoring�:The VBAT monitoring channel (VBAT/3) is connected to ADC1_IN18 and ADC3_IN18. The CH18_SEL bit bit in the ADCx_CCR must be set to enable the conversion of internal channels ADC1_IN18 and ADC3_IN18 (VBAT/3). Th measured value is Vbat/3
-Hannibal-
2016-09-15 07:30 AM
2016-09-16 08:32 AM
Hi mejrissi.chiheb,
When you want to check the Vbat volatege or there is a drop, you should this measuring or monitoring of voltage in Run mode-Hannibal-2016-11-21 09:12 AM
Hi,
I'm working on a project using the STM32L476RG microcontroller with IAR IDE . In my project , I shall use the RTC peripheral in order to get accurate time value.Here I have two questions to ask :1- If the voltage that supplies the RTC goes down ( run out of battery for example ) and then we power on the RTC , the time value that we get is re-initialized from zero ? Or we get the last time value from where we did stop ?2- When I leave my board running for too long ( 24hours for example ) and after that I went to check the RTC time value I find a gap of 10seconds between my desktop time and the RTC time . So, the question here , why I do get this gap ? I shall not forget to mention that I have modified values of these parameters ( RTC_ASYNCH_PREDIV and RTC_SYNCH_PREDIV ) in order to remove the gap but in vain.can someone clarify these issues for me , maybe I'm missing something.Thanks2016-11-21 10:53 PM
Please don't hijack threads, start your own.
JW