Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A64 => Topic started by: Noone on February 05, 2023, 01:21:46 PM

Title: Internal pull-up
Post by: Noone on February 05, 2023, 01:21:46 PM
Hi,
I'm not able to use internal pull-up for GPIO-pins.

With Python code:
from pyA64.gpio import gpio
from pyA64.gpio import port
gpio.init()
gpio.setcfg(port.PE12, gpio.INPUT)
gpio.pullup(port.PE12, gpio.PULLUP)
gpio.input(port.PE12)

I always get '0' if nothing is connected to the line. With external pull-up everything works.

I'm I missing something here?

Title: Re: Internal pull-up
Post by: LubOlimex on February 06, 2023, 11:15:50 AM
Maybe it is not good enough for your application. What is the value of the external pull up that you connect? Maybe the internal has different value.

Did you try with other GPIO ports?
Title: Re: Internal pull-up
Post by: Noone on February 06, 2023, 12:32:45 PM
If I leave pin fully unconnected, pull-up is still not working. I tested with ports defined in
from pyA64.gpio import port
I'm using image
A64-OLinuXino-focal-minimal-20210127-100834.img

Title: Re: Internal pull-up
Post by: LubOlimex on February 06, 2023, 03:07:21 PM
What is the value of the external pull up that you connect? Maybe the internal has different value?

What do you expect is the value of the internal pull-up is?
Title: Re: Internal pull-up
Post by: Noone on February 06, 2023, 07:14:20 PM
Problem solved 8)

Documentation linked from A64-OLinuXino product page is outdated.

Document (revision G, December 2022) behind the link (https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf (https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf) gives outdated instructions for Python.

Pull-ups (and everything else) work well with python3-gpiod https://pypi.org/project/gpiod/ (https://pypi.org/project/gpiod/).

Brgs,
 Noone