2024-07-20 03:04 AM
Hello everyone, I'm new to STM32 world, trying to run a 5 dc motor with adafruit drv8833 and NUCELO-L432KC
I connected it as below
NUCELO-L432KC a0 > ain1
NUCELO-L432KC a1 > ain2
NUCELO-L432KC vin > vm
NUCELO-L432KC gnd > gnd
drv8833 aout1 > motor
drv8833 aout2 > motor
I couldn't find drv8833 motor driver for stm32 I tried with below:
/* USER CODE BEGIN 2 */
/* Start PWM */
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
HAL_Delay(500);
HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
HAL_Delay(500);
// Start PWM
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
I need help how to operate the driver with the board.
Best regards
Josef