assembly proteus hatası.

Başlatan kerem, 14 Mayıs 2023, 21:49:51

kerem

[PIC16 LOAD] Program or EEPROM data has invalid address [2002] for this device [U1]

mrb arkadaşlar ben proteusta bu hatayı alıyorum led yakma işlemini bile yapamayorum sürekli bu hatayı veriyor. daha önce böyle bir hatayla karşılaşan var mı bir türlü ilerleyemedim teşekker ederim.

kodu aşağıda veriyorum

    PROCESSOR 16F887
    INCLUDE P16F887.INC
    RADIX DEC
    __IDLOCS H'0100'
    __CONFIG _CONFIG1,H'2400';9216
    __CONFIG _CONFIG2,H'38FF';14591
; missing constants

ZERO    EQU Z    ; ZERO-Flag
CARRY    EQU C    ; CARRY-Flag
SYSTICKS    EQU    7750

; variable

SYS_SSAV    EQU 32    ; located in BANK 0
SYS_PSAV    EQU 33    ; located in BANK 0
SYS_WSAV    EQU 127    ; located in BANK 0, 1, 2, 3

; disable warning for Bankswitching
    ERRORLEVEL -302
; disable warning for Pageswitching
    ERRORLEVEL -306

;------------------------------------------------------------------------------
; Program start
;------------------------------------------------------------------------------
    ORG 0

    NOP
    BCF PCLATH,3    ; Page 0
    BCF PCLATH,4    ; Page 0
    GOTO SYS_INIT

    RETURN
;------------------------------------------------------------------------------
; Subroutines
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
; Initialisation
;------------------------------------------------------------------------------

SYS_INIT

    CLRF STATUS    ; 0 -> f
    CLRF INTCON    ; 0 -> f

; A/D off
    MOVLW 0
    MOVWF ADCON1
    CLRF ANSEL    ; 0 -> f
    CLRF ANSELH    ; 0 -> f


; Set output before direction

    MOVLW B'00000000'
    MOVWF PORTA

    MOVLW B'00000001'
    MOVWF PORTB

    MOVLW B'00000000'
    MOVWF PORTC

    MOVLW B'00000000'
    MOVWF PORTD

    MOVLW B'00000000'
    MOVWF PORTE

; set direction

    MOVLW B'11111111'
    MOVWF TRISA

    MOVLW B'11111110'
    MOVWF TRISB

    MOVLW B'11111111'
    MOVWF TRISC

    MOVLW B'11111111'
    MOVWF TRISD

    MOVLW B'00001111'
    MOVWF TRISE


; init some registers

; Timer 0
    MOVLW 143
    MOVWF OPTION_REG

;------------------------------------------------------------------------------
; Clear RAM
;------------------------------------------------------------------------------

; Clear from $020 to $06F

    MOVLW 32
    MOVWF FSR
    BCF STATUS,IRP

SYSClearRAM1

    CLRF INDF    ; 0 -> f
    INCF FSR,F    ; f + 1 -> f
    MOVLW 112
    SUBWF FSR,W    ; f - W -> W
    BTFSS STATUS,ZERO
    GOTO SYSClearRAM1

;------------------------------------------------------------------------------

; Clear from $070 to $07E

    MOVLW 112
    MOVWF FSR
    BCF STATUS,IRP

SYSClearRAM2

    CLRF INDF    ; 0 -> f
    INCF FSR,F    ; f + 1 -> f
    MOVLW 127
    SUBWF FSR,W    ; f - W -> W
    BTFSS STATUS,ZERO
    GOTO SYSClearRAM2

;------------------------------------------------------------------------------

; Clear from $0A0 to $0EF

    MOVLW 160
    MOVWF FSR
    BCF STATUS,IRP

SYSClearRAM3

    CLRF INDF    ; 0 -> f
    INCF FSR,F    ; f + 1 -> f
    MOVLW 240
    SUBWF FSR,W    ; f - W -> W
    BTFSS STATUS,ZERO
    GOTO SYSClearRAM3

;------------------------------------------------------------------------------

; Clear from $110 to $16F

    MOVLW 16
    MOVWF FSR
    BSF STATUS,IRP

SYSClearRAM4

    CLRF INDF    ; 0 -> f
    INCF FSR,F    ; f + 1 -> f
    MOVLW 112
    SUBWF FSR,W    ; f - W -> W
    BTFSS STATUS,ZERO
    GOTO SYSClearRAM4

;------------------------------------------------------------------------------

; Clear from $190 to $1EF

    MOVLW 144
    MOVWF FSR
    BSF STATUS,IRP

SYSClearRAM5

    CLRF INDF    ; 0 -> f
    INCF FSR,F    ; f + 1 -> f
    MOVLW 240
    SUBWF FSR,W    ; f - W -> W
    BTFSS STATUS,ZERO
    GOTO SYSClearRAM5

;------------------------------------------------------------------------------

; init vars


; enable interrupts

;------------------------------------------------------------------------------
; Main program
;------------------------------------------------------------------------------


MAIN


;------------------------------------------------------------------------------
; LG1
;------------------------------------------------------------------------------


LG1_1

    BTFSC PORTA,0
    GOTO LG1_TRUE


LG1_FALSE

    BSF PORTB,0
    GOTO LG1_END


LG1_TRUE

    BCF PORTB,0

LG1_END

;------------------------------------------------------------------------------
    GOTO MAIN
;------------------------------------------------------------------------------


    END

onurinci

__IDLOCS H'0100'

satırını kaldır bir daha derle

Powered by EzPortal