2013-06-28 01:10 AM
MCU: STM32 F207 VG
We try to upgrade a device from STM32 F107 to F207. We are glad to use the ''old'' RTC and to have a simple 32bit counter with a free settable prescaler (our RTC works at 1024Hz). Now the ''new'' RTC is a BCD-coded version, normally working at 1Hz. Is there a simple way, to: - get it back into a simple counter (synchronize to LSE) and - to work without VCC (power over VBAT only)? To take a 32bit counter like TIM2 with external trigger over external pin connection from RTC calibration out seems to be a possibility but is there a smarter way? The reference manual speaks about a possiblity to get the WUKF out to a pin (Output selection in RTC->CR to ''Wakeup output enabled''). Have anyone verified this feature yet? What (unmentioned) precondition must be met to get it working? Or is it a feature with notice ''implemented but not wired''? ;) Thanks a lot!2013-06-28 04:54 AM
Ok, ALARMOUTTYPE of RTC->TAFCR has to be set to get WUKF on PC13.
WUKF has to be cleared by software. So this function cannot generate a square wave signal and it could be programmed in an interrupt service routine. This cannot be done in this case, because interrupts are often disabled for a longer time than the interrupt period time. RTC_CALIB has an undocumented feature, too: The RTC_CALIB out function seems to be defined as (PCNT is the acual prescaler counter value (running cyclic from 0 to PREDIV_A)): if (PCNT<0x20) RTC_CALIB = LOW; else if (PCNT<0x40) RTC_CALIB = HIGH; else if (PCNT<0x60) RTC_CALIB = LOW; else RTC_CALIB = HIGH; This has the effect, that the signal at PC13 looks curios, if PREDIV_A is not 0x3F or 0x7F! If PREDIV_A is less than 0x20 there is a constant LOW signal at PC13 ;)