; ZONA DE DATOS ********************************************************************** LIST P=16F88A processor 16f88 include #DEFINE Marcha PORTB,6 ; Interruptor de marcha. #DEFINE Sentido PORTB,7 ; Interruptor sentido de giro. ; ZONA DE CÓDIGOS ******************************************************************** ORG 0 CLRF PCLATH GOTO WEB WEB ORG 3 BCF STATUS,RP0 ;ELIJE EL BANCO0 bcf RCSTA,SPEN ;DESHABILITA UART BSF STATUS,RP0 ;ELIJE EL BANCO1 movlw 0x0 movwf CVRCON movlw 0x7 movwf CMCON ;EN BANCO 1 clrf ANSEL Inicio bsf STATUS,RP0 ;BANCO 1 movlw b'11000000' ; Configuramos el Puerto B. movwf PORTB bcf STATUS,RP0 ;BANCO 0 Principal clrw ; Con esta combinación se detiene el motor. btfsc Marcha ; Comprueba el estado del interruptor de funcionamiento. goto Salida movlw b'00010010' ; Gira en un sentido. btfsc Sentido ; Comprueba el sentido de giro deseado. movlw b'00010001' ; Gira en el otro sentido. Salida movwf PORTB goto Principal END