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.

DRV8245-Q1: How to test the device in SPI(S) and PH/EN mode?

Part Number: DRV8245-Q1
Other Parts Discussed in Thread: MSP430G2553

Tool/software:

Hello all,

I plan to use the DRV8245-Q1 in SPI(S) mode and PH/EN mode. I wanted to test it with a most simple configuration. I build a PoC on breadboard, but with no succes. 

The motor is not moving:

VM -> 12V

nSLEEP -> 3,3V Logic HIGH

DRVOFF -> GND

with a STM32 Microcontroller i wanted to configurate the DRV8245-Q1 via SPI and put the PH/EN2 on LOW and EN/IN1 on HIGH. The HIGH and LOW levels are checked by me with a multimeter.

First of all, is this way correct?

I have read that i should configurate the Register CONFIG3. How could I do this with SPI?

I should overwrite the S_mode Bits. Are there any example codes for overwriting these registers. Which registers are also necessary for basic configuration.

thanks in advance for any help

  • Hi Trung-An,

    You will need at least connections from the MCU to nSLEEP and the SPI pins. To spin a motor over SPI you can follow these steps:

    1. Pull nSLEEP high to enable the DRV8245S-Q1
    2. Write 0x91 to address 0x08 to clear any fault at startup like POR and enable SPI_IN mode
    3. Set bits 3 and 2 (S_DRVOFF) in address 0x09 are set to 0 to enable the gate driver inside of the DRV8245S-Q1
    4. You can now set bits S_EN_IN1 and  S_PH_IN2 to the desired configuration as you need to control your load

    As a side note, before step 3 make sure to make any register configurations that you would want with regards to protection features, slew rate (SR), etc.

    Regards,

    Joshua

  • Hi Joshua,

    thank you for the fast answer. Unfortunately I am not so good in Software programming and its still not working.

    I have put nSLEEP Pin by wire on high 3,3V

    I have (tried) to clear andy FAULT: with step 2 which you described (0x91 -> 0x08).

    Also i have write the S_Mode in CONFIG3: (0x40 -> 0x0C) to get in PH/EN Mode.

    I have put DRVOFF Pin by wire on GND.

    I have configure the pins EN/IN1= 1 und PH/IN2 =1.

    It didn't work. 

    My problem is that I am not so familiar with Software programming. I am usure if my code to write over the register is correct. 

    Is there any example code for overwriting the registers? What is the most easiest way to test the H-bridge with less SW. HW steps are no problem.

    thanks in advance

    Best regards

    Trung-An Nguyen

  • Hi Trung-An Nguyen,

    I cannot help you with code for a STM32 microcontroller specifically but I can provide code we have for the MSP430G2553 which we use on the DRV8245 Evaluation boards. I will aim to provide you with some example code tomorrow.

    Everything else you did was correct.

    Regards,

    Joshua

  • Hi Trung-An,

    Below is a CCS project with C code for programming a DRV8245-Q1 to set PH/EN mode and to set OUT2 high and OUT1 low. I think a step that may have been missed is to wait at least 1ms after pulling nSLEEP high before sending any SPI commands to allow time for the device to wake up.

    DRV8245-Startup-Code.zip

    Regards,

    Joshua