I’m trying to convert my JCUT 6090 laser cutter to use an MKS SBase board rather than the PCI controller card and dedicated computer I had before.
Initially I intended to use Smoothieware but due to various problems I have decided to switch to grbl-lpc. I have done a test build and have been able to control my external stepper drivers, but I haven’t wired up the laser power supply yet.
As best as I can tell, unlike a K40 LPS, my LPS is supposed to take PWM on pin 5 rather than an analog voltage. I plan to use the default P2.5 mosfet output for the PWM, but I also want to wire up an active low enable pin for the laser. I’m also trying to avoid adding to many extra components. What I would like is to set the “SPINDLE_DIRECTION_BIT” (that I’m using for SPINDLE_ENABLE) to be open drain and then add a pull up resistor to it.
So to finally get to my question, can I just edit the cpu_map.h file to use the Stepper A pins (which I have already set to open drain in the config.h file) for the “SPINDLE_DIRECTION_BIT”?
So it would look like // Define spindle enable and spindle direction output pins.
#define SPINDLE_ENABLE_DDR LPC_GPIO1->FIODIR
#define SPINDLE_ENABLE_PORT LPC_GPIO1->FIOPIN
#define SPINDLE_ENABLE_BIT 30 // P1.30
#define SPINDLE_DIRECTION_DDR LPC_GPIO0->FIODIR
#define SPINDLE_DIRECTION_PORT LPC_GPIO0->FIOPIN
#define SPINDLE_DIRECTION_BIT 22 // P0.22
Would that work? If yes, would I need to change "A_DIRECTION_BIT " to something else or can I just leave it defined in both places? If I change "A_DIRECTION_BIT " to something else, will the open drain config also change or will it stay on P0.22?
Or if I can’t do that, what about changing “SPINDLE_DIRECTION_BIT” to one the other Mosfet enable pins?
Or is there an easier way to make the “SPINDLE_DIRECTION_BIT” open drain?
I really don’t understand a lot about this and I’m trying to avoid burning up my MKS board.