1-Wire Slave

It's about time to move some dust.

Moving from this Arduino и 1-Wire - эмуляция ведомого устройства с помощью библиотеки OneWireSlave – RoboCraft way there to this https://digistump.com/board/index.php/topic,887.0.html. Thanks to all that Guys what they did.

I was able to start this. Files in the Attachment.

DS18B20_Slave.ino --> the Slave in Arduinostyle
OneWireSlave.cpp/.h --> the library for it
(did not work on Due or Teensy 3)

DS18x20_Temperature_edited.ino --> an little edited Version of Paul Stoffregen's File from the last OneWirelib (2.2)

The Arduino pretend on with the DS18B20_Slave to be an DS18B20 with an temp of 155°C (clearly above the capabilities of the DS18B20 (125)) parasite powered. But under heavy duty.

What didn't work is the DallasTemperature Library from Miles Burton there are some problems with reset_search and the reset at the end of some parts.

// reads the device's power requirements
bool DallasTemperature::readPowerSupply(uint8_t* deviceAddress)
{
  bool ret = false;
  _wire->reset();
  _wire->select(deviceAddress);
  _wire->write(READPOWERSUPPLY);
  if (_wire->read_bit() == 0) ret = true;
  _wire->reset();     --> this line is not good fore the cloned DS18B20 without it works
  return ret;
}

May someone can help drive this forward to getting an working and universal library. Perhaps an interrpt driven Initiaization Timing can bring success but I'm not an expert for that.

This is really experimental. Nothing is convenient on this.

Pictures below:

DS18B20_Slave.ino (1.11 KB)

OneWireSlave.h (1.88 KB)

OneWireSlave.cpp (18 KB)

DS18x20_Temperature_edited.ino (3.12 KB)