PIC实现CRC的小程序 PIC实现Dallas的iButton通讯时,编了段产生和校验CRC的子程序。 #include ;------------------------------- cblock 0x20 datBuff:8 ;assign 8 byte data buffer bit_cnt ;bit counting CRC_COUNT ;number of bytes for CRC CRC_RESULT ;CRC resulr crc_temp ;temporary data buffer during CRC endc ;------------------------------- #define skp0 btfsc #define skp1 btfss ;=============================== org 0x000 movlw .7 movwf CRC_COUNT movlw datBuff movwf FSR ;FSR point to data buffer call CRC_CHECK movwf datBuff+7 goto $ ;=============================== ;CHECK THE CRC FOR ? BYTES DATA ;For the polynomial of X^8 + X^5 + X^4 + 1 ;Derived from Dallas‘s iButton st……