1 2 Previous Next 16 Replies Latest reply on Oct 7, 2015 4:02 PM by laniko

    Intel Edison Mini Breakout Board, GPIO High and Ground Pins

    laniko

      My projects needs a constant gpio high logic and ground to control my mosfet.  As well as two GPIO to act as input interrupts when signals go from high to low 

       

      I think  found my logic supply's, and annotated them below. but can someone advise on the best two pins to use as my GPIO inputs.  As my circuit will be active high on both inputs and only drop to low for 23ms pulses  I should not have an issue with the boot up gpio logic, however I would like to pick the pins with least amount of mulitplexing issues. Thanks

       

       

       

       

      J19 - pin 2 V_V1P80 System 1.8 V I/O output power

      J19 - pin 3 GND Ground.

       

      INTEL_edison_GPIOHigh_Gnd.JPG

        • 1. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
          CMata_Intel

          Hi laniko,

           

          1. Are you going to power the MOSFET with the module o is the MOSFET only going to be controlled by the module?

          2. As inputs you can use whichever of the GPIOS like 24, 25, 26, 28, 30, 32, 34, 42, and 48 [GP44, GP165, GP45, GP46, GP47, GP48, GP49, GP15 and GP14]. Take a look at the specifications of the GPIOs http://download.intel.com/support/edison/sb/edisonmodule_hg_331189004.pdf so you can be aware of all the voltage and current requirements for these pins.

          3. If you are concerned about the states of the pins while booting you can try with pull-up resistors or with a cold boot [echo 1 > /sys/module/intel_mid/parameters/force_cold_boot]

           

          Regards,

          Charlie

          • 2. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
            laniko

            CMata_Intel

             

            Hi Chris

            Sorry it is not a MOSFET its NPN BJT Transistor

             

            Like the attached picture.

             

            Ill be using the Edison Constant 1.8V Supply for the High Logic and Edison Grounds for Low

             

            I have decided to GP165 (J18-Pin 2) as my GPIO Input to Edison.

            The plan is to put the device to sleep and when the GP165 to get triggered when it goes from High-to-Low (Falling Edge) do a specfic task and go back to sleep and await the next interrupt

             

            1) what is the correct way to identify GP165(J18-Pin 2) in in my node application using MRAA

             

            2) Assuming my transistor design is correct where can I get more detail regarding Edison Wake Source function.

             

            3) Sample GPIO as Input and Interrupt code

             

            Let me know your thoughts Chris,

            Sample.jpg

            thanks

            • 3. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
              mhahn

              mraa/edison.md at master · intel-iot-devkit/mraa · GitHub may help you on the pins of the mini breakout board. You'll find examples for MRAA GPIO & interrupts in MRAA samples

              • 4. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                CMata_Intel

                Hi laniko,

                 

                Do you have updates in this?

                As mhahn said you can use that link to have the MRAA number for the pins in the board. In your case the J18-2 is MRAA 15.

                We are currently working on more documentation about the states and power management for Edison, right now I suggest you to use sleep functions for this.

                You can find different examples using MRAA and JavaScript here: mraa/examples/javascript at master · intel-iot-devkit/mraa · GitHub

                 

                Regards,

                Charlie

                • 5. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                  laniko

                  Thanks mhahn

                   

                  CMata_Intel

                   

                  I have decided to use two pins (MRAA 14, 15) for my two inputs using ISR

                   

                  1) I noticed in the sample code the direction of the GPIO is not declared, I assume its understood to  be inputs thus not necessary?

                   

                  2) Will the interrupt work to wake edison up from sleep even if the pulse is only 20mS? I need Edison to sleep all time except for when ever MRAA14, 15 are triggered externally.

                   

                  3) My 2 pins will be active high so will the sleep function on edison still work with this circuit? My usecase both GPIO will be high except for about 20ms when it will be low. During that time node app should register and do the selected task.

                   

                  4) During Sleep, will Edison still suplly the 1.8V High Supply at j19-2

                   

                  5) Any sleep / wake trigger samples and documentation you guys can suggest to review to better understand

                   

                   

                  Thanks please see the code for a sample nodeJS is this sufficient to to get this 2 pin isr set up ?

                   

                   

                  #!/usr/bin/env node

                   

                  var m = require('mraa')


                  function h() {

                    console.log("GPIO 14")

                  }

                   

                  function i() {

                    console.log("GPIO 15")

                  }

                   

                  x = new m.Gpio(14)

                  x.isr(m.EDGE_BOTH, h)

                   

                  x = new m.Gpio(15)

                  x.isr(m.EDGE_BOTH, h)

                  • 6. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                    CMata_Intel

                    Hi laniko,

                     

                    1) It depends on the GPIO, sometimes it could be set as input or output. I suggest you to take a look at the Hardware Guide for the Arduino Expansion Board [Section 11]. You will see how to configure a pin from the Linux side. Or you can set it with  xxx.dir(mraa.DIR_IN)

                    2,3,4) How are you going to sleep the Edison? According to the Hardware Guide for the Edison Compute Module, to ensure the detection of a pulse, the pulse should be five clock cycles long, in a normal performance the pulse has to be higher than 100ns.

                    3) Are you going to sleep the Edison and generate an interrupt to wake it up with another Edison?

                    4) If you are talking about the sleep command for Linux you should be having the same output always.

                    5) There are no available documentation about these states yet nor ETA for them. I apologize for the inconveniences this may produce.

                     

                    Your code looks good, take a look at this one too: Re: Edison ISR where the direction of the pin is set as an input I think it could help you.

                     

                    Regards,

                    Charlie

                    • 7. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                      laniko

                      CMata_Intel

                       

                      Thanks Chris,

                       

                      1) Is it possible to put Edison to sleep using nodeJS and not via the Linux sleep command? If so what is the command in JS, I can not seem to find it in the documentation

                       

                      2) Are you going to sleep the Edison and generate an interrupt to wake it up with another Edison? No i have my own circuit that will give GPIO low pulse for 20ms before coming back to a high. This will need to trigger the Edison to do the task for each interrupt.

                       

                      3) I want to know if the Edison board is in sleep mode, will the pin 19-2 still supply 1.8v even when that edison chip is at sleep.  I need that 1.8v supply for my circuit that connects to the edison as interrupt

                       

                      4) Finally how do i show my code in the forumn using the proper format.

                       

                       

                      #!/usr/bin/env node

                       

                      var m = require('mraa')

                      x = new m.Gpio(14)

                      x.dir(m.DIR_IN)


                      y = new m.Gpio(15)

                      y.dir(m.DIR_IN)


                      function h() {

                        console.log("GPIO 14")

                      }

                       

                      function i() {

                        console.log("GPIO 15")

                      }

                       

                       

                      x.isr(m.EDGE_BOTH, h)

                      y.isr(m.EDGE_BOTH, i)

                      • 8. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                        CMata_Intel

                        Hi laniko,

                         

                        1) You can use system commands in Javascritp: Execute a system command

                        2) If this is the case, you shouldn't have problems (as I said) the Edison in order to ensure the detection of a pulse, the pulse should be five clock cycles long, in a normal performance the pulse has to be higher than 100ns.

                        3) You should have the same voltage in the pins if you are going to use the sleep function, this function is not related with the hardware of the module.

                        4) After clicking on Reply, select the option "Use advanced editor", then click on the button >> and go to Syntax Highlighting. After this select the option you want.

                         

                         

                        Regards,

                        Charlie

                        • 9. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                          CMata_Intel

                          Hi laniko,

                           

                          Do you have updates in this?

                           

                          -Charlie

                          • 10. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                            laniko

                            CMata_Intel

                             

                            Thanks Charlie.

                             

                            I am going to scale up my application from the led 13 blink demo.  I will sort out the sleep commands and power managment after

                             

                            Now i have set up the following code,

                             

                            var mraa = require('mraa'); //require mraa
                            
                            var X = new mraa.Gpio(15); //LED hooked up to digital pin 15
                            X.dir(mraa.DIR_IN); //set the gpio direction to input
                            
                            
                            var myOnboardLed = new mraa.Gpio(13); //LED hooked up to digital pin 13
                            myOnboardLed.dir(mraa.DIR_OUT); //set the gpio direction to output
                            var ledState = true; //Boolean to hold the state of Led
                            
                            
                            X.write(0);
                            var ONN = ' ';
                            
                            
                            periodicActivity(); //call the periodicActivity function
                            
                            
                            function periodicActivity()
                            {
                              myOnboardLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' (low)
                              ledState = !ledState; //invert the ledState
                            
                            
                              var X_STATE =  X.read();
                            
                            
                              ONN = X_STATE == true ? "GPIO 15 HIGH" : "GPIO 15 LOW";
                            
                            
                              console.log('LEDSTATE: ' + ledState + ' | PIN15: ' + X_STATE + ' | state: ' + ONN);
                            
                            
                              setTimeout(periodicActivity,2000); //call the indicated function after 1 second (1000 milliseconds)
                            }
                            
                            
                            
                            

                             

                             

                            Here is my console log:

                             

                             

                            29.09.15 17:44:11 [-0400] LEDSTATE: false | PIN15: 1 | state: GPIO 15 HIGH

                            29.09.15 17:44:13 [-0400] LEDSTATE: true | PIN15: 1 | state: GPIO 15 HIGH

                            29.09.15 17:44:15 [-0400] LEDSTATE: false | PIN15: 1 | state: GPIO 15 HIGH

                            29.09.15 17:44:17 [-0400] LEDSTATE: true | PIN15: 1 | state: GPIO 15 HIGH

                            29.09.15 17:44:19 [-0400] LEDSTATE: false | PIN15: 1 | state: GPIO 15 HIGH

                            29.09.15 17:44:21 [-0400] LEDSTATE: true | PIN15: 1 | state: GPIO 15 HIGH

                            29.09.15 17:44:23 [-0400] LEDSTATE: false | PIN15: 1 | state: GPIO 15 HIGH

                            29.09.15 17:44:25 [-0400] LEDSTATE: true | PIN15: 1 | state: GPIO 15 HIGH

                             

                             

                            1) Looks like GPIO 15 is High everytime i boot up the edison is this normal?

                             

                            2) More importantly when i Connect J19-3 (Ground) to J18-2 (MRAA 15) the edison module just reboots.  I was tryiing to give it a Low signal and see the console produce the expectat results for that but each time Edison reboot...

                             

                            Not sure what I am doing wrong here.  I expected the PIN15 0 and state: GPIO 15 LOW when  a ground signal to the pin is connected...  mhahn Intel_Alvarado

                             

                            Update:

                            3) I tried it with MRAA 31 which is J19-3 and when i connect the ground i get the expected result. but also this gipi is high when booting up as well

                            • 11. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                              mhahn

                               

                               

                              2) More importantly when i Connect J19-3 (Ground) to J18-2 (MRAA 15) the edison module just reboots.  I was tryiing to give it a Low signal and see the console produce the expectat results for that but each time Edison reboot...

                               

                              Not sure what I am doing wrong here.  I expected the PIN15 0 and state: GPIO 15 LOW when  a ground signal to the pin is connected...  mhahn Intel_Alvarado

                               

                               

                               

                              check mraa: Intel Edison

                              not sure whether you somehow interfere with UART?

                               

                              13J17-14GP128GPIO-128UART-1-CTS
                              • 12. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                                laniko

                                mhahn

                                 

                                thanks for the advice.

                                 

                                I actually just moved over to J19-4 and J19-5 and working perfect now

                                 

                                Currently I am getting app to work using the basic setTimeout()

                                 

                                CMata_Intel DiegoVal_Intel

                                 

                                However in this example below you guys have referred to make use of the ISR interrupt they are using the same setTimeout()..

                                 

                                1)Is it possible to do interrupt without using timeout

                                 

                                2) Is there documentation of EDGE_FALLING

                                 

                                3) Sample code on using 2 interrupts at once

                                 

                                 

                                 

                                #!/usr/bin/env node  
                                  
                                var mraa = require('mraa') //require mraa  
                                console.log('MRAA Version: ' + mraa.getVersion()); //write mraa version to the console  
                                  
                                function h()  
                                {  
                                console.log("Yo!!") //write message to the console  
                                }  
                                  
                                InterruptPin = new mraa.Gpio(7) // mraa7 - gp20  
                                InterruptPin.dir(mraa.DIR_IN) //set the Gpio direction to input  
                                a(); //call the a function  
                                  
                                function a()  
                                {  
                                InterruptPin.isr(mraa.EDGE_BOTH, h)  
                                setTimeout(a, 500); // call the a function after 500 millis  
                                }  
                                
                                
                                
                                
                                
                                • 13. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                                  CMata_Intel

                                  Hi laniko,

                                   

                                  1) The setTimeout function calls repeatedly the main function, if you remove this function the code will run the routine only once.

                                  2) The documentation about the MRAA API for Javascript is in here: Gpio

                                  3) You can repeat the same logic you are using on your code, something like:

                                   

                                  var mraa = require('mraa') //require mraa
                                  console.log('MRAA Version: ' + mraa.getVersion()); //write mraa version to the console
                                  
                                  function h()
                                  {
                                  console.log("Yo1!!") //write message to the console
                                  }
                                  function g()
                                  {
                                  console.log("Yo2!!") //write message to the console
                                  }
                                  
                                  InterruptPin = new mraa.Gpio(7)  // mraa7 - gp20
                                  InterruptPin2 = new mraa.Gpio(8) // mraa8 -gp28
                                  InterruptPin.dir(mraa.DIR_IN)    // set the Gpio direction to input
                                  InterruptPin2.dir(mraa.DIR_IN)   // set the Gpio direction to input
                                  a(); //call the a function
                                  
                                  function a()
                                  {
                                  InterruptPin.isr(mraa.EDGE_BOTH, h)
                                  InterruptPin2.isr(mraa.EDGE_BOTH, g)
                                  setTimeout(a, 500); // call the a function after 500 millis
                                  }
                                  
                                  • 14. Re: Intel Edison Mini Breakout Board, GPIO High and Ground Pins
                                    laniko

                                    Hi CMata_Intel

                                     

                                    Now my external circuit signal last abut 25ms so I would to setTimeout(a,20);

                                    Will this effect my battery management if its continuously looping or is this the best way to detect two gpio interrupts while conserving the least amount of power.

                                     

                                    Further now you have a better understanding of my fimrware logic. You have any suggestions on how to sleep function would fit into this usecase

                                     

                                    Thanks

                                    1 2 Previous Next