C GPIO
#17
(08-31-2016, 04:14 AM)pfeerick Wrote:
(08-31-2016, 03:47 AM)martind1983 Wrote: However, 1 thing I did not understand that pin labeling. I get the point pin(32) is actual physical pin on PI 2 connector of PINE64 board, PineGPIO(68) is gpio used by sysfs when we access it via gpio class. But what is GPIO(12) labeling?

Right now I am going to my actual issue I want to solve.

I want to control GPIOs through my program written in C code or any other programming languages.
What I want to test is direct memory access when I map /dev/mem file image to virtual memory then I would able to directly write/read GPIO registers

What Mark was saying (and it looks like we were both writing this at the same time, and he beat me in hitting reply Wink) was the pin number, the GPIO number that that pin would be mapped to on a Raspberry Pi, and the GPIO it is mapped to on the Pine64. i.e., if you read across the table from Joey's pinout table, you can see it says

Quote:32 - GPIO 12 - GPIO 68 PC4

That's Pin - PI GPIO - PINE GPIO  - Pin Name (from the datasheet)

So if you wanted to control the 32nd pin on the RPi connector, you would be wanting to maniplulate GPIO68 on the pine64 (or  GPIO12 on the Raspberry Pi).

Now, since it can be toggled from using sysfs calls from the command line... can you not use System calls in your program to manipulate the GPIOs? Is DMA access a must? If not, depending on how sophisticated you want to make the code, you could probably base it off this Raspberry Pi example, or simplify it down since at it's simplest you really only need to send the export, direction and value commands to control the LED.

I don't know enough about the direct memory access interface to comment on that, but I noticed there was an example for that further up that page I just linked, so maybe that will be of some help or give some ideas?

Pfeerick

Thanks for your quick response. Wink

Currently, It does not matter for me which way I use for the purpose of GPIO controlling. It is just going about I want to learn this stuff.

I already did direct memory access GPIOs control for RPi2 I have and it worked. However, I had there also some kind of similar issue. Because first I found some manual for mapping register of previous version of raspberry PI which actually used BCM2835 chip (ARMv6) and RPi2 already uses (ARMv7). If I do not mistake ;Wink

However, between ARMv6 and v7 is one big distinction that is at v7 the base register address starts with different value. Although the rest register's address are not changed, you cannot actually access registers exactly because of that distinction at base address. Fortunately and finally I found it and it worked for me at RPi2. Unfortunately, guys from production somehow have issue to release current and precise manuals for those chips. This is the same for PINE.

I also like the fact that PINE64 has uncompetitive price. However, I am a bit upset of that there are not any good and precise manuals for those chips. I want to do development without constraints. THat is the reason I buy the board Smile

Nevertheless thank you for help Big Grin
  Reply


Messages In This Thread
C GPIO - by igna09 - 06-10-2016, 12:41 PM
RE: C GPIO - by martinayotte - 06-10-2016, 01:52 PM
RE: C GPIO - by igna09 - 06-10-2016, 02:16 PM
RE: C GPIO - by martinayotte - 06-10-2016, 03:10 PM
RE: C GPIO - by martind1983 - 08-24-2016, 09:55 AM
RE: C GPIO - by igna09 - 06-11-2016, 02:51 AM
RE: C GPIO - by martinayotte - 08-25-2016, 07:35 AM
RE: C GPIO - by martind1983 - 08-25-2016, 08:24 AM
RE: C GPIO - by MarkHaysHarris777 - 08-25-2016, 11:17 AM
RE: C GPIO - by martind1983 - 08-29-2016, 01:30 AM
RE: C GPIO - by martind1983 - 08-29-2016, 03:50 AM
RE: C GPIO - by MarkHaysHarris777 - 08-29-2016, 05:25 AM
RE: C GPIO - by martind1983 - 08-31-2016, 03:47 AM
RE: C GPIO - by pfeerick - 08-31-2016, 04:14 AM
RE: C GPIO - by martind1983 - 08-31-2016, 04:36 AM
RE: C GPIO - by MarkHaysHarris777 - 08-29-2016, 05:04 PM
RE: C GPIO - by MarkHaysHarris777 - 08-31-2016, 04:09 AM
RE: C GPIO - by KnReLe - 08-31-2016, 07:27 AM
RE: C GPIO - by martind1983 - 09-01-2016, 05:08 AM
RE: C GPIO - by MarkHaysHarris777 - 09-01-2016, 05:29 AM
RE: C GPIO - by martind1983 - 09-01-2016, 08:04 AM
RE: C GPIO - by KnReLe - 09-01-2016, 08:52 AM
RE: C GPIO - by martind1983 - 09-01-2016, 09:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  RPi.GPIO python module for Pine A64/A64+ aquilegia 98 104,905 12-15-2022, 08:40 PM
Last Post: Fadazo
  fm transmitter with gpio weasel18 2 3,785 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 2,904 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 9,013 06-07-2019, 12:37 AM
Last Post: tllim
Star GPIO, SPI and I2C C++ Lib databit 7 9,166 02-04-2019, 05:45 AM
Last Post: Jeff R
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 10,277 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 25,925 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 12,304 03-11-2018, 01:52 AM
Last Post: jomoengineer
  Read GPIO problem shworker 14 16,947 08-17-2017, 01:21 PM
Last Post: martinayotte
  GPIO fiq capability joseph 3 4,912 11-10-2016, 06:07 PM
Last Post: joseph

Forum Jump:


Users browsing this thread: 1 Guest(s)