destroyedlolo / OWBus

Maxim's One Wire bus handling for arduino
Other
4 stars 3 forks source link

Feature request: DS28EA00 Chain mode #5

Open JesFo opened 1 year ago

JesFo commented 1 year ago

If this library isn't abandoned yet? Could support be added for DS28EA00 chain-function?

destroyedlolo commented 1 year ago

No, it's not abandoned, it's only it's stable and suit my usage, so don't have any forecasted update. What is your need about the chain ? Because, nobody seems having usage if this feature (checked on OWS mailing list and some hobbyists' forum).

JesFo commented 1 year ago

I just happen to have a use for the chain feature. I have over 120 sensors on a single bus, and currently i have to assemble my ID table manually by testing each sensor individually.

destroyedlolo commented 1 year ago

Ha, ok. I don't have spare DS28EA00 but will command some new ones. But it will take time as I have a lot of things to do. Alternatively, you may implement on your side and I'll merge your changes.

On the other way, 120 probes on a single GPIO ? Do you use any driver ? Because it looks like a large network for a GPIO : my own network has about 40 probes spread on 70m bus, and I'm using an DS2482-100 / 800 to avoid bus electrical issue. The head is a Linux SBC by the way

JesFo commented 1 year ago

So far I haven't yet implemented a full DS28EA00 version of the hardware. However, I am currently using 128-DS18B20 devices over a single OneWire bus without any problems.

The chain feature is what prompted me to switch over to DS28EA00 from DS18B20, as for the 128-piece DS18B20, I had to assemble a sort of "programming jig" to read each device ID by powering them individually through a probing pad on the bottom side of my temperature sensor PCB. This however also needs a diode for each sensor to prevent the jig from powering the whole chain through the test-pads. So far, I've been trying to figure out the DS28EA00 chain feature on a smaller scale of 10-sensors on a single bus, before comitting to replacing all the 128-DS18B20 sensors I currently have on the bus.

I first prototyped the system on a STM32-Nucleo devkit, before porting it to an ESP32 devkit with POE, which surprisingly is sufficient at powering the whole array of 128-DS18B20 sensors.

destroyedlolo commented 1 year ago

Hello,

Some (bad news) update : I got only one EA00 left so not enough to test CHAIN : the price is a bit high and, more than all, I don't have the time to test.

Anyway, it doesn't seem so difficult to implement : in class DS28EA00 (/src/OWBus/DS28EA00.h), following function need to be implemented :

  1. chain_start() - issue CHAIN then CHAIN_ON then ~CHAIN_ON - it will put the 1st EA00 is chain mode.
  2. Doing a bus scan will return the first address
  3. if you got a valid address, chain_next() - issue a CHAIN then CHAIN_DONE then ~CHAIN_DONE and loop to step2 to get next address.
  4. if you got an invalid address, no more probe so chain_end() - issue a CHAIN then CHAIN_OFF then ~CHAIN_OFF to return to normal mode.

If you patch the library, don't hesitate to issue a patch request :)