; NOLIST include "16c84.h" ; LIST ;CE RA0 ;CS RA1 ;ALE RA2 ;WR RA3 ;CLK RA4 ;-------------------------------; ; REGISTERS ;-------------------------------; tmp equ 0x0C ;-------------------------------; ; START ;-------------------------------; ORG 0x0000 goto start ;-------------------------------; ; INT ;-------------------------------; ORG 0x0004 retfie ;-------------------------------; ;-------------------------------; ; SKANER ;-------------------------------; start bsf STATUS, PR0 bcf OPTIO, RBPU ; on pullup PORTB movlw 0xF7 movwf TRISA bcf STATUS, PR0 wt_ale bsf PORTA, RA3 bsf STATUS, PR0 movlw 0xFF ; PORTB to input movwf TRISB bcf STATUS, PR0 wt_ale1 clrwdt btfsc PORTA, RA0 goto wt_ale btfss PORTA, RA2 goto wt_ale1 ; waite +ALE wt_ale2 clrwdt btfsc PORTA, RA0 goto wt_ale btfsc PORTA, RA2 goto wt_ale2 ; waite -ALE movf PORTB, W call TABL movwf PORTB wt_cs1 clrwdt btfsc PORTA, RA0 goto wt_ale ; wate CS- btfsc PORTA, RA1 goto wt_cs1 bsf STATUS, PR0 clrf TRISB ; PORTB to output bcf STATUS, PR0 bcf PORTA, RA3 wt_cs2 clrwdt btfsc PORTA, RA0 goto wt_ale ; wate CS+ btfss PORTA, RA1 goto wt_cs2 goto wt_ale ;-------------------------------; ORG 0x02FD TABL bsf PCLATH, 0 bsf PCLATH, 1 iorwf PCL retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x007F retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x0000 retlw 0x0000 retlw 0x0000 retlw 0x000E retlw 0x0029 retlw 0x00A3 retlw 0x0000 retlw 0x0029 retlw 0x0000 retlw 0x0000 retlw 0x0000 retlw 0x000E retlw 0x0029 retlw 0x00A3 retlw 0x0000 retlw 0x0029 retlw 0x0000 retlw 0x0000 retlw 0x0000 retlw 0x000E retlw 0x0029 retlw 0x00A3 retlw 0x0000 retlw 0x0029 retlw 0x0000 retlw 0x0000 retlw 0x0000 retlw 0x000E retlw 0x0029 retlw 0x00A3 retlw 0x0000 retlw 0x0029 retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x0095 retlw 0x00F6 retlw 0x00C0 retlw 0x005D retlw 0x00B9 retlw 0x0001 retlw 0x000A retlw 0x0005 retlw 0x004B retlw 0x0013 retlw 0x0026 retlw 0x004F retlw 0x006E retlw 0x00D3 retlw 0x00FF retlw 0x007F retlw 0x0071 retlw 0x0045 retlw 0x0000 retlw 0x001A retlw 0x0000 retlw 0x000F retlw 0x0064 retlw 0x0000 retlw 0x0000 retlw 0x0000 retlw 0x00B4 retlw 0x0069 retlw 0x0046 retlw 0x002D retlw 0x0010 retlw 0x000F retlw 0x00AD retlw 0x00CE retlw 0x00DD retlw 0x00EE retlw 0x0000 retlw 0x0000 retlw 0x00CB retlw 0x0090 retlw 0x0001 retlw 0x005D retlw 0x000E retlw 0x00BA retlw 0x00C6 retlw 0x00DA retlw 0x00E5 retlw 0x00F8 retlw 0x0014 retlw 0x00EC retlw 0x000E retlw 0x00D3 retlw 0x0009 retlw 0x00AA retlw 0x0005 retlw 0x007A retlw 0x0002 retlw 0x0006 retlw 0x0000 retlw 0x0000 retlw 0x002B retlw 0x0055 retlw 0x00AA retlw 0x007F retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x0051 retlw 0x0001 retlw 0x0001 retlw 0x0001 retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF retlw 0x00FF ;-------------------------------; END