One-Wire Bus Problem
Posted: Fri Aug 17, 2012 8:37 pm
Hi Matrix Team,
I have some trouble getting the one-wire bus to work. I'm using the following hardware:
1 x PIC18F8722 TQFP 80
4 x DS18B20 Temp. Sensors
I'm using this setup ( see pics):
![Image](http://i47.tinypic.com/358zbmf.jpg)
The first cable from the main controller to the sensor box is about 2 meters long the cable of the sensor is about 1.5 meters long so in total of 3.5 meter cable.
I can read succesfully 1 temperature sensor but thats not the problem,
If I use the busreset, scanbus and get device count it never does what Im expecting for example:
Example 1:
no cable and no sensor box are connected thus no sensor is connected. with my current program you should think that the busreset macro returns a value greater than zero because no device can be detect because there is nothing to be detected.
![Image](http://i49.tinypic.com/20ubqds.jpg)
But it never does the variable onewire_Busreset is first initialised with a value of 255 so this I dont understand
The same is for get device count it always returns 0 if I connect two sensors its says 0 if I connect one sensors it says 0 so this I dont understand![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
With the one wire component not working properly its not possible to use the four temperature sensors, hope this problem can be solved.
If it helps I have the one wire bus connected to Port B at Pin 5
Regards Jordy
I have some trouble getting the one-wire bus to work. I'm using the following hardware:
1 x PIC18F8722 TQFP 80
4 x DS18B20 Temp. Sensors
I'm using this setup ( see pics):
![Image](http://i47.tinypic.com/358zbmf.jpg)
The first cable from the main controller to the sensor box is about 2 meters long the cable of the sensor is about 1.5 meters long so in total of 3.5 meter cable.
I can read succesfully 1 temperature sensor but thats not the problem,
If I use the busreset, scanbus and get device count it never does what Im expecting for example:
Example 1:
no cable and no sensor box are connected thus no sensor is connected. with my current program you should think that the busreset macro returns a value greater than zero because no device can be detect because there is nothing to be detected.
![Image](http://i49.tinypic.com/20ubqds.jpg)
But it never does the variable onewire_Busreset is first initialised with a value of 255 so this I dont understand
![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
The same is for get device count it always returns 0 if I connect two sensors its says 0 if I connect one sensors it says 0 so this I dont understand
![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
With the one wire component not working properly its not possible to use the four temperature sensors, hope this problem can be solved.
If it helps I have the one wire bus connected to Port B at Pin 5
Regards Jordy