element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Andy Clark's Blog Dragonboard 410c GPIO
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 15 May 2016 8:22 PM Date Created
  • Views 273 views
  • Likes 2 likes
  • Comments 0 comments
  • gpio
  • dragonboard 410c
Related
Recommended

Dragonboard 410c GPIO

Workshopshed
Workshopshed
15 May 2016

For my Dragon detector project I was interested in activating some kind of attached "defence" when a dragon was detected. For this I intend to use the GPIO pins, the 96Boards GPIO library only has basic functionality at the moment, digital read and write so I need to find something else. Specifically I am looking for interupt based inputs so that my IR sensor can trigger the camera to take a photo. I'm also looking to drive a servo or two.

 

After reading some of the blogs from 96Boards, I thought that the Intel MRAA library would work well as it supported interrupt based inputs and PWM outputs.

 

Shell control of GPIO

Before getting involved in libraries, I though it best to test using simple shell commands.

 

I ran through the example in the low speed I/O application note and found a couple of things. Firstly, and not surprisingly you need to be root to

configure the GPIO. Switching to super user made this easier. Secondly there was a mention of adding 902 to the GPIO number, I did not find this to be the case.

 

To enable a pin you "export" it  and then configure for output. Sending 1 turns the pin on.

 

sudo su
echo 36 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio36/direction

echo 1 > /sys/class/gpio/gpio36/value

 

and then to turn it back off again, send a 0.

 

echo 0 > /sys/class/gpio/gpio36/value

 

Once my red LED (note that some colours of LED have a forward voltage > 1.8v so don't light up) was working correctly I thought I'd check the inputs. That's just a case of repeating the export command and reading the value. I used a jumper wire to set the input high as I did not have any switches to hand.

 

echo 12 > export
echo in > /sys/class/gpio/gpio12/direction
cat /sys/class/gpio/gpio12/value

 

Further investigation into libraries

 

When I looked into MRAA in more detail I saw that the PWM functionality was just a wrapper for existing device level functionality. A simple "ls /sys/class/pwm*" showed that there was no  such function on my board.

 

I cross checked this by looking at the mraa_pincapabilities_t setup for the board.

https://github.com/intel-iot-devkit/mraa/blob/master/include/arm/96boards.h

And

http://iotdk.intel.com/docs/1.1/mraa/structmraa__pincapabilities__t.html

 

So in conclusion it does not look like PWM is supported by this library/board. Looking at Libsoc the other library mentioned in 96boards blog that too uses the pwm class so that does not help either. The Libsoc library has a wrapper for I2C which I think I'll be using to connect up an I/O board which does support PWM, so I'll go for that library.

 

Installing Libsoc

 

There are some notes on the 96Boards blog but those did not seem to be up to date. So I used the instructions from the libsoc github and that compiled successfully.

 

For my next post I'll switch into Python and hopefully get OpenCV detecting things from the webcam.

 

Reference

Bringing Standardization to Linux GPIO for 96Boards - 96Boards

How do you install 96BoardGPIO, libsoc and libmraa on a new image? - 96Boards

https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

 

Videos

Using GPIOs on low speed connector on DragonBoardTm 410

DragonBoard 410C controlled RC Car

 

I also found this extra reference article from Qualcomm https://developer.qualcomm.com/blog/dragonboard-410c-maker-month-contest-tools-you-need

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube