Ahhhhhhhh no puede ser, ahora lo paso a un PIC16F84A y las INTs nuevamente no funcionan, ME VOY A VOLVER LOCOOOOOOOO, el codigo queda asi donde estara la falla???
;**********************************************************************
list p=16F84A ; list directive to define processor
#include <p16F84A.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;********REG USO GENERAL********************************************
w_temp EQU 0C
status_temp EQU 0D
PDel0 EQU 0E
PDel1 EQU 0F
ESTADO EQU 10
TEMPO_INTEN EQU 11
TEMPO EQU 12
PCLATH_TEMP EQU 13
ON EQU 0
STAR EQU 1
GUN EQU 3
OK EQU 4
CHG EQU 0
reset org 0
goto MAIN ;vaya al inicio
org 4 ;aqui viene la Interrupcion
goto INT ;vaya a atender las INT
;********************ATENCION A LAS INTERRUPCIONES*****************************
INT movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
BTFSC INTCON,0
GOTO MARCAR ;SE ACTIVO LA INT TMR0
GOTO SAL_INT
MARCAR BSF ESTADO,CHG ;MARCO CAMBIO
SAL_INT movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
BCF INTCON,0 ;BORRO FLAG
retfie ; return from interrupt
;**********************FIN ATENCION DE LAS INTERRUPCIONES**************************************************
MAIN BSF STATUS,5 ;BANCO 1
MOVLW 0X00
MOVWF TRISA ;Salidas
MOVLW 0XFF
MOVWF TRISB ;Entradas
MOVLW 0X80
MOVWF OPTION_REG ;SIN RBPULL
BCF STATUS,5 ;BANCO 0
CLRF PORTA
BCF ESTADO,CHG
CALL DEMORA
CALL DEMORA
CALL DEMORA ;ESPERO 600 mS PARA ESTABILIZAR VCC
MOVLW 0X88
MOVWF INTCON ;HABILI INTs PORTB
GOTO ACCIONAR
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%SUBRUTINA ACCIONAR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ACCIONAR SWAPF PORTB,0 ;CARGO ENTRADAS Y COLOCO EN BITS DE MENOR PESO
ANDLW 0X03 ;BORRO LOS 6 BITS DE MAYOR PESO
ADDWF PCL,1
GOTO OFF_TOTAL
GOTO ARRANCAR
GOTO NO_OPERE
GOTO ON_REPOSO
;*****************************************
OFF_TOTAL BCF PORTA,ON ;APAGO TODO FIN DE TODO
BCF PORTA,STAR
BCF PORTA,GUN
BCF ESTADO,CHG
GOTO LOOP
;*****************************************
ARRANCAR MOVLW .5
MOVWF TEMPO_INTEN
LOOP_INI BSF PORTA,ON ;ENCIENDO PLANTA
BSF PORTA,STAR ;INICIO ARRANQUE 2.5 SEGUNDOS
BSF PORTA,GUN
MOVLW .15
MOVWF TEMPO
LOOP_ST1 CALL DEMORA
DECFSZ TEMPO,1
GOTO LOOP_ST1
BCF PORTA,STAR ;APAGO ARRANQUE Y ESPERO 1SEG
BCF PORTA,GUN
MOVLW .15
MOVWF TEMPO
LOOP_ST2 CALL DEMORA
DECFSZ TEMPO,1
GOTO LOOP_ST2
DECFSZ TEMPO_INTEN,1
GOTO LOOP_INI
BCF PORTA,ON ;TERMINARON LOS 5 INTENTOS, EXISTE FALLO DE ARRANQUE APAGO TODO Y DOY ALARMA
BCF ESTADO,CHG
GOTO FALL_STAR
FALL_STAR CLRF INTCON
BCF PORTA,OK
CALL DEMORA ;LED INDICANDO FALLO DE ARRANQUE
BSF PORTA,OK
CALL DEMORA
GOTO FALL_STAR
;***************************************************************************************************************************
NO_OPERE BCF PORTA,ON
BCF PORTA,STAR
BCF PORTA,GUN
BCF ESTADO,CHG
GOTO LOOP
;***************************************************************************************************************************
ON_REPOSO BSF PORTA,ON
BCF PORTA,STAR
BCF PORTA,GUN
BCF ESTADO,CHG
GOTO LOOP
;***************************************************************************************************************************
LOOP BCF PORTA,OK
CALL DEMORA
CALL DEMORA
CALL DEMORA
BSF PORTA,OK
BTFSC ESTADO,CHG
CALL ACCIONAR
CALL DEMORA
CALL DEMORA
CALL DEMORA
CALL DEMORA
CALL DEMORA
BTFSC ESTADO,CHG
CALL ACCIONAR
GOTO LOOP
;***************************************************************************************************************************
;-----------------------RUTINA DE DEMORA 200mSEG------------------------------------
DEMORA movlw .156 ; 1 set numero de repeticion (B)
movwf PDel0 ; 1 |
PLoop1 movlw .213 ; 1 set numero de repeticion (A)
movwf PDel1 ; 1 |
PLoop2 clrwdt ; 1 clear watchdog
PDelL1 goto PDelL2 ; 2 ciclos delay
PDelL2
decfsz PDel1, 1 ; 1 + (1) es el tiempo 0 ? (A)
goto PLoop2 ; 2 no, loop
decfsz PDel0, 1 ; 1 + (1) es el tiempo 0 ? (B)
goto PLoop1 ; 2 no, loop
PDelL3 goto PDelL4 ; 2 ciclos delay
PDelL4 clrwdt ; 1 ciclo delay
return ; 2+2 Fin.
;-----------------------------------------------------------------------------------
END ; directive 'end of program'