2020-07-10 01:18 AM
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.
Can someone please give me some hints on how to solve this problem?
Solved! Go to Solution.
2020-07-10 02:52 AM
> I think data can only be sent in blocks of 8Bit.
I don't say it's practical, though.
JW
2020-07-10 02:02 AM
What is SSI?
JW
2020-07-10 02:29 AM
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
2020-07-10 02:42 AM
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
2020-07-10 02:52 AM
> I think data can only be sent in blocks of 8Bit.
I don't say it's practical, though.
JW
2020-07-12 11:06 PM
Thanks so much I will try it and give you a Feedback.
2020-07-20 02:53 AM
@Community member Thanks it works.
2023-11-13 11:33 AM
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.