PDA

View Full Version : 18F4550 compiles, 18F4620 does not



BrianT
- 19th September 2007, 07:57
The following trivial code compiles if I select 18F4550 via the MCS+ 3.0.0.0 drop down box.
I have tried PBPL ver 2.50 and PBPW ver 2.47.

If I select the 18F4620 I get
Error [115] c:\pbp247\pbppi18.lib 1529 : Duplicate label ("DEBUG" or redefining symbol that cannot be redefined)

There are almost identical messages with PBPW and PBPL. Only the c:\...... varies.

Anyone got any ideas?

Cheers
Brian

''************************************************ ****************
''* Name : Test 18F4620.PBP *
''* Author : Brian Taylor *
''* Notice : Copyright (c) 2007 Brian Taylor *
''* : All Rights Reserved *
''* Date : 18 SEP 2007 *
''* Version : 4.00 *
''* Notes : *
''* : *
''************************************************ ****************

'' ************************ Defines *****************************
DEFINE osc 4 '
DEFINE Loader_Used 1
DEFINE DEBUG_REG PORTC 'Debug pin port
DEFINE DEBUG_BIT 6 'Debug pin bit
DEFINE DEBUG_BAUD 19200 'Debug baud rate
DEFINE DEBUG_MODE 0 'Debug mode: 0 = True, 1 = Inverted


A var byte
B var byte


ShowRevStatus: ' zzzzz remove in runtime version
pause 50
debug $0D, $0A
for a = 2 to 42
read a,b
debug b
next a
debug $0D, $0A

Bruce
- 19th September 2007, 08:05
Open and edit the Microchip header file P18F4620.INC. Comment out DEBUG, and save the
file. That will get rid of the error.

LVDCON EQU H'0FD2'
OSCCON EQU H'0FD3'
; DEBUG EQU H'0FD4' ; <--- comment this out & save
T0CON EQU H'0FD5'
TMR0L EQU H'0FD6'

BrianT
- 20th September 2007, 00:06
Thank you Bruce and Jeff Schmoyer.

Thank you Jeff for the prompt personal reply.

Bruce's comment above is exactly right and does fix the problem. I must say I usually regard the xxx.inc files as sacred and not to be messed with by amateurs like me.

This is what I did.

I went to c:\mpasm\p18f4620.inc and saved a copy.
I opened c:\mpasm\p18f4620.inc and a couple of pages into the file, at the first instance of the word "DEBUG" I commented out the line with a semi-colon.

OSCCON EQU H'0FD3'
; DEBUG EQU H'0FD4'
T0CON EQU H'0FD5'


Cheers
Brian