µTasker Forum

µTasker Forum => µTasker general => Topic started by: Oellness on January 20, 2010, 01:11:00 PM

Title: RTC Function without RTC Chip?
Post by: Oellness on January 20, 2010, 01:11:00 PM
Hello,

is in µTasker a Software Function to use as a RTC with Calendar or must i have a external rtc connect to my system?

Thanks a lot?

Best Regards
Volker
Title: Re: RTC Function without RTC Chip?
Post by: mark on January 20, 2010, 04:52:59 PM
Hi Volker

Generally it is preferred to work with a RTC when the time and data needs to be always available - some processors have them integrated and the project also supports the DS1307 via I2C. Such solutions require a battery but have the added advantage that they usually have some battery backed up RAM included too.

Alternatively the time and data can be obtained from the network (when there is a connection) from a time server or SNTP server. Generally this a second (or in the case of SNTP also fraction of a second) value relative to a certain point in time and then the seconds can be counted locally using a simple second timer. To convert to data and time requires further manipulation which is not included in the project - the time of day is very simple but the date requires Gregorian calendar conversion - which is a bit more complicated but also not that bad because leap years until the end of the present century are easy to work with. Probably this code is available on the Internet - check http://www.epochconverter.com/ and search for Gregorian calendar SW.

Regards

Mark

PS. Note that SNMP is included in the project (in application.c) but only completely for the SAM7X. This is because it requires a high resolution local clock to allow it to accurately synchronise. This part is very HW specific and so is not generic as the actual communication with the server is.