Skip to main content
mcdino.5338840562911753E12
Associate III
July 10, 2020
Solved

Implementing an SSI slave interface on STM32 Board

  • July 10, 2020
  • 7 replies
  • 3871 views

I am trying to implement a SSI Slave Protocol on a STM32 Board. Since the STM32 Boards don't have a SSI interface, I used its SPI interface in Slave(Transmit only mode). The master SSI sends 24 clock signals and the slave reacts by sending its data(3 Bytes) over the MISO pins. The problem I am facing is that the data is always shifted on the left on every clock signal coming from the master. For example assuming I am constantly sending 0x010101 from slave.

  • At first transmission the master receives 0x010101
  • At Second transmission the master receives 0x020202
  • At third transmission the master receives 0x040404

Can someone please give me some hints on how to solve this problem?

This topic has been closed for replies.
Best answer by waclawek.jan

> I think data can only be sent in blocks of 8Bit.

0693W000001scWcQAI.png

I don't say it's practical, though.

JW

7 replies

waclawek.jan
Super User
July 10, 2020

What is SSI?

JW

waclawek.jan
Super User
July 10, 2020

https://en.wikipedia.org/wiki/Synchronous_Serial_Interface ?

After the transmission of complete data word (3) (i.e. LSB is transmitted), an additional rising edge of the clock sets the clock line HIGH.

In other words, the transfer is effectively 25-bit, for 24-bit data.

You did not tell us which STM32 are you using, but you can probably reset the SPI's internal bit counter by disabling it (SPE=0) and reenabling it again.

Alternatively, send truly 25 bits of data.

JW

mcdino.5338840562911753E12
Associate III
July 10, 2020

Thank you for your reply, I am using STM32F042k6. Yes you are right the transfer is effectively 25-bit for 24-bit data. I think data can only be sent in blocks of 8Bit. So it will practically impossible to send 25Bit data. I will try to disable the internal bit counter if available. Thanks again

waclawek.jan
waclawek.janBest answer
Super User
July 10, 2020

> I think data can only be sent in blocks of 8Bit.

0693W000001scWcQAI.png

I don't say it's practical, though.

JW

mcdino.5338840562911753E12
Associate III
July 13, 2020

Thanks so much I will try it and give you a Feedback.

mcdino.5338840562911753E12
Associate III
July 20, 2020

@Community member​  Thanks it works.

Associate
November 13, 2023

Hi, I am implementing an SSI slave protocol to emulate a magnetic encoder and in my current application the motor controller (SSI master) sends a clock signal up to 10Mhz. I wonder how fast you were able to get you slave to work.