Other Parts Discussed in Thread: DRV8835
Tool/software: TI C/C++ Compiler
Hello,
I was try to implement the Stepper motor driver DRV8835 IC interface with TM4C123 micro controller, in the only one step motor is routeing even if keep for continues running, please help out of this error where i am missing something and please consider below source code. or If you have any source code of same driver please send me.
NOTE: I AM USING MODE:0 in Mode_0 pins are IN1 and IN2 are normal GPIO pins.(toggle HIGH or LOW condition).
This GPIO PIN Init code
void Motor_Driver_ONE(void)
{
Usbprint("***** MOTOR ONE Enable *****\r\n");
/**************** MOTOR-1 PB Pins ****************/
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_5 | GPIO_PIN_4);
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_5, 0);
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4, 0);
/**************** MOTOR-1 PE Pins ****************/
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_5 | GPIO_PIN_4);
ROM_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_5, 0);
ROM_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 0);
/**************** MOTOR-1 PD Pins ****************/
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_0);
ROM_GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_0, 0);
}
This while loop to s\run the continuously.
while(1)
{
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_5, 0);
/*** IN1-> PHASE IN2-> ENABLE ***/
ROM_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_5, 1); //AENBLE1 -> PE4
ROM_GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_0, 1); //BENBLE1 -> PD0
for(int i = 0; i <= 900; i++){}
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4, 1); //APHASE1 -> PB4
ROM_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 1); //BPHASE1 -> PE5
for(int i = 0; i <= 900; i++){}
ROM_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_5, 0); //AENBLE1 -> PE4
ROM_GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_0, 0); //BENBLE1 -> PD0
for(int i = 0; i <= 900; i++){}
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4, 0); //APHASE1 -> PB4
ROM_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 0); //BPHASE1 -> PE5
for(int i = 0; i <= 900; i++){}
}
Please help out of this,
Thanks,