Communicated with ADC122S101 chip using SPI

Ori1

Member
Trying using ADC122S101 chip with ADC08XS.h library, Issue is that no address sending from Teensy4.1, MOSI, to the chip.
There is 2 channel on it and all time getting the data just from first channel.
With sketch that I use just spi.h library with Teensy4.1 it seems that data sending out.
Arduino library for ADC08XS ADC (SPI).
What should be changed to get it to work with the library.

#include <SPI.h>

const int SS_PIN = 10; // Replace with your SS pin
const int SPI_MOSI = 11;
const int SPI_MISO = 12;
const int SPI_SCK = 13;
const int RST_PIN = 22;

void setup() {

pinMode(SS_PIN, OUTPUT);
digitalWrite(SS_PIN, HIGH);

SPI.begin();
pinMode(RST_PIN, OUTPUT); //OUTPUT_OPENDRAIN
digitalWrite(RST_PIN, LOW);
}

void loop() {
digitalWrite(RST_PIN, HIGH);
delay(2);
digitalWrite(RST_PIN, LOW);
delay(2);
digitalWrite(RST_PIN, HIGH);
SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE3));
digitalWrite(SS_PIN, LOW); // Select device
SPI.transfer(0x08); // Send address

uint16_t data = SPI.transfer(0x08) << 8; // Read data
digitalWrite(SS_PIN, HIGH); // Deselect device
// Do something with the received data
Serial.println(data, DEC); // Print data in hexadecimal format
digitalWrite(RST_PIN, LOW);
delay(100); // Optional delay for testing
}
 

Attachments

  • ADC122_SPI.png
    ADC122_SPI.png
    14.4 KB · Views: 16
You may want to open an issue at https://github.com/RobTillaart/ADC08XS/issues.
Rob Tillaart is very responsive and actually this current issue might be relevant to you.

Paul
I opened an issue already and he try to help me , but it still not working.
Library that work with arduino uno not working with Teensy4.1, what could be the gap between them?

What I show above that other sketch working, with spi communication between teensy and the chip then It's not seems that is hardware issue
 
Last edited:
Back
Top