2014-05-06 07:31 AM
hello,
I am in the
development of a new
application with a
STM32F051R8
.I have a big
problem with
the accuracy of the
RTC:
I
used both
the
quartz
advocate
in the
note
AN2867
application.
I initialize
the
RTC
well
with clock
LSE
I
check
the integrity
of the signal
source
to the oscilloscope
, however
I see
some
burst
even
changing
repeatedly
torque
quartz
/
capacitor
I have
the same problem
on the prototype board
made
for our
machine
on the
evaluation board
is
why I
excluded
a problem of
PCB
design
After
24 hours
I
observed
a
deviation
which varies
from 60 to
90 seconds
.This deviation
is even more important
if I use
the
timer
2
to generate an interrupt
every
0.1
ms
.I do not see
what can
interfere with
the oscillation of the
quartz
or registers
of the
RTC
, didyou
meet with a
similar case
?Thank you
for your help.
2014-05-06 07:47 AM
Hi
''I initialize
the
RTC
well
with clock
LSE
I
check
the integrity
of the signal
source
to the oscilloscope
'' The capacitance of the scope probe may affect the Xtal oscillations. If the device has the functionality - get he device to output the LSE on an IO pin and check that with the scope. ''After
24 hours
I
observed
a
deviation
which varies
from 60 to
90 seconds
. '' That is an enormous error! The last time I worked on a RTC - I got around 1 second/month error before correction. I think something else must be wrong.2014-05-06 07:54 AM
Observe the LSE indirectly, either via the MCO (PA8) pin, or measure the period via one of the TIM with the LSE clock routed to it. I'd have to check the manual as to which TIM that is.
The loading of the crystal will change it's performance, also the STM32 expects 6-7pF crystals, so make sure you are not using 9 or 12pF ones.2014-05-06 08:15 AM
thanks for your reply :)
yes ocscilloscope is a bad thing to measure signal, it s just for check the frequency, but level is bas, sure. I use 6,8 pf +/- 0.25 pf , perhaps i buy in other distributorbecause
there
may
be an error
... Before i'm used DS1340, very good RTC IC with best accuracy. For me is the first use of RTC in STM32 ________________ Attachments : scope_4.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0qu&d=%2Fa%2F0X0000000bfE%2FYyNh4SF6So1vE3BMZFAHCbcEWG3sum9sXQOrIwPXSGM&asPdf=false2014-05-06 08:25 AM
Check what prescaler you are using for the LSE, the LSI is around 40 KHz
Observe LSE via MCO pin RM0091, search on ''Clock-out capability'', and ''Internal/external clock measurement with TIM14''2014-05-06 08:40 AM
2014-05-06 08:41 AM
i rewrite the code for tomorrow, i'm post result soon as possible
thanks2014-05-09 01:18 AM
I give you
somenews about
the problem of
stability
:First
I rewrite
my code for
just use
the
RTC
péripheralto
make sure
there
was
no
interference
with other peripheral.I activated
the
512
HZ
output
to measure the
signal
:I bought
high-precision
6.2
Pf
capacitors,
the
measured frequency
was 404
Hz:
even worse than before
.Capacitors
with
6.8
pf
I have
a frequency of
520
Hz
...
In any
case
the
two
signal
asvery
unstable.
I said that
I use
quartz
with
capacity of 6
Pf
as recommended by
ST.
And
I
test
the 12
pf,
and:Very stable and good frequency.
In conclusion
:no
software
problem
but I
'll orderthe exact reference of
quartz
in BOM ofdiscovery
noard, and Iredo the
test.
I
keep you informed
. Sorry for my english.2014-05-26 11:33 PM
finally to close the post,
and after much
trial
, the best accuracy was found whith 12 pf quartz and 12 pf capacitor. thanks.