Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

When bit-banging I2C using 2 PIO lines do these lines still need to be pulled high? Obviously using a dedicated I2C bus the lines must be pulled high as the pins are open-drain outputs but PIO pins aren't open-drain.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Yes, both lines need to be pulled high at all time.

Also, when bitbanging I2C, rather than switching the LOW/HIGH states of the pin, switch between LOW/HiZ by simply altering the DDR/DIR registers.

share|improve this answer
    
The data pin needs to be pulled high, but not necessarily the clock. –  Erik Friesen Mar 19 at 10:19
    
Why is that? Well, I guess, if you only have one master, don't account for slave-induced clock stretching, etc. –  Dzarda Mar 19 at 10:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.