Skip to content

Commit b744350

Browse files
Merge pull request #107 from OpenAstroTech/esp32-nema-pins
added pins for nema motor setup on esp32
2 parents 422c8c9 + c370a40 commit b744350

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

Software/Arduino code/OpenAstroTracker/Configuration_adv.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,3 @@
282282
#if RA_RMSCURRENT > 2000 || DEC_RMSCURRENT > 2000
283283
#error "Do you really want to set the RMS motorcurrent above 2 Ampere? Thats almost 3A peak! Delete this error if you know what youre doing"
284284
#endif
285-
#if RA_STEPPER_TYPE != STEPPER_TYPE_28BYJ48 && ESP32
286-
#error "Sorry, ESP32 only supports 28BYJ48 steppers at this moment"
287-
#endif

Software/Arduino code/OpenAstroTracker/Configuration_pins.hpp

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@
6363
// ESP32
6464
////////////////////////////////////////////////////////////////////
6565
#ifdef ESP32
66-
#if (RA_STEPPER_TYPE != STEPPER_TYPE_28BYJ48) || (DEC_STEPPER_TYPE != STEPPER_TYPE_28BYJ48)
67-
#error Only 28BJY-48 stepper motors are supported on the ESP (for now)
68-
#endif
6966

7067
// RA Motor pins
7168
#define RA_IN1_PIN 19
@@ -79,6 +76,31 @@
7976
#define DEC_IN3_PIN 5
8077
#define DEC_IN4_PIN 18
8178

79+
// If using NEMA steppers
80+
#define RA_STEP_PIN 19 // STEP
81+
#define RA_DIR_PIN 21 // DIR
82+
#define RA_EN_PIN 22 // Enable
83+
#define RA_DIAG_PIN 23 // only needed for autohome function
84+
#define RA_MS0_PIN 4
85+
#define RA_MS1_PIN 0
86+
#define RA_MS2_PIN 2
87+
88+
//RA TMC2209 UART specific pins
89+
#define RA_SERIAL_PORT Serial2 // HardwareSerial port, wire to TX2 for write-only
90+
#define RA_DRIVER_ADDRESS 0b00 // Set by MS1/MS2. LOW/LOW in this case
91+
92+
#define DEC_STEP_PIN 16 // STEP
93+
#define DEC_DIR_PIN 17 // DIR
94+
#define DEC_EN_PIN 5 // Enable
95+
#define DEC_DIAG_PIN 18 // only needed for autohome function
96+
#define DEC_MS0_PIN 15
97+
#define DEC_MS1_PIN 8
98+
#define DEC_MS2_PIN 7
99+
100+
//DEC TMC2209 UART specific pins
101+
#define DEC_SERIAL_PORT Serial2 // HardwareSerial port, wire to TX2 for write-only
102+
#define DEC_DRIVER_ADDRESS 0b01 // Set by MS1/MS2 (MS1 HIGH, MS2 LOW)
103+
82104
#if AZIMUTH_ALTITUDE_MOTORS == 1
83105
#define AZ_IN1_PIN 38
84106
#define AZ_IN2_PIN 40

0 commit comments

Comments
 (0)