readtemp12 works at 8MHz

moey

Member
Technical, the manual says that readtemp12 will not to work 8MHz.

I am reading a DS18B20 and displaying it on LCD. Changing the clock speed to 8MHz (setfreq 8m) seems to have no detrimental effect on readtemp12, it still reads the sensor correctly.

The setfreq 8m command has definitely been set - I have an LED on an output being pulsed by the program loop... it flashes twice as fast at 8MHz.

Not complaining, mind you, it's just that the manual is specific in stating that it shouldn't work.
________
Arizona Medical Marijuana Dispensary
 
Last edited:

BeanieBots

Moderator
Be careful, it may well appear to work but might not give you the expected result. Worst case, the DS18B20 takes 750mS to do a conversion. At 8Mhz, it will not wait that long, consequently, what is returned, may be the previous result and not the current one.
 

Technical

Technical Support
Staff member
As stated above, you may violate the read times and so get corrupt data. There is a simple solution though, simply change speed in the program before the command:

<code><pre><font size=2>
setfreq m4 ' back to 4MHz
readadc10 1,b1
setfreq m8
</code></pre></font>

Edited by - Technical on 4/4/2005 8:36:32 AM
 
Top