See: General Error Detection and Correction.
But except for CRC, these methods are a bit hard to implement on a PIC, even an '877. CRC has been done.
Ken's serial port multiplexer is a great example of CRC use, in that case for testing external RAM but the idea is the same.
See:
Questions:
has anyone written a routine for checking the ram memory onboard of a pic? identify and mark a 'badram' address and exclude this somehow in the cblock section for memory allocation? the application would be for batch production where you would not want to check manually every part and adjust the cblock for every device programmed. anyone? Thanks for the help