DynamicPerception / OMLibraries

OpenMoCo Libraries for AVR
GNU General Public License v3.0
35 stars 28 forks source link

change pin numbering for OMMotor - question #5

Open samitray opened 11 years ago

samitray commented 11 years ago

Can i change the step and direction pin numbers from the default DDIR 4 , DSTEP 9 to any other pin number?

is there any restriction on which pin numbers can be used for step and direction like they have to be on same port or something similar?

what about DMS1, DMS2, DMS3 pins what are they for? I have a cheapo stepper driver that takes steps direction and enable, i guess the DSLP pin should get connected to the drive enable, the step and direction to DSTEP and DDIR respectively. Microstepping is done by the driver through dip switches, so in this case is there any need to connect MS!,MS2,MS3 pins at all?

Regards

thisdroneeatspeople commented 11 years ago

You can change the pins to any pins you like by modifying the definitions in the header file. The important part is to make sure that the port register and port flag are correct for the step pin, since it is driven directly during stepping. They need to be the registers that refer to your step pin.

There is no requirement that any pin be on the same register as another pin.

The DMSx pins are the microstep controls. You can set to them to whatever you want, as long as you don't need to use the ms() method. Note that they will be set as outputs during the constructor. No need to connect them if your driver doesn't use them.