Hallo, ich versuche gerade den Umstieg von AVR's auf PIC's. ALs Entwicklungsumgebung nutze ich MPLAB und als Sprache Assembler. Als Einstieg habe ich mir verschiedene Beispielcodes aus dem Netz gesucht und habe die versucht zu compilieren und zu simulieren. Allerdings erhalte ich immer die Fehlermeldung "CORE-E0002: Stack under flow error occurred from instruction at 0x000004". Vielleicht kann mir da jemand helfen und sagen, was ich falsche mache? Vielen Dank im voraus. lg Torsten
Also das ist wie gesagt ein Beispielcode von Microchip selbst.
[c]
list p=12F509 ; list directive to define processor
#include <p12F509.inc> ; processor specific variable
definitions
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _IntRC_OSC
; '__CONFIG' directive is used to embed configuration word 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.
;***** VARIABLE DEFINITIONS
TEMP_VAR UDATA
temp RES 1 ;example variable definition
;**********************************************************************
RESET_VECTOR CODE 0x3FF ; processor reset vector
; Internal RC calibration value is placed at location 0x3FF by Microchip
; as a movlw k, where the k is a literal value.
MAIN CODE 0x000
movwf OSCCAL ; update register with factory cal value
start
nop ; example code
movlw 0xFF ; example code
movwf temp ; example code
; remaining code goes here
END ; directive 'end of program'
[\c]
lg Torsten
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.