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

Is this compatible with Arduino Due? #4

Open
buildream opened this issue Apr 22, 2024 · 6 comments
Open

Is this compatible with Arduino Due? #4

buildream opened this issue Apr 22, 2024 · 6 comments

Comments

@buildream
Copy link

Hello,
I tried to use this library on Arduino Due.
But it fails to create an object and no initialization.
I wonder if this library is compatible with Arduino Due.
Thanks.

@siteswapjuggler
Copy link
Owner

I do not have an Arduino Due to test it yet but it seems to compile juste fine and as far as I know this board should not be a problem. What error message do you exactly get ? What system ? What IDE ? What code ?

@buildream
Copy link
Author

buildream commented Apr 22, 2024

I do not have an Arduino Due to test it yet but it seems to compile juste fine and as far as I know this board should not be a problem. What error message do you exactly get ? What system ? What IDE ? What code ?

Thank siteswapjuggler for your fast reply !!!

When I tested with Arduino Mega2560, it works well, but it showed a problem when I tested with Arduino Due.
I tested a library with Arduino IDE 1.8.19 and 2.3.2. (Windows 11, 64bit)
I used the code in an example folder as below.

When I commented all lines related to library, serial print worked,
But I didn't get any response with the original code. (No compile error and uploading, but no response)
I used PIN10 for CS.
When I just changed board to Aruino Mega, it worked ok. (I used SPI sockets)

Thanks again!!!

#include <ADS8688.h>
ADS8688 bank = ADS8688(); // Instantiate ADS8688 with PIN 10 as default CS
void setup() {
bank.setChannelSPD(0b00000001); // enable channel 0, power-down the others
bank.setChannelRange(0,R1); // set all channel range to +- 1.25*Vref
bank.autoRst(); // reset auto sequence
Serial.begin(115200); // start serial communication
}
void loop() {
Serial.print("CH0: "); // print label
uint16_t val = bank.noOp(); // trigger sampling
Serial.print(bank.I2V(val,R1),3); // print value in Volts,
Serial.println(" V"); // print Volt label
delay(100); // wait for 500 milliseconds
}

@siteswapjuggler
Copy link
Owner

Ok so basically should I consider this as solved ?

SPI pins are actually different from board to board, the library use SPI library which use default pin for each board the only exception is the CS pin which is arbitrary defaulted to 10 (which is the Uno default one). It may be a good idea to change it the the default macro CS pin.

Btw you could always define a user specific CS pin by instanciating with :

#define MY_CS_PIN 42
ADS8688 bank = ADS8688(MY_CS_PIN); 

@buildream
Copy link
Author

I changed the CS pin (4,10,52) but still didn't get any response from board. (No differences)
When I referred the arduino web document(https://docs.arduino.cc/tutorials/due/due-extended-spi/), it made me much confused.
I think I need more research on your library and due board.
Thanks again!!!

@siteswapjuggler
Copy link
Owner

Hmmm very strange as stated in your link " It is possible to use these extended methods, or the AVR-based ones." so it should make no difference. Are you sure of your electrical connection and schematci ? To my knowledge there is no standard breakboard for ADS8688a so is it a design of your own ?

@buildream
Copy link
Author

I used the ADS8688 module available in aliexpress.
Because there was no problem with arduino Mega, I doubt the arduino due board.
So far, what I found out is information on arduino due is outdated and not well organized even updated information. It still has a problem with USB3.0 ports...

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