DallasTemperature Library & DS18B20

I have a system monitoring 3 DS18B20 temperature probes using the DallasTemperature library (the latest version from MilesBurton.com) and using the PID Control library.

I also have 4 buttons and an LCD (amongst other things) controlled by the Arduino. The temperatures are read every second, and I scan for button presses (they are used as soft keys for my user).

Most of the time the system works well.

However, once about every 8 to 10 start-ups, the system becomes unresponsive. I've narrowed the problem down to the temperature library.

It becomes unresponsive when the temperature readings take too much time - the DallasTemperature libraries have delays incorporated in them according to the resolution set (from 9 to 12 bits). The higher the resolution, the longer it takes. WIth 9 bit resolution, the system is responsive enough for 1 second temperature readings. So I force 9 bit resolution at startup.

However, it seems like the appropriate resolution is not always configured properly in the scratchpad. I've tried adding delays after the call to DallasTemperature::begin (when the resolutions are sent to the devices), but that doesn't help. It really seems like an initial configuration problem, as sometimes I get totally off temperature values also.

Has anybody encountered this problem before? Does anyone have a clue?

I've opened the DallasTemperature code right now and trying to figure out what's going on to no avail.

Thanks for any help.

P.S. I've got the sensors mounted in parasite mode, with a 4.7k resistor. The wire length is tiny (for now as they are on a breadboard) but I will mount them on 3 ft wires soon. I'm going to try regular (non parasite) mode to see if it helps.

The temperature library has hardwired delays in some of its functions which probably wreaks havoc with trying to read button presses. I butchered the library so it doesn't have the delays and allow for the latency of the devices in the main sketch without using delay. Can't afford to have the arduino effectively shutting down for nearly a second at time......