Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:11 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Colour Maximite RTC update?

Author Message
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5119
Posted: 02:34am 02 Nov 2015
Copy link to clipboard 
Print this post

Probably been covered before. I have a Colour Maximite from Circuit Gizmo, with the built in battery backed RTC. I read somewhere, on boot, the maximite will get the current time and date info from the RTC.

My question is, does TIME$ get its time from the RTC, or from the PIC's own time keeping, which was set when the chip was booted?

The reason I ask is I'm building a workshop siren that will run continuously, would only be rebooted if there was a power outage, and I'm concerned about drift in time if the TIME$ isn't getting its time from the RTC.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 03:23am 02 Nov 2015
Copy link to clipboard 
Print this post

The 1307 RTC is drifty as hell. I'm not sure if that is what is used on the CG boards - it's been a while since I had one.

You CAN replace the 1307 with a DS3232 or DS3231, and it will work. I have done this on my old CMM units a couple of times, and those RTC's are much more accurate long-term.

As to the specifics of your question, my understanding is that the CMM gets the values for TIME$ and DATE$ from the RTC at power-up, but these figures are used to set the internal MMBASIC RTC, so provided you don't cycle power, the MMBASIC RTC should remain quite accurate over a period of several days or weeks.

If you lose power, or cycle power daily, after a few days, you will start to see the drifty nature of the 1307's accuracy.

It's a variation on the Micromite's GETTIME and SETTIME commands, except that the CMM will look for the RTC, and if it finds it, it will automatically update the PIC32's internal RTC with the values from the external RTC.

I may be wrong, but that is how I understood things to work.
Geoff would be the fella to confirm that or not.


Smoke makes things work. When the smoke gets out, it stops!
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 03:24am 02 Nov 2015
Copy link to clipboard 
Print this post

  Gizmo said   My question is, does TIME$ get its time from the RTC, or from the PIC's own time keeping, which was set when the chip was booted?


AFAIK yes. MAXIMITE takes his time at boottime from RTC.

Anyhow, I would propose to use a DS3231 module and set the time/date per Autorun.bas.

Michael
causality ≠ correlation ≠ coincidence
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:46am 02 Nov 2015
Copy link to clipboard 
Print this post

Once set at powerup from the RTC, the Maximite does it's own timekeeping, just like a PC.

The Maximite's crystal is as good as or better than the 1307. A few seconds a day.
You could tweak the crystal but it would still vary with temperature.

I would get a high precision RTC and adjust the Maximite's time daily (or more often).

Jim
VK7JH
MMedit
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:51am 02 Nov 2015
Copy link to clipboard 
Print this post

You could measure how much the maximite drifts and then adjust for it.
Every day on 00:00:00 you could add/substract a few seconds.
A problem with install and forget projects is that at one time it will need attention and then nobody knows how.
Having a 'routine' of adjusting the time every week (or month) or so will keep them knowledgeable.
If it really has to be precise and run for years then GPS enhancement could be a solution.
Version X?




Microblocks. Build with logic.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 12:54pm 02 Nov 2015
Copy link to clipboard 
Print this post

  MicroBlocks said  
Every day on 00:00:00 you could add/substract a few seconds.


are there any time transmissions in australia (or new zealand) one can use for adjustment? i know that in europe there are a couple of transmissions on HF that provide tones on the hour/etc that can be used.

or one could use GPS to keep the clock in check. something that generates NMEA strings out of a serial port. or a nearby PC that can send the odd timestamp string to the maximite.


cheers,
rob :-)Edited by robert.rozee 2015-11-03
 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 328
Posted: 01:29pm 02 Nov 2015
Copy link to clipboard 
Print this post

  robert.rozee said  or one could use GPS to keep the clock in check. something that generates NMEA strings out of a serial port. or a nearby PC that can send the odd timestamp string to the maximite.


I use this method on my DVR PC. The DVR needs to maintain fairly accurate time, but the PC is not connected to the internet. So, every hour I reset the PC time using GPS data. Windows even handles the UTC to Local time conversion when you use the proper API call to set the system time.

--CurtisEdited by Justplayin 2015-11-03
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 07:37pm 02 Nov 2015
Copy link to clipboard 
Print this post

the ceapest GPS modules (with onboard antenna) on ebay seem to be these ones:
http://www.ebay.com/itm/281505145902

VK16E module, 9600 baud serial output, just under us$10. like many of the different modules available from china on ebay, over time there seems to be a fair turnover - what is available this week is no longer sold a year later. the EM408 that geoff used in a micromite clock design a year back seems to be all but vanished.


cheers,
rob :-)
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 986
Posted: 11:09pm 02 Nov 2015
Copy link to clipboard 
Print this post

  robert.rozee said   the ceapest GPS modules (with onboard antenna) on ebay seem to be these ones:
http://www.ebay.com/itm/281505145902
cheers,
rob :-)


Rob this may make it difficult for Glenn


Shipping:
Does not ship to Australia | See details
Item location:

shenzhen, China










Ships to:

Worldwide See exclusions
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 11:32pm 02 Nov 2015
Copy link to clipboard 
Print this post

  Graeme Meager said  
  robert.rozee said   the ceapest GPS modules (with onboard antenna) on ebay seem to be these ones:
http://www.ebay.com/itm/281505145902
cheers,
rob :-)


Rob this may make it difficult for Glenn


Shipping:
Does not ship to Australia | See details
Item location:

shenzhen, China

Ships to:

Worldwide See exclusions


Hi Rob,

There's an opportunity for you to order some in for us folks in Australia and UK (and Hawaii!)

WWEdited by WhiteWizzard 2015-11-04
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 11:49pm 02 Nov 2015
Copy link to clipboard 
Print this post

this one ships to australia, for just a few cents more:
http://www.ebay.com/itm/171556498506

and this one to the UK:
http://www.ebay.com/itm/181594912168


cheers,
rob :-)Edited by robert.rozee 2015-11-04
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 11:37am 03 Nov 2015
Copy link to clipboard 
Print this post

I have used the V.KEL VK16E and it works well.
Paul
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5119
Posted: 12:02pm 03 Nov 2015
Copy link to clipboard 
Print this post

Thanks guys. I'll do some tests to see how much drift I have. The RTC seams to be spot on so far, to the minute at least. I set the time a couple of weeks ago and its still good.

But I'll order a GPS module anyway.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
VK2MCT
Senior Member

Joined: 30/03/2012
Location: Australia
Posts: 120
Posted: 12:56pm 03 Nov 2015
Copy link to clipboard 
Print this post

Does anyone know (especially Paul) whether a V.KEL VK16E GPS rx is likely to work under an Aussie Tile roof? Or near a window ?
Thanks John BEdited by VK2MCT 2015-11-04
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5119
Posted: 12:17pm 04 Nov 2015
Copy link to clipboard 
Print this post

I would imagine tiles wont have much effect on GPS signals. A steel roof however can be a problem, it depends on how close you are to a non-steel wall or window.

OK, early tests so not very accurate. The PIC looses about 0.5 seconds a day, the RTC looses about 1 second a day.

Question is, will the following reset the RTC to the PIC's time?

TIME$=TIME$

?

I assume when you do a TIME$= it will update the RTC as well as the PIC.

So once a week I could add a few seconds to the PIC's time, then issue a TIME$=TIME$ to update the RTC?

Glenn


The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 12:36pm 04 Nov 2015
Copy link to clipboard 
Print this post

I think you need RTC SETTIME and RTC GETTIME.
I don't have a CMM with RTC to test.

Jim
VK7JH
MMedit
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5119
Posted: 08:25pm 08 Nov 2015
Copy link to clipboard 
Print this post

I've added the following code to help keep better time. The user can set a fine adjustment in the menu, basically how many milliseconds to adjust the clock every midnight. At 15 seconds past midnight, the following code is run...


if TimeOffset<0 then
Pause 0-TimeOffset
Time$="00:00:15"
endif
if TimeOffset>0 then
Pause 1000-TimeOffset
Time$="00:00:16"
endif
Pause 1000


where TimeOffset is the preset millisecond adjustment. The code is fired at 00:00:15, pauses for a few milliseconds ( TimeOffset ), then resets the clock either back or forward a second, depending if its a negative offset or not.

Its triggered at 15 seconds past midnight because at exactly midnight there is a siren event in the code for night shift lunch break. The final Pause 1000 delay is there to stop the code running more than once. My main code loops every 100 milliseconds, so events like this can be re-triggered if no delay is added.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 09:22pm 08 Nov 2015
Copy link to clipboard 
Print this post

@ VK2MCT

Sorry I'm late I wasn't following the thread. I find that receiving the time only is always OK, I have a GPS clock that seems to work anywhere. But when I use the lat. and lon. coordinates it is a different matter, not very reliable indoors. I can't explain why the time is easier to receive except that maybe you only need one satellite for time and many more for accurate location. I have been working with EM408 and V.KEL modules for about 3 years and haven't found any difference. In my workshop with metal roof I use an antenna I bought from DealXtreme for about $5.
Paul.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025