After a long time search in the forum it seems that the I can not use the RTC with the internal LS for time keeping?
Was this already fixed or is really a limitation of the controller?
Would like to implement the option of have a track of the time even when in sleep or power down mode.
The board(custom) I have the pin 1 is connected to a battery already.
Thanks in advance.
Tim
you could get cheap crystals on ebay, aliexpress, but get the better ones otherwise you may find your rtc drifting quite a bit.
and if i assume that you are using stm32f103 libmaple core the normal way is to power the VBAT on a coin cell
setup the RTC to run, set the time correctly
you could follow the examples in the library.
after that if you remove power (leaving VBAT connected) and when you power up the board again the time should be correct against a wall clock time
Sorry for not clarify this I use the stm32f103CBT6 and the maple core toke from Roger git page.
The only problem now is that the board does not have space for upgrades and did not left the xtal pins longer for connections.
Internally is not possible at all?!
Thanks,
Tim
Have been reading the datasheet of the stm32f103 and it talks about an external high speed oscillator for RTC divided by 128.
Is this the 8MHz xtral used for clock the datasheet is refered?
Is it possible to use this crystal as the RTC clock instead of an 32,867KHz aplied to RTC pins?
Really need a solution for my problem that does not passes to build another pcb ![]()
Thanks.
All the best
Tim
a ‘cheap’ solution, the $2 bluepill has an on board 32k crystal! you’d only need to power vbat
http://wiki.stm32duino.com/index.php?title=Blue_Pill
for my maple mini, i simply solder a cheap 32k crystal at PC14, PC15
http://wiki.stm32duino.com/index.php?title=Maple_Mini
i didn’t bother with caps and wrote some codes that adjust for drifts
viewtopic.php?f=18&t=4365
viewtopic.php?f=3&t=658
you could keep VDD powered for trickle currents, but low power is ‘tricky’
I decided to move to a new board as it is the only approach I can be confidence it will work.
Now, to keep the parts small and use the minimum board space as replace a 8MHz xtal with 2 xtals 1 of 8MHz and 1 of 32.768kHz the idea is to use a resonator of 8MHz and a normal crystal with 2 caps for the RTC.
Any advise on this subject is well come.
The low power is also a target to me but could not understand yet all the implementations in the post:
viewtopic.php?f=3&t=658
my design will use a reed switch to start the acquisition (gives power to the vdd).
Thanks for your inputs.
All the best,
Tim
but there are a lot of details to watch for, in terms of implementation it is only a few lines of code
the idea is to switch into standby mode and when it is woken up (say via a pin or via rtc) simply reboot/reset
that would look like the board is just powered up, details are discussed in that thread
i’d guess using a different board should resolve the problem, but do look out for the details e.g. like the 32k crystals etc
as i’ve not literally designed a board myself, i’d refrain from much comments about it
When you say it is just some lines of code can you give an example?
Is it possible to wake up from an timer interrupt?
I would like my system works like:
turns on,
start acquire values and put then in a buffer, here I use interrupt to keep a fixed sample rate, already working.
transfer buffer to an external flash memory, already implemented.
when the memory is complete I send the device to sleep, here is also ok
but then every 10 seconds or so I would like to blink an led just to know it is complete and send to sleep again, could not perform this last step…
Any idea is more then welcome!
Tim
For the new board I used the stm32 appnote, it will work ![]()
viewtopic.php?f=3&t=658&p=51756#p51756
Thanks for the reply will follow the low power thread…
This can be marked as resolved as it has not possible to use this function.
All the best,
Tim


