cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for Python code and registery mapping to control a powerSTEP01 via SPI

BPont.1
Associate

Hello,

I wish write to use the powerSTEP01 (X-NUCLEO-IHM03A1) using SPI (STM32 157 or raspberryPi) with python.

I'm looking for python code example such as a basic initialization, move/position and a few registery reads and writes.

I'm loking for the powerSTEP01 register mapping too.

Is there a powerSTEP01 python library? If not, I could write and share one.

Note: I'm ok with stepper driver (already works with Trinamic drivers).

Thanks in advance,

Have a good night

3 REPLIES 3
Cristiana SCARAMEL
ST Employee

Hello @BPont.1​ and welcome to the ST Community.

No Python library is available for the powerSTEP01 device.

If you need any guidance for the communication protocol of the device, you can refer to the Application Notes AN4290.

Thanks for sharing the results of your development with the Community.

If you feel a post has answered your question, please click "Accept as Solution"
BPont.1
Associate

Hello,

I've figure how to communicate with the powerSTEP with SPI using Python thanks to your documentation.

I've dig into the documentation and found the register addresses:

https://www.st.com/resource/en/datasheet/powerstep01.pdf

For those who want to drive it with Python

Register addresses => P51

SPI most significant bit first

spidev should do the work

Here some snipet to get you started:

importspidev

# We only have SPI bus 0 available to us on the Pi

bus=0

# Enable SPI

spi=spidev.SpiDev()

# Open a connection to a specific bus and device (chip select pin)

spi.open(bus, device)

# Set SPI speed and mode

spi.max_speed_hz=500000

spi.mode=0

# send data and read the returned data from uc driver

data= [0xAD, 0x00, 0x07, 0xD0, 0x00]

response=spi.xfer(data)

I was ready to start the project and write documentations/librairies for Python users, but sadly, the board (X-NUCLEO-IHM03A1) is not avaible. I really can't wait for so long => Factory Lead Time: 71 weeks! And no European supplier got stock.

If I can't find suppliers, I'll have to stay with the Trinamic motor drivers.

I really want to do something with your brand because I live close to one of your factory (Grenoble). Plus, I push my company to use your great MCU board (STM32 157), but that's another story :)

Thanks for the info,

Have a great day

Hi @BPont.1​ ,

For this kind of information you can contact our ST sales office.

You can refine your search at LINK selecting "Sales Office and Representatives" and your country.

Remember to "Select as Best" label in the proper reply to your original question.

So, you can help others Community member to find the answer at similar question.

If you feel a post has answered your question, please click "Accept as Solution"