Finally, TinyG2 (ArduinoDue+gShield) is working OK.

Finally, TinyG2 (ArduinoDue+gShield) is working OK.

First of all I would like to express my huge appreciation to @Alden_Hart for his immediate support and for explaining in details the way TinyG2 works.

It looks that the wiring method I am using in my setup (NC switches wired with pull-down resistors to GND and switch mode in settings.h set to ACTIVE_LOW) has not been described.
I have to state here that the method of wiring NC switches with pull-up resistors connected to VCC and switch mode in settings.h set to ACTIVE_HIGH, which is presented in the source files comments did not work for me. It conflicted with the probing process.

I am using two NC switches for each axis wired in series thus both sharing a single pin of the microcontroller. This way I do not need to use Xmx, Ymx and Zmx can be used for Z-axis limit switches. Zmn is used as PROBE pin.

Here is how I made my setup:

  1. I wired all connections according to diagrams attached below to this post.
  2. I adapted settings in the settings/settings_default.h (alternatively you may wish to create your own settings-OWN.h file by copying existing file) related to limit switches pins and probe pin configuration:

// Xmin on v9 board
#define DI1_MODE INPUT_ACTIVE_LOW //NC switch wired with pull-down resistor
#define DI1_ACTION INPUT_ACTION_STOP // STOP
#define DI1_FUNCTION INPUT_FUNCTION_LIMIT // LIMIT

// Xmax
#define DI2_MODE INPUT_MODE_DISABLED
#define DI2_ACTION INPUT_ACTION_NONE
#define DI2_FUNCTION INPUT_FUNCTION_NONE

// Ymin
#define DI3_MODE INPUT_ACTIVE_LOW //NC switch wired with pull-down resistor
#define DI3_ACTION INPUT_ACTION_STOP
#define DI3_FUNCTION INPUT_FUNCTION_LIMIT

// Ymax
#define DI4_MODE INPUT_MODE_DISABLED
#define DI4_ACTION INPUT_ACTION_NONE
#define DI4_FUNCTION INPUT_FUNCTION_NONE

// Zmin
#define DI5_MODE INPUT_ACTIVE_LOW //Z probe (NO) wired with pull-up resistors
#define DI5_ACTION INPUT_ACTION_NONE
#define DI5_FUNCTION INPUT_FUNCTION_NONE

// Zmax
#define DI6_MODE INPUT_ACTIVE_LOW //NC switch wired with pull-down resistor
#define DI6_ACTION INPUT_ACTION_STOP
#define DI6_FUNCTION INPUT_FUNCTION_LIMIT

With this setup the limit action triggers every time a limit switch gets hit and the machine gets SHUTDOWN state. Homing works fine, too. The PCB probing works as expected,
I did not get any false positive since I have set it all up. My limit switches are all enabled in the configuration ($lim=1).

Why I prefer using NC switches? If the wire gets accidently disconnected/broken the machine will report ‘limit action’ and remain in SHUTDOWN state until the wiring is repaired or the user clears the alarm with $clear. But even so, a user will be aware of the problem.

@sszafran @Alden_Hart does rock! I am glad you were able to figure it out! Thanks for pressing forward man! Also NC switches help with noise as well. I use NC switches on all my setups!

Sebastian - You have obviously looked deep into the code - how are the port pins configured - with or without the on-chip weak pull-up resistor? As I read the spec, Rpullup is somewhere between 20K and 50K ohms effectively (it could be a current source).
If Rpullup IS enabled, then the port input voltage for your NC configuration will set the Switch-operated (OPEN) port voltage at the result of a voltage divider between Rpullup and 11K to ground.
You could mitigate this by reducing 10K substantially and increasing the capacitor substantially to maintain the rolloff of the filter.
You could also change the Port configuration, but that might become a configuration administrative complexity.