TGit-Tech / GRBL-28byj-48

Grbl ver 1.1f.20170131 with XYZ Unipolar Stepper Support (28byj-48)
Other
89 stars 44 forks source link

PinOut change #8

Open Blackbox2018 opened 3 years ago

Blackbox2018 commented 3 years ago

Good afternoon Is it possible change the pin from Z to Y? I'd like to use your GRBL, but my pcb are X 2,3,4,5 ad Y6,7,8,9

Carlo

TGit-Tech commented 3 years ago

It should be especially if you're doing just a axis difference with same pins.

The code you want to change is in stepper.c Let me know if you have any problems with it - perhaps I can find some time to dig in and help out.

But it should be pretty straight forward - just a copy / paste the two PORT? = Assignments from one Axis to the other.

if (st.exec_block->direction_bits & (1<<X_DIRECTION_BIT)) { 
  sys_position[X_AXIS]--; 
  costyx=costyx-1;
  if (costyx < 1) costyx=8;
  if (costyx==1)   PORTD=0B100000;
  if (costyx==2)   PORTD=0B110000;
  if (costyx==3)   PORTD=0B010000;
  if (costyx==4)   PORTD=0B011000;
  if (costyx==5)  PORTD=0B001000;
  if (costyx==6)  PORTD=0B001100;
  if (costyx==7)  PORTD=0B000100;
  if (costyx==8) PORTD=0B100100;
} else { 
  sys_position[X_AXIS]++; 
  costyx=costyx+1;
  if (costyx > 8) costyx=1;
  if (costyx==1)   PORTD=0B100000;
  if (costyx==2)   PORTD=0B110000;
  if (costyx==3)   PORTD=0B010000;
  if (costyx==4)   PORTD=0B011000;
  if (costyx==5)  PORTD=0B001000;
  if (costyx==6)  PORTD=0B001100;
  if (costyx==7)  PORTD=0B000100;
  if (costyx==8) PORTD=0B100100;
}