Hi everyone,
I'm making a project, and i've read something about resolving some issue with stacks underflow. could someone help me with this one?
I get one stack underflow after getting back from an interruption with the pic16F877, this is the code:
INT
BTFSS INTCON,INTF
GOTO BACK
MOVF DEMORA,W ; Valor de demora para el TRIAC
MOVWF TMR0
CLRF PORTA
WAIT
BTFSS INTCON,T0IF
GOTO WAIT ; ESPERO EL DESBORDE DE TMR0 ENCUESTANDO LA BANDERA DE TMR0
BCF INTCON,T0IF ; LIMPIO LA BANDERA
MOVLW B'00000010'; DISPARO LOS TRIACS
MOVWF PORTB
BSF 3,5
BTFSS OPTION_REG,INTEDG
GOTO SETTING
BCF OPTION_REG,INTEDG
BCF 3,5
GOTO BACK
SETTING
BSF OPTION_REG,INTEDG
BCF 3,5
BACK
BCF INTCON,INTF
RETFIE
Thank you for your help!
I'm making a project, and i've read something about resolving some issue with stacks underflow. could someone help me with this one?
I get one stack underflow after getting back from an interruption with the pic16F877, this is the code:
INT
BTFSS INTCON,INTF
GOTO BACK
MOVF DEMORA,W ; Valor de demora para el TRIAC
MOVWF TMR0
CLRF PORTA
WAIT
BTFSS INTCON,T0IF
GOTO WAIT ; ESPERO EL DESBORDE DE TMR0 ENCUESTANDO LA BANDERA DE TMR0
BCF INTCON,T0IF ; LIMPIO LA BANDERA
MOVLW B'00000010'; DISPARO LOS TRIACS
MOVWF PORTB
BSF 3,5
BTFSS OPTION_REG,INTEDG
GOTO SETTING
BCF OPTION_REG,INTEDG
BCF 3,5
GOTO BACK
SETTING
BSF OPTION_REG,INTEDG
BCF 3,5
BACK
BCF INTCON,INTF
RETFIE
Thank you for your help!