RPi.GPIO python module for Pine A64/A64+
#31
(06-19-2016, 07:56 AM)martinayotte Wrote: In my case, RPi.GPIO-PineA64 worked out of the box using "python setup.py install", nothing else to do.

Beware that pyA20 doesn't use the same pins for A64, so some GPIOs are working but some other won't or simply not defined.

Hmm okay. Maybe it's time to try a fresh OS. What kernel version are you running on the OS that RPi.GPIO for Pine is working on?
  Reply
#32
Ubuntu with longsleep kernel.
  Reply
#33
http://wiki.pine64.org/index.php/Main_Pa...eep_kernel

The lenny.raposo image (debian) with the Longsleep kernel works straight-away also... no problems.
  Reply
#34
Thanks for the help.
After installing the GCC compiler everything worked.

I am using the OpenHAB image based on Ubuntu Linux Longsleep 20160415, which does not seem to work with the GPIO Python library out-of-box:
http://wiki.pine64.org/index.php/Pine_A6...0415_image
  Reply
#35
Thank you for this thread. Between this and some posts on using the GPIO on a Raspberry Pi I got what I was trying to do working without too much frustration.
  Reply
#36
I tried to use the RPi GPIO script with OpenOCD to connect it with an ARM STM32 microcontroller, however OpenOCD can't find it. It is a adapter interface for Pine A64 like the bcm2835gpio interface, right?

Screenshot of putty output:
   

.cfg file for OpenOCD:
   
  Reply
#37
If that OpenOCD driver uses the GPIO hardware directly (looks like it since there is a base address define), it will be different on the Pine and you have to look at how to port the GPIO driver for the bcm2835 to the A64 since the registers are also different... I prefer FTDI based JTAG adapters that implement the electrical part in hardware...
Come have a chat in the Pine IRC channel >>
  Reply
#38
I use this code
Code:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(3, GPIO.IN)

while True:
   print GPIO.input(3)
I have this setup
http://imgur.com/a/HjjuE
and I get nothing but "0" in the console.
  Reply
#39
You will need to provide an external pull-up resistor 4.7k to 3v3...

...that will give you '1' unless you ground the pin (on the pin side of the 4.7k resistor.

Or, you can define the input as having a pull-up and then the pull-up will be internal.


PS you can experiment with 'strong' or 'weak' pull-up resistors, anything from 1k to 10k, the higher the number, the weaker the pull-up.

PSS I too will experiment with pin(3) GPIO02 as input... on debian... will get back to you soon
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
#40
(08-09-2016, 02:30 PM)MarkHaysHarris777 Wrote: You will need to provide an external pull-up resistor 4.7k to 3v3...

...that will give you '1' unless you ground the pin (on the pin side of the 4.7k resistor.

Or, you can define the input as having a pull-up and then the pull-up will be internal.


PS  you can experiment with 'strong' or 'weak' pull-up resistors,  anything from 1k to 10k,   the higher the number, the weaker the pull-up.

PSS    I too will experiment with pin(3) GPIO02  as input... on debian...  will get back to you soon

http://forum.pine64.org/showthread.php?t...8#pid17268

(08-03-2016, 08:29 PM)MarkHaysHarris777 Wrote: hi Wolfenstein, when I code for a pull-up on an input pin ( I'm going to put a switch on it that pulls to ground ) then I leave it with the internal pull-up ( why use an additional component if not needed ).

Now you are confusing me.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  fm transmitter with gpio weasel18 2 2,231 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 1,219 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 4,493 06-07-2019, 12:37 AM
Last Post: tllim
Star GPIO, SPI and I2C C++ Lib databit 7 5,654 02-04-2019, 05:45 AM
Last Post: Jeff R
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 6,750 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 13,889 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 7,096 03-11-2018, 01:52 AM
Last Post: jomoengineer
  Read GPIO problem shworker 14 7,618 08-17-2017, 01:21 PM
Last Post: martinayotte
  Cross-wired Uart Ports between two Pine Boards via Cat5 Cable MarkHaysHarris777 10 5,831 11-20-2016, 04:17 AM
Last Post: pfeerick
  GPIO fiq capability joseph 3 2,373 11-10-2016, 06:07 PM
Last Post: joseph

Forum Jump:


Users browsing this thread: 1 Guest(s)