Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code writes HIGH to bus, when it probably should not #1

Open
positron96 opened this issue Mar 2, 2014 · 4 comments
Open

Code writes HIGH to bus, when it probably should not #1

positron96 opened this issue Mar 2, 2014 · 4 comments

Comments

@positron96
Copy link

Hello. I noticed DIRECT_WRITE_HIGH call in sendBit. Shoul not it be changed to DIRECT_MODE_INPUT to make bus float? The specs say that devices should not (and do not have to) pull the bus high. This issue will probably break my project where an raspberry master (with 3.3V) communicates with arduino slave (by pulling the bus to 5V arduino will probably damage rpi).

@positron96
Copy link
Author

@MarkusLange
Copy link
Owner

It has to call DIRECT_WRITE_HIGH to send the bit that has to be send, and yes it will kill your raspberry pi input you will need an levelchanger or an uC running at 3.3V to use it save

@positron96
Copy link
Author

Could you explain why it has to write high? High level should be provided by external pullups on the bus automatically without software intervention if I am not missing anything.

@orgua
Copy link

orgua commented Feb 24, 2016

just for the record: this is a bug, since the bus is used only as open-drain by master and slaves. if someone wants to communicate, the bus will be pulled low, the HIGH part comes from the PU-Resistor.
if you replace this line with DIRECT_INPUT it will work as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants