STEPPER MOTOR using I2C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-29 6: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
- Labels:
-
I2C
-
STM32F7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-03 2: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-03 3: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.
