PDA

View Full Version : Error Compiling with PbP 3



srspinho
- 1st July 2015, 00:41
Hello Guys !

Finally, I got my PbP 3 License last week.

I have just installed it in my notebook and tryed to compile an old source code designed for 16F877A.

My source code is using the Darrell's interrupts, lcdbar and some other resources.

As I define a new @ __CONFIG on my source code, I commented a line on the .INC file on my old 2.46 version to avoid the error : overwriting previous address contents (2007)

Now, I´m trying to compile the same source code on my PbP 3 and MPASMX.

The error showed up again, of course, because I did not edit the new inc file.

Following the advice Henrik Olsson gave on the post bellow :


http://support.melabs.com/archive/index.php/t-1065.html?

My original code :



@ ERRORLEVEL -306 ; Retira o erro de crossing page boundary
@ __CONFIG _CP_OFF & _DEBUG_OFF & _CP_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC


Include "LCDbar_INC.bas"
Include "DT_INTS-14.bas" ' Base Interrupt System
Include "ReEnterPBP.bas" ' Include if using PBP interrupts

define OSC 4


When I compile, I get the overwriting previous address contents (2007) error, because we have two __CONFIG on ASM.

So, I put the #CONFIG / ENDCONFIG in the code , like this :




#CONFIG
@ ERRORLEVEL -306 ; Retira o erro de crossing page boundary
@ __CONFIG _CP_OFF & _DEBUG_OFF & _CP_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC
#ENDCONFIG

Include "LCDbar_INC.bas"
Include "DT_INTS-14.bas" ' Base Interrupt System
Include "ReEnterPBP.bas" ' Include if using PBP interrupts

define OSC 4 l


Now, when I compile, I get the errors :

[ASM ERRORS] COMPB.ASM (29) : Illegal label (@)
[ASM ERRORS] COMPB.ASM (30) : Illegal label (@)

I would not like to edit the INC files anymore.

So, could someone, please, help me ?

Is there a specific place where I have to put the #CONFIG... block on the code ?

Thank you very much

Sérgio

Tabsoft
- 1st July 2015, 02:39
Try this link about meConfig (http://support.melabs.com/forums/22-meCONFIG).

HenrikOlsson
- 1st July 2015, 06:14
You didn't follow my advice from the other thread....
When you use the #CONFIG/#ENDCONFIG block you can't also have the @ in there and you can only set the CONFIG bits with it, you can't include the error lever stuff within the block. So, the original

@ ERRORLEVEL -306 ; Retira o erro de crossing page boundary
@ __CONFIG _CP_OFF & _DEBUG_OFF & _CP_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC

Becomes


@ ERRORLEVEL -306 ; Retira o erro de crossing page boundary
#CONFIG
__CONFIG _CP_OFF & _DEBUG_OFF & _CP_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC
#ENDCONFIG

/Henrik.

srspinho
- 1st July 2015, 14:39
Thank you Henrik and TabSoft !

I will test it today !

My best regards.

Sérgio Pinheiro

srspinho
- 2nd July 2015, 14:54
Hy Guys !

thank you for the tips. It worked !

My best regards.

Sérgio

fratello
- 1st June 2017, 11:28
Hi !
For me the solution don't work ? Any others sugestions ? Thanks !
8414

HenrikOlsson
- 1st June 2017, 11:40
It doesn't work for you because you have not applied the solution. Read the thread again.

/Henrik.

fratello
- 1st June 2017, 12:12
Thanks for fast reply !
But ... I don't understand what I do wrong :( ...
I wrote :

@ ERRORLEVEL -306
#CONFIG
__CONFIG _XT_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _BODEN_ON & _LVP_OFF & _CP_ON
#ENDCONFIG
Exactly like in post #3.
8415

HenrikOlsson
- 1st June 2017, 12:25
But that's not the same code - or error - as in your previous post now, is it?
Now you've fixed the "Overwrting previous address" error and you're facing a completely different issue.

First try commenting out the Include statement to see if the problem is within that piece of code.
Then please post the code, within code tags, so we don't have to retype it and make our own errors.

/Henrik.

fratello
- 1st June 2017, 12:39
No change !
8416


@ ERRORLEVEL -306
#CONFIG
__CONFIG _XT_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _BODEN_ON & _LVP_OFF & _CP_ON
#ENDCONFIG

;INCLUDE "D:\PBP\ALLDIGITAL.PBP"
DEFINE OSC 4 ' 4MHz
CMCON = 7 ' Disable on-chip comparator, PORTA in digital mode

TRISA = %00011100
PORTA = %00011100
TRISB = %00000000
PORTB = %00000000

oldState VAR BYTE
newState VAR BYTE
status_1 VAR BYTE
status_2 VAR BYTE
status_3 VAR BYTE
DIR VAR Byte
j var byte
BitCount VAR BYTE ' Index variable for above array
i VAR BYTE ' General purpose

dir = 2
Main:
PortA.1 = 0
newState = PortA & %00011100 ; this is for my hw : 11100 = 28
PortA.1 = 1

HenrikOlsson
- 1st June 2017, 13:21
You seem to have the 628 selected in one of the screenshots, and the 628A in the other.
Which device is teh code INTENDED for and which device do you have selected in the dropdown list?

/H.

fratello
- 1st June 2017, 13:48
Sorry, is 16F628A !
8417

HenrikOlsson
- 1st June 2017, 13:56
Well, then there must be some hidden character in there because if I copy/paste the code from post #10 above and compile it for a 16F628A it works just fine.

pedja089
- 1st June 2017, 16:10
Or you have version 2.6 or older...

HenrikOlsson
- 1st June 2017, 17:53
Surely THAT can't be it when the thread title is Error Compiling with PbP 3 located in the forum section called PBP3....or can it... :-)

fratello
- 1st June 2017, 20:02
Don't know how...but solved. Thanks !
8418