PDA

View Full Version : DS18B20s on 876 portc



anj
- 7th May 2004, 04:52
Gday
I have been playing with a circuit to measure temp and output 2 PWM streams based on relative deltas of temps.
I currently read the DS18B20s on ports B0, C4 and C5, as that was the neatest PCB layout. The DS18B20s are powered via pullups from Vsupply so have adequate power. The sensors are also built into a 3.5mm stereo plug and the pullup is close to the sensor, as the sensors are designed to be removable/hot swappable during operation.
All worked well during testing, however, as soon as i used an extension cable for the sensors ( approx 1.8m stereo cord ), the sensor on port c4 stopped working. I have found i can get it to work by reducing the value of the pullup resistor, but this now appears to be affecting the reading. I am currently doing more testing on what value works.
I have read the manual, and note that portC4 is slightly different to c5, but not for std I/O. I have checked all the SSP bits etc that may be affecting its operation.
I also noted that the portC units are ST and the portB is TTL, however, it all works well on all ports if the sensor is close to the PIC but fails on portc4 ( only ) if i use the extension. The weak pullups on portB are disabled.
What other potholes could i be falling into here????
Andrew

Just a follow up, i have reduced my prog to test only the portC pins, and all work if sensor/pullup are close to pic, and all fail if on the end of a 1.8m cable. Still works OK on portb so is there a reason for this??? Ie, if using 1 wire devices, shld you only use TTL style pins? Next step is to try a CRO and see whats happening to the voltage levels, but thats for tomorrow.
Andrew