please dont rip this site
; 
; From Dallas Application note 27
;
; CRC-16  (x^16+x^15+x^2+x^0)
; No tables, No loops, No temporary registers used.
;
; This code is from Dallas Semiconductor Application Note 27:
;
;   Understanding and Using Cyclic Redundancy Checks 
;   with Dallas Semiconductor iButton(TM) Products. 
;
; This routine that calculates the same CRC as the hardware 
; in the DS5001/2 secure micro.
;-----------------------------------------------------------------------
        NAME    CRC_test

?DT?CRC_test SEGMENT DATA
	rseg	?DT?CRC_test
CRCH:   ds      1
CRCL:   ds      1


?CO?CRC_test	SEGMENT	CODE
	RSEG	?CO?CRC_test

        public  CRC_test
	
CRC_test:

        mov     CRCH,#0
        mov     CRCL,#0
	
        mov     A,#080H
        call    CRC16

        mov     A,#075H
        call    CRC16
	
        mov     A,#08AH
        call    CRC16

        mov     A,#00BH
        call    CRC16

        mov     A,#075H
        call    CRC16

        mov     A,#0C7H
        call    CRC16

        mov     A,#0AAH
        call    CRC16

        mov     A,#075H
        call    CRC16

        mov     A,#0C7H
        call    CRC16

        mov     A,#055H
        call    CRC16

        mov     A,#043H
        call    CRC16

        ljmp    CRC_test


;CALCULATE CRC16 IN PARALLEL TO THE GREATEST EXTENT PRACTICAL
;       INPUT:  BYTE TO BE INCUDED IN CRC CALCULATION IS IN ACC
;       OUTPUT: CRCH:CRCL UPDATED TO INCLUDE THE NEW BYTE
;
CRC16:  
        PUSH    ACC                     ;save this in case the caller needs it
        XRL     A,CRCL
        MOV     CRCL,CRCH               ;put the high byte of the crc in its dest..
        MOV     CRCH,A                  ;save data xor low(crc) for later
        MOV     C,P
        JNC     CRC0
        XRL     CRCL,#001H

CRC0:   
        RRC     A                       ;get the low bit in c
        JNC     CRC1
        XRL     CRCL,#040H

CRC1:   
        MOV     C,ACC.7
        XRL     A,CRCH                  ;compute the results for bits P...U
        RRC     A                       ;shift them into place
        MOV     CRCH,A                  ;and save them
        JNC     CRC2
        XRL     CRCL,#080H

CRC2:   
        POP     ACC                     ;and restore everything and return
        RET

        end


file: /techref/8051/crc16.htm, 2KB, , updated: 2001/4/17 10:21, local time: 2010/3/17 21:12,
TOP NEW HELP FIND: 
38.107.191.112:LOG IN
©2010 PLEASE DON'T RIP! DO: LINK / DIGG! / MAKE!

 ©2010 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it!
<A HREF="http://www.piclist.com/techref/8051/crc16.htm"> 8051 crc16</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 
Stepper motors CAN be smooth!
And stepper controllers can be strong and cheap. Roman Black's Linistep stepper controller kits:
o 18th microstep
o Linear smoothing
  o Open source
o Full kit $25!
 
miSim DE is an excellent, portable and powerful IDE for developing PIC applications.
The only consistant, simple to use yet powerful development environment. It simulates real-world devices via virtual component "plugins" (LED,LCD,key,motor,TV,etc) in real time, has a syntax highlighting editor, macro assembler and disassembler. Regular updates and third-party plugins keep this software ahead of any other PIC IDE.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .