MKR NB 1500 PINS I2C DigitalRead pins 11&12 does not works

Hi, I'm newest in Arduino....and my english is poor, sorry.
I have to use the pins 10,11 and 12 like inputs pinMode(x,INPUT),these pins(11,12) are shared with the I2C.
When I try to use it like as digital input, in 11 and 12 it have HIGH level, I have been connected a pull down resistor 10k, and serial of 560R to input to limit the Iin.
In 11,12 always are in low mode, Vin grounded (Vin voltage applied to the digital port) I measure 2,2Vdc in these pins, also with Vin=3,3 I can measure 3.3Vdc.
Does the Arduino board IC2 used as Serial port(Serial.Begin())?
I have tried to shutdown the Wire port Wire.end() but still having wrong reads.
Why? thanks.

Hi @XAVI1973

The I2C pins 11 and 12 have a HIGH level, because they are connected to two 4k7 pull-up resistors on your MKR1500 NB board. This also explains why adding 10k pull-down resistors causes the 4k7 and 10k to act a voltage divider, lowering the input to 2.2V, since:

10k / (10K + 4k7) * 3.3V = 2.2V

Hi Martin,
Thanks a lot, I have download the SCH from the www and now I have been seen the two resistors.
I have arranged my SCH to use it like digital I/O and other connections to Arduino's PCBs. Also I have to have a look over the SCHs!!!!
Thanks a lot.

My five cents:
when two pins are configured and uses as I2C: the peripheral device will configure these pins as Open Drain (external pull-up). And the signals on pins are just toggling if an I2C transaction is done.

You can configure any time, almost any MCU pin as a GPIO: the MCU has a "pin mux": specific pin configuration modes ("ALT" code) specify how this external pin should be connected to an internal logic (e.g. if it is the output of the I2C peripheral, something else, or a GPIO output/input).

If you configure a signal intended as I2C as GPIO input, and there is an external I2C pull-up (which is needed due to I2C is Open Drain) - you will read the effect of the pull-up: signal is always high: except: you tie down the external signal to GND.

Turning an I2C signal into an input is OK. Even the pull-up does not matter really: if you connect an external HW which would pull the signal low: ok, it has to work against the pull-up but as long as the pull-up is not so strong (low resistance) - the external signal can still pull the signal low (and you should see a low).

Using pull-up AND pull-down on a digital pin is not a good idea: you put the signal level somewhere in the "middle", e.g. to a 2.0V level (the pin hangs somewhere in the middle between high and low). If you read this: ok, it will not damage, but the result, if low or high - is flaky, random. Digital logic has thresholds (levels) for low and high, seen as stable signal. If you put a single into the "transition zone" (it not for sure high or low) - you draw a low of current into pin and your result is unpredictable (random).

Digital logic (such as I2C, GPIO) should have clear low and high voltage levels, and the transition through the "undefined" voltage levels should happen and be fast as possible. Never place a pin voltage with a static voltage level into the "uncertainty range" (not low and not high).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.