<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Marlin: Pin assignment for ESP32</title>
        <description> Hello All,
I am getting familiar with Marlin. Recently I have rotate motor with G-code with Arduino Mega 2560.
I am exploring option to use ESP32. In pins_ESP32.h file below pin assignment is present. But I couldn&#039;t understand pin like 128,129 etc. ESP32 doesn&#039;t have such pin numbers.
Please anybody can explain these pin assignment? 
Thanks in advance.

 // Steppers
//
#define X_STEP_PIN                           128
#define X_DIR_PIN                            129
#define X_ENABLE_PIN                         130
//#define X_CS_PIN                             0

#define Y_STEP_PIN                           131
#define Y_DIR_PIN                            132
#define Y_ENABLE_PIN                         133
//#define Y_CS_PIN                            13

#define Z_STEP_PIN                           134
#define Z_DIR_PIN                            135
#define Z_ENABLE_PIN                         136
//#define Z_CS_PIN                             5  // SS_PIN</description>
        <link>https://reprap.org/forum/read.php?415,896350,896350#msg-896350</link>
        <lastBuildDate>Fri, 10 Jul 2026 16:05:17 -0400</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://reprap.org/forum/read.php?415,896350,896354#msg-896354</guid>
            <title>Re: Marlin: Pin assignment for ESP32</title>
            <link>https://reprap.org/forum/read.php?415,896350,896354#msg-896354</link>
            <description><![CDATA[ You need to make a few small code changes to have a second uart on esp32<br />
In standard diff format.<br />
<br />
Make these changes<br />
<br />
<br />
<pre class="bbcode">
diff --git a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp
index 145662215a..29804d34e9 100644
--- a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp
+++ b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp
@@ -25,5 +25,6 @@
 #include "FlushableHardwareSerial.h"

 Serial1Class flushableSerial(false, 0);
+Serial1Class flushableSerial2(false, 0);

 #endif</pre>
<br />
<pre class="bbcode">
diff --git a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h
index 012dda8626..8fbcca9f1a 100644
--- a/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h
+++ b/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h
@@ -32,3 +32,5 @@ public:
 };

 extern Serial1Class flushableSerial;
+extern Serial1Class flushableSerial2;</pre>
<br />
<pre class="bbcode">
diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h
index 0acb3676a2..a835dcf88d 100644
--- a/Marlin/src/HAL/ESP32/HAL.h
+++ b/Marlin/src/HAL/ESP32/HAL.h
@@ -51,6 +51,8 @@
 // ------------------------

 #define MYSERIAL1 flushableSerial
+#define MYSERIAL2 flushableSerial2

 #if ENABLED(ESP3D_WIFISUPPORT)
   typedef ForwardSerial1Class&lt; decltype(Serial2Socket) &gt; DefaultSerial1;
</pre>]]></description>
            <dc:creator>Dust</dc:creator>
            <category>Firmware - Marlin</category>
            <pubDate>Wed, 01 Jan 2025 04:52:30 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?415,896350,896353#msg-896353</guid>
            <title>Re: Marlin: Pin assignment for ESP32</title>
            <link>https://reprap.org/forum/read.php?415,896350,896353#msg-896353</link>
            <description><![CDATA[ Thanks for reply.<br />
I am trying to rotate motor  for 2 axis only (X,Y) at fist stage.<br />
I have considered pins from pins_ESPA_common.h. (FYSETC E4 board ) I can complied code now. But I couldn't connect it "Pronterface" with serial 0.<br />
I tried #define SERIAL_PORT_2 1, but it gives error 'MYSERIAL2' was not declared in this scope "<br />
Is it any way we can configure port 2?]]></description>
            <dc:creator>godageprasad</dc:creator>
            <category>Firmware - Marlin</category>
            <pubDate>Wed, 01 Jan 2025 02:56:17 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?415,896350,896352#msg-896352</guid>
            <title>Re: Marlin: Pin assignment for ESP32</title>
            <link>https://reprap.org/forum/read.php?415,896350,896352#msg-896352</link>
            <description><![CDATA[ esp32 does not have sufficient IO pins for most 3d printers, so an IO expander chip is used<br />
<br />
There are two different types of io expanders currently implemented<br />
<br />
One is via serial, pins &gt;= 100 on this type of IO expander are on the expander.<br />
The other is via i2s when pinis with bit 8 is set ie &gt;= 128 are on the expander.<br />
<br />
See Marlin/src/HAL/ESP32/fastio.h for more details.]]></description>
            <dc:creator>Dust</dc:creator>
            <category>Firmware - Marlin</category>
            <pubDate>Tue, 31 Dec 2024 17:37:57 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?415,896350,896350#msg-896350</guid>
            <title>Marlin: Pin assignment for ESP32</title>
            <link>https://reprap.org/forum/read.php?415,896350,896350#msg-896350</link>
            <description><![CDATA[ Hello All,<br />
I am getting familiar with Marlin. Recently I have rotate motor with G-code with Arduino Mega 2560.<br />
I am exploring option to use ESP32. In pins_ESP32.h file below pin assignment is present. But I couldn't understand pin like 128,129 etc. ESP32 doesn't have such pin numbers.<br />
Please anybody can explain these pin assignment? <br />
Thanks in advance.<br />
<br />
 // Steppers<br />
//<br />
#define X_STEP_PIN                           128<br />
#define X_DIR_PIN                            129<br />
#define X_ENABLE_PIN                         130<br />
//#define X_CS_PIN                             0<br />
<br />
#define Y_STEP_PIN                           131<br />
#define Y_DIR_PIN                            132<br />
#define Y_ENABLE_PIN                         133<br />
//#define Y_CS_PIN                            13<br />
<br />
#define Z_STEP_PIN                           134<br />
#define Z_DIR_PIN                            135<br />
#define Z_ENABLE_PIN                         136<br />
//#define Z_CS_PIN                             5  // SS_PIN]]></description>
            <dc:creator>godageprasad</dc:creator>
            <category>Firmware - Marlin</category>
            <pubDate>Tue, 31 Dec 2024 11:33:45 -0500</pubDate>
        </item>
    </channel>
</rss>
