Estoy realizando un decodificador en mplab con el microcontrolador PIC16F628A pero al momento de cargar el código en proteus me empieza a salir el mismo error una y otra vez "[PIC16 CORE] PC=0x07F3. Stack overflow executing CALL instruction. [U1]" ya cheque y al modificar algunas partes del código se ponen números al azar pero no decodifica del 0 al 9 como debería adjunto el código que elaboré:
PROCESSOR 16F628A ;Declarar pic que se ocupara
#include <xc.inc> ;Declarar librerias
; CONFIG
CONFIG FOSC = INTOSCIO ; Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN)
CONFIG WDTE = OFF ; Watchdog Timer Enable bit (WDT disabled)
CONFIG PWRTE = OFF ; Power-up Timer Enable bit (PWRT disabled)
CONFIG MCLRE = ON ; RA5/MCLR/VPP Pin Function Select bit (RA5/MCLR/VPP pin function is digital input, MCLR internally tied to VDD)
CONFIG BOREN = OFF ; Brown-out Detect Enable bit (BOD disabled)
CONFIG LVP = OFF ; Low-Voltage Programming Enable bit (RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming)
CONFIG CPD = OFF ; Data EE Memory Code Protection bit (Data memory code protection off)
CONFIG CP = OFF
PSECT udata_bank0
W_TEMP: DS 0
; 1 byte=8bites
PSECT CODIGO, class = CODE, delta=2
Inicio:
CLRF PORTA
MOVLW 07H; 00001111
MOVWF CMCON ; Habilitar entradas y salidas (input's,Output's) digitales
BSF STATUS,05H; 00100000B
BCF STATUS,06H; mover al banco 1
MOVLW 00001111B
MOVWF TRISA
CLRF TRISB
BCF STATUS,05H
CLRF PORTB
PRINCIPAL:
MOVF PORTA,0
ANDLW 0FH
MOVWF W_TEMP
MOVLW 0AH
SUBWF W_TEMP,0
BTFSS CARRY
GOTO $+03H
MOVLW 09H
MOVWF W_TEMP
MOVF W_TEMP,0
CALL TABLA
MOVWF PORTB
GOTO PRINCIPAL
TABLA:
ADDWF PCL,1
RETLW 00111111B;0
RETLW 00000110B;1
RETLW 01011011B;2
RETLW 01001111B;3
RETLW 01100110B;4
RETLW 01101101B;5
RETLW 01111101B;6
RETLW 00000111B;7
RETLW 01111111B;8
RETLW 01100111B;9
END
El esquemático del proyecto sería el siguiente, donde se decodifican los bits en el display gracias a un dip switch