Trying to apply M3/M5 to HEATER_0_PIN

Hi All,
First post here, but lurking for a while. I’m still printing the parts for a MPCNC Primo, and have all the electrical stuff on my desk getting setup. I’m using SKR 1.3 board with TMC5160v1.2 drivers in SPI and a TFT35 v3 screen. Going for the dual endstop setup, using Michael’s (TT) config files. I have a 24V PS running the board and steppers, and want M3/M5 to control the HEATER_0_PIN (P2_07) to control a 24V/150A HEAVY DUTY relay. This will control my power outlets for a spindle and vacuum. I figure the P2_07 output is 24V, and should handle the ~350mA (at 24V) coil in this relay, though I might need to add a diode to protect from backfeed.
I’m talking to the SKR with Pronterface, and M122 shows good drivers, and I can move the motors. Also, M106/M107 controls the FAN pins, but M3/M5 is returned as “unknown command”
How to set the M3/M5 in which files to relate to that pin? That is my problem! Any help?

M3 is the spindle pin, which would be set in the pins_skr_something.h file.

You can also use M42 to turn on or off a specific pin. IDK how that works with the skr numbering.

Thanks Jeff - got that setup (I think?). Trying to relate M3/M5 to that pin is what I’m missing - I think (again :slightly_smiling_face:)

I looked the the M42 on Wiki and found the following;

In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with M42 P102 S1 .
So tried it with M42 P207 S1 and it came back as “Error - Protected Pin” so looks like that is not available. The M42 is meant for general I/O pins that are not used yet from what I read.

It may not let you mess with that because it is still for the heater. So you will probably need to change that. This is how it is set for the rambo:

I’m using the servo pin to enable a relay controlling my spindle. Should give you an idea on what to change in the pins file to use something else.

OK, almost got it! Using Pronterface I can send the M3 and M5 code and not get “unknown command” returned. Also can see the LED for the HE0 connection blink when I send the M3, but it doesn’t stay ON. Just a single flash showing the command is working to activate that pin. It seems like something else is taking control of that pin. The HEATER_0_PIN is also using that same P2_07. Hmmm - maybe if I set that to a different pin that is unused, and leave SPINDLE_LASER_ENA_PIN set to P2_07 it could eliminate the second function on that pin.