What is the probem ß

Hello everyone,
I am currently working on my master's thesis and there is a task involving Arduino.

I have a Hall sensor (SS39ET/SS49E/SS59ET Series Linear Hall-effect Sensor ICs) , which is connected to a Converter (TLA2518 Small, 8-Channel, 12-Bit ADC with SPI Interface and GPIOs) through SPI and then to Arduino(UNO).

I have connected them as follows:

MISO to pin 12
MOSI to pin 11
SCK to pin 13
Vcc with Vcc
GND with GND

I have CS on GNS, which is always low.

I have written the code, but I keep getting -1 as the values and I am unable to figure out where the error is.

#include <SPI.h>

// Definieren der SPI-Pins
#define MOSI_PIN 11
#define MISO_PIN 12
#define SCK_PIN 13

// Initialisieren des SPI-Objekts
SPISettings settings(1000000, MSBFIRST, SPI_MODE0);

void setup() {
  // Initialisieren der seriellen Schnittstelle
  Serial.begin(9600);
  
  // Initialisieren der SPI-Kommunikation
  SPI.begin();
  SPI.beginTransaction(settings);
  
  // Konfigurieren des TLA2518-IC
  byte configByte = 0b00000000; // Konfigurationsbyte
  byte resultByte = 0;
  
  SPI.transfer(configByte);
  resultByte = SPI.transfer(0); // Lesen des Ergebnisbytes
  
  Serial.println(resultByte);
}

void loop() {
  // Lesen des Hall-Sensor-Werts
  int sensorValue = 0;
  
  SPI.transfer(0); // Dummy-Byte senden
  sensorValue = SPI.transfer16(0); // Lesen des Sensorwerts
  
  // Ausgabe des empfangenen Sensorwerts
  Serial.print("Sensorwert: ");
  Serial.println(sensorValue);
  
  delay(2000);
}

What hall sensor?
What ADC?
Schematic?

I'm missing SS (required!)

You left out:
Which Arduino?

1 Like

Wehre is the CS, Chip Select, pin?

I have a Hall sensor (SS39ET/SS49E/SS59ET Series
Linear Hall-effect Sensor ICs) , which is connected to an Converter (TLA2518 Small, 8-Channel, 12-Bit ADC with SPI Interface and GPIOs) through SPI and then to Arduino(UNO).

I have CS on GNS, which is always low.

I have CS on GNS, which is always low.!

How's that working out for you? Anyways, you know best. Good luck.

SS is required to select the slave. Not selected slaves don't respond. See the SPI examples in the IDE. You can choose any output pin as the SS for your device, one for each slave.

what do u mean ?

Of Course it's not necessary. That is if you don't mind that it doesn't respond :rofl:

DaveX is right : "The device starts converting the active input channel on the rising edge of CS". (TLA2518 datasheet page 3) => SS mandatory here

1 Like

Why in advance? Find the answer already in #10.

The TLA2518 itself needs CS to go high to start a conversion. No conversion = no data.
In many other situations it wouldn't be necessary but not here : CS required

2 Likes

Read section 19.3 (SS Pin Functionality) in the ATmega328P data sheet.

Why don't you simply try ?

1 Like

image https://www.ti.com/lit/ds/symlink/tla2518.pdf?ts=1681214616811

I have CS on GNS, which is always low..