cancel
Showing results for 
Search instead for 
Did you mean: 

STEPPER MOTOR using I2C

PBiał.1
Associate II

Hi, I have a problem with starting a stepper motor using the I2C bus. It uses the NUCLEO-F746ZG microprocessor, the SMC 64-BP stepper motor driver and the KH1634-03CA stepper motor. The main problem is finding the address of the controller and giving it the appropriate control word. In the attachment I am sending a photo of the assembled system and the main.c file.

Regards,

Paul

2 REPLIES 2
Foued_KH
ST Employee

Hello @Paweł Białobłocki​ ,

The slave address expects to be in the upper 7 bits, you might need to use (slaveaddr << 1) when you call HAL_I2C_* functions.

  HAL_I2C_Master_Transmit(&hi2c1, DEVICE_ADDRESS << 1, data, sizeof(data), 1000);

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

PBiał.1
Associate II

Thank you @KHALSI_Foued​ for the answer. I will try it as soon as possible but I've read again the datasheet of the stepper motor controller and I think that it can't use I2C :(. Maybe I'm wrong, can you check it also, please?

Datasheet: http://www.silniki.pl/download/smc64v2.pdf

PS. Stepper motor works perfectly on GPIO.