OneWire slave interrupt based lib

Working libraries, libraries being ported and related hardware
Post Reply
fari
Posts: 23
Joined: Sun Feb 26, 2017 12:01 pm

OneWire slave interrupt based lib

Post by fari » Tue Feb 28, 2017 10:09 pm

Hello everybody!

I have migrated the library of Youen Neuoy to STM321f103 (Arduino). You have got the advantage, that the polling does not bloc your micro, since the onewire communication is interrupt based. The attached example simulates the DHT22 sensor
Some timing constants have to be adjusted, if you change your Arduino compiler options!
I have fixed one bug, which caused a total deadlock of the onewire network. Still there are few telegram errors (app. 1%)
Unfortunately I do not own a logic analyser and could not trace the cause of erroneous telegrams .

I have signed into gitHUB and will upload the library soon!
Attachments
OneWireIOSlave.zip
(48.42 KiB) Downloaded 101 times

User avatar
RogerClark
Posts: 7178
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: OneWire slave interrupt based lib

Post by RogerClark » Tue Feb 28, 2017 11:31 pm

Wow

Thanks for posting

I2C slave is / was a noticeable gap in the core functionality

youen
Posts: 2
Joined: Mon Apr 24, 2017 10:32 am

Re: OneWire slave interrupt based lib

Post by youen » Mon Apr 24, 2017 10:38 am

@RogerClark I suppose you meant 1-wire and not I2C ?

@fari Thanks for the fix of the deadlock, I observed it a few times and had another report of the bug, but didn't find the time to really look at it yet. I'm curious of what it was, I'll compare your version to see what you did. You don't mind if I merge that on github? Or maybe you want to commit your work on github first to properly appear in the commit history?

youen
Posts: 2
Joined: Mon Apr 24, 2017 10:32 am

Re: OneWire slave interrupt based lib

Post by youen » Sun Apr 30, 2017 7:30 pm

I've merged the deadlock pull-down fix from fari, or so I hope. If I understand correctly, it was a problem when getting back to "waiting reset" state, if the pin was previously pulled down due to ongoing communication, it would remain in this state forever, also preventing other devices to use the bus. But let me know if you fixed something else ; it's difficult to confirm the bug is fixed since it's quite rare (I think it happens only in case of communication errors).

I've pushed it on github, since fari distributed it under MIT license as well :)

fari
Posts: 23
Joined: Sun Feb 26, 2017 12:01 pm

Re: OneWire slave interrupt based lib

Post by fari » Fri May 05, 2017 3:07 pm

Thanks Youen! I hope, that every one can use this library with stm32
Sorry! I had no time to archive my bug fix of the 1- wire lib in git!

User avatar
RogerClark
Posts: 7178
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: OneWire slave interrupt based lib

Post by RogerClark » Thu Aug 03, 2017 5:02 am

Just trying to tidy up what libraries we had, I came across this.

If I get time I will add it to the repo, but I dont have time to test it

Post Reply