A5 & A4 fried. Is I2c still possible?

To get to the auestion , go to anyways. To get what I have tried already disregard this message

Hey everyone. The title pretty much says it. I some how managed to fry either the A4 or A5 pins. Im making a VR headset with gyroscopic head tracking and I'll need i2c for communicating with the gyro. I'm running a standalone atmega328 with a USB to serial TTL convertor for communication with the computer, however I'm still using the arduino IDE because I love it so much, and its easier to use than just bare avrdude.

Anyways, I had another working atmega328 with fully working pins but completly bricked as I was debugging serial communication. I tried using my attinys for the same task, but could only get the serial communication to work, through the software serial library. I tried using the USI to do i2c communication with the tinywire library, I couldn't get the gyro to show up on a i2c scanner. Pretty much I just want to know if I can use the other working analog pins on the atmega for i2c. Like some type of emulator for analog pins 5 or 4, what ever one I fried. I would have some test results for you but I don't know where to start...

I have done some research and it seems that there may be something that works like software serial, the software i2c library. But I don't know if it'll work if the pins are fried. I havnt tested it yet. I'll try when I get home. I'm at school right :(. If anyone has any advice on his to get i2c working on either a partially charred atmega328 or a attiny85 please let me know.

Thanks for reading!

If you use the software I2C library, you're no longer restricted to which pins you have to use, so you could move to pins that you think are still good...

Although... chip damage is difficult to quantify exactly; anything that friend some pins may have done arbitrary internal damage to other parts of the chip. Spending too much time working with a chip that is known to be "partially bad" can be a wonderful way to waste a lot of time.

I think soft i2c is designed to use other than a4/a5 so you can have separate i2c busses.

Time to order some spare parts. See which is closer to you, digikey.com in MN, mouser.com in TX, or dipmicro.com in Niagara Falls. Digikey & Mouser can ship blank parts same day, $4-5 for shipping. Dipmicro is sometimes same day; but, they have bootloaded parts if you don't have bootloading capability, or a Programmer for direct sketch loading (File:Upload Using Programmer) with no bootoader. Also cheap shipping, no sales tax.

I think Mouser had the best price for atmega328P-PU last time I checked, $3.70, and no sales tax. Digikey is the same now, but charges sales tax. Dipmicro has Uno (& Duemilanove) bootloaded parts for $3.89. Deal! Also 22 pF caps (50V), 100nF caps (100nF), 16 MHz crystals, 10K pullup resistors, sockets, perfboard, voltage regulators, power supply, barrel jacks, all easy to find making a standalone board. Headers too. Digikey & Mouser do too, but you really have to know what you're looking for.

Thanks for the fast replys :D so judging by what you guys have said, I'll try software serial on the atmega and it should work as long as no huge damage has been done to the chip. I honestly don't know how I did the damage actually :/ but I can still upload through the ISP and get serial information from the TTL tx and and rx pins and thats all I need to do the project lol. I just hope that I can get the i2c working. If not, does anyone know if the attinys are compatible with software i2c using their USI interface? But I guess if you can switch to any pins you want, it would even need USI, right?

There is soft I2C (for any pin - something like SoftI2CMaster library), but you do need to tweak the library to make it work. I2C can be done through the USI on ATTiny's- I use the TinyWireM library for that. Again, minor tweaks to the library are needed. (

The library changes are find/replace (replace "Wire" with "TinyWireM", or whatever you named the instance of SoftI2CMaster). There are a few examples of doing this in my github - https://github.com/SpenceKonde?tab=repositories of course, in those examples, I assume that any chip that has hardware I2C will use it, as you can see from the ifdef's in the .h file.

I would strongly recommend, however, that you just get a working chip! Arduino clones, particularly '328p based ones, are really really cheap. Of course, if you have a board where you can replace the chip, snag an Arduino-bootloaded '328p, and use that. As others have mentioned, if there is damage to the chip, you'll often discover more damage later - after wasting hours throwing time down a rathole assuming the problem was your code or wiring.