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.
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209
Posted: 11:24pm 18 Oct 2013
Copy link to clipboard
Print this post
The reason i want to try is that when the CMM is used as an embedded controller it might not restart for weeks, even months.
If the RTC is read only at startup the time will drift a lot over long time spans.
Mine drifts about 10 seconds each day. I have a CMM based on a UBW32.
My thinking was that synchronizing the system time with the RTC time every day would eradicate that problem.
I have a particular need for two i2c busses so that i can set one in slave and the other in master. That has to be changed in the firmware and i will need to study that. Which will be a good way to learn more about it. So i am not complaining. :)
Microblocks. Build with logic.
Lorenzo Newbie Joined: 27/08/2013 Location: FrancePosts: 17
Posted: 04:20am 20 Oct 2013
Copy link to clipboard
Print this post
Geof,
Effectively,
I just read the code:
340 TIME$ = "0:0:0" ' Zero the clock it's explicit.
This is an interesting little demonstration program, I think you already think in an update, perhaps also improvements for the next revision of the MMbasic library...
Lorenzo.
Edited by Lorenzo 2013-10-21
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9493
Posted: 11:28pm 22 Oct 2013
Copy link to clipboard
Print this post
If you want REAL accuracy, then use the DS3232.
This IC is a very VERY accurate RTC, and the crystal reference is internal to the chip.
However, the 3232 is about four times the price of the 1307, but I have had issues with the 1307 before today, in terms of it's drifting time - over time. ;)
Having said that, it is easy enough to design a routine into your code, so that you can update the time once you notice it is out by a bit - not really that painful to do, and having said all the above, I am happy enough to stick with the 1307, and just alter the clock in the menus as and when needed, which is not really that often.Smoke makes things work. When the smoke gets out, it stops!