DS1620 clock speed question
mikea
Posts: 283
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
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
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