[TriEmbed] Basic I2C Question
Pete Soper
pete at soper.us
Thu Sep 11 12:24:32 CDT 2014
The Atmega builtin pullups are very weak (high value). In addition to
the issue with long distance (i.e. more capacitance in the "transmission
line" created by the PC traces and/or cables) that Rod mentioned folks
should know that speed can figure into the equation. If for some reason
the I2C is going to be run at 400khz vs the default 100khz then lower
value pullups become critical in addition to mindfulness about the lower
limit on load capacitance.
The ST M41T62 clock chip is pretty cool, and it can be arranged to
generate interrupts when an alarm expires. But it's basic accuracy is
like a DS1307 (roughly 20-30ppm). It has excellent support for on the
fly calibration to get the error down to a fraction of one ppm, but
there would have to be initial measurement of drift at a few
temperatures and then the driver would have to be able to monitor
temperature to tweak things as you go along, especially in your setting
where the temp can swing a lot. I started a driver for this chip but its
only 80% complete (you can do all the usual stuff with it and peek/poke
the register values very conveniently, but a list of very smart features
to do with minimizing power consumption is undone) I have a breakout
board you could try out immediately and parts to build a few more. (If I
can succeed in building the "calibrator' I'm designing now I'll be able
to calibrate this clock chip for any given temperature to within 100ppb
with one second of square wave samples).
If your logger is doing smart stuff like talking to mother ship via the
cell network it should be straight forward to calibrate the clock
periodically, shouldn't it? If you can get a "fix" on actual time of day
periodically you can determine how to calibrate your processor's
reckoning of time and make your own alarm clock(s) with software iff
your sleep modes are not so deep that the timer involved with millis is
powered down. There is easy library support for translating the free
running timer (the thing that drives "millis()") into date/time info.
But I suspect you're aiming to do things the other way around and use
the RTC alarm clock to wake the cpu up?
-Pete
On 09/11/2014 08:28 AM, Charles McClelland wrote:
> First, I wanted to thank Paul for the excellent presentation on interrupts. I now have a Watch Dog Timer routine which is saving me from having to put a clock on one project.
>
> On my other project though, I still need a clock. And since I am already using an I2C bus, I thought I could simply add one to that bus. That way I will have two I2C sensors connected to an Arduino (ATMEGA328). My question is how to best implement the pull-up the resistors. Should I put resistors on each (perhaps 10k since they will effectively be in parallel) or should I put one set of pull up resistors on the main board for both? It seems like the latter is the better approach but I did not know if there was some reason to do one over the other.
>
> On a related note, I need a 3.3V I2C Real Time Clock with Alarms - I am looking at the DS1339 and hoping I can use some of the DS1307 library since they are both from Maxim. Any other suggestions?
>
> Thanks,
>
> Chip
>
>
>
> _______________________________________________
> Triangle, NC Embedded Computing mailing list
> TriEmbed at triembed.org
> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> TriEmbed web site: http://TriEmbed.org
More information about the TriEmbed
mailing list