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.

DRV8842 Working with PIC16F877A

Other Parts Discussed in Thread: DRV8842, DRV8825, DRV8711, DRV8818, DRV8828, DRV8813, DRV8829

Hi, 

I am planning to control a bipolar Stepper motor using DRV8842. Is my PIC16F877A / PIC16F887 is capable of controlling the stepper via DRV8842? Because mentioned PIC MCU is having 2 channel of PWM only.


Please suggest me.
Thank you very much.

Regards,

Ramesh Duraisamy.

  • Hi Ramesh

    First, DRV8842 has only one H bridge. Are you going to use two DRV8842?

    For the control resource needed from MCU, it dependences on the control methods and the system requirement.  

    Generally, the more Micro stepping requirements, the more MCU resource needed.

    Control Methods:

    1. 4 PWMs to the 4 half bridge with or without current feedback. (Please refer to http://www.ti.com/tool/drv8412-c2-kit). Nearly all DRV8x can be used this way.

    2. STEP/DIR inputs with built in index. Such as DRV8825, DRV8818, DRV8711.

    3. Two DACs control the VrefA and VrefB. DAC + IO + DRV8813 / DRV8842*2 / DRV8828 / DRV8829 . Please refer to http://www.ti.com/lit/an/slva416/slva416.pdf for this method in detail.

    Thanks.

  • Hi Wilson,

    Good day!
    Thank you for your given information. Please refer the attached schematic diagram.

    I have used DRV8842 U4 & U5. (2Nos for driving a stepper motor.) Also a DRV8813 full bridge driver is used to drive an extra stepper  motor.

    Please refer the attachment and suggest us to connections with the presently selected MCU.

    2781.MCU_DRV SECTION.pdf

    Thank you.

  • Hi Ramesh

    In your hardware configuration, if only want to drive the motor in full / half step, you can just control the GPIOs by MCU internal counter and generate the full / half step sequence to the U4's IN1 IN2 and U5's IN1 IN2. The MAX current can be regulated by DRV8842 itself.

    If you want achieve higher micro stepping, you may need PWM duty cycle control for each INx. Since you don't have current feedback in hardware configuration, you can just use sine table to generate two approximate sine and cosine wave currents to the two motor phases for micro stepping.

    Thanks.

  • Hi Wilson,
    Greetings!
    Thank you for your prompt response. I am in the need of rotating a Bipolar stepper motor for below operation.
    a) Starts the stepper at 126 steps/sec and ramps up to 651 steps/sec run for 120 seconds then stop.
    b) Wait for a interrupt button from a user.
    c) If get interrupt button command then start the step a).

    This is my requirement. For this the designed schematic is right one or should I need any modificaiton for the same?

    Please suggest for my query.
    Thank you very much.