|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
CRC lookup table in RobotOpen Source
I was not sure where to ask this, but I was reading through the RobotOpen Source code, and noticed the CRC Lookup table coded in, and was curious as to if anyone knew what is what for? I do not want to modify it, but I want a better understanding of how it fits into the scheme of things, should one want to port it to a different architecture.
|
|
#2
|
||||
|
||||
|
Re: CRC lookup table in RobotOpen Source
By what I saw last time, it is an error check for the networking between the driver station and the arduino.
|
|
#3
|
|||||
|
|||||
|
Re: CRC lookup table in RobotOpen Source
CRC stands for Cyclic Redundancy Check. It's a way to take a large chunk of bits and come up with a small number that can be used to verify that those bits haven't been changed after being copied from one place to another. The "Cyclic" in the name refers to the specific algorithm being used, which involves bit shifts and exclusive or operations with feedback to the shift input. The process can be time-consuming, which is why many implementations use a precomputed table of values to trade off memory space for execution time.
A CRC is like a checksum, but it detects strings of errors better. |
|
#4
|
|||
|
|||
|
Re: CRC lookup table in RobotOpen Source
That makes a lot of sense, thank you! I was reading through some more bits of the libraries and it looks like the table is stored in some kind of flash memory, but as far as I know, the arduino ethernet board only has the EEPROM for program storage, and I know the memories are not the same, but I believe they are both non volatile. If one wanted, could one move this table to a different bank of memory, and update the functions calling this table to point to memory containing the table?
|
|
#5
|
|||
|
|||
|
Re: CRC lookup table in RobotOpen Source
The arduino has EEPROM, program flash, and RAM. The table is being stored in the program flash in order to reduce RAM usage, because otherwise the table would be stored in RAM as more variables are. It would not be of any use to move the table to another memory, as the EEPROM is write count limited, and the table requires fast repeated access for network error checking; and moving to RAM would take up a good chunk of ram that could be used for other things.
|
|
#6
|
|||
|
|||
|
Re: CRC lookup table in RobotOpen Source
Hmm, that's what I figured, but this would not be for arduino, I have a different microcontroller to play around with in my free time, and it wanted to some tinkering. Gotta find me a flash chip.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|