Shop OBEX P1 Docs P2 Docs Learn Events
Sharing I2C pins with Blue LEDs — Parallax Forums

Sharing I2C pins with Blue LEDs

RaymanRayman Posts: 14,272
edited 2023-10-09 22:55 in Propeller 2

Looking for a better place to put an I2C QWIIC connector on my robot board, the best place seems to be on two sorta spare pins.

The problem: These pins both have a 1k resistor and a blue LED on them already, for use as general purpose indicators. But, if someone uses the QWIIC connector, they sorta become I2C activity indicators.
Initial tests show I2C interface working with one device.
But, how do the resistor and LED affect the bus performance?

There are two internal pullup options that seem to make the most sense for I2C, 3.3k and 15k. Also, that 1k LED resistor could be swapped out for 2k or 10k.
Here are the high state voltages for 3.3k and 15k options.

LED                   Pull-Up Resistor
Resistor
                         15k          3.3k       

1k                       2.514V      2.625V       
2k                       2.55V       3.02V
10k                      2.80V       3.24V 

The limiting factor is that the I2C device needs to see this voltage as logic high. The spec says that value is 0.7 times VCC. So, all of these are above that. P2 also needs to see that as logic high, but that's easy at 0.5 times VCC.

I2C bus Speed is the other concern. I've only tested at 400 kHz. But, I think this LED load will actually make the bus faster. Need to test at 1 MHz though to be sure...

Comments

  • I can't imagine the led capacitance, behind a 1~10k resistor, would affect performance very much at all. But its always good to test these things.

  • RaymanRayman Posts: 14,272

    Think I had 3.3k and 15k reversed in top post… just fixed

  • You might also try the 1mA setting. It should give aproximately the same initial slope (3.3V/3.3k=1mA) but a more linear ramp instead of a shark-fin (mirrored exp function). Is the LED still bright enough to see with the 10k resistor?

  • RaymanRayman Posts: 14,272

    @ManAtWork I think the 3.3k pullup option is actually the 1mA setting in Jon's driver...

    It's hard to get a good photo of the blue leds... Here, the left one has 1k in series with blue led and the right one has a 10k in series.
    You can see it's slightly dimmer in photo, but a little more in real life.

    469 x 485 - 49K
  • @Rayman said:
    @ManAtWork I think the 3.3k pullup option is actually the 1mA setting in Jon's driver...

    Ah, yes, there is no real 3.3k setting, only 1k5 and 1mA.

    It's hard to get a good photo of the blue leds... Here, the left one has 1k in series with blue led and the right one has a 10k in series. You can see it's slightly dimmer in photo, but a little more in real life.

    The sensitivity of the human eye is scaled in a logarithmic way, not linear. So with 10k instead of 1k it's not at 10% brightness but only "slightly dimmer".

Sign In or Register to comment.