Make the use of the internal pullup resistors optional.
All other firmwares set them to zero -> no internal pullup resistor, as they counter-work to the design of the electronic endstops. However, in conjunction with mechanical endstops, they're very practical.
This commit is contained in:
parent
815ff7ba19
commit
b7afdda3f7
|
|
@ -158,6 +158,12 @@ undefine if you don't want to use them
|
||||||
|
|
||||||
#include "arduino.h"
|
#include "arduino.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
internal pullup resistors
|
||||||
|
the ATmega has internal pullup resistors on it's input pins which are counterproductive with the commonly used eletronic endstops, so they should be switched off. For other endstops, like mechanical ones, you may want to uncomment this.
|
||||||
|
*/
|
||||||
|
//#define USE_INTERNAL_PULLUPS
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this is the official gen3 reprap motherboard pinout
|
this is the official gen3 reprap motherboard pinout
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,12 @@ undefine if you don't want to use them
|
||||||
|
|
||||||
#include "arduino.h"
|
#include "arduino.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
internal pullup resistors
|
||||||
|
the ATmega has internal pullup resistors on it's input pins which are counterproductive with the commonly used eletronic endstops, so they should be switched off. For other endstops, like mechanical ones, you may want to uncomment this.
|
||||||
|
*/
|
||||||
|
//#define USE_INTERNAL_PULLUPS
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this is the official GEN6 reprap motherboard pinout
|
this is the official GEN6 reprap motherboard pinout
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,12 @@ undefine if you don't want to use them
|
||||||
|
|
||||||
#include "arduino.h"
|
#include "arduino.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
internal pullup resistors
|
||||||
|
the ATmega has internal pullup resistors on it's input pins which are counterproductive with the commonly used eletronic endstops, so they should be switched off. For other endstops, like mechanical ones, you may want to uncomment this.
|
||||||
|
*/
|
||||||
|
//#define USE_INTERNAL_PULLUPS
|
||||||
|
|
||||||
/*
|
/*
|
||||||
user defined pins
|
user defined pins
|
||||||
adjust to suit your electronics,
|
adjust to suit your electronics,
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,12 @@ undefine if you don't want to use them
|
||||||
|
|
||||||
#include "arduino.h"
|
#include "arduino.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
internal pullup resistors
|
||||||
|
the ATmega has internal pullup resistors on it's input pins which are counterproductive with the commonly used eletronic endstops, so they should be switched off. For other endstops, like mechanical ones, you may want to uncomment this.
|
||||||
|
*/
|
||||||
|
//#define USE_INTERNAL_PULLUPS
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this is the ramps motherboard pinout
|
this is the ramps motherboard pinout
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
36
mendel.c
36
mendel.c
|
|
@ -39,10 +39,18 @@ void io_init(void) {
|
||||||
WRITE(X_STEP_PIN, 0); SET_OUTPUT(X_STEP_PIN);
|
WRITE(X_STEP_PIN, 0); SET_OUTPUT(X_STEP_PIN);
|
||||||
WRITE(X_DIR_PIN, 0); SET_OUTPUT(X_DIR_PIN);
|
WRITE(X_DIR_PIN, 0); SET_OUTPUT(X_DIR_PIN);
|
||||||
#ifdef X_MIN_PIN
|
#ifdef X_MIN_PIN
|
||||||
WRITE(X_MIN_PIN, 1); SET_INPUT(X_MIN_PIN);
|
#ifdef USE_INTERNAL_PULLUPS
|
||||||
|
WRITE(X_MIN_PIN, 1); SET_INPUT(X_MIN_PIN);
|
||||||
|
#else
|
||||||
|
WRITE(X_MIN_PIN, 0); SET_INPUT(X_MIN_PIN);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef X_MAX_PIN
|
#ifdef X_MAX_PIN
|
||||||
WRITE(X_MAX_PIN, 1); SET_INPUT(X_MAX_PIN);
|
#ifdef USE_INTERNAL_PULLUPS
|
||||||
|
WRITE(X_MAX_PIN, 1); SET_INPUT(X_MAX_PIN);
|
||||||
|
#else
|
||||||
|
WRITE(X_MAX_PIN, 0); SET_INPUT(X_MAX_PIN);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef X_ENABLE_PIN
|
#ifdef X_ENABLE_PIN
|
||||||
WRITE(X_ENABLE_PIN, 1); SET_OUTPUT(X_ENABLE_PIN);
|
WRITE(X_ENABLE_PIN, 1); SET_OUTPUT(X_ENABLE_PIN);
|
||||||
|
|
@ -51,10 +59,18 @@ void io_init(void) {
|
||||||
WRITE(Y_STEP_PIN, 0); SET_OUTPUT(Y_STEP_PIN);
|
WRITE(Y_STEP_PIN, 0); SET_OUTPUT(Y_STEP_PIN);
|
||||||
WRITE(Y_DIR_PIN, 0); SET_OUTPUT(Y_DIR_PIN);
|
WRITE(Y_DIR_PIN, 0); SET_OUTPUT(Y_DIR_PIN);
|
||||||
#ifdef Y_MIN_PIN
|
#ifdef Y_MIN_PIN
|
||||||
WRITE(Y_MIN_PIN, 1); SET_INPUT(Y_MIN_PIN);
|
#ifdef USE_INTERNAL_PULLUPS
|
||||||
|
WRITE(Y_MIN_PIN, 1); SET_INPUT(Y_MIN_PIN);
|
||||||
|
#else
|
||||||
|
WRITE(Y_MIN_PIN, 0); SET_INPUT(Y_MIN_PIN);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef Y_MAX_PIN
|
#ifdef Y_MAX_PIN
|
||||||
WRITE(Y_MAX_PIN, 1); SET_INPUT(Y_MAX_PIN);
|
#ifdef USE_INTERNAL_PULLUPS
|
||||||
|
WRITE(Y_MAX_PIN, 1); SET_INPUT(Y_MAX_PIN);
|
||||||
|
#else
|
||||||
|
WRITE(Y_MAX_PIN, 0); SET_INPUT(Y_MAX_PIN);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef Y_ENABLE_PIN
|
#ifdef Y_ENABLE_PIN
|
||||||
WRITE(Y_ENABLE_PIN, 1); SET_OUTPUT(Y_ENABLE_PIN);
|
WRITE(Y_ENABLE_PIN, 1); SET_OUTPUT(Y_ENABLE_PIN);
|
||||||
|
|
@ -63,10 +79,18 @@ void io_init(void) {
|
||||||
WRITE(Z_STEP_PIN, 0); SET_OUTPUT(Z_STEP_PIN);
|
WRITE(Z_STEP_PIN, 0); SET_OUTPUT(Z_STEP_PIN);
|
||||||
WRITE(Z_DIR_PIN, 0); SET_OUTPUT(Z_DIR_PIN);
|
WRITE(Z_DIR_PIN, 0); SET_OUTPUT(Z_DIR_PIN);
|
||||||
#ifdef Z_MIN_PIN
|
#ifdef Z_MIN_PIN
|
||||||
WRITE(Z_MIN_PIN, 1); SET_INPUT(Z_MIN_PIN);
|
#ifdef USE_INTERNAL_PULLUPS
|
||||||
|
WRITE(Z_MIN_PIN, 1); SET_INPUT(Z_MIN_PIN);
|
||||||
|
#else
|
||||||
|
WRITE(Z_MIN_PIN, 0); SET_INPUT(Z_MIN_PIN);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef Z_MAX_PIN
|
#ifdef Z_MAX_PIN
|
||||||
WRITE(Z_MAX_PIN, 1); SET_INPUT(Z_MAX_PIN);
|
#ifdef USE_INTERNAL_PULLUPS
|
||||||
|
WRITE(Z_MAX_PIN, 1); SET_INPUT(Z_MAX_PIN);
|
||||||
|
#else
|
||||||
|
WRITE(Z_MAX_PIN, 0); SET_INPUT(Z_MAX_PIN);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef Z_ENABLE_PIN
|
#ifdef Z_ENABLE_PIN
|
||||||
WRITE(Z_ENABLE_PIN, 1); SET_OUTPUT(Z_ENABLE_PIN);
|
WRITE(Z_ENABLE_PIN, 1); SET_OUTPUT(Z_ENABLE_PIN);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue