You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I figured out that currently, the configuration is never stored in EEPROM.
There is a little burden in the library, in cpp file, in this function:
void DallasTemperature::writeScratchPad(uint8_t* deviceAddress, const uint8_t* scratchPad)
{
_wire->reset();
_wire->select(deviceAddress);
_wire->write(WRITESCRATCH);
_wire->write(scratchPad[HIGH_ALARM_TEMP]); // high alarm temp
_wire->write(scratchPad[LOW_ALARM_TEMP]); // low alarm temp
// DS18S20 does not use the configuration register
if (deviceAddress[0] != DS18S20MODEL) _wire->write(scratchPad[CONFIGURATION]); // configuration
_wire->reset();
----- HERE SOMETHING MISSES ----
// save the newly written values to eeprom
_wire->write(COPYSCRATCH, parasite);
if (parasite) delay(10); // 10ms delay
_wire->reset();
}
After the second reset (before comment " // save the newly written values to eeprom") you should add that:
_wire->select(deviceAddress);
Otherwise, the copy command is never received.
Hope It helps.
Damien.
The text was updated successfully, but these errors were encountered:
Hello,
I figured out that currently, the configuration is never stored in EEPROM.
There is a little burden in the library, in cpp file, in this function:
void DallasTemperature::writeScratchPad(uint8_t* deviceAddress, const uint8_t* scratchPad)
{
_wire->reset();
_wire->select(deviceAddress);
_wire->write(WRITESCRATCH);
_wire->write(scratchPad[HIGH_ALARM_TEMP]); // high alarm temp
_wire->write(scratchPad[LOW_ALARM_TEMP]); // low alarm temp
// DS18S20 does not use the configuration register
if (deviceAddress[0] != DS18S20MODEL) _wire->write(scratchPad[CONFIGURATION]); // configuration
_wire->reset();
----- HERE SOMETHING MISSES ----
// save the newly written values to eeprom
_wire->write(COPYSCRATCH, parasite);
if (parasite) delay(10); // 10ms delay
_wire->reset();
}
After the second reset (before comment " // save the newly written values to eeprom") you should add that:
_wire->select(deviceAddress);
Otherwise, the copy command is never received.
Hope It helps.
Damien.
The text was updated successfully, but these errors were encountered: