I2C bitbanging in C

Questions on control of serial busses
Post Reply
YahooArchive
Posts: 1463
Joined: Fri Oct 19, 2012 5:11 am

I2C bitbanging in C

Post by YahooArchive » Fri Jan 25, 2013 3:48 pm

>from help line
> i am having difficulty configuring the I2C bus. Which pins
> physically on the board should i use and which ones would
> they correspond to in the software? Also i run the software
> in the Csample.c and at case 41 it finds an I2C device
> though there isn\'t one connected. The sensor that i am
> using is the SRF08 ultrasonic range finder.

While there is hardware to do i2c, we usually use bit banged software to do i2c.
This allows us to use any 2 pins, and the overhead is not that much compared to
the setup of the dedicated hardware.

When you do i2c to a floating pin, it may decide a device is connected, as it
assumes the data pin would be pulled high by a resistor if no device answers.

When that pin is floating it will probably look like a device has responded.



Post Reply