OpenWrt Forum Archive

Topic: I2C Device Seen at Every Address - Cooked Chip? [Solved]

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Edit: Solved, popped in a different chip and this time used the PCF to drive the LEDs (sourcing current from the PCF) as opposed to sinking (LED connected to + and sourcing ground from the PCF).

Interestingly on mine it doesn't tell you what GPIO numbers are available like in some examples after creating the new_device. It created a new directory in /sys/class/gpio called gpiochip56 so I was able to deduce that pin 0 on the PCF was gpio56, pin 1 was gpio57, etc.

I2C is a real slick setup on this limited GPIO routers to use just 2 wires and these cheap chips to get a ton more GPIOs. Many thanks to those who developed the modules for i2c and pcf class chips!

Original post...
I'm having some trouble getting an I2C expander to work on a GL Inet router and I'm hoping someone can give me some pointers. I had it all working until I shut it down after noticing the chip was getting very hot after enabling an led. Now i2cdetect is reporting a device at every single address. More details in my latest replies, but does it sound like I cooked the chip, a portion of the router, or?

(Last edited by bizee on 22 Nov 2016, 07:45)

I pieced together enough info off google thinking I had this licked, at least to be able to detect the expander. I installed all of the gpio/I2c packages, wired up the expander per the pinouts and compared to a couple wiring diagram example projects. I included the pullups on data and clock as well.

I am using a Glinet 6416 as my test unit and soldered header pins to Ground, 3.3V, Pin 20 (for SDA), and Pin 19 (for SCL).

# insmod i2c-dev
# insmod i2c-gpio-custom bus0=0,20,19
# i2cdetect 0
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
It found nothing at any address. I expected it to detect it on 0x38 since I have a PFC8574AP and wired A0, A1 and A2 to ground.

The expander is getting power, grounds are good, everything appears to be good. I'm wondering if I'm missing something else?

Any ideas on what it could be or troubleshooting. I guess I can hook my logic analyzer to the data and clock when I scan and see if anything shows up there.

So I hooked my logic analyzer up and was able to capture data flowing across SDA and SCL. This would indicate to me that GPIOs are functioning properly, but for whatever reason the device is not recognizing the expander. I'm not sure where else to go from here except replace the expander to see if it is bad. I've checked all the wiring so unless I'm working off a bad set of instructions or wrong pinouts I'm not sure what the next step is. Any ideas? Could it be a setting or something with device that is preventing it from detecting it?

Replaced chip, worked now! Yay!

I think I've got it figured out how to write to the GPIO as outputs. I just need to figure out how to read them inputs now.

So just when I was ready to celebrate because I got it working and successfully turned on a LED, things went weird.

I tried turning off the led by echo'ing 1, 0, etc. Couldn't control it. I unexported it, and but then when I exported back I could not set "direction", it said it did not exist. Very weird. I'm thinking maybe something was a little loose and I touched the expander and it was HOT, nearly too hot to even touch. I powered everything down, and I realized I had a 330 ohm resistor on the LED. I was thinking I may have overloaded the chip since I was using it to sink to turn on the LED (active low). I swapped out a higher resistor, but when I went through the steps again now i2cdetect gives me something really odd...

it detects every possible address space instead of just 0x38?!

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77     

Any ideas what the deal is? Did I fry the expander or something else?

With a 3.3V supply to the LED with a 330 ohm resistor it should have been drawing around 0.033 watts, which is well in range of the 100mw (0.100 watts) per output per the datasheet. Should the chip have got so hot with the draw I had? I feel like it wouldn't have got that hot without a short but I checked it all again. I just can't understand what the deal is and why i2cdetect is now detecting at every single address now. Does this sound like I cooked the chip or something with the router (router still performing flawless except for that).

I have seen such output some years ago, and it was due to bad wiring. So, after resoldering all wires and pull-up resistors, it worked. Just an idea.

Thanks for the idea. I found another chip in my junk drawer and replaced it and it all worked now. I interogated the "bad" chip on the bench a little and it seemed to match with the good one, so perhaps there was a wiring problem that was fixed when I replaced the chip. I will know next time I need it but for now the project moves forward!

The discussion might have continued from here.