2019-09-05 10:15 AM
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
2019-09-05 10:49 AM
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.
2019-09-05 11:12 AM
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
2019-09-05 12:10 PM
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.
2019-09-05 12:32 PM
Show the actual bit stream from the device, your presentation of the decimal numbers is not helpful.
The data is in SSI6 format, right?
2019-09-05 12:44 PM
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.
2019-09-06 07:14 AM
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).
2019-09-06 10:09 AM
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
2019-09-07 01:14 AM
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.