Jump to content


Photo

Fast GPIO without using device files


  • Please log in to reply
6 replies to this topic

#1 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:01 PM

Hi,

access to GPIO using the device files is extremely slow.
Is it possible to access them without using the device files?

I looked over here, but could not get this working:
http://www.geek-work...d-5033-1-1.html

Anybody did it?

I'm trying to program a CNC controller on the pcDuino, which needs fast IO access.

Regards,
Jack.



#2 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:01 PM

as I remember.

you can not tongue.gif

I read somewhere on linux-sunxi mailinglist.
this is tight to AllWinner design as I remember, (please check on A10 and A20 PDF)

the easy way is let arduino to control fast I/O. amazing hah.... microcontroller is purely design to contril external world pretty fast cheesy.gif.
and  let pcduino to process and manipulate data.



#3 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:01 PM

Hi,

have you tried using the GPIO library from linux-sunxi?
http://linux-sunxi.org/GPIO

another way for fast access:
i am brand new with pcduino, but most ARM boards have some memory mapping of the GPIO pins.
i have not found the full datasheet of the A20, there should be a detailled description, how to access directly to the GPIOs.
like with AVR and smaller ARMs you first need to configure the GPIO as output, then fast access via memory mapping should be possible.

the official user manual does not tell much.
but it should be possible to copy and paste some source code of the orginal driver library or gpio libraries

here is a small tutorial for device drivers and mentioned gpio library:
http://en.bir-robotic.ir/2014/04/gpio/

edit:
please take a look at the introducing comments in the gpio drivers source file:
https://github.com/l.../gpio-generic.c



#4 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:01 PM

Hi!

Allwinner seems to like to hide all documentation for really using their product...You'll not found any code source or documentation to access gpio from mem mapping without using *bad  hardwarelib  closed blackox*!....I hope that it will change in the future...



#5 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:01 PM

exactly... 
I do not see they will open that.
totally a bummer  for making closed source.
GPIO is mostly people use to explore possibilities smiley.gif.


honestly, nothing can beat microcontroller GPIO responses, such as arduino or others smiley.gif.



#6 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:01 PM

Hi!

You've right, but in some case it can be useful to use gpio directly from sbc without linking it to arduino(or other uc). I'm programming a home automation system, I use arduino with serial link for some controls(RF24, TFT, rcswitch for receiving 433Mhz...) and pcduino gpios for leds/rcswitch sending...I'd like to merge rcswitch receiving into pcduino gpio code but it seems to be very difficult since sw_interrupt is totally buggy...  undecided.gif I'd like to learn how to use gpio mem mapping but without source code or doc it seems very hard...

Greets,
Alex.



#7 kiyo

kiyo

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 17 February 2015 - 06:12 PM

You can find the memory mapping address on Page 19 , Port controller is described in Page 230 of User Manual.

http://forum.linkspr...w-spec-adc-spec






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users