OzGrant 22 Posted February 2, 2013 Share Posted February 2, 2013 G'day, I now have a working Dallas Library that works on both 430 and Stellaris using Energia IDE. Have fun. Grant StellarisDS18B20.zip energia, Rickta59 and Automate 3 Quote Link to post Share on other sites
warg-vs 1 Posted February 4, 2013 Share Posted February 4, 2013 Hello! Cannot run on the MSP430, compiles but does not find sensor. :!!!: larsie 1 Quote Link to post Share on other sites
OzGrant 22 Posted February 6, 2013 Author Share Posted February 6, 2013 G'day Warg-vs,Yup you were correct, I mucked up the attached library. This new zip file workes OK, also did a minor change to the sketch. Have fun. Grant Quote Link to post Share on other sites
OzGrant 22 Posted February 6, 2013 Author Share Posted February 6, 2013 Opps, zip file now attached GFDS18B20.zip warg-vs and larsie 2 Quote Link to post Share on other sites
warg-vs 1 Posted February 6, 2013 Share Posted February 6, 2013 it works! thanks Quote Link to post Share on other sites
pivden 6 Posted February 14, 2013 Share Posted February 14, 2013 write_byte(0x44); // convert T command OW_HI delayMicroseconds(750); or write_byte(0x44); // convert T command OW_HI delay(750); ? conversion time 93.75 ms (9-bit), 187.5 ms (10-bit), 375 ms (11-bit), 750 ms (12-bit). default: 750 ms (12-bit). select resolutions: reset(); write_byte(0xCC); // skip ROM command write_byte(0x4E); // write to eeprom write_byte(0x00); // write to eeprom write_byte(0x00); // write to eeprom write_byte(0x7F); // 0x1F - 9bit; 0x3F - 10 bit; 0x5F - 11 bit; 0x7F - 12bit reset(); Quote Link to post Share on other sites
OzGrant 22 Posted February 14, 2013 Author Share Posted February 14, 2013 G'day Pivden, Do not know what your question is. Most of the temperature applications I work in only require 9 bits that allow a 0.5C resolution, and hence the lowest delay. There is another way (as long as you do not use parasite power) and that is to loop while checking the status of the temperature conversion. This allows other routines to use the time normally hogged by the delay() function. Grant Quote Link to post Share on other sites
pivden 6 Posted February 15, 2013 Share Posted February 15, 2013 OzGrant, question in the wrong time delay (ms, micros) after the command 0x44 (convert T command). in code delay in micro seconds, but must be in ms. even for 9-bit resolution delay must be 94ms. for resolution 12 bit, temperature data in the first 0.75 second will be invalid and will lag. in the loop will work but will lag. OzGrant 1 Quote Link to post Share on other sites
OzGrant 22 Posted February 17, 2013 Author Share Posted February 17, 2013 Tks Pivden, Yes your correct, no idea how the microsec's snuck through, they seem to do that at 2AM. Have updated the zip file. Tks again GFDS18B20V2.zip manhdan and phaseform 2 Quote Link to post Share on other sites
vr13azvedke 0 Posted February 17, 2013 Share Posted February 17, 2013 Thanks for library. Please add to example decimal fractions to temperature result (-25,13, 13,94... etc). I can't do it right Quote Link to post Share on other sites
OzGrant 22 Posted February 18, 2013 Author Share Posted February 18, 2013 G'Day vr13azvedke (hum that is a mouth full to pronounce) The DS18B can give a temperature resolution down to 1/16 C but have never used such resolution in the real world of process control. Also you have to start using float variables to store the values that uses a sizable a chunk code space. I round up or down to the closest integer temperature temperature. You can get one decimal place by using substituting getDate() with getData10() and still storing the returned value as int, and then right shift to obtain that decimal portion. If that does not help, let me know and will put in a full resolution (with the dreaded code hogging Float) function. Grant Quote Link to post Share on other sites
arvo 0 Posted February 18, 2013 Share Posted February 18, 2013 Hi Grant! Thank you for a library! Can you make comments in sketch? I can't receive correct data from DS18B20 on MSP430 G2553. Quote Link to post Share on other sites
energia 485 Posted February 18, 2013 Share Posted February 18, 2013 Are you using the example Sketch as is or do you have your own Sketch? If you coded up your own Sketch then can you post it in this thread? If you are using the Sketch as is then could it be that you have the wrong COM port selected? You can verify with a Sketch like the ASCIITable example. Quote Link to post Share on other sites
arvo 0 Posted February 19, 2013 Share Posted February 19, 2013 Yes, i use example sketch without modification. I connect DS18B20 to 1.1PIN. COM-port is correct. Quote Link to post Share on other sites
OzGrant 22 Posted February 19, 2013 Author Share Posted February 19, 2013 G'Day Arvo (bit like saying good afternoon) I think your problem is that you have used P1.1 as your one wire connection. It should be on P2.1 (Pin 9). P1.1 (Pin 3) is also the UART Rx data, so that is why you are not getting correct comms. When the sketch starts it will always send (at 9600 baud) the message "G'day StellarisOW" Let me know if this fixes the problem. Grant Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.