Z end stop not detected

Hopefully correct format

DIY Router
Arduino UNO R3
Engraver shield
Easel 0.3.10
Grbl 1.1F

Fitted and connected the end switches. Attempted to home the the machine. The Z axis activated first but the micro switch did not stop travel.

Went into the Machine Inspector to check end stop operation . X and Y work OK but not Z. Moved the wiring about on the board to prove the switches, with all switches working except when connected to Z +ve or -ve .

Is it something I have missed?

Any advice much appreciated.

Wiring diagram, code?

I am assuming that the "engraver shield" is a protoneer grbl shield.

In grbl 1.1, variable spindle speed (PWM) is enabled by default. With variable spindle speed enabled the Z axis limit switch connects to spindle enable (SPNEN pin12) and the PWM to the spindle motor controller comes from Z+ or Z- limit switch connector (pin 11). See the config.h file in the grbl folder for more information.

I thank you for your replies.

The wiring digram is a N/O micro switch connected across the End Stop connections on the shield.

Code. Total novice so am a bit lost with what you require.

"protoneer grbl shield". I assume so

I am guessing that there is something in the settings that will allow me to take Z out of the homing cycle but again not sure where to look although I can see setting in the Machine Inspector
Settings
$0=10
$1=25
$2=0
$3=0
$4=0
$5=0
$6=0
$10=115
$11=0.010
$12=0.002
$13=0
$20=0
$21=0
$22=0
$23=0
$24=25.000
$25=500.000
$26=250
$27=1.000
$30=1
$31=0
$32=0
$100=250.000
$101=250.000
$102=320.000
$110=500.000
$111=500.000
$112=500.000
$120=10.000
$121=10.000
$122=10.000
$130=290.000
$131=290.000
$132=200.000
Consoleok
$132=200.000
$131=290.000
$130=290.000
$122=10.000
$121=10.000
$120=10.000
$112=500.000
$111=500.000
$110=500.000
$102=320.000
$101=250.000
$100=250.000
$32=0
$31=0
$30=1
$27=1.000
$26=250
$25=500.000
$24=25.000
$23=0
$22=0
$21=0
$20=0
$13=0
$12=0.002
$11=0.010
$10=115
$6=0
$5=0
$4=0
$3=0
$2=0
$1=25
$0=10
$$

Hope this helps

I am guessing that there is something in the settings that will allow me to take Z out of the homing cycle but again not sure where to look

Enable homing cycle by setting $22=1.
If you want to customize which axis are homed and the order of homing the axes, you need to edit the config.h file, re-compile and upload grbl.

More info on configuring grbl.

I thank you very much for your reply. At moment reading through file.

From my brief look my end stops can be used for homing or a limit. I have run a test carve however when I activate a limit switch nothing happens. Activating emergency stop does work.
Should I have both $20=1 & $22=1?

Well decided not to be lazy and experiment. Turned $21 on and micro switched now work. Other problems now so will persevere . Thanks again