I SEE this link https://e2e.ti.com/support/motor-drivers/f/38/t/656555?tisearch=e2e-sitesearch
so :
Do you have an external pullup on SDATAO?
NOT I don´t have…..
Have you checked to the VCP, VREG, and VINT voltages?
VCP = 22.27 [V]
VREG= 5.01 [V]
VINT= 1.80 [V]
VM = 12.40 [V]
Please focus on reading register 0x2A first. The defaults of all other registers is 0x0000.
The most common causes for SPI trouble are:
1) setup/hold on SDATAI vs SCLK?
digitalWrite(SCS, HIGH); //SPI.transfer16(0b0000000000000001); SPI.transfer(TESTEendereco); CTRL_DRV8308 = SPI.transfer16(0x00); digitalWrite(SCS, LOW);
2) lack of pullup of SDATAO
3) SCLK to fast with respect to the SDATAO pullup
SPISettings settings(1000000, MSBFIRST, SPI_MODE0);
4) SCS incorrectly framing of the transaction. Refer to section 7.5.2 for correct framing
digitalWrite(SCS, HIGH); //SPI.transfer16(0b0000000000000001); SPI.transfer(TESTEendereco);//send comand 8bit CTRL_DRV8308 = SPI.transfer16(0x00);//receib from in 16 bit digitalWrite(SCS, LOW);
If you do not read 0x0018 in register 0x2A, please provide a scope capture of the transaction.
nating
I use a microcontroler like arduino uno
#include <Arduino.h> #include <SPI.h> SPISettings settings(1000000, MSBFIRST, SPI_MODE0); //1000000 é um MegaHertz //******* Pinos do SPI 1************************************************** #define SCS PC7 //PA4 //1 // SLAVE PIN #define MOSI PA7 // MOSI, for "Master Out / Slave In". #define MISO PA6 // MISO, for "Master In / Slave Out". #define SCLK PA5 //clock #define adress 0x2A void setup() { Serial.begin(115200); delay(100); SPI.begin(); SPI.beginTransaction(settings); pinMode(SCS, OUTPUT); } void Tryread() { SPISettings settings(1000000, MSBFIRST, SPI_MODE0); SPI.beginTransaction(settings); Serial.print("Adress send = "); Serial.print(adress,HEX); Serial.print(" -> binary = "); Serial.print(adress,BIN); digitalWrite(SCS, HIGH); SPI.transfer(adress);//send comando de 8bit CTRL_DRV8308 = SPI.transfer16(0); digitalWrite(SCS, LOW); Serial.print("\nCTRL_DRV8308= "); Serial.println(CTRL_DRV8308 ,BIN); Serial.println("****************************************************\n\n"); delay(1); } void loop () { if (Serial.available()) { char aux=Serial.read(); if (aux=='p' || aux == 'P') { Tryread(); } } }