Shop OBEX P1 Docs P2 Docs Learn Events
DS1620 clock speed question — Parallax Forums

DS1620 clock speed question

mikeamikea Posts: 283
edited 2015-02-11 22:27 in Propeller 1
Hi, I'm just getting started with the DS1620 digital thermometer. I've downloaded the beginner code for it from the obex and noticed the clock speed was 12 MHz. The other code I will be using for my project along with it is at 80 MHz. Will it cause a problem if I changed the DS1620 object code to 80 as well without changing anything else in it? I would like everything to be at the same clock speed, but if the different speeds are in different cogs it will work fine right? Thanks

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2015-02-11 22:27
    Hi mikea,

    the clockspeed is totally global to all cogs.
    the obex-object http://obex.parallax.com/object/59

    which is described as "A beginner's demo for the DS1620 thermometer chip from Parallax."

    sets no particular clockspeed in the constants block of the sourcecode.
    The used object "timing" uses the pre-defined constant "clkfreq"

    clkfreq contains always the value of the clockspeed regardless which clockspeed is setup.
    This means the calculations done inside theobject timings are correct for each clockspeed.

    Only thing is that setting up no constants like
    con
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000 
    

    makes the propeller-chip use the internal oscillator which is unprecise.
    For the communication with the DS1620 this is not important as the clock is driven by the propeller-chip.
    The propeller-chip dictates the times for bitbanging.

    Just setup the constants in your TOP-OBJECT-FILE like shown above and it should work with 80MHz.

    the propeller-chip-manual says:
    "The top object file in an application (the one where compilation starts from) can specify a
    setting for _CLKMODEin its CONblock. ....
    Any _CLKMODEsettings in child objects are simply ignored by the compiler."


    The datasheet of the DS1620 says clockfrequency is 1.75MHz. Minimum period is 1 / 1.750.000 = 0,57 µsecs.
    As the shiftio uses 10µsec as minimal timebase it should work fine.

    best regards

    Stefan
Sign In or Register to comment.