cancel
Showing results for 
Search instead for 
Did you mean: 

6-step library not working

Hrishikesh
Senior

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? 

2 REPLIES 2
CKund.4
Associate

I know of just a few things you could check:

  1. Ensure that the Hardware is setup for 6-step. It should already be setup this way by default
  2. When the code is loaded to the board, the reset button has to be pressed before changes take effect. Press reset and then try pressing the user button.

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.

Hrishikesh
Senior

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!