3 Replies Latest reply on Aug 9, 2017 1:54 PM by Intel Corporation

    mapping from MRAA number to Edison Arduino breakout pin

    hitworld

      Hi,

      I am quite confused about how to get the correct MRAA number of a specific Edison Arduino breakout pin.

       

      From mraa: Intel Edison, I know MRAA number 0-5 is mapped to A0-A5, and number 14-19 is also mapped to A0-A5 while they are used as GPIO.  However, for the other GPIO pins such as IO0 - IO13, I really cannot figure out how they are mapped to MRAA numbers. I found this edison-arduino-hardware-guide here Hardware Guide for the Intel® Edison Kit for Arduino* , but don't know how to check the numbers with the help of it. E.g., I did blink LED test so I know that one LED is connected to IO13 (which is also mentioned in the aforementioned guide), and in MRAA it is also number 13. But according to Table2 in the guide, IO13 corresponds to GPIO(Linux) 40, and in the MRAA documentation, Edison pin GP40 corresponds to MRAA number 37, which is not the number I used in the tutorial that is 13, this confused me a lot. Where am I wrong? Could anyone explain it to me?

       

      I also found this table SparkFun Inventor's Kit for Edison Experiment Guide - learn.sparkfun.com , it mentions A0-31, A1-45, A2-32, etc., which are totally different from what I learned from MRAA documentation. Why is it like this?

        • 1. Re: mapping from MRAA number to Edison Arduino breakout pin
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi hitworld,

          Thank you for contacting us.

          There’s no mistake in the documentation, I believe the confusion is because of how the information is presented on the charts. Please allow us to explain. Whenever an expansion board is connected to the Edison, MRAA evaluates the expansion board connected as either an Arduino expansion board or a mini breakout board. If the Arduino expansion board is connected, then the MRAA mapping is just as the pin number. It goes from 0-13 for GPIOs and for 0-5 for analog pins. If you connect a mini breakout board to the Edison, then you’d have to check the Edison pin numbers from the MRAA docs here: https://iotdk.intel.com/docs/master/mraa/edison.html . You mentioned an example where you suspect MRAA number 37 might be inaccurate in the documentation. MRAA number 37, in this case is used in the mini breakout board and is mapped to the physical pin J19-10.

          I hope this information is clear. Let me know if you have any questions, we’d be happy to clarify if needed.

          Regards,
          -Sergio A
           

          • 2. Re: mapping from MRAA number to Edison Arduino breakout pin
            hitworld

            Hi Sergio,

             

            thank you for your explanations!

            Can I understand it in this way, for Arduino expansion board, GPIO 0 to 13 are mapped to the same number in MRAA, and A0 - A5 are mapped to 14 - 19 in MRAA, so I can use mraa_gpio_init() to initialize them for GPIO purpose. For analog usage, it's from number 0  to 5 in MRAA, so when I put number 0 - 5 in mraa_aio_init() function, MRAA knows now it's analog pin.

             

            Best

            • 3. Re: mapping from MRAA number to Edison Arduino breakout pin
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi hitworld,

              You’re welcome. Glad I was able to help!

              Regards,
              -Sergio A