Perhaps stating the things I don't understand one at a time, would make it easier for those in the Know, to assist me.
The Modbus (not sure if all CNC's use the same version) that I have uploaded to my Arduino Mega 2560 has the following registers:
//################ Initialize IO ################# // 0 => Output, 1 => Input, opposite of normal Arduino, but my habit from other platforms, 0 looks like an O and 1 looks like an I
Register[IO_Config_Register] = 0b0000000000000000; // UNO and MEGA PIN 00-15
Register[IO_Config_Register+1] = 0b0000000000000000; // MEGA PIN 16-31
Register[IO_Config_Register+2] = 0b0000000000000000; // MEGA PIN 32-47
Register[IO_Config_Register+3] = 0b0000000000000000; // MEGA PIN 48-64
Register[IO_Config_Register+4] = 0b1111111111111111; // AN Digital PIN A0-A16
//################ Kill IO Register ################# // 0 => Leave, 1 => Kill
Register[Kill_IO_Register] = 0b1111111111111111; // UNO and MEGA PIN 00-15
Register[Kill_IO_Register+1] = 0b1111111111111111; // MEGA PIN 16-31
Register[Kill_IO_Register+2] = 0b1111111111111111; // MEGA PIN 32-47
Register[Kill_IO_Register+3] = 0b1111111111111111; // MEGA PIN 48-64
Register[Kill_IO_Register+4] = 0b1111111111111111; // AN Digital PIN A0-A16
//################ PWM IO Register ################# // 0 => Normal I/O, 1 => PWM I/O
Register[PWMIOMap_Register] = 0b0000111001101000; // UNO and MEGA PWM 01-16
//################ AN IO Register ################# // 0 => Digital, 1=> Analog
Register[ANIOMap_Register] = 0b1111111111111111; // UNO and MEGA
There is no area in the code, nor in any of the library's to define the pins to be used specifically with relation to each output, which I suspect Mach will take care of, again not sure?
If so, can I select pins as follow:
X Step 22 Dir 23 all on port 1 (Modbus Slave address)
Y Step 24 Dir 25
Z Step 26 Dir 27
B Step 28 Dir 29
This arrangement is due to the fact that a LCDKeypad shield I have plugged onto the Ard Mega covers most of the other pins and only really leaves me with the header that contains pins 22-53.
Any help will be greatly appreciated!