CCS does not monitor this forum on a regular basis. Please do not post bug Reports on this forum. Send them to support@ccsinfo.com
 DS18S20 & DS18B20 Codes Goto page Previous  1, 2, 3, 4  Next
Author Message
xokolatecake

Joined: 09 Mar 2007
Posts: 14

Posted: Wed Jun 04, 2008 10:40 am

Sorry guys!..i was so mad with the time i wasted on this i didn't noticed that i was using a DS18B20P, the (only) parasitic power version of DS18B20!
So my problem was not in the software but on the hardware, although i made a few adjustments to the delays duration and added the strong pull up control maxim recomends in the datasheet!

Will post the code for future reference. Again this is meant for DS18B20-PAR, don't make the same mistake i did!;P

See ya!:D
azakuri

Joined: 02 Aug 2008
Posts: 4

 Posted: Tue Sep 02, 2008 6:40 am i'm still wonder if i use 2 ds18s20 and pic16f877, do i need to make a major changes in this coding......
Aurbo

Joined: 07 Apr 2008
Posts: 49

Posted: Wed Oct 01, 2008 6:05 pm

If I wanted to convert this to Fahrenheit I'd need to convert the "whole number part"

 Code: //calculate the whole number part       temperature = (temp >> 4) & 0x00FF; //convert to Fahrenheit temperature=((temperature*9)/5)+32;

I believe that is right above

The part I've stuck on is getting the fractional part converted

I'm tempted to go this route but I'm unsure if it correct or proper coding.

 Code: //calculate the fractional part       if((((temp*9)/5)+32) & 0x0001) temperature = temperature + 0.06250;       if((((temp*9)/5)+32) & 0x0002) temperature = temperature + 0.12500;       if((((temp*9)/5)+32) & 0x0004) temperature = temperature + 0.25000;       if((((temp*9)/5)+32) & 0x0008) temperature = temperature + 0.50000;
HTAluvBeBeo

Joined: 23 Feb 2008
Posts: 35

 Posted: Tue Nov 11, 2008 8:49 am Can I use a normal BJT and pullup resistor instead of a MOSFET in parasite power mode ? Thank you all for reply my noob question.
HTAluvBeBeo

Joined: 23 Feb 2008
Posts: 35

Posted: Thu Nov 13, 2008 6:26 am

 xokolatecake wrote: Sorry guys!..i was so mad with the time i wasted on this i didn't noticed that i was using a DS18B20P, the (only) parasitic power version of DS18B20! So my problem was not in the software but on the hardware, although i made a few adjustments to the delays duration and added the strong pull up control maxim recomends in the datasheet! Will post the code for future reference. Again this is meant for DS18B20-PAR, don't make the same mistake i did!;P See ya!:D

Would you like to help me about the hardware for ds18b20p. A simple schematic will help me much. I am bad at electronics. Which MOSFET should I use?

Thank you all!
soulraven

Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

Posted: Sat Feb 14, 2009 12:13 pm

I tried the code below, go, only 2 questions that I
1. Below 0 degrees Celsius shows error displays 250 degrees Celsius
2. How can I adjust for sensors 3-4

xokolatecake wrote:
Hi!
Regarding scanan post, what does this little piece do?:

 Code: //for 10 bit resolution mod onewire_write(0xCC); onewire_write(0x4E); onewire_write(125); onewire_write(-55); //this should be done for proper working of DS18B20 onewire_write(127); onewire_reset(); onewire_write(0xCC); onewire_write(0x48); delay_ms(15);

He issues a write scratchpad command, then sends the 3bytes and then copies the scratchpad to eeprom...what for?

And why it should be done for proper DS18B20 work?

I'm having trouble using a DS18B20, all it gives me is the power up state temperature reading: 0x0550->85ºdegrees. Any ideas of what the problem may be?

Thanks*
Alioshag

Joined: 23 Feb 2009
Posts: 5

 Pls Help!! Posted: Mon Feb 23, 2009 3:32 am I used the code posted by scanan and all what I get on the serial port is "Temperature =10.6" I'm using a PIC16F628A and a DS18S20P. is this DS18S20P compatible with DS18S20 or DS18B20? pls answer to me.
Alioshag

Joined: 23 Feb 2009
Posts: 5

 DS18S20 and DS18S20P Posted: Mon Feb 23, 2009 7:34 pm are these two sensors incompatible? I get only one constant temperature even if I heat the sensor
pyu

Joined: 04 Feb 2009
Posts: 51

 Posted: Wed Feb 25, 2009 2:24 am DS18S20P - derives power from dataline (parasite power), and is not need power supply, pin 3 is NC. Did you used this sensor in parasite mode or not? For more info see: http://datasheets.maxim-ic.com/en/ds/DS18S20-PAR.pdf http://datasheets.maxim-ic.com/en/ds/DS18S20.pdf
Alioshag

Joined: 23 Feb 2009
Posts: 5

 Posted: Sun Mar 15, 2009 5:26 pm I used this sensor in normal mode, I used all the 3 wires and I used a 10K pull up resistor; that's all I've made.
pyu

Joined: 04 Feb 2009
Posts: 51

 Posted: Mon Mar 16, 2009 2:01 am if you use DS18S20P, you shouldn't use all 3 pins.
Alioshag

Joined: 23 Feb 2009
Posts: 5

 Posted: Mon Mar 16, 2009 9:24 am I saw many people on internet having problem with this DS18S20P sensor, and they all didn't succeed to solve their problem. The DS18S20P sensor is not compatible with the DS1820 or DS18B20. That's all what I found about this difficult to use sensor. Is there anyone who managed to use this sensor (DS18S20P)? If it's so, pls post some schematics or code, or both. . Thanks a lot.Last edited by Alioshag on Mon Mar 16, 2009 10:01 am; edited 1 time in total
pyu

Joined: 04 Feb 2009
Posts: 51

 Posted: Mon Mar 16, 2009 9:27 am Why didn't you use DS18B20 ? It has almost the same price.
Alioshag

Joined: 23 Feb 2009
Posts: 5

 Posted: Mon Mar 16, 2009 11:20 am I got it as a free sample.
Borke

Joined: 31 Mar 2009
Posts: 1

 Posted: Tue Mar 31, 2009 7:44 am I'm having problems with output_high(), output_low(), output_bit(), output_float(), shift_right().... and delay functions. Compiler is not recognizing this functions. I get "undefined symbols" error. I use PIC12f629 and I 've included its .h file. Compiler is HI-TECH STD and I use MPLAB. Where can I find their definitions, or how can I cope with that? Can somebody help me?
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 6 HoursGoto page Previous  1, 2, 3, 4  Next Page 2 of 4

 Jump to: Select a forum Software----------------General CCS C DiscussionCode LibraryEZ App LynxBest OfKnown Issues Hardware----------------CCS ICD / Mach X / Load-n-Go
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum