2018-12-26 06:35 AM
I'm trying to work with the STSW-SPIN3202 6-step firmware example for the Keil MDK, specifically the potentiometer example. I opened the firmware and in the infinite while loop I have MC_StartMotor() as per the instructions listed in there. But nothing happens. I then tried calling the MC_EXT_button_SixStep() function but again nothing happens when I press the USER1 button. Also the VREG12 pins does not show 12V on the test point. What am I missing?
2018-12-28 02:04 PM
I know of just a few things you could check:
Now that the basics are out of the way, the motor (Bull Running motor setup by default) should start right up after loading the example project to the board and you should be able to control speed somewhat using the potentiometer. If the motor still does not start, ensure that the motor parameters match the motor you are using (there are several header files for different motors). Also, try setting up a quick "if" statement in the main code to execute the MC_StartMotor Function just once on startup (problems can arise if this function is being constantly called in the main loop).
If none of that works, download STMStudio and import the SIXSTEP_parameter.STATUS variable and see what it is returning. This status variable is essential for debugging this library.
Hope this helps.
2018-12-28 06:56 PM
Thank you @Community member. This definitely helps.
I realised that I had unwittingly tied BOOT0 to VDD. Once I removed that jumper I could get the firmware to boot from the Flash memory. I still can't get the motor to spin. It starts and rotates about half a turn before the USER2 (failure) LED comes on.
I did not know about that variable for error statues. I will monitor that.
Thanks again!