I'd like to use RPi as 1-wire slave for my home project. Do you think it is feasible? If yes then how to configure device tree to reuse the same pin for 1wire slave as it is for 1wire master (gpio 4)?
Thanks for any comments on that.
I would imagine not, simply because there would likely have been some report back of success given the bragging rights which would deservedly go with having achieved that.
Thank you very much!hippy wrote: ↑Sun Dec 30, 2018 7:04 pmI would imagine not, simply because there would likely have been some report back of success given the bragging rights which would deservedly go with having achieved that.
A 1-wire slave is theoretically possible even without built-in hardware to support it. It can be done with bit-banging on a dedicated microcontroller, but I am not sure if that could be achieved on a Pi while running a multi-tasking OS.
I can't be sure of the exact figures off-hand but recall the slave must respond within 15us of seeing a signal transition from the master and the slave has to be responsive enough to continually keep up with the master-driven communication's sequence. That's easy enough with a fast dedicated micro but potentially a pain if an OS is taking control away from the slave handler code or preventing the required responsiveness.
I can't give a definitive answer because doing highly responsive bit-banging with a Pi is not something I have really looked into. It could be possible, perhaps by running code in the GPU or even a dedicated ARM core. One would be into 'niche skill-set' territory there.
One could likely produce a bootcode.bin which can make a Pi a dedicated 1-wire slave controller by running entirely in GPU or using ARM bare-metal but that is probably not that useful.
The easiest approach to having a Pi work as a 1-wire slave, while running a general purpose OS, would probably be to add a suitable microcontroller which can act as the 1-wire slave and pass data between the two. How useful that would be would depend on what data you wanted to deliver.