AS5048A - How to wire and read data

Hello,

I bought a Brushless Motor with a AS5048A encoder built-in.

Only 3 wires are available. Datasheet on page 13 say -3 Wire Mode (read only) -.

I read this thread but i still don’t understand. I don’t understand where cables must be plug on arduino. I have an arduino pro mini.

I test first code with no result. I use SS, MISO adn SCK.

I use code below:

#include “SPI.h”
unsigned int result = 0;
unsigned int result1 = 0;
unsigned int result2 = 0;

void setup ()
{
Serial.begin(9600);
SPI.begin();
SPI.setBitOrder(MSBFIRST);
}

void loop () {

digitalWrite(SS, LOW);

//Reading 8 bit frame (the first half of 16-bit SPI transfer)
result1 = SPI.transfer(0b00000000);
Serial.print("byte 1: ");
Serial.println(result1, BIN);

// removing (masking) first 2 bit
result1 &= 0b00111111;
Serial.print("byte 1 masked: ");
Serial.println(result1, BIN);

//shifting 8 bit to left. to create emty space for last 8 bit transfer
result1 = result1 << 8;
Serial.print("byte 1 shifted: ");
Serial.println(result, BIN);

// getting last 8 bits (the last half of 16-bit SPI transfer)
result2 = SPI.transfer(0b00000000);
Serial.print("byte 2: ");
Serial.println(result2, BIN);

// merging
result = result1 | result2;
Serial.print("Result: “);
Serial.print(result, BIN);
Serial.print(” = ");
Serial.println(result, DEC);
Serial.println();

digitalWrite(SS, HIGH);
delay(1000);

}

And result below:

byte 1: 11111111
byte 1 masked: 111111
byte 1 shifted: 11111100000000
byte 2: 0
Result: 11111100000000 = 16128

byte 1: 0
byte 1 masked: 0
byte 1 shifted: 11111100000000
byte 2: 0
Result: 0 = 0

I also read picture below but…

My aim is get angle in degrees to store this data.

Thank you!