-
Notifications
You must be signed in to change notification settings - Fork 10
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
Get stuck in mcp.analogRead loop #4
Comments
Hey Felix, I've run into this exact issue (also with the ESP32S3). I'm currently working on a PR to make this library fully compatible ( GH-5), but for the time being here's the fix in order to get analogRead to work.
Must get updated to
There's an issue on the ESP32S3 specifically where the bit assignment in the union doesn't work properly unless explicitly stated. You can also optionally add
in analogRead; however, I'm not sure if this is necessary or not. Best, |
could you please specify what you mean by: |
This is the problem on my end. It is dude to the wrong PCB layout of my project. |
Mirageofmage By the way, I should have mentioned this in my post that I'm using MCP3562R: dual channel variant. I'm trying to read ADC readings from Device 1. So I'm assuming I should change |
I manage to make it work now. What I did was twick the configuration a bit Apart from the topic, shouldn't the code here
be like this? _spi->begin(_pinCLK,_pinMISO,_pinMOSI,_pinCS); otherwise the pin configurations will be overwrite by default SPI configurations. |
There is no Please check the examples, there I use a setup with a custom SPI, this should also help with your pin swap without modifiying my lib.
As you can see the custom SPI As far as I understand your schematic your try to do some differential reading as well as a single ended reading. There should be nothing wrong with this, but my personal approach would be to handle both the same way... anyway, you should not need to change the definition of |
Well , it seem that Arduino core didn't provide it but in ESP32 core it does. Check out the following link for SPI library in esp32 core
Ah, you did provide the settings I want. This is great it feels weird to modifiy your library. |
Hi,
Thank you for making this ADC library. It's one of the few library that support MCP3562.
But when I'm implement this code to my ESP32 S3 it seems to stuck in analogread infinite loop.
The differences are I make the MCP3562 instance aka
mcp
a global instance by addingextern MCP3562 mcp;
in MCP3x6x.h andMCP3562 mcp=MCP3562();
in MCP3x6x.cpp .Also dude to the layout error I swap the pin definition of MISO & MOSI in the class Constructor .
And this is my main task
And the Serial out put:
_pinMISO: 11
_pinMOSI: 13
_pinCLK: 12
_pinCS: 10
1
mux
Any advice is greatly appreciated.
The text was updated successfully, but these errors were encountered: