real time clock drifting off #991
Replies: 11 comments
-
Posted at 2018-07-08 by BootySnorkeler
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-08 by @allObjects ...your're obviously not doing anything wrong: [PICO CLOCK ACCURACY}(https://www.espruino.com/Pico+Clock) search provided me this link... Not very encouraging... but that it is that bad, I'm surprised, because I'm working on something that would need some better time keeping... glad you pointed out your 'real time' experience. Which makes me think about a different solution. Most simple is to add a watch crystal, which was initially @gordon's intent for the PICO, but for various reasons it just didn't pan out. You find other entries in the forum, such as from @drazzy, who did work with adding a watch crystal. For 'simplicity' - when no connectivity to a time base is available - adding an RTC module is the only answer... and there are some out there w/ few wires only protocol and very easy to add... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-08 by BootySnorkeler Do you think a simple software solution can be added? For example, add 5 minutes to the time every 10 hours or so? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-08 by @allObjects The question is what causes the drift and is it really predictable... but you can observe and if the target environmental conditions are stable, it may work. If you can 'afford' to spend the money on a ESP8266 WiFi module, you go once in a while to the Web and get the time for free from there. Power seems not an issue, I guess, because running a multi 7-Segment LED display needs to be fed as well. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-09 by @gfwilliams Yes, I'm afraid this is just an issue with the Pico's internal RC oscillator (although if you've updated your firmware I think it's better than the original firmware that shipped on the early ones). You can add a crystal to the Pico, but it has to be a very specific one (Abracon ABS06-107) - and it's pretty small so is a pain to solder. Probably the easiest way around it is to add an external RTC like http://www.espruino.com/DS3231 Are you making your clock mains-powered? If so then you could try this code:
It stores the current time in a variable called Unfortunately to do that your device can't use I know this isn't much help, but this is actually only an issue on the Pico. The original and WiFi boards have a crystal for a low speed oscillator, and the Bluetooth LE boards are pretty good at self-calibrating. It's just unfortunate that the chip used for the Pico had an issue where you had to use a very specific oscillator type, and I wasn't able to get them fast enough in the quantity needed for production. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-10 by BootySnorkeler Oh well. I guess I'll use the MDBT42Q module for my future projects then. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-10 by @gfwilliams Have you tried the code above? Or you need the low power? The simplest method would be to just keep your own time using the RTC as a base. For instance this should work based on what you say about calibrating it:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-10 by @gfwilliams Also, you could always try adding the ABS06-107 crystal. It only costs around £1 (plus delivery) so it's not the end of the world if you don't manage to get it on properly. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-15 by BootySnorkeler Yeah, I'll try that. How accurate is the crystal? How long will it last before it drifts off? Also, are the capacitors required? I read another forum thread where someone else's crystal only worked after adding the capacitors, but in the documentation it says they aren't. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-16 by @gfwilliams Supposedly the crystal is 20 PPM accuracy, so 1 second in 50000 - about 2 seconds a day. Well, I didn't think the caps were required (since the capacitance is so low and the board has some itself), but I just tried now and it did seem to need them - so yes, I'd add some. They're only a few pence each. You could always add the crystal, try, and add caps if it's not working. If you have access to a hot air gun, flux, and tweezers then it'll actually be pretty easy to do. I think with a standard soldering iron it's going to be a bit more of a struggle - but you could put the crystal on its side so you can solder the contacts to the pads more easily. You can try the following code:
It should report:
When it's working. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-18 by DrAzzy While a little unpleasant due to the size of the parts, since all the parts you need to add are two terminal devices, it definitely can be done with an iron. Honestly, for two terminal parts, even small ones, I find soldering iron to be easier than hot-air. I only use air for large or no-lead parts. You put a bit of solder onto one pad for each part, hold in place with tweezers, and melt the solder on that side to solder that end, then go back and solder the other end. Might not even need additional flux. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-08 by BootySnorkeler
Hey everyone,
I'm using the Espruino Pico's real time clock for my clock project. Basically when I press the button, the Pico shows the time on some 7-segment LEDs for about a second and goes back to deep sleep.
No matter what I do, the time seems to be drifting off about 5 to 10 minutes after a full day of use. What did I do wrong??? Or is the Pico's clock not the most accurate?
Thanks!
If you want the entire code it's in the comment below.
Beta Was this translation helpful? Give feedback.
All reactions