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

SoftwareBitBang short circuit risk #160

Closed
filogranaf opened this Issue Dec 29, 2017 · 8 comments

Comments

Projects
None yet
2 participants
@filogranaf

filogranaf commented Dec 29, 2017

When using only one cable, can short circuits occur when two devices try to write different bits at the same time? Should not some transistors be used or do the pull down resistor be taken to bring the voltage to zero without setting the output pin directly to zero?
Thanks in advance

@gioblu

This comment has been minimized.

Owner

gioblu commented Dec 29, 2017

Ciao @filogranaf the pull-down resistor is there to ground potential induced interference bringing the bus state high (it must be low for other devices to start transmission). Before packet transmission there is a polling timeframe where the bus state is checked and transmission starts only if bus state was always low. After polling the transmitter sends 3 synchronization pulses where potential collision is checked 3 times. For each transmitted byte a collision check timeframe is present to abort reception if a collision or interference occurred. Collision and so short circuits can potentially occur but the chances of their occurrence and their duration is minimized by the scheme described above. Extended tests demonstrate that this procedure can be applied in production for long periods of time supporting high reliability.

@gioblu gioblu added the question label Dec 29, 2017

@filogranaf

This comment has been minimized.

filogranaf commented Dec 30, 2017

Thanks for reply.
To avoid any risk of damage it would not be enough to avoid setting the output pin to 0, allowing the pull down resistor to act? in the code it would be sufficient not to use digitalWrite (pin, 0) and set the pin in read mode to make the pull down rest act. This would avoid the condition 2 described in https: //www.rugged-circuits.com/10-ways-to-destroy-an-arduino/

@gioblu

This comment has been minimized.

Owner

gioblu commented Dec 30, 2017

CIao @filogranaf I know about the article you have linked and the points it describes.
I have never seen a single pin failure in 7 years of testing and I am not aware of any user have experienced this issue although really complex setups are present worldwide.

It could be possible to switch to input low, instead of output low but that would add an additional variable timeframe influencing binary timing. Pin mode change duration is extremely variable depending on the microcontroller used, so then would be more difficult for different architectures to achieve synchronization.

Thank you for your reply.

@filogranaf

This comment has been minimized.

filogranaf commented Dec 30, 2017

One last note ... the reading mode for 0 could be used to detect conflicts immediately (it must remain at 0 for the duration of the bit) and immediately stop the transmission without waiting for the ack.

@gioblu

This comment has been minimized.

Owner

gioblu commented Dec 30, 2017

ciao @filogranaf I have explored the possibility of switching to input while transmitting, in my tests I have noted that this change adds an architecture related timeframe (the pin mode switching time) that makes much more difficult to let all supported mcus to effectively communicate with acceptable accuracy. But I will try again in the next iteration.

Obviously, can be added a current limiting resistor to each pin feed to reduce the maximum current drain to match the suggested rating of the hardware pin used if that is feasible considering the pin threshold voltage, required transmission range and medium resistivity.

To receive a digital high pulse PJDL needs only its digital threshold voltage to be exceeded and obviously its timing to be coherent with its constants. A voltage drop of more than 1 volt does not effect its procedure, a nice fast test showing this is to try to act as communication medium touching with the left hand the port of a device, and with the right the port of the other. Generally PJDL is able to operate through a living body with a consistent voltage drop and distortion due to human body resistance and capacitance.

All this to say that simply a current limiting resistor can be applied to protect each pin from any potential overcurrent without affecting PJDL procedure if that is required.

@gioblu

This comment has been minimized.

Owner

gioblu commented Dec 31, 2017

Ciao @filogranaf thank you for pointing out, added the missing documentation about the optional use of current limiting resistors. I have tested practically over a 20m bus, 180Ω resistors on each pin end are not affecting transmission reliability. I have tested also with 1KΩ and 15KΩ on 20m range and it also works fine as well. So I expect the practical maximum range to be well beyond 50 meters using 180Ω current limiting resistors,

@gioblu

This comment has been minimized.

Owner

gioblu commented Dec 31, 2017

Closing, feel free to reopen if you consider that necessary.
Happy new year 👍 and thank you for your support.

@gioblu gioblu closed this Dec 31, 2017

@gioblu gioblu added the enhancement label Dec 31, 2017

@filogranaf

This comment has been minimized.

filogranaf commented Dec 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment