|
After playing around a little bit, I found the following method...
Lets say you want to read SDA on pin 16. You can read INL0 (contains input values for pins 0 to 31) into a variable and shift right 16 digits and always read bit 0 of the result.
SDA_Read = INL0 >> SDA SDA_Value = SDA_Read.Bit0
It works, but the overhead makes my overall bit banged I2C function* take about 2.5 times longer than an otherwise slow I2C read. Any ideas on how to lessen the overhead or another approach?
* This is being done to support a non-standard slow sensor which doesn't work with the built-in SW I2C functions and probably wouldn't even work with HW I2C because of the speed. The sensor also has a complete inability to change its address, and there is a desire to support 2 of these sensors which requires they be placed on different input pins.
|