2025-12-20 3:42 PM - last edited on 2025-12-22 3:50 AM by Andrew Neil
Powerstep01 has a beautiful function to zero the position of the counter that works in conjunction of an external switch SW. It sets the slowest speed and direction of a movement automatically and waits until a rising edge is detected on from the switch input pin and finishes performing with hard stop and setting zero. The question is how to define the pin address to be monitored.
Using Poonor library, is there another library that you recommend?
Regards
2025-12-22 3:23 AM
What is Poonor library?
2025-12-22 3:58 AM
Welcome to the forum.
Please see How to write your question to maximize your chances to find a solution for best results
For recommended software, go to the 'Tools & Software' tab on the Product Page:
https://www.st.com/en/motor-drivers/powerstep01.html#tools-software
@kafkaesq wrote:Poonor library
I guess you mean this: https://github.com/ponoor/Ponoor_PowerSTEP01_Library ?
Always best to give a link - as @STuser2 showed, not everyone is going to know what you mean.
Note that UNO Q is not an ST product, and Arduino is not a focus of this forum - so probably best to go to the Arduino forums for support:
https://forum.arduino.cc/c/other-hardware/motors-mechanics-power-and-cnc/25
2025-12-22 12:29 PM
Thanks to all for the replies. I am aware that ARDUINO is not a ST product. This question is directed to ST users with IHM3A1 experience.
To fully document my question:
From item 7.14 in the powerSTEP01 Datasheet:
External switch (SW pin)
The SW input is internally pulled up to VDD and detects if the pin is open or connected to ground (see Figure 14).
The SW_F bit of the STATUS register indicates if the switch is open (‘0’) or closed (‘1’) (Section 11.1.28 ); the bit
value is refreshed at every system clock cycle (125 ns). The SW_EVN flag of the STATUS register is raised when
a switch turn-on event (SW input falling edge) is detected (Section 11.1.28). A GetStatus command releases the
SW_EVN flag (Section 11.2.20).
By default, a switch turn-on event causes a HardStop interrupt (SW_MODE bit of CONFIG register set to ‘0’).
Otherwise (SW_MODE bit of CONFIG register set to ‘1’), switch input events do not cause interrupts and the
switch status information is at the user’s disposal (see Table 42).
The switch input can be used by the GoUntil and ReleaseSW commands as described in Section 11.2.10 and
Section 11.2.11. If the SW input is not used, it should be connected to VDD.
If I can know where is this switch connection in the IHM03A1, I can figure out the ARDUINO pin which it connects to be able to use the built in function that is plenty to start Step motor reliable operation.
Thanks.
2025-12-22 12:38 PM
@kafkaesq wrote:If I can know where is this switch connection in the IHM03A1
You mean in the X-NUCLEO-IHM03A1 board?
The schematic is in the User Manual - which, as always, is available on the 'Documentation' tab of the Product Page:
https://www.st.com/en/evaluation-tools/x-nucleo-ihm03a1.html#documentation
Also on the 'CAD Resources' tab:
https://www.st.com/en/evaluation-tools/x-nucleo-ihm03a1.html#cad-resources