This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BOOST-DRV8711: Registers read always gives 0xff

Part Number: BOOST-DRV8711
Other Parts Discussed in Thread: DRV8711, MSP430FR2355, DRV8711EVM

Am trying to configure DRV8711 using the launchpad MSP430FR2355 through SPI, the SPI is working fine, but when I try to read the registers of the DRV, I always get 0xFF, I made sure that the sleep pin is high and the reset pin is low, so could you help if there are any constraints or something wrong with my code?

And is there a way to know if the DRV8711 is running correctly or not?

Find the code overview as below:

--- INIT PART ---

** SPI pins init:

// SPI 3 pins
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P4,
GPIO_PIN5 + GPIO_PIN6 + GPIO_PIN7,
GPIO_PRIMARY_MODULE_FUNCTION );

// Chip select
GPIO_setAsOutputPin(GPIO_PORT_P3, GPIO_PIN0);

** SPI clock and configuration init:

// Set Ratio and Desired MCLK Frequency and initialize DCO
CS_initFLLSettle(20000, 600);
// Set MCLK= DCO with frequency divider of 1
CS_initClockSignal(CS_MCLK, CS_DCOCLKDIV_SELECT, CS_CLOCK_DIVIDER_1);

// Set SPI config

SpiConfig.clockPhase= 32768;
SpiConfig.clockPolarity= 0;
SpiConfig.msbFirst= 32768;
SpiConfig.spiMode= 0;
SpiConfig.selectClockSource= 128;
SpiConfig.clockSourceFrequency= CS_getSMCLK();
SpiConfig.desiredSpiClock= 1000000;
EUSCI_B_SPI_initMaster(EUSCI_B1_BASE, &SpiConfig);
EUSCI_B_SPI_enable(EUSCI_B1_BASE);

** DRV pins init:

GPIO_setAsOutputPin(GPIO_PORT_P3, GPIO_PIN4);
GPIO_setAsOutputPin(GPIO_PORT_P5, GPIO_PIN2);
GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_PIN4);
GPIO_setOutputHighOnPin(GPIO_PORT_P5, GPIO_PIN2);

--- SEND/RECEIVE PART ---

GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN0);

UCB1IFG &= ~UCRXIFG;
EUSCI_B_SPI_transmitData(EUSCI_B1_BASE, TxData]);
while ( !(UCB1IFG & UCRXIFG) );
RxData= EUSCI_B_SPI_receiveData(EUSCI_B1_BASE);

GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_PIN0);

  • Ahmed,

    Would you take SPI signals on a scope?
  • Here are the outputs from the scope:

    1- CLK: 1 MHz frequency

    2- MOSI (SDI):

    3- MISO (SDO): always high

  • Ahmed,

    What SPI command do you send to DRV8711? How can we make sure the command format is correct? Would you put them on the same scope picture?
  • I write zeros in the first register, that's why only the write bit is 1 and the rest is zeros in the MOSI.
    Unfortunately I don't have scope right now, but if it is only about the command, I can re-check it.
    Let me know if you have anymore advice.
  • Sorry,
    This scope shot for the SDI was during the reading; not the writing, however the SDO is always high.

    Are there any constraints regarding the jumpers?
  • Ahmed,

    The clock signal is less 5mV. The SPI command should not work with 5mV clock. The clock waveform is 1us/div. SDI signal is 20us/div. I don't know what command do you send to DRV8711. Would you order an EVM to do a comparison?
  • The clock is 1 MHz.

    SDI information is 16 bits with the most bit 1 and the rest is 0,
    The timing is ~ 1 bit / 3 us as per the graph, so fine with regarding to the clock.

    Am not sure why the clock has such low voltage!

    What am trying to do, is just to read the value of register 0, to make sure that the communication is working fine. That's why am sending the most bit with value 1 (to read), the register address filed with value 0 (to read register 0).

  • Ahmed,

    Do you test it with an EVM? If the clock signal is only 5mV, it is much lower than the logic-level input high voltage threshold.  So, the IC doesn't get any command.

    If you use an EVM, would you measure SCLK pin to ground resistance? 

    If the SCLK pin is not short to ground, would download DRV8711 GUI and firmware from TI.com? And then, run DRV8711 GUI to see if the SCLK signal is still 5mV.

  • I tried it again with the scope, and it gave good volt output.

  • Still the SDO is high all the time.
  • Ahmed,

    If possible, please order an EVM to compare the full SPI command signals, such as: SCS; SCLK; SDATI, nSLEEP and VM. It is a long process. But, we have to verify all SPI related input signals first. And then, we can say SDO response or not.

  • I was able to record screenshot from a scope to the 4 SPI lines together:

    1 --> CLK

    2 --> Chip select

    3 --> SDI (used to read from register 0 then register 1, so it has data 0x8000 then data 0x9000, the transmission is done 1 byte 1 byte)

    4 --> SDO (always high)

  • Ahmed,

    Are you sending a read command or a write command? If it is a write command, the SDO should not respond.
    Also, I would think DRIVE Register (Address = 0x06) is good example to read because the bit default values are not all "0" and all "1".
  • Am trying to read from registers 0 and 1 as I mentioned before, that's why the SDI data is 0x8000 and 0x9000,
    When I tried the DRIVE register, It gave 0xFF as well.
  • Hello Ahmed,

    let us try to solve your problem by following the steps below.


    First Step :

    we Need to make sure that you've set the SPI Configuration Right.

    SPI Should work with Freq 4MHZ in order to Communicate with The DRV8711.

    The first clock signal rising can be used to prepare the data. The clock idle state is zero. The data on MISO and MOSI lines must be stable while the clock is low and can be changed when the clock is high. The data is captured on the clock's high-to-low transition and propagated on low-to-high clock transition.   " Meaning CPOL = 0 , CPHA = 1"

    SCS Goes HIGH to Enable DRV8711 And Low At the End of Communication.

    Second Step:

    Making Sure That Your SPI is working Correctly 

    Enable Loop back mode at your SPI , Send Data And Make Sure You Receive The Same Data you Sent, if you didn't receive any thing you have a problem with your SPI.


    Third Step:

    Connecting your DRV8711 

    GND : All pins Must be Connected.

    Vm : Connect to motor supply voltage.

    SLEEPn : Logic high to enable device, logic low to enter low-power sleep mode ( Make it HIGH ).

    DIR/AIN2 : LOGIC HIGH

    RESET : LOGIC LOW

    STEP: LOGIC LOW
    SDO  with MISO

    SDI with MOSI

    CLK with CLK


    Fourth Step:


    Now Send Data From Your MCU to DRV8711 Then Read it to make sure communication is working " Please Make Sure to Disable LoopBack".

    you could do that by sending 0x0C05, then sending 0x8000, look at your receiver buffer to find 0x0C01  "it means Communication is working correctly".

    Hope i Could Help.

  • Thanks for the detailed reply, please find my comments below:

    For the 1st step:
    I was configuring the clock 1 MHz, it should be fine as per the DRV specs, but anyway I tried the 4 MHz, it didn't make difference.
    For the clock phase and polarity, yes I tried to have phase 1 and polarity 0, but it wasn't working.

    For the 2nd step:
    Yes, I tested my SPI, there is no loopback, that's why I connected UCA0 to UCB1 and I tested the communication between them, it was working fine.

    For step #3:
    The DRV is already compatible with the MSP I have, so I was connecting everything, and I tried to add the updated of Dir and Step, but no difference.

    For #4:
    I tried the control register with other values, but when I read it, It always showed high values (FFs).
  • Ahmed,

    In such case, please compare your SPI signals to DRV8711EVM GUI SPI signals (includes: SLEEPn, SCLK, SDATI, SCS, SDATO) on DRV8711EVM boards.

    Regards,
    Wang