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.

CCS/DRV8308: DRV8308 how to connect to run a bldc motor

Part Number: DRV8308

Tool/software: Code Composer Studio

HEELO

i read the data sheet and is a litle confuse to me
i have the drv8308 ic and i need to put a bldc motor to run on button1-> DIR 0
 and button2-> DIR 1

I gonna use a stm32F103RB micro controller to read an write in the registor
but witch pins i need enable for it work when a press the button.
when I press the button 1 what parameters do I have to activate?
button 1 is an input on my micro controller, which will then rotate
the motor in the DIR 0 direction.

I use the VSCODE with platformio  to program the stm32F108RB board 
I THINK this way when i press the button my micro controler active other output or send a hex comando to the register and motor RUN?

THANKS 

  • Esmith,

    I can only help you with the DRV8308 commands, I do not know the microcontroller or programming interface you are using.

    The DRV8308 has a DIR pin, this pin sets the output direction.

    My recommendation is to tie this DIR pin HIGH or LOW using one of your MCU GPIO pins and then switch the state of this pin based on your press of button1 or button2.

    The same rotation method can be used for either direction since the DIR pin will control which direction the rotation occurs.

    Regards,

    -Adam
  • //Mode Clock Polarity (CPOL) Clock Phase (CPHA)
    //SPI_MODE0 0 0
    //SPI_MODE1 0 1
    //SPI_MODE2 1 0
    //SPI_MODE3 1 1


    SPISettings settings(1000000, MSBFIRST, SPI_MODE0);

    void setup()
    {
    Serial.begin(115200);
    SPIClass(MOSI,MISO,SCLK,SCS);
    SPI.beginTransaction(settings);
    pinMode(SCS, OUTPUT);
    }

    to read and save the bits on variable COMCTRL_DRV8308 to print
    Adress_COMCTRL =0x00
    case Adress_COMCTRL:
    digitalWrite(SCS, HIGH);
    COMCTRL_DRV8308 = SPI.transfer16(Adress_COMCTRL);
    digitalWrite(SCS, LOW);
    break;

    i have always the same values on picture

    i need help
  • Esmith,

    I cannot help you with this unfortunately. Please post on a code forum or the stm32F103RB forum.

    Regards,

    -Adam