Menu

ESP32-S2

Higany
2023-02-13
2023-07-17
  • Higany

    Higany - 2023-02-13

    Hello,

    Few years ago I built the project on a custom PCB with a Lolin D1 mini ESP8266 board & DRV8825 controlboard.
    The ESP8266 support was removed from the project, but Lolin came out a Lolin D1 Mini pin-compatible ESP32-S2 breakout board, called the Lolin S2-Mini.
    S2 Mini

    I didn't want to throw out my PCBs and enclosure, so I decided to upgrade my controller with the S2-Mini.

    There were a few pitfalls, but at the end it works.
    Here are my findings, maybe it will help others:

    1. Controller not starting:
    The ESP32-S has a native USB port, and the controller didn't start until I opened the serial monitor in Arduino IDE. This while cycle had to be commented out in myfp2esp32F.ino to make it work with the S2:

    //  while ( !Serial )
    //  {
    //    ;                                         // wait for serial port to start
    //  }
    

    2. Motor not moving & Board options
    Maybe my DRV8825 board had some hiccups, but I couldn't get the motor moving with the CUSTOMBRD & 99.json tweaking. It worked after I defined the DRVBRD PRO2ESP32DRV8825 instead and modified, 44.jsn according to my pins.

    { "board":"PRO2ESP32DRV8825","maxstepmode":32,"stepmode":1,"enpin":7,"steppin":9,"dirpin":11,"temppin":18,"hpswpin":-1,"inledpin":-1,"outledpin":-1,"pb1pin":-1,"pb2pin":-1,"irpin":-1,"brdnum":44,"stepsrev":-1,"fixedsmode":1,"brdpins":[-1,-1,-1,-1],"msdelay":4000 }
    

    3. I2C pins:
    Needed to modify in Controller_defines.h according to the D1 Mini -> S2 Mini pinout:

    // I2C
    #define I2CDATAPIN        33
    #define I2CCLKPIN         35
    

    4. ESP32 Sketch data downloader:

    The manual refers to an old version of the ESP32 sketch data downloader, which doesn't support the S2. This is the recent one, which supports the S2 chip: Arduino ESP32 filesystem uploader (SPIFFS has to be selected)

    Other:
    The S2-Mini has a double row of pins for extra GPIOs, so software selection of stepside would be also possible with 3 Dupont-wires on the existing PCB, but I am happy with the jumper selection, because it has to be only set once anyway.

    My PCB is a minimal D1 mini & DRV8825 board with temp sensor and LCD options.
    Pins:

    Function |D1 Mini |ESP8266 GPIO |ESP32-S GPIO  
            EN    | D5     |      14     |       7       
            STEP  | D6     |      12     |       9      
            DIR   | D7     |      13     |       11      
            SCL   | D1     |      5      |       35     
            SDA   | D2     |      4      |       33      
            TEMP  | D3     |      0      |       18
    
     
  • brownrb

    brownrb - 2023-07-17

    Confirming that support for the Board is now in the next release.

    // ESP32 Boards

    #define DRVBRD  PRO2ESP32DRV8825
    //#define DRVBRD    PRO2ESP32ULN2003
    //#define DRVBRD    PRO2ESP32L298N
    //#define DRVBRD    PRO2ESP32L293DMINI
    //#define DRVBRD    PRO2ESP32L9110S
    //#define DRVBRD    PRO2ESP32R3WEMOS      // fixed step mode
    //#define DRVBRD    PRO2ESP32TMC2225
    //#define DRVBRD    PRO2ESP32TMC2209
    //#define DRVBRD  PRO2ESP32TMC2209P     // for Paul using TMC2209 - 58.jsn
    //#define DRVBRD    PRO2ESP32ST6128       // for CLOSED LOOP ST6128 driver. fixed step mode
    //#define DRVBRD  PRO2ESP32LOLINS2MINI  // for Higany, target is LOLIN S2 Mini - 60.jsn
    //#define DRVBRD    CUSTOMBRD
    
     

    Last edit: brownrb 2023-07-17

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.