• AVR Freaks

AnsweredHot!Trouble with MPLAB X IDE

Author
Coldfire76
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2014/11/24 07:21:26
  • Location: 0
  • Status: offline
2020/07/01 08:41:21 (permalink)
0

Trouble with MPLAB X IDE

Hi Folks,
 
I´m recently working on a program with an 12LF1552 and have problems compiling.
 
My System:
Win 10 Pro
MPLAB X IDE v5.35
mpasm V5.87
PICKit3
self-built ICSP-adapter
 
Can reach the MCU and blank chek it. No probs here.
But when I try to compile my code I get the folowing error:
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/Andre/Desktop/Projekt/Dimmer.X'
make -f nbproject/Makefile-default.mk dist/default/debug/Dimmer.X.debug.cof
make[2]: Entering directory 'C:/Users/Andre/Desktop/Projekt/Dimmer.X'
make[2]: *** [nbproject/Makefile-default.mk:122: dist/default/debug/Dimmer.X.debug.cof] Error 1
"C:\Program Files (x86)\Microchip\MPLABX\v5.35\mpasmx\mplink.exe" -p12lf1552 -w -x -u_DEBUG -z__ICD2RAM=1 -m"dist/default/debug/Dimmer.X.debug.map" -z__MPLAB_BUILD=1 -z__MPLAB_DEBUG=1 -z__MPLAB_DEBUGGER_SIMULATOR=1 -odist/default/debug/Dimmer.X.debug.cof build/default/debug/Dimmer.o build/default/debug/Dimmer.o
MPLINK 5.09, LINKER
Device Database Version 1.50
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - mutliple inclusion of object file 'build/default/debug/Dimmer.o'
Errors : 1

make[2]: Leaving directory 'C:/Users/Andre/Desktop/Projekt/Dimmer.X'
make[1]: *** [nbproject/Makefile-default.mk:91: .build-conf] Error 2
make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2
make[1]: Leaving directory 'C:/Users/Andre/Desktop/Projekt/Dimmer.X'

BUILD FAILED (exit value 2, total time: 209ms)

As i expect the question will be my code, here it is:
 ; ***********************************************
 ; * Dimmer mit 12LF1552 und Incrementalgeber *
 ; * André Nußmann (Coldfire1976@googlemail.com) *
 ; * Version 1.0 *
 ; * 06/2020 *
 ; ***********************************************
 ;
 ; *** Header *************************************************************
 LIST p = PIC12LF1552
 #INCLUDE
 ;
 ; #INCLUDE <MY_STD.MAC> ; Standardmakros inkludieren
 ; #INCLUDE ; Besonder Macros inkludieren
 ;
 ; *** Config Bits *******************************************************
 __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_OFF & _CLKOUTEN_OFF
 __CONFIG _CONFIG2, _WRT_OFF & _STVREN_OFF & _BORV_HI & _LPBOR_ON & _LVP_ON
 ;
 ; *** Konstanten ********************************************************
 ORG 0
#define Puls 03h ;Pulsbreite
#define PulsCnt 85h ;Zaehler Pulsbreite
#define PauseCnt 86h ;Zaehler Pulspause
#define LED 99h ;PortA Ausgang LED
 ;

 ; *** PortA konfigurieren
 BANKSEL PORTA ;Bank 0
 CLRF PORTA ;PORTA nullen
 BANKSEL LATA ;Bank2
 CLRF LATA ;Data Latch nullen
 BANKSEL ANSELA ;Bank3
 CLRF ANSELA ;Analog Select nullen
 BANKSEL TRISA ;Bank1
 MOVLW B'00111000' ;RA sind Eingaenge
 MOVWF TRISA ;RA sind Ausgaenge
 ;
 ; *******************************
 ; * RA0 = Dimmer Ausgang *
 ; * RA3 = Inkerementalgeber auf *
 ; * RA5 = Inkrementalgeber ab *
 ; *******************************
 ;
 ; *** Subroutine *****************************************************
PulsBreite
 BSF PORTA,RA0 ;Pin RA0 einschalten
 DECFSZ PulsCnt ;PulsCnt runterzaehlen, falls 0 naechste Zeile überspringen
 GOTO $-1 ;Ruecksprung in vorherige Zeile
 BSF PORTA,RA0 ;Pin RA0 ausschalten
 DECFSZ PauseCnt ;PauseCnt runterzaehlen, falls 0 naechste Zeile ueberspringen
 GOTO $-1 ;Ruecksprung in vorherige Zaehler
 RETURN;
; ***
GeberLesen
 BTFSC PORTA,RA3 ;RA3 einlesen
 INCF PulsCnt ;Zaehler inkrementieren
 BTFSC PORTA,RA5 ;RA5 einlesen
 DECFSZ PulsCnt ;Zaehler dekrementieren, ausser bei 0
 RETURN
;***
;
; *** Start of Program Memory *******************************************
START
  ;CALL PulsBreite
   CALL GeberLesen
   GOTO 0x00
 END

 
Have selected mpasm in toolchain and selected the right processor, can´t find the issue here :(
 
Thanks for Your help in advance !!
#1
crennolet
Super Member
  • Total Posts : 202
  • Reward points : 0
  • Joined: 2012/03/15 09:51:58
  • Location: 0
  • Status: offline
Re: Trouble with MPLAB X IDE 2020/07/01 10:50:33 (permalink) ☼ Best Answerby Coldfire76 2020/07/01 23:45:18
+1 (1)
What I see is: "Error - mutliple inclusion of object file 'build/default/debug/Dimmer.o'"
 
Your problem is with your project, not with your code, it seems. Look at your project in the left-hand pane and see if there are multiple places where "Dimmer" appears.
#2
Mark Yampolsky
Super Member
  • Total Posts : 122
  • Reward points : 0
  • Joined: 2009/04/03 18:50:36
  • Location: Russia Fryazino Moskow reg
  • Status: offline
Re: Trouble with MPLAB X IDE 2020/07/01 11:12:23 (permalink) ☄ Helpfulby Coldfire76 2020/07/04 01:31:51
+3 (3)
Coldfire76
 
As i expect the question will be my code, here it is:
 ; ***********************************************
; * Dimmer mit 12LF1552 und Incrementalgeber *
; * André Nußmann (Coldfire1976@googlemail.com) *
; * Version 1.0 *
; * 06/2020 *
; ***********************************************
;
; *** Header *************************************************************
LIST p = PIC12LF1552
#INCLUDE   <<<<<<<  What is it?
;
; #INCLUDE <MY_STD.MAC> ; Standardmakros inkludieren
; #INCLUDE ; Besonder Macros inkludieren
;
; *** Config Bits *******************************************************
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_OFF & _CLKOUTEN_OFF
__CONFIG _CONFIG2, _WRT_OFF & _STVREN_OFF & _BORV_HI & _LPBOR_ON & _LVP_ON
;
; *** Konstanten ********************************************************
ORG 0   <<<< this is the start address of the flash
#define Puls 03h ;Pulsbreite
#define PulsCnt 85h ;Zaehler Pulsbreite
#define PauseCnt 86h ;Zaehler Pulspause
#define LED 99h ;PortA Ausgang LED
;

; *** PortA konfigurieren
BANKSEL PORTA ;Bank 0     <<<< performance starts from here
CLRF PORTA ;PORTA nullen
BANKSEL LATA ;Bank2
CLRF LATA ;Data Latch nullen
BANKSEL ANSELA ;Bank3
CLRF ANSELA ;Analog Select nullen
BANKSEL TRISA ;Bank1
MOVLW B'00111000' ;RA sind Eingaenge
MOVWF TRISA ;RA sind Ausgaenge
;
; *******************************
; * RA0 = Dimmer Ausgang *
; * RA3 = Inkerementalgeber auf *
; * RA5 = Inkrementalgeber ab *
; *******************************
;
; *** Subroutine *****************************************************
PulsBreite
BSF PORTA,RA0 ;Pin RA0 einschalten
DECFSZ PulsCnt ;PulsCnt runterzaehlen, falls 0 naechste Zeile überspringen
GOTO $-1 ;Ruecksprung in vorherige Zeile
BSF PORTA,RA0 ;Pin RA0 ausschalten
DECFSZ PauseCnt ;PauseCnt runterzaehlen, falls 0 naechste Zeile ueberspringen
GOTO $-1 ;Ruecksprung in vorherige Zaehler
RETURN;   <<<< the stack will be destroyed here
; ***
GeberLesen
BTFSC PORTA,RA3 ;RA3 einlesen
INCF PulsCnt ;Zaehler inkrementieren
BTFSC PORTA,RA5 ;RA5 einlesen
DECFSZ PulsCnt ;Zaehler dekrementieren, ausser bei 0
RETURN
;***
;
; *** Start of Program Memory *******************************************
START    <<<<< the code will never get here
 ;CALL PulsBreite
  CALL GeberLesen
  GOTO 0x00
END

read comments in code
post edited by Mark Yampolsky - 2020/07/01 12:16:15
#3
Coldfire76
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2014/11/24 07:21:26
  • Location: 0
  • Status: offline
Re: Trouble with MPLAB X IDE 2020/07/01 23:52:00 (permalink)
0
@ crennolet : Thanks, will check this by creating a new project with another name and inserting the code.
 
@ Mark Yampolsky: Thanks for the advice, I was quite sure the code wasn´t working. Seems I copy-pasted too much and destroyed much of the original code LoL: LoL
#4
Jams100001
Junior Member
  • Total Posts : 91
  • Reward points : 0
  • Joined: 2018/04/12 13:37:33
  • Location: MCHP Chandler
  • Status: offline
Re: Trouble with MPLAB X IDE 2020/07/02 12:17:21 (permalink) ☄ Helpfulby Coldfire76 2020/07/04 01:31:39
+1 (1)
Coldfire76,
The missing include <p12lf1552.inc> is one of the reasons the compile didn't work. two other issues with the code. the Subroutines I moved them after the main code. I also changed the goto 0x00 to goto START because you really only should run the configuration code once unless you are doing something fancy. 
 I compiled this code with no errors.
 
 ; ***********************************************
 ; * Dimmer mit 12LF1552 und Incrementalgeber (Dimmer with 12LF1552 and incremental encoder)*
 ; * André Nußmann (Coldfire1976@googlemail.com) *
 ; * Version 1.0 *
 ; * 06/2020 *
 ; ***********************************************
 ;
 ; *** Header *************************************************************
 LIST p = PIC12LF1552
 #INCLUDE <p12lf1552.inc>
 ;
 ; #INCLUDE <MY_STD.MAC> ; Standardmakros inkludieren (Include standard macro)
 ; #INCLUDE ; Besonder Macros inkludieren (Include special macros)
 ;
 ; *** Config Bits *******************************************************
 __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_OFF & _CLKOUTEN_OFF
 __CONFIG _CONFIG2, _WRT_OFF & _STVREN_OFF & _BORV_HI & _LPBOR_ON & _LVP_ON
 ;
 ; *** Konstanten (Constants)***************************************************
 ORG 0
#define Puls 03h ;Pulsbreite (Pulse width)
#define PulsCnt 85h ;Zaehler Pulsbreite (Counter pulse width)
#define PauseCnt 86h ;Zaehler Pulspause (Counter pulse pause)
#define LED 99h ;PortA Ausgang LED (PortA output LED)
 ;
 ; *** PortA konfigurieren
 BANKSEL PORTA ;Bank 0
 CLRF PORTA ;PORTA nullen
 BANKSEL LATA ;Bank2
 CLRF LATA ;Data Latch nullen
 BANKSEL ANSELA ;Bank3
 CLRF ANSELA ;Analog Select nullen
 BANKSEL TRISA ;Bank1
 MOVLW B'00111000' ;RA sind Eingaenge
 MOVWF TRISA ;RA sind Ausgaenge
 ;
 ; *******************************
 ; * RA0 = Dimmer Ausgang *
 ; * RA3 = Inkerementalgeber auf *
 ; * RA5 = Inkrementalgeber ab *
 ; *******************************

;
; *** Start of Program Memory *******************************************
START
  ;CALL PulsBreite
   CALL GeberLesen
   GOTO START
 ;
 ; *** Subroutine *****************************************************
PulsBreite
 BSF PORTA,RA0 ;Pin RA0 einschalten
 DECFSZ PulsCnt ;PulsCnt runterzaehlen, falls 0 naechste Zeile überspringen
 GOTO $-1 ;Ruecksprung in vorherige Zeile
 BSF PORTA,RA0 ;Pin RA0 ausschalten
 DECFSZ PauseCnt ;PauseCnt runterzaehlen, falls 0 naechste Zeile ueberspringen
 GOTO $-1 ;Ruecksprung in vorherige Zaehler
 RETURN;
; ***
GeberLesen
 BTFSC PORTA,RA3 ;RA3 einlesen
 INCF PulsCnt ;Zaehler inkrementieren
 BTFSC PORTA,RA5 ;RA5 einlesen
 DECFSZ PulsCnt ;Zaehler dekrementieren, ausser bei 0
 RETURN
;***
 END

Jamus
#5
Coldfire76
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2014/11/24 07:21:26
  • Location: 0
  • Status: offline
Re: Trouble with MPLAB X IDE 2020/07/04 01:31:33 (permalink)
0
Thanks Jamus,
 
compiled fine now with a new project.
The missing .inc is in old code, still had issues.
Even copy-pasting Your code to the original project left me with the same error.
Seems it has been a mixture of my bad coding and a damaged project.
 
Thanks again for all the help !!
#6
kiymik
Junior Member
  • Total Posts : 94
  • Reward points : 0
  • Joined: 2005/02/05 01:30:10
  • Status: offline
Re: Trouble with MPLAB X IDE 2020/07/13 08:42:27 (permalink)
0
I'm writing assembler, I had problems with v5.35 and switched to v5.20, assembled and debugged without problems. In v5.35 it was said that it has incompatibility issues with MPASM, instead suggesting to use XC8 assembler (that I couldn't succeed). My system is W7.
#7
Coldfire76
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2014/11/24 07:21:26
  • Location: 0
  • Status: offline
Re: Trouble with MPLAB X IDE 2020/07/13 10:06:59 (permalink)
0
Hello kiymik,
 
V5.35 is working fine for me now, had a broken projekt and some errors in my code.
Got it compiled and simulated fine, now.
 
 
#8
Jump to:
© 2020 APG vNext Commercial Version 4.5