1 2 Previous Next 23 Replies Latest reply on Jan 14, 2015 11:44 AM by KurtE

    Intel Edison GPIO Pin Multiplexing Guide

    David_J_Hunt

      Hi all,

       

          With the increasing amount of questions about enabling pins using shell scripts (GPIO, UART, etc) I though I'd let you all know about an Edison Pin Muxing Guide I've just pushed up onto the Emutex Labs website. It describes how to multiplex the pins on the Arduino header to get the function you need.

       

      Probably the most interesting table is the multicoloured one, that's a synopsis of all the other tables, in a (hopefully) easy to follow format.

       

      Link to article here: EmutexLabs

       

      If you have any feedback on any typos/errors, please let me know and I'll endeavour to fix.

       

      Regards,

      Dave.

        • 1. Re: Intel Edison GPIO Pin Multiplexing Guide
          duane_steel

          First - Thanks very much for this! It's been hard to find documentation so far and this is incredibly helpful.

           

          If I may be so greedy, do you have any other information on how to setup spi vs i2s? I'm working on taking advantage of the i2s features of the module but I can't find any information at all. Your document is a help in the right direction but it seems like even in that spi/i2s is grouped together. Any info on how I can set i2s mode and try pushing audio data to an external dac? thanks again!

           

          edit: a more thorough read of your document (and your spi example) showed (I think) how to get into i2s mode. Thanks again!

          • 2. Re: Intel Edison GPIO Pin Multiplexing Guide
            rubidium

            Bookmarked. This is really outstanding! Thanks for your hard work.

            • 3. Re: Intel Edison GPIO Pin Multiplexing Guide
              finepower.mh

              Hi guys,

               

              i even get frusttrated with this Edison stuff here on my desk and the usage of these I2C Port Expanders...

              Port Expanders are no problem in general and I used them much times before on other MCU Projects, but if there is no Information on how the drivers are implemented you end up searching the web instead of being productive.

              I even read the Emutex Labs Summary on that GPIO, PWM and ADC usage - much thanks from my side for this work - but it does not work so far.

              Looking at Example 3 setting up PWM on IO6 : I have NO gpio214 and even NO gpio254 or gpio222 in my /sys/class/gpio path ?!

               

              I updated my Edison yesterday with the image from intel (edison-image-rel1-maint-rel1-ww42-14.zip) and I can not say if these devices have been there before.

              But actually I am not able to get the examples run and even the Arduino IDE Examples for the Peripherals do not work, except the LED Blinky.

               

              So we have to go into detail debugging the I2C Data between Port Expanders and Edison to get it run, or we have to wait for intel doing the job on documentation ?

              Happy Beta-testing, isn't it ?

               

              Kind regards,

              Marcus

              • 4. Re: Intel Edison GPIO Pin Multiplexing Guide
                David_O_Riordan

                Hi Marcus,

                If you try:

                echo 214 > /sys/class/gpio/export

                 

                do you get an error or does the gpio214 appear in /sys/class/gpio?

                I haven't used a ww42 based image yet but something is a little weird if it doesn't appear. Do other gpios appear when exported?

                Do you know what jumper settings you are using for IOREF (assuming you are using Arduino breakout board, jumper j9), and do you have anything connected to the gpios when you boot the board?

                 

                I would disconnect anything attached to the board, shut it down, remove power, and boot it again with no shields or other circuitry attached.

                I know that sounds like typical "turn it off and turn it on again"  advice, but perhaps the I2C bus or the expanders need a hard reset to restore correct communications.

                If the problem persists then something may be fried in the I2C circuitry, or a bug found its way into the ww42 image?

                 

                BTW, I'm using the previous version of Ubilinux ( the current version is based on the ww42 image I believe?), no gpio214 trouble here but I haven't tried the Arduino examples.

                • 5. Re: Intel Edison GPIO Pin Multiplexing Guide
                  finepower.mh

                  Dear David,

                   

                  the peripheral or device is not listed in the directory, therefore i get an error :


                  root@fineEdison:~# echo 214 > /sys/class/gpio/export

                  sh: write error: No such device

                  root@fineEdison:~# ls /sys/class/gpio/

                  export       gpio126      gpio129      gpio132      gpiochip0    gpiochip248

                  gpio124      gpio127      gpio130      gpio133      gpiochip216  unexport

                  gpio125      gpio128      gpio131      gpio134      gpiochip232

                  root@fineEdison:~#

                   

                  So if I understood correct, all the I2C connected Port expanders and devices may be scanned upon reset/restart and the devices are included to the /sys/class or kernel if found?

                  This implies that at reset, the I2C Bus is scanned for all possible devices with their addresses ?

                   

                  I am not so familiar with the boot concept and Yocto – I actually looked up the “Linux Hardware Hackz” book from my shelf I bought some years ago when starting with RaspberryPi, because I normally use ARM Cortex M Devices, or other Microcontrollers with 8/16/32Bit for our Projects and work with an own OS and libraries.

                   

                  Yes - below the Edison, there is the Arduino board I bought as a bundle from Mouser last week. As well I have the small breakout board I would use in the next step to debug I2C because there is no breakout available on the Arduino board, or maybe I can use the Test Points below ?

                   

                  Actually, there is only a Poti connected to A0, nothing else. So I will power down the Board now completely and look if the devices are registered correctly afterwards.

                   

                  Thanks for your response and kind regards,

                   

                  Marcus

                  • 6. Re: Intel Edison GPIO Pin Multiplexing Guide
                    David_O_Riordan

                    For comparison, I have

                    root@ubilinux:~#

                    root@ubilinux:~#

                    root@ubilinux:~# ls /sys/class/gpio/

                    export   gpio126  gpio129  gpio132  gpiochip0    gpiochip232

                    gpio124  gpio127  gpio130  gpio133  gpiochip200 gpiochip248

                    gpio125  gpio128  gpio131  gpio134  gpiochip216  unexport

                    root@ubilinux:~# echo 214 > /sys/class/gpio/export

                    root@ubilinux:~# ls /sys/class/gpio/

                    export   gpio126  gpio129  gpio132  gpio214     gpiochip216  unexport

                    gpio124  gpio127  gpio130  gpio133  gpiochip0    gpiochip232

                    gpio125  gpio128  gpio131  gpio134  gpiochip200 gpiochip248

                    root@ubilinux:~#

                     

                     

                    Looks like you have an I2C expander chip not registered?

                    • 7. Re: Intel Edison GPIO Pin Multiplexing Guide
                      finepower.mh

                      Ok,

                      after cold start now the device list changed...

                       

                      Poky (Yocto Project Reference Distro) 1.6 fineEdison ttyMFD2

                       

                      [   23.300767] systemd-fsck[253]: /dev/mmcblk0p10: clean, 382/152608 files, 28808/610299 blocks

                      root@fineEdison:~# ls /sys/class/gpio/

                      export       gpio127      gpio131      gpio207      gpiochip216

                      gpio124      gpio128      gpio132      gpio215      gpiochip232

                      gpio125      gpio129      gpio133      gpiochip0    gpiochip248

                      gpio126      gpio130      gpio134      gpiochip200  unexport

                      root@fineEdison:~#

                       

                      But gpio214 is not there...

                      What is maybe to be mentioned is that I use a 12V/2A Power Adaptor because using both USB Connectors with my USB Hub is not enough to power the board and it will crash while booting sinking too much power without the additional power supply on the power jacket.

                       

                      Kind regards,

                       

                      Marcus

                      • 8. Re: Intel Edison GPIO Pin Multiplexing Guide
                        David_O_Riordan

                        I think you are close now!

                        Export 214, it wasn't exported by default in my setup either. (edit - or try the arduino examples, should work now that gpiochip200 has registered)

                        I wonder why that chip wasn't registered. I'm also using a 12V supply with an RGB LCD display being powered from the board and using I2C comms.

                        I think 2A should be sufficient for your case but mine happens to be 5A , no particular reason it just happened to be there when I needed a 12V supply.

                        • 9. Re: Intel Edison GPIO Pin Multiplexing Guide
                          finepower.mh

                          Thanks, David,

                          yes, it seems to be that the I2C Expander was not registered before, because now echo 214 > /etc/class/gpio/export is executed without error and the device is there afterwards.

                           

                          Kind regards,

                           

                          Marcus

                          • 10. Re: Intel Edison GPIO Pin Multiplexing Guide
                            arfoll

                            If you're struggling with the expanders and all, using libmraa might be of interest - see: Upgrading Intel® IoT Developer Kit libraries – Intel® Edison or Intel® Galileo board | Intel® Developer Zone

                             

                            If nothing else, the pinmap we've developed here as part of libmraa should show you how to work around most of your issues.

                            • 11. Re: Intel Edison GPIO Pin Multiplexing Guide
                              finepower.mh

                              maybe I should add that the PWM Example No 3 is now working and the PWM is generated on PWM2 Output on my Arduino Board.

                              Thanks for support & kind regards,

                               

                              Marcus

                              • 12. Re: Intel Edison GPIO Pin Multiplexing Guide
                                MPayne

                                We're not some nameless corporation, and we (the engineers) do monitor these forums. 

                                 

                                Like any other development operation, trade offs have to be made.  In this case, we chose to get it in the market before all the docs were completely ready - in the interest of consumers being able to get started.

                                 

                                There is a major documentation upgrade incoming to address these concerns.

                                • 13. Re: Intel Edison GPIO Pin Multiplexing Guide
                                  mikemoy

                                  MPayne wrote:

                                   

                                  We're not some nameless corporation, and we (the engineers) do monitor these forums. 

                                   

                                  Like any other development operation, trade offs have to be made.  In this case, we chose to get it in the market before all the docs were completely ready - in the interest of consumers being able to get started.

                                   

                                  There is a major documentation upgrade incoming to address these concerns.

                                   

                                  Guys i have to let loose on this one.

                                   

                                  We would understand and might expect a nameless corporation to make such a poor decision. For Intel to do this clearly shows that have the wrong person / persons in charge that know nothing at all about the embedded market. One would think they would have taken what they learned from the Galileo flop and applied them here. Sadly they did not and are soon to have two flops on their hands.

                                   

                                  " In this case, we chose to get it in the market before all the docs were completely ready - in the interest of consumers being able to get started."

                                  is this kinda a oxymoron ?   Dont we need proper documentation to actually get started ?

                                   

                                  The docs at release date were far beyond "completely ready". In fact they should have never been released at all in that state. The web site for the Edison is a joke to say the least.

                                  I could take a few kids out of H.S. and they would do a far better job with the site. Even this forum in the way it works is so far off the norm its not even funny.

                                   

                                  Bottom line is this, when you release something far to soon as the case with the Edison, you WILL wind up ******* more people off than making them happy by allowing them to get it early.

                                  You WILL put such a bad taste in their mouth they will not be able to get rid of. There is a reason why it has been said so many times before "First impression is everything" That does not only apply to people.

                                   

                                  Intel, you better get it together before its too late. Other companies are going to see how great the need is for an embedded module to have low power, eMMC, WI-FI, and blue-tooth all on board. They are going to see how bad you screwed things up and are simply going to make their own low cost module very much like the Edison and be successful with it.  Why? because they will release it when the documentation is ready, when the software is ready and everything has been tested and works.

                                   

                                  I am done venting for now.

                                  • 14. Re: Intel Edison GPIO Pin Multiplexing Guide
                                    MPayne

                                    I'm sorry that you feel that way.

                                     

                                    You know I'm the guy that's been asked to fix said issues right?  I'm trying to help.

                                     

                                    I'm not sure what you're trying to accomplish here, and I don't have to respond to the community at all (we do this in our own time).

                                     

                                    Let's make this constructive - can you suggest certain topics you would like to see covered better?  I will check my list and see if it is in the documentation update we are finalizing now - and if not, make sure it is added.

                                    1 2 Previous Next