2015-01-01 12:39 AM
Hello, hapy 2015 to all.
I try to use an external LSE for RTC a STM32F4DISCOVERY . I follow indication of clive1 on this post: https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a%2f%2fmy.st.com%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Discovery%2fUsing%20LSE%20for%20RTC%20on%20a%20STM32F4DISCOVERY%20board&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EA... Component i used are: http://it.farnell.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=15001&langId=-4&urlRequestType=Base&partNumber=2101354&storeId=10165 http://it.farnell.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=15001&langId=-4&urlRequestType=Base&partNumber=2332630&storeId=10165 Problem is that the RTC_Config function is nont able to get the LSE ready and don't retriev correct flag SET. /* Wait till LSE is ready */ while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET) {} I checked connection and they sems ok. Anyone have suggestion to sort out ? what can i do? Regards, Carmelo2015-01-01 06:04 AM
Just to check - did you remove the two solder bridges ?
Cheers, Hal2015-01-01 09:09 AM
Anyone have suggestion to sort out ? what can i do?
I guess you've got to identify what you've done wrong and fix that? Start with the circuitry and the components. Make sure you've made ALL the required changes, that the parts are correctly orientated, and of the correct values. Look at the software, I can't see anything you're doing./* Enable the PWR clock */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
/* Allow access to RTC */
PWR_BackupAccessCmd(ENABLE);
/* Enable the LSE OSC */
RCC_LSEConfig(RCC_LSE_ON);
/* Wait till LSE is ready */
while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET);
Look at the signal with a scope. First see if you can observe anything directly. Second observe indirectly by outputting the LSE signal out via MCO (PA8) pin and measuring that.
These are the one's ST uses on the DISCO boards (when populated), along with 6.8pF capacitors.
2015-01-01 11:36 AM
Hello.
Yes i removed the soldier sb15,sb16. This is my code: if (1){//(RTC_ReadBackupRegister(RTC_BKP_DR0) != 0xA5A5) { /* Enable the PWR clock */ RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); /* Allow access to RTC */ PWR_BackupAccessCmd(ENABLE); #if defined (RTC_CLOCK_SOURCE_LSE) /* Enable the Low Speed External (LSE) clock */ RCC_LSEConfig(RCC_LSE_ON); /* Wait till LSE is ready */ while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET) {} /* Select the RTC Clock Source */ RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE); /* ck_spre(1Hz) = RTCCLK(LSE) / (uwAsynchPrediv + 1) * (uwSynchPrediv + 1) */ uwSynchPrediv = 0xFF; uwAsynchPrediv = 0x7F; #elif defined (RTC_CLOCK_SOURCE_LSI) Thanks clive1. I'll do extended analisys.2015-01-05 02:27 AM
Try to start the LSE by manually manipulating/reading back register bits in the debugger.
JW