2 Replies Latest reply on Feb 5, 2014 4:12 PM by Intel_Jesus

    Having issues with using all the digital port pins

    ALJ-1108ExtremeCoder

      Hey Guys and Gals,

      Having an issue using all the digital pins wondering what could be wrong???

      this code is toggling every pin supposedly and the a0-a5 is working but the 0-13 stuff isn't on some of the pins

      // testing each output with a scope

       

      void setup()
      {
      pinMode(0,OUTPUT);
      pinMode(1,OUTPUT);
      pinMode(2,OUTPUT);
      pinMode(3,OUTPUT);
      pinMode(4,OUTPUT);
      pinMode(5,OUTPUT);
      pinMode(6,OUTPUT);
      pinMode(7,OUTPUT);
      pinMode(8,OUTPUT);
      pinMode(9,OUTPUT);
      pinMode(10,OUTPUT);
      pinMode(11,OUTPUT);
      pinMode(12,OUTPUT);
      pinMode(13,OUTPUT);
      pinMode(A0,OUTPUT);
      pinMode(A1,OUTPUT);
      pinMode(A2,OUTPUT);
      pinMode(A3,OUTPUT);
      pinMode(A4,OUTPUT);
      pinMode(A5,OUTPUT);
      }

       

       

       

      void loop()
      {
      // turn ever pin high-----------------------------------------------
      digitalWrite(0, HIGH);  
      digitalWrite(1, HIGH); 
      digitalWrite(2, HIGH);  
      digitalWrite(3, HIGH);  
      digitalWrite(4, HIGH); 
      digitalWrite(5, HIGH);   
      digitalWrite(6, HIGH); 
      digitalWrite(7, HIGH);   
      digitalWrite(8, HIGH); 
      digitalWrite(9, HIGH);   
      digitalWrite(10, HIGH); 
      digitalWrite(11, HIGH);  
      digitalWrite(12, HIGH);  
      digitalWrite(13, HIGH); 
      digitalWrite(A0, HIGH);  
      digitalWrite(A1, HIGH); 
      digitalWrite(A2, HIGH);
      digitalWrite(A3, HIGH);
      digitalWrite(A4, HIGH);
      digitalWrite(A5, HIGH);
      delay(10);               // wait for a bit
      // turn ever pin low-----------------------------------------------
      digitalWrite(0, LOW);  
      digitalWrite(1, LOW); 
      digitalWrite(2, LOW);  
      digitalWrite(3, LOW);  
      digitalWrite(4, LOW); 
      digitalWrite(5, LOW);   
      digitalWrite(6, LOW); 
      digitalWrite(7, LOW);   
      digitalWrite(8, LOW); 
      digitalWrite(9, LOW);   
      digitalWrite(10, LOW); 
      digitalWrite(11, LOW);  
      digitalWrite(12, LOW);  
      digitalWrite(13, LOW); 
      digitalWrite(A0, LOW);  
      digitalWrite(A1, LOW); 
      digitalWrite(A2, LOW);
      digitalWrite(A3, LOW);
      digitalWrite(A4, LOW);
      digitalWrite(A5, LOW); 
      delay(10);// wait for a bit

      }

        • 1. Re: Having issues with using all the digital port pins
          Intel_Jesus

          Hi ALJ-1108ExtremeCoder,

           

          I have wired up pins 0 - 13 and used the code you provided. I can see pin 2 – 13 blinking and pin 0 and pin 1 are tied high. Are these the same results you are getting?

           

          Regards,

          Intel_JEspinoza

          1 of 1 people found this helpful
          • 2. Re: Having issues with using all the digital port pins
            Intel_Jesus

            Hi ALJ-1108ExtremeCoder,

             

            Add to the file <arduino-1.5.3>\hardware\arduino\x86\cores\arduino\ wiring_digital.c after line 143 the following:

             

                                            if ( pin == MUX_SEL_UART0_RXD && mode == OUTPUT)

                                                            sysfsGpioSet(gpio2gpiohandle(40), HIGH);

                                            if ( pin == MUX_SEL_UART0_TXD && mode == OUTPUT)

                                                            sysfsGpioSet(gpio2gpiohandle(41), HIGH);

             

            Restart Arduino IDE and that should fix pin 0 and 1 to be used as digital output.

             

            Regards,

            Intel_JEspinoza