µC - Temperature Sensor DS18B20

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
4.3 V for the Low part of the loop is not correct. Logic low is less than 1V (@ 5 V supply).
Exactly this is why I'm confused. :confused:

Make sure nothing else is connected to RC1 but the meter.
I've checked and double checked, there is nothing else on RC1 line.. except one solder blob for the link wire which goes to DQ.

So maybe it is faulty? How can I test this.
 

DatLe

May 31, 2016
15
Joined
May 31, 2016
Messages
15
RC1 pin is pushpull output pin or open drain pin in PIC.
1.Testing RC1 toggle output, nothing else connect.
2. Add pullup resistor, test again.
3. Add DS18B20, test again.
You have to make sure that every thing is OK before start next step.
How about RC0 pin, in case of failure, change to RC0.
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
1. RC1 Toggle output nothing connected - HIGH 2s -> LOW 2s...
2. RC1 Toggle output with pullup 5V - HIGH 2s -> LOW 2s...
3. RC1 Toggle output with pullup & DS - 5V 2s -> 4.2V 2s...

Using code below.

Code:
#define _XTAL_FREQ 4000000
#include <htc.h> 
#include <pic.h>
__CONFIG(FOSC_XT & WDTE_OFF & PWRTE_OFF & CP_ON & BOREN_OFF );

void main()
{
    TRISC1 = 0;
    while(1)
    {
    RC1 = 0;
    __delay_ms(2000);
    RC1 = 1;
    __delay_ms(2000);
    }
}

This is the same results using RC0. I think I might grab a few more DS18B20's to rule out the possibility of a damage component.

I also used an oscilloscope to see if the DS was giving a presence pulse, but got 4.2V like before. See below:

DS_Oscill.jpg
 

DatLe

May 31, 2016
15
Joined
May 31, 2016
Messages
15
May be when you drive output is 0, DS will be drive DQ pin as output, and conflict. Try read bit and write bit. If result is not good, current DS may be problem. Replace new device.
Currently, I think control output and input is OK.
 
Top