I have written this code for a friends hot water system which incorporates a solar water heater and water heated radiators.
The system itself is fairly straight forward, there are 3 temperature sensors (DS18B20), 1 in the solar hot water heater and 2 in the hot water cylinder.
My code scans the 1 wire bus and maps the temperature sensors according to whatever the user has previously configuring using the LCD and 2 buttons.
Initially the system works fine, but after a while the Serial number for the TOP sensor (ee_TOP_sensor_Serial_addr) gets set to zero. My friend has indicated that the solar system can go above 125 degrees celsius (which is what the DS18b20 is rated up to), but seems to think that the corruption doesn't necessarily happen when this temperature exceeds the limit of the DS18B20.
Here is my main code for you to peruse at your leisure and give me any pointers as to where there might be a problem.
Main.c file attached. Thanks in advance.