Search found 876 matches

by kevinkk525
Sat Feb 13, 2021 7:42 pm
Forum: Programs, Libraries and Tools
Topic: Fast crc8
Replies: 49
Views: 1240

Re: Fast crc8

Still, Peter is right in that pure transmission errors will be very rare. More likely are message frame errors: messages too short or too long. Yeah I might be wasting time for a situation that is very unlikely to happen.. Guess I'll make it configurable so people can decide if they want to use a c...
by kevinkk525
Sat Feb 13, 2021 2:56 pm
Forum: Raspberry Pi microcontroller boards
Topic: Wifi bridge for RPI Pico
Replies: 27
Views: 1878

Re: Wifi bridge for RPI Pico

Thanks for the suggestion. The though crossed my mind and I took a look at the documentation you linked. It's not quite easy to implement either using a compatible socket object. Would also need to create buffers and receive the data interrupt driven as the AT firmware just sends whatever it receive...
by kevinkk525
Sat Feb 13, 2021 2:49 pm
Forum: Programs, Libraries and Tools
Topic: Fast crc8
Replies: 49
Views: 1240

Re: Fast crc8

Wow that is a very thorough test! When you say "single byte change" do you mean a whole byte has changed or just a single bit within that byte? Quite interesting that the tabled hash is worse than the simple hash. But crc16 beats them all.. I'd stick with crc16 if not for the pico being so slow with...
by kevinkk525
Fri Feb 12, 2021 9:23 pm
Forum: Programs, Libraries and Tools
Topic: Fast crc8
Replies: 49
Views: 1240

Re: Fast crc8

Ok, so I guess for my use-case a simple hash without the table will be good enough then.

Thank you so much for all your help and answers! This has been immensely helpful.
by kevinkk525
Fri Feb 12, 2021 8:59 pm
Forum: Programs, Libraries and Tools
Topic: Fast crc8
Replies: 49
Views: 1240

Re: Fast crc8

Thanks for that explanation. Guess I might have expressed my question unclear though. The same with an additional lookup table, which is told to be better How much better is that table? I can't grasp how important that table is. Like is the hash without table worse than the crc16? Especially for pac...
by kevinkk525
Fri Feb 12, 2021 8:49 pm
Forum: Programs, Libraries and Tools
Topic: Fast crc8
Replies: 49
Views: 1240

Re: Fast crc8

This is an interesting approach. For 400 Bytes on the esp32 I get: 3ms for the table based crc, table outside the function but locally cached 2.5ms for the hash without table 2.8ms for the hash with table These are interesting results. The RP2040 is a lot slower on the crc calculations but quite a b...
by kevinkk525
Fri Feb 12, 2021 8:34 pm
Forum: Programs, Libraries and Tools
Topic: UART and end of line
Replies: 4
Views: 138

Re: UART and end of line

What hardware are you using?
if you use uart.readline() maybe it stops because it considers \x00 the end of a line? i don't know. I only use read()
by kevinkk525
Fri Feb 12, 2021 7:59 pm
Forum: Programs, Libraries and Tools
Topic: UART and end of line
Replies: 4
Views: 138

Re: UART and end of line

If you are trying to read exactly 40 bytes, why are you using uart.readline()? You should be using uart.read(40)
But even then it might return less bytes if it reads faster than the other end sends bytes.
by kevinkk525
Fri Feb 12, 2021 5:38 pm
Forum: Programs, Libraries and Tools
Topic: Fast crc8
Replies: 49
Views: 1240

Re: Fast crc8

Thanks so much for your efforts! This version is indeed 700-900us faster on 500Bytes than the old one (once you make _tab a local variable otherwise the access to a global variable makes it slower).
by kevinkk525
Fri Feb 12, 2021 3:01 pm
Forum: Programs, Libraries and Tools
Topic: Fast crc8
Replies: 49
Views: 1240

Re: Fast crc8

The crc16 code with precalculated table has a table of 256 shorts. You could put that into an array of shorts as well. But that may still create an intemediate list. Thanks a lot, didn't think about that solution. It reduced the RAM need to <3kB which is very acceptable. The speed of crc16 even wit...