Go Down

Topic: software I2C for analog pins (Read 379 times) previous topic - next topic

crazyman2012

Hey community,

Can we use analog pins in Atmea2560 for software I2C? I have used digital pins and they work perfectly fine but have not tried with analog pins.

Thanks

sterretje

Please explain why you want to use Software I2C.

I'm not sure about the answer, I think it's yes. You can easily test; hook a device up and write a little test code.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

pylon

Quote
Can we use analog pins in Atmea2560 for software I2C? I have used digital pins and they work perfectly fine but have not tried with analog pins.
Depends on the software you're using (you forgot the link!).

For SoftI2CMaster you can use only the lower 8 analog inputs, if you want to use all analog input pins, you must use the slower bit-bang emulation.

But in most situations you did something wrong if you need a software I2C emulation. Provide more information about your case, maybe we can show you an alternative solution.

adwsystems

Isn't I2C already on the analog pins (A4/A5)? Why would you apply SoftI2C to the analog pins where it resides naturally?

pylon

Isn't I2C already on the analog pins (A4/A5)? Why would you apply SoftI2C to the analog pins where it resides naturally?
No, those pin sharing is only on the UNO (ATmega328) but not on the Mega2560 OP is using.


Go Up