Hello Martin, Thank you for the advice. I've eventually traced the problem to an interrupt routine in another file ( I'm using mplink to build the project) disabling *this* gives me 100% reliability reading the 1820. At the moment the 1820 is on the same stripboard as the PIC but eventually I want to put it in my wifes greenhouse and run 15 metres of cable back to the house. Then I will know how good my routines are ! Best Wishes Steve Allard Martin Buehler wrote: > try to slow down interface timing, if you have more than half a meter of > cabling. > i use about 20 ds1621 on a f84 with up to 20m of cabling and run the whole > thing at a clock frequency of 1kHz. > also try to use serial resistors (a few 100 ohms) on the bus to reduce > switching current. > tino > > Steven Allard > Gesendet von: pic microcontroller discussion list > 15.12.01 12:50 > Bitte antworten an pic microcontroller discussion list > > An: PICLIST@MITVMA.MIT.EDU > Kopie: > Thema: [PIC]: DS1820, 16F873 and CC5X > > Hello all, > > I've written some routines to talk to a DS1820 thermometer. The program > works 95% of the time, the other 5% it returns 0xFF for all the > scratchpad locations. ie the 1820 is not responding, although the > presence pulse after the master bus reset is OK. > > As far as I can tell the routines are correct I've checked the timing > etc. > > I've also tried not using the ICD, and disabling interrupts, while > reading/writing. > > Can anyone tell me whether its a problem using portA. I'm using a 4K7 > pull up resistor and the port is configured for digital > (ADCON1=0000.0110). > > Best Wishes > > Steve Allard > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu