Jump to content
43oh

[Energia Library] Simple CC3200 RTC emulation library (ccRTC)


Recommended Posts

Hi,

 

I've made a very simple RTC library using the RTC method in the PRCM library.

 

It is intended for the CC3200 Launchpad and has only been tested on the CC3200 Launchpad so far.

 

Overview:

  • Uses the PRCM library
  • It follows UNIX Time
  • It was made with the "Time" library of the Sparkcore in mind.
  • It has the following methods:
    • ccRTC.zone()
    • ccRTC.now()
    • ccRTC.year()
    • ccRTC.month()
    • ccRTC.day()
    • ccRTC.weekday()
    • ccRTC.hour()
    • ccRTC.minute()
    • ** ccRTC.begin()

Limitations: (Unfortunately there are a few actual limitations)

  • It is accurate to only about 4 seconds an hour. (That is pretty bad, but can it can be used for non time critical applications if time is synced with an online server regularly)
  • My tests haven't shown any issues so far, but it is not foolproof yet.
  • If you're using an NTP server to sync time, then you'll need to convert it to UNIX time first before you use the ccRTC.setTime()

 

You can get the code and a basic guide from here : https://github.com/nitred/ccRTC

Additional Documentation for the the functionality can be found here : http://docs.spark.io/firmware/#libraries-timeIt

 

Its a work in progress and I know for a fact that there's a better way to do it than this but I really needed this library and I hope you find it helpful too. Any and all feedback and improvements are welcome!

 

Link to post
Share on other sites

Is the API compatible with that of some other RTC libraries?  If not, might think about making it more similar.

I do not know of a particular API that is defacto standard in Arduino circles, or in Energia.  But there are already 

a few Energia RTC libraries, and I am sure there are several for Arduino as well.  Would be nice to have things work across multiple devices.

 

e.g.

http://forum.43oh.com/topic/5421-energia-library-rtc-a/

 

http://forum.stellarisiti.com/topic/2026-calendar-mode-with-tm4c1294/

Link to post
Share on other sites

I don't think the API is fully compatible with other Libraries or Arduino's. I think I'll slowly work towards it.

 

At the moment however I'm not sure there's libraries that will work with the CC3200 Launchpad so I was just filling the space, since I needed an RTC Library for myself. I'm more than happy to deprecate this one if a better library comes up.

 

Thanks for the direction igor.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...