I don't find it all that remarkable that the ceramic resonator is off by 20%.
Which is exactly why the Arduino folks used a real crystal in the "USB" processor and not a ceramic resonator. Your honor, I rest my case.
i've been having timing issues with one of my sketches, and eventually figured out that millis() is fast by about 20% on my board (Uno). In my sketch, i log a line once every 1000ms (as received by millis()). I've also got a GPS attached, so i can check the internal time against the GPS time. It's pretty consistent, but for every 10s that passes on the GPS, about 7800ms (give or take a hundred or so ms to account for lag) passes on the internal clock. Does anyone know why this might be happening? I googled around for others having this problem, but i only found folks talking about millis being off around 5s per day.
And yet __Tango's Uno appears to be accepting (and presumably sending) serial data between the Arduino processor and the USB processor. Even with a 20% error. I haven't even looked into Tango's problem. I'm just responding to your statement that ceramic resonators can have up to 20% error. Again I will state, the Arduino board could not even function with the IDE if the clock was 20% off value from 16mhz. I showed you accuracy specification of one rather inexpensive resonator showing it's accuracy specification. Have you any links to datasheets showing a 16Mhz ceramic clock resonator for sale with a 20% accuracy tolerance specification? What is your theory for why they used a real crystal on the USB processor, but a cheap ceramic resonator for the Arduino processor? Upon casual observation, that would seem backwards.I have no idea what drove the Arduino people to use both a crystal and a resonator on the board. I know on first release the Uno board's picture showed using two crystals.Lefty
1) __Tango would be reporting a DIFFERENT problem (that he couldn't upload sketches) if there were a problem communicating between the USB processor and the Arduino processor. The fact that he is able to upload code and download test results would appear to be prima facia evidence that the serial and USB communication are operational.Agreed, and that means the clock frequency of the 328p is accurate enough to support the 115200 baudrate of the bootloader, not something possible if the resonator was off by 20%.2) The places that fabricate and assemble PC boards for cheap are deep in the interior of a place where datasheets (even if they did exist) are written in a language foreign to both of us. And those assembly vendors concentrate on delivering the minimum requirement for the lowest price. That is how they survive in their industry. OTOH, if "official" Arduino boards are really manufactured in Italy then we must come up with some other explanation. Or __Tango could have a counterfeit or clone for all we know."Official" Arduino boards are made in Italy, however they have lincensed some firms (SparkFun? other?) to manufacture some of their board types. Of course the vast number of Asian 'arduino' boards are not official but are made and sold without regards to and violating the Arduino trademark. 3) I suspect that the board manufacturer (Arduino?, their vendor?, a counterfeiter?) saves money by requiring only some sort of functionality test at the end of the assembly line and does not reject boards for clock frequency excursions. I continue to reject the notion that a u-proc clock can be used for timekeeping in any meaningful way. We have RTC and TCO for that sort of thing.Time keeping over longer periods is best done using a RTC or other methods, no disagreement there. Even if one used a high accuracy crystal or TCXO or OCXO clock oscillator, the fact that interrupt useage can effect millis() accumulation over time is a good reason not to use software RTC functions.4) They left the hole patterns for a proper crystal for those who find the cheap ceramic resonator intolerable.Or to give them flexiblity on sourcing parts for batch manufacturing runs. There wanting and receiving FCC type acceptenace for the Uno board could be another reason for their resonator choice. Only someone from the Arduino firm could answer those questions.5) I agree that there could be other reasons for __Tango's reported results. But apparently my world-view is not as tidy and accurate as yours. An Arduino board is low-end mass-market consumer goods. Not intended to be any kind of accurate laboratory- (or even industrial-) grade product. Note that there is no published spec for the Uno clock accuracy.It is a mass-market product for sure, but must have a time base accuracy good enough to support the 115200 baudrate used by the bootloader.
For my own sketch using millis() and Serial.print*() I found that sending data with Serial.println() messes up the counted millis. And the lower the serial console baud rate, the bigger the effect. My conclusion was that the two interfere.
Gentlemen,Any chance you guys could take your "discussion" offline? It isn't relevant (anymore) to the original poster's question.Thanks.