cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate rcc with stm32f10x

parisa
Senior
Posted on March 14, 2017 at 17:23

Hi,

Here is my input data

0690X00000606F3QAI.png

you assume that I have 4 variables such as Data1,Data2,Data3 and Data4 that store each byte (Data1 saves d24-d31 and Data4 stores D0-D7). So I want to know how can I execute Crc-8 algorithm in these data according to datasheet with SPL library. I would appreciate give me a simple source because I don't have any Idea How I can implement this algorithm form my input data.

9 REPLIES 9
Posted on March 14, 2017 at 17:36

You'd need to compute in software, the hardware isn't going likely to do this for you.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parisa
Senior
Posted on March 14, 2017 at 18:23

Thanks for your reply.

Actually I want to prevent my communication from noise in long distance.doesn't we have any simple CRC-8 software algorithm?

Posted on March 14, 2017 at 17:42

https://www.ien.eu/uploads/tx_etim/Page_24_25_Zettlex_42750.pdf

 

You'd need to provide a couple of example packets.

What is the final application here? Where will it be used?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 14, 2017 at 18:54

It isn't that complicated, would need a couple of 32-bit data patterns to validate.

What is the final application here? Where will it be used? Please complete your profile accurately.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parisa
Senior
Posted on March 14, 2017 at 21:19

Thanks for your contributions.

Well , I have got these values:the first bytes are 000255,000098,000197

000255,000225,000029,000033

000098,000225,000029,000032

000197,000225,000029,000034

Actually I want to decrease and increase speed of a motor with getting valid data. but if my motor starts it tries to make a lot of noise that can destroy my input data. So I want to check crc code to be sure that each received characters are valid.

Posted on March 15, 2017 at 04:59

Not able to make the maths work with those numbers..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parisa
Senior
Posted on March 15, 2017 at 09:39

Thanks for your effort

maybe I have got the wrong result.However, thanks for your contributions

Posted on March 15, 2017 at 15:16

I don't know, post the link to the data sheet for the specific part you are using, and perhaps the logic analyzer output from the SPI transaction. The command/result phase might take 6 bytes of total transfer back/forth. Present the data as stream of 2 digit hex bytes rather than decimals, ie 0x11,0x22,0x33, etc.

I don't have a way to replicate the hardware.

I tried different initialization, shift direction, and polynomials. The manuals for these parts should provide specific byte/word sequence examples.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
parisa
Senior
Posted on March 18, 2017 at 10:52

Dear Clive one

Thanks for your explanation

you are right and it was my fault because my sensor model doesn't provide the CRC calculation and I thought the first byte it is related to CRC bytes.

Thank you so much for your effort and kindness.