I'm having trouble in MPLab Sim. I've written a small program to see if I have grasped some of the theory behind the programming language. Everytime I try to debug/simulate it, it gives the error: "CORE-E0002: Stack under flow error occurred from instruction at 0x000005".
Can someone look at the program and see where I'm messing up? I've got it assigned to program a 16F628A. I've got the watch window open and viewing the data on PORTA, and that's really all that the program is supposed to do is make the PORTA data go 0000 > 0001 > 0011 then repeat.
Thanks,
Joe
;**********************************************************************
; *
; Files required: *
; 16F628A.lkr *
; *
; *
;**********************************************************************
list p=16F628A ; list directive to define processor
#include <p16F628A.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
__CONFIG _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT
;***** VARIABLE DEFINITIONS (examples)
PORTA EQU 05h
TRISA EQU 85h
;**********************************************************************
MAIN CODE
main
;******SETUP PORTA******
BSF STATUS, 5
MOVLW 00H
MOVWF TRISA
BCF STATUS, 5
START BSF PORTA, 0
BSF PORTA, 1
BSF PORTA, 2
MOVLW 00h
MOVWF PORTA
GOTO START
END ; directive 'end of program'
Can someone look at the program and see where I'm messing up? I've got it assigned to program a 16F628A. I've got the watch window open and viewing the data on PORTA, and that's really all that the program is supposed to do is make the PORTA data go 0000 > 0001 > 0011 then repeat.
Thanks,
Joe
;**********************************************************************
; *
; Files required: *
; 16F628A.lkr *
; *
; *
;**********************************************************************
list p=16F628A ; list directive to define processor
#include <p16F628A.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
__CONFIG _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT
;***** VARIABLE DEFINITIONS (examples)
PORTA EQU 05h
TRISA EQU 85h
;**********************************************************************
MAIN CODE
main
;******SETUP PORTA******
BSF STATUS, 5
MOVLW 00H
MOVWF TRISA
BCF STATUS, 5
START BSF PORTA, 0
BSF PORTA, 1
BSF PORTA, 2
MOVLW 00h
MOVWF PORTA
GOTO START
END ; directive 'end of program'