siteswapjuggler / ADS8688a

ADS8688a Library
GNU General Public License v3.0
18 stars 4 forks source link

Is this compatible with Arduino Due? #4

Open buildream opened 6 months ago

buildream commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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...