RTC subseconds issue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-06-16 6:25 AM
Posted on June 16, 2014 at 15:25
Hi,
I am working on STM32F303VCT6.The source clock is a cristal of 32.768Khz.I need to have a time resolution on the RTC of 1ms. So I have arranged the prescalers as follow:SynchPrediv = 0x3E7; AsynchPrediv = 0x21;My idea is to have a frequency on the second counter (Synchronous prescaler) of about 1khz. Doing this I should have the possibility to have a value on the RTC_SS register from 0 to 999, that means 1ms for each steps.the time in msec = (Prediv_Sync - SS)/(Prediv_Sync + 1) (Ref. Manual pag.643)If I put a function GetSubseconds() inside an external interrupt routine ( external pin ) that is connected to an external source ( 100hz) I should have a difference of the two value read by the function GetSubseconds() of about 10. Am I right?( I am sure that the time intervall between the two consequenzial GetSubseconds() function call is really 10ms, because I have put a logic toggle on a pin and show it on my oscilloscope)Instead I read about 3, 4 steps...The RTC works fine, If I try to read the time each 1sec, the time is correct, 1sec of increment...I don't understand
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-06-16 7:01 AM
Posted on June 16, 2014 at 16:01
Solved!!
RTC registers were not updated correctlythk