CRC-16 Component

Post and discuss new components that you have created.
Landlweg
Posts: 7
http://meble-kuchenne.info.pl
Joined: Fri Jun 11, 2021 6:44 pm

Re: CRC-16 Component

Post by Landlweg »

Hi Martin,

Sorry - my know how is to small

i have attach the file CCITT16-02.fcfx

for this databytes i have to calculate the checksumme
CRC16 Polynominal 0x8404 and invert the result in two bytes.
with PIC16F18877, he have a funktion for Cylic redundancy check (CRC) Module
but if is working with software is also O.K
the endresult must be O.K

can you please help ?

regards
Hermann
Attachments
CCITT16-02.fcfx
(9.36 KiB) Downloaded 165 times

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: CRC-16 Component

Post by mnfisher »

Hi Hermann,

First save the .fcpx file (from the first post) into a directory (for example c:\Flowcode)
Then add this directory to Flowcode's search using 'Build->Customise-Locations'
2023-09-15_18-13-40.jpg
2023-09-15_18-13-40.jpg (75.98 KiB) Viewed 2870 times
Okay I have G:\Flowcode (it's a long story - you're probably using C:\ )

Then you need to have your data in a byte array - I've modified your code to do this:
CCITT16-03.fcfx
(10.61 KiB) Downloaded 181 times
I;ve set the polynomial to 0x8404 - if you need to invert the CRC you can either change the value of XorOut to 0xFFFF
or use the ~ operator (and do .crc = ~.crc)
2023-09-15_18-20-43.jpg
2023-09-15_18-20-43.jpg (26.73 KiB) Viewed 2870 times
Martin

V_E_D
Posts: 2
Joined: Tue Apr 20, 2021 9:20 am

Re: CRC-16 Component

Post by V_E_D »

hi there
i am new to this forum so i hope posting here is ok?
i have been looking into generating 8 bit crc's from 6 8 bit bytes. i have flowcode 9 and was hoping to experiment with your crc component
but i cant get it to appear in the components list. i added the path to flowcode as described but no joy.
thanks from steve

Steve-Matrix
Matrix Staff
Posts: 1253
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: CRC-16 Component

Post by Steve-Matrix »

This component is a v10 one I think and probably won't work with v9.

V_E_D
Posts: 2
Joined: Tue Apr 20, 2021 9:20 am

Re: CRC-16 Component

Post by V_E_D »

hi steve
thanks for the reply. i wondered if that may be the case.
cheers,
steve

Landlweg
Posts: 7
Joined: Fri Jun 11, 2021 6:44 pm

Re: CRC-16 Component

Post by Landlweg »

Hi Steve,
Hi Martin,

Sorry i was ill.

Thank you for help
But the result is always wrong

i have for example 9 databyte,
4d 56 57 02 80 00 19 00 00,
CRC-CCITT16 Polynom 0x8408,
the result from other system inverted is 69 CD,
Do you have a good idea ?
i have Flowcode V10,PIC16F18877,

regards
Hermann

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: CRC-16 Component

Post by mnfisher »

Hi Herman,

I checked using the online checker - mentioned in the first post. There seem to be a range of algorithms / polynomials - and 0x8408 isn't one on that site.
If you can post (or PM) your code = and result you are getting I'll take a look and see if i can work out what is going awry..

Martin

Qualcomm5
Posts: 11
Joined: Wed Dec 20, 2023 2:13 pm
Has thanked: 6 times
Been thanked: 4 times

Re: CRC-16 Component

Post by Qualcomm5 »

Thank you Herman for creating this component.

I've played around much with various CRC8's and CRC16's on various projects in the past, with some micro's sporting a hardware CRC engine and others not, so will doubtless be of great use to many people :)

crccalc.com is nice and simple, though just giving a shout to the CRC location of Sunshine's website that I've used many times to validate calculated CRC's, with further explanations/information/features...
http://www.sunshine2k.de/coding/javascr ... rc_js.html

Post Reply