ProtoCentral_ads1262
ProtoCentral_ads1262 copied to clipboard
Trying to connect to portenta H7 without any success
Hello 👋,
I am using an Arduino Portenta H7, and an analog light sensor. I tested the sensor with the on-board ADC of the arduino (analogRead) and I can read the values (so the sensor works).
This is the sensor I'm using: https://wiki.dfrobot.com/DFRobot_Ambient_Light_Sensor_SKU_DFR0026
This is the pinout for the Portenta: https://content.arduino.cc/assets/Pinout-PortentaH7_latest.png
The connections I'm using are as follows:
AVDD -> Arduino 5V
GND -> Arduino GND
PWDN -> D20
DRDY -> D21
MISO -> D10
MOSI -> D8
SCK -> D9
CS -> D7
START -> D4
DVDD -> Arduino 5V
AGND -> Arduino GND
AIN0 -> Analog output of the sensor
AIN1 -> Arduino GND
I also changed the pin constants in ads1262.h as follows:
const int ADS1262_DRDY_PIN = 21;
const int ADS1262_CS_PIN = 7;
const int ADS1262_START_PIN = 4;
const int ADS1262_PWDN_PIN = 20;
Finally, in ads1262.cpp I removed the deprecated SPI calls (setBitOrder, setDataMode, setClockDivider) and before every SPI.transfer()
call, I added SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE1));
and after each transfer I added SPI.endTransaction();
The only thing I'm getting is "ads1262 Initialised successfully...." and that's it. I wasn't able to get a single reading, no matter what arrangement I tried.
Please help!
Update:
I changed the DDRY and PWDN pins to D3 and D2 accordingly and now I started getting readings. There must be an issue with pins that can be used as analog, IDK.
BUT all the readings I get are always 0