[TriEmbed] TriEmbed Digest, Vol 16, Issue 12

Charles McClelland chip at mcclellands.org
Thu Sep 11 13:15:00 CDT 2014


Pete, 

Good point on accuracy.  The Maxim data sheet for the DS1339 does not give an accuracy (at least that I could see).  But I want to make sure I understand how to convert ppm to something I can understand.

Using your data point for the DS1307, 20 parts per million would be 20/1,000,000 or 0.002% and if there are 86,400 seconds in a day, that is 1.728 seconds a day in “drift”.  

Am I thinking about that right?  I put these sensors out for a week (the non-cellular version) and I could expect 12 seconds drift. 

Thanks,

Chip


On Sep 11, 2014, at 1:33 PM, triembed-request at triembed.org wrote:

> Send TriEmbed mailing list submissions to
> 	triembed at triembed.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> or, via email, send a message with subject or body 'help' to
> 	triembed-request at triembed.org
> 
> You can reach the person managing the list at
> 	triembed-owner at triembed.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of TriEmbed digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Basic I2C Question (Pete Soper)
>   2. Re: Basic I2C Question (Jon Wolfe)
>   3. Re: Basic I2C Question (Pete Soper)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 11 Sep 2014 13:24:32 -0400
> From: Pete Soper <pete at soper.us>
> To: triembed at triembed.org
> Subject: Re: [TriEmbed] Basic I2C Question
> Message-ID: <5411DAD0.70508 at soper.us>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> 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
> 
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Thu, 11 Sep 2014 13:25:53 -0400
> From: Jon Wolfe <jonjwolfe at anibit.com>
> To: Charles McClelland <chip at mcclellands.org>, Adam Haile
> 	<email at adamhaile.net>
> Cc: TriEmbed Discussion <triembed at triembed.org>
> Subject: Re: [TriEmbed] Basic I2C Question
> Message-ID: <qh0murv7j077ct0v25w2cw8c.1410456353334 at email.android.com>
> Content-Type: text/plain; charset="utf-8"
> 
> What I've done on my i2c device boards is to leave unpopulated placeholders for pullups on the pcb.
> 
> <div>-------- Original message --------</div><div>From: Charles McClelland <chip at mcclellands.org> </div><div>Date:09/11/2014  11:28 AM  (GMT-05:00) </div><div>To: Adam Haile <email at adamhaile.net> </div><div>Cc: TriEmbed Discussion <triembed at triembed.org> </div><div>Subject: Re: [TriEmbed] Basic I2C Question </div><div>
> </div>Adam,?
> 
> Thank you for the response your and Jon?s note raises another question:
> 
> Is there an advantage to putting resistors on the circuit board versus simply using the Arduino?s internal pull-ups? ?Power savings or - as Jon mentioned - the ability to tune for performance?
> 
> On the RTC - here is my reader?s digest version of the bewildering variety that Maxim offers:?
> 	- DS1337 - Great but no battery backup to keep clock set when I change the batteries
> 	- DS1338 - Adds battery backup but drops alarms
> 	- DS1339 - Battery backup, alarms and an alarm pin - and it is cheaper than the DS1338. ?
> 
> I am hoping the library / commands for all three will be similar and similar. ?Thoughts?
> 
> thanks,
> 
> Chip
> 
> 
> On Sep 11, 2014, at 8:50 AM, Adam Haile <email at adamhaile.net> wrote:
> 
> There's no need for them at all.
> I2C only needs pull up resistors on the bus as a whole, NOT for each device.
> Also, the Wire library in Arduino automatically enables the internal pullup resistors when you call begin(). You can also do the same by setting a pin as an input and then writing HIGH to it, but Wire takes care of it for you.
> 
> Sure, having extra won't help but you certainly don't need more than one set.
> 
> For the RTC, check out the DS1337, it is the DS1307's big brother and includes alarms. However, there are no alarm pins, you just have to poll for if the alarm is "going off". But there is lots of code out there already for the DS1337. If you need alarm interrupts, I'm not sure what to use... nothing I'm familiar with that has separate alarm pins.
> 
> On Thu, Sep 11, 2014 at 8:28 AM, Charles McClelland <chip at mcclellands.org> 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
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20140911/a3526f25/attachment-0001.html>
> 
> ------------------------------
> 
> Message: 3
> Date: Thu, 11 Sep 2014 13:33:01 -0400
> From: Pete Soper <pete at soper.us>
> To: triembed at triembed.org
> Subject: Re: [TriEmbed] Basic I2C Question
> Message-ID: <5411DCCD.90501 at soper.us>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
> 
> An oscilloscope would allow measuring the actual the slew rate 
> accurately enough to determine if you've got some headroom or if things 
> are on the ragged edge.
> 
> But the load capacitance of the sensors should be in their data sheets, 
> so adding those up gives you a start on knowing the total load. And 
> there are online calculators for estimating the capacitance of PCB 
> traces. But just taking it to a 'scope' would close the gap between 
> theory and reality. :-)
> 
> -Pete
> 
> On 09/11/2014 11:46 AM, Jeff Highsmith wrote:
>> Rodney,
>> 
>> Can bus capacitance be easily measured? I've got five I2C sensors 
>> hooked up to the project I'm working on, though all within a square 
>> foot. Can I just put my multimeter in capacitance mode and measure 
>> across SDA and SCL when the circuit is off?
>> 
>> Thanks!
>> Jeff :)
>> 
>> 
>> On Sep 11, 2014, at 11:39 , Rodney Radford wrote:
>> 
>>> As long as the I2C devices are close to the microprocessor, you do 
>>> not need additional pull up resistors.
>>> 
>>> However, as you increase the distance (say to an extra sensor board), 
>>> the long wires add additional capacitance to the I2C lines, turning 
>>> those sharp edges into something that looks more like a sine wave.  
>>> The same occurs as you add more devices as each device has it's own 
>>> internal capacitance. The additional pull up resistors help correct 
>>> this, allowing you to put your sensors further away (or add more 
>>> sensors).
>>> 
>>> So if you are going off-board with your sensors, yes, i would 
>>> definitely recommend adding pull up resistors. The lower the value of 
>>> the resistors, the more pull up you get and the sharper your edges 
>>> become - at the increase of additional current required for your 
>>> device, so it is a trade off.
>>> 
>>> I worked on a setup years ago where I used I2C as a communication bus 
>>> for a large aquarium monitoring system where I had I2C temperature 
>>> sensors in each aquarium, I2C port expanders to drive small 2x16 line 
>>> LCD displays, and port expanders to control turning on heaters to 
>>> each aquarium.  The aquariums were in an external storage shed that 
>>> was not insulated, so by measuring the external temperature we could 
>>> start increasing the water temperature as the external temperature 
>>> dropped, to prevent the water from getting too cold before the 
>>> heaters cut in.  In hind site, it may have been easier to insulate 
>>> the shed, but the system worked well for years.  I was running I2C 
>>> lines over CAT-5 30' and it worked like a charm.  I did optoisolate 
>>> the I2C lines back to the computer (which was a Windows PC that was 
>>> bit-banging the I2C out the PC's parallel port) to prevent lightning 
>>> of other high static charges from damaging the port.
>>> 
>>> Of course now I would replace all of that with a few small 
>>> microprocessors and a Raspberry Pi, but this was back in the 
>>> early/mid 90s...
>>> 
>>> On Thu, Sep 11, 2014 at 11:28 AM, Charles McClelland 
>>> <chip at mcclellands.org <mailto:chip at mcclellands.org>> wrote:
>>> 
>>>    Adam,
>>> 
>>>    Thank you for the response your and Jon's note raises another
>>>    question:
>>> 
>>>    Is there an advantage to putting resistors on the circuit board
>>>    versus simply using the Arduino's internal pull-ups?  Power
>>>    savings or - as Jon mentioned - the ability to tune for performance?
>>> 
>>>    On the RTC - here is my reader's digest version of the
>>>    bewildering variety that Maxim offers:
>>>    - DS1337 - Great but no battery backup to keep clock set when I
>>>    change the batteries
>>>    - DS1338 - Adds battery backup but drops alarms
>>>    - DS1339 - Battery backup, alarms and an alarm pin - and it is
>>>    cheaper than the DS1338.
>>> 
>>>    I am hoping the library / commands for all three will be similar
>>>    and similar.  Thoughts?
>>> 
>>>    thanks,
>>> 
>>>    Chip
>>> 
>>> 
>>>    On Sep 11, 2014, at 8:50 AM, Adam Haile <email at adamhaile.net
>>>    <mailto:email at adamhaile.net>> wrote:
>>> 
>>>>    There's no need for them at all.
>>>>    I2C only needs pull up resistors on the bus as a whole, NOT for
>>>>    each device.
>>>>    Also, the Wire library in Arduino automatically enables the
>>>>    internal pullup resistors when you call begin(). You can also do
>>>>    the same by setting a pin as an input and then writing HIGH to
>>>>    it, but Wire takes care of it for you.
>>>> 
>>>>    Sure, having extra won't help but you certainly don't need more
>>>>    than one set.
>>>> 
>>>>    For the RTC, check out the DS1337, it is the DS1307's big
>>>>    brother and includes alarms. However, there are no alarm pins,
>>>>    you just have to poll for if the alarm is "going off". But there
>>>>    is lots of code out there already for the DS1337. If you need
>>>>    alarm interrupts, I'm not sure what to use... nothing I'm
>>>>    familiar with that has separate alarm pins.
>>>> 
>>>>    On Thu, Sep 11, 2014 at 8:28 AM, Charles McClelland
>>>>    <chip at mcclellands.org <mailto:chip at mcclellands.org>> 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 <mailto:TriEmbed at triembed.org>
>>>>        http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
>>>>        TriEmbed web site: http://TriEmbed.org <http://triembed.org/>
>>>> 
>>>> 
>>> 
>>> 
>>>    _______________________________________________
>>>    Triangle, NC Embedded Computing mailing list
>>>    TriEmbed at triembed.org <mailto:TriEmbed at triembed.org>
>>>    http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
>>>    TriEmbed web site: http://TriEmbed.org <http://TriEmbed.org/>
>>> 
>>> 
>>> _______________________________________________
>>> Triangle, NC Embedded Computing mailing list
>>> TriEmbed at triembed.org <mailto:TriEmbed at triembed.org>
>>> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
>>> TriEmbed web site: http://TriEmbed.org
>> 
>> 
>> 
>> _______________________________________________
>> 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
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20140911/5febbe04/attachment.html>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> TriEmbed mailing list
> TriEmbed at triembed.org
> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> 
> 
> ------------------------------
> 
> End of TriEmbed Digest, Vol 16, Issue 12
> ****************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20140911/f32204ec/attachment.htm>


More information about the TriEmbed mailing list