cancel
Showing results for 
Search instead for 
Did you mean: 

SSI Protocol under STM32

parisa
Senior

Hello,

Here is the file of Encoder which uses SSI protocol for its communication. I have run this encoder with SPI and its interrupt in STM32 but I have some problems that I will be thankful if you could help me.

1) I want to know would it be possible to communicate with the Encoder with SPI thoroughly?

2) how can implant CRC-8 encryption for validate data

Thanks

8 REPLIES 8

The SSI6 mode looks viable

>>how can implant CRC-8 encryption for validate data

Provide a couple of example data patterns, make a reasonable donation, I'm sure I can provide a worked example of a software check routine.

The SPI peripheral may be able to implement it directly, you'd have to try.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parisa
Senior

I appreciate your help.

Here is some of the output ( each number is byte)

(MSB)000173->000096->000074->000045(LSB)

(MSB)000178->000224->000075->000204(LSB)

(MSB)000167->000224->000073->000163(LSB)

One of my questions is, By sending 4 bytes via SPI interrupt I can see the position of some bits is a little different. For example and based on the pdf file, When I change the distance of rotation surface the 23th bit should be 0 (As an error) but as you can see the second MSB byte changes from 01100000 to ‭00100000(22th bit)‬.

Thank you for your kindness

You might need to alter the clock phase settings for SPI peripheral. ie if data is latched on rising vs falling edges

A method of testing would be to bit-bang the interface, ie use GPIO to write and read bits via the pins.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Show the actual bit stream from the device, your presentation of the decimal numbers is not helpful.

The data is in SSI6 format, right?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parisa
Senior

Thank you so much for your comments.

Yes they are in SSI6 format. In the next days I will handle them by using the bit-bang method. I will tell you ASAP.

parisa
Senior

Dear Clive Two.Zero,

Here is some of my output (first data is between 0 to 65535(all data & 0xffff) and the second data is all received bits.

24434-3917569906

31180-3917576652

36042-2709621962

in this manner, the output of encoder works fine(0-65535) but the PV bit is on the 16th bit( n from 0 to 31).

Like to see the bits on the wire, not the interpretation of them

E9815F72 5F72 24434

E98179CC

A1818CCA

C0AFB9 -  44985 - 11101001100000010101111101110010

C0BCE6 -  48358 - 11101001100000010111100111001100

C0C665 -  50789 - 10100001100000011000110011001010

Looks like we're shifted off by one bit

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parisa
Senior

Thank you so much for you comment, You are right. Before asking about CRC I have a big problem for losing my speed of MCU. I started a new topic on SPI which may help me to correct my MCU's speed.