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.

DRV8711: Registers Read & Write not working properly

Part Number: DRV8711

Tool/software:

Hello team,

  We are working DRV8711 stepper motor driver with STM32F429IGT6 controller for our application. When we work with the driver, it automatically stopped after running few minutes. We are configured all registers as per driver's datasheet. There is no fault indication in driver when motor not run. So we are using oscilloscope to see the data in driver's SDATI and SCLK lines. We see the data what we send. Then we send register address for to read the our already configured data, BUT in the SDATO line there is no data available in the waveform. Here we added configuration registers of driver and waveforms for your reference.

Our PCB design with Driver for your reference.

Our configuration in DRV8711 registers,

// CTRL REGISTER (Address = 0x00)
CTRLn.DTIME = 0x11; // Dead time 850ns
CTRLn.ISGAIN = 0x01; // gain 10
CTRLn.EXSTALL = 0x00; // Internal stall detect
CTRLn.MODE = 0x0100; // 16 Steps
CTRLn.RSTEP = 0x00; // No Action
CTRLn.RDIR = 0x00; // Direction set by DIR Pin
CTRLn.ENBL = 0x01; // Enable Motor

// TORQUE REGISTER (Address = 0x01)
TORQUEn.TORQUE = 0xFF; // Sets full-scale output current for both H-bridges
TORQUEn.SMPLTH = 0x001; // Back EMF sample threshold 100 µs

// OFF REGISTER (Address = 0x02)
OFFn.TOFF = 0x30; // As per the data sheet Default value
OFFn.PWMMODE = 0x00; // Use internal indexer

// BLANK REGISTER (Address = 0x03)
BLANKn.TBLANK = 0x80; // As per the data sheet Default value
BLANKn.ABT = 0x00; // Disable adaptive blanking time

// DECAY REGISTER (Address = 0x04)
DECAYn.TDECAY = 0x10; // As per the data sheet Default value
DECAYn.DECMOD = 0x101; // Use auto mixed decay at all times

// STALL Register (Address = 0x05)
STALLn.SDTHR = 0x40; // As per the data sheet Default value
STALLn.SDCNT = 0x00; // Default value STALLn asserted on first step with back EMF below SDTHR
STALLn.VDIV = 0x00; // Default STALLn asserted on first step with back EMF below SDTHR

// DRIVE Register (Address = 0x06)
DRIVEn.OCPTH = 0X01; // ocp threshold 500 mv
DRIVEn.OCPDEG = 0x11; // 8 - us
DRIVEn.TDRIVEN = 0x01; // Low-side gate drive time 500 ns
DRIVEn.TDRIVEP = 0x01; // High-side gate drive time 500 ns
DRIVEn.IDRIVEN = 0x10;// 300 mA
DRIVEn.IDRIVEP = 0x10;// 150 mA
// STATUS Register (Address = 0x07)
// All are Normal Operation
STATUSn.OTS = 0x00;
STATUSn.AOCP = 0x00;
STATUSn.BOCP = 0x00;
STATUSn.APDF = 0x00;
STATUSn.BPDF = 0x00;
STATUSn.UVLO = 0x01;
STATUSn.STD = 0x00;
STATUSn.STDLAT = 0x00;

We send the command 0x8000 to read the configured register value. Here below waveform is SDATI and SCLK line. We configured SPI mode is CPHA=0 & CPOL=0. After one byte of transmission we receive one bit as High. Is this waveform is correct, Kindly check .

We send the command 0x8000 to read the configured register value. Here below waveform is SDATI and SCLK line. We configured SPI mode is CPHA=1 & CPOL=1. After one byte of transmission there is no High. Kindly check .

Here this waveform, we received when we read a register of 0x8000. All time we receive the same waveform in SDATO line. We configured SPI mode is CPHA=1 & CPOL=1.

Please Find the waveforms we have attached and what we made mistakes and help me to resolve the issue. Which type we need to set SPI mode in our master configuration. Can you please give me a guidance for to solve the issues. Our SCLK ,SDATI and SDATO lines are pulldown state.

  • Hi Narasimman,

    Thank you for posting your question in this forum. 

    Thanks for sharing the schematic. The RESET pin has a pullup resistor and capacitor to GND. It is also controlled by a GPIO of a controller. A logic high on this pin will reset the device. The capacitor to GND has no purpose and can be removed. The 20 kΩ pulldown on SDATAI and SCLK is not needed but should not affect functionality as long as the GPIO can support it with correct logic levels. It appears to be okay. The +5V_OUT from the V5 pin must not be used to power any external load except for device pullup resistors. The pullup 20 kΩ may not be sufficient. This pin is a open drain output. Using 3.3 kΩ  or 4.7 kΩ  would be a better choice.

    That said, looking at the waveforms to review. Please refer to this E2E post and review the correct waveforms shown. 

    We send the command 0x8000 to read the configured register value. Here below waveform is SDATI and SCLK line. We configured SPI mode is CPHA=0 & CPOL=0. After one byte of transmission we receive one bit as High. Is this waveform is correct, Kindly check .

    We send the command 0x8000 to read the configured register value. Here below waveform is SDATI and SCLK line. We configured SPI mode is CPHA=1 & CPOL=1. After one byte of transmission there is no High. Kindly check .

    Here this waveform, we received when we read a register of 0x8000. All time we receive the same waveform in SDATO line. We configured SPI mode is CPHA=1 & CPOL=1.

    Please Find the waveforms we have attached and what we made mistakes and help me to resolve the issue. Which type we need to set SPI mode in our master configuration. Can you please give me a guidance for to solve the issues. Our SCLK ,SDATI and SDATO lines are pulldown state.

    In addition, be sure to follow the SPI timing exactly as described in the datasheet. When the SCS is enabled 0 to 1, the SCLK must be LOW and SDATAI must be setup by the MCU. The SDATAI input data is latched in by the DRV8711 during the rising edge of the SCLK. Often times this may be possible only if SCLK is setup to be HIGH when inactive - this depends on the MCU. Please check the timing. 

    After making these changes please also share SCS, SCLK and SDATA0 waveforms. Thank you.

    Regards, Murugavel 

  • Hello Team ,

         Thank you for your fast response sir. We are changed 3.3 kΩ pulldown on DATA and CLK Resistor value instead of 20 kΩ pulldown resistors. And also changed SPI mode CPHA=0 & CPOL=1 as per your recommendation. Then we write  and Read different values in  Multiple time of DRV8711 registers, The SDATO Line is always High State .

    We send the command 0x8000 to read the configured register value. Here below waveform is SCS, SDATI and SCLK line. We configured SPI mode is CPHA=0 & CPOL=1. 

    Here below waveform, we received when we read a register of 0x8000. All time we receive the same waveform in SDATO line is always high. We configured SPI mode is CPHA=0 & CPOL=1.

     When We configured SPI mode is CPHA=0 & CPOL=0, that time only we received Some data on SDATO Line. Compared to write data, read data is Different. 

    Kindly find and give me a guidance to achieve our application

  • Hi Narasimman,

    Thanks for trying and getting us this feedback.

    When We configured SPI mode is CPHA=0 & CPOL=0, that time only we received Some data on SDATO Line. Compared to write data, read data is Different. 

    I think this may be the correct mode for your MCU. During a write transaction the data out on SDO would always be the previous content of the register not the new written value. If you perform a read after this transaction or a second write you'd get the newly written value from the previous write operation. Could you please confirm? Thanks.

    Regards, Murugavel