I may have bricked I2C(2)

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
User avatar
mathieu
Posts: 40
Joined: Fri Nov 10, 2017 9:57 pm

Re: I may have bricked I2C(2)

Post by mathieu » Thu Oct 03, 2019 3:08 pm

chuckbook wrote:
Thu Oct 03, 2019 2:11 pm
I2C2 works pretty well with some I2C slaves as long as very short wires are used and pull-up is enabled for B10 & B11.
But this operation mode is clearly out of I2C specs.
Thanks for the tip. Unfortunately, this didn't work in my case.

What is best practice for adding external pull-ups to Y9 and Y10? Am I right to assume that I should connect each one to 3.3 V through independent resistors? Would 5K be a reasonable starting value for these resistors ? What could go wrong if I connected the pins to 5 V instead of 3.3V (this would be easier to achieve in my space-limited circuit, and seems to be within the specs of the MPU6050)?

Thanks to everyone for your help.

chuckbook
Posts: 107
Joined: Fri Oct 30, 2015 11:55 pm

Re: I may have bricked I2C(2)

Post by chuckbook » Thu Oct 03, 2019 3:32 pm

This is exactly the reason why Y9 & Y10 don't have internal pull-ups. If PYBD is integrated in another design it is usually required to put I2C pull-up resistors on the supporting board (or even on a remote board).
Using 5V as pull-up source is ok. Pull-up resistor values should be in the range of 1.5kOhm to 10kOhm. USB specs require a minimal pull-up current of 3mA.
Of course both lines shall be pulled by a separate resistor.

Note: X9 &X10 have internal pull-ups that can be switched on by configuring F1 & H5 as PP outputs with high level.
Note2: If external pull-ups are used, all internal pull-ups of affected ports should be turned off. F1 & H5 have to be configured as inputs.

User avatar
mathieu
Posts: 40
Joined: Fri Nov 10, 2017 9:57 pm

Re: I may have bricked I2C(2)

Post by mathieu » Thu Oct 03, 2019 4:35 pm

chuckbook wrote:
Thu Oct 03, 2019 3:32 pm
This is exactly the reason why Y9 & Y10 don't have internal pull-ups. If PYBD is integrated in another design it is usually required to put I2C pull-up resistors on the supporting board (or even on a remote board).
Using 5V as pull-up source is ok. Pull-up resistor values should be in the range of 1.5kOhm to 10kOhm. USB specs require a minimal pull-up current of 3mA.
Of course both lines shall be pulled by a separate resistor.

Note: X9 &X10 have internal pull-ups that can be switched on by configuring F1 & H5 as PP outputs with high level.
Note2: If external pull-ups are used, all internal pull-ups of affected ports should be turned off. F1 & H5 have to be configured as inputs.
Using two 10K resistors as specified above, and this code:

Code: Select all

Pin('Y9', Pin.IN, pull = None)
Pin('Y10', Pin.IN, pull = None)
i2c = machine.I2C('Y')
print(i2c.scan())
returns an empty scan. If I switch to I2C(1), everything works fine.

Based on this observation and the fact that Y9 refuses to behave properly as IN or OUT, should I conclude that Y9 is now unusable?

chuckbook
Posts: 107
Joined: Fri Oct 30, 2015 11:55 pm

Re: I may have bricked I2C(2)

Post by chuckbook » Thu Oct 03, 2019 5:15 pm

If Y9 can't be used as GPIO in input and output mode there is no way it can operate in I2C mode.
As it is pretty hard to kill a GPIO port with voltages of 0V..+5V there might be a change that there is a shortcut somewhere that affects Y9.

Post Reply