-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On ESP32 can also use GPIO36 and GPIO39 to recieve, but need to edit "SoftwareSerial.cpp" #182
Comments
@Rob58329 I'm sorry this isn't quite what you requested, but thanks for giving me an opportunity to look into this anew. If you check out the documentation (link is in commit message), I hope you will agree that for general purpose use and least surprise, let alone needing to find out what happens when using the |
@dok-net - Thank you for considering my suggestion! (1) I note that you have changed the line to "<39". As my "NodeMCU-32S" ESP32 board has a pin GPIO39, I suggest that this "<39" should be "<=39"?? (2) For you info, one of my ESP32 projects successfully uses 6 serial ports as follows:
As you commented, you have now added the lines "#elif defined(ESP32)" and "&& (pin < 34)" into your espsoftwareserial code which stops the use of GPIO 34 to 39. This surprises me as (1) The standard HardwareSerial ports all allow use of pins 34 to 39, (2) your espsoftwareserial code works FINE using ESP32 pins 34 to 39 as long as I comment out your above added 2 lines. (As discussed, these ESP32 pins 34 to 39 only work as Receive Pins, and don't have internal pullups so may need external pullups depending on what you connect them to. However this is well documented, and is exactly the same if using Hardware Serial or Software Serial, so I don't feel this is a reason to disable their use in espsoftwareserial.) (PS. it appears from my tests that setting the INPUT_PULL flag on these pins simply does not do anything.) Therefore you may wish to consider removing your above GPIO 34 to 39 restriction? PS. I find your "plerup/espsoftwareserial" very useful & reliable - thank you!! |
re. plerup/espsoftwareserial
On ESP32 one can also use GPIO36 and GPIO39 to recieve, but need to edit "SoftwareSerial.cpp":
Specifically, if one changes the code "(pin >= 32 && pin <= 35);" to "(pin >= 32 && pin <= 39);" in the above file, then GPIO36 and GPIO39 will work fine as Rx pins (with external pullups if necessary).
Suggest you consider updating "SoftwareSerial.cpp" to reflect this?
(PS. Neat software!)
Regards, Rob (15Nov20)
The text was updated successfully, but these errors were encountered: