PDA

View Full Version : 18f + Debug



Beavis
- 12th December 2004, 03:37
GETTING DEBUG CANNOT BE REDEFINED DURING COMPILE, ANY IDEAS?

PicBasic Pro Compiler 2.45, (c) 1998, 2004 microEngineering Labs, Inc.
All Rights Reserved.
Error[115] C:\PBP\PBPPIC18.LIB 1524 : Duplicate label ("DEBUG" or redefining symbol that cannot be redefined)


ITS A BARE MINIMUM PROGRAM TO JUST CHECK IF DEBUG WORKS.........WICH IT DOES NOT.

mister_e
- 12th December 2004, 10:46
can you just post the header of your program (fuses,define, declare) Sure it's not a big problem...

Beavis
- 12th December 2004, 18:45
ASM
__CONFIG 0X300001, 0X38
__CONFIG 0X300002, 0XFF
__CONFIG 0X300003, 0X00
__CONFIG 0X300005, 0X01
__CONFIG 0X300006, 0X00
__CONFIG 0X300008, 0X0F
__CONFIG 0X300009, 0XC0
__CONFIG 0X30000A, 0X0F
__CONFIG 0X30000B, 0XE0
__CONFIG 0X30000C, 0X0F
__CONFIG 0X30000D, 0X40
ENDASM

DEFINE OSC 4

TRISA=%00000000
TRISB=%00000000
TRISC=%11111111
TRISD=%00000000
TRISE=%11111111

DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 6
DEFINE DEBUG_BAUD 2400
DEFINE DEBUG_MODE 1
DEFINE DEBUG_PACING 10

LOOP:

PORTA.1=1
PAUSE 50
PORTA.1=0
PAUSE 50

DEBUG "WORKS?"

GOTO LOOP


END


the entire program, oh btw it works with "listed" supported 18f processors, and im using a 18f4620, not in the list, so i guess thats limited support for that processor. So I take it the the statement of "all microchip processors supported" is a bit of a mis-statement....

Bruce
- 13th December 2004, 00:34
This error appears to be Microchips fault. Not MeLabs. DEBUG is a library command in the PBP 18F library, BUT, it's also defined as a register in the P18F4620.INC file Microchip provides with MPLAB.

The error is because you can't *re-define* DEBUG.

Open your P18F4620.INC file in your MPLAB directory.

Comment this line out --> DEBUG EQU H'0FD4'. Save, exit, you should be in business.

For some odd reason Microchip thinks this 18F series has a DEBUG register at location 0FD4h tucked away between OSCCON & T0CON.

Unless I'm missing something, my 4620 datasheet shows this particular register address as "unused".

I found the same deal in the 2525/2620/4525/4620 .INC files shipped with MPLAB. Go figure..!

Beavis
- 13th December 2004, 01:15
hot damn!, if i was gay id kiss you! lol. Ive got alot to learn. BTW, why isnt microchip working a little closer with melabs, seems you guys know thier product better than they do :)

mister_e
- 13th December 2004, 01:34
hehe, those compiler error are mostely due to the default settings in the .inc files. Try define all config fuses in a 18F452 or elses... you'll get ERROR 118...overwriting previous address bla bla bla.

Once you visit melabs website, on all folder, you'll find a link like this

http://microengineeringlabs.com/support/config_defaults.htm

again refering to the .inc file. So for my purpose/use i decide to comment all default setting in the .inc files i currently use. So now i have the full control of the PIC and. of course, avoid compilation errors.


why isnt microchip working a little closer with melabs, seems you guys know thier product better than they do

They assume that everybody read/understand the default setting in .inc files. They also assume that everything is clear with those ERRORs message... not my point of view but once you know to what it refer, it's easy to debug/understand.

IMO they never working closer with Melabs... with the new MPLAB (6.62 or 7(not sure for this one..still not install on my machine)) the PicBasic Pro toolsuite language is not include as in the past. You must go to the Melabs website to get the patch. Why??? i don't know.

Beavis
- 15th December 2004, 20:11
hmmmz, debug still wont work, although no compile errors