;------------------------------------------------------------------------------ ; MM53200 Coder Emulation With A PIC12C508 ; Copyright 2000 Patrick Gueulle ; patrick.gueulle@wanadoo.fr ;------------------------------------------------------------------------------ list p=12c508 #include __config _CP_ON & _WDT_OFF & _MCLRE_OFF & _ExtRC_OSC goto begin org 40 ;skips the first 64 memory locations begin movlw 0 tris 6 option movwf 6 code call start call hibit ;DIPswitch OFF call lobit ;DIPswitch ON call lobit ;DIPswitch ON call hibit ;DIPswitch OFF call hibit ;DIPswitch OFF call lobit ;DIPswitch ON call hibit ;DIPswitch OFF call hibit ;DIPswitch OFF call lobit ;DIPswitch ON call lobit ;DIPswitch ON call lobit ;DIPswitch ON call hibit ;DIPswitch OFF call pause goto code ;produce the start pulse start bsf 6,0 call bit bcf 6,0 retlw 0 ;simulate DIPswitch ON lobit bcf 6,0 call bit bsf 6,0 call bit call bit bcf 6,0 retlw 0 ;simulate DIPswitch OFF hibit bcf 6,0 call bit call bit bsf 6,0 call bit bcf 6,0 retlw 0 ;all timing derives from the "bit" routine ;calibrated for a clock resistor (R1) value of 47k ;and a capacitor (C1) value of 270pF bit nop nop retlw 0 ;time the repetition rate of the code transmissions pause bcf 6,0 movlw 36 movwf 8 wait call bit decfsz 8,1 goto wait retlw 0 end