cancel
Showing results for 
Search instead for 
Did you mean: 

Tamper Pin Output for RTC

gizemtabak7
Associate II
Posted on July 25, 2013 at 14:15

I am using STM32VLDISCOVERY board (with STM32F100RB) to develop a basic real time clock application. Since I do not have a 32kHz crystal for now, I am using LSI clock instead of LSE.

When I debug the code, I can see RTC counter increments by 1 in each 1 sec, which means it should be working fine but when I try to get tamper pin output of RTC with the code below*, I get a square wave with 652Hz frequency instead of ~511Hz.

*Code:

BKP_TamperPinCmd(DISABLE);

BKP_RTCOutputConfig(BKP_RTCOutputsource_CalibClock);

(By the way,  to get a proper 1 second time, I set prescalar value to 41942 but the frequency of the output from tamper pin does not change even if I make the prescaler value 32767.)

#rtc-tamper-pin-output-signal #rtc
1 REPLY 1
Posted on July 25, 2013 at 16:49

I don't think the pin output has anything to do with the prescaler, it's surely the raw clock source divided down by 64, not 32768 or whatever.

Yes, the LSI is in the order of 40 KHz (37?), and it's not particularly stable either.

The connection of the clock on the tamper pin suggest it's RTC_CLOCK, but I don't see a diagram, it could conceivably be just LSI, but you'd want to check you have the correct RTC source selected.

On the F2/F4 designs is easier to benchmark the LSI/LSE directly against the HSE, which gives you good measurements based on the accuracy of the crystal/source being used there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..