2 Replies Latest reply on Feb 25, 2016 11:34 AM by mhirst

    Galileo pinmux: how to enable all GPIO pins as input?

    geedubess

      Hi,

       

      I have an empty Rocket project which I have modified in an attempt to configure

      to use all GPIO pins as input (save for #13, which I use as a square wave

      output). I see very strange results, though, with two notable problems.

       

      Problem #1) configuring entry 2 as FUNC_B (in) results in the UART not working

      - is there a link between the UART and the arduino shield header pins?! How can

      I use arduino digital pin #2 as GPIO? (I am trying to use this pin specifically

      because I would like to use it as an interrupt source, and the IO mapping doc

      indicates that 2 & 3 are the only two interruptable pins).

       

      Problem #2) sending a square wave into all input pins does not show the

      expected result (some pins show no input; others [5] very strange behavior!).

       

      Details:

       

      0 - not tested (RX)

      1 - not tested (TX)

      2 - okay

      3 - okay

      4 - does not toggle!

      5 - when I provide input to this, BOTH 5 and 6 register the input!!!

      6 - does not toggle!

      7 - okay

      8 - does not toggle!

      9 - does not toggle!

      10- okay

      11- does not toggle!

      12- okay

      13- not tested (square wave output)

       

      Clearly 4,6,8,9,11 are configured wrong or not working.

       

      5 looks like a hardware defect.

       

      Here is my pin mux config - please advise? Is there an example that could

      demonstrate all of the pins working as inputs?

       

      static struct pin_config mux_config[NUM_IO_PINS_USED] = {

          /* pin, selected mode    <mode A, mode B, mode C, mode D> */

          /* Analog Inputs */

          { 0,  PINMUX_FUNC_C }, /* GPIO3 (out), GPIO3 (in), UART0_RXD, NA */

          { 1,  PINMUX_FUNC_C }, /* GPIO4 (out), GPIO4 (in), UART0_TXD, NA */

          { 2,  PINMUX_FUNC_C }, /* GPIO5 (out), GPIO5 (in), UART1_RXD, NA */

          { 3,  PINMUX_FUNC_B }, /* GPIO6 (out), GPIO6 (in), UART1_TXD, PWM.LED1 */

          { 4,  PINMUX_FUNC_B }, /* GPIO_SUS4 (out), GPIO_SUS4 (in), NA, NA */

          { 5,  PINMUX_FUNC_B }, /* GPIO8 (out), GPIO8 (in), PWM.LED3, NA */

          { 6,  PINMUX_FUNC_B }, /* GPIO9 (out), GPIO9 (in), PWM.LED5, NA */

          { 7,  PINMUX_FUNC_B }, /* EXP1.P0_6 (out), EXP1.P0_6 (in), NA, NA */

         

          { 8,  PINMUX_FUNC_B }, /* EXP1.P1_0 (out), EXP1.P1_0 (in), NA, NA */

          { 9,  PINMUX_FUNC_B }, /* GPIO_SUS2 (out), GPIO_SUS2 (in), PWM.LED7, NA */

          { 10, PINMUX_FUNC_B }, /* GPIO2 (out), GPIO2 (in), PWM.LED11, NA */

          { 11, PINMUX_FUNC_B }, /* GPIO_SUS3 (out), GPIO_SUS3 (in), PWM.LED9, SPI1_MOSI */

          { 12, PINMUX_FUNC_B }, /* GPIO7 (out), GPIO7 (in), SPI1_MISO, NA */

          { 13, PINMUX_FUNC_A }, /* GPIO_SUS5 (out), GPIO_SUS5(in), SPI1_SCK, NA */

         

          { 14, PINMUX_FUNC_B }, /* EXP2.P0_0 (out)/ADC.IN0, EXP2.P0_0 (in)/ADC.IN0, NA, NA */

          { 15, PINMUX_FUNC_B }, /* EXP2.P0_2 (out)/ADC.IN1, EXP2.P0_2 (in)/ADC.IN1, NA, NA */

          { 16, PINMUX_FUNC_B }, /* EXP2.P0_4 (out)/ADC.IN2, EXP2.P0_4 (in)/ADC.IN2, NA, NA */

          { 17, PINMUX_FUNC_B }, /* EXP2.P0_6 (out)/ADC.IN3, EXP2.P0_6 (in)/ADC.IN3, NA, NA */

          { 18, PINMUX_FUNC_C }, /* EXP2.P1_0 (out), ADC.IN4, I2C_SDA, NA */

          { 19, PINMUX_FUNC_C }, /* EXP2.P1_2 (out), ADC.IN5, I2C_SCL, NA */

      };

       

      thanks,

      Greg