Bruce,
Thanks so much for your help! Your example is quite clear and I am able to execute it properly on my device.
One more question if you don't mind... the CRC calculation algorithm seems to want to be passed one byte at a time, but I need to calculate a checksum for a series of bytes (as a complete set, not individually) and I'm not sure how to accumulate the result of each one-byte cycle through the checksum routine.
As a real-world example, I need to be able to send the three bytes $AA $05 $01 into the routine and obtain the resultant accumulated checksum for all three bytes, which should produce a result of $D5 $50 (I am using a PC-based checksum program to determine what the proper output should be), but no matter what I do I can't seem to achieve this result.
I then need to append this checksum (with the high and low order bytes reversed) to the original three-byte command for a final result of $AA $05 $01 $50 $D5 to go out the serial port.
Once again, the help is really appreciated...
Bookmarks