Clock output on multiple pins

Hello, I have this code:

int i,N;
void setup()
{//*G1*
pinMode(2,OUTPUT); //signal pin
  pinMode(A0,INPUT); //input pin
  pinMode(8,OUTPUT); //ready pin
  //*G1*
  
  //*G2*
  pinMode(3,OUTPUT);
  pinMode(A1,INPUT);
  pinMode(9,OUTPUT);
  //*G2*
  
  //*G3*
  pinMode(4,OUTPUT);
  pinMode(A2,INPUT);
  pinMode(10,OUTPUT);
  //*G3*
  
  //*G4*
  pinMode(5,OUTPUT);
  pinMode(A3,INPUT);
  pinMode(11,OUTPUT);
  //*G4*
  
  //*G5*
  pinMode(6,OUTPUT);
  pinMode(A4,INPUT);
  pinMode(12,OUTPUT);
  //*G5
}


void loop()
{ 
  transmisie(8,2,A0);
  transmisie(9,3,A1);
  transmisie(10,4,A2);
  transmisie(11,5,A3);
  transmisie(12,6,A4);
 
}


void transmisie(int R, int P ,int a)
{ // ii();
  //O(R,P);
  
  digitalWrite(R,LOW);
  N=analogRead(a);
  N=map(N,0,1023,1,210);
  for(i=0;i<N;i++)
  {//delayMicroseconds(40);
   digitalWrite(P,HIGH); 
   //delayMicroseconds(40);
   digitalWrite(P,LOW);

  }
  digitalWrite(R,HIGH);
  
}

There are pots on the A pins.
The R and P pins go to a FPGA. The problem is as follows:
if I connect only the pins from 1 “transmisie” to the fpga and the others remain unconnected everything works perfectly. Once any of the other wires are connected nothing works. I tried putting the unused pins to Hiz (input) to no success. Any help?:slight_smile:

For who dosent know what a fpga is, lets say it’s a very powerfull arduino that can run parallel processes.

Analogue pins are, by definition, input pins - there's no need to set the pin mode. Which FPGA are you using?

Pin names would be good too.

BASYS2 250 from Digilent I'm using the PMOD pins for connecting the arduino. I'm using the 2nd and 3rd from the JB pmod, and the entire JC and JD pins (excepting gnd/vcc obviously) The pins not mensioned are used as outputs to servos. I know I can use the arduino directly to servos but using the fpga is the idea.