Read GPIO problem
#8
(08-06-2017, 01:33 AM)pfeerick Wrote:
(08-05-2017, 10:24 PM)MarkHaysHarris777 Wrote: This is not a bug.

... you have to set the direction to  "IN"  and then set the ACTIVE_LOW or the input pin will not work the way you expect, even though theoretically the default state of the pins is input !

After setting the direction to IN of course the pin functions normally as an input pin.

Actually, that is a bug... 

My money is on the DTS... as I think it can also set the inital state of the pins, but I really haven't played in that space, so I'll defer to the DTS experts on that one Wink


No, actually, it is NOT a bug.

... that is one of the problems with the PineA64 board;  it does not guarantee the state of an uninitialized pin !  Unlike the Raspberry PI which DOES guarantee the state(s) of uninitialized pins.  The /sys/class/gpio/ system is not "in sync" with the hardware until explicit initialization.  The reason ACTIVE_LOW needs to be set is that the internal pullups can also be pulldowns !  If you don't set ACTIVE_LOW the function of the input pin (whether pullup or pulldown) is not known either, and may or may not function as expected.  The bottom line (aside from argumentative semantics) is that explicit initialization of gpio pads on the PineA64 board is required !

Having said all of that, I agree that we may be able to correct this situation (bug or semantics) with dts and|or init code which makes sure default states of all pins really are input;  but then,  do we assume pullups ?  Or is it really better that the gpio(s) are a resource left up to the user in user space/  again explicit initialization seems to be the best situation all around.


Blush
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Messages In This Thread
Read GPIO problem - by shworker - 02-21-2017, 04:00 AM
RE: Read GPIO problem - by Techsensei - 02-21-2017, 06:41 AM
RE: Read GPIO problem - by shworker - 02-21-2017, 08:58 AM
RE: Read GPIO problem - by MarkHaysHarris777 - 02-22-2017, 04:23 AM
RE: Read GPIO problem - by aromring - 08-05-2017, 09:59 PM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-05-2017, 10:24 PM
RE: Read GPIO problem - by pfeerick - 08-06-2017, 01:33 AM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-06-2017, 10:38 AM
RE: Read GPIO problem - by pfeerick - 08-07-2017, 12:11 AM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-07-2017, 07:21 AM
RE: Read GPIO problem - by pfeerick - 08-07-2017, 07:21 PM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-07-2017, 11:10 PM
RE: Read GPIO problem - by pfeerick - 08-08-2017, 06:20 PM
RE: Read GPIO problem - by MarkHaysHarris777 - 08-15-2017, 02:24 AM
RE: Read GPIO problem - by martinayotte - 08-17-2017, 01:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  RPi.GPIO python module for Pine A64/A64+ aquilegia 98 149,228 10-26-2024, 07:17 AM
Last Post: Garesdq1d
  fm transmitter with gpio weasel18 2 5,522 09-10-2019, 04:28 AM
Last Post: desai_amogh
  How to use dts or other setup to declare gpio pin Interrupt (e.g. a button)? dkebler 1 4,047 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 12,480 06-07-2019, 12:37 AM
Last Post: tllim
Star GPIO, SPI and I2C C++ Lib databit 7 12,585 02-04-2019, 05:45 AM
Last Post: Jeff R
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 12,840 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 35,330 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 16,421 03-11-2018, 01:52 AM
Last Post: jomoengineer
  GPIO fiq capability joseph 3 6,837 11-10-2016, 06:07 PM
Last Post: joseph
  RPI2-GPIO mus1c 6 10,373 09-22-2016, 05:28 AM
Last Post: mus1c

Forum Jump:


Users browsing this thread: 9 Guest(s)