LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 06-13-2019, 06:42 PM   #1
pmknkaek
LQ Newbie
 
Registered: Mar 2018
Posts: 13

Rep: Reputation: Disabled
Question Orangepi - any one with experience? using GPIO?


So I picked up an OrangePi, which is a RaspberryPi alternative that generally runs at about half the cost for similar specs. It has a pin layout which is compatible with the RPi too, which is a nice bonus. The downside is that there is little to no documentation for it, and a much smaller community in general.

My plan is to use it to read sensor data from the GPIO pins, but with so little documentation, using the GPIO at all is a considerable challenge in and of itself (especially as I have not done so previously with the RaspberryPi). So if anyone has any experience with this, or any other general knowledge to share before I officially start breaking ground in the software, I would be very interested in what you have to say.
 
Old 06-13-2019, 08:28 PM   #2
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by pmknkaek View Post
So I picked up an OrangePi ...
That's just a piece of hardware (and an ambiguous mention of which board you have.
It's useless without software.


Quote:
Originally Posted by pmknkaek View Post
The downside is that there is little to no documentation for it
The previous link indicates otherwise.
That's about what you can expect for a Far-East product.
If you want more, such as 1000+ pages of technical reference manuals and datasheets, then you should get a SBC with TI or NXP SoC.


Quote:
Originally Posted by pmknkaek View Post
My plan is to use it to read sensor data from the GPIO pins ...
You can run baremetal programs on your new SBC, but you would need to study the datasheet for the Allwinner SoC.
Or boot some operating system such as Linux, which will abstract much of the hardware into well-defined interfaces.

Regards

Last edited by blue_z; 06-13-2019 at 08:48 PM.
 
Old 06-14-2019, 09:11 AM   #3
wvermin
Member
 
Registered: Jun 2019
Posts: 34

Rep: Reputation: Disabled
If the pins are Raspberry-compatible, why don't you have a look at the Raspberry docs?
 
Old 06-16-2019, 04:40 PM   #4
pmknkaek
LQ Newbie
 
Registered: Mar 2018
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by blue_z View Post
That's just a piece of hardware (and an ambiguous mention of which board you have)
I have the Pi PC 2 model. I am aware of the linux images they have and intend to use one in my project. My issue is that I don't know exactly how to interact with the GPIO on this particular device. The raspberry pi community has made it very easy for you to download a simple library for any language and be ready to go. This is not the case with the Orange Pi.

I'll boot into something and report my findings, as well as scour github for something that might work with this. My hope was that someone here may have used one of these boards before, but it appears that is likely not the case. (the official orange pi forums were of little help either)
 
Old 06-16-2019, 04:40 PM   #5
pmknkaek
LQ Newbie
 
Registered: Mar 2018
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wvermin View Post
If the pins are Raspberry-compatible, why don't you have a look at the Raspberry docs?
Compatible only in layout, the software is not compatible between rpi and opi.
 
Old 06-16-2019, 06:16 PM   #6
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by pmknkaek View Post
My issue is that I don't know exactly how to interact with the GPIO on this particular device.
As previous written, if you use Linux then a lot of the hardware complexity will be abstracted.
The software differences between the RPi using Linux and the OrangePi using Linux is not that great.
The real problem is that there is a RPi (hobbyist) jargon that conflicts with Linux kernel (professional) jargon.

You need to be aware that Linux "gpio" has a specific meaning that does not mesh identically with how RPi users (and probably hobbyists in general) use the term "GPIO".
The Linux kernel makes a distinction between pins (of the SoC) and gpio.
A pin can be assigned for use by a peripheral device (through pin multiplexing during kernel initialization). That pin is then no longer a "gpio" (actually the pin never was a "gpio").
A pin that is not assigned to any peripheral device (after boot is complete) becomes a gpio. The pool of available gpios is a managed resource, i.e. a driver or program can acquire a gpio, and then releases it when done (just like a memory buffer).

So technically (or more accurately) "interact with the GPIO" would mean input or output using simple digital (i.e. TTL) signal.
Connecting to the UARTs and SPI and TWI interfaces on the 40-pin header involves pinmuxing, and not "GPIO".


Quote:
Originally Posted by pmknkaek View Post
... as well as scour github for something that might work with this
Instead of "github" learn how to use Google.
There are resources out there if you bother to look.


Regards

Last edited by blue_z; 06-16-2019 at 06:40 PM.
 
Old 06-16-2019, 09:21 PM   #7
pmknkaek
LQ Newbie
 
Registered: Mar 2018
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by blue_z View Post
As previous written, if you use Linux then a lot of the hardware complexity will be abstracted. You need to be aware that Linux "gpio" has a specific meaning that does not mesh identically with how RPi users (and probably hobbyists in general) use the term "GPIO".
The Linux kernel makes a distinction between pins (of the SoC) and gpio.
A pin can be assigned for use by a peripheral device (through pin multiplexing during kernel initialization). That pin is then no longer a "gpio" (actually the pin never was a "gpio").
A pin that is not assigned to any peripheral device (after boot is complete) becomes a gpio. The pool of available gpios is a managed resource, i.e. a driver or program can acquire a gpio, and then releases it when done (just like a memory buffer).
This is a very helpful explanation! I have definitely been using google, this is where I come when google doesn't help as much. I appreciate you taking time to explain this to me.
 
  


Reply

Tags
gpio, raspberrypi


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Totality: did you experience it, and if so was it a religious experience? sundialsvcs General 39 09-15-2017 04:09 PM
GPIO access on a Fujitsu Mini-ITX Industrial Mainboard, PCI Driver for GPIO mechatrix Linux - Embedded & Single-board computer 3 11-20-2011 03:57 PM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 07:52 AM
Does any have experience with installing two linux and one FreeBSD on one Harddrive? babyboss Fedora 2 10-24-2004 03:13 AM
Any one have any experience with Linux on an IBM T41? Kramer Linux - Laptop and Netbook 3 06-17-2004 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 04:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration