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 : cgcolormax2 very bad time accuracy
Page 1 of 2 | |||||
Author | Message | ||||
Lorenzo Newbie Joined: 27/08/2013 Location: FrancePosts: 17 |
Hi all, It is impossible to have a normal precision time, indeed, the clock of my cgcolormax2 is not accurate at all, loss time day after days. Since last week : Loss 2 hours. Is this normal ? I'm alone is this case ? Lorenzo |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3804 |
I think you'd need a precise xtal or (easier) just use an external RTC chip. John |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
I have seen this loss of time too. It is not specific to a cgcolormax2, it does have an RTC chip or not? After a restart it is good again, which makes me think that the battery backed up RTC chip is only read at boot time and not after. Microblocks. Build with logic. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
No, that is not normal. +/-30 seconds in a week perhaps, not 2 hours. Check your battery voltage and that the battery is properly seated in its holder. Also check that your program is not inadvertently changing the time. If it is none of those I would suspect the crystal. Geoff Geoff Graham - http://geoffg.net |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
Yes, that is correct. It is done that way for speed. Geoff Geoff Graham - http://geoffg.net |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Geoff, would it be possible to wire the i2c that is connected to the rtc on to the pins 12 and 13 so that it can be read with the i2c commands? I would then be able to read the RTC once every day to update the system time. Microblocks. Build with logic. |
||||
Lorenzo Newbie Joined: 27/08/2013 Location: FrancePosts: 17 |
I suspect the crystal, because the date is correct. It's just a matter of time. Someone else has the same problem with cgcolormax2 before I play with the soldering iron and change quartz. The reference quartz: 32C229 it's strange, I do not know this reference. Lorenzo |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Geoff, another similar time query. Is it possible to connect things to have the mono-Maximite Basic read an added 1307 chip rather than have to incorporate separate I2C time routines in our MMBasic programs to do it? I have a project that needs time but isn't using I2C for anything else and I'd like to use my Mini-Maximite for it. Greg |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Some old threads which discuss RTC & I2C http://www.thebackshed.com/forum/forum_posts.asp?TID=3790&KW =rtc http://www.thebackshed.com/forum/forum_posts.asp?TID=3775&KW =ajkw http://www.thebackshed.com/forum/forum_posts.asp?TID=5350&KW =BBV |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Hi Anthony, Yes I had looked at those threads but they don't answer the question. The current CMM firmware reads a 1307 rtc "as-is" if you've installed one on the "system" pins. I'd like to use my Mini-Maximite (which uses the Mono MMBasic firmware) by adding a 1307 but hopefully not have to incorporate the separate I2c MMBasic routines into my program - a long shot I'd guess. More than likely, the Mono firmware is not simply a version of the Colour firmware with features disabled e.g the rtc, colour, two channel audio etc. The Mono's a 64 pin version of the 695 or 795 chip for a start, versus the Colour's 795 100 pin version. If it were though, it would make for easy rtc implementation on the mono MM versions by connecting a 1307 to the "system" pins used by the Colour firmware and using the "in-built" rtc capability. I think I'm dreaming here but still.... If not, I can always use the Mini-Maximite by adding the 1307 MMBasic routines and connecting to the normal I2C pins, or go to a Colour MM chip implementation and have the rtc already implemented for me. Greg |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Greg, I would actually prefer that the RTC is connected to pins that are accessible through MMBasic. This will give you control without the need to change the firmware. I will be giving it a go next weekend connecting the onboard RTC to the I2C pins on the extension bus. Should be ok as I2C is meant to have more devices connected. The pull up resistors are already in place so it is just two short wires. I have the RTC in a socket so i can make it a 'plugin' modification. Microblocks. Build with logic. |
||||
Lorenzo Newbie Joined: 27/08/2013 Location: FrancePosts: 17 |
Hi, I did a little experiment, I set the time there two days, no use, and turned on the colormax just now. No problem with the time, so this is a program that is a problem, but none of programs I use call the RTC. From now on, I'll watch the clock after each use to find where is the cause of this disorder. Lorenzo |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
It will be interesting to see how you get on TZ. I wonder why Geoff didn't connect the CMM 1307 to pins 12/13? Was it something to do with the master/slave configuration or to keep them "general purpose" as per earlier Maximites? I'm not sure but I seem to remember a comment in an earlier thread somewhere - I think from Geoff, that he needed to have the "system" 1307 clock pins kept as slave only, whereas he wanted to keep pins 12/13 available for master or slave configuration. My case is different in that I'm just trying to circumvent having to add the MMBasic 1307 routines to my program when using the mono Mini-Maximite. It's not a show-stopper though. Greg |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Lorenzo, It sounds as if you have an abnormal problem with your 1307 rtc, but if the 1307 accuracy is still a problem for you, have a look at this thread which talks about using the much more accurate DS3231 chip . Accurate clock There is more on using this in other threads - search on "DS3231" using the forum's Google search facility. Greg |
||||
Lorenzo Newbie Joined: 27/08/2013 Location: FrancePosts: 17 |
paceman, I do not think the DS1307 is the problem, since my last test (easy) which is to start from time to time cgmax and compare the time with my watch, I noticed perfect accuracy. So, I think one of the programs I use, interfere with the chip, and made him lose precious minutes they become hours days after days, so for now it is not a problem but just a question I ask myself if one day I have to use it seriously. Otherwise, I wear a watch, and it is what I use primarily when I need to know the time. Lorenzo |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
I am not sure it is going to work, because the pic32 acts as a master when connecting to the RTC which is a slave device. Connecting it to pin 12/13 will introduce a second master on a single bus. That should also work but needs a little different coding and i am not sure if the i2c routines in mmbasic support that. Guess trying it is the only way to find out. Microblocks. Build with logic. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
It would not be hard to do but it would require a special version or modification to MMBasic. I did not do this because I figured that the people who did want an RTC on the mono MM could put the routines to read it in their AUTORUN.BAS and that was easier than dedicating pins 12 and 13 to the RTC, which would have left everyone with an 18 pin mono MM (not good). I suppose it could be an option, but there are too many options already. I am not sure that I fully understand the question but the answer is essentially the same as above. It could be done but it would involve yet another option to satisfy a requirement of one or two people. Also, the PIC32's crystal should be as accurate as the RTC crystal so you should not have to keep re reading the RTC. If I did that everyone would have lost the use of these pins as general purpose I/O - and that would not have been good. I am trying to not clutter MMBasic with additional commands/options that will only be used by a few people but I will put some thought into how I could meet these two requests, which I think can be summarised as: - Provide access from within MMBasic to the RTC on the CMM (also let you store non volatile data in the RTC). - Provide optional support for an RTC on the mono MM on pins 12/13. Geoff Geoff Graham - http://geoffg.net |
||||
Lorenzo Newbie Joined: 27/08/2013 Location: FrancePosts: 17 |
Since my first message, or I thought, wrongly, that the RTC was at fault, I looked for a program that could cause this problem. I find one !!! After the execution of the programm "GRAPH" found in the MMBASIC LIBRARY, the time is reset, but not the date ... I do not know why, for the moment... I search another, but it's strange, no ? Lorenzo |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
Ah, I am the guilty one there. I wrote GRAPH even before the original Maximite was published and I used the internal clock for timing. To do that the program reset the clock to midnight when it started - and that is the cause of your problem. Back in those days the MM did not have a RTC so that did not matter, nowadays there are other ways to count time. Geoff Geoff Graham - http://geoffg.net |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Hmmm... AUTORUN, of course - a good option to keep the rtc routines out of the main program that I should have thought about. Sorry about that one Geoff. I think you're right to keep it as un-cluttered as possible Geoff and a proliferation of firmware versions is definitely not a good idea. Your first point above sounds exactly what TZ and others have queried - they can respond to that. The second point would be good for me and probably others, but some would also need pins 12/13 for their own I2C devices. If it can be done reasonably easily that'd be great, but as you've said, it can be done now with AUTORUN without complicating the main user program. I was originally wondering about a hardware solution for individuals to implement themselves, i.e. be able to incorporate a link to the un-used RA2/3 pins of the mono MM's and be able to use the colour firmware that has the rtc support on those pins - not possible without different firmware though as you say. It's great that you still respond to these sorts of requests Geoff. If you were a multi-million (billion?) dollar company I'm sure we'd be getting short-shrift. Greg |
||||
Page 1 of 2 |
Print this page |