any body has implemented clock calender.
Clock calendar implementation on RTC
(152 posts) (17 voices)-
Posted 4 years ago #
-
not that I know of. are you working on such a thing? are you using the RTC pins or a separate i2c device or something?
Posted 4 years ago # -
i am using internal RTC of STM32. trying to implement with RTC backup register using STM applicatin note "Clock_calendar implementation on RTC AN2821".
Posted 4 years ago # -
Hello,
I just got myself an Olimexino (with the 32,768 kHz crystal onboard) and I was planning to write and RTC library to start using the "Maple" board.
Need some help with this?
Posted 4 years ago # -
I haven't ran this through the processor, but apparently you can use time.h to convert the timestamp. :) Yeay :)
Posted 4 years ago # -
I have just finished a libmaple driver for the STM32F1 on board RTC peripheral modeled closely on Marti's new timer.c code (not as clever, but very similar structures). Its 'series F1' only at the moment. My focus is low power, so I needed the RTC to wake up from deep sleep. It just supports the native peripheral, so the 32 bit timer and alarm registers. It would need something to convert to day/date to use it as a calendar (time.h you say?) but it handles all the interrupts/alarm event and stuff. Doesn't use the backup registers. There is an example as well.
It does all three clock sources. HSE/128 could give an accurate time on Maple Mini. The test case uses LSI.
How does one go about contributing source to the Leaf cause?
Posted 4 years ago # -
Tested the time.h yesterday and it works as it would anywhere else.
Haven't picked up on the RTC yet. Too busy at work.
I wouldn't mind testing yours though. I have a board with the 32kHz crystal in it already.
Did you implement the possibility to attach functions on the alarm and seconds interrupts?
Posted 4 years ago # -
Yes. It all works as you would expect...
rtc_init(RTCSEL_LSI);
rtc_set_prescaler_load(0x7fff);
rtc_set_count(0);rtc_attach_interrupt(RTC_SECONDS_INTERRUPT, rtc_glob_intr);
rtc_attach_interrupt(RTC_ALARM_GLOBAL_INTERRUPT, rtc_glob_intr);
rtc_attach_interrupt(RTC_ALARM_SPECIFIC_INTERRUPT, rtc_spec_alm_intr);I would love to have you test it.
Maybe I'll futz with a github repository today with changed files from 0.0.12 libmaple...
I haven't seen an 'official' suggestion for sharing code yet.
Posted 4 years ago # -
Rod,
patches are always welcome! Sorry for the belated reference: http://leaflabs.com/docs/libmaple/contributing.html#libmaple-contributingThe new stm32 line has an RTC oscillator baked right in, so RTC is definitely on our radar for libmaple.
Posted 4 years ago # -
Bit of a learning curve there, but you have a pull request...
Thanks for the reference. Missed that.
bubulindo you are welcome to clone rodgilchrist/libmaple on github for a copy to test.
poslathian what happens next to the code I submitted? I'm just curious about how to move my local repository forward beyond 0.0.12 as I am very interested in the F4 (and L1 in particular) work in progress. I have projects using both that I'd like to move forward with.
Posted 4 years ago # -
BTW, not sure how to integrate the test program into the IDE examples. I just assumed dropping it into the example directory would do it.
I'm using command line development myself (which I love how LeafLabs has set up, BTW).
Posted 4 years ago # -
In the MapleIDE folder, where all your sketches are stored, create a folder named libraries and put your library there.
Posted 4 years ago # -
I looked around github and didn't find any files regarding the RTC. Can you post a link to them?
Posted 4 years ago # -
Ok. That's interesting about sketches. I was trying to file my example test program in the libmaple source, though, so I just dropped it in libmaple/examples. I think that will work.
On github search for for 'rodgilchrist' which will lead you to my repositories. You want release e23ece8. There is a
download link there.Github is pretty cool. I haven't used it before.
The full url is:
https://github.com/rodgilchrist/libmaple/commit/e23ece87e60772a7785ef5c84207917e81680282Posted 4 years ago # -
Found it.
I'll download it and test it today. Maybe leave it running over night to see if it fails.
I might create a .cpp wrapper to hide most of the stuff and make it "easier" to use.
Good work. I'll post the feedback here.
Posted 4 years ago #
Reply »
You must log in to post.