Homebrew Player Tracking and EFT Systems > NLG Homebrew Player Tracking and EFT Systems
SAS CRC check
(1/1)
bassplyr647:
Forgive me if this has already been answered. I am using the SASTest program from IGT and trying to verify the CRC. I'm using the example code from the spec
--- Code: ---unsigned short CRC (unsigned char *s, int len, unsigned short crcval)
{
unsigned c,q;
c = 0;
q = 0;
for(; len; len--)
{
c = *s++;
q = (crcval ^ c) & 017;
crcval = (crcval >> 4) ^ (q * 010201);
q = (crcval ^ (c >> 4)) & 017;
crcval = (crcval >> 4) ^ (q * 010201);
}
return (crcval);
}
--- End code ---
I am using this code on a 32-bit ARM processor. Is the magic number different? Does it matter? Any advice/direction would be helpful. FYI..I can read the full command, including the address-wakeup bit (this was verified using a logic analyzer).
Thanks in advance.
iwalker:
Hi
My Arduino routine looks like this
--- Code: ---void CalculateCRC(byte val[], int len)
{
CRCH=0x00;
CRCL=0x00;
long crc;
long q;
byte c;
crc = 0;
for (int i = 0; i < len; i++)
{
c = val[i];
q = (crc ^ c) & 0x0f;
crc = (crc >> 4) ^ (q * 0x1081);
q = (crc ^ (c >> 4)) & 0xf;
crc = (crc >> 4) ^ (q * 0x1081);
}
CRCH =crc & 0xff;
CRCL =crc >> 8;
}
--- End code ---
Original Routine courtesy of Zarobhr on the old site - http://newlifegames.net/nlg/index.php?topic=13799.0
Which Arm Micro / Dev environment are You working with ? As soon as I get a gap I want to try and migrate my project to the sparkCore.
Tx
Ian
bassplyr647:
Thanks for the quick reply. I found the problem...the seed value I was using was incorrect. I'm using an NXP11xx (I'm testing with a NXP1115). I'm going to be making my own boards. The "Host" system will be a Linux computer.
Navigation
[0] Message Index
Cell Phone and Pad Mode imode wap wap2 |
NLG Archives Archives @ newlifegames.net Wayback Machine |
Contact Us NLG Shop 928 754-4147 Email Us 1788 Highway 95 30 BHC City AZ 86442 |