Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A13 => Topic started by: michal.bury on February 05, 2025, 05:17:33 PM

Title: enable internal Pullup in sun5i-a13-i2c2.dts
Post by: michal.bury on February 05, 2025, 05:17:33 PM
Dear olimex,

I need to enable internal pullups of A13 on pins

pin 49 (PB17): 1c2b400.i2c (GPIO UNCLAIMED) function i2c2 group PB17
pin 50 (PB18): 1c2b400.i2c (GPIO UNCLAIMED) function i2c2 group PB18

I want to do this with dts, any help is appreciated.

What shloud be added to sun5i-a13-i2c2.dts to achieve the task.



thank you
Title: Re: enable internal Pullup in sun5i-a13-i2c2.dts
Post by: LubOlimex on February 06, 2025, 09:12:01 AM
If you need them for I2C - internal pull up are too weak. Like 30k. Just add external.

Maybe first test via the sysfs before doing it in the DTS, refer to this python package that had internal pull up control:

https://pypi.org/project/pyA13/
Title: Re: enable internal Pullup in sun5i-a13-i2c2.dts
Post by: michal.bury on February 11, 2025, 08:13:08 AM
Hello,

thanks for info,
i have tested it allready With externall pullups, and it's working.
But I really want to try it with internall pullups. I need that the operating system it self recognize the connected device. Pyhton doesn not help in this situation.

So is it possible to enable the pullups with dts?
Title: Re: enable internal Pullup in sun5i-a13-i2c2.dts
Post by: LubOlimex on February 11, 2025, 09:46:48 AM
I believe you just add "bias-pull-up;" in the dts under the pin you want. However, not every pin has internal pull up you need to check the user manual or datasheet of A13 chip. You will find it is like 5 pins and it is not guaranteed all 5 are free of other peripherals. Check here:

https://linux-sunxi.org/images/e/e6/A13_datasheet_V1.4_20150320.pdf

Also check here:

https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/allwinner%2Csunxi-pinctrl.txt