Skip to content
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

Init of ADS breaks loop on ESP32 #8

Open
mglavind opened this issue May 17, 2022 · 2 comments
Open

Init of ADS breaks loop on ESP32 #8

mglavind opened this issue May 17, 2022 · 2 comments

Comments

@mglavind
Copy link

When i bult and upload the script to the ESP32, it feedback "success", but the script stops after I create the adc object with the following code.

#include "ADS1256.h"
#include <SPI.h>

float clockMHZ = 8.0;
float vRef = 2.5;

ADS1256 adc(clockMHZ,vRef,false); // breaks here

// setup and loop after here

Do you have any good ideas, on how to fix this?

Setup

ESP-32 Devkit-c v4
PlatformIO

@mglavind
Copy link
Author

the problem is the SPI.begin and SPI.beginTransaction() in line 31-33.
Comment it out in ADS1256.cpp, and call it when you initiate SPI in void setup()

// Start SPI on a quarter of ADC clock speed
SPI.begin();
SPI.beginTransaction(
    SPISettings(clockspdMhz * 1000000 / 4, MSBFIRST, SPI_MODE1));
´´´

A good idea could do to remove this from the library, and add it to an example isntead.

@MoonLighTingPY
Copy link

@mglavind thank you!!! i spent a whole day AND night on this, it's currently 4:30 in the morning, and i thought nothing would help. this issue really has to be fixed asap!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants