2023-04-29 06:17 AM
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
2023-05-03 02:29 AM
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.
2023-05-03 03:24 AM
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.