Closed maxnemoy closed 4 years ago
I can't help with this particular library, but you can decode the error message with the backtrace decoder. Also, if the 6 in that line is a pin reference, that is a reserved pin. See the pinmap
Also, if the 6 in that line is a pin reference, that is a reserved pin.
From a very quick scan of the referenced library it is a pin on the MCP23017 and not the ESP32
HOWEVER these lines will cause issues since it is randomly resetting pin modes when the constructor runs.
@lbernstone Thank. I will try this.
@atanisoft MCP23017 works great on its own, any pins. It seems to me that the problem is exactly here
but it is not clear to me why this works well for arduino, but does not work for esp.
I'm new to this, maybe my question is stupid. Thanks for the help, I will try to fix this.
but it is not clear to me why this works well for arduino, but does not work for esp.
Because arduino (avr) does not restrict usage of certain exposed pins. The ESP32 has a handful of restricted pins that are connected to the on-board flash which can not be used by the user.
but it is not clear to me why this works well for arduino, but does not work for esp.
Because arduino (avr) does not restrict usage of certain exposed pins. The ESP32 has a handful of restricted pins that are connected to the on-board flash which can not be used by the user.
But I don’t use pin esp, 6pin for 23017. if we take esp32 and 23017, the Adafruit_MCP23017 library everything works fine, including reading and writing to A6 23017.
But for this particular case, using the Rotary library, everything breaks and I get an error.
my english is not that good. maybe I'm not explaining well.
still many thanks. you can close this. i hope i will solve it
But I don’t use pin esp, 6pin for 23017.
You aren't using it directly but the Rotary library IS as I linked above to the constructor. It blindly resets the pin mode and pull-up values for whatever pins you are sending into the RotaryEncOverMCP declaration. I'm honestly not entirely sure how this library doesn't break applications on the AVR side as well since it will randomly reset pin modes!
@lbernstone I am very sorry, I understood what you were talking about. I managed to fix it.
Thanks again so much for the tip.
I am using the library https://github.com/maxgerhardt/rotary-encoder-over-mcp23017
Hardware:
Board: ESP32 Dev Module Core Installation version: 1.12.4 IDE name: Platform.io Upload Speed: 115200 Computer OS: Windows 10.2004
Description:
I get endless reboot. The error occurs when initializing pin A6, at 23017
for example
for other pins it works well.
This problem is relevant only for esp32. (the same circuit is tested for ATMEGA)
I understand that maybe my question is at the wrong address. But the author abandoned the library. I hope for any advice that can help solve the problem. I tried a lot, but I don't have a debugger for esp32, so I can't look into the chip to find the problem.
If you cannot help, just close this. thank.
Sketch
you can use the example of this library for testing https://github.com/maxgerhardt/rotary-encoder-over-mcp23017/blob/master/examples/Polling/PollingExample.cpp
Debug Messages: